Browse Source

Suggestion of implementation of is_party_leader and is_guild_leader script commands. (#3617)

* Implemented is_party_leader and is_guild_leader script commands.

Thanks to @cydh !
Atemo 6 years ago
parent
commit
78edf851a0
49 changed files with 217 additions and 164 deletions
  1. 14 0
      doc/script_commands.txt
  2. 1 1
      npc/custom/events/mvp_ladder.txt
  3. 3 3
      npc/custom/official/GeffenMagicTournament.txt
  4. 1 1
      npc/events/gdevent_aru.txt
  5. 1 1
      npc/events/gdevent_sch.txt
  6. 4 6
      npc/events/god_se_festival.txt
  7. 1 1
      npc/events/nguild/nguild_managers.txt
  8. 1 1
      npc/guild/agit_main.txt
  9. 1 1
      npc/guild/trs_rp.txt
  10. 3 3
      npc/guild2/agit_main_se.txt
  11. 1 1
      npc/instances/EndlessTower.txt
  12. 3 3
      npc/instances/NydhoggsNest.txt
  13. 2 2
      npc/instances/OrcsMemory.txt
  14. 8 10
      npc/instances/SealedShrine.txt
  15. 1 1
      npc/other/CashShop_Functions.txt
  16. 3 4
      npc/other/arena/arena_party.txt
  17. 4 4
      npc/other/poring_war.txt
  18. 7 8
      npc/quests/guildrelay.txt
  19. 2 2
      npc/quests/okolnir.txt
  20. 8 17
      npc/quests/partyrelay.txt
  21. 2 2
      npc/quests/quests_louyang.txt
  22. 3 3
      npc/quests/seals/god_weapon_creation.txt
  23. 1 1
      npc/re/cities/malaya.txt
  24. 2 2
      npc/re/guild/mission_main.txt
  25. 2 2
      npc/re/instances/AirshipAssault.txt
  26. 3 3
      npc/re/instances/BakonawaLake.txt
  27. 1 1
      npc/re/instances/BangungotHospital.txt
  28. 1 1
      npc/re/instances/BuwayaCave.txt
  29. 2 2
      npc/re/instances/CentralLaboratory.txt
  30. 13 13
      npc/re/instances/DevilTower.txt
  31. 2 2
      npc/re/instances/EclageInterior.txt
  32. 4 4
      npc/re/instances/FacewormsNest.txt
  33. 2 2
      npc/re/instances/GhostPalace.txt
  34. 1 1
      npc/re/instances/HazyForest.txt
  35. 4 4
      npc/re/instances/HorrorToyFactory.txt
  36. 2 2
      npc/re/instances/IsleOfBios.txt
  37. 3 3
      npc/re/instances/LastRoom.txt
  38. 4 4
      npc/re/instances/MalangdoCulvert.txt
  39. 2 2
      npc/re/instances/MorseCave.txt
  40. 1 1
      npc/re/instances/OctopusCave.txt
  41. 5 5
      npc/re/instances/OldGlastHeim.txt
  42. 6 6
      npc/re/instances/RoomOfConsciousness.txt
  43. 6 6
      npc/re/instances/SaraMemory.txt
  44. 6 6
      npc/re/instances/SarahAndFenrir.txt
  45. 5 5
      npc/re/instances/WolfchevLaboratory.txt
  46. 9 9
      npc/re/quests/quests_16_1.txt
  47. 1 1
      npc/re/quests/woe_te/te_goditem_alde1.txt
  48. 1 1
      npc/re/quests/woe_te/te_goditem_prt01.txt
  49. 54 0
      src/map/script.cpp

+ 14 - 0
doc/script_commands.txt

@@ -3353,6 +3353,13 @@ guild specified by the ID. 0 if the character is not a guild master of any guild
 
 
 ---------------------------------------
 ---------------------------------------
 
 
+*is_guild_leader({<guild ID>})
+
+This command will return true if the player attached to the script is the leader
+of his/her guild, or, if a guild ID is specified, of that guild.
+
+---------------------------------------
+
 *getcastlename("<map name>")
 *getcastlename("<map name>")
 
 
 This function returns the name of the castle when given the map name for that
 This function returns the name of the castle when given the map name for that
@@ -9777,6 +9784,13 @@ returns "null" instead of the character name, and -1 for the other types.
 
 
 ---------------------------------------
 ---------------------------------------
 
 
+*is_party_leader({<party ID>})
+
+This command will return true if the player attached to the script is the leader
+of his/her party, or, if a party ID is specified, of that party.
+
+---------------------------------------
+
 *party_create("<party name>"{,<character id>{,<item share>,<item share type>}});
 *party_create("<party name>"{,<character id>{,<item share>,<item share type>}});
 
 
 Organizes a party with the attached or specified character as leader. If
 Organizes a party with the attached or specified character as leader. If

+ 1 - 1
npc/custom/events/mvp_ladder.txt

@@ -63,7 +63,7 @@ prontera,164,171,3	script	MvP Ladder Warper	56,{
 		mes "You have to form a party to play.";
 		mes "You have to form a party to play.";
 		close;
 		close;
 	}
 	}
