• 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!

Ring & Amulets - 1 charge

Rudyg

New Member
Joined
Nov 8, 2009
Messages
30
Reaction score
0
Hi,
I have problem with buying rings or amulets with charges in NPC ...
for example: might ring always have one charge when I buy it in NPC ...
In items.xml might ring have 20 charges, when I loot it from monster - it have 20 charges but only in NPC have 1 !
I tried in npc.xml by might ring,ID,money,20 but it have 1 charge ! In npc.lua by module:addbuyable - the same ... By doplayeradditem also one ;[
Do you have any ideas ?

I have TFS on 8.11 ...

Thanks !
 
Search for CreateItem, add these lines in luascript.cpp and compile your exe(your npcs will always sell amulets and might ring with correct charges):

if(itemId == 2197 || itemId == 10219 || itemId == 10221 || itemId == 10220)
newItem->setCharges(5);
else if(itemId == 2164)
newItem->setCharges(20);
else if(itemId == 2198)
newItem->setCharges(50);
else if(itemId == 2199)
newItem->setCharges(150);
else if(itemId == 2201 || itemId == 2172 || itemId == 2170 || itemId == 7887 || itemId == 7888 || itemId == 7889 || itemId == 7890 || itemId == 2161)
newItem->setCharges(200);
else if(itemId == 2200)
newItem->setCharges(250);

You can do the same in monsters.cpp at CreateItem if the Monsters drop stuff with 1 charge.
 
Back
Top