• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

add condition doll

bpm91

Advanced OT User
Joined
May 23, 2019
Messages
1,046
Solutions
7
Reaction score
180
Location
Brazil
YouTube
caruniawikibr
hello i would like to know how i do for an item when equipped give food condition so the player will not need to eat. I also need to know if this condition can have a time as a healing ring for example. Can someone help me?
tfs 0,4 version 8,6
I forgot to mention, equipped with the arrow or 2 hands.
however when in the backpack will not be activated.
it's like an enchanted item...

Screenshot_1.png
 
Solution
You want the item to disappear after time ends? like ring of healing?
Just write in items.xml
XML:
<attribute key="duration" value="xxx" />
<attribute key="decayTo" value="0" />
And try this one data\movements\scripts xxx.lua
LUA:
function onEquip(cid, item, slot)
  doPlayerFeed(cid, 1400)
  return true
end
function onDeEquip(cid, item, slot)
  doPlayerFeed(cid, 0)
  return true
end
and in movements.xml
XML:
<movevent type="Equip" itemid="2112" slot="ammo" event="script" value="xxx.lua"/>
<movevent type="DeEquip" itemid="2112" slot="ammo" event="script" value="xxx.lua"/>
<movevent type="Equip" itemid="2112" slot="left-hand" event="script" value="xxx.lua"/>
<movevent type="DeEquip" itemid="2112" slot="left-hand"...
You want the item to disappear after time ends? like ring of healing?
Just write in items.xml
XML:
<attribute key="duration" value="xxx" />
<attribute key="decayTo" value="0" />
And try this one data\movements\scripts xxx.lua
LUA:
function onEquip(cid, item, slot)
  doPlayerFeed(cid, 1400)
  return true
end
function onDeEquip(cid, item, slot)
  doPlayerFeed(cid, 0)
  return true
end
and in movements.xml
XML:
<movevent type="Equip" itemid="2112" slot="ammo" event="script" value="xxx.lua"/>
<movevent type="DeEquip" itemid="2112" slot="ammo" event="script" value="xxx.lua"/>
<movevent type="Equip" itemid="2112" slot="left-hand" event="script" value="xxx.lua"/>
<movevent type="DeEquip" itemid="2112" slot="left-hand" event="script" value="xxx.lua"/>
<movevent type="Equip" itemid="2112" slot="right-hand" event="script" value="xxx.lua"/>
<movevent type="DeEquip" itemid="2112" slot="right-hand" event="script" value="xxx.lua"/>
 
Solution
i think in something like that
no disappear...
can be recharged



LUA:
</item>
        <item id="13483" article="a" name="bear doll">
        <attribute key="weight" value="2500" />
        <attribute key="slotType" value="two-handed" />
        <attribute key="decayTo" value="13485" />
        <attribute key="transformDeEquipTo" value="13484" />
        <attribute key="duration" value="3300" />
        <attribute key="showduration" value="1" />
        <attribute key="showattributes" value="1" />
        <attribute key="description" value="a little bear that satisfies your hunger." />
    </item>
        <item id="13484" article="a" name="bear doll">
        <attribute key="weight" value="2500" />
        <attribute key="slotType" value="two-handed" />
        <attribute key="transformEquipTo" value="13483" />
        <attribute key="stopduration" value="1" />
        <attribute key="showduration" value="1" />       
        <attribute key="description" value="a little bear that satisfies your hunger." />
    </item>
 
If you don't need it to disappear then you'll have to decayTo different item id.

XML:
<attribute key="decayTo" value="xxx" />
 
What? did you copy the line exactly like I posted? You have to change the "XXX" to the item ID you want it to change/decay to it when time ends.
You don't write it like this
XML:
<attribute key="decayTo" value="xxx" />
You write an ID
XML:
<attribute key="decayTo" value="2112" />
 
When crash happens? Can you try with main client items not the ones you have added custom to your server.
 
1st the hunger should remove only if the doll is equipped on the arrow of the person.
2nd if the player is hungry, and moving to the arrow will remove the hunger, but if he removes the bear from the arrow, then the player will be hungry again.
3rd I made 2 items, an enchanted doll ID 13483. and an unenchanted doll 13484 pulling id 13483 into the backpack is not becoming id 13484. it can only appear id 13483 if it is in the arrow.


I know we did it for the hands but I think it's giving conflict.


@M0ustafa
 
Last edited:
Back
Top