[Courtesy]Create an item with status

01/19/2014 11:21 oziel235#1
Hi everyone!
Well, below is a predetermined file to create some items, for you are an administrator and you have no idea how to create an item with status, here's help.
:bandit:

Remembering that this is just an example.
You can implement the way you want!

PHP Code:
<?php

function add_item $type,$attr,$inv$slot,$stack,$cid,$uid ){
  global 
$cRohanGame;
  global 
$attr_list;  

  
$sql  "SELECT MAX(id) as id from [RohanGame].[dbo].[TItem]";
  
$res  sqlsrv_query($cRohanGame,$sql);
  
$id   sqlsrv_fetch_array($res,SQLSRV_FETCH_ASSOC);
  
$id   $id['id']+1;
  
  
## putting the costume on their slots
  
if ( $type == 4391040 ){
    
$inv  0   ;
    
$slot 14  // costume
  
} elseif ( $type == 4390972){
    
$inv  0   ;
    
$slot 28  // hat
  
} elseif ( $type == 2754516){
    
$inv  0   ;
    
$slot 7  // eyepatch
  
} elseif ( $type == 2753513){
    
$inv  0   ;
    
$slot 8  // earrings
  
}
  
  
$sql "INSERT INTO [RohanGame].[dbo].[TItem]" .
        
"( id, type, attr, inventory, slot, stack, rank, equip_level, equip_strength, equip_dexterity, equip_intelligence, char_id, user_id)" .
        
" VALUES (".
        
$id.','.
        
$type.','.
        
$attr.','.
        
$inv.','.
        
$slot.','.
        
$stack.','.
        
'0,'// rank
        
'0,'// lvl
        
'0,'// str
        
'0,'// dex
        
'0,'// int
        
$cid.','.
        
$uid.")";
        
//  echo "<pre>".$sql.'</pre>';        
  
$res  sqlsrv_query($cRohanGame,$sql);
  if (
$res == false ){
       
print_rsqlsrv_errors(), true);
  }
}

global 
$attr_list;
$attr_list = array(
  
'none'              =>  '0x4C1100000000000000000000000000000000000000000000000000000000000000000000000000000000',
  
'armors'            =>  '0x1CA0001DA0004C1100309101560500000000000000000000000000000000000000000000000000000000',
  
'rings'             =>  '0x4F08004C1100000000000000000000000000000000000000000000000000000000000000000000000000',
  
'30allstat'         =>  '0x011E00021E00031E00041E00051E00061E001E0F004C1100000000000000000000000000000000000000'
);

