Ricauter
New member
- Messages
- 26
- Points
- 0
Just a question: what you mean with 'X' >>> number of mobs, or a specifc one??I want to know if it's possible to script that when you kill X mob in Y map, it exexutes Z command, like for example to add +1 to a counter, and when that counter reaches a certain number, then it executes a certain command, or when killing a monster it buffs you, I'd greatly appreciate on some help on how to create a script of this kind![]()
![]()
a specific oneJust a question: what you mean with 'X' >>> number of mobs, or a specifc one??I want to know if it's possible to script that when you kill X mob in Y map, it exexutes Z command, like for example to add +1 to a counter, and when that counter reaches a certain number, then it executes a certain command, or when killing a monster it buffs you, I'd greatly appreciate on some help on how to create a script of this kind![]()
![]()
then do something like this:a specific oneJust a question: what you mean with 'X' >>> number of mobs, or a specifc one??I want to know if it's possible to script that when you kill X mob in Y map, it exexutes Z command, like for example to add +1 to a counter, and when that counter reaches a certain number, then it executes a certain command, or when killing a monster it buffs you, I'd greatly appreciate on some help on how to create a script of this kind![]()
![]()
OnNPCKillEvent:if(strcharinfo(3)== 'map'){ if(getmonsterinfo(killedrid,0) == 'monstername'){ sc_start 39, 60,5; //buff 39(id), 60(time), 5 (skill level)
Exaclty!!@@RodRich oh right, and how do I do the counter thing? would it be something like
OnNPCKillEvent:if(strcharinfo(3)== 'map'){if(getmonsterinfo(killedrid,0) == 'monstername'){ set mymobkills,mymobkills +1;// to count +1 kills }end; if (mymobkills > 99){ set mymobkills,0; //to reset the counter and buff? sc_start 39, 60,5;}end;
right?
and how can I make it execute a roullette? like I want it to give a random drop from an OBB without giving the OBB?
Ah ok, that simple either!!@@RodRich oh right, and how do I do the counter thing? would it be something like
OnNPCKillEvent:if(strcharinfo(3)== 'map'){if(getmonsterinfo(killedrid,0) == 'monstername'){ set mymobkills,mymobkills +1;// to count +1 kills }end; if (mymobkills > 99){ set mymobkills,0; //to reset the counter and buff? sc_start 39, 60,5;}end;
right?
and how can I make it execute a roullette? like I want it to give a random drop from an OBB without giving the OBB?
You should use <tab> instead <space bar> for while that's it! =Dthanks! but now while testing I ran intro some issues D: I'm trying the code BUT I'm getting this eror on the console:
[Error]: npc_parsesrcfile: Unable to parse, probably a missing TAB in file 'npc/test/test.txt', line '1'. Skipping line... * w1=prontera * w2=Script * w3=FASE1,-1{ * w4=[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/test/test.txt', line '3'. Stopping... * w1=OnNPCKillEvent: * w2= * w3= * w4=
here's how it goes:
prontera Script TEST1,-1{ OnNPCKillEvent: if(strcharinfo(3)== 'prontera'){ if(getmonsterinfo(killerid == 1973) == 'Poring'){ set f1@ks,f1@ks +1;// to count +1 kills announce "PORINGS KILLED +1 ["f1@ks"/5]",3 } if (f1@ks > 5){ set f1@ks,0; //to reset the counter and buff sc_start 10, 240000,10;}end;}}
what did I do wrong?![]()
-<tab>script<tab>npcname<tab>-1,{
I guess you're using the <tab> key form you keyboard where you wrote <tab> (you have to)I did it like this:
-<tab>Script<tab>test1<tab>-1,{<tab>OnNPCKillEvent:<tab><tab>if(strcharinfo(3)== 'prontera'){<tab><tab><tab>if(getmonsterinfo(killerid,1973) == 'Poring'){<tab><tab><tab>set f1@ks,f1@ks +1;// to count +1 kills<tab><tab><tab>announce "PORINGS KILLED +1 ["f1@ks"/5]",3}<tab>if (f1@ks > 5){<tab><tab>set f1@ks,1; //to reset the counter and buff<tab><tab>sc_start 10, 240000,10;}}end;}
and I'm getting the same errors![]()
yes xD but I mean the problem is that the console is saying that there's a syntax error on the 1st line, and that it doesn't recognize the OnNPCKillEvent: syntaxI guess you're using the <tab> key form you keyboard where you wrote <tab> (you have to)
but this line is wrong:
<tab><tab><tab>announce "PORINGS KILLED +1 ["f1@ks"/5]",3
do this way:
<tab><tab><tab>announce "PORINGS KILLED +1 ["+f1@ks+"/5]",3;
Ah ok, because when you get errer from first line, the npc isn't readed.yes xD but I mean the problem is that the console is saying that there's a syntax error on the 1st line, and that it doesn't recognize the OnNPCKillEvent: syntaxI guess you're using the <tab> key form you keyboard where you wrote <tab> (you have to)
but this line is wrong:
<tab><tab><tab>announce "PORINGS KILLED +1 ["f1@ks"/5]",3
do this way:
<tab><tab><tab>announce "PORINGS KILLED +1 ["+f1@ks+"/5]",3;I know it was OnNPCKillEvent, but why doesn't it recognize it as valid?![]()
-<tab>script<tab>test1<tab>-1,{
I found some issues, make this way:nope... still getting:
[Error]: scriptp_2: invalid data for operator C_EQ
[Debug]: Data: string value="prontera"
[Debug]: Data: number value=0
[Debug]: Source (NPC): test1 (invisible/not on a map)
what can that be?
- script test1 -1,{ OnNPCKillEvent: if(strcharinfo(3)==prontera){ if(getmonsterinfo(killerid,1008)=='Poring'){ set f1ks,f1ks +1;// to count +1 kills; announce "PORINGS KILLED +1 ["+f1ks+"/5]",3; } if (f1ks >= 5){ set f1ks,f1ks=1; //to reset the counter and buff? sc_start 10, 240000,10; }}end;}
edit: but I should tell you, the script loads perfectly, the error appears on the console as soon as I try to execute it, and by that I mean, when I kill a poring in prontera...
- script test1 -1,{ OnNPCKillEvent: set .@map$,"prontera"; if(strcharinfo(3)== .@map$){ if(getmonsterinfo(killerid,0)=="Poring"){ //u had put 1008, here and have to be '0' set f1ks,f1ks +1;// to count +1 kills; announce "PORINGS KILLED +1 ["+f1ks+"/5]",3; } if (f1ks >= 5){ set f1ks,0; //if you put '1' here, the count will start at 2 sc_start 10, 240000,10; }}end;}
We use essential cookies to make this site work, and optional cookies to enhance your experience.