• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Add amulet with 200 charges

ziggy46802

Active Member
Joined
Aug 19, 2012
Messages
418
Reaction score
27
How do you do a doPlayerAddItem(cid, 2170, 200) with 200 being the charges,

of course this script doesnt work but how do I make it so the npc does not just give you an amulet with one charge?
 
It supports two forms of parameter sets:
//doPlayerAddItem(cid, itemid[, count/subtype = 1[, canDropOnMap = true[, slot = 0]]])
//doPlayerAddItem(cid, itemid[, count = 1[, canDropOnMap = true[, subtype = 1[, slot = 0]]]])
//Returns uid of the created item

Since the implication of your post is that doPlayerAddItem(cid, 2170, 200) doesn't give you your expected result you could try either
doPlayerAddItem(cid, 2170, 1, false, 200, CONST_SLOT_NECKLACE)
or, confirmed working for me via /lua command on an r3884 server
Code:
doTransformItem(doPlayerAddItem(cid, 2170, 1), 2170, 200) ;
 
very strangely but neither one of those works, I just tested both and both give me a silver necklace with one charge left.

I am using 8.60 Crying Damson 0.3.6 V5 server base if that means anything why this is not working for some reason.

- - - Updated - - -

In my LUA_FUNCTIONS it says this

Code:
doPlayerAddItem(uid, itemid[, count/subtype[, canDropOnMap]])

So I tried this:

Code:
doPlayerAddItem(cid, 2170, 200, false)

But still only one charge....
 
Last edited:
//doPlayerAddItem(cid, itemid[, count/subtype[, canDropOnMap]])
//doPlayerAddItem(cid, itemid[, count[, canDropOnMap[, subtype]]])

doPlayerAddItem(cid, 2170, 1, false, 200) ;
 
well i saw in my items.xml the silver amulet did not have a "charges" attribute so I added charges=200 and now its giving me silver amulets with 100 charges???

doPlayerAddItem(cid, 2170, 1, false, 200) ;

Even this line gives me a 100 charge silver amulet when in items.xml I clearly put charges=200, but if I can't get it to work then I guess the silver amulet on my server only has 100 charges.

- - - Updated - - -

I even changed the code to 100 charges and changed it in items.xml to 100 charges and it gives me 100 charges, as if the max number of charges is 100 or something.
 
Back
Top