• 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 Bug Amulet of Loss

Phoenix Decion

New Member
Joined
Jul 28, 2008
Messages
30
Reaction score
0
Hello Guys xD
I find an bug with my amulet of loss, when i die it dont work, i lost my items :S

I use tfs 0.3.2(cryingdamson)

Code:
<item id="2173" article="an" name="amulet of loss">
		<attribute key="weight" value="420"/>
		<attribute key="slotType" value="necklace"/>
		<attribute key="preventLoss" value="1"/>

My movements:

Code:
<movevent type="DeEquip" itemid="2173" slot="necklace" event="function" value="onDeEquipItem"/>
 
Last edited:
in file data/creaturescripts/playerdeath.lua
under
Code:
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
add
PHP:
if getPlayerSlotItem(cid, 2).itemid == 2173 then
                doPlayerRemoveItem(cid, 2173, 1)
end
please rep me if this helped you :)
 
Thank you mate but now im not loosing my amulet xD, i dont loose my loot but my amulet too

Check your movements.xml. In my server AOL works fine and I have this in movements.xml:

Code:
	<movevent type="Equip" itemid="2173" slot="necklace" event="function" value="onEquipItem"/>
	<movevent type="DeEquip" itemid="2173" slot="necklace" event="function" value="onDeEquipItem"/>

In your first post you're only showing the DeEquip one, if you dont have the Equip one, add it. Maybe thats the problem.

Cheers~
 
@up
his aol is working.. but he doesnt lose it after dying...

try my solution phoenix.. im 99% sure its going to work.

I see.. well it might be something I figured out yesterday when doing some experiments. It was a silly mistake I made but I only found out about it because of the experiments, it might be what he's doing but he cant realize he is.

@Phoenix~

In your AOL from items.xml, you should have this:

Code:
	<item id="2173" article="an" name="amulet of loss">
		<attribute key="weight" value="420"/>
		<attribute key="slotType" value="necklace"/>
		<attribute key="preventDrop" value="1">     
[B]		<attribute key="charges" value="1"/>[/B]
                </attribute>
	</item>

Including the "charges" part. If you dont have the "charges" attribute, add it just like I posted above, otherwise the server will take the amulet as if it had no charges (infinite charges). So it will never drop. At least thats how it works for me and Im using TFS 0.3.2 (Crying Damson) too.

But, if you already have the "charges" part (or if you just added it like I told you but still doesnt work), then you might be making the silly mistake I was making yesterday :p If you're testing your AOLs by making them with your GOD/GM char, like this:

Code:
/i 2173

or

Code:
/i amulet of loss

Then you need to remember that now in the newest TFS the command /i makes by default 100 of the respective item, so if it is a rune/amulet it will put 100x charges by default, so if you're doing the amulets with that command, when you make the AOL with your GOD/GM you're actually making an AOL with 100 charges, so it will only drop after 100 deaths, and considering you dont have the "showcharges" attribute on the AOL on items.xml, you cant see or even know thats happening.

So if you're gonna test your AOLs, do it by buying them from a NPC or make it dropable by any monster just for the tests or something like that. Dont do it by making them with your GOD/GM char or this will keep happening.

Maybe this is your problem, but if it isnt, then I dont know what else it could be :( If this doesnt work, try out Leiken's suggestion (in case you havent already) it sure is an extra solution and should work. Good luck.

Cheers~
 
Last edited:
Good, my problem resolved, is gm send only /i amulet of loss create 100 charges! /i amulet of loss, 1 is correty
 
Back
Top