-	if ( getpartyleader( getcharid(1), 2 ) != getcharid(0) ) {
+	if ( is_party_leader() == false ) {
 		mes "[MvP Ladder Warper]";
 		mes "[MvP Ladder Warper]";
 		mes "Only the party leader can register.";
 		mes "Only the party leader can register.";
 		close;
 		close;

+ 3 - 3
npc/custom/official/GeffenMagicTournament.txt

@@ -625,7 +625,7 @@ dali,100,147,3	script	Dimensional Device#gefma	PORTAL,{
 			getpartymember(getcharid(1),0);
 			getpartymember(getcharid(1),0);
 			set .@GPPartySize,$@partymembercount;
 			set .@GPPartySize,$@partymembercount;
 			
 			
-			if( !getcharid(1) || getcharid(3) != getpartyleader( getcharid(1),1 ) || .@GPPartySize > 1) {
+			if( !getcharid(1) || is_party_leader() == false || .@GPPartySize > 1) {
 				mes .@n$;
 				mes .@n$;
 				mes "This is a solo instance. Please form a solo party before continuing.";
 				mes "This is a solo instance. Please form a solo party before continuing.";
 				end;
 				end;
@@ -737,7 +737,7 @@ dali,98,141,3	script	Emmitt White	4_M_KHKYEL,{
 		getpartymember(getcharid(1),0);
 		getpartymember(getcharid(1),0);
 		set .@GPPartySize,$@partymembercount;
 		set .@GPPartySize,$@partymembercount;
 		
 		
-		if( !getcharid(1) || getcharid(3) != getpartyleader( getcharid(1),1 ) || .@GPPartySize > 1) {
+		if( !getcharid(1) || is_party_leader() == false || .@GPPartySize > 1) {
 			mes .@n$;
 			mes .@n$;
 			mes "This is a solo instance. Please form a solo party before continuing.";
 			mes "This is a solo instance. Please form a solo party before continuing.";
 			end;
 			end;
@@ -757,7 +757,7 @@ dali,98,141,3	script	Emmitt White	4_M_KHKYEL,{
 				end;
 				end;
 			}
 			}
 			
 			
-		if (getcharid(0) == getpartyleader(.@party_id,2)){
+		if (is_party_leader() == true){
 			mes .@n$; 
 			mes .@n$; 
 			mes "Did you know? A long time ago there was a Magic Tournament in Geffen.";
 			mes "Did you know? A long time ago there was a Magic Tournament in Geffen.";
 			next;
 			next;

+ 1 - 1
npc/events/gdevent_aru.txt

@@ -504,7 +504,7 @@ arug_que01,100,81,3	script	Pierrot Pier#aru_gd	715,{
 		mes "- and come back later. -";
 		mes "- and come back later. -";
 		close;
 		close;
 	}
 	}
-	if (strcharinfo(0) == getguildmaster(getcharid(2))) {
+	if (is_guild_leader() == true) {
 		if ($@gdeventv_a2 == 0) {
 		if ($@gdeventv_a2 == 0) {
 			set .@que_2143,checkquest(2143,PLAYTIME);
 			set .@que_2143,checkquest(2143,PLAYTIME);
 			if (.@que_2143 == -1) {
 			if (.@que_2143 == -1) {

+ 1 - 1
npc/events/gdevent_sch.txt

@@ -503,7 +503,7 @@ schg_que01,100,81,3	script	Pierrot Pier#sch_gd	715,{
 		mes "- and come back later. -";
 		mes "- and come back later. -";
 		close;
 		close;
 	}
 	}
-	if (strcharinfo(0) == getguildmaster(getcharid(2))) {
+	if (is_guild_leader() == true) {
 		if ($@gdeventv_s2 == 0) {
 		if ($@gdeventv_s2 == 0) {
 			set .@que_2143,checkquest(2143,PLAYTIME);
 			set .@que_2143,checkquest(2143,PLAYTIME);
 			if (.@que_2143 == -1) {
 			if (.@que_2143 == -1) {

+ 4 - 6
npc/events/god_se_festival.txt

@@ -47,13 +47,12 @@ yuno,1,1,0	script	Festival Manager#gq_fes0	891,{
 }
 }
 
 
 yuno,118,192,5	script	Rmimi Ravies#gq_fes01	891,{
 yuno,118,192,5	script	Rmimi Ravies#gq_fes01	891,{
-	set .@GID, getcharid(2);
 	if (countitem(7840) > 0) {
 	if (countitem(7840) > 0) {
 		mes "[Rmimi Ravies]";
 		mes "[Rmimi Ravies]";
 		mes "This is the flower.";
 		mes "This is the flower.";
 		mes "This is just a formality, but let me check your qualifications.";
 		mes "This is just a formality, but let me check your qualifications.";
 		next;
 		next;
-		if (strcharinfo(0) == getguildmaster(.@GID)) {
+		if (is_guild_leader() == true) {
 			mes "[Rmimi Ravies]";
 			mes "[Rmimi Ravies]";
 			mes "Your qualification is verified as a Guild master.";
 			mes "Your qualification is verified as a Guild master.";
 			next;
 			next;
@@ -123,7 +122,7 @@ yuno,118,192,5	script	Rmimi Ravies#gq_fes01	891,{
 				mes "Have a good time.";
 				mes "Have a good time.";
 				donpcevent "Rmimi Ravies#gq_fes01::OnStart";
 				donpcevent "Rmimi Ravies#gq_fes01::OnStart";
 				
 				
-				announce "["+ strcharinfo(0) +"] member of ["+ GetGuildName(.@GID) +"] is summoning a 'Valkyrie's Present' in 'Juno'.",bc_all,"0x70dbdb";
+				announce "["+ strcharinfo(0) +"] member of ["+ GetGuildName( getcharid(2) ) +"] is summoning a 'Valkyrie's Present' in 'Juno'.",bc_all,"0x70dbdb";
 				close;
 				close;
 			}
 			}
 			else {
 			else {
@@ -425,13 +424,12 @@ rachel,1,1,0	script	Festival Manager#gq_fes2	891,{
 }
 }
 
 
 rachel,132,117,3	script	Rhehe Ravies#gq_fes03	891,{
 rachel,132,117,3	script	Rhehe Ravies#gq_fes03	891,{
-	set .@GID, getcharid(2);
 	if (countitem(7840) > 0) {
 	if (countitem(7840) > 0) {
 		mes "[Rhehe Ravies]";
 		mes "[Rhehe Ravies]";
 		mes "A flower!!";
 		mes "A flower!!";
 		mes "Shall we proceed?";
 		mes "Shall we proceed?";
 		next;
 		next;
-		if (strcharinfo(0) == getguildmaster(.@GID)) {
+		if (is_guild_leader() == true) {
 			mes "[Rhehe Ravies]";
 			mes "[Rhehe Ravies]";
 			mes "Eeeeh, so young and yet you're a guild master? Your guildsmen must be jealous.";
 			mes "Eeeeh, so young and yet you're a guild master? Your guildsmen must be jealous.";
 			next;
 			next;
@@ -504,7 +502,7 @@ rachel,132,117,3	script	Rhehe Ravies#gq_fes03	891,{
 				mes "[Rhehe Ravies]";
 				mes "[Rhehe Ravies]";
 				mes "I hope you enjoy yourself!";
 				mes "I hope you enjoy yourself!";
 				donpcevent "Rhehe Ravies#gq_fes03::OnStart";
 				donpcevent "Rhehe Ravies#gq_fes03::OnStart";
-				announce "["+ strcharinfo(0) +"] member of ["+ GetGuildName(.@GID) +"] is summoning a 'Valkyrie's Present' in 'Rachel'.",bc_all,"0x70dbdb";
+				announce "["+ strcharinfo(0) +"] member of ["+ GetGuildName( getcharid(2) ) +"] is summoning a 'Valkyrie's Present' in 'Rachel'.",bc_all,"0x70dbdb";
 				close;
 				close;
 			}
 			}
 			else {
 			else {

+ 1 - 1
npc/events/nguild/nguild_managers.txt

@@ -39,7 +39,7 @@ function	script	F_GldManager	{
 		mes "Where are the guardians? Destroy these intruders!";
 		mes "Where are the guardians? Destroy these intruders!";
 		return;
 		return;
 	}
 	}
-	if (strcharinfo(0) != getguildmaster(.@gid)){
+	if (is_guild_leader() == false){
 		mes "You're not ^5533FF" + getguildmaster(.@gid) + "^000000! I am here to follow ^5533FF" + getguildmaster(.@gid) + "^000000's command only";
 		mes "You're not ^5533FF" + getguildmaster(.@gid) + "^000000! I am here to follow ^5533FF" + getguildmaster(.@gid) + "^000000's command only";
 		return 0;
 		return 0;
 	}
 	}

+ 1 - 1
npc/guild/agit_main.txt

@@ -610,7 +610,7 @@ OnRecvCastle:
 		mes "Brave soul... fate will guide you towards your future...";
 		mes "Brave soul... fate will guide you towards your future...";
 		close;
 		close;
 	}
 	}
-	if (GetGuildMaster(.@GID) != strcharinfo(0)) {
+	if (is_guild_leader(.@GID) == false) {
 		mes "["+strnpcinfo(1)+"]";
 		mes "["+strnpcinfo(1)+"]";
 		mes "No matter how much you pester me, I'll still follow my master ^ff0000"+GetGuildMaster(.@GID)+"^000000. Where are the Guardians?! Send these ruffians away right now!";
 		mes "No matter how much you pester me, I'll still follow my master ^ff0000"+GetGuildMaster(.@GID)+"^000000. Where are the Guardians?! Send these ruffians away right now!";
 		close;
 		close;

+ 1 - 1
npc/guild/trs_rp.txt

@@ -20,7 +20,7 @@
 	end;
 	end;
 OnTouch:
 OnTouch:
 	set .@GID, getcastledata(strnpcinfo(2),1);
 	set .@GID, getcastledata(strnpcinfo(2),1);
-	if (strcharinfo(0) != getguildmaster(.@GID)) {
+	if (is_guild_leader(.@GID) == false) {
 		if (compare(strnpcinfo(2),"aldeg"))
 		if (compare(strnpcinfo(2),"aldeg"))
 			warp "aldebaran",143,112;
 			warp "aldebaran",143,112;
 		else if (compare(strnpcinfo(2),"gefg"))
 		else if (compare(strnpcinfo(2),"gefg"))

+ 3 - 3
npc/guild2/agit_main_se.txt

@@ -215,7 +215,7 @@ OnTreasureDied:
 		mes "to conquer this stronghold?";
 		mes "to conquer this stronghold?";
 		close;
 		close;
 	}
 	}
-	if (getcharid(2) != .@GID || strcharinfo(0) != getguildmaster(.@GID)) {
+	if (is_guild_leader(.@GID) == false) {
 		mes "[ Steward ]";
 		mes "[ Steward ]";
 		mes "Hmpf. Your threats don't";
 		mes "Hmpf. Your threats don't";
 		mes "scare me! Guardians, drive";
 		mes "scare me! Guardians, drive";
@@ -648,7 +648,7 @@ OnStartArena:
 		close;
 		close;
 	}
 	}
 	if (getcharid(2) == .@GID) {
 	if (getcharid(2) == .@GID) {
-		if (strcharinfo(0) != getguildmaster(.@GID)) {
+		if (is_guild_leader() == false) {
 			mes .@n$;
 			mes .@n$;
 			mes "As guardian of this";
 			mes "As guardian of this";
 			mes "stronghold, I answer only";
 			mes "stronghold, I answer only";
@@ -1108,7 +1108,7 @@ OnEnable:
 	set .@num, atoi(charat(strnpcinfo(1),15));
 	set .@num, atoi(charat(strnpcinfo(1),15));
 	set .@var$,"$agit_"+strnpcinfo(2);
 	set .@var$,"$agit_"+strnpcinfo(2);
 	if (getcharid(2) == .@GID) {
 	if (getcharid(2) == .@GID) {
-		if (strcharinfo(0) == getguildmaster(.@GID)) {
+		if (is_guild_leader() == true) {
 			if (getd(.@var$+"["+(.@num+1)+"]") == 2) {
 			if (getd(.@var$+"["+(.@num+1)+"]") == 2) {
 				mes "^3355FFDemolished Fortress";
 				mes "^3355FFDemolished Fortress";
 				mes "Gates can be repaired,";
 				mes "Gates can be repaired,";

+ 1 - 1
npc/instances/EndlessTower.txt

@@ -216,7 +216,7 @@ e_tower,81,105,0	script	Tower Protection Stone	406,{
 	}
 	}
 	switch(.@etower_timer) {
 	switch(.@etower_timer) {
 	case -1:
 	case -1:
-		if (getcharid(0) == getpartyleader(.@party_id,2)) {
+		if (is_party_leader() == true) {
 			mes "Confirmed the party has been made. Would you like to reserve entrance to the Endless Tower?";
 			mes "Confirmed the party has been made. Would you like to reserve entrance to the Endless Tower?";
 			next;
 			next;
 			switch(select("Generate dungeon "+.@md_name$+":Enter the dungeon:Return to Alberta:Cancel")) {
 			switch(select("Generate dungeon "+.@md_name$+":Enter the dungeon:Return to Alberta:Cancel")) {

+ 3 - 3
npc/instances/NydhoggsNest.txt

@@ -108,7 +108,7 @@ nyd_dun02,100,201,3	script	Yggdrasil Gatekeeper	111,8,8,{
 				mes "And only 1 representative of you needs to talk to me, so don't annoy me...";
 				mes "And only 1 representative of you needs to talk to me, so don't annoy me...";
 				close;
 				close;
 			}
 			}
-			if (getcharid(0) == getpartyleader(.@party_id,2)) {
+			if (is_party_leader(.@party_id) == true) {
 				mes "[Yggdrasil Gatekeeper]";
 				mes "[Yggdrasil Gatekeeper]";
 				mes "The loyal servants of the Guardian... what can I do for you?";
 				mes "The loyal servants of the Guardian... what can I do for you?";
 				next;
 				next;
@@ -1591,7 +1591,7 @@ OnTouch_:
 		mes "I thank you deeply for your decision. I will use what is left of my powers to open up the path towards the Guardian's Nest.";
 		mes "I thank you deeply for your decision. I will use what is left of my powers to open up the path towards the Guardian's Nest.";
 		next;
 		next;
 		mes "[World Tree Yggdrasil]";
 		mes "[World Tree Yggdrasil]";
-		if (getcharid(0) == getpartyleader(getcharid(1),2)) {
+		if (is_party_leader() == true) {
 			mes "The path to the Guardian's Nest is just past the waterfall by the large World Tree Yggdrasil to the North. The defensive mechanisms of the Sanctuary will start immediately.";
 			mes "The path to the Guardian's Nest is just past the waterfall by the large World Tree Yggdrasil to the North. The defensive mechanisms of the Sanctuary will start immediately.";
 			next;
 			next;
 			mes "[World Tree Yggdrasil]";
 			mes "[World Tree Yggdrasil]";
@@ -1844,7 +1844,7 @@ OnTouch:
 
 
 2@nyd,199,268,0	script	nyd_2f_boss_enter	-1,8,8,{
 2@nyd,199,268,0	script	nyd_2f_boss_enter	-1,8,8,{
 OnTouch_:
 OnTouch_:
-	if (getcharid(0) == getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == true) {
 		donpcevent instance_npcname("nyd_2f_boss_enter_call")+"::OnEnable";
 		donpcevent instance_npcname("nyd_2f_boss_enter_call")+"::OnEnable";
 		disablenpc instance_npcname("nyd_2f_boss_enter");
 		disablenpc instance_npcname("nyd_2f_boss_enter");
 		end;
 		end;

+ 2 - 2
npc/instances/OrcsMemory.txt

@@ -47,7 +47,7 @@ gef_fild10,242,202,0	script	Dimensional Gorge Piece	406,{
 
 
 	set .@orctime,checkquest(12059,PLAYTIME);
 	set .@orctime,checkquest(12059,PLAYTIME);
 	if (.@orctime == -1) {
 	if (.@orctime == -1) {
-		if (getcharid(0) == getpartyleader(.@party_id,2)) {
+		if (is_party_leader() == true) {
 			mes "Party status confirmed. Would you like to book entrance to the "+.@md_name$+"?";
 			mes "Party status confirmed. Would you like to book entrance to the "+.@md_name$+"?";
 			next;
 			next;
 			switch(select("Reserve the "+.@md_name$+":Enter the Dungeon:Cancel")) {
 			switch(select("Reserve the "+.@md_name$+":Enter the Dungeon:Cancel")) {
@@ -677,7 +677,7 @@ OnTimer23910:
 }
 }
 
 
 2@orcs,26,164,0	script	Torch#1-1	844,{
 2@orcs,26,164,0	script	Torch#1-1	844,{
-	if(getpartyleader(getcharid(1),2) != getcharid(0)) end;
+	if (is_party_leader() == false) end;
 	progressbar "ffff00",5;
 	progressbar "ffff00",5;
 	setarray .@id[0], atoi(charat(strnpcinfo(2),0)), atoi(charat(strnpcinfo(2),2));
 	setarray .@id[0], atoi(charat(strnpcinfo(2),0)), atoi(charat(strnpcinfo(2),2));
 	if (.@id[1] == 4)
 	if (.@id[1] == 4)

+ 8 - 10
npc/instances/SealedShrine.txt

@@ -109,7 +109,7 @@ monk_test,309,146,3	script	Friar Patrick#edq	412,{
 			//set .@ins_bapho_check2,checkquest(3045,PLAYTIME);
 			//set .@ins_bapho_check2,checkquest(3045,PLAYTIME);
 
 
 			if (.@ins_bapho_check == -1) {
 			if (.@ins_bapho_check == -1) {
-				if (getpartyleader(.@party_id,2) == getcharid(0) && instance_check_party(.@party_id,2,75)) {
+				if (is_party_leader(.@party_id) == true && instance_check_party(.@party_id,2,75)) {
 					mes "[Friar Patrick]";
 					mes "[Friar Patrick]";
 					mes "Party name is "+getpartyname(.@party_id)+"...";
 					mes "Party name is "+getpartyname(.@party_id)+"...";
 					mes "Name of the leader is "+strcharinfo(0)+"...";
 					mes "Name of the leader is "+strcharinfo(0)+"...";
@@ -540,7 +540,7 @@ OnMyMobDead:
 		mes "If your ^0000FFparty leader^000000 brings me the pendant, my soul can be substantialized. So, hurry up.";
 		mes "If your ^0000FFparty leader^000000 brings me the pendant, my soul can be substantialized. So, hurry up.";
 		close;
 		close;
 	}
 	}
-	else if (('ins_baphomet == 2) && (getpartyleader(.@party_id,2) == getcharid(0))) {
+	else if (('ins_baphomet == 2) && is_party_leader(.@party_id) == true) {
 		mes "[Voice of the Gravestone]";
 		mes "[Voice of the Gravestone]";
 		mes "Did you find the pendant?";
 		mes "Did you find the pendant?";
 		next;
 		next;
@@ -652,7 +652,7 @@ OnInstanceInit: // Temporary fix for @reloadscript.
 				break;
 				break;
 			case 3:
 			case 3:
 				set .@ins_baphomet_1f_3,.@ins_baphomet_1f_3+1;
 				set .@ins_baphomet_1f_3,.@ins_baphomet_1f_3+1;
-				if (getpartyleader(.@party_id,2) == getcharid(0)) {
+				if (is_party_leader(.@party_id) == true) {
 					mes "[Ancient Hero's Soul]";
 					mes "[Ancient Hero's Soul]";
 					mes "You look like the leader of this party. You need to go and get ^0000FF10 Essence of Fire^000000 from the torches.";
 					mes "You look like the leader of this party. You need to go and get ^0000FF10 Essence of Fire^000000 from the torches.";
 					next;
 					next;
@@ -704,7 +704,7 @@ OnInstanceInit: // Temporary fix for @reloadscript.
 			}
 			}
 			if (.@exitloop) break;
 			if (.@exitloop) break;
 		}
 		}
-		if (getpartyleader(.@party_id,2) == getcharid(0)) {
+		if (is_party_leader(.@party_id) == true) {
 			mes "[Ancient Hero's Soul]";
 			mes "[Ancient Hero's Soul]";
 			mes "To remind you again, I must be substantialized within the next hour. So everyone, finish your work within that time!";
 			mes "To remind you again, I must be substantialized within the next hour. So everyone, finish your work within that time!";
 			set 'ins_baphomet,3;
 			set 'ins_baphomet,3;
@@ -721,7 +721,7 @@ OnInstanceInit: // Temporary fix for @reloadscript.
 		cutin "",255;
 		cutin "",255;
 		end;
 		end;
 	}
 	}
-	else if (('ins_baphomet == 3) && (getpartyleader(.@party_id,2) == getcharid(0))) {
+	else if (('ins_baphomet == 3) && is_party_leader(.@party_id) == true) {
 		cutin "ins_cata_champ_n",2;
 		cutin "ins_cata_champ_n",2;
 		mes "[Ancient Hero's Soul]";
 		mes "[Ancient Hero's Soul]";
 		mes "Did you get 10 ^0000FFEssence of Fire^000000 and ^0000FFToken of Apostle^000000?";
 		mes "Did you get 10 ^0000FFEssence of Fire^000000 and ^0000FFToken of Apostle^000000?";
@@ -758,7 +758,7 @@ OnInstanceInit: // Temporary fix for @reloadscript.
 		cutin "",255;
 		cutin "",255;
 		end;
 		end;
 	}
 	}
-	else if (('ins_baphomet == 4) && (getpartyleader(.@party_id,2) == getcharid(0))) {
+	else if (('ins_baphomet == 4) && is_party_leader(.@party_id) == true) {
 		cutin "ins_cata_champ_n",2;
 		cutin "ins_cata_champ_n",2;
 		mes "[Ancient Hero's Soul]";
 		mes "[Ancient Hero's Soul]";
 		mes "Are you ready? I opened the sealed gate. To pass the gate, you should carry a ^0000FFToken of Apostle^000000.";
 		mes "Are you ready? I opened the sealed gate. To pass the gate, you should carry a ^0000FFToken of Apostle^000000.";
@@ -881,8 +881,7 @@ OnInstanceInit:
 // Bobbing Torches
 // Bobbing Torches
 //============================================================
 //============================================================
 -	script	Bobbing Torch#SS	-1,{
 -	script	Bobbing Torch#SS	-1,{
-	set .@party_id,getcharid(1);
-	if (getpartyleader(.@party_id,2) == getcharid(0)) {
+	if (is_party_leader() == true) {
 		if (('ins_baphomet == 3) && (countitem(6001) < 11)) {
 		if (('ins_baphomet == 3) && (countitem(6001) < 11)) {
 			mes "A huge torch appearing as if it can burn everything is bobbing up and down in front of me.";
 			mes "A huge torch appearing as if it can burn everything is bobbing up and down in front of me.";
 			next;
 			next;
@@ -1120,8 +1119,7 @@ OnInstanceInit:
 2@cata,35,109,0	duplicate(Magical Seal#SS)	Magical Seal#10	844
 2@cata,35,109,0	duplicate(Magical Seal#SS)	Magical Seal#10	844
 
 
 2@cata,79,65,0	script	The Main Altar#ss	844,{
 2@cata,79,65,0	script	The Main Altar#ss	844,{
-	set .@party_id,getcharid(1);
-	if (('ins_baphomet == 5) && (getpartyleader(.@party_id,2) == getcharid(0))) {
+	if (('ins_baphomet == 5) && is_party_leader() == true) {
 		mes "An evil power, too terrible to describe, lies under the great altar radiating a violet color.";
 		mes "An evil power, too terrible to describe, lies under the great altar radiating a violet color.";
 		next;
 		next;
 		mes "Complicated Magical Rune letters blink rapidly, attempting to suppress the dreadful power within.";
 		mes "Complicated Magical Rune letters blink rapidly, attempting to suppress the dreadful power within.";

+ 1 - 1
npc/other/CashShop_Functions.txt

@@ -52,7 +52,7 @@ function	script	F_CashStore	{
 // - No arguments.
 // - No arguments.
 function	script	F_CashPartyCall	{
 function	script	F_CashPartyCall	{
 	warp "Random",0,0;
 	warp "Random",0,0;
-	if(getpartyleader(getcharid(1),2) == getcharid(0))
+	if (is_party_leader() == true)
 		warpparty "Leader", 0, 0, getcharid(1), strcharinfo(3), 3, 3;
 		warpparty "Leader", 0, 0, getcharid(1), strcharinfo(3), 3, 3;
 	return;
 	return;
 }
 }

+ 3 - 4
npc/other/arena/arena_party.txt

@@ -1006,7 +1006,6 @@ prt_are_in,77,135,3	script	Staff#party-2	67,{
 	mes "[Staff]";
 	mes "[Staff]";
 	mes "^3131FF"+$arena_pttopn$+"^000000's running time was ^3131FF"+$top_ptmin+"^000000minutes ^3131FF"+$top_ptsec+"^000000seconds.";
 	mes "^3131FF"+$arena_pttopn$+"^000000's running time was ^3131FF"+$top_ptmin+"^000000minutes ^3131FF"+$top_ptsec+"^000000seconds.";
 	next;
 	next;
-	set .arn_party,getcharid(1);
 	if (@gappt < 0) {
 	if (@gappt < 0) {
 		mes "[Staff]";
 		mes "[Staff]";
 		mes "Although you failed to make a new record, I hope you will succeed next time.";
 		mes "Although you failed to make a new record, I hope you will succeed next time.";
@@ -1034,7 +1033,7 @@ prt_are_in,77,135,3	script	Staff#party-2	67,{
 			mes "See you later~";
 			mes "See you later~";
 			close2;
 			close2;
 		}
 		}
-		if(getpartyleader(.arn_party,2) == getcharid(0)) {
+		if (is_party_leader() == true) {
 			donpcevent "#arn_timer_pt::OnStop";
 			donpcevent "#arn_timer_pt::OnStop";
 			donpcevent "alloff#pt::OnEnable";
 			donpcevent "alloff#pt::OnEnable";
 			donpcevent "Ponox::OnStart";
 			donpcevent "Ponox::OnStart";
@@ -1049,7 +1048,7 @@ prt_are_in,77,135,3	script	Staff#party-2	67,{
 		mes "Wow! You have renewed the record!";
 		mes "Wow! You have renewed the record!";
 		mes "What a great job!";
 		mes "What a great job!";
 		next;
 		next;
-		if(getpartyleader(.arn_party,2) == getcharid(0)) {
+		if (is_party_leader() == true) {
 			mes "[Staff]";
 			mes "[Staff]";
 			mes "You can record you and your party members on ^FF0000the hall of Arena Time Force Battle party ^000000.";
 			mes "You can record you and your party members on ^FF0000the hall of Arena Time Force Battle party ^000000.";
 			mes "When you enter a name, the name will be remained on the top unless someone make a new record.";
 			mes "When you enter a name, the name will be remained on the top unless someone make a new record.";
@@ -1112,7 +1111,7 @@ prt_are_in,77,135,3	script	Staff#party-2	67,{
 			mes "See you later~";
 			mes "See you later~";
 			close2;
 			close2;
 		}
 		}
-		if(getpartyleader(.arn_party,2) == getcharid(0)) {
+		if (is_party_leader() == true) {
 			donpcevent "#arn_timer_pt::OnStop";
 			donpcevent "#arn_timer_pt::OnStop";
 			donpcevent "alloff#pt::OnEnable";
 			donpcevent "alloff#pt::OnEnable";
 			donpcevent "Ponox::OnStart";
 			donpcevent "Ponox::OnStart";

+ 4 - 4
npc/other/poring_war.txt

@@ -648,7 +648,7 @@ poring_w02,26,181,3	script	Mr. Doppel#wop_team_a	739,{
 			mes "If you don't get there in time, you won't make it to the battle.";
 			mes "If you don't get there in time, you won't make it to the battle.";
 			close;
 			close;
 		case 2:
 		case 2:
-			if ((getpartyleader(getcharid(1),2) == getcharid(0))) {
+			if (is_party_leader() == true) {
 				mes "[Mr. Doppel]";
 				mes "[Mr. Doppel]";
 				mes "So, you are the leader. Before going to the battlefield, you should check all your members.";
 				mes "So, you are the leader. Before going to the battlefield, you should check all your members.";
 				next;
 				next;
@@ -680,7 +680,7 @@ poring_w02,26,181,3	script	Mr. Doppel#wop_team_a	739,{
 		}
 		}
 	}
 	}
 	else {
 	else {
-		if ((getpartyleader(getcharid(1),2) == getcharid(0))) {
+		if (is_party_leader() == true) {
 			if ($@wop_team_a == 0) {
 			if ($@wop_team_a == 0) {
 				mes "[Mr. Doppel]";
 				mes "[Mr. Doppel]";
 				mes "So, you are the party leader of Angeling Team.";
 				mes "So, you are the party leader of Angeling Team.";
@@ -779,7 +779,7 @@ poring_w02,170,181,3	script	Mr. Doppel#wop_team_d	739,{
 			mes "If you don't get there in time, you won't make it to the battle.";
 			mes "If you don't get there in time, you won't make it to the battle.";
 			close;
 			close;
 		case 2:
 		case 2:
-			if ((getpartyleader(getcharid(1),2) == getcharid(0))) {
+			if (is_party_leader() == true) {
 				mes "[Mr. Doppel]";
 				mes "[Mr. Doppel]";
 				mes "So, you are the leader. Before going to the battlefield, you should check all your members.";
 				mes "So, you are the leader. Before going to the battlefield, you should check all your members.";
 				next;
 				next;
@@ -809,7 +809,7 @@ poring_w02,170,181,3	script	Mr. Doppel#wop_team_d	739,{
 			}
 			}
 		}
 		}
 	} else {
 	} else {
-		if ((getpartyleader(getcharid(1),2) == getcharid(0))) {
+		if (is_party_leader() == true) {
 			if ($@wop_team_d == 0) {
 			if ($@wop_team_d == 0) {
 				mes "[Mr. Doppel]";
 				mes "[Mr. Doppel]";
 				mes "So, you are the party leader of Deviling Team.";
 				mes "So, you are the party leader of Deviling Team.";

+ 7 - 8
npc/quests/guildrelay.txt

@@ -69,7 +69,7 @@
 		close;
 		close;
 	}
 	}
 	if (getcharid(2) == .@GID) {
 	if (getcharid(2) == .@GID) {
-		if (strcharinfo(0) == getguildmaster(.@GID)) {
+		if (is_guild_leader() == true) {
 			if (guildrelay_q == 100) {
 			if (guildrelay_q == 100) {
 				if (guildtime > 22) {
 				if (guildtime > 22) {
 					if ((gettime(DT_HOUR) > 1) && (gettime(DT_HOUR) < guildtime)) {
 					if ((gettime(DT_HOUR) > 1) && (gettime(DT_HOUR) < guildtime)) {
@@ -1247,7 +1247,7 @@
 		close;
 		close;
 	}
 	}
 	if (getcharid(2) == .@GID) {
 	if (getcharid(2) == .@GID) {
-		if (strcharinfo(0) == getguildmaster(.@GID)) {
+		if (is_guild_leader() == true) {
 			if (countitem(7234) > 0) {
 			if (countitem(7234) > 0) {
 				mes "[" + .@name$ + "]";
 				mes "[" + .@name$ + "]";
 				mes "Hm. You can't just keep";
 				mes "Hm. You can't just keep";
@@ -1710,7 +1710,7 @@
 		}
 		}
 	}
 	}
 	else {
 	else {
-		if (strcharinfo(0) == getguildmaster(.@GID)) {
+		if (is_guild_leader(.@GID) == true) {
 			mes "[" + .@name$ + "]";
 			mes "[" + .@name$ + "]";
 			mes "Hm? What brings you";
 			mes "Hm? What brings you";
 			mes "here? Feel free to take";
 			mes "here? Feel free to take";
@@ -1751,7 +1751,7 @@
 		close;
 		close;
 	}
 	}
 	if (getcharid(2) == .@GID) {
 	if (getcharid(2) == .@GID) {
-		if (strcharinfo(0) == getguildmaster(.@GID)) {
+		if (is_guild_leader() == true) {
 			if (countitem(7240) > 0) {
 			if (countitem(7240) > 0) {
 				mes "[" + .@name$ + "]";
 				mes "[" + .@name$ + "]";
 				mes "Hm? What are you doing?";
 				mes "Hm? What are you doing?";
@@ -2266,7 +2266,7 @@
 		}
 		}
 	}
 	}
 	else {
 	else {
-		if (strcharinfo(0) == getguildmaster(.@GID)) {
+		if (is_guild_leader(.@GID) == true) {
 			mes "[" + .@name$ + "]";
 			mes "[" + .@name$ + "]";
 			mes "Hm. You're the master";
 			mes "Hm. You're the master";
 			mes "of another guild, aren't";
 			mes "of another guild, aren't";
@@ -2436,7 +2436,7 @@
 		close;
 		close;
 	}
 	}
 	if (getcharid(2) == .@GID) {
 	if (getcharid(2) == .@GID) {
-		if (strcharinfo(0) == getguildmaster(.@GID)) {
+		if (is_guild_leader() == true) {
 			if (countitem(7246) > 0) {
 			if (countitem(7246) > 0) {
 				mes "[" + .@name$ + "]";
 				mes "[" + .@name$ + "]";
 				mes "Hm? That spirit that";
 				mes "Hm? That spirit that";
@@ -2512,7 +2512,6 @@
 			}
 			}
 			getpartymember(getcharid(1));
 			getpartymember(getcharid(1));
 			set .@partymembercount,$@partymembercount;
 			set .@partymembercount,$@partymembercount;
-			set .@partyleader,getpartyleader(getcharid(1),2);
 			if (guildrelay_q == 91) {
 			if (guildrelay_q == 91) {
 				if (.@partymembercount == 6) {
 				if (.@partymembercount == 6) {
 					mes "[" + .@name$ + "]";
 					mes "[" + .@name$ + "]";
@@ -3059,7 +3058,7 @@
 		}
 		}
 	}
 	}
 	else {
 	else {
-		if (strcharinfo(0) == getguildmaster(.@GID)) {
+		if (is_guild_leader(.@GID) == true) {
 			mes "[" + .@name$ + "]";
 			mes "[" + .@name$ + "]";
 			mes "You might be the master";
 			mes "You might be the master";
 			mes "of a guild, but you and I";
 			mes "of a guild, but you and I";

+ 2 - 2
npc/quests/okolnir.txt

@@ -174,7 +174,7 @@ que_qsch05,345,23,0	warp	Gate02#gq_sch05	1,1,schg_cas05,369,306
 	set .@GID, GetCastleData(.@t$,1);
 	set .@GID, GetCastleData(.@t$,1);
 	if (getcharid(2) == .@GID) {
 	if (getcharid(2) == .@GID) {
 		cutin "wish_maiden31",1;
 		cutin "wish_maiden31",1;
-		if (strcharinfo(0) == getguildmaster(.@GID)) {
+		if (is_guild_leader() == true) {
 			mes "[Wish Maiden]";
 			mes "[Wish Maiden]";
 			mes "I am... Wish maiden.";
 			mes "I am... Wish maiden.";
 			mes "Mourning in this virtual realm, Okolnir.";
 			mes "Mourning in this virtual realm, Okolnir.";
@@ -2146,7 +2146,7 @@ que_qsch05,251,255,3	duplicate(Wish Maiden#main_boss)	Wish Maiden#sch05_boss	193
 	set .@t$, ((compare(strnpcinfo(4),"aru"))?"arug_cas0":"schg_cas0")+(charat(strnpcinfo(4),getstrlen(strnpcinfo(4))-1));
 	set .@t$, ((compare(strnpcinfo(4),"aru"))?"arug_cas0":"schg_cas0")+(charat(strnpcinfo(4),getstrlen(strnpcinfo(4))-1));
 	set .@GID, GetCastleData(.@t$,1);
 	set .@GID, GetCastleData(.@t$,1);
 	if (getcharid(2) == .@GID) {
 	if (getcharid(2) == .@GID) {
-		if (strcharinfo(0) == getguildmaster(.@GID)) {
+		if (is_guild_leader() == true) {
 			if (compare(.@sub$,"aru")) {
 			if (compare(.@sub$,"aru")) {
 				setarray .@n, 7835,1,7836,1,7837,1,7838,1,2513,1,7291,10,7293,10,7063,100,985,20;
 				setarray .@n, 7835,1,7836,1,7837,1,7838,1,2513,1,7291,10,7293,10,7063,100,985,20;
 				set .@rwd, 2541; //Asprika
 				set .@rwd, 2541; //Asprika

+ 8 - 17
npc/quests/partyrelay.txt

@@ -18,7 +18,7 @@
 payon,103,113,3	script	Ledrion#payon::RelayLedrion	109,{
 payon,103,113,3	script	Ledrion#payon::RelayLedrion	109,{
 	getpartymember(getcharid(1));
 	getpartymember(getcharid(1));
 	set .@partymembercount,$@partymembercount;
 	set .@partymembercount,$@partymembercount;
-	set .@partyleader,getpartyleader(getcharid(1),2);
+	set .@partyleader, is_party_leader();
 	if (checkweight(907,300) == 0) {
 	if (checkweight(907,300) == 0) {
 		mes "^3355FFWait a minute! You're";
 		mes "^3355FFWait a minute! You're";
 		mes "carrying too many items";
 		mes "carrying too many items";
@@ -36,7 +36,7 @@ payon,103,113,3	script	Ledrion#payon::RelayLedrion	109,{
 		mes "of your group members with you.";
 		mes "of your group members with you.";
 		close;
 		close;
 	}
 	}
-	if ((countitem(7741) > 0) && (.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5)) {
+	if ((countitem(7741) > 0) && .@partyleader == true && (getcharid(2) > 0) && (.@partymembercount > 5)) {
 		mes "[Ledrion]";
 		mes "[Ledrion]";
 		mes "Ah, you've brought the";
 		mes "Ah, you've brought the";
 		mes "last ticket from Rospii.";
 		mes "last ticket from Rospii.";
@@ -111,7 +111,7 @@ payon,103,113,3	script	Ledrion#payon::RelayLedrion	109,{
 		mes "over to Gatan right now?";
 		mes "over to Gatan right now?";
 		close;
 		close;
 	}
 	}
-	if ((countitem(7737) > 0) && (.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5)) {
+	if ((countitem(7737) > 0) && .@partyleader == true && (getcharid(2) > 0) && (.@partymembercount > 5)) {
 		mes "[Ledrion]";
 		mes "[Ledrion]";
 		mes "Great, you've brought";
 		mes "Great, you've brought";
 		mes "me the eighth ticket from";
 		mes "me the eighth ticket from";
@@ -160,7 +160,7 @@ payon,103,113,3	script	Ledrion#payon::RelayLedrion	109,{
 		mes "a ticket to Gatan?";
 		mes "a ticket to Gatan?";
 		close;
 		close;
 	}
 	}
-	if ((countitem(7733) > 0) && (.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5)) {
+	if ((countitem(7733) > 0) && .@partyleader == true && (getcharid(2) > 0) && (.@partymembercount > 5)) {
 		mes "[Ledrion]";
 		mes "[Ledrion]";
 		mes "I see that you've brought";
 		mes "I see that you've brought";
 		mes "me the fourth ticket from";
 		mes "me the fourth ticket from";
@@ -201,7 +201,7 @@ payon,103,113,3	script	Ledrion#payon::RelayLedrion	109,{
 		mes "come to me, not yet.";
 		mes "come to me, not yet.";
 		close;
 		close;
 	}
 	}
-	if ((BaseLevel > 39) && (.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5) && (party_relay == 1)) {
+	if ((BaseLevel > 39) && .@partyleader == true && (getcharid(2) > 0) && (.@partymembercount > 5) && (party_relay == 1)) {
 		mes "[Ledrion]";
 		mes "[Ledrion]";
 		mes "As I mentioned earlier,";
 		mes "As I mentioned earlier,";
 		mes "I'm challenging guild";
 		mes "I'm challenging guild";
@@ -253,7 +253,7 @@ payon,103,113,3	script	Ledrion#payon::RelayLedrion	109,{
 		mes "once the time is right.";
 		mes "once the time is right.";
 		close;
 		close;
 	}
 	}
-	if ((.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5) && (party_relay > 0)) {
+	if (.@partyleader == true && (getcharid(2) > 0) && (.@partymembercount > 5) && (party_relay > 0)) {
 		mes "[Ledrion]";
 		mes "[Ledrion]";
 		mes "As leader of your";
 		mes "As leader of your";
 		mes "Party, you should";
 		mes "Party, you should";
@@ -262,7 +262,7 @@ payon,103,113,3	script	Ledrion#payon::RelayLedrion	109,{
 		mes "of your partners.";
 		mes "of your partners.";
 		close;
 		close;
 	}
 	}
-	if ((.@partyleader != getcharid(0)) && (getcharid(2) > 0)) {
+	if (.@partyleader == false && (getcharid(2) > 0)) {
 		mes "[Ledrion]";
 		mes "[Ledrion]";
 		mes "I'm sorry, but there's";
 		mes "I'm sorry, but there's";
 		mes "nothing I can really offer";
 		mes "nothing I can really offer";
@@ -345,7 +345,7 @@ payon,103,113,3	script	Ledrion#payon::RelayLedrion	109,{
 	next;
 	next;
 	switch(select("Sure!:No.")) {
 	switch(select("Sure!:No.")) {
 	case 1:
 	case 1:
-		if ((BaseLevel > 39) && (.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5)) {
+		if ((BaseLevel > 39) && .@partyleader == true && (getcharid(2) > 0) && (.@partymembercount > 5)) {
 			mes "[Ledrion]";
 			mes "[Ledrion]";
 			mes "Great! Let's see...";
 			mes "Great! Let's see...";
 			mes "Well, you meet all the";
 			mes "Well, you meet all the";
@@ -384,9 +384,6 @@ payon,103,113,3	script	Ledrion#payon::RelayLedrion	109,{
 }
 }
 
 
 payon,83,327,3	script	Gatan#payon::RelayGatan	86,{
 payon,83,327,3	script	Gatan#payon::RelayGatan	86,{
-	getpartymember(getcharid(1));
-	set .@partymembercount,$@partymembercount;
-	set .@partyleader,getpartyleader(getcharid(1),2);
 	if (checkweight(907,300) == 0) {
 	if (checkweight(907,300) == 0) {
 		mes "^3355FFWait a minute! You're";
 		mes "^3355FFWait a minute! You're";
 		mes "carrying too many items";
 		mes "carrying too many items";
@@ -1819,9 +1816,6 @@ payon,83,327,3	script	Gatan#payon::RelayGatan	86,{
 }
 }
 
 
 payon,204,221,3	script	Bafhail#payon::RelayBafhail	731,{
 payon,204,221,3	script	Bafhail#payon::RelayBafhail	731,{
-	getpartymember(getcharid(1));
-	set .@partymembercount,$@partymembercount;
-	set .@partyleader,getpartyleader(getcharid(1),2);
 	if (checkweight(907,300) == 0) {
 	if (checkweight(907,300) == 0) {
 		mes "^3355FFWait a minute! You're";
 		mes "^3355FFWait a minute! You're";
 		mes "carrying too many items";
 		mes "carrying too many items";
@@ -2452,9 +2446,6 @@ payon,204,221,3	script	Bafhail#payon::RelayBafhail	731,{
 }
 }
 
 
 payon,168,314,3	script	Lospii#payon::RelayLospii	706,{
 payon,168,314,3	script	Lospii#payon::RelayLospii	706,{
-	getpartymember(getcharid(1));
-	set .@partymembercount,$@partymembercount;
-	set .@partyleader,getpartyleader(getcharid(1),2);
 	if (checkweight(907,300) == 0) {
 	if (checkweight(907,300) == 0) {
 		mes "^3355FFWait a minute! You're";
 		mes "^3355FFWait a minute! You're";
 		mes "carrying too many items";
 		mes "carrying too many items";

+ 2 - 2
npc/quests/quests_louyang.txt

@@ -4643,7 +4643,7 @@ lou_in02,77,37,7	script	Hermit	824,{
 				next;
 				next;
 				getpartymember(getcharid(1));
 				getpartymember(getcharid(1));
 				set @partymember,$@partymembercount;
 				set @partymember,$@partymembercount;
-				if (getpartyleader(getcharid(1),1) == getcharid(0) || !@partymember) {
+				if (is_party_leader() == true || !@partymember) {
 					mes "[Sun Mao]";
 					mes "[Sun Mao]";
 					mes "Now, the most important thing for our cause is to gather more recruits and increase our numbers. Please find others who will join us in our fight.";
 					mes "Now, the most important thing for our cause is to gather more recruits and increase our numbers. Please find others who will join us in our fight.";
 					next;
 					next;
@@ -4666,7 +4666,7 @@ lou_in02,77,37,7	script	Hermit	824,{
 			mes "If you're a real tourist, you do not want to get involved in our business, one way or another.";
 			mes "If you're a real tourist, you do not want to get involved in our business, one way or another.";
 			close;
 			close;
 		}
 		}
-	} else if (getpartyleader(getcharid(1),2) == getcharid(0)) {
+	} else if (is_party_leader() == true) {
 		if (QL_REVOL == 9) {
 		if (QL_REVOL == 9) {
 			mes "[Sun Mao]";
 			mes "[Sun Mao]";
 			mes "Once again,";
 			mes "Once again,";

+ 3 - 3
npc/quests/seals/god_weapon_creation.txt

@@ -72,7 +72,7 @@ gld_dun01,28,85,0	script	Grunburti#1::GodDwarf	826,{
 	case 3:
 	case 3:
 		set .@GID,getcharid(2);
 		set .@GID,getcharid(2);
 		if (($God1 < $@god_check2) || ($God2 < $@god_check2) || ($God3 < $@god_check2) || ($God4 < $@god_check2)){
 		if (($God1 < $@god_check2) || ($God2 < $@god_check2) || ($God3 < $@god_check2) || ($God4 < $@god_check2)){
-			if (($God1 >= $@god_check1) && ($God2 >= $@god_check1) && ($God3 >= $@god_check1) && ($God4 >= $@god_check1) && (strcharinfo(0) == getguildmaster(.@GID))) {
+			if (($God1 >= $@god_check1) && ($God2 >= $@god_check1) && ($God3 >= $@god_check1) && ($God4 >= $@god_check1) && (is_guild_leader() == true)) {
 				mes "[Dwarf Grunburti]";
 				mes "[Dwarf Grunburti]";
 				mes "Hmm...";
 				mes "Hmm...";
 				mes "I'll need some things to make a weapon for you. What exactly were you interested in having?";
 				mes "I'll need some things to make a weapon for you. What exactly were you interested in having?";
@@ -148,7 +148,7 @@ gld_dun01,28,85,0	script	Grunburti#1::GodDwarf	826,{
 			mes "Stop bothering me and get out of here! Go play with some monsters, you simple minded fool!";
 			mes "Stop bothering me and get out of here! Go play with some monsters, you simple minded fool!";
 			close;
 			close;
 		}
 		}
-		if (strcharinfo(0) != getguildmaster(.@GID)) {
+		if (is_guild_leader() == false) {
 			mes "[Dwarf Grunburti]";
 			mes "[Dwarf Grunburti]";
 			mes "I'll only present";
 			mes "I'll only present";
 			mes "my magnificent skills";
 			mes "my magnificent skills";
@@ -394,7 +394,7 @@ que_god01,154,112,4	script	Grunburti#god	826,{
 		close;
 		close;
 	}
 	}
 	set .@GID,getcharid(2);
 	set .@GID,getcharid(2);
-	if (strcharinfo(0) != getguildmaster(.@GID)) {
+	if (is_guild_leader() == false) {
 		mes "[Dwarf Grunburti]";
 		mes "[Dwarf Grunburti]";
 		mes "How in the...";
 		mes "How in the...";
 		mes "Get out of here!";
 		mes "Get out of here!";

+ 1 - 1
npc/re/cities/malaya.txt

@@ -221,7 +221,7 @@ OnBingx2:
 OnTouch_:
 OnTouch_:
 	set .@i, atoi(strnpcinfo(2));
 	set .@i, atoi(strnpcinfo(2));
 	if (.@i%4 == 2) {
 	if (.@i%4 == 2) {
-		if (getcharid(0) == getpartyleader(getcharid(1),2))
+		if (is_party_leader() == true)
 			set .@pass,1;
 			set .@pass,1;
 	} else if (.@i%4 == 3) {
 	} else if (.@i%4 == 3) {
 		if (checkquest(4229,PLAYTIME) > -1 && checkquest(9223,PLAYTIME) > -1 && checkquest(12278,PLAYTIME) > -1)
 		if (checkquest(4229,PLAYTIME) > -1 && checkquest(9223,PLAYTIME) > -1 && checkquest(12278,PLAYTIME) > -1)

+ 2 - 2
npc/re/guild/mission_main.txt

@@ -59,7 +59,7 @@ function calcjobexp;
 	switch(select("Conquering " + .region$[.@zoneid], "Guild Dungeon Daily Quests", "About quests", "I don't need it.")){
 	switch(select("Conquering " + .region$[.@zoneid], "Guild Dungeon Daily Quests", "About quests", "I don't need it.")){
 		case 1: // Conquering.
 		case 1: // Conquering.
 			.@gid = getcharid(2);
 			.@gid = getcharid(2);
-			if(.@gid && getguildmaster(.@gid) == strcharinfo(0)){
+			if(.@gid && is_guild_leader() == true){
 				.@time_check1 = checkquest(.conquer_delay_questid[.@zoneid], PLAYTIME);
 				.@time_check1 = checkquest(.conquer_delay_questid[.@zoneid], PLAYTIME);
 				if(.@time_check1 == 0){
 				if(.@time_check1 == 0){
 					mes .@npcname$;
 					mes .@npcname$;
@@ -175,7 +175,7 @@ function calcjobexp;
 					getitem 6615,1;
 					getitem 6615,1;
 				} else {
 				} else {
 					mes .@npcname$;
 					mes .@npcname$;
-					mes "Hmm? It seems like you haven't completed the mission yet";
+					mes "Hmm? It seems like you haven't completed the mission yet..";
 					mes "Is there any problem?";
 					mes "Is there any problem?";
 					next;
 					next;
 					if(select("No.","Give up the quest.") == 1){
 					if(select("No.","Give up the quest.") == 1){

+ 2 - 2
npc/re/instances/AirshipAssault.txt

@@ -42,12 +42,12 @@ dali02,142,81,3	script	Dimensional Device#air1	PORTAL,{
 		mes "^ff0000To enter, you must create or join a party of 1 or more members.^000000";
 		mes "^ff0000To enter, you must create or join a party of 1 or more members.^000000";
 		close;
 		close;
 	}
 	}
-	if (getcharid(0) != getpartyleader(.@party_id,2)) {
+	if (is_party_leader() == false) {
 		mes "^ff0000This Memorial Dungeon is only for 1 person. Only the party leader can enter.^000000";
 		mes "^ff0000This Memorial Dungeon is only for 1 person. Only the party leader can enter.^000000";
 		close;
 		close;
 	}
 	}
 	.@s = select( "Power Up the Device", "Use the Device", "Cancel" );
 	.@s = select( "Power Up the Device", "Use the Device", "Cancel" );
-	if (getcharid(0) != getpartyleader(.@party_id,2)) {
+	if (is_party_leader(.@party_id) == false) {
 		mes "^ff0000This Memorial Dungeon is only for 1 person. Only the party leader can enter.^000000";
 		mes "^ff0000This Memorial Dungeon is only for 1 person. Only the party leader can enter.^000000";
 		close;
 		close;
 	}
 	}

+ 3 - 3
npc/re/instances/BakonawaLake.txt

@@ -52,7 +52,7 @@ ma_scene01,174,179,4	script	Taho	541,{
 		close;
 		close;
 	}
 	}
 	if (.@baku_time == -1) {
 	if (.@baku_time == -1) {
-		if (getcharid(0) == getpartyleader(.@party_id,2)) {
+		if (is_party_leader() == true) {
 			mes "[Taho]";
 			mes "[Taho]";
 			mes "Are you the leader of the Bakonawa slayers? The road is not well so we have to go down the cliff with a rope, is that OK?";
 			mes "Are you the leader of the Bakonawa slayers? The road is not well so we have to go down the cliff with a rope, is that OK?";
 			next;
 			next;
@@ -130,7 +130,7 @@ sec_in02,26,26,4	script	Bakonawa's Rage	541,{
 	mes "[Taho]";
 	mes "[Taho]";
 	mes "Bakonawa becomes invincible at some point. When that time comes, listen to my guides carefully. Just trust me and all will be good.";
 	mes "Bakonawa becomes invincible at some point. When that time comes, listen to my guides carefully. Just trust me and all will be good.";
 	next;
 	next;
-	if (getcharid(0) == getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == true) {
 		mes "[Taho]";
 		mes "[Taho]";
 		mes "Now I will make Bakonawa spring out from the lake.";
 		mes "Now I will make Bakonawa spring out from the lake.";
 		next;
 		next;
@@ -514,7 +514,7 @@ OnTimer10000:
 	mes "[Taho]";
 	mes "[Taho]";
 	mes "HMM. We almost got him but he is one fast creature...";
 	mes "HMM. We almost got him but he is one fast creature...";
 	next;
 	next;
-	if (getcharid(0) == getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == true) {
 		mes "[Taho]";
 		mes "[Taho]";
 		mes "Are we going to try again?";
 		mes "Are we going to try again?";
 		next;
 		next;

+ 1 - 1
npc/re/instances/BangungotHospital.txt

@@ -241,7 +241,7 @@ S_NoParty:
 S_Enter:
 S_Enter:
 	.@md_name$ = "Bangungot Hospital 2F";
 	.@md_name$ = "Bangungot Hospital 2F";
 	if (getarg(1,1) == true) {
 	if (getarg(1,1) == true) {
-		if (getcharid(0) == getpartyleader(getcharid(1),2))
+		if (is_party_leader() == true)
 			.@menu$ = "Prepare to enter the second floor.";
 			.@menu$ = "Prepare to enter the second floor.";
 		mes "[Nurse Maenne]";
 		mes "[Nurse Maenne]";
 		if (getarg(0) == false) {
 		if (getarg(0) == false) {

+ 1 - 1
npc/re/instances/BuwayaCave.txt

@@ -35,7 +35,7 @@ ma_fild02,312,317,5	script	Guard#buwaya_cave	570,{
 		mes "team with other people.";
 		mes "team with other people.";
 		close;
 		close;
 	}
 	}
-	if (getcharid(0) == getpartyleader(.@party_id,2)) {
+	if (is_party_leader() == true) {
 		mes "[Guard]";
 		mes "[Guard]";
 		mes "This place is dangerous. Please go back.";
 		mes "This place is dangerous. Please go back.";
 		mes "If you dont have any business here, please go back.";
 		mes "If you dont have any business here, please go back.";

+ 2 - 2
npc/re/instances/CentralLaboratory.txt

@@ -103,7 +103,7 @@ verus01,149,155,5	script	Civilization Explorer#p	4_LGTSCIENCE,{
 		mes "Please talk to me after composing a party of 1 or more, or after joining a party.";
 		mes "Please talk to me after composing a party of 1 or more, or after joining a party.";
 		close;
 		close;
 	}
 	}
-	if (getpartyleader(.@party_id,2) != getcharid(0)) {
+	if (is_party_leader() == false) {
 		mes "[Civilization Explorer]";
 		mes "[Civilization Explorer]";
 		mes "Ah. You aren't the party leader. Take me to your leader! Or perhaps take your leader to me.";
 		mes "Ah. You aren't the party leader. Take me to your leader! Or perhaps take your leader to me.";
 		close;
 		close;
@@ -136,7 +136,7 @@ verus01,149,155,5	script	Civilization Explorer#p	4_LGTSCIENCE,{
 		mes "The entrance door is already open.";
 		mes "The entrance door is already open.";
 		close;
 		close;
 	}
 	}
-	if (getpartyleader(getcharid(1),2) != getcharid(0)) {
+	if (is_party_leader() == false) {
 		mes "[Probationary researcher]";
 		mes "[Probationary researcher]";
 		mes "Please hold. I am speaking with the guide about whether or not you have been authorized.";
 		mes "Please hold. I am speaking with the guide about whether or not you have been authorized.";
 		close;
 		close;

+ 13 - 13
npc/re/instances/DevilTower.txt

@@ -226,7 +226,7 @@ dali02,137,121,3	script	Magic Scholar Artie#tnm	4_M_FAIRYKID6,{
 		mes "Don't take any unncessary risks, okay?";
 		mes "Don't take any unncessary risks, okay?";
 		close;
 		close;
 	}
 	}
-	if (getpartyleader(.@party_id,2) != getcharid(0)) {
+	if (is_party_leader() == false) {
 		mes "[Artie]";
 		mes "[Artie]";
 		mes "Bring the Expedition Chief.";
 		mes "Bring the Expedition Chief.";
 		mes "Devil's Tower is not a place to visit alone.";
 		mes "Devil's Tower is not a place to visit alone.";
@@ -441,7 +441,7 @@ OnTimer26000:
 1@tnm1,57,112,5	script	Officer Heim#heim0	4_TOWER_05,{ end; }
 1@tnm1,57,112,5	script	Officer Heim#heim0	4_TOWER_05,{ end; }
 
 
 1@tnm1,56,110,3	script	Officer Heim#heim	4_TOWER_05,{
 1@tnm1,56,110,3	script	Officer Heim#heim	4_TOWER_05,{
-	if (getpartyleader(getcharid(1),2) != getcharid(0)) {
+	if (is_party_leader() == false) {
 		mes "[Officer Heim]";
 		mes "[Officer Heim]";
 		mes "Who brought you all here?";
 		mes "Who brought you all here?";
 		mes "I will talk to a representative.";
 		mes "I will talk to a representative.";
@@ -454,7 +454,7 @@ OnTimer26000:
 		npctalk "Officer Heim: Back up soldiers? So why are you just standing there?";
 		npctalk "Officer Heim: Back up soldiers? So why are you just standing there?";
 		next;
 		next;
 		select("Right now?");
 		select("Right now?");
-		if (getpartyleader(getcharid(1),2) == getcharid(0) && 'devil_tower == 0) {
+		if (is_party_leader() == true && 'devil_tower == 0) {
 			enablenpc instance_npcname("Healer Fama#feima");
 			enablenpc instance_npcname("Healer Fama#feima");
 			'devil_tower = 1;
 			'devil_tower = 1;
 		}
 		}
@@ -638,7 +638,7 @@ OnTouch:
 }
 }
 
 
 1@tnm1,46,105,5	script	Lucile#tnm01	4_F_LUCILE,{
 1@tnm1,46,105,5	script	Lucile#tnm01	4_F_LUCILE,{
-	if (getpartyleader(getcharid(1),2) != getcharid(0)) {
+	if (is_party_leader() == false) {
 		cutin "tnm_lucile01.bmp",2;
 		cutin "tnm_lucile01.bmp",2;
 		mes "[Lucile]";
 		mes "[Lucile]";
 		mes "Who is in charge of the back-up team?";
 		mes "Who is in charge of the back-up team?";
@@ -831,7 +831,7 @@ OnMobDead:
 1@tnm1,138,96,3	script	Lucile#tnm02	4_F_LUCILE,{
 1@tnm1,138,96,3	script	Lucile#tnm02	4_F_LUCILE,{
 	if (isbegin_quest(7571) == 0)
 	if (isbegin_quest(7571) == 0)
 		end;
 		end;
-	if (getpartyleader(getcharid(1),2) != getcharid(0)) {
+	if (is_party_leader() == false) {
 		mes "You wave your hand in front of her but she doesn't react.";
 		mes "You wave your hand in front of her but she doesn't react.";
 		close;
 		close;
 	}
 	}
@@ -857,7 +857,7 @@ OnMobDead:
 			next;
 			next;
 			sleep2 750;
 			sleep2 750;
 			npctalk "Lucile: Please hold tight.";
 			npctalk "Lucile: Please hold tight.";
-			if (getpartyleader(getcharid(1),2) == getcharid(0) && 'devil_tower == 4) {
+			if (is_party_leader() == true && 'devil_tower == 4) {
 				donpcevent instance_npcname("Huey#hui02") + "::OnEnable";
 				donpcevent instance_npcname("Huey#hui02") + "::OnEnable";
 				'devil_tower = 5;
 				'devil_tower = 5;
 			}
 			}
@@ -868,7 +868,7 @@ OnMobDead:
 		mes "I can hear mechanical sounds all of a sudden.";
 		mes "I can hear mechanical sounds all of a sudden.";
 		specialeffect EF_LEVEL99_3;
 		specialeffect EF_LEVEL99_3;
 		// progressbar "000000",40;	// fix me: progressbar doesn't display close button on cancel
 		// progressbar "000000",40;	// fix me: progressbar doesn't display close button on cancel
-		if (getpartyleader(getcharid(1),2) == getcharid(0) && 'devil_tower == 5) {
+		if (is_party_leader() == true && 'devil_tower == 5) {
 			if (isbegin_quest(7572) == 0)
 			if (isbegin_quest(7572) == 0)
 				setquest 7572;// Lucile...?
 				setquest 7572;// Lucile...?
 			'devil_tower = 6;
 			'devil_tower = 6;
@@ -996,7 +996,7 @@ OnMobDead:
 1@tnm2,133,139,5	duplicate(Officer Heim#heim0)	Demon Morocc#tnm01	1916
 1@tnm2,133,139,5	duplicate(Officer Heim#heim0)	Demon Morocc#tnm01	1916
 
 
 1@tnm2,144,137,3	script	Lucile#tnm03	4_F_LUCILE,{
 1@tnm2,144,137,3	script	Lucile#tnm03	4_F_LUCILE,{
-	if (getpartyleader(getcharid(1),2) != getcharid(0)) {
+	if (is_party_leader() == false) {
 		mes "[Lucile]";
 		mes "[Lucile]";
 		mes "I am talking to your party leader now so please step back for a while.";
 		mes "I am talking to your party leader now so please step back for a while.";
 		cutin "tnm_lucile01.bmp",2;
 		cutin "tnm_lucile01.bmp",2;
@@ -1012,7 +1012,7 @@ OnMobDead:
 		mes "We need to stop the demon...";
 		mes "We need to stop the demon...";
 		mes "Can you do that?";
 		mes "Can you do that?";
 		npctalk "Lucile: We need to stop the demon... Can you do that?";
 		npctalk "Lucile: We need to stop the demon... Can you do that?";
-		if (getpartyleader(getcharid(1),2) == getcharid(0) && 'devil_tower == 7) {
+		if (is_party_leader() == true && 'devil_tower == 7) {
 			if (isbegin_quest(7573) == 0)
 			if (isbegin_quest(7573) == 0)
 				setquest 7573;// Magic Swordman Thanatos
 				setquest 7573;// Magic Swordman Thanatos
 			'demon$ = instance_npcname("Demon Morocc#tnm01");
 			'demon$ = instance_npcname("Demon Morocc#tnm01");
@@ -1464,7 +1464,7 @@ OnTimer9000:
 		close;
 		close;
 	}
 	}
 	if ('devil_tower == 10) {
 	if ('devil_tower == 10) {
-		if (getpartyleader(getcharid(1),2) != getcharid(0)) {
+		if (is_party_leader() == false) {
 			mes "[Young Girl]";
 			mes "[Young Girl]";
 			mes "*weeping* The demons are so scary.";
 			mes "*weeping* The demons are so scary.";
 			close;
 			close;
@@ -1493,7 +1493,7 @@ OnTimer9000:
 		mes "Please come with me through the passage behind that shelf!";
 		mes "Please come with me through the passage behind that shelf!";
 		npctalk "Young Girl: Please come with me through the passage behind that shelf!";
 		npctalk "Young Girl: Please come with me through the passage behind that shelf!";
 		close2;
 		close2;
-		if (getpartyleader(getcharid(1),2) == getcharid(0) && 'devil_tower == 10) {
+		if (is_party_leader() == true && 'devil_tower == 10) {
 			enablenpc instance_npcname("#tnm3gate01");
 			enablenpc instance_npcname("#tnm3gate01");
 			enablenpc instance_npcname("#tnm3event02ect");
 			enablenpc instance_npcname("#tnm3event02ect");
 			'devil_tower = 11;
 			'devil_tower = 11;
@@ -1825,7 +1825,7 @@ OnTimer55500:
 1@tnm3,137,65,3	script	Loki#tnmloki02	4_M_ROKI2,{
 1@tnm3,137,65,3	script	Loki#tnmloki02	4_M_ROKI2,{
 	if ('devil_tower != 13)
 	if ('devil_tower != 13)
 		end;
 		end;
-	if (getpartyleader(getcharid(1),2) != getcharid(0)) {
+	if (is_party_leader() == false) {
 		mes "[Loki]";
 		mes "[Loki]";
 		mes "I am talking to your boss.";
 		mes "I am talking to your boss.";
 		close;
 		close;
@@ -1853,7 +1853,7 @@ OnTimer55500:
 	mes "You will be in charge of activating Mind Blaster.";
 	mes "You will be in charge of activating Mind Blaster.";
 	npctalk "Loki: You will be in charge of activating Mind Blaster.", instance_npcname("Loki#tnmloki02");
 	npctalk "Loki: You will be in charge of activating Mind Blaster.", instance_npcname("Loki#tnmloki02");
 	next;
 	next;
-	if (getpartyleader(getcharid(1),2) == getcharid(0) && 'devil_tower == 13) {
+	if (is_party_leader() == true && 'devil_tower == 13) {
 		disablenpc instance_npcname("Loki#tnmloki02");
 		disablenpc instance_npcname("Loki#tnmloki02");
 		mes "^4d4dffLoki, Guillotine Cross of the Assassin Guild, has joined your party.";
 		mes "^4d4dffLoki, Guillotine Cross of the Assassin Guild, has joined your party.";
 		mes "We have to get rid of the demonic Lord Knight by Mind Blasting him with Loki's skill.^000000";
 		mes "We have to get rid of the demonic Lord Knight by Mind Blasting him with Loki's skill.^000000";

+ 2 - 2
npc/re/instances/EclageInterior.txt

@@ -18,7 +18,7 @@ ecl_hub01,132,12,3	script	Chief of Staff#tl02	435,{
 	.@party_id = getcharid(1);
 	.@party_id = getcharid(1);
 	.@md_name$ = "Eclage Interior";
 	.@md_name$ = "Eclage Interior";
 
 
-	if (.@party_id == 0 || getpartyleader(.@party_id,2) != getcharid(0)){
+	if (.@party_id == 0 || is_party_leader() == false){
 		mes "-! Warning !-";
 		mes "-! Warning !-";
 		mes "This current quest will be held at Memorial dungeon.";
 		mes "This current quest will be held at Memorial dungeon.";
 		mes "Only the party leader will enter. Please create your party.";
 		mes "Only the party leader will enter. Please create your party.";
@@ -62,7 +62,7 @@ ecl_hub01,130,15,0	script	It is closed shut.	844,{
 		if (select("Enter it.:Forget it.") == 1) {
 		if (select("Enter it.:Forget it.") == 1) {
 			.@party_id = getcharid(1);
 			.@party_id = getcharid(1);
 			.@md_name$ = "Eclage Interior";
 			.@md_name$ = "Eclage Interior";
-			if (.@party_id == 0 || getpartyleader(.@party_id,2) != getcharid(0)) {
+			if (.@party_id == 0 || is_party_leader() == false) {
 				mes "-! Warning !-";
 				mes "-! Warning !-";
 				mes "This current quest will be held at Memorial dungeon.";
 				mes "This current quest will be held at Memorial dungeon.";
 				mes "Only the party leader will enter. Please create your party.";
 				mes "Only the party leader will enter. Please create your party.";

+ 4 - 4
npc/re/instances/FacewormsNest.txt

@@ -333,7 +333,7 @@ dali,80,60,4	script	Magic Scholar	4_M_SAGE_C,{
 	}
 	}
 	switch( checkquest(12325,PLAYTIME) ) {
 	switch( checkquest(12325,PLAYTIME) ) {
 	case -1:
 	case -1:
-		if (getcharid(0) == getpartyleader(.@party_id,2)) {
+		if (is_party_leader() == true) {
 			mes "[Magic Scholar]";
 			mes "[Magic Scholar]";
 			mes "What can I do for you?";
 			mes "What can I do for you?";
 			next;
 			next;
@@ -440,7 +440,7 @@ dali,72,55,4	script	Interdimensional Device	CLEAR_NPC,{
 //============================================================
 //============================================================
 1@face,110,348,6	script	Chaos#0	4_M_CHAOS,{
 1@face,110,348,6	script	Chaos#0	4_M_CHAOS,{
 	cutin "h_chaos01",2;
 	cutin "h_chaos01",2;
-	if (getcharid(0) != getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == false) {
 		mes "[Chaos]";
 		mes "[Chaos]";
 		mes "I do not know what this is about, but I'm talking to your leader so please wait for a while ok?";
 		mes "I do not know what this is about, but I'm talking to your leader so please wait for a while ok?";
 		close2;
 		close2;
@@ -680,7 +680,7 @@ OnInstanceInit:
 //============================================================
 //============================================================
 1@face,120,97,6	script	Chaos#1	4_M_CHAOS,{
 1@face,120,97,6	script	Chaos#1	4_M_CHAOS,{
 	cutin "h_chaos01",2;
 	cutin "h_chaos01",2;
-	if (getcharid(0) != getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == false) {
 		mes "[Chaos]";
 		mes "[Chaos]";
 		mes "I do not know what this is about, but I'm talking to your leader so please wait for a while ok?";
 		mes "I do not know what this is about, but I'm talking to your leader so please wait for a while ok?";
 		close2;
 		close2;
@@ -896,7 +896,7 @@ OnInstanceInit:
 //============================================================
 //============================================================
 1@face,153,113,7	script	Chaos#2	4_M_CHAOS,{
 1@face,153,113,7	script	Chaos#2	4_M_CHAOS,{
 	cutin "h_chaos01",2;
 	cutin "h_chaos01",2;
-	if (getcharid(0) != getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == false) {
 		mes "[Chaos]";
 		mes "[Chaos]";
 		mes "I do not know what this is about, but I'm talking to your leader so please wait for a while ok?";
 		mes "I do not know what this is about, but I'm talking to your leader so please wait for a while ok?";
 		close2;
 		close2;

+ 2 - 2
npc/re/instances/GhostPalace.txt

@@ -17,7 +17,7 @@ dali02,43,129,5	script	Unpleasant Royal Guard#	4_M_SAKRAYROYAL,{
 		close;
 		close;
 	}
 	}
 	.@party_id = getcharid(1);
 	.@party_id = getcharid(1);
-	if (getcharid(0) != getpartyleader(.@party_id,2) || .@party_id < 1) {
+	if (is_party_leader() == false || .@party_id < 1) {
 		mes "[Unpleasant Royal Guard]";
 		mes "[Unpleasant Royal Guard]";
 		mes "I can only open the secret passage for party leaders. Please have your party leader talk to me.";
 		mes "I can only open the secret passage for party leaders. Please have your party leader talk to me.";
 		close;
 		close;
@@ -98,7 +98,7 @@ dali02,40,134,5	script	Interdimensional Device#dk	PORTAL,{
 		close;
 		close;
 	}
 	}
 	.@party_id = getcharid(1);
 	.@party_id = getcharid(1);
-	if (getcharid(0) != getpartyleader(.@party_id,2) || .@party_id < 1) {
+	if (is_party_leader() == false || .@party_id < 1) {
 		mes "[Unpleasant Royal Guard]";
 		mes "[Unpleasant Royal Guard]";
 		mes "I can only open the secret passage for party leaders. Please have your party leader talk to me.";
 		mes "I can only open the secret passage for party leaders. Please have your party leader talk to me.";
 		close;
 		close;

+ 1 - 1
npc/re/instances/HazyForest.txt

@@ -32,7 +32,7 @@ bif_fild01,158,340,5	script	Laphine Soldier#mist	447,{
 		close;
 		close;
 	}
 	}
 	set .@playtime, checkquest(7211,PLAYTIME);
 	set .@playtime, checkquest(7211,PLAYTIME);
-	if (getcharid(0) == getpartyleader(.@party_id,2)) {
+	if (is_party_leader() == true) {
 		if (.@playtime == 0 || .@playtime == 1) {
 		if (.@playtime == 0 || .@playtime == 1) {
 			mes "[Laphine Soldier]";
 			mes "[Laphine Soldier]";
 			mes "...Are you sure you're not doing too much?";
 			mes "...Are you sure you're not doing too much?";

+ 4 - 4
npc/re/instances/HorrorToyFactory.txt

@@ -146,7 +146,7 @@ xmas,237,303,3	script	Catherine Jet Johnson	4_F_SKULL06GIRL,{
 	}
 	}
 	switch( checkquest(12331,PLAYTIME) ) {
 	switch( checkquest(12331,PLAYTIME) ) {
 	case -1:
 	case -1:
-		if (getpartyleader(getcharid(1),2) != getcharid(0)) {
+		if (is_party_leader() == false) {
 			mes "[Catherine Jet Johnson]";
 			mes "[Catherine Jet Johnson]";
 			mes "Eh.. Give me a second. I am talking to the person in charge. Please wait a little bit.";
 			mes "Eh.. Give me a second. I am talking to the person in charge. Please wait a little bit.";
 			close;
 			close;
@@ -226,7 +226,7 @@ xmas,233,305,4	script	Factory Dimension Telep	PORTAL,{
 		mes "Please wait until the transformation is finished. You cannot move to another area until you become normal.";
 		mes "Please wait until the transformation is finished. You cannot move to another area until you become normal.";
 		close;
 		close;
 	}
 	}
-	if (getpartyleader(getcharid(1),2) != getcharid(0)) {
+	if (is_party_leader() == false) {
 		mes "[Catherine Jet Johnson]";
 		mes "[Catherine Jet Johnson]";
 		mes "Eh.. Give me a second. I am talking to the person in charge. Please wait.";
 		mes "Eh.. Give me a second. I am talking to the person in charge. Please wait.";
 		close;
 		close;
@@ -367,7 +367,7 @@ OnTimer1000:
 }
 }
 
 
 1@xm_d,71,129,3	script	#fac1bs	4_M_COOKIE,{
 1@xm_d,71,129,3	script	#fac1bs	4_M_COOKIE,{
-	if (getpartyleader(getcharid(1),2) == getcharid(0)) {
+	if (is_party_leader() == true) {
 		.@mob_id_transform = getstatus(SC_MONSTER_TRANSFORM,1);
 		.@mob_id_transform = getstatus(SC_MONSTER_TRANSFORM,1);
 		mes "[Coordinator]";
 		mes "[Coordinator]";
 		if (.@mob_id_transform == 1246) {
 		if (.@mob_id_transform == 1246) {
@@ -565,7 +565,7 @@ OnMyMobDead:
 
 
 
 
 1@xm_d,185,100,6	script	Catherine Jet Johnson#2	4_F_SKULL06GIRL,{
 1@xm_d,185,100,6	script	Catherine Jet Johnson#2	4_F_SKULL06GIRL,{
-	if (getpartyleader(getcharid(1),2) == getcharid(0)) {
+	if (is_party_leader() == true) {
 		mes "[Catherine Jet Johnson]";
 		mes "[Catherine Jet Johnson]";
 		mes "Lucky you got here safely.";
 		mes "Lucky you got here safely.";
 		next;
 		next;

+ 2 - 2
npc/re/instances/IsleOfBios.txt

@@ -48,7 +48,7 @@ moro_cav,50,64,5	script	Yellow Seed#bios	CLEAR_NPC,{
 			erasequest 15008;// Memorial Dungeon: Isle of Bios
 			erasequest 15008;// Memorial Dungeon: Isle of Bios
 		break;
 		break;
 	}
 	}
-	if (getpartyleader(.@party_id,2) == getcharid(0))
+	if (is_party_leader() == true)
 		.@create$ = "Create Memorial dungeon.";
 		.@create$ = "Create Memorial dungeon.";
 	switch( select( .@create$, "Enter Isle of Bios.", "Cancel." ) ) {
 	switch( select( .@create$, "Enter Isle of Bios.", "Cancel." ) ) {
 	case 1:
 	case 1:
@@ -61,7 +61,7 @@ moro_cav,50,64,5	script	Yellow Seed#bios	CLEAR_NPC,{
 		case IE_NOMEMBER:
 		case IE_NOMEMBER:
 		case IE_NOINSTANCE:
 		case IE_NOINSTANCE:
 		case IE_OTHER:
 		case IE_OTHER:
-			if (getpartyleader(getcharid(1),2) != getcharid(0)) {
+			if (is_party_leader(.@party_id) == false) {
 				mes "^ff0000Please note that This Memorial Dungeon cannot be accessed for 23 hours after your last visit.^000000";
 				mes "^ff0000Please note that This Memorial Dungeon cannot be accessed for 23 hours after your last visit.^000000";
 				next;
 				next;
 			}
 			}

+ 3 - 3
npc/re/instances/LastRoom.txt

@@ -29,7 +29,7 @@ un_myst,163,38,5	script	Mark	4_M_BLUEMAN,{
 	switch( checkquest(11379,PLAYTIME) ) {
 	switch( checkquest(11379,PLAYTIME) ) {
 	case -1:
 	case -1:
 		.@party_id = getcharid(1);
 		.@party_id = getcharid(1);
-		if (getpartyleader(.@party_id,2) == getcharid(0))
+		if (is_party_leader() == true)
 			.@string$ = "Open door.";
 			.@string$ = "Open door.";
 		.@s = select( .@string$, "Go in.", "Quit." );
 		.@s = select( .@string$, "Go in.", "Quit." );
 		if (.@s == 1) {
 		if (.@s == 1) {
@@ -114,7 +114,7 @@ un_myst,163,38,5	script	Mark	4_M_BLUEMAN,{
 		mes "[Verity]";
 		mes "[Verity]";
 		mes "Umph...I suddenly have a feeling that's not good.";
 		mes "Umph...I suddenly have a feeling that's not good.";
 		cutin "EP15_2_brt_6.bmp",2;
 		cutin "EP15_2_brt_6.bmp",2;
-		if (getpartyleader(getcharid(1),2) != getcharid(0)) {
+		if (is_party_leader() == false) {
 			mes "I wish to talk with the leader.";
 			mes "I wish to talk with the leader.";
 			close3;
 			close3;
 		}
 		}
@@ -238,7 +238,7 @@ OnMyMobDead2:
 	mes "[Tamarin]";
 	mes "[Tamarin]";
 	mes "Huff huff... Verity suddenly huff huff couldn't even stand straight before huff huff...";
 	mes "Huff huff... Verity suddenly huff huff couldn't even stand straight before huff huff...";
 	cutin "ep143_tahuk.bmp",2;
 	cutin "ep143_tahuk.bmp",2;
-	if (getpartyleader(getcharid(1),2) != getcharid(0)) {
+	if (is_party_leader() == false) {
 		next;
 		next;
 		mes "[Tamarin]";
 		mes "[Tamarin]";
 		mes "I don't think this is a problem we can solve by talking amongst ourselves.";
 		mes "I don't think this is a problem we can solve by talking amongst ourselves.";

+ 4 - 4
npc/re/instances/MalangdoCulvert.txt

@@ -392,7 +392,7 @@ mal_in01,160,34,4	script	Missing, the Cleaner	545,{
 	}
 	}
 	set .@playtime, checkquest(12254,PLAYTIME);
 	set .@playtime, checkquest(12254,PLAYTIME);
 	if (.@playtime == -1) {
 	if (.@playtime == -1) {
-		if (getcharid(0) == getpartyleader(.@party_id,2)) {
+		if (is_party_leader() == true) {
 			mes "[Missing, the Cleaner]";
 			mes "[Missing, the Cleaner]";
 			mes "Ummm? What's up? Tell me the password if you're the leader!";
 			mes "Ummm? What's up? Tell me the password if you're the leader!";
 			next;
 			next;
@@ -455,7 +455,7 @@ L_Enter:
 // Instance: Common Scripts
 // Instance: Common Scripts
 //============================================================
 //============================================================
 1@pump,63,100,4	script	Missing, the Cleaner#0	545,{
 1@pump,63,100,4	script	Missing, the Cleaner#0	545,{
-	if (getcharid(0) != getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == false) {
 		mes "[Missing, the Cleaner]";
 		mes "[Missing, the Cleaner]";
 		mes "I am trying to have a conversation with your leader now. Please don't disturb and wait!";
 		mes "I am trying to have a conversation with your leader now. Please don't disturb and wait!";
 		close;
 		close;
@@ -546,7 +546,7 @@ function	script	F_mal_missing	{
 	mes "[Missing, the Cleaner]";
 	mes "[Missing, the Cleaner]";
 	mes "I don't care if you get help from your friends or not. I want you to clean up all culverts! Don't forget! I will watch you and give you instructions. Just do what I said!!";
 	mes "I don't care if you get help from your friends or not. I want you to clean up all culverts! Don't forget! I will watch you and give you instructions. Just do what I said!!";
 	next;
 	next;
-	if (getcharid(0) != getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == false) {
 		mes "[Missing, the Cleaner]";
 		mes "[Missing, the Cleaner]";
 		mes "Once your leader finishes preparing, it will begin, so get your hearts ready for it!!";
 		mes "Once your leader finishes preparing, it will begin, so get your hearts ready for it!!";
 		close;
 		close;
@@ -575,7 +575,7 @@ function	script	F_mal_missing	{
 	mes "[Missing, the Cleaner]";
 	mes "[Missing, the Cleaner]";
 	mes "I see seaweed everywhere because you're wiggling! All the culverts will be blocked with seaweed!";
 	mes "I see seaweed everywhere because you're wiggling! All the culverts will be blocked with seaweed!";
 	next;
 	next;
-	if (getcharid(0) != getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == false) {
 		mes "[Missing, the Cleaner]";
 		mes "[Missing, the Cleaner]";
 		mes "Once your leader finishes preparing, settlement will be decided so get your hearts ready for it!!";
 		mes "Once your leader finishes preparing, settlement will be decided so get your hearts ready for it!!";
 		close;
 		close;

+ 2 - 2
npc/re/instances/MorseCave.txt

@@ -75,7 +75,7 @@ moro_cav,61,69,3	script	Senior Tracker#a1	4_M_JOB_ASSASSIN,{
 		mes "and become the hero";
 		mes "and become the hero";
 		mes "who saved the world from evil?";
 		mes "who saved the world from evil?";
 		next;
 		next;
-		if (getcharid(1) < 1 || getcharid(0) != getpartyleader(getcharid(1),2)) {
+		if (getcharid(1) < 1 || is_party_leader() == false) {
 			mes "[Senior Tracker]";
 			mes "[Senior Tracker]";
 			mes "If you're interested in my proposition,";
 			mes "If you're interested in my proposition,";
 			mes "let me talk to your party leader.";
 			mes "let me talk to your party leader.";
@@ -136,7 +136,7 @@ moro_cav,61,69,3	script	Senior Tracker#a1	4_M_JOB_ASSASSIN,{
 	mes "as many comrades as you can find.";
 	mes "as many comrades as you can find.";
 	mes "Are you ready to enter the Red Flower";
 	mes "Are you ready to enter the Red Flower";
 	mes "where Morroc is believed to be hiding?";
 	mes "where Morroc is believed to be hiding?";
-	if (getcharid(1) > 0 && getcharid(0) == getpartyleader(getcharid(1),2)) {
+	if (getcharid(1) > 0 && is_party_leader() == true) {
 		next;
 		next;
 		if (select( "No.", "Yes." ) == 1) {
 		if (select( "No.", "Yes." ) == 1) {
 			mes "[Senior Tracker]";
 			mes "[Senior Tracker]";

+ 1 - 1
npc/re/instances/OctopusCave.txt

@@ -28,7 +28,7 @@ mal_dun01,151,235,5	script	Starfish	551,{
 		mes "Make a party, and come back later.";
 		mes "Make a party, and come back later.";
 		close;
 		close;
 	}
 	}
-	if (getcharid(0) != getpartyleader(.@party_id,2)) {
+	if (is_party_leader() == false) {
 		mes "[Starfish]";
 		mes "[Starfish]";
 		mes "Where is your leader, hehe.";
 		mes "Where is your leader, hehe.";
 		mes "I don't talk to some random people.";
 		mes "I don't talk to some random people.";

+ 5 - 5
npc/re/instances/OldGlastHeim.txt

@@ -88,7 +88,7 @@ glast_01,204,273,5	script	Hugin	4_M_SAGE_C,{
 			mes "Why don't you make a party with more than 1 person and talk to me again?";
 			mes "Why don't you make a party with more than 1 person and talk to me again?";
 			close;
 			close;
 		}
 		}
-		if (getcharid(0) == getpartyleader(.@party_id,2))
+		if (is_party_leader() == true)
 			.@menu$ = "Generate Time Gap";
 			.@menu$ = "Generate Time Gap";
 		else {
 		else {
 			mes "[Hugin]";
 			mes "[Hugin]";
@@ -174,7 +174,7 @@ glast_01,204,273,5	script	Hugin	4_M_SAGE_C,{
 // Floor 1
 // Floor 1
 //============================================================
 //============================================================
 1@gl_k,149,41,5	script	Varmundt#0	4_M_BARMUND,{
 1@gl_k,149,41,5	script	Varmundt#0	4_M_BARMUND,{
-	if (getcharid(0) != getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == false) {
 		mes "[Varmundt]";
 		mes "[Varmundt]";
 		mes "Where's your leader? I need his help.";
 		mes "Where's your leader? I need his help.";
 		cutin "gl_barmund2",2;
 		cutin "gl_barmund2",2;
@@ -312,7 +312,7 @@ glast_01,204,273,5	script	Hugin	4_M_SAGE_C,{
 1@gl_k,154,54,3	duplicate(Khalitzburg Knightage#21)	Khalitzburg Knightage#22	4_F_KHALITZBURG
 1@gl_k,154,54,3	duplicate(Khalitzburg Knightage#21)	Khalitzburg Knightage#22	4_F_KHALITZBURG
 
 
 1@gl_k,149,100,6	script	Heinrich#1	4_M_HEINRICH,{
 1@gl_k,149,100,6	script	Heinrich#1	4_M_HEINRICH,{
-	if (getcharid(0) != getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == false) {
 		mes "[Heinrich]";
 		mes "[Heinrich]";
 		mes "Where is your leader? I must talk to him.";
 		mes "Where is your leader? I must talk to him.";
 		cutin "gl_heinrich2",2;
 		cutin "gl_heinrich2",2;
@@ -642,7 +642,7 @@ OnMyMobDead:
 }
 }
 
 
 1@gl_k,17,51,3	script	Altar boy Domun#1	4_M_KID1,{
 1@gl_k,17,51,3	script	Altar boy Domun#1	4_M_KID1,{
-	if (getcharid(0) != getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == false) {
 		mes "[Altar boy Domun]";
 		mes "[Altar boy Domun]";
 		mes "Save me, save me, please...";
 		mes "Save me, save me, please...";
 		close;
 		close;
@@ -720,7 +720,7 @@ OnMyMobDead:
 }
 }
 
 
 1@gl_k,291,145,3	script	Holgren the Destroyer#1	4_F_JOB_BLACKSMITH,{
 1@gl_k,291,145,3	script	Holgren the Destroyer#1	4_F_JOB_BLACKSMITH,{
-	if (getcharid(0) != getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == false) {
 		mes "[Holgren the Destroyer]";
 		mes "[Holgren the Destroyer]";
 		mes "You human?";
 		mes "You human?";
 		close;
 		close;

+ 6 - 6
npc/re/instances/RoomOfConsciousness.txt

@@ -8,7 +8,7 @@
 //============================================================
 //============================================================
 
 
 1@mir,103,40,3	script	Fenrir#1mir	4_F_FENRIR,{
 1@mir,103,40,3	script	Fenrir#1mir	4_F_FENRIR,{
-	if (getpartyleader(getcharid(1),2) != getcharid(0))	// it shouldn't happen
+	if (is_party_leader() == false)	// it shouldn't happen
 		end;
 		end;
 	cutin "fenrir_a",2;
 	cutin "fenrir_a",2;
 	mes "[Fenrir]";
 	mes "[Fenrir]";
@@ -79,7 +79,7 @@ OnInstanceInit:
 }
 }
 
 
 1@mir,100,94,7	script	Iris#2mir	4_F_IRIS,{
 1@mir,100,94,7	script	Iris#2mir	4_F_IRIS,{
-	if (getpartyleader(getcharid(1),2) != getcharid(0))	// it shouldn't happen
+	if (is_party_leader() == false)	// it shouldn't happen
 		end;
 		end;
 	mes "[Iris]";
 	mes "[Iris]";
 	mes "This...this must be...";
 	mes "This...this must be...";
@@ -200,7 +200,7 @@ OnMobDead2:
 }
 }
 
 
 1@mir,103,85,1	script	Iris#3mir	4_F_IRIS,{
 1@mir,103,85,1	script	Iris#3mir	4_F_IRIS,{
-	if (getpartyleader(getcharid(1),2) != getcharid(0))	// it shouldn't happen
+	if (is_party_leader() == false)	// it shouldn't happen
 		end;
 		end;
 	mes "[Bijou]";
 	mes "[Bijou]";
 	mes "~Chuckles~ I think you're not that bad for a human.";
 	mes "~Chuckles~ I think you're not that bad for a human.";
@@ -392,7 +392,7 @@ OnStop:
 }
 }
 
 
 1@mir,100,90,7	script	Iris#4mir	4_F_IRIS,{
 1@mir,100,90,7	script	Iris#4mir	4_F_IRIS,{
-	if (getpartyleader(getcharid(1),2) != getcharid(0))	// it shouldn't happen
+	if (is_party_leader() == false)	// it shouldn't happen
 		end;
 		end;
 	mes "[Iris]";
 	mes "[Iris]";
 	mes "Was that it...? Has it gone now?";
 	mes "Was that it...? Has it gone now?";
@@ -461,7 +461,7 @@ OnMobDead:
 }
 }
 
 
 1@mir,103,90,1	script	Fenrir#5mir	4_F_FENRIR,{
 1@mir,103,90,1	script	Fenrir#5mir	4_F_FENRIR,{
-	if (getpartyleader(getcharid(1),2) != getcharid(0))	// it shouldn't happen
+	if (is_party_leader() == false)	// it shouldn't happen
 		end;
 		end;
 	mes "[Fenrir]";
 	mes "[Fenrir]";
 	mes "~Groans~ I can't believe nothing seems to work!";
 	mes "~Groans~ I can't believe nothing seems to work!";
@@ -727,7 +727,7 @@ OnStop:
 }
 }
 
 
 1@mir,100,95,5	script	Iris#6mir	4_F_IRIS,{
 1@mir,100,95,5	script	Iris#6mir	4_F_IRIS,{
-	if (getpartyleader(getcharid(1),2) != getcharid(0))	// it shouldn't happen
+	if (is_party_leader() == false)	// it shouldn't happen
 		end;
 		end;
 	mes "[Iris]";
 	mes "[Iris]";
 	mes "~Grunts~";
 	mes "~Grunts~";

+ 6 - 6
npc/re/instances/SaraMemory.txt

@@ -179,7 +179,7 @@ dali,139,118,4	script	Dimensional Device#sara	10007,{
 			close;
 			close;
 		}
 		}
 
 
-		if (getcharid(0) == getpartyleader(.@party_id,2))
+		if (is_party_leader() == true)
 			set .@menu$, "Boot up the dimensional device.:Use the dimensional device.:Cancel.";
 			set .@menu$, "Boot up the dimensional device.:Use the dimensional device.:Cancel.";
 		else
 		else
 			set .@menu$, ":Use the dimensional device.:Cancel.";
 			set .@menu$, ":Use the dimensional device.:Cancel.";
@@ -228,7 +228,7 @@ dali,139,118,4	script	Dimensional Device#sara	10007,{
 }
 }
 
 
 1@sara,260,156,6	script	A Girl#01	668,{
 1@sara,260,156,6	script	A Girl#01	668,{
-	if(getcharid(0)==getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == true) {
 		unittalk getcharid(3),"Where am I?";
 		unittalk getcharid(3),"Where am I?";
 		mes "["+strcharinfo(0)+"]";
 		mes "["+strcharinfo(0)+"]";
 		mes "Where am I?";
 		mes "Where am I?";
@@ -419,7 +419,7 @@ OnEnable:
 }
 }
 
 
 1@sara,107,325,6	script	Sara Irene#01	668,{
 1@sara,107,325,6	script	Sara Irene#01	668,{
-	if(getcharid(0)==getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == true) {
 		cutin "sara_9sara1",2;
 		cutin "sara_9sara1",2;
 		npctalk "Oh! Hello again! I remember you, what's up?";
 		npctalk "Oh! Hello again! I remember you, what's up?";
 		mes "[Sara Irene]";
 		mes "[Sara Irene]";
@@ -546,7 +546,7 @@ OnEnable:
 }
 }
 
 
 1@sara,152,233,6	script	Sara Irene#02	668,{
 1@sara,152,233,6	script	Sara Irene#02	668,{
-	if(getcharid(0)==getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == true) {
 		cutin "sara_9sara2",2;
 		cutin "sara_9sara2",2;
 		npctalk "Mommy!";
 		npctalk "Mommy!";
 		mes "[Sara Irene]";
 		mes "[Sara Irene]";
@@ -617,7 +617,7 @@ OnEnable:
 }
 }
 
 
 1@sara,156,236,4	script	Doyen Irene#04	684,{
 1@sara,156,236,4	script	Doyen Irene#04	684,{
-	if(getcharid(0)==getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == true) {
 		cutin "sara_elder_irine4",2;
 		cutin "sara_elder_irine4",2;
 		npctalk "You... were too strong for me.";
 		npctalk "You... were too strong for me.";
 		mes "[Doyen Irene]";
 		mes "[Doyen Irene]";
@@ -697,7 +697,7 @@ OnEnable:
 }
 }
 
 
 1@sara,39,142,4	script	Sara Irene#03	668,{
 1@sara,39,142,4	script	Sara Irene#03	668,{
-	if(getcharid(0)==getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == true) {
 		mapannounce instance_mapname("1@sara"), "As you are about to call out to Sara, a sudden blow knocks you down from behind.",bc_area,"0xffffff";
 		mapannounce instance_mapname("1@sara"), "As you are about to call out to Sara, a sudden blow knocks you down from behind.",bc_area,"0xffffff";
 		mes "^FF0000As you are about to call out to Sara, a sudden blow knocks you down from behind.^000000";
 		mes "^FF0000As you are about to call out to Sara, a sudden blow knocks you down from behind.^000000";
 		next;
 		next;

+ 6 - 6
npc/re/instances/SarahAndFenrir.txt

@@ -28,7 +28,7 @@ dali02,97,142,3	script	Professor Bernhard#a1	4_LGTSCIENCE,{
 			mes "That is why..I need you..";
 			mes "That is why..I need you..";
 			next;
 			next;
 			mes "[Professor Bernhard]";
 			mes "[Professor Bernhard]";
-			if (getpartyleader(getcharid(1),2) != getcharid(0)) {
+			if (is_party_leader() == false) {
 				mes "A longing for accomplishing a powerful weapon as a genuine professor!";
 				mes "A longing for accomplishing a powerful weapon as a genuine professor!";
 				mes "In order to accomplish that, we need shards of Gigantes that once appeared in the past battle of Fenrir and Sarah.";
 				mes "In order to accomplish that, we need shards of Gigantes that once appeared in the past battle of Fenrir and Sarah.";
 				next;
 				next;
@@ -124,7 +124,7 @@ dali02,97,142,3	script	Professor Bernhard#a1	4_LGTSCIENCE,{
 		mes "There, all the preparations are finished.";
 		mes "There, all the preparations are finished.";
 		mes "Can you go back in time again and bring me the shards of Gigantes?";
 		mes "Can you go back in time again and bring me the shards of Gigantes?";
 		mes "I will make sure to compensate you sufficiently.";
 		mes "I will make sure to compensate you sufficiently.";
-		if (getpartyleader(getcharid(1),2) == getcharid(0)) {
+		if (is_party_leader() == true) {
 			next;
 			next;
 			if (select( "No", "Yes" ) == 1) {
 			if (select( "No", "Yes" ) == 1) {
 				mes "[Professor Bernhard]";
 				mes "[Professor Bernhard]";
@@ -664,7 +664,7 @@ OnTimer15500:
 1@glast,199,237,0	script	#glast_move_03	WARPNPC,2,2,{
 1@glast,199,237,0	script	#glast_move_03	WARPNPC,2,2,{
 	end;
 	end;
 OnTouch:
 OnTouch:
-	if (getcharid(0) == getpartyleader(getcharid(1),2))
+	if (is_party_leader() == true)
 		warpparty 'map_glast$,197,263, getcharid(1), 'map_glast$,1,1;
 		warpparty 'map_glast$,197,263, getcharid(1), 'map_glast$,1,1;
 	end;
 	end;
 }
 }
@@ -673,7 +673,7 @@ OnTouch:
 1@glast,199,294,0	script	#glast_move_03a	WARPNPC,3,3,{
 1@glast,199,294,0	script	#glast_move_03a	WARPNPC,3,3,{
 	end;
 	end;
 OnTouch:
 OnTouch:
-	if (getcharid(0) == getpartyleader(getcharid(1),2))
+	if (is_party_leader() == true)
 		warpparty 'map_glast$,188,334, getcharid(1), 'map_glast$,1,1;
 		warpparty 'map_glast$,188,334, getcharid(1), 'map_glast$,1,1;
 	end;
 	end;
 }
 }
@@ -690,7 +690,7 @@ OnTouch:
 1@glast,351,269,0	script	#glast_move_04	WARPNPC,3,3,{
 1@glast,351,269,0	script	#glast_move_04	WARPNPC,3,3,{
 	end;
 	end;
 OnTouch:
 OnTouch:
-	if (getcharid(0) == getpartyleader(getcharid(1),2)) {
+	if (is_party_leader() == true) {
 		donpcevent instance_npcname("#sarah_wrath") + "::OnStop";
 		donpcevent instance_npcname("#sarah_wrath") + "::OnStop";
 		warpparty 'map_glast$,349,282, getcharid(1), 'map_glast$,1,1;
 		warpparty 'map_glast$,349,282, getcharid(1), 'map_glast$,1,1;
 	}
 	}
@@ -750,7 +750,7 @@ OnTouch:
 1@glast,47,270,0	script	#glast_event_7	HIDDEN_WARP_NPC,5,5,{
 1@glast,47,270,0	script	#glast_event_7	HIDDEN_WARP_NPC,5,5,{
 	end;
 	end;
 OnTouch:
 OnTouch:
-	if (getcharid(0) != getpartyleader(getcharid(1),2))
+	if (is_party_leader() == false)
 		npctalk "Fenrith Fenrir: I would like your party leader to come and help me!", 'fenrir_3$;
 		npctalk "Fenrith Fenrir: I would like your party leader to come and help me!", 'fenrir_3$;
 	else {
 	else {
 		mes "";
 		mes "";

+ 5 - 5
npc/re/instances/WolfchevLaboratory.txt

@@ -818,7 +818,7 @@ lhz_dun04,151,276,3	script	Researcher#memo	4_LGTSCIENCE,{
 						}
 						}
 					}
 					}
 				}
 				}
-				if (getpartyleader(getcharid(1),2) == getcharid(0)) {
+				if (is_party_leader() == true) {
 					if (instance_create("Wolfchev's Laboratory") < 0) {
 					if (instance_create("Wolfchev's Laboratory") < 0) {
 						mes "[Wolfchev]";
 						mes "[Wolfchev]";
 						mes "Hmm.. Lab entering system is a bit weird. Would wait for me to check the system?";
 						mes "Hmm.. Lab entering system is a bit weird. Would wait for me to check the system?";
@@ -990,7 +990,7 @@ OnMyMobDead:
 1@lhz,39,168,0	script	Manual Sheet#1_1	CLEAR_NPC,{
 1@lhz,39,168,0	script	Manual Sheet#1_1	CLEAR_NPC,{
 	mes "There are valve manual sheets littered on the floor.";
 	mes "There are valve manual sheets littered on the floor.";
 	next;
 	next;
-	if (getpartyleader(getcharid(1),2) == getcharid(0)) {
+	if (is_party_leader() == true) {
 		mes "You the party leader, started to read the manual.";
 		mes "You the party leader, started to read the manual.";
 		next;
 		next;
 		mes "[Emergency Access Valve Manual]";
 		mes "[Emergency Access Valve Manual]";
@@ -1068,7 +1068,7 @@ OnEnable:
 1@lhz,41,172,0	script	Valve#1_2	CLEAR_NPC,{
 1@lhz,41,172,0	script	Valve#1_2	CLEAR_NPC,{
 	.@open_portal = 0;
 	.@open_portal = 0;
 	mes "This is the left valve for the emergency access.";
 	mes "This is the left valve for the emergency access.";
-	if (getpartyleader(getcharid(1),2) == getcharid(0)) {
+	if (is_party_leader() == true) {
 		next;
 		next;
 		mes "To which direction do you wish to turn?";
 		mes "To which direction do you wish to turn?";
 		next;
 		next;
@@ -1131,7 +1131,7 @@ OnEnable:
 1@lhz,52,172,0	script	Valve#1_3	CLEAR_NPC,{
 1@lhz,52,172,0	script	Valve#1_3	CLEAR_NPC,{
 	.@open_portal = 0;
 	.@open_portal = 0;
 	mes "This is the left valve for the emergency access.";
 	mes "This is the left valve for the emergency access.";
-	if (getpartyleader(getcharid(1),2) == getcharid(0)) {
+	if (is_party_leader() == true) {
 		next;
 		next;
 		mes "To which direction do you wish to turn?";
 		mes "To which direction do you wish to turn?";
 		next;
 		next;
@@ -1526,7 +1526,7 @@ OnMyMobDead:
 // The Lab No.2 Valves
 // The Lab No.2 Valves
 //============================================================
 //============================================================
 -	script	bio4FLab2Valve	-1,{
 -	script	bio4FLab2Valve	-1,{
-	if (getpartyleader(getcharid(1),2) == getcharid(0)) {
+	if (is_party_leader() == true) {
 		progressbar "0xffff00", 20;
 		progressbar "0xffff00", 20;
 		stopnpctimer;
 		stopnpctimer;
 		donpcevent instance_npcname("Lab2#2_2")+"::OnDisableValve1";
 		donpcevent instance_npcname("Lab2#2_2")+"::OnDisableValve1";

+ 9 - 9
npc/re/quests/quests_16_1.txt

@@ -1572,7 +1572,7 @@ prt_lib,76,80,3	script	Lindt the Librarian#ep1	1_M_01,{
 prt_lib,91,85,3	script	Mage Nillem#ep16_warp	4_M_JOB_WIZARD,{
 prt_lib,91,85,3	script	Mage Nillem#ep16_warp	4_M_JOB_WIZARD,{
 	switch( banquet_main_quest ) {
 	switch( banquet_main_quest ) {
 	case 8:
 	case 8:
-		if (getcharid(1) == 0 || getpartyleader(getcharid(1),2) != getcharid(0)) {// solo instance
+		if (getcharid(1) == 0 || is_party_leader() == false) {// solo instance
 			mes "^4d4dffIt is an event which proceeds as a memorial.";
 			mes "^4d4dffIt is an event which proceeds as a memorial.";
 			mes "Only the party leader can proceed with a memorial event. Try again after forming a party.^000000";
 			mes "Only the party leader can proceed with a memorial event. Try again after forming a party.^000000";
 			close;
 			close;
@@ -1760,7 +1760,7 @@ prt_lib,91,85,3	script	Mage Nillem#ep16_warp	4_M_JOB_WIZARD,{
 
 
 prt_lib,88,90,1	script	Room of Consciousness#e	HIDDEN_WARP_NPC,{
 prt_lib,88,90,1	script	Room of Consciousness#e	HIDDEN_WARP_NPC,{
 	if (banquet_main_quest == 8) {
 	if (banquet_main_quest == 8) {
-		if (getcharid(1) == 0 || getpartyleader(getcharid(1),2) != getcharid(0)) {
+		if (getcharid(1) == 0 || is_party_leader() == false) {
 			mes "^4d4dffOnly the party leader can enter MD [Ritual of Blessing].^000000";
 			mes "^4d4dffOnly the party leader can enter MD [Ritual of Blessing].^000000";
 			close;
 			close;
 		}
 		}
@@ -1771,7 +1771,7 @@ prt_lib,88,90,1	script	Room of Consciousness#e	HIDDEN_WARP_NPC,{
 			mes "Hum... This gate is only activated temporarily so that it doesn't last long.";
 			mes "Hum... This gate is only activated temporarily so that it doesn't last long.";
 			close;
 			close;
 		}
 		}
-		if (getcharid(1) == 0 || getpartyleader(getcharid(1),2) != getcharid(0)) {
+		if (getcharid(1) == 0 || is_party_leader() == false) {
 			mes "^4d4dffOnly the party leader can enter MD [Ritual of Blessing].^000000";
 			mes "^4d4dffOnly the party leader can enter MD [Ritual of Blessing].^000000";
 			close;
 			close;
 		}
 		}
@@ -2257,7 +2257,7 @@ prt_lib_q,91,85,3	script	Nillem#ep16_lib_q	4_M_JOB_WIZARD,{
 		close;
 		close;
 	}
 	}
 	if (banquet_main_quest == 21) {
 	if (banquet_main_quest == 21) {
-		if (getcharid(1) == 0 || getpartyleader(getcharid(1),2) != getcharid(0)) {
+		if (getcharid(1) == 0 || is_party_leader() == false) {
 			mes "^4d4dffIt is an event which proceeds as a memorial.";
 			mes "^4d4dffIt is an event which proceeds as a memorial.";
 			mes "Only the party leader can proceed with a memorial event. Try again after forming a party.^000000";
 			mes "Only the party leader can proceed with a memorial event. Try again after forming a party.^000000";
 			close;
 			close;
@@ -2449,7 +2449,7 @@ prt_lib_q,91,85,3	script	Nillem#ep16_lib_q	4_M_JOB_WIZARD,{
 				close;
 				close;
 			case 0:
 			case 0:
 			case 1:
 			case 1:
-				if (getcharid(1) == 0 || getpartyleader(getcharid(1),2) != getcharid(0)) {
+				if (getcharid(1) == 0 || is_party_leader() == false) {
 					mes "^4d4dffIt is an event which proceeds as a memorial.";
 					mes "^4d4dffIt is an event which proceeds as a memorial.";
 					mes "Only the party leader can proceed with a memorial event. Try again after forming a party.^000000";
 					mes "Only the party leader can proceed with a memorial event. Try again after forming a party.^000000";
 					close;
 					close;
@@ -2518,14 +2518,14 @@ prt_lib_q,91,85,3	script	Nillem#ep16_lib_q	4_M_JOB_WIZARD,{
 
 
 prt_lib_q,88,90,1	script	Swaying Space#evt_gate0	HIDDEN_WARP_NPC,{
 prt_lib_q,88,90,1	script	Swaying Space#evt_gate0	HIDDEN_WARP_NPC,{
 	if (banquet_main_quest == 21) {
 	if (banquet_main_quest == 21) {
-		if (getcharid(1) == 0 || getpartyleader(getcharid(1),2) != getcharid(0)) {// solo instance
+		if (getcharid(1) == 0 || is_party_leader() == false) {// solo instance
 			mes "^4d4dffOnly the party leader can enter MD [Room of Consciousness].^000000";
 			mes "^4d4dffOnly the party leader can enter MD [Room of Consciousness].^000000";
 			close;
 			close;
 		}
 		}
 		mes "You can move to the place where the piece of Imir Heart was in the past.";
 		mes "You can move to the place where the piece of Imir Heart was in the past.";
 		next;
 		next;
 		if (select( "Enter.", "Do not enter." ) == 1) {
 		if (select( "Enter.", "Do not enter." ) == 1) {
-			if (getcharid(1) == 0 || getpartyleader(getcharid(1),2) != getcharid(0)) {
+			if (getcharid(1) == 0 || is_party_leader() == false) {
 				mes "^4d4dffOnly the party leader can enter MD [Room of Consciousness].^000000";
 				mes "^4d4dffOnly the party leader can enter MD [Room of Consciousness].^000000";
 				close;
 				close;
 			}
 			}
@@ -2557,7 +2557,7 @@ prt_lib_q,88,90,1	script	Swaying Space#evt_gate0	HIDDEN_WARP_NPC,{
 		close;
 		close;
 	}
 	}
 	if (banquet_main_quest == 26) {
 	if (banquet_main_quest == 26) {
-		if (getcharid(1) == 0 || getpartyleader(getcharid(1),2) != getcharid(0)) {// solo instance
+		if (getcharid(1) == 0 || is_party_leader() == false) {// solo instance
 			mes "^4d4dffOnly the party leader can enter MD [Room of Consciousness].^000000";
 			mes "^4d4dffOnly the party leader can enter MD [Room of Consciousness].^000000";
 			close;
 			close;
 		}
 		}
@@ -2569,7 +2569,7 @@ prt_lib_q,88,90,1	script	Swaying Space#evt_gate0	HIDDEN_WARP_NPC,{
 			mes "Such thing is possible since I am a genius!";
 			mes "Such thing is possible since I am a genius!";
 			close;
 			close;
 		}
 		}
-		if (getcharid(1) == 0 || getpartyleader(getcharid(1),2) != getcharid(0)) {
+		if (getcharid(1) == 0 || is_party_leader() == false) {
 			mes "^4d4dffOnly the party leader can enter MD [Room of Consciousness].^000000";
 			mes "^4d4dffOnly the party leader can enter MD [Room of Consciousness].^000000";
 			close;
 			close;
 		}
 		}

+ 1 - 1
npc/re/quests/woe_te/te_goditem_alde1.txt

@@ -33,7 +33,7 @@ te_aldecas1,226,34,3	script	Blacksmith Cano#tegod01	4_M_RACHMAN1,{
 		mes "Don't worry about me.";
 		mes "Don't worry about me.";
 		close;
 		close;
 	}
 	}
-	if (getguildmaster(.@guild_id) != strcharinfo(0)) {
+	if (is_guild_leader() == false) {
 		mes "I feel so grateful all the time about you letting me stay here.";
 		mes "I feel so grateful all the time about you letting me stay here.";
 		mes "It's nothing special... but if you want, I'll make you tools that could be of use.";
 		mes "It's nothing special... but if you want, I'll make you tools that could be of use.";
 		next;
 		next;

+ 1 - 1
npc/re/quests/woe_te/te_goditem_prt01.txt

@@ -33,7 +33,7 @@ te_prtcas01,204,204,3	script	Blacksmith Kai#tegod01	4_M_RACHMAN2,{
 		mes "Don't worry about me.";
 		mes "Don't worry about me.";
 		close;
 		close;
 	}
 	}
-	if (getguildmaster(.@guild_id) != strcharinfo(0)) {
+	if (is_guild_leader() == false) {
 		mes "I feel so grateful all the time about you letting me stay here.";
 		mes "I feel so grateful all the time about you letting me stay here.";
 		mes "It's nothing special... but if you want, I'll make you tools that could be of use.";
 		mes "It's nothing special... but if you want, I'll make you tools that could be of use.";
 		next;
 		next;

+ 54 - 0
src/map/script.cpp

@@ -23991,6 +23991,58 @@ BUILDIN_FUNC(identifyall) {
 	return SCRIPT_CMD_SUCCESS;
 	return SCRIPT_CMD_SUCCESS;
 }
 }
 
 
+BUILDIN_FUNC(is_guild_leader)
+{
+	struct map_session_data* sd;
+	struct guild* guild_data;
+	int guild_id;
+
+	if (!script_rid2sd(sd)) {
+		script_pushint(st, false);
+		return SCRIPT_CMD_FAILURE;
+	}
+
+	if (script_hasdata(st, 2))
+		guild_id = script_getnum(st, 2);
+	else
+		guild_id = sd->status.guild_id;
+
+	guild_data = guild_search(guild_id);
+	if (guild_data)
+		script_pushint(st, (guild_data->member[0].char_id == sd->status.char_id));
+	else
+		script_pushint(st, false);
+	return SCRIPT_CMD_SUCCESS;
+}
+
+BUILDIN_FUNC(is_party_leader)
+{
+	struct map_session_data* sd;
+	struct party_data* p_data;
+	int p_id, i = 0;
+
+	if (!script_rid2sd(sd)) {
+		script_pushint(st, false);
+		return SCRIPT_CMD_FAILURE;
+	}
+
+	if (script_hasdata(st, 2))
+		p_id = script_getnum(st, 2);
+	else
+		p_id = sd->status.party_id;
+
+	p_data = party_search(p_id);
+	if (p_data) {
+		ARR_FIND( 0, MAX_PARTY, i, p_data->data[i].sd == sd );
+		if (i < MAX_PARTY){
+			script_pushint(st, p_data->party.member[i].leader);
+			return SCRIPT_CMD_SUCCESS;
+		}
+	}
+	script_pushint(st, false);
+	return SCRIPT_CMD_SUCCESS;
+}
+
 #include "../custom/script.inc"
 #include "../custom/script.inc"
 
 
 // declarations that were supposed to be exported from npc_chat.c
 // declarations that were supposed to be exported from npc_chat.c
@@ -24651,6 +24703,8 @@ struct script_function buildin_func[] = {
 	BUILDIN_DEF(mail, "isss*"),
 	BUILDIN_DEF(mail, "isss*"),
 	BUILDIN_DEF(open_roulette,"?"),
 	BUILDIN_DEF(open_roulette,"?"),
 	BUILDIN_DEF(identifyall,"??"),
 	BUILDIN_DEF(identifyall,"??"),
+	BUILDIN_DEF(is_guild_leader,"?"),
+	BUILDIN_DEF(is_party_leader,"?"),
 #include "../custom/script_def.inc"
 #include "../custom/script_def.inc"
 
 
 	{NULL,NULL,NULL},
 	{NULL,NULL,NULL},