kyeme Posted June 25, 2012 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 164 Reputation: 12 Joined: 03/08/12 Last Seen: 9 hours ago Share Posted June 25, 2012 I need a Party checker NPC script for not allowing same Job in the Party. Can anyone help me? Quote Link to comment Share on other sites More sharing options...
deathscythe13 Posted June 27, 2012 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 118 Reputation: 7 Joined: 01/25/12 Last Seen: February 11, 2023 Share Posted June 27, 2012 try this prontera,156,180,4 script Party Checker 100,{ if(getcharid(1) != 1) { mes "Sorry you don't have party."; close; } getpartymember getcharid(1),1; getpartymember getcharid(1),2; for( set .@i,0; .@i<$@partymembercount && !.@classdupe; set .@i,.@i+1 ) { if (isloggedin($@partymemberaid[.@i],$@partymembercid[.@i]) ) { attachrid($@partymemberaid[.@i]); set .@comparemember1, Class; attachrid($@partymemberaid[.@i+1]); set .@comparemember2, Class; if(.@comparemember2 == .@comparemember1) set .@classdupe, 1; detachrid; } } if(.@classdupe) { mes "Sorry there is someone in your party with the same Class."; close; } mes "Good your ready to go"; close; } Quote Link to comment Share on other sites More sharing options...
kyeme Posted July 5, 2012 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 164 Reputation: 12 Joined: 03/08/12 Last Seen: 9 hours ago Author Share Posted July 5, 2012 Thank you deathscythe13 Quote Link to comment Share on other sites More sharing options...
Tonetzkii Posted July 10, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 323 Reputation: 9 Joined: 11/19/11 Last Seen: September 25, 2015 Share Posted July 10, 2012 bump not working on me he say always "Sorry you don't have party." I have a party with same job. Quote Link to comment Share on other sites More sharing options...
Emistry Posted July 10, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 4 hours ago Share Posted July 10, 2012 change if(getcharid(1) != 1) { into if(!getcharid(1) ) { Quote Link to comment Share on other sites More sharing options...
KeyWorld Posted July 10, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 379 Reputation: 304 Joined: 11/10/11 Last Seen: December 2, 2014 Share Posted July 10, 2012 The script above can't work : - If the party is : mage, archer, swordman, mage, it will not find the 2 mages. - Can have problem with offline member (Class will throw an error ?) - What about a user disconnect before the test and reconnect after ? So here a function (not tested), I just write on the fly, should do the work. function script party_has_duplicate_job { set .@party_id, getarg( 0, getcharid(1) ); // Need to have a party. if ( .@party_id != 1 ) { return -1; } // Loading party members variables getpartymember getcharid(1),1; getpartymember getcharid(1),2; // Keep rid attached. set .@rid, playerattached(); // Check all members for ( set .@i,0; .@i<$@partymembercount; set .@i, .@i+1 ) { // Online user if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i]) ) { // Attach the member to access "Class" attachrid( $@partymemberaid[.@i] ); if ( compare( .@tmp_class$ + "|", "|" + Class + "|" ) ) { if ( .@rid ) attachrid(.@rid); else detachrid; return 1; } set .@tmp_class$, .@tmp_class$ + "|" + Class; } // Offline user (use sql) else { set .@sql$, .@sql$ + ( .@sql_i ? "OR " : "" ) "`char_id`='" + $@partymembercid[.@i] + "' "; set .@sql_i, .@sql_i + 1; } } // SQL for offline users if ( getstrlen(.@sql$) ) { // get class from offline members set .@count, query_sql("SELECT `class` FROM `char` WHERE " + .@sql$, .@class ); // Check the class. for ( set .@i, 0; .@i<.@count; set .@i, .@i+1 ) { if ( compare( .@tmp_class$ + "|", "|" + .@class[.@i] + "|" ) ) { if ( .@rid ) attachrid(.@rid); else detachrid; return 1; } set .@tmp_class$, .@tmp_class$ + "|" + .@class[.@i]; } } // Restore RID. if ( .@rid ) attachrid(.@rid); else detachrid; return 0; } Example of used: if ( callfunc("party_has_duplicate_job") ) { mes "It seems that someone in the party has the same class than another member. Please check again the requirements..."; close; } mes "OK, no problem with your party, let's go !"; ... Quote Link to comment Share on other sites More sharing options...
Virtue Posted July 10, 2012 Group: Members Topic Count: 92 Topics Per Day: 0.02 Content Count: 354 Reputation: 22 Joined: 11/17/11 Last Seen: May 12, 2024 Share Posted July 10, 2012 The script above can't work : - If the party is : mage, archer, swordman, mage, it will not find the 2 mages. - Can have problem with offline member (Class will throw an error ?) - What about a user disconnect before the test and reconnect after ? So here a function (not tested), I just write on the fly, should do the work. function script party_has_duplicate_job { set .@party_id, getarg( 0, getcharid(1) ); // Need to have a party. if ( .@party_id != 1 ) { return -1; } // Loading party members variables getpartymember getcharid(1),1; getpartymember getcharid(1),2; // Keep rid attached. set .@rid, playerattached(); // Check all members for ( set .@i,0; .@i<$@partymembercount; set .@i, .@i+1 ) { // Online user if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i]) ) { // Attach the member to access "Class" attachrid( $@partymemberaid[.@i] ); if ( compare( .@tmp_class$ + "|", "|" + Class + "|" ) ) { if ( .@rid ) attachrid(.@rid); else detachrid; return 1; } set .@tmp_class$, .@tmp_class$ + "|" + Class; } // Offline user (use sql) else { set .@sql$, .@sql$ + ( .@sql_i ? "OR " : "" ) "`char_id`='" + $@partymembercid[.@i] + "' "; set .@sql_i, .@sql_i + 1; } } // SQL for offline users if ( getstrlen(.@sql$) ) { // get class from offline members set .@count, query_sql("SELECT `class` FROM `char` WHERE " + .@sql$, .@class ); // Check the class. for ( set .@i, 0; .@i<.@count; set .@i, .@i+1 ) { if ( compare( .@tmp_class$ + "|", "|" + .@class[.@i] + "|" ) ) { if ( .@rid ) attachrid(.@rid); else detachrid; return 1; } set .@tmp_class$, .@tmp_class$ + "|" + .@class[.@i]; } } // Restore RID. if ( .@rid ) attachrid(.@rid); else detachrid; return 0; } Example of used: if ( callfunc("party_has_duplicate_job") ) { mes "It seems that someone in the party has the same class than another member. Please check again the requirements..."; close; } mes "OK, no problem with your party, let's go !"; ... Can you make this script + limit the party members to seven only? Quote Link to comment Share on other sites More sharing options...
Tonetzkii Posted July 10, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 323 Reputation: 9 Joined: 11/19/11 Last Seen: September 25, 2015 Share Posted July 10, 2012 Not working sir. Quote Link to comment Share on other sites More sharing options...
KeyWorld Posted July 10, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 379 Reputation: 304 Joined: 11/10/11 Last Seen: December 2, 2014 Share Posted July 10, 2012 Can you make this script + limit the party members to seven only? Just 7 members or 1 to 7 members ? Quote Link to comment Share on other sites More sharing options...
Tonetzkii Posted July 10, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 323 Reputation: 9 Joined: 11/19/11 Last Seen: September 25, 2015 Share Posted July 10, 2012 Im trying.... Still not working i need this script. bump Quote Link to comment Share on other sites More sharing options...
KeyWorld Posted July 10, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 379 Reputation: 304 Joined: 11/10/11 Last Seen: December 2, 2014 Share Posted July 10, 2012 Im trying.... Still not working i need this script. bump Maybe due to the header "{" in the next line, try replace this: function script party_has_duplicate_job { With: function script party_has_duplicate_job { Quote Link to comment Share on other sites More sharing options...
GM Takumirai Posted July 10, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 592 Reputation: 31 Joined: 11/14/11 Last Seen: July 29, 2015 Share Posted July 10, 2012 - waiting for this to finish.. this will be a good start for RPC 7vs 7 event Quote Link to comment Share on other sites More sharing options...
Tonetzkii Posted July 10, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 323 Reputation: 9 Joined: 11/19/11 Last Seen: September 25, 2015 Share Posted July 10, 2012 Yes ill try this later. im on work i hope it works this is my last script to finish my rwc organizer automated. Quote Link to comment Share on other sites More sharing options...
GM Takumirai Posted July 10, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 592 Reputation: 31 Joined: 11/14/11 Last Seen: July 29, 2015 Share Posted July 10, 2012 http://rathena.org/board/topic/66873-party-vs-party/ = check this script i found on eAthena - its check party but not that good Quote Link to comment Share on other sites More sharing options...
Tonetzkii Posted July 10, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 323 Reputation: 9 Joined: 11/19/11 Last Seen: September 25, 2015 Share Posted July 10, 2012 Thanks but i have already party registration this script is 1 missing Quote Link to comment Share on other sites More sharing options...
Virtue Posted July 10, 2012 Group: Members Topic Count: 92 Topics Per Day: 0.02 Content Count: 354 Reputation: 22 Joined: 11/17/11 Last Seen: May 12, 2024 Share Posted July 10, 2012 Can you make this script + limit the party members to seven only? Just 7 members or 1 to 7 members ? Yup just 7 members fixed. not 1 to 7. I'll try to make some too, but just in case could you make it possible. Quote Link to comment Share on other sites More sharing options...
Tonetzkii Posted July 10, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 323 Reputation: 9 Joined: 11/19/11 Last Seen: September 25, 2015 Share Posted July 10, 2012 Error again. Quote Link to comment Share on other sites More sharing options...
KeyWorld Posted July 10, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 379 Reputation: 304 Joined: 11/10/11 Last Seen: December 2, 2014 Share Posted July 10, 2012 @Khaii This should fixed the problem : function script party_has_duplicate_job { set .@party_id, getarg( 0, getcharid(1) ); // Need to have a party. if ( .@party_id != 1 ) { return -1; } // Loading party members variables getpartymember .@party_id,1; getpartymember .@party_id,2; // Keep rid attached. set .@rid, playerattached(); // Check all members for ( set .@i,0; .@i<$@partymembercount; set .@i, .@i+1 ) { // Online user if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i]) ) { // Attach the member to access "Class" attachrid( $@partymemberaid[.@i] ); if ( compare( .@tmp_class$ + "|", "|" + Class + "|" ) ) { if ( .@rid ) attachrid(.@rid); else detachrid; return 1; } set .@tmp_class$, .@tmp_class$ + "|" + Class; } // Offline user (use sql) else { set .@sql$, .@sql$ + ( .@sql_i ? "OR " : "" ) + "`char_id`='" + $@partymembercid[.@i] + "' "; set .@sql_i, .@sql_i + 1; } } // SQL for offline users if ( getstrlen(.@sql$) ) { // get class from offline members set .@count, query_sql("SELECT `class` FROM `char` WHERE " + .@sql$, .@class ); // Check the class. for ( set .@i, 0; .@i<.@count; set .@i, .@i+1 ) { if ( compare( .@tmp_class$ + "|", "|" + .@class[.@i] + "|" ) ) { if ( .@rid ) attachrid(.@rid); else detachrid; return 1; } set .@tmp_class$, .@tmp_class$ + "|" + .@class[.@i]; } } // Restore RID. if ( .@rid ) attachrid(.@rid); else detachrid; return 0; } @Emnaj if ( callfunc("party_has_duplicate_job") ) { mes "It seems that someone in the party has the same class than another member. Please check again the requirements..."; close; } if ( $@partymembercount != 7 ) { mes "You have to be 7 on the team."; close; } mes "OK, no problem with your party, let's go !"; Quote Link to comment Share on other sites More sharing options...
Virtue Posted July 10, 2012 Group: Members Topic Count: 92 Topics Per Day: 0.02 Content Count: 354 Reputation: 22 Joined: 11/17/11 Last Seen: May 12, 2024 Share Posted July 10, 2012 (edited) @khaii have you tried this? function<tab>script<tab>party_has_duplicate_job<tab>{ set .@party_id, getarg( 0, getcharid(1) ); // Need to have a party. if ( .@party_id != 1 ) { return -1; } // Loading party members variables getpartymember getcharid(1),1; getpartymember getcharid(1),2; // Keep rid attached. set .@rid, playerattached(); // Check all members for ( set .@i,0; .@i<$@partymembercount; set .@i, .@i+1 ) { // Online user if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i]) ) { // Attach the member to access "Class" attachrid( $@partymemberaid[.@i] ); if ( compare( .@tmp_class$ + "|", "|" + Class + "|" ) ) { if ( .@rid ) attachrid(.@rid); else detachrid; return 1; } set .@tmp_class$, .@tmp_class$ + "|" + Class; } // Offline user (use sql) else { set .@sql$, .@sql$ + ( .@sql_i ? "OR " : "" ) "`char_id`='" + $@partymembercid[.@i] + "' "; set .@sql_i, .@sql_i + 1; } } // SQL for offline users if ( getstrlen(.@sql$) ) { // get class from offline members set .@count, query_sql("SELECT `class` FROM `char` WHERE " + .@sql$, .@class ); // Check the class. for ( set .@i, 0; .@i<.@count; set .@i, .@i+1 ) { if ( compare( .@tmp_class$ + "|", "|" + .@class[.@i] + "|" ) ) { if ( .@rid ) attachrid(.@rid); else detachrid; return 1; } set .@tmp_class$, .@tmp_class$ + "|" + .@class[.@i]; } } // Restore RID. if ( .@rid ) attachrid(.@rid); else detachrid; return 0; } Edited July 10, 2012 by Emnaj Quote Link to comment Share on other sites More sharing options...
Tonetzkii Posted July 10, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 323 Reputation: 9 Joined: 11/19/11 Last Seen: September 25, 2015 Share Posted July 10, 2012 @Emnaj , KeyWorld Its working now thank you very much! for fast reply. Now my problem is i have a 2 jobs not same. look the picture prontera,153,167,3 script War Organizer 89,{ mes "[War Organizer]"; mes "Welcome "+strcharinfo(0)+"!"; mes "I am the War Arena Organizer"; menu "Choose the Room Battle",L_Choose; L_Choose: menu "Arena 3 (Open)",L_Arena3; L_Arena3: next; mes "[War Organizer]"; if ( callfunc("party_has_duplicate_job") ) { mes "It seems that someone in the party has the same class than another member. Please check again the requirements..."; close; } if ( $@partymembercount != 2 ) { mes "You have to be 2 on the team."; close; } mes "OK, no problem with your party, let's go !"; warp "quiz_02",37,63; end; } Quote Link to comment Share on other sites More sharing options...
Virtue Posted July 10, 2012 Group: Members Topic Count: 92 Topics Per Day: 0.02 Content Count: 354 Reputation: 22 Joined: 11/17/11 Last Seen: May 12, 2024 Share Posted July 10, 2012 i have not yet tested this but I will reply as soon as i can, Quote Link to comment Share on other sites More sharing options...
Tonetzkii Posted July 10, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 323 Reputation: 9 Joined: 11/19/11 Last Seen: September 25, 2015 Share Posted July 10, 2012 bump! Quote Link to comment Share on other sites More sharing options...
KeyWorld Posted July 11, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 379 Reputation: 304 Joined: 11/10/11 Last Seen: December 2, 2014 Share Posted July 11, 2012 My fault, I copy deathscythe13's base script without reading : function script party_has_duplicate_job { set .@party_id, getarg( 0, getcharid(1) ); // Need to have a party. if ( !.@party_id ) { return -1; } // Loading party members variables getpartymember .@party_id, 1; getpartymember .@party_id, 2; // Keep rid attached. set .@rid, playerattached(); // Check all members for ( set .@i,0; .@i<$@partymembercount; set .@i, .@i+1 ) { // Online user if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i]) ) { // Attach the member to access "Class" attachrid( $@partymemberaid[.@i] ); if ( compare( .@tmp_class$ + "|", "|" + Class + "|" ) ) { if ( .@rid ) attachrid(.@rid); else detachrid; return 1; } set .@tmp_class$, .@tmp_class$ + "|" + Class; } // Offline user (use sql) else { set .@sql$, .@sql$ + ( .@sql_i ? "OR " : "" ) + "`char_id`='" + $@partymembercid[.@i] + "' "; set .@sql_i, .@sql_i + 1; } } // SQL for offline users if ( getstrlen(.@sql$) ) { // get class from offline members set .@count, query_sql("SELECT `class` FROM `char` WHERE " + .@sql$, .@class ); // Check the class. for ( set .@i, 0; .@i<.@count; set .@i, .@i+1 ) { if ( compare( .@tmp_class$ + "|", "|" + .@class[.@i] + "|" ) ) { if ( .@rid ) attachrid(.@rid); else detachrid; return 1; } set .@tmp_class$, .@tmp_class$ + "|" + .@class[.@i]; } } // Restore RID. if ( .@rid ) attachrid(.@rid); else detachrid; return 0; } 1 Quote Link to comment Share on other sites More sharing options...
Tonetzkii Posted July 11, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 323 Reputation: 9 Joined: 11/19/11 Last Seen: September 25, 2015 Share Posted July 11, 2012 Its working now thank you! i have organizer rwc now. Quote Link to comment Share on other sites More sharing options...
SlashGeeGee Posted July 11, 2012 Group: Members Topic Count: 111 Topics Per Day: 0.02 Content Count: 573 Reputation: 20 Joined: 11/19/11 Last Seen: October 24, 2014 Share Posted July 11, 2012 Its working now thank you! i have organizer rwc now. will you share it ? Quote Link to comment Share on other sites More sharing options...
Virtue Posted July 11, 2012 Group: Members Topic Count: 92 Topics Per Day: 0.02 Content Count: 354 Reputation: 22 Joined: 11/17/11 Last Seen: May 12, 2024 Share Posted July 11, 2012 its not quite easy to make one but if he is willing to share it it would be great for the others. clue : make the KVM scripts as a pattern then add the partychecker. at least thats what i did. Quote Link to comment Share on other sites More sharing options...
Question
kyeme
I need a Party checker NPC script for not allowing same Job in the Party. Can anyone help me?
Link to comment
Share on other sites
29 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.