SphereCommunity
ON=@ITEMDROPON_GROUND - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Requests (/Forum-Script-Requests)
+--- Thread: ON=@ITEMDROPON_GROUND (/Thread-ON-ITEMDROPON-GROUND)



ON=@ITEMDROPON_GROUND - Deathangel592 - 10-01-2012 09:40 PM

Hello. I have problem with ON=@ITEMDROPON_GROUND trigger.
I need that for example someone drops item on the groud no matter where and this item dissapears after 20 seconds, can someone help me with that?
And when item is dropped on the ground it showes on the item Item will dissapear in 20 seconds.


RE: ON=@ITEMDROPON_GROUND - Skul - 10-01-2012 10:28 PM

Code:
on=@itemdropon_ground
if !( <act.attr> & attr_move_never ) && !( <act.attr> & attr_static )
  act.attr |= attr_decay
  act.p=<args>
  act.timer=20
  act.message This item will decay in 20 seconds.
  return 1
endif



RE: ON=@ITEMDROPON_GROUND - Deathangel592 - 10-10-2012 05:56 AM

(10-01-2012 10:28 PM)Skul Wrote:  
Code:
on=@itemdropon_ground
if !( <act.attr> & attr_move_never ) && !( <act.attr> & attr_static )
  act.attr |= attr_decay
  act.p=<args>
  act.timer=20
  act.message This item will decay in 20 seconds.
  return 1
endif

Thanks mate. It worked. Smile


RE: ON=@ITEMDROPON_GROUND - Shaklaban - 10-10-2012 07:28 AM

timer can cause some problems, since lot of script using @timer trigger. you can replace timer=20 line with argn1=200

http://wiki.sphere.torfo.org/index.php/@DropOn_Ground


RE: ON=@ITEMDROPON_GROUND - xwerswoodx - 02-16-2013 01:46 AM

If you use, timer or argn1 I think they don't check if it's static or move_never when the timer finish.
Code:
[Function f_item_decay]
ref1=<uid>
if !(<ref1.cont>) && !(<ref1.attr>&attr_static) && !(<ref1.attr>&attr_move_never) && !(<ref1.attr>&attr_owned)
ref1.remove
endif

In your player event;
Code:
On=@ItemDropOn_Ground
src.sysmessage This item will decay in 20 seconds.
act.timerf 20,f_item_decay

On=@ItemPickUp_Ground
act.timerf clear