SphereCommunity

Full Version: Extra gold killings mobs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys,

I need your help with this script:

[ITEMDEF i_arken_talisman]
Defname=i_arken_talisman
ID=i_talisman4
Name=Arken talisman
type=t_jewelry
Tevents=t_arken
Tevents=t_luck_item
tag.luck=100

ON=@EQUIP
IF (<src.findlayer.9.baseid>==i_arken_talisman)
src.events=+e_more_money
else
Return 0
endif

ON=@UNEQUIP
src.events=-e_more_money

[Events e_more_money]
ON=@kill
if (<act.isplayer>)
obj=<argo.uid>
if (<obj.isevent.e_exp>)
local.new=<new>
serv.newitem i_gold,{1000 2000}
bounce <new>
new=<local.new>
return 1
endif
endif


The script serve as the player kill a mob, this drop extra gold.
When I kill the mob with him GM drop the gold, but when you kill the player nothing happens. Can you help?
Look at the wiki page for @Kill http://wiki.sphere.torfo.org/index.php/@Kill ... There is no ACT reference explicitly set in that trigger. The reason it works for your GM, but not your players is coincidental.

Also, "saving" NEW in a LOCAL variable should not be necessary... however, failing to save OBJ, may cause you problems later since OBJ is a global reference. Why even use OBJ? My suggestion is to never use it.

Lastly, using RETURN 1 in @Kill prevents the killer from receiving credit for the kill... do you really want that?

Here is a simpler alternative:

Code:
[Events e_more_money]
ON=@kill
if (<SRC.isplayer>) && (<SRC.isevent.e_exp>)
   serv.newitem i_gold,{1000 2000},<SRC>
endif
I could have sworn I answered this one last night...
Reference URL's