global 
$items_list;
$items_list = array(
## ARMORS
###########################################################
/* Glacial Split Tunic                  */  
array( 2688083$attr_list['armors']        , 01),
/* Glacial Split Leggings               */  array( 2688091$attr_list['armors']        , 01),
/* Glacial Split Helm                   */  array( 2688099$attr_list['armors']        , 01),
/* Glacial Split Gauntlet               */  array( 2688107$attr_list['armors']        , 01),
/* Glacial Split Boots                  */  array( 2688115$attr_list['armors']        , 01),
/* Glacial Split Shield                 */  array( 3671322$attr_list['armors']        , 01),

## RINGS
###########################################################
/* Artisan Spinel                       */  
array( 2762559$attr_list['rings']         , 01),
/* Artisan Spinel                       */  array( 2762559$attr_list['rings']         , 01),
/* Artisan Spinel                       */  array( 2762559$attr_list['rings']         , 01),
/* Artisan Spinel                       */  array( 2762559$attr_list['rings']         , 01),

/* Artisan Aquamarine                   */  array( 2762560$attr_list['rings']         , 01),
/* Artisan Aquamarine                   */  array( 2762560$attr_list['rings']         , 01),
/* Artisan Aquamarine                   */  array( 2762560$attr_list['rings']         , 01),
/* Artisan Aquamarine                   */  array( 2762560$attr_list['rings']         , 01),

/* Artisan Topaz Brooch                 */  array( 2762561$attr_list['rings']         , 01),
/* Artisan Topaz Brooch                 */  array( 2762561$attr_list['rings']         , 01),
/* Artisan Topaz Brooch                 */  array( 2762561$attr_list['rings']         , 01),
/* Artisan Topaz Brooch                 */  array( 2762561$attr_list['rings']         , 01),

/* Artisan Green Mano                   */  array( 2762558$attr_list['rings']         , 01),
/* Artisan Green Mano                   */  array( 2762558$attr_list['rings']         , 01),
/* Artisan Green Mano                   */  array( 2762558$attr_list['rings']         , 01),
/* Artisan Green Mano                   */  array( 2762558$attr_list['rings']         , 01),

/* Flame Diamonds                       */  array( 2753056$attr_list['none']          , 01),
/* Flame Diamonds                       */  array( 2753056$attr_list['none']          , 01),
/* Flame Diamonds                       */  array( 2753056$attr_list['none']          , 01),
/* Flame Diamonds                       */  array( 2753056$attr_list['none']          , 01),

## SCROLSS
###########################################################
/* Gradiator Liesence(Highest grade)    */  
array(4718623'0x00'                       25),
/* Ranger Liesence(Highest grade)       */  array(4718626'0x00'                       25),
/* Mage Liesence(Highest grade)         */  array(4718629'0x00'                       25),
/* Physical Blow Scroll(Highest grade)  */  array(4718691'0x00'                       25),
/* Sacred Heart's Blessing              */  array(4722672'0x00'                       25),
/* Purified Physical Def                */  array(4718670'0x00'                       25),

## SES & RAES (100%)
###########################################################
/* SES 100%                             */ 
array(2884583,  "0x00"                       30),
/* RAES 100%                            */ array(2884586,  "0x00"                       30),
//
## Costumes
###########################################################
/* Ignited Spirit Armor                 */ 
array(4391040$attr_list['none']            , 01),
/* Santa's Hat                          */ array(4390972$attr_list['30allstat']       , 01),
/* Monocle of Solemnity                 */ array(2754516$attr_list['30allstat']       , 01),
/* Cold Gaze Earrings                   */ array(2753513$attr_list['30allstat']       , 01),
//
## PETS & POTS
###########################################################
/* Soft Kahto                           */ 
array(4063233'0x00'                       01),
/* Bear                                 */ array(4063234'0x00'                       01),
/* Brave Dragon                         */ array(4063237'0x00'                       01),
/* Speedy Hawk                          */ array(4063238'0x00'                       01),
/* Power Tiger                          */ array(4063239'0x00'                       01),
/* Molly                                */ array(4063282'0x00'                       01),
//
/* PET FOOD                             */ 
array(2937591'0x00'                       25),
/* Incomprehensible Growth Feed         */ array(2886001'0x00'                       25),

/* HP POT                               */ array(2818067'0x00'                       ,25),
/* HP POT                               */ array(2818067'0x00'                       ,25),
/* HP POT                               */ array(2818067'0x00'                       ,25),
/* HP POT                               */ array(2818067'0x00'                       ,25),

/* MP POT                               */ array(2818071'0x00'                       ,25),
/* MP POT                               */ array(2818071'0x00'                       ,25),
/* MP POT                               */ array(2818071'0x00'                       ,25),
/* MP POT                               */ array(2818071'0x00'                       ,25),
//
/* Elixir                               */ 
array(2818076'0x00'                       ,25),
/* Elixir                               */ array(2818076'0x00'                       ,25),
/* Elixir                               */ array(2818076'0x00'                       ,25),
/* Elixir                               */ array(2818076'0x00'                       ,25),
//
## TIght Sealed bag 2933685
// bag slots inv 0 slot 16 17 18
);

global 
$weapons_list;
$weapons_list = array(
  
'Glacial Split Dagger'      =>  2621497,
  
'Glacial Split Sword'       =>  2621598,
  
'Glacial Split Dual Sword'  =>  2621700,
  
'Glacial Split Zhen'        =>  2622721,
  
'Glacial Split Katar'       =>  2622498,
  
'Glacial Split Polearm'     =>  2621998,
  
'Glacial Split Staff'       =>  2622198,
  
'Glacial Split Bow'         =>  2622299,
  
'Glacial Split Crossbow'    =>  2622397,
  
'Glacial Split Club'        =>  2621798,
  
'Glacial Split Axe'         =>  2621898,
);

