• 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 AOL not working on Cryingdamson 0.3.6 (8.60) V5

Demnish

Tibian Hero
Joined
Sep 28, 2011
Messages
401
Solutions
2
Reaction score
63
Location
Sweden
I'm using the distro cryingdamson 0.3.6 (8.60) V5

And my AOL doesn't seem to be working..
It has the PreventDrop AND PreventLoss,
it did not work when I had only PreventDrop either.

Also, the aol is in movements.xml

I can not seem to figure this out on my own, is there anyone that can help me on the items.xml part or even actionscriptwise?
Rep+ if help is given.

----------
I tried this Actionscript I made in a few seconds but didn't work, does anyone see the errors or does it not work this way?

scripts/items/AOL.lua
function onEquip(cid, item, slot)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0)
return true
end

actions.xml
<action itemid="7889" event="script" value="items/aol.lua"/>


Also here is lib/actions.lua
function destroyItem(cid, itemEx, toPosition)
if(itemEx.uid <= 65535 or itemEx.actionid > 0) then
return false
end

if not(isInArray({1770, 2098, 1774, 2064, 2094, 2095, 1619, 2602, 3805, 3806}, itemEx.itemid) or
(itemEx.itemid >= 1724 and itemEx.itemid <= 1741) or
(itemEx.itemid >= 2581 and itemEx.itemid <= 2588) or
(itemEx.itemid >= 1747 and itemEx.itemid <= 1753) or
(itemEx.itemid >= 1714 and itemEx.itemid <= 1717) or
(itemEx.itemid >= 1650 and itemEx.itemid <= 1653) or
(itemEx.itemid >= 1666 and itemEx.itemid <= 1677) or
(itemEx.itemid >= 1614 and itemEx.itemid <= 1616) or
(itemEx.itemid >= 3813 and itemEx.itemid <= 3820) or
(itemEx.itemid >= 3807 and itemEx.itemid <= 3810) or
(itemEx.itemid >= 2080 and itemEx.itemid <= 2085) or
(itemEx.itemid >= 2116 and itemEx.itemid <= 2119)) then
return false
end

if(math.random(1, 7) == 1) then
if(isInArray({1738, 1739, 1770, 2098, 1774, 1775, 2064}, itemEx.itemid) or
(itemEx.itemid >= 2581 and itemEx.itemid <= 2588)) then
doCreateItem(2250, 1, toPosition)
elseif((itemEx.itemid >= 1747 and itemEx.itemid <= 1749) or itemEx.itemid == 1740) then
doCreateItem(2251, 1, toPosition)
elseif((itemEx.itemid >= 1714 and itemEx.itemid <= 1717)) then
doCreateItem(2252, 1, toPosition)
elseif((itemEx.itemid >= 1650 and itemEx.itemid <= 1653) or
(itemEx.itemid >= 1666 and itemEx.itemid <= 1677) or
(itemEx.itemid >= 1614 and itemEx.itemid <= 1616) or
(itemEx.itemid >= 3813 and itemEx.itemid <= 3820) or
(itemEx.itemid >= 3807 and itemEx.itemid <= 3810)) then
doCreateItem(2253, 1, toPosition)
elseif((itemEx.itemid >= 1724 and itemEx.itemid <= 1737) or
(itemEx.itemid >= 2080 and itemEx.itemid <= 2085) or
(itemEx.itemid >= 2116 and itemEx.itemid <= 2119) or
isInArray({2094, 2095}, itemEx.itemid)) then
doCreateItem(2254, 1, toPosition)
elseif((itemEx.itemid >= 1750 and itemEx.itemid <= 1753) or isInArray({1619, 1741}, itemEx.itemid)) then
doCreateItem(2255, 1, toPosition)
elseif(itemEx.itemid == 2602) then
doCreateItem(2257, 1, toPosition)
elseif(itemEx.itemid == 3805 or itemEx.itemid == 3806) then
doCreateItem(2259, 1, toPosition)
end

doRemoveItem(itemEx.uid, 1)
end

doSendMagicEffect(toPosition, CONST_ME_POFF)
return true
end
----------

Yours, Demnish.
 
Last edited:
LUA:
	<item id="2173" article="an" name="amulet of loss">
		<attribute key="weight" value="420" />
		<attribute key="slotType" value="necklace" />
		<attribute key="charges" value="1" />
		<attribute key="preventDrop" value="1" />
	</item>

Is it the same?
If not test it and tell results.
 
Why you don't create another amulet of loss? Maybe another amulet with different id and only add the following lines:

Code:
		<attribute key="charges" value="1" />
		<attribute key="preventDrop" value="1" />
 
Did but doesnt work.. :/
Ice rapier works when I added attribute key "showcharges" but when I added to the NEW aol it didnt work, also Ice Rapier wasnt found in weapons.xml or movements.xml, so tried with commenting the lines of the aol, but didnt work..

I think the problem is the Attribute Key, if I could get hold of a list with all attribute keys for the distro I think I can solve it, but dunno how..


EDIT: After some tries of diffrent methods I can only assume that the problem lies within the "attribute key", anyone know how to fix this?
 
Weird.. I just have used that rev and I have that config for the AOL, well if you don't find any solution look here (to prevent the item loss without a amulet), just add the following lines to creaturescripts > login.lua:

doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0)
 
Is it possible to use those lines in an actionscript? So that I can redirect that actionscript to the AOL??


Tried this actionscript without success, anyone know what might be wrong with it? Or does it somply just dont work this way?

items/AOL.lua
function onEquip(cid, item, slot)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0)
return true
end

actions.xml
<action itemid="7889" event="script" value="items/aol.lua"/>
 
Last edited:
Back
Top