<attribute key="weight" value="420"/>
<attribute key="slotType" value="necklace"/>
<attribute key="charges" value="1"/>
<attribute key="preventDrop" value="1"/>
</item>
local config = {
regular_aol = -- Id for the item you want the player to use to transform it into the new aol.
edited_aol = -- Id for the edited aol.
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) then
doPlayerSendCancel(cid,'You have already used an aol!')
else
if item.uid == 20017 then -- Put any unique id you want, as long as its not in use.
doTransformItem(regular_aol,edited_aol)
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You may now put on your new 50% less death loss Aol.")
end
end
return 1
end
<action itemid=" " event="script" value=" "/> -- Put whatever item id you want, and put the name of the new file you just made.
local config = {
regular_aol = -- Id for the item you want the player to use to transform it into the new aol.
edited_aol = -- Id for the edited aol.
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) then
doPlayerSendCancel(cid,'You have already used an aol!')
else
if item.uid == 20017 then -- Put any unique id you want, as long as its not in use.
doTransformItem(20017, edited_aol)
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You may now put on your new 50% less death loss Aol.")
end
end
return 1
elseif(getCreatureHealth(cid) and (getCreatureMana(cid))) <= (getCreatureMaxHealth(cid) and (getCreatureMaxMana(cid))) then
doPlayerRemoveItem(cid, CONST_SLOT_NECKLACE, edited_aol)
end
end
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerSetLossPercent(cid, 1, 50)
doPlayerSetLossPercent(cid, lossType, newPercent)