luisdgs19 Posted January 8, 2013 Posted January 8, 2013 I'm trying to make a script that each time you kill the monster with the id 1769 on the map aev_fild01 the server adds the amount of kills to a character variable.I tried doing it this way. -<tab>script<tab>-1,{ OnNPCKillEvent: <tab>doSomething; } But it doesn't work, could you guys help me Quote
Euphy Posted January 8, 2013 Posted January 8, 2013 Basic_Scripting - script #test -1,{ OnNPCKillEvent: if (killedrid == 1769 && strcharinfo(3) == "aev_fild01") set Var, Var+1; end; } Best to just spawn the monsters with an event label, though, as OnNPCKillEvent will trigger for all mob kills. Quote
Magnetix Posted January 8, 2013 Posted January 8, 2013 (edited) you can see an example here Edit:oh... it's the same with Euphy's.. Edited January 8, 2013 by Magnetix Quote
luisdgs19 Posted January 8, 2013 Author Posted January 8, 2013 Basic_Scripting - script #test -1,{ OnNPCKillEvent: if (killedrid == 1769 && strcharinfo(3) == "aev_fild01") set Var, Var+1; end; } Best to just spawn the monsters with an event label, though, as OnNPCKillEvent will trigger for all mob kills. How do i make a mob generate an event on killed ?? Quote
Euphy Posted January 8, 2013 Posted January 8, 2013 ** Create a permanent monster spawn:<map name>,<x>,<y>,<xs>,<ys>%TAB%monster%TAB%<monster name>%TAB%<mob id>,<amount>,<delay1>,<delay2>,<event>{,<mob size>,<mob ai>} Event is a script event to be executed when the mob is killed. The event must be in the form "NPCName::OnEventName" to execute, and the event name label should start with "On". As with all events, if the NPC is an on-touch NPC, the player who triggers the script must be within 'trigger' range for the event to work. Quote
Capuche Posted January 8, 2013 Posted January 8, 2013 (edited) https://rathena.svn....pt_commands.txt (temporary) *monster "<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>",<size>,<ai>}; or (permanent) <map name>,<x>,<y>,<xs>,<ys>%TAB%monster%TAB%<monster name>%TAB%<mob id>,<amount>,<delay1>,<delay2>,<event>{,<mob size>,<mob ai>} Example: splendide,237,143,5, script mlkjhg 456,{ monster "splendide",237,143,"--ja--",1002,1,"mlkjhg::OnMyMobDead"; end; OnMyMobDead: dispbottom "Quack quack goes a duck!"; end; } Edit : >.< Edited January 8, 2013 by Capuche Quote
Question
luisdgs19
I'm trying to make a script that each time you kill the monster with the id 1769 on the map aev_fild01 the server adds the amount of kills to a character variable.I tried doing it this way.
But it doesn't work, could you guys help me
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.