Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] Add Item to NPC [PHP Script]

Initiate Mage
Joined
Jan 9, 2009
Messages
0
Reaction score
424
Hi to all, i got idea from Hean and i made it :closedeyes:


PHP:
<?php
// Coded by HyperProCoders - CEZALAND
// www.HyperProCoders.com - www.RageZone.com

/* Connect To SQL - Edit Here */
$sqlhost            = "CEZALAND\HYPERPROCODERS";
$sqluser            = "vsro_shard";
$sqlpass            = "123456";
$sqldatabase        = "SRO_VT_SHARD";
$connect            = @mssql_connect($sqlhost, $sqluser, $sqlpass) or die("Cant connect to SQL");
$dbconnect            = @mssql_select_db($sqldatabase, $connect) or die("Cant connect to Database");
/* Connected.*/
/* Dont Touch ! */
    function TextFix($text)
    {
        $needfix         = array("\\\\");
        $fix             = array("\\");
        $fixed             = str_replace($needfix, $fix, $text);
        return $fixed;
    }
if(!$_POST)
{
    ?>
        <style>
        div.item
        {
            border: 1px solid #dadada;
            -webkit-border-radius: 3px;
            -moz-border-radius: 3px; 
            border-radius: 3px;
            padding: 5px;
        }
        input.input
        {
            border: 1px solid #dadada; 
            padding: 5px;
            -webkit-border-radius: 3px;
            -moz-border-radius: 3px;
            border-radius: 3px;
        }
        </style>
        <div align="center" class="item">
            <form action="" method="POST">
            <table width="50%" border="0" cellpadding="5" cellspacing="5">
                <tr>
                    <td width="15%">Item CodeName</td>
                    <td width="35%"><input size="50" class="input" type="text" name="codename" /></td>
                </tr>
                <tr>
                    <td width="15%">Item Image(.ddj file)</td>
                    <td width="35%"><input size="50" class="input" type="text" name="itemimage" /></td>
                </tr>
                <tr>
                    <td width="15%">Shop TAB</td>
                    <td width="35%"><input size="50" class="input" type="text" name="shoptab" /></td>
                </tr>
                <tr>
                    <td width="15%">Shop Slot</td>
                    <td width="35%"><input size="50" class="input" type="text" name="shopslot" /></td>
                </tr>
                <tr>
                    <td width="15%">Item Price</td>
                    <td width="35%"><input size="50" class="input" type="text" name="itemprice" /></td>
                </tr>
                <tr>
                    <td width="15%">Durability</td>
                    <td width="35%"><input size="50" class="input" type="text" name="durability" /></td>
                </tr>
                <tr>
                    <td width="15%">Plus Value</td>
                    <td width="35%"><input size="50" class="input" type="text" name="plusvalue" /></td>
                </tr>
                <tr>
                    <td colspan="2" align="right"><input type="submit" class="input" value="ADD Item" /></td>
                </tr>
            </table>
            </form>
        </div>
    <?php
}
else
{
    $postcodename        = $_POST["codename"];
    $codename            = "PACKAGE_" . $postcodename;
    $namestrid            = "SN_" . $postcodename;
    $descstrid            = "SN_" . $postcodename . "_TT_DESC";
    $itemimage            = TextFix($_POST["itemimage"]);
    $shoptab            = $_POST["shoptab"];
    $shopslot            = $_POST["shopslot"];
    $itemprice            = $_POST["itemprice"];
    $durabilty            = $_POST["durability"];
    $plusvalue            = $_POST["plusvalue"];
    
    /* Lets add to RefShopGoods Table */
    $addRefShopGoods    = @mssql_query("INSERT INTO dbo._RefShopGoods (Service, Country, RefTabCodeName, RefPackageItemCodeName, SlotIndex, Param1, Param1_Desc128, Param2, Param2_Desc128, Param3, Param3_Desc128, Param4, Param4_Desc128) VALUES ('1', '15', '$shoptab', '$codename', '$shopslot', '-1', 'xxx', '-1', 'xxx', '-1', 'xxx', '-1', 'xxx')") or print("Cant added to RefShopGoods Table ~Maybe already have ?<br />");
    /* Lets add to RefScrapOfPackageItem Table */
    $addRefScrap        = @mssql_query("INSERT INTO dbo._RefScrapOfPackageItem (Service, Country, RefPackageItemCodeName, RefItemCodeName, OptLevel, Variance, Data, MagParamNum, MagParam1, MagParam2, MagParam3, MagParam4, MagParam5, MagParam6, MagParam7, MagParam8, MagParam9, MagParam10, MagParam11, MagParam12, Param1, Param1_Desc128, Param2, Param2_Desc128, Param3, Param3_Desc128, Param4, Param4_Desc128) VALUES ('1', '15', '$codename', '$postcodename', '$plusvalue', '0', '$durability', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', 'xxx', '-1', 'xxx', '-1', 'xxx', '-1', 'xxx')") or print("Cant added to RefScrapOfPackageItem Table ~Maybe already have ?<br />");
    /* Lets add to RefPackageItem Table */
    $addPackageItem        = @mssql_query("INSERT INTO dbo._RefPackageItem (Service, Country, CodeName128, SaleTag, ExpandTerm, NameStrID, DescStrID, AssocFileIcon, Param1, Param1_Desc128, Param2, Param2_Desc128, Param3, Param3_Desc128, Param4, Param4_Desc128) VALUES ('1', '15', '$codename', '0', 'EXPAND_TERM_ALL', '$namestrid', '$descstrid', '$itemimage', '-1', 'xxx', '-1', 'xxx', '-1', 'xxx', '-1', 'xxx')") or print("Cant added to RefPackageItem Table ~Maybe already have ?<br />");
    /* Lets add to RefPricePolicyOfItem Table */
    $addRefPrice        = @mssql_query("INSERT INTO dbo._RefPricePolicyOfItem (Service, Country, RefPackageItemCodeName, PaymentDevice, PreviousCost, Cost, Param1, Param1_Desc128, Param2, Param2_Desc128, Param3, Param3_Desc128, Param4, Param4_Desc128) VALUES ('1', '15', '$codename', '1', '0', '$itemprice', '0', 'xxx', '0', 'xxx', '0', 'xxx', '0', 'xxx')") or print("Cant added to RefPricePolicyOfItem Table ~Maybe already have ?<br />");
    echo $postcodename . "<br />" . $codename . "<br />" . $namestrid . "<br />" . $descstrid . "<br />" .$itemimage . "<br />" . $shoptab . "<br />" . $shopslot . "<br />" . $itemprice . "<br />" . $durabilty . "<br /><br /> <b>Successfully.</b>";
}
/* Dont Touch ! */
?>
Sorry about Table design but i am not designer.
And you can use Hean's program for client-side from here (http://forum.ragezone.com/f722/release-add-item-npc-803104/)


+ What is diffrence from Hean's script?

  • Quickly Injectable to your script
  • Quickly Editable

Bugs:

  • There is no bugs but if you find a bug contact with me.
 
Junior Spellweaver
Joined
Sep 13, 2011
Messages
100
Reaction score
110
Hey, thank you, very nice :)
 
Initiate Mage
Joined
Jan 9, 2009
Messages
0
Reaction score
424
@tamer14966
If you can use your brain, you can use php code.
 
Experienced Elementalist
Joined
Sep 27, 2011
Messages
285
Reaction score
229
@ sladlejrhfpq
It were actually 3 releases, but my one is hidden at another release thread ;D
 
Back
Top