Jump to content
  • 0
Sign in to follow this  
Pevij

Stop decaying of item

Question

Hello, I want to make something like this:

Item have "duration" and when I equip it "duration" fall down, but when I deequip it "duration" should stop falling down. Any clues how to do it?

I tried something like this:

function onEquip(cid, item, slot)
       doItemSetAttribute(item.uid, "stopduration", 0)
return true
end

function onDeEquip(cid, item, slot)
doItemSetAttribute(item.uid, "stopduration", 1)
return true
end

But it isn't working :(

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Maybe change the stuff in items.xml?

Also for

doItemSetAttribute(item.uid, "stopduration", 0)

Change the 0 to 1

oh yeah and it should be showduration

Share this post


Link to post
Share on other sites
  • 0

If you use custom items and want to decay them:

 

function onEquip(cid, item, slot)
       doDecayItem(item.uid)
return true
end

 

Edit the movements.xml to

 

<movevent type="Equip" itemid="2164" slot="ring" event="script" value="YOUR_SCRIPT_NAME"/>
<movevent type="DeEquip" itemid="2164" slot="ring" event="function" value="onDeEquipItem"/>

 

In items.xml edit the item you need.

Share this post


Link to post
Share on other sites
  • 0

@Zyntax

When I equip that ring it start decaying, but when I deequip it still decaying.

 

The think is I don't want to add two items with same sprite.

I need something like:

- equip royal helmet make it decaying

- when decaying is finished and I still wear this helmet it disappear

- if I deequip royal helmet it stop decaying and won't disappear

Share this post


Link to post
Share on other sites
  • 0

Infos the community needs:

 

What server distribution do you use? (TFS 0.3.X, OTserv 0.2.X)

What item do you want to use?

What effect should happen if you equip, deequip the item? Any sparkling like the equiped rings?

What's the duration time?

What bonuses will be added?

...

 

Make a full request.

Otherwise if the community reads your first post then they will reply like I did:

 

You want to stop decaying an Item?

onEquip = doDecayItem(item.uid)

onDeEquip = doTransformItem(item.uid, unEquipedItemID)

 

Informations are vital for us to be effective and prevent multiple replies which can result in spam and lead to offtopic posts.

Please give us as much input as you can.

 

Take a look here: http://otfans.net/showthread.php?147269-Read-This-BEFORE-Requesting-Scripts!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

Privacy Policy