Hello, here i'm releasing the script for the item "Claw of the Noxious Spawn", you can see how it works here: Claw of 'The Noxious Spawn' - TibiaWiki - Quests, Items, Spells, and more
Go to data/items/items.xml and search for:
And replace with this:
After it, go to data/movements/movements.xml and paste this:
Now, go to data/actions/scripts/other/ and create a file called claw.lua, paste this inside:
And then, paste this in data/actions/actions.xml:
Notes:
Go to data/items/items.xml and search for:
PHP:
<item id="10309" article="a" name="claw of the noxious spawn">
<attribute key="description" value="It's like a glove and you can't wear a ring on it. You are not sure if you should really put it on."/>
<attribute key="weight" value="500"/>
</item>
And replace with this:
PHP:
<item id="10309" article="a" name="claw of the noxious spawn">
<attribute key="description" value="It's like a glove and you can't wear a ring on it. You are not sure if you should really put it on."/>
<attribute key="weight" value="500"/>
<attribute key="slotType" value="ring"/>
<attribute key="transformDeEquipTo" value="10310"/>
</item>
<item id="10310" article="a" name="claw of the noxious spawn">
<attribute key="description" value="It's like a glove and you can't wear a ring on it. You are not sure if you should really put it on."/>
<attribute key="weight" value="500"/>
<attribute key="slotType" value="ring"/>
<attribute key="transformEquipTo" value="10309"/>
</item>
<item id="10311" article="a" name="claw of the noxious spawn">
<attribute key="weight" value="500"/>
<attribute key="decayTo" value="10310"/>
<attribute key="duration" value="86400"/>
<attribute key="showduration" value="1"/>
</item>
After it, go to data/movements/movements.xml and paste this:
PHP:
<movevent type="Equip" itemid="10309" slot="ring" level="100" event="function" value="onEquipItem"/>
<movevent type="DeEquip" itemid="10309" slot="ring" level="100" event="function" value="onDeEquipItem"/>
<movevent type="Equip" itemid="10310" slot="ring" level="100" event="function" value="onEquipItem"/>
<movevent type="DeEquip" itemid="10310" slot="ring" level="100" event="function" value="onDeEquipItem"/>
<movevent type="Equip" itemid="10311" slot="ammo" level="100" event="function" value="onEquipItem"/>
<movevent type="DeEquip" itemid="10311" slot="ammo" level="100" event="function" value="onDeEquipItem"/>
Now, go to data/actions/scripts/other/ and create a file called claw.lua, paste this inside:
Lua:
local config =
{
conditionsToRemove = {CONDITION_POISON, CONDITION_CURSED}, --conditions to be removed
timeBetweenUse = 10, --time between uses (in seconds)
usesLimit = 60, --uses limit before transform the claw in the unuseful claw(itemid: 10311)
usesLimitTime = 1, --if you use the claw 'usesLimit' times or (60 times) before 'usesLimitTime' hours or (1 hours) then claw will be transformed in the unuseful claw
damage = 200, --damage if you use the claw in a non-protection zone
timeStorage = 64500, --storage to save the time between uses (timeBetweenUse)
usesStorage = 64501, --storage to save the times you use the claw before the 'usesLimit'
usesLimitStorage = 64502 --storage to save the times you use the claw before 'usesLimitTime' hours
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerStorageValue(cid, config.timeStorage) < 0) then
doPlayerSetStorageValue(cid, config.timeStorage, 0)
end
if(getPlayerStorageValue(cid, config.usesStorage) < 0) then
doPlayerSetStorageValue(cid, config.usesStorage, 0)
end
if(os.clock() - getPlayerStorageValue(cid, config.timeStorage)) > config.timeBetweenUse then
if(getTilePzInfo(getCreaturePosition(cid)) == true) then
doCreatureSay(cid, "It tightens around your wrist as you take it on.", TALKTYPE_MONSTER)
else
doCreatureSay(cid, "Ouch! The serpent claw stabbed you.", TALKTYPE_MONSTER)
doCreatureAddHealth(cid, -config.damage)
doSendAnimatedText(getCreaturePosition(cid), config.damage, TEXTCOLOR_RED)
end
doPlayerSetStorageValue(cid, config.timeStorage, os.clock())
if(os.clock() - (config.usesLimitTime * 3600) < getPlayerStorageValue(cid, config.usesLimitStorage)) then
doPlayerSetStorageValue(cid, config.usesStorage, getPlayerStorageValue(cid, config.usesStorage) + 1)
else
doPlayerSetStorageValue(cid, config.usesStorage, 0)
end
if(getPlayerStorageValue(cid, config.usesStorage) >= config.usesLimit) then
doTransformItem(item.uid, item.itemid + 2)
end
for i = 1, table.maxn(config.conditionsToRemove) do
doRemoveCondition(cid, config.conditionsToRemove[i])
end
else
return false
end
return true
end
And then, paste this in data/actions/actions.xml:
PHP:
<action itemid="10309" event="script" value="other/claw.lua"/>
Notes:
Code:
[LIST]
[*]Well this happens to me so i post it here if someone have the same bug... edit the items.xml file with Notepad(Bloc de notas para los habla español) or XML Editor, because the WordPad give bugs.
[*]When claw is transformed to the unuseful claw (itemid: 10311), it will not add the cursed and poison conditions because i don't remember how to do that =D!
[*]When claw is transformed to the unuseful claw(itemid: 10311), you need to put the claw in your ammo slot and wait 24 hours.
[/LIST]