global 
$weapons_attr;
$weapons_attr = array(
  
'100Str 67Melee 33Health 50DD'          =>  '0x0164001721001A4300223200550D004C1100000000000000000000000000000000000000000000000000',
  
'100Str 67Melee 33Health 15Crit'        =>  '0x0164000D0F001721001A4300550D004C1100000000000000000000000000000000000000000000000000',
  
'100Str 67Melee 33Health 35WA'          =>  '0x0164000723001721001A4300550D004C1100000000000000000000000000000000000000000000000000',
  
'100Str 67Melee 33Health 35AttSpeed'    =>  '0x0164000C23001721001A4300550D004C1100000000000000000000000000000000000000000000000000',
  
  
'100Psy 50Vit 67Health 50DD'            =>  '0x046400053200174300223200550D004C1100000000000000000000000000000000000000000000000000',
  
'100Vit 50Psy 67Health 50DD'            =>  '0x043200056400174300223200550D004C1100000000000000000000000000000000000000000000000000',    

  
'100Vit 50Psy 67Health 20Reflect'       =>  '0x043200056400174300281400550D004C1100000000000000000000000000000000000000000000000000',
  
  
'200Agi 33Health 15Crit'                =>  '0x06C8000D0F00172100000000550D004C1100000000000000000000000000000000000000000000000000',
  
'200Agi 33Health 70Elemental'           =>  '0x06C800172100254600000000550D004C1100000000000000000000000000000000000000000000000000',
  
'200Dex 33Health 15Crit'                =>  '0x02C8000D0F00172100000000550D004C1100000000000000000000000000000000000000000000000000',
  
  
'100Int 67Melee 33Magic 50DD'           =>  '0x0364001921001A4300223200550D004C1100000000000000000000000000000000000000000000000000',   
  
'100Int 67Melee 33Magic 35AttSpeed'     =>  '0x0364000C23001921001A4300550D004C1100000000000000000000000000000000000000000000000000',
  
  
'100Dex 67Ranged 33Health 50DD'         =>  '0x0264001721001B4300223200550D004C1100236400000000000000000000000000000000000000000000',  
  
'100Dex 67Ranged 33Health 15Crit'       =>  '0x0264000D0F001721001B4300550D004C1100236400000000000000000000000000000000000000000000',  
  
'100Dex 67Ranged 33Health 35WA'         =>  '0x0264000723001721001B4300550D004C1100236400000000000000000000000000000000000000000000',  
  
'100Dex 67Ranged 33Health 35AttSpeed'   =>  '0x0264000C23001721001B4300550D004C1100236400000000000000000000000000000000000000000000',

  
'100Int 67Magic 33Health 50DD'          =>  '0x036400172100194300223200550D004C1100000000000000000000000000000000000000000000000000',
  
'200Vit 33Health 35Mobility'            =>  '0x05C8000B2300172100000000550D004C1100000000000000000000000000000000000000000000000000',
  
'100Vit 67Health 3Mobility'             =>  '0x0564000B2300174300000000550D004C1100000000000000000000000000000000000000000000000000',
  
'100Vit 67Health 33Ranged 50DD'         =>  '0x0564001743001B2100223200550D004C1100000000000000000000000000000000000000000000000000'
);
?>
:D
01/19/2014 11:44 zzerachiel#2
That's the script to add items i made on the first server i worked at.
Unfortunately, inserting items directly into TItem is not the way to do things, because the mapserver would "steal" items from another player in order to give you those items.

You're better inserting them to TEventItems or Item Mall.

It bugs me that some server use ancient scripts in order to run their server.
01/19/2014 12:29 oziel235#3
because it is neither tested got it but didn't have time. Posted only to help people who have no idea of how to make an item with status.


I changed some statements doing that instead you use an item, it creates a new item and adds the status and now worked perfectly.
Didn't use any one item
01/19/2014 13:28 jarrod512#4
Thx YoY
01/20/2014 02:15 marianreynald#5
oziel235 pwd magpatulong sayo?
01/21/2014 16:14 bringmethehorizon12#6
thanks .. this is will usefull for me ^_^
01/21/2014 16:29 oziel235#7
Quote:
Originally Posted by marianreynald View Post
oziel235 pwd magpatulong sayo?
I do not understand
01/23/2014 16:14 DevParanoid#8
Quote:
Originally Posted by oziel235 View Post
I do not understand
He said. "Can you help me?"
01/23/2014 16:22 oziel235#9
Quote:
Originally Posted by marianreynald View Post
oziel235 pwd magpatulong sayo?
I can try to help you.
Add skype: oziel73150
01/23/2014 18:42 rohanprivateteam#10
any guide on how to put this on itemmall?
01/24/2014 15:18 christianzlife#11
where to put this?
02/14/2014 07:04 saszuke25#12
can you help me too sir oziel ?? i will send you private message here on EPVP TY :)
05/28/2014 19:17 aisman#13
location scrip place where
05/29/2014 00:42 oziel235#14
Guys... this script you adapt it on its website. It's just a hint of how to create items for the website, can adapt it in your shop. It is an idea, the way how to apply is with you.
07/12/2014 17:03 jamesyap00#15
how do you convert xls to bin ?