SphereCommunity
ON=@kill - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: ON=@kill (/Thread-ON-kill)

Pages: 1 2


RE: ON=@kill - Van Glan Bloom - 03-28-2014 01:30 AM

My intention is that the player receives a bonus when you kill the mob with e_exp event. I got to use all that incluiste the post and none of those did what I wanted = /


RE: ON=@kill - Coruja - 03-29-2014 01:23 AM

just use @ExpChange instead @Kill
http://wiki.sphere.torfo.org/index.php/@ExpChange

Code:
[EVENTS e_exp]
ON=@ExpChange
SYSMESSAGE You killed <ARGO.NAME> and gained more <ARGN1>gp
ARGO.NEWGOLD <ARGN1> //the gold will be created on NPC



RE: ON=@kill - UltimaAku - 03-29-2014 03:44 AM

Is it specific monster or random chance? if it's a random monster, you could have a randomiser put in.

[Events e_more_money_random]
ON=@kill
SRC.VAR.RAND=<EVAL {1 50}> //2% chance or 1/50 chances
if (<ARGO.brain> = 0) // Prevents it working against other players
RETURN 0 // but the kill still happens
ELSEIF (<SRC.VAR.RAND>=1) // Random Value is 1
SRC.SYSMESSAGE You have received bonus gold from <ARGO.NAME>.
SRC.newitem i_gold // Creates the new item
SRC.ACT.AMOUNT = (<ARGO.STR> + <ARGO.DEX> + <ARGO.INT>) /// the tougher the mob, the more the gold
SRC.ACT.BOUNCE /// gives it to the player
RETURN 0 /// And the creature dies
endif

This script could be used, but it would work on anything, if you use this, i'd recommend attaching this event to a weapon of some sort, because something like this could work on a cow... although it gives little gold. (30 + 5 + 15 = 50, so 2% chance of dropping 50 gold, worth? lol)

But if it's specific, try this:

[Events e_more_money_specific]
ON=@kill
SRC.VAR.RAND=<EVAL {1 10}> //10% chance or 1/10 chances
IF (<SRC.VAR.RAND>=1) // Random Value is 1
IF (<ARGO.TAG.BONUSCHANCE>=1) // Checks to see if it's the creature that drops the bonus gold
SRC.SYSMESSAGE You have received bonus gold from <ARGO.NAME>.
SRC.newitem i_gold // Creates the new item
SRC.ACT.AMOUNT = (<ARGO.STR> + <ARGO.DEX> + <ARGO.INT>) /// the tougher the mob, the more the gold
SRC.ACT.BOUNCE /// gives it to the player
RETURN 0 /// And the creature dies
endif

then add TAG.BONUSCHANCE=1 to any monster you want to have the gold bonus chance.


RE: ON=@kill - Van Glan Bloom - 03-29-2014 09:45 AM

Thx UltimaAku you really helped me =)

+1 Reputation for you and thx you again =)


RE: ON=@kill - UltimaAku - 03-30-2014 09:16 PM

No problem, thanks for the rep ^^