ToiletMaster 3 Posted September 15, 2013 Hi there guys! Yet another question from me, hope you guys don't mind! This time I'm stuck at something. I've started using setarray as it really simplifies alot of things!However I can't seem to spawn all the monster I wanted for this time. it only summons the first ID that I specified on the script. Here's the current script. guild_vs5,57,47,4 script npc#hihi 73,{ set $@map$,"guild_vs5"; setarray $@Monsteridweak[1],1301,1297,1403,1654,1268,1507,1830,1307,1302,1635,1655,1636,1777,1837,1656,1219,1502,1637,1262,1700,1320,1865,1657,1702,1829,1375,1204,1653,1416,1200,1197; mes "Hello"; monster "this",0,0,"--ja--",$@monsteridweak[1],100,strnpcinfo(3)+"::OnWave1"; close; OnWave1: if(mobcount($@map$,strnpcinfo(3)+"::OnWave1") <= 95) goto L_announce; end; L_announce: announce "There are only "+mobcount($@map$ , "all")+" left! Good luck!",0; end; } Quote Share this post Link to post Share on other sites
0 mleo1 36 Posted September 15, 2013 (edited) set .arrcount, getarraysize($@monsteridweak);for(set .@i, 1; .@i <= (.arrcount); set .@i, .@i + 1){monster "this",0,0,"--ja--",$@monsteridweak[.@i],100,strnpcinfo(3)+"::OnWave1";} loop thru it dunno if script works, never tried lol Edited September 15, 2013 by mleo1 1 ToiletMaster reacted to this Quote Share this post Link to post Share on other sites
0 Emistry 145 Posted September 15, 2013 @mleo nearly 99.99% working xD ( wrong index number ) set .@arrcount,getarraysize( $@monsteridweak );for( set .@i,0; .@i < .@arrcount; set .@i, .@i + 1 ){ monster "this",0,0,"--ja--",$@monsteridweak[.@i],100,strnpcinfo(3)+"::OnWave1";} and actually you dont really need to use a "Global Variable" in your case.... 1 ToiletMaster reacted to this Quote Share this post Link to post Share on other sites
0 Mumbles 193 Posted September 15, 2013 Here's my method, which utilizes your array and makes it a little easier to reconfigure (if needed): guild_vs5,57,47,4 script Wave Mobs#rand::wave_mobs 73,{ // Dialogue mes "Hello"; mes "You've caused monsters to be summoned!"; close2; // Summon all monsters in the '.monster_weak' array for (.@i = 0; .@i < getarraysize(.monster_weak); .@i++) monster .map$, 0, 0, .weak_name$, .monster_weak[.@i], .weak_amount, strnpcinfo(3) +"::OnWave"; end; OnWave: // Mob death event if (mobcount(.map$, strnpcinfo(3) +"::OnWave") <= .announce_start) announce "There are only "+ mobcount(.map$, "all") +" left! Good luck!", 0; end; OnInit: // Map name .map$ = "guild_vs5"; // Mob count before announcements start .announce_start = 95; // Weak monster name .weak_name$ = "--ja--"; // List of weak monster IDs setarray .monster_weak[0], 1301,1297,1403,1654,1268,1507,1830,1307,1302,1635, 1655,1636,1777,1837,1656,1219,1502,1637,1262,1700, 1320,1865,1657,1702,1829,1375,1204,1653,1416,1200, 1197; // Amount of weak monsters to summon .weak_amount = 100; end;} You should consider reading a little more on looping through arrays in the documentation or on Wiki. The basic concept of using a for loop with your array(s) is that you'll essentially run the same sequence of code through your array indexes until each index has been used. for (.@i = 0; .@i < getarraysize(.monster_weak); .@i++) This loop says, "Start .@i off with the value 0. For each loop in which .@i is less than the array size of the array .monster_weak, run the script on the first line below (or within curlies { } below), then increase the current value of .@i by 1." Now, this might seem like a mouthful at first, but it really starts to make sense once you understand the relation between array indexes and the usage of an incrementation variable (.@i, in this case) in your script. The first value of an array is at the index 0; this means that an array set up like this: setarray .array[0], 123, 231, 321; ...will have its first index value (.array[0]) as 123, its second index value (.array[1]) as 231, and its third index value (.array[2]) as 321. When we go through the array with a loop, we start .@i off at 0 so that we can use .@i as a place holder for the array and start reading from the first index (.array[0]) with .array[.@i]. Here's an example of this usage: for (.@i = 0; .@i < getarraysize(.array); .@i++) mes .array[.@i]; close; This loop will display an NPC message dialogue with the value of the current index being referred to. The final product will look something like: 123 231 321 ...followed by a close button. If you wanted to do more, enclose your looped script within curlies { }, like you would with an if statement. Regarding getarraysize(): This script command returns a value with the size of an array - the amount of indexes an array has. Our array .array has three indexes, therefore it has an array size of 3. Since there is no value for .array[3], we can safely use the condition .@i < getarraysize(.array) within the forloop's expression; this also allows us to increase the amount of valuesour array has without having to modify the loop directly. To reiterate what @Emistry said, you can just use permanent NPC variables (.variable_name) instead of global variables - that is, unless you intend to use your arrays in such a way that permanent NPC variables would not suffice. 1 ToiletMaster reacted to this Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted September 15, 2013 Well, since he's new on it I think we should explain some things before giving him the solution, isn't it? First of all you know what's an array and possibly miss a bit of how setarray works, but I'd advice you to fill up the arrays on their first position. The first position of an array is number 0, then number 1, 2, 3, etcetera. Why positions start on 0? I don't know very well; Why start setting on position 0? It's a mere convention and you can perfectly start setting at position 1. It could also simplify some calculations/processing later. That setarray literally said: start setting the array $@monsteridweak at index 1 (second position, remember first one is 0) with the values: 1301 for index 1,1297 for index 2,1403 for index 3, etcetera. Then, let's go to the summoning part: you tried to summon this piece of code: monster "this",0,0,"--ja--",$@monsteridweak[1],100,strnpcinfo(3)+"::OnWave1"; which I think you know what it literally means, but let's go to the monster ID variable you passed. You're trying to summon the content of $@monsteridweak at index 1, which is just ID# 1301 and just summons that mob, and that's your issue. What to do to solve this? Just passing the $@monsteridweak variable? Wrong (that'll only summon the monster at position 0 if possible). You need a new tool for it, that's looping on the array till all desired monsters are summoned. How do you get the size of an array? With getarraysize, that gets all set positions except trailing zeros or empty strings (which by default mean unset variable), but getarraysize counts leading zeros or empty strings. You are already familiar with loops so, as examples: // Supposing empty arrays before setting. !!Position 0 is the first position of an array!!setarray .@myArray1[0],5,4,3,2,1; // myArray1 = 5,4,3,2,1 at positions 0,1,2,3,4 respectivelygetarraysize(.@myArray1); // Returns 5// Correct loop around .@myArray1for (set .@i, 0; .@i < getarraysize(.@myArray1); set .@i, .@i + 1) { // i varies from 0 to 4 whatever with .@myArray[i];}setarray .@myArray2[1],5,4,3,2,1; // myArray2 = 0,5,4,3,2,1 at positions 0,1,2,3,4,5 respectivelygetarraysize (.@myArray2); // Returns 6// Correct loop around .@myArray2for (set .@i, 1; .@i <= getarraysize(.@myArray1); set .@i, .@i + 1) { // i varies from 1 to 5, position 0 is skipped whatever with .@myArray[i];} Since Via and others have already caught me up you have now a correct solution at the moment depending on what you want, but hope that this explanation has given you a bit of more insight if possible! P.S.: 31 filled up positions on the array... Multiplying by 100... You sure you want to summon 3100 monsters on the same map at once? O.O 2 Red and ToiletMaster reacted to this Quote Share this post Link to post Share on other sites
0 ToiletMaster 3 Posted September 15, 2013 @mleo nearly 99.99% working xD ( wrong index number ) set .@arrcount,getarraysize( $@monsteridweak );for( set .@i,0; .@i < .@arrcount; set .@i, .@i + 1 ){ monster "this",0,0,"--ja--",$@monsteridweak[.@i],100,strnpcinfo(3)+"::OnWave1";} and actually you dont really need to use a "Global Variable" in your case.... To be honest I'm not too sure when to use Global Variable or not to, from my point of view, if I have multiple servers, then it'll show in all accounts? I guess? >_> Correct me if i'm wrong still trying to learn my best here xD Well, since he's new on it I think we should explain some things before giving him the solution, isn't it? First of all you know what's an array and possibly miss a bit of how setarray works, but I'd advice you to fill up the arrays on their first position. The first position of an array is number 0, then number 1, 2, 3, etcetera. Why positions start on 0? I don't know very well; Why start setting on position 0? It's a mere convention and you can perfectly start setting at position 1. It could also simplify some calculations/processing later. That setarray literally said: start setting the array $@monsteridweak at index 1 (second position, remember first one is 0) with the values: 1301 for index 1,1297 for index 2,1403 for index 3, etcetera. Then, let's go to the summoning part: you tried to summon this piece of code: monster "this",0,0,"--ja--",$@monsteridweak[1],100,strnpcinfo(3)+"::OnWave1"; which I think you know what it literally means, but let's go to the monster ID variable you passed. You're trying to summon the content of $@monsteridweak at index 1, which is just ID# 1301 and just summons that mob, and that's your issue. What to do to solve this? Just passing the $@monsteridweak variable? Wrong (that'll only summon the monster at position 0 if possible). You need a new tool for it, that's looping on the array till all desired monsters are summoned. How do you get the size of an array? With getarraysize, that gets all set positions except trailing zeros or empty strings (which by default mean unset variable), but getarraysize counts leading zeros or empty strings. You are already familiar with loops so, as examples: // Supposing empty arrays before setting. !!Position 0 is the first position of an array!!setarray .@myArray1[0],5,4,3,2,1; // myArray1 = 5,4,3,2,1 at positions 0,1,2,3,4 respectivelygetarraysize(.@myArray1); // Returns 5// Correct loop around .@myArray1for (set .@i, 0; .@i < getarraysize(.@myArray1); set .@i, .@i + 1) { // i varies from 0 to 4 whatever with .@myArray[i];}setarray .@myArray2[1],5,4,3,2,1; // myArray2 = 0,5,4,3,2,1 at positions 0,1,2,3,4,5 respectivelygetarraysize (.@myArray2); // Returns 6// Correct loop around .@myArray2for (set .@i, 1; .@i <= getarraysize(.@myArray1); set .@i, .@i + 1) { // i varies from 1 to 5, position 0 is skipped whatever with .@myArray[i];} Since Via and others have already caught me up you have now a correct solution at the moment depending on what you want, but hope that this explanation has given you a bit of more insight if possible! P.S.: 31 filled up positions on the array... Multiplying by 100... You sure you want to summon 3100 monsters on the same map at once? O.O Definitely not! Thanks for the warning lol, Wouldn't want to try 3100 monsters in 1 map at a time lol. and Huge thanks for the amazing definition! There's some parts I'm still fuzzy about, but I believe by reading your description for the next hundred times I might get it xD (It's just me, i'm just slow in learning things and most of the time I need someone to guide me through ._.) This is yet another eye opener in the world of scripting thanks! Here's my method, which utilizes your array and makes it a little easier to reconfigure (if needed): guild_vs5,57,47,4 script Wave Mobs#rand::wave_mobs 73,{ // Dialogue mes "Hello"; mes "You've caused monsters to be summoned!"; close2; // Summon all monsters in the '.monster_weak' array for (.@i = 0; .@i < getarraysize(.monster_weak); .@i++) monster .map$, 0, 0, .weak_name$, .monster_weak[.@i], .weak_amount, strnpcinfo(3) +"::OnWave"; end; OnWave: // Mob death event if (mobcount(.map$, strnpcinfo(3) +"::OnWave") <= .announce_start) announce "There are only "+ mobcount(.map$, "all") +" left! Good luck!", 0; end; OnInit: // Map name .map$ = "guild_vs5"; // Mob count before announcements start .announce_start = 95; // Weak monster name .weak_name$ = "--ja--"; // List of weak monster IDs setarray .monster_weak[0], 1301,1297,1403,1654,1268,1507,1830,1307,1302,1635, 1655,1636,1777,1837,1656,1219,1502,1637,1262,1700, 1320,1865,1657,1702,1829,1375,1204,1653,1416,1200, 1197; // Amount of weak monsters to summon .weak_amount = 100; end;} You should consider reading a little more on looping through arrays in the documentation or on Wiki. The basic concept of using a for loop with your array(s) is that you'll essentially run the same sequence of code through your array indexes until each index has been used. for (.@i = 0; .@i < getarraysize(.monster_weak); .@i++) This loop says, "Start .@i off with the value 0. For each loop in which .@i is less than the array size of the array .monster_weak, run the script on the first line below (or within curlies { } below), then increase the current value of .@i by 1." Now, this might seem like a mouthful at first, but it really starts to make sense once you understand the relation between array indexes and the usage of an incrementation variable (.@i, in this case) in your script. The first value of an array is at the index 0; this means that an array set up like this: setarray .array[0], 123, 231, 321; ...will have its first index value (.array[0]) as 123, its second index value (.array[1]) as 231, and its third index value (.array[2]) as 321. When we go through the array with a loop, we start .@i off at 0 so that we can use .@i as a place holder for the array and start reading from the first index (.array[0]) with .array[.@i]. Here's an example of this usage: for (.@i = 0; .@i < getarraysize(.array); .@i++) mes .array[.@i]; close; This loop will display an NPC message dialogue with the value of the current index being referred to. The final product will look something like: 123 231 321 ...followed by a close button. If you wanted to do more, enclose your looped script within curlies { }, like you would with an if statement. Regarding getarraysize(): This script command returns a value with the size of an array - the amount of indexes an array has. Our array .array has three indexes, therefore it has an array size of 3. Since there is no value for .array[3], we can safely use the condition .@i < getarraysize(.array) within the for loop's expression; this also allows us to increase the amount of values our array has without having to modify the loop directly. To reiterate what @Emistry said, you can just use permanent NPC variables (.variable_name) instead of global variables - that is, unless you intend to use your arrays in such a way that permanent NPC variables would not suffice. Thanks for the explanation as well! Your script does look much better xD but I still have quite an amount of things to edit actually xD. Hopefully once i'm done I won't have 4800 lines >_> or perhaps any errors xD Thanks again! You're all wonderful people in this great community! Quote Share this post Link to post Share on other sites
0 Emistry 145 Posted September 15, 2013 this is how i use variables... $variable$$variable $@variable$@variable .variable$.variable .@variable$.@variable 'variable$'variable guild_vs5,50,50,4 script Sample 757,{mes "Hello";mes "You've caused monsters to be summoned!";close2;if( .mob_count ){ // Summon all monsters for( .@i = 0; .@i < .monster_size; .@i++ ) monster .map$, 0, 0,"--ja--", .monster[.@i],.monster_amount[.@i], .npc_name$+"::OnWaveKill"; .mob_count = mobcount( .map$,.npc_name$+"::OnWaveKill" ); mapannounce .map$,"There are only "+.mob_count+" left! Good luck!", 0;}end;OnWaveKill:.mob_count--;if( .mob_count ){ mapannounce .map$,"There are only "+.mob_count+" left! Good luck!", 0;}end;OnInit:// Map name.map$ = "guild_vs5";// List of weak monster IDssetarray .monster, 1301, 1297;setarray .monster_amount, 100, 200;.monster_size = getarraysize( .monster );.npc_name$ = strnpcinfo(0);end;} Quote Share this post Link to post Share on other sites
0 ToiletMaster 3 Posted September 18, 2013 this is how i use variables... $variable$$variable > $@variable$@variable .variable$.variable .@variable$.@variable 'variable$'variable guild_vs5,50,50,4 script Sample 757,{mes "Hello";mes "You've caused monsters to be summoned!";close2;if( .mob_count ){ // Summon all monsters for( .@i = 0; .@i < .monster_size; .@i++ ) monster .map$, 0, 0,"--ja--", .monster[.@i],.monster_amount[.@i], .npc_name"::OnWaveKill"; .mob_count = mobcount( .map$,.npc_name"::OnWaveKill" ); mapannounce .map$,"There are only "+.mob_count+" left! Good luck!", 0;}end;OnWaveKill:.mob_count--;if( .mob_count ){ mapannounce .map$,"There are only "+.mob_count+" left! Good luck!", 0;}end;OnInit:// Map name.map$ = "guild_vs5";// List of weak monster IDssetarray .monster, 1301, 1297;setarray .monster_amount, 100, 200;.monster_size = getarraysize( .monster );.npc_name$ = strnpcinfo(0);end;} Thanks a lot on clearing up on the variables part! Din't know the global could be used for various NPCs. However I do have one more question though, would it be possible to give a timer to everyone in the party upon entering? so that they can't access while that timer is active. (If possible I'd like to use setquest) I tried replicating something similar to Endless Tower, however I only found out that Endless Tower timer is started when they clicked on the NPC. Would it be possible to get a timer on them as well as detect if anyone has the timer? (Sorry if this is becoming more of it like a request) Quote Share this post Link to post Share on other sites
0 Emistry 145 Posted September 18, 2013 you can do it in different way ... save the time in a variable .... #timer = gettimetick(1) + 180; // account based@timer = gettimetick(1) + 180; // player based ( delete upon logout )timer = gettimetick(1) + 180; // player based ( wont delete upon logout ) or you can use the quest stuff for checking... checkquest( <questid>,PLAYTIME ) there still alot of method to do so .... depend on how you want it to work ... Quote Share this post Link to post Share on other sites
0 ToiletMaster 3 Posted September 19, 2013 (edited) you can do it in different way ... save the time in a variable .... #timer = gettimetick(1) + 180; // account based@timer = gettimetick(1) + 180; // player based ( delete upon logout )timer = gettimetick(1) + 180; // player based ( wont delete upon logout ) or you can use the quest stuff for checking... checkquest( <questid>,PLAYTIME ) there still alot of method to do so .... depend on how you want it to work ... Thanks! But wouldn't this be only 1 person? let's say If i place in a party and would like to add a timer to everyone. Here's the current script that I have at the moment. prontera,152,154,4 script Survival Warper#Prt 73,{ set .register_num, 2; getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; if( !getcharid(1) || getcharid(3) != getpartyleader( getcharid(1),1 ) ){ mes "I only talk to the party leaders."; close; } if ( $@partymembercount != .register_num ) { mes "Please form a party of "+ .register_num +" to continue"; close; } for ( set .@i, 0; .@i < $@partymembercount; set .@i, .@i +1 ) if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) set .@count_online, .@count_online +1 ; if ( .@count_online != .register_num ) { mes "All your party members must be online to continue"; close; } copyarray .@partymembercid, $@partymembercid, .register_num; mes "[Survivalist]"; mes "Party Confirmed"; mes "^FF0000---------------^000000"; mes "Party Name: ^FF0000"+strcharinfo(1)+"^000000"; mes "Party Leader: ^FF0000"+strcharinfo(0)+"^000000"; next; mes "[Survivalist]"; mes "Are you ready ?"; next; // careful here switch(select("Yes I'm ready:No I'm Not")){ case 1: getpartymember getcharid(1), 1; if ( $@partymembercount != .register_num ) { mes "You've made changes to your party !"; close; } for ( set .@i, 0; .@i < $@partymembercount; set .@i, .@i +1 ) { if ( .@partymembercid[.@i] != $@partymembercid[.@i] ) { mes "You've made changes to your party !"; close; } }//if i added a setquest here, would it be applicable to the party leader only? How can i make this to everyone in the party?//since my next command is warpparty. is there any way to achieve that? donpcevent "Survival Waves#Sur::OnWave1"; warpparty "guild_vs5", 0,0, getcharid(1); end; case 2: mes "Come back once you're ready to survive the horror!"; close; } } - script Survival Waves#Sur -1,{ OnWave1: killmonster "guild_vs5", ""+strnpcinfo(3)+"::OnWave"; sleep 3000; mapannounce .map$,""+.npcname$+" Can you survive the horror?",0; sleep 5000; mapannounce .map$,""+.npcname$+" You'll be given 30 seconds in order to buff yourselves!",0; sleep 5000; mapannounce .map$,""+.npcname$+" Just Kidding, Prepare to die!",0; // Summon all monsters in the '.monster_weak' array for (.@i = 0; .@i < getarraysize(.monster_weak); .@i++) monster .map$, 0, 0, .weak_name$, .monster_weak[.@i], .wave1_amount, strnpcinfo(3) +"::OnWave"; end; OnWave: if (mobcount(.map$, strnpcinfo(3) +"::OnWave") == 0){ mapannounce .map$,""+.npcname$+" You think you've won? Think again.!",0; sleep 5000; mapannounce .map$,""+.npcname$+" To be continued",0; //to be continued end;} else // Mob death event if (mobcount(.map$, strnpcinfo(3) +"::OnWave") <= .announce_start) announce "There are only "+ mobcount(.map$, "all") +" left in the map.", 1; end; OnInit: // Map name .map$ = "guild_vs5"; // Mob count before announcements start .announce_start = 10; // Weak monster name .weak_name$ = "--ja--"; // List of weak monster IDs setarray .monster_weak[0], 1301,1297,1403,1654,1268,1507,1830,1307,1302,1635, 1655,1636,1777,1837,1656,1219,1502,1637,1262,1700, 1320,1865,1657,1702,1829,1375,1204,1653,1416,1200, 1197; // Amount of weak monsters to summon .wave1_amount = 2; .npcname$ = "[Survival Master]:";} Edited September 19, 2013 by ToiletMaster Quote Share this post Link to post Share on other sites
0 Emistry 145 Posted September 19, 2013 Thanks! But wouldn't this be only 1 person? let's say If i place in a party and would like to add a timer to everyone. attach everybody and assign the timer ... Quote Share this post Link to post Share on other sites
0 ToiletMaster 3 Posted September 19, 2013 (edited) Thanks! But wouldn't this be only 1 person? let's say If i place in a party and would like to add a timer to everyone. attach everybody and assign the timer ... I tried searching around but I can't seem to find anything ._. I've read alot from the Timers (Scripting) in the Wiki but mostly none of them does talk about party wise timers. however i definitely know it has something to do with $@partymembercid[] as it gets all the id of the members, problem is adding the timer >_> I'm clueless on adding it in at the moment Edited September 19, 2013 by ToiletMaster Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted September 19, 2013 I'm on my cellphone right now so I can't give a detailed reply to this. Maybe use detachrid then loop around all party members attaching an independent timer to them by attachrid and detachrid? Remember RID is account ID. Or I think you could attach'em a timer by using optional parameters of the timer functions. Or make the timer run in the npc then when it times out or whatever, do what you want to the party. Quote Share this post Link to post Share on other sites
0 ToiletMaster 3 Posted September 19, 2013 (edited) I'm on my cellphone right now so I can't give a detailed reply to this. Maybe use detachrid then loop around all party members attaching an independent timer to them by attachrid and detachrid? Remember RID is account ID. Or I think you could attach'em a timer by using optional parameters of the timer functions. Or make the timer run in the npc then when it times out or whatever, do what you want to the party. Thanks for the reply! i've tried reading about http://rathena.org/wiki/Attachrid honestly speaking, I'm totally clueless what does it mean there, (not entirely though, i mean, i know what it does in the example, but not enough for me to relate back to the current script ._.) Edited September 19, 2013 by ToiletMaster Quote Share this post Link to post Share on other sites
0 ToiletMaster 3 Posted October 1, 2013 Bump for this, I can't seem to attach a party timer upon partywarp. Is there any possible solution for this? The only method I can think of would be placing a temporary variable for let's say 2 minutes for them to enter. However it would be even better if I can directly add a timer for everyone to enter in. Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted October 2, 2013 To attach all party member. try : getpartymember getcharid(1), 2;for ( set .@i, 0; .@i < $@partymembercount; set .@i, .@i + 1 ) { detachrid; if ( attachrid($@partymemberaid[.@i]) ) { // do whatever }} 1 ToiletMaster reacted to this Quote Share this post Link to post Share on other sites
0 ToiletMaster 3 Posted October 2, 2013 To attach all party member. try : getpartymember getcharid(1), 2;for ( set .@i, 0; .@i < $@partymembercount; set .@i, .@i + 1 ) { detachrid; if ( attachrid($@partymemberaid[.@i]) ) { // do whatever }} Hi there Patskie! Thanks for replying the thread! However, upon using your command I can't seem to make it function well enough though. Here's an example of what I did in order to test it out. getpartymember getcharid(1), 2; for ( set .@i, 0; .@i < $@partymembercount; set .@i, .@i + 1 ) { detachrid; if ( attachrid($@partymemberaid[.@i]) ) { set test, test+1;// do whatever donpcevent "Survival Waves#Sur::OnWave1"; warpparty "guild_vs5", 0,0, getcharid(1); end; } } It doesn't place the test variable 1 on each character only the party leader that spoken to the npc. Quote Share this post Link to post Share on other sites
0 Emistry 145 Posted October 2, 2013 getpartymember getcharid(1), 2;for ( set .@i, 0; .@i < $@partymembercount; set .@i, .@i + 1 ) if ( attachrid($@partymemberaid[.@i]) ) { set test, test+1;// do whatever }donpcevent "Survival Waves#Sur::OnWave1";warpparty "guild_vs5", 0,0, getcharid(1);end; Quote Share this post Link to post Share on other sites
Hi there guys!
Yet another question from me, hope you guys don't mind!
This time I'm stuck at something.
I've started using setarray as it really simplifies alot of things!
However I can't seem to spawn all the monster I wanted for this time. it only summons the first ID that I specified on the script.
Here's the current script.
Share this post
Link to post
Share on other sites