give item

01/31/2013 18:08 yosif#1
hello
i would like to give player item with a comand and i can make it bound and have effect like ( /give player item heartnecklace super 12 7 255 13 13 1 HP )
this wil give player +12 -7 255 HP , 2dragon gem bound item and it have health regan

here my give code can you help me with it please

01/31/2013 18:42 go for it#2
Quote:
it have health regan
duno about this one
but about the rest
at the client.inventory.add(item,plus,times) there is overload with 4th bool parm. for bounded
create a new override with damage,hp,gem1,gem2 in addition to the item id , plus , times
give it a try :)
01/31/2013 21:38 yosif#3
i think you didnt understand me or i didnt understand you....
what i mean i can make any item ( neck , armor , boot , helmet...etc ) same as when you be rebrith you got a poison blade / bow give shield / backsword give HP / MP...i want to make a item bla super 12 7 255 13 13 1 HP

super
+12
-7 dmg
255 health
2 super dragon gem
1 bound ( 0 not bound )
HP ( chance to regain health ) [ same as backsword for fire rebrith ]

thnx
01/31/2013 23:09 pro4never#4
Then make the item...


There's a few steps you have to accomplish.

Step 1: Create the item in memory (Item class/struct which likely inherits from a ItemType class/struct). There are likely multiple constructors for this already. If you need additional parameters (such as reborn effect)then I suggest writing your own constructor for ther class.

Step 2: Populate this Item object via command input (actually same step but they involve different things). You're already doing this sortof but checking validity of input is always (strongly) recommended and I'm sure you can clean up that code after you get everything working.


Step 3: Save the new item to your database. Just a simple insert statement which should already exist in your source.

Step 4: Add the Item object to your Client's inventory.

Step 5:: Inform the client about their shiny new item. This is just an item info packet which you can send generally based on the Item object which you've already created.
01/31/2013 23:18 nTL3fTy#5
Code:
for (uint x = 0; x < COunt; x++)
{
if (x >= COunt) break;
...
}
This is why you need to learn the language before using it. :facepalm:
Although, I should probably assume you didn't write this because you're asking about it..

After debating whether to actually help, I decided I would.
Here's a formatted copy of this sorry excuse for code:

Based on the code provided, you need to use "/Give item <item_name> <item_quality> [plus] [bless] [enchant] [soc1] [soc2] [r] [g] [b]".
I should also mention your array length checks are wrong..
02/01/2013 06:52 yosif#6
so i only have to close it after
" if (x >= COunt) break; " ?

and what is " [r] [g] [b] "....? and how do i use them , sorry but this code i found it in server it self so i was wonder if you guys would help me to make this happen
thnx alot

PS: i have try this /give player item steelblade super 12 7 255 13 13 0 0 1 ( i thog it gona be bound but it didnt be bound )
thnx again vary much all of you ( we reply and help me out , i would give thnx for every one help me or i see his topic usefully to me )