diff options
author | Ibrahem Hossam <ibrahem.h.basyone@gmail.com> | 2016-10-16 14:19:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-16 14:19:36 +0200 |
commit | 8f2dace11eb6cce3fa9d4ff194db2a4b34753f91 (patch) | |
tree | 5dd5748a4f12963b57253a6a946a583b07022e56 | |
parent | 1b1682ed243ef8304bfce1be7a70626c95720d93 (diff) | |
parent | 062f2cf4235cf07481ecaf58682f37f2ad8928f8 (diff) | |
download | hercules-8f2dace11eb6cce3fa9d4ff194db2a4b34753f91.tar.gz hercules-8f2dace11eb6cce3fa9d4ff194db2a4b34753f91.tar.bz2 hercules-8f2dace11eb6cce3fa9d4ff194db2a4b34753f91.tar.xz hercules-8f2dace11eb6cce3fa9d4ff194db2a4b34753f91.zip |
Merge pull request #1472 from Asheraf/getcharid
Change *getcharid to use constants
79 files changed, 368 insertions, 361 deletions
diff --git a/db/constants.conf b/db/constants.conf index a044aee7d..c22435a36 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -3656,6 +3656,13 @@ constants_db: { NPC_NAME_HIDDEN: 2 NPC_NAME_UNIQUE: 3 NPC_MAP: 4 + + comment__: "getcharid" + CHAR_ID_CHAR: 0 + CHAR_ID_PARTY: 1 + CHAR_ID_GUILD: 2 + CHAR_ID_ACCOUNT: 3 + CHAR_ID_BG: 4 comment__: "sc_start" SCFLAG_NONE: 0x00 diff --git a/db/pre-re/item_db.conf b/db/pre-re/item_db.conf index 1ba177d18..4ba5719a4 100644 --- a/db/pre-re/item_db.conf +++ b/db/pre-re/item_db.conf @@ -93445,7 +93445,7 @@ item_db: ( Name: "Chemical Protection Helm Scroll" Type: 2 Weight: 10 - Script: <" unitskilluseid getcharid(3),237,5; "> + Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),237,5; "> }, { Id: 14518 @@ -93453,7 +93453,7 @@ item_db: ( Name: "Chemical Protection Shield Scrol" Type: 2 Weight: 10 - Script: <" unitskilluseid getcharid(3),235,5; "> + Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),235,5; "> }, { Id: 14519 @@ -93461,7 +93461,7 @@ item_db: ( Name: "Chemical Protection Armor Scroll" Type: 2 Weight: 10 - Script: <" unitskilluseid getcharid(3),236,5; "> + Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),236,5; "> }, { Id: 14520 @@ -93469,7 +93469,7 @@ item_db: ( Name: "Chemical Protection Weapon Scroll" Type: 2 Weight: 10 - Script: <" unitskilluseid getcharid(3),234,5; "> + Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),234,5; "> }, { Id: 14521 @@ -93489,7 +93489,7 @@ item_db: ( Nouse: { sitting: true } - Script: <" unitskilluseid getcharid(3),108,1; "> + Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),108,1; "> }, { Id: 14522 diff --git a/db/re/item_db.conf b/db/re/item_db.conf index 3587fb4ce..34136aa5c 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -120552,7 +120552,7 @@ item_db: ( nomail: true noauction: true } - Script: <" unitskilluseid getcharid(3),237,5; "> + Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),237,5; "> }, { Id: 14518 @@ -120569,7 +120569,7 @@ item_db: ( nomail: true noauction: true } - Script: <" unitskilluseid getcharid(3),235,5; "> + Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),235,5; "> }, { Id: 14519 @@ -120586,7 +120586,7 @@ item_db: ( nomail: true noauction: true } - Script: <" unitskilluseid getcharid(3),236,5; "> + Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),236,5; "> }, { Id: 14520 @@ -120603,7 +120603,7 @@ item_db: ( nomail: true noauction: true } - Script: <" unitskilluseid getcharid(3),234,5; "> + Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),234,5; "> }, { Id: 14521 @@ -120623,7 +120623,7 @@ item_db: ( Nouse: { sitting: true } - Script: <" unitskilluseid getcharid(3),108,1; "> + Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT),108,1; "> }, { Id: 14522 @@ -146123,7 +146123,7 @@ item_db: ( nomail: true noauction: true } - Script: <" unitskilluseid getcharid(3), "AL_TELEPORT", 3; "> + Script: <" unitskilluseid getcharid(CHAR_ID_ACCOUNT), "AL_TELEPORT", 3; "> }, { Id: 22514 diff --git a/doc/script_commands.txt b/doc/script_commands.txt index eb7e0cd9d..cb25c389f 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -2466,11 +2466,11 @@ or, if a character name is specified, of that player. Type is the kind of associated ID number required: - 0 - Character ID number. - 1 - Party ID number. - 2 - Guild ID number. - 3 - Account ID number. - 4 - Battle ground ID +(0) CHAR_ID_CHAR - Character ID number. +(1) CHAR_ID_PARTY - Party ID number. +(2) CHAR_ID_GUILD - Guild ID number. +(3) CHAR_ID_ACCOUNT - Account ID number. +(4) CHAR_ID_BG - Battle ground ID For most purposes other than printing it, a number is better to have than a name (people do horrifying things to their character names). @@ -2479,12 +2479,12 @@ If the character is not in a party or not in a guild, the function will return 0 if guild or party number is requested. If a name is specified and the character is not found, 0 is returned. -If getcharid(0) returns a zero, the script got called not by a character +If getcharid(CHAR_ID_CHAR) returns a zero, the script got called not by a character and doesn't have an attached RID. Note that this will cause the map server to print "player not attached!" error messages, so it is preferred to use playerattached() to check for the character attached to the script. - if (getcharid(2) == 0) + if (getcharid(CHAR_ID_GUILD) == 0) mes("Only members of a guild are allowed here!"); --------------------------------------- @@ -2588,7 +2588,7 @@ return 7 in this case. Example 1: list party member names // get the party member names - getpartymember(getcharid(1), 0); + getpartymember(getcharid(CHAR_ID_PARTY), 0); // It's a good idea to copy the global temporary $@partymember***** // variables to your own scope variables because if you have pauses in @@ -2610,8 +2610,8 @@ Example 2: check party count (with a next() pause), before warping to event .register_num = 5; // How many party members are required? // get the charID and accountID of character's party members - getpartymember(getcharid(1), 1); - getpartymember(getcharid(1), 2); + getpartymember(getcharid(CHAR_ID_PARTY), 1); + getpartymember(getcharid(CHAR_ID_PARTY), 2); if ($@partymembercount != .register_num) { mes("Please form a party of "+ .register_num +" to continue"); @@ -2645,7 +2645,7 @@ Example 2: check party count (with a next() pause), before warping to event // party. To prevent this, we call getpartymember again and compare // with the original values. - getpartymember(getcharid(1), 1); + getpartymember(getcharid(CHAR_ID_PARTY), 1); if ($@partymembercount != .register_num) { mes("You've made changes to your party !"); close(); @@ -2658,7 +2658,7 @@ Example 2: check party count (with a next() pause), before warping to event } // Finally, it's safe to start the event! - warpparty("event_map", 0, 0, getcharid(1)); + warpparty("event_map", 0, 0, getcharid(CHAR_ID_PARTY)); --------------------------------------- @@ -3377,7 +3377,7 @@ guild. Maybe you want to make a room only guild masters can enter: - .@GID = getcharid(2); + .@GID = getcharid(CHAR_ID_GUILD); if (.@GID == 0) { mes("Sorry you are not in a guild"); close(); @@ -3476,7 +3476,7 @@ Returns the amount of characters from the specified guild on the given map. Example: - mes("You have "+getmapguildusers("prontera", getcharid(2))+" guild members in Prontera."); + mes("You have "+getmapguildusers("prontera", getcharid(CHAR_ID_GUILD))+" guild members in Prontera."); --------------------------------------- @@ -4251,8 +4251,8 @@ See also warp(). *warpparty("<to_mapname>", <x>, <y>, <party_id>, {"<from_mapname>"}) Warps a party to specified map and coordinate given the party ID, which -you can get with getcharid(1). You can also request another party id given -a member's name with getcharid(1, <player_name>). +you can get with getcharid(CHAR_ID_PARTY). You can also request another party id given +a member's name with getcharid(CHAR_ID_PARTY, <player_name>). You can use the following "map names" for special warping behavior: Random: All party members are randomly warped in their current map @@ -4273,7 +4273,7 @@ Example: mes("[Party Warper]"); mes("Here you go!"); close2(); - .@id = getcharid(1); + .@id = getcharid(CHAR_ID_PARTY); warpparty("prontera", 150, 100, .@id); close(); @@ -4282,7 +4282,7 @@ Example: *warpchar("<mapname>", <x>, <y>, <char_id>) Warps another player to specified map and coordinate given the char id, -which you can get with getcharid(0, <player_name>). Obviously this is +which you can get with getcharid(CHAR_ID_CHAR, <player_name>). Obviously this is useless if you want to warp the same player that is executing this script, unless it's some kind of "chosen" script. @@ -4295,8 +4295,8 @@ Example: *warpguild("<mapname>", <x>, <y>, <guild_id>) Warps a guild to specified map and coordinate given the guild id, which -you can get with getcharid(2). You can also request another guild id given -the member's name with getcharid(2, <player_name>). +you can get with getcharid(CHAR_ID_GUILD). You can also request another guild id given +the member's name with getcharid(CHAR_ID_GUILD, <player_name>). You can use the following "map names" for special warping behavior: Random: All guild members are randomly warped in their current map @@ -4748,7 +4748,7 @@ like this. Careful, minor magic ahead. // item. Only an existing character's name may be there. // Let's assume our character is 'Adam' and find his ID. - .@charid = getcharid(0, "Adam"); + .@charid = getcharid(CHAR_ID_CHAR, "Adam"); // Now we split the character ID number into two portions with a // binary shift operation. If you don't understand what this does, @@ -5902,10 +5902,10 @@ Examples: // This will make Aaron follow Bullah, when both of these characters are // online. - pcfollow(getcharid(3, "Aaron"), getcharid(3, "Bullah")); + pcfollow(getcharid(CHAR_ID_ACCOUNT, "Aaron"), getcharid(CHAR_ID_ACCOUNT, "Bullah")); // Makes Aaron stop following whoever he is following. - pcstopfollow(getcharid(3, "Aaron")); + pcstopfollow(getcharid(CHAR_ID_ACCOUNT, "Aaron")); --------------------------------------- @@ -5919,10 +5919,10 @@ player if zero is supplied. Examples: // Prevents the current char from moving away. - pcblockmove(getcharid(3), true); + pcblockmove(getcharid(CHAR_ID_ACCOUNT), true); // Enables the current char to move again. - pcblockmove(getcharid(3), false); + pcblockmove(getcharid(CHAR_ID_ACCOUNT), false); --------------------------------------- @@ -5983,7 +5983,7 @@ For example: // We'll make a poring which will automatically attack invoking player: .@mobGID = monster("prontera", 150, 150, "Poring", PORING, 1); // PORING is defined in the mob db and its value is 1002 - unitattack(.@mobGID, getcharid(3)); // Attacker GID, attacked GID + unitattack(.@mobGID, getcharid(CHAR_ID_ACCOUNT)); // Attacker GID, attacked GID The way you can get the GID of more than only one monster is looping through all the summons to get their individual GIDs and do whatever you @@ -6273,7 +6273,7 @@ Examples: unitwalk(.GID, 150, 150); //NPC will move towards the attached player. - unitwalk(.GID, getcharid(3));//a player's GID is their account ID + unitwalk(.GID, getcharid(CHAR_ID_ACCOUNT));//a player's GID is their account ID --------------------------------------- @@ -8519,7 +8519,7 @@ ID this command returns. Example: // Store the Party ID of the invoking character. - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); // Attempt to create an instance using that party ID. .@id = instance_create("Endless Tower", .@party_id); @@ -8662,7 +8662,7 @@ max - maximum level of all characters in the party (default is max Example: -if (instance_check_party(getcharid(1), 2, 2, 149)) { +if (instance_check_party(getcharid(CHAR_ID_PARTY), 2, 2, 149)) { mes("Your party meets the Memorial Dungeon requirements."); mes("All online members are between levels 1-150 and at least two are online."); close(); @@ -8683,7 +8683,7 @@ min - minimum level of all characters in the guild (default is 1). max - maximum level of all characters in the guild (default is max level in conf). Example: - if (instance_check_guild(getcharid(2), 2, 1, 150)) { + if (instance_check_guild(getcharid(CHAR_ID_GUILD), 2, 1, 150)) { mes("Your guild meets the Memorial Dungeon requirements."); mes("All online members are between levels 1-150 and at least two are online."); close(); @@ -8907,10 +8907,10 @@ Example: *bg_team_setxy(<Battle Group ID>, <x>, <y>) Update the respawn point of the given battle group to x, y on the same -map. The <Battle Group ID> can be retrieved using getcharid(4). +map. The <Battle Group ID> can be retrieved using getcharid(CHAR_ID_BG). Example: - bg_team_setxy(getcharid(4), 56, 212); + bg_team_setxy(getcharid(CHAR_ID_BG), 56, 212); mapannounce("bat_a01", "Group [1] has taken the work shop, and will now respawn there.", bc_map, 0xFFCE00); end; diff --git a/npc/battleground/flavius/flavius01.txt b/npc/battleground/flavius/flavius01.txt index 681786792..8370f1e53 100644 --- a/npc/battleground/flavius/flavius01.txt +++ b/npc/battleground/flavius/flavius01.txt @@ -405,7 +405,7 @@ OnTouch: } bat_b01,10,294,3 script Guillaume Vintenar#b01_a 4_M_RASWORD,{ - if ($@FlaviusBG1_id1 == getcharid(4)) { + if ($@FlaviusBG1_id1 == getcharid(CHAR_ID_BG)) { if ($@FlaviusBG1_Victory == 1) { .@your_medal = countitem(BF_Badge2); .@medal_gap = 500 - .@your_medal; @@ -457,7 +457,7 @@ OnInit: } bat_b01,389,14,3 script Croix Vintenar#b01_b 4_M_RASWORD,{ - if ($@FlaviusBG1_id2 == getcharid(4)) { + if ($@FlaviusBG1_id2 == getcharid(CHAR_ID_BG)) { if ($@FlaviusBG1_Victory == 2) { .@your_medal = countitem(BF_Badge2); .@medal_gap = 500 - .@your_medal; @@ -590,7 +590,7 @@ bat_b01,389,16,3 script Croix Camp#flag31 1_FLAG_EAGLE,{ end; } bat_b01,10,294,3 script Vintenar#bat_b01_aover 4_M_KY_HEAD,{ .@A_B_gap = $@Guill_ScoreBG1 - $@Croix_ScoreBG1; - if ($@FlaviusBG1_id1 == getcharid(4)) { + if ($@FlaviusBG1_id1 == getcharid(CHAR_ID_BG)) { if (.@A_B_gap > 0) { .@your_medal = countitem(BF_Badge2); .@medal_gap = 500 - .@your_medal; @@ -668,7 +668,7 @@ OnInit: bat_b01,389,14,3 script Vintenar#bat_b01_bover 4_M_CRU_HEAD,{ .@A_B_gap = $@Guill_ScoreBG1 - $@Croix_ScoreBG1; - if ($@FlaviusBG1_id2 == getcharid(4)) { + if ($@FlaviusBG1_id2 == getcharid(CHAR_ID_BG)) { if (.@A_B_gap > 0) { .@your_medal = countitem(BF_Badge2); .@medal_gap = 500 - .@your_medal; diff --git a/npc/battleground/flavius/flavius02.txt b/npc/battleground/flavius/flavius02.txt index becee77c6..232dd7e39 100644 --- a/npc/battleground/flavius/flavius02.txt +++ b/npc/battleground/flavius/flavius02.txt @@ -405,7 +405,7 @@ OnTouch: } bat_b02,10,294,3 script Guillaume Vintenar#b02_a 4_M_RASWORD,{ - if ($@FlaviusBG2_id1 == getcharid(4)) { + if ($@FlaviusBG2_id1 == getcharid(CHAR_ID_BG)) { if ($@FlaviusBG2_Victory == 1) { .@your_medal = countitem(BF_Badge2); .@medal_gap = 500 - .@your_medal; @@ -457,7 +457,7 @@ OnInit: } bat_b02,389,14,3 script Croix Vintenar#b02_b 4_M_RASWORD,{ - if ($@FlaviusBG2_id2 == getcharid(4)) { + if ($@FlaviusBG2_id2 == getcharid(CHAR_ID_BG)) { if ($@FlaviusBG2_Victory == 2) { .@your_medal = countitem(BF_Badge2); .@medal_gap = 500 - .@your_medal; @@ -590,7 +590,7 @@ bat_b02,389,16,3 script Croix Camp#flag42 1_FLAG_EAGLE,{ end; } bat_b02,10,294,3 script Vintenar#bat_b02_aover 4_M_KY_HEAD,{ .@A_B_gap = $@Guill_ScoreBG2 - $@Croix_ScoreBG2; - if ($@FlaviusBG2_id1 == getcharid(4)) { + if ($@FlaviusBG2_id1 == getcharid(CHAR_ID_BG)) { if (.@A_B_gap > 0) { .@your_medal = countitem(BF_Badge2); .@medal_gap = 500 - .@your_medal; @@ -668,7 +668,7 @@ OnInit: bat_b02,389,14,3 script Vintenar#bat_b02_bover 4_M_CRU_HEAD,{ .@A_B_gap = $@Guill_ScoreBG2 - $@Croix_ScoreBG2; - if ($@FlaviusBG2_id2 == getcharid(4)) { + if ($@FlaviusBG2_id2 == getcharid(CHAR_ID_BG)) { if (.@A_B_gap > 0) { .@your_medal = countitem(BF_Badge2); .@medal_gap = 500 - .@your_medal; diff --git a/npc/battleground/tierra/tierra01.txt b/npc/battleground/tierra/tierra01.txt index 0dabe28d0..22a612c81 100644 --- a/npc/battleground/tierra/tierra01.txt +++ b/npc/battleground/tierra/tierra01.txt @@ -267,8 +267,8 @@ OnKill: OnMyMobDead: if (mobcount("bat_a01","OBJ#bat_a01_n::OnMyMobDead") < 17) { - bg_team_setxy getcharid(4),56,212; - if (getcharid(4) == $@TierraBG1_id1) { + bg_team_setxy getcharid(CHAR_ID_BG),56,212; + if (getcharid(CHAR_ID_BG) == $@TierraBG1_id1) { donpcevent "NOBJ_mob#bat_a01_a::OnEnable"; mapannounce("bat_a01", _("Guillaume captured a Neutrality Flag, so they have an advantage."), bc_map, "0xFFCE00"); } @@ -313,7 +313,7 @@ OnMyMobDead: } bat_a01,185,270,1 script Guillaume Blacksmith#a01 4_M_REPAIR,{ - if (getcharid(4) == $@TierraBG1_id1) { + if (getcharid(CHAR_ID_BG) == $@TierraBG1_id1) { mes("[Guillaume Blacksmith]"); mes("We are in urgency! The Barricade has been destroyed!"); mes("We can repair the Barricade with ^3131FF50 Stones, 3 Sinew of Bear, 500 Metal Fragments, 30 Rough Elunium and 100 Gold.^000000"); @@ -397,7 +397,7 @@ OnInit: } bat_a01,170,121,5 script Croix Blacksmith#bat_a01 4_M_REPAIR,{ - if (getcharid(4) == $@TierraBG1_id2) { + if (getcharid(CHAR_ID_BG) == $@TierraBG1_id2) { mes("[Croix Blacksmith]"); mes("We are in urgency! The Barricade has been destroyed!"); mes("We can repair the Barricade with ^3131FF50 Stones, 3 Sinew of Bear, 500 Metal Fragments, 30 Rough Elunium and 100 Gold.^000000"); @@ -622,28 +622,28 @@ OnTouch: bat_a01,194,267,0 script barri_warp_up#bat_a01_a FAKE_NPC,7,0,{ OnTouch: - if (getcharid(4) == $@TierraBG1_id1) + if (getcharid(CHAR_ID_BG) == $@TierraBG1_id1) warp "bat_a01",194,261; end; } bat_a01,194,265,0 script barri_warp_down#bat_a01a FAKE_NPC,7,0,{ OnTouch: - if (getcharid(4) == $@TierraBG1_id1) + if (getcharid(CHAR_ID_BG) == $@TierraBG1_id1) warp "bat_a01",194,270; end; } bat_a01,177,130,0 script barri_warp_up#bat_a01_b FAKE_NPC,7,0,{ OnTouch: - if (getcharid(4) == $@TierraBG1_id2) + if (getcharid(CHAR_ID_BG) == $@TierraBG1_id2) warp "bat_a01",178,125; end; } bat_a01,177,128,0 script barri_warp_down#bat_a01b FAKE_NPC,7,0,{ OnTouch: - if (getcharid(4) == $@TierraBG1_id2) + if (getcharid(CHAR_ID_BG) == $@TierraBG1_id2) warp "bat_a01",178,134; end; } @@ -695,7 +695,7 @@ bat_a01,357,74,3 script Croix Camp#flag8 1_FLAG_EAGLE,{ end; } bat_a01,348,74,3 script Croix Camp#flag9 1_FLAG_EAGLE,{ end; } bat_a01,53,377,3 script Guillaume Vintenar#a01_a 4_M_KY_HEAD,{ - if (getcharid(4) == $@TierraBG1_id1) { + if (getcharid(CHAR_ID_BG) == $@TierraBG1_id1) { if ($@TierraBG1_Victory == 1) { .@your_medal = countitem(BF_Badge1); .@medal_gap = 500 - .@your_medal; @@ -789,7 +789,7 @@ OnInit: } bat_a01,45,19,3 script Croix Vintenar#a01_b 4_M_CRU_HEAD,{ - if (getcharid(4) == $@TierraBG1_id2) { + if (getcharid(CHAR_ID_BG) == $@TierraBG1_id2) { if ($@TierraBG1_Victory == 2) { .@your_medal = countitem(BF_Badge1); .@medal_gap = 500 - .@your_medal; diff --git a/npc/battleground/tierra/tierra02.txt b/npc/battleground/tierra/tierra02.txt index ac7710aa8..a54935089 100644 --- a/npc/battleground/tierra/tierra02.txt +++ b/npc/battleground/tierra/tierra02.txt @@ -267,8 +267,8 @@ OnKill: OnMyMobDead: if (mobcount("bat_a02","OBJ#bat_a02_n::OnMyMobDead") < 17) { - bg_team_setxy getcharid(4),56,212; - if (getcharid(4) == $@TierraBG2_id1) { + bg_team_setxy getcharid(CHAR_ID_BG),56,212; + if (getcharid(CHAR_ID_BG) == $@TierraBG2_id1) { donpcevent "NOBJ_mob#bat_a02_a::OnEnable"; mapannounce("bat_a02", _("Guillaume captured a Neutrality Flag, so they have an advantage."), bc_map, "0xFFCE00"); } @@ -313,7 +313,7 @@ OnMyMobDead: } bat_a02,185,270,1 script Guillaume Blacksmith#a02 4_M_REPAIR,{ - if (getcharid(4) == $@TierraBG2_id1) { + if (getcharid(CHAR_ID_BG) == $@TierraBG2_id1) { mes("[Guillaume Blacksmith]"); mes("We are in urgency! The Barricade has been destroyed!"); mes("We can repair the Barricade with ^3131FF50 Stones, 3 Sinew of Bear, 500 Metal Fragments, 30 Rough Elunium and 100 Gold.^000000"); @@ -397,7 +397,7 @@ OnInit: } bat_a02,170,121,5 script Croix Blacksmith#bat_a02 4_M_REPAIR,{ - if (getcharid(4) == $@TierraBG2_id2) { + if (getcharid(CHAR_ID_BG) == $@TierraBG2_id2) { mes("[Croix Blacksmith]"); mes("We are in urgency! The Barricade has been destroyed!"); mes("We can repair the Barricade with ^3131FF50 Stones, 3 Sinew of Bear, 500 Metal Fragments, 30 Rough Elunium and 100 Gold.^000000"); @@ -622,28 +622,28 @@ OnTouch: bat_a02,194,267,0 script barri_warp_up#bat_a02_a FAKE_NPC,7,0,{ OnTouch: - if (getcharid(4) == $@TierraBG2_id1) + if (getcharid(CHAR_ID_BG) == $@TierraBG2_id1) warp "bat_a02",194,261; end; } bat_a02,194,265,0 script barri_warp_down#bat_a02a FAKE_NPC,7,0,{ OnTouch: - if (getcharid(4) == $@TierraBG2_id1) + if (getcharid(CHAR_ID_BG) == $@TierraBG2_id1) warp "bat_a02",194,270; end; } bat_a02,177,130,0 script barri_warp_up#bat_a02_b FAKE_NPC,7,0,{ OnTouch: - if (getcharid(4) == $@TierraBG2_id2) + if (getcharid(CHAR_ID_BG) == $@TierraBG2_id2) warp "bat_a02",178,125; end; } bat_a02,177,128,0 script barri_warp_down#bat_a02b FAKE_NPC,7,0,{ OnTouch: - if (getcharid(4) == $@TierraBG2_id2) + if (getcharid(CHAR_ID_BG) == $@TierraBG2_id2) warp "bat_a02",178,134; end; } @@ -695,7 +695,7 @@ bat_a02,357,74,3 script Croix Camp#flag18 1_FLAG_EAGLE,{ end; } bat_a02,348,74,3 script Croix Camp#flag19 1_FLAG_EAGLE,{ end; } bat_a02,53,377,3 script Guillaume Vintenar#a02_a 4_M_KY_HEAD,{ - if (getcharid(4) == $@TierraBG2_id1) { + if (getcharid(CHAR_ID_BG) == $@TierraBG2_id1) { if ($@TierraBG2_Victory == 1) { .@your_medal = countitem(BF_Badge1); .@medal_gap = 500 - .@your_medal; @@ -789,7 +789,7 @@ OnInit: } bat_a02,45,19,3 script Croix Vintenar#a02_b 4_M_CRU_HEAD,{ - if (getcharid(4) == $@TierraBG2_id2) { + if (getcharid(CHAR_ID_BG) == $@TierraBG2_id2) { if ($@TierraBG2_Victory == 2) { .@your_medal = countitem(BF_Badge1); .@medal_gap = 500 - .@your_medal; diff --git a/npc/custom/battleground/bg_tierra_01.txt b/npc/custom/battleground/bg_tierra_01.txt index bab80916b..56a505356 100644 --- a/npc/custom/battleground/bg_tierra_01.txt +++ b/npc/custom/battleground/bg_tierra_01.txt @@ -99,13 +99,13 @@ OnReadyCheck: end; OnNeutralBreak: - if( getcharid(4) == $@TierraBG1_id1 ) + if( getcharid(CHAR_ID_BG) == $@TierraBG1_id1 ) { mapannounce "bat_a01","Guillaume obtained a neurality banner, so they have an advantage.",1,0x0000FF; bg_team_setxy $@TierraBG1_id2,42,16; areawarp "bat_a01",52,208,61,217,"bat_a01",42,16; } - else if( getcharid(4) == $@TierraBG1_id2 ) + else if( getcharid(CHAR_ID_BG) == $@TierraBG1_id2 ) { mapannounce "bat_a01","Croix obtained a neutrality banner, so they have an advantage.",1,0xFF0000; bg_team_setxy $@TierraBG1_id1,50,374; @@ -113,7 +113,7 @@ OnNeutralBreak: } else end; - set .Neutral_Base, getcharid(4); + set .Neutral_Base, getcharid(CHAR_ID_BG); bg_team_setxy .Neutral_Base,56,212; if( .Guardian_1 == 0 ) diff --git a/npc/custom/battleground/bg_tierra_02.txt b/npc/custom/battleground/bg_tierra_02.txt index 791f02109..e0f1b402a 100644 --- a/npc/custom/battleground/bg_tierra_02.txt +++ b/npc/custom/battleground/bg_tierra_02.txt @@ -99,13 +99,13 @@ OnReadyCheck: end; OnNeutralBreak: - if( getcharid(4) == $@TierraBG2_id1 ) + if( getcharid(CHAR_ID_BG) == $@TierraBG2_id1 ) { mapannounce "bat_a02","Guillaume obtained a neurality banner, so they have an advantage.",1,0x0000FF; bg_team_setxy $@TierraBG2_id2,42,16; areawarp "bat_a02",52,208,61,217,"bat_a02",42,16; } - else if( getcharid(4) == $@TierraBG2_id2 ) + else if( getcharid(CHAR_ID_BG) == $@TierraBG2_id2 ) { mapannounce "bat_a02","Croix obtained a neutrality banner, so they have an advantage.",1,0xFF0000; bg_team_setxy $@TierraBG2_id1,50,374; @@ -113,7 +113,7 @@ OnNeutralBreak: } else end; - set .Neutral_Base, getcharid(4); + set .Neutral_Base, getcharid(CHAR_ID_BG); bg_team_setxy .Neutral_Base,56,212; if( .Guardian_1 == 0 ) diff --git a/npc/custom/bgqueue/flavius.txt b/npc/custom/bgqueue/flavius.txt index 33561db0a..d959253f3 100644 --- a/npc/custom/bgqueue/flavius.txt +++ b/npc/custom/bgqueue/flavius.txt @@ -170,12 +170,12 @@ OnReset: end; OnCroixQuit: - queueremove($@Croix_QueueBG1,getcharid(3)); + queueremove($@Croix_QueueBG1,getcharid(CHAR_ID_ACCOUNT)); callsub L_OnPlayerQuit; end; OnGuillaumeQuit: - queueremove($@Guill_QueueBG1,getcharid(3)); + queueremove($@Guill_QueueBG1,getcharid(CHAR_ID_ACCOUNT)); callsub L_OnPlayerQuit; end; @@ -437,7 +437,7 @@ OnTouch: } bat_b01,10,294,3 script Guillaume Vintenar#b01_a 4_M_RASWORD,{ - if ($@FlaviusBG1_id1 == getcharid(4)) { + if ($@FlaviusBG1_id1 == getcharid(CHAR_ID_BG)) { if ($@FlaviusBG1_Victory == 1) { set .@your_medal,countitem(BF_Badge2); set .@medal_gap,500 - .@your_medal; @@ -489,7 +489,7 @@ OnInit: } bat_b01,389,14,3 script Croix Vintenar#b01_b 4_M_RASWORD,{ - if ($@FlaviusBG1_id2 == getcharid(4)) { + if ($@FlaviusBG1_id2 == getcharid(CHAR_ID_BG)) { if ($@FlaviusBG1_Victory == 2) { set .@your_medal,countitem(BF_Badge2); set .@medal_gap,500 - .@your_medal; @@ -623,7 +623,7 @@ bat_b01,389,16,3 script Croix Camp#flag31 1_FLAG_EAGLE,{ end; } bat_b01,10,294,3 script Vintenar#bat_b01_aover 4_M_KY_HEAD,{ set .@A_B_gap,$@Guill_ScoreBG1 - $@Croix_ScoreBG1; - if ($@FlaviusBG1_id1 == getcharid(4)) { + if ($@FlaviusBG1_id1 == getcharid(CHAR_ID_BG)) { if (.@A_B_gap > 0) { set .@your_medal,countitem(BF_Badge2); set .@medal_gap,500 - .@your_medal; @@ -701,7 +701,7 @@ OnInit: bat_b01,389,14,3 script Vintenar#bat_b01_bover 4_M_CRU_HEAD,{ set .@A_B_gap,$@Guill_ScoreBG1 - $@Croix_ScoreBG1; - if ($@FlaviusBG1_id2 == getcharid(4)) { + if ($@FlaviusBG1_id2 == getcharid(CHAR_ID_BG)) { if (.@A_B_gap > 0) { set .@your_medal,countitem(BF_Badge2); set .@medal_gap,500 - .@your_medal; diff --git a/npc/custom/etc/marriage.txt b/npc/custom/etc/marriage.txt index 76b0429c8..4e521ec55 100644 --- a/npc/custom/etc/marriage.txt +++ b/npc/custom/etc/marriage.txt @@ -723,13 +723,13 @@ function SF_TryRegister { set $wed_bride$,strcharinfo(PC_NAME); $wed_bride_sex = Sex; if ($@wedding_effect == 1) //Store account id for effect. - set $wedding_effect_id, getcharid(3); + set $wedding_effect_id, getcharid(CHAR_ID_ACCOUNT); } else { set $wed_groom_progress,1; set $wed_groom$,strcharinfo(PC_NAME); $wed_groom_sex = Sex; if ($@wedding_effect == 2) //Store account id for effect. - set $wedding_effect_id, getcharid(3); + set $wedding_effect_id, getcharid(CHAR_ID_ACCOUNT); } } @@ -882,7 +882,7 @@ function SF_InProgress { mes "...I am still waiting for your partner to confirm the divorce procedure."; close; } - if (getcharid(0) != $@divorcee) { + if (getcharid(CHAR_ID_CHAR) != $@divorcee) { mes "["+@name$+"]"; mes "I am in the progress of divorcing "+$@divorcer$+"."; mes "Do you know who the spouse is?"; diff --git a/npc/custom/events/cluckers.txt b/npc/custom/events/cluckers.txt index f0967590b..fbdbbed3f 100644 --- a/npc/custom/events/cluckers.txt +++ b/npc/custom/events/cluckers.txt @@ -23,20 +23,20 @@ prontera,156,219,4 script Cluckers 4_NFCOCK,{ if (.startcluck) { specialeffect2 2; switch(rand(15)) { - case 0: npctalk "CLUUUUUUCK!!!"; unitskilluseid getcharid(3),"NPC_SELFDESTRUCTION",1; emotion 23; break; + case 0: npctalk "CLUUUUUUCK!!!"; unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; emotion 23; break; case 1: npctalk "Cluuuuuck!~"; break; - case 2: unitskilluseid getcharid(3),"NPC_SELFDESTRUCTION",1; break; + case 2: unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; break; case 3: sc_start SC_FREEZE,10000,0; break; - case 4: npctalk "CLUUUUUUUUUCK!!!"; unitskilluseid getcharid(3),"NPC_SELFDESTRUCTION",1; emotion 23; break; + case 4: npctalk "CLUUUUUUUUUCK!!!"; unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; emotion 23; break; case 5: sc_start SC_SLEEP,10000,0; break; case 6: sc_start SC_STONE,10000,0; emotion 29; break; - case 7: npctalk "CLUUUUUUCK!!!"; unitskilluseid getcharid(3),"NPC_SELFDESTRUCTION",1; emotion 23; break; - case 8: npctalk "Cluck! CLUUUCK!!"; unitskilluseid getcharid(3),"NPC_SELFDESTRUCTION",1; emotion 23; break; + case 7: npctalk "CLUUUUUUCK!!!"; unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; emotion 23; break; + case 8: npctalk "Cluck! CLUUUCK!!"; unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; emotion 23; break; case 9: sc_start SC_STUN,10000,0; break; case 10: sc_start SC_SLEEP,10000,0; emotion 29; break; case 11: npctalk "Cluck! Cluck!"; break; case 12: sc_start SC_STUN,10000,0; break; - case 13: unitskilluseid getcharid(3),"NPC_SELFDESTRUCTION",1; break; + case 13: unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; break; default: if (rand(50) < 4) { npctalk "WOOF!..........."; @@ -46,7 +46,7 @@ prontera,156,219,4 script Cluckers 4_NFCOCK,{ set .startcluck,0; } else { npctalk "Cluck! CLUUUCK!!"; - unitskilluseid getcharid(3),"NPC_SELFDESTRUCTION",1; + unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; } break; } diff --git a/npc/custom/item_signer.txt b/npc/custom/item_signer.txt index 7e90542b1..a0097bb55 100644 --- a/npc/custom/item_signer.txt +++ b/npc/custom/item_signer.txt @@ -126,7 +126,7 @@ prt_in,24,61,7 script Perchik 1_M_01,{ delitem2 .@id,1,1,.@ref,0,.@slot[0],.@slot[1],.@slot[2],.@slot[3]; mes "Done!"; emotion e_proud; - getitem2 .@id,1,1,.@ref,0,254,0,getcharid(0)&0xffff,(getcharid(0)>>16)&0xffff; + getitem2 .@id,1,1,.@ref,0,254,0,getcharid(CHAR_ID_CHAR)&0xffff,(getcharid(CHAR_ID_CHAR)>>16)&0xffff; equip .@id; close; } diff --git a/npc/custom/itembind.txt b/npc/custom/itembind.txt index 66b37f4e7..8c51ad24d 100644 --- a/npc/custom/itembind.txt +++ b/npc/custom/itembind.txt @@ -25,7 +25,7 @@ prontera,144,174,4 script Bound Items 4_M_JP_MID,{ } mes "What kind of bind?"; .@boundtype = 1 << (select("Account", "Guild", "Character")-1); - if(.@boundtype == 2 && (!getcharid(2) || getguildmaster(getcharid(2)) != strcharinfo(PC_NAME))) { + if(.@boundtype == 2 && (!getcharid(CHAR_ID_GUILD) || getguildmaster(getcharid(CHAR_ID_GUILD)) != strcharinfo(PC_NAME))) { mes "In order for me to bind an item to a guild you must be the master of one."; close; } @@ -92,7 +92,7 @@ prontera,144,174,4 script Bound Items 4_M_JP_MID,{ next; for(.@i = 0; .@i < getarraysize(@bound_items); .@i++) { if(@inventorylist_id[.@item] == @bound_items[.@i] && - (!getcharid(2) || getguildmaster(getcharid(2)) != strcharinfo(PC_NAME)) + (!getcharid(CHAR_ID_GUILD) || getguildmaster(getcharid(CHAR_ID_GUILD)) != strcharinfo(PC_NAME)) ) { mes "I will only unbind guild bound items that the guild master requests."; close; diff --git a/npc/custom/quests/hunting_missions.txt b/npc/custom/quests/hunting_missions.txt index dc4e20f79..611bdd480 100644 --- a/npc/custom/quests/hunting_missions.txt +++ b/npc/custom/quests/hunting_missions.txt @@ -50,7 +50,7 @@ function Chk; function Cm; mes "You've started a mission"; mes "on another character."; if ( !@hm_char_del_check ) { - if ( !query_sql( "SELECT 1 FROM `char_reg_num_db` WHERE `key` = 'Mission0' AND `char_id` IN ( SELECT `char_id` FROM `char` WHERE `account_id` = "+ getcharid(3) +" )", .@dummy ) ) { + if ( !query_sql( "SELECT 1 FROM `char_reg_num_db` WHERE `key` = 'Mission0' AND `char_id` IN ( SELECT `char_id` FROM `char` WHERE `account_id` = "+ getcharid(CHAR_ID_ACCOUNT) +" )", .@dummy ) ) { next; mes "[Hunting Missions]"; mes "I can't seem to find any records"; @@ -198,8 +198,8 @@ Mission_Status: set #Mission_Count,0; if (.Delay) set #Mission_Delay, gettimetick(2)+(.Delay*3600); set Mission_Total, Mission_Total+1; - if (Mission_Total == 1) query_sql("INSERT INTO `char_reg_num_db` (`char_id`,`key`,`index`,`value`) VALUES ("+getcharid(0)+",'Mission_Total','0',1)"); - else query_sql("UPDATE `char_reg_num_db` SET `value` = "+Mission_Total+" WHERE `char_id` = "+getcharid(0)+" AND `key` = 'Mission_Total'"); + if (Mission_Total == 1) query_sql("INSERT INTO `char_reg_num_db` (`char_id`,`key`,`index`,`value`) VALUES ("+getcharid(CHAR_ID_CHAR)+",'Mission_Total','0',1)"); + else query_sql("UPDATE `char_reg_num_db` SET `value` = "+Mission_Total+" WHERE `char_id` = "+getcharid(CHAR_ID_CHAR)+" AND `key` = 'Mission_Total'"); close; Mission_Info: @@ -258,7 +258,7 @@ OnBuyItem: close; OnNPCKillEvent: - if (!getcharid(1) || !.Party) { + if (!getcharid(CHAR_ID_PARTY) || !.Party) { if (!#Mission_Count || !Mission0) end; for (set .@i, 0; .@i<.Quests; set .@i,.@i+1) { if (strmobinfo(1,killedrid) == strmobinfo(1,getd("Mission"+.@i))) { @@ -271,8 +271,8 @@ OnNPCKillEvent: } else if (.Party) { set .@mob, killedrid; getmapxy(.@map1$, .@x1, .@y1, UNITTYPE_PC); - getpartymember getcharid(1),1; - getpartymember getcharid(1),2; + getpartymember getcharid(CHAR_ID_PARTY),1; + getpartymember getcharid(CHAR_ID_PARTY),2; for(set .@i,0; .@i<$@partymembercount; set .@i,.@i+1) { if (isloggedin($@partymemberaid[.@i], $@partymembercid[.@i])) { attachrid $@partymemberaid[.@i]; diff --git a/npc/custom/woe_controller.txt b/npc/custom/woe_controller.txt index e109951d7..14e288be7 100644 --- a/npc/custom/woe_controller.txt +++ b/npc/custom/woe_controller.txt @@ -194,7 +194,7 @@ OnReward: OnPCLoadMapEvent: if (!compare(strcharinfo(PC_MAP),"g_cas")) end; if (((.AutoKick && .Active[0]) || (.NoOwner && !getcastledata(strcharinfo(PC_MAP),1))) && !(.Active[0]&(1<<getd("."+strcharinfo(PC_MAP))))) { - if (getcharid(2) && getcastledata(strcharinfo(PC_MAP),1) == getcharid(2)) end; + if (getcharid(CHAR_ID_GUILD) && getcastledata(strcharinfo(PC_MAP),1) == getcharid(CHAR_ID_GUILD)) end; sleep2 1000; message strcharinfo(PC_NAME), getcastlename(strcharinfo(PC_MAP))+" is currently inactive."; sleep2 5000; diff --git a/npc/events/gdevent_aru.txt b/npc/events/gdevent_aru.txt index 39c3ca5f7..898880d02 100644 --- a/npc/events/gdevent_aru.txt +++ b/npc/events/gdevent_aru.txt @@ -79,13 +79,13 @@ OnMyMobDead: } arug_dun01,199,195,5 script Dwarf#aru_gd 4_M_DWARF,{ - if (getcharid(2) == 0) { + if (getcharid(CHAR_ID_GUILD) == 0) { mes "[Dwarf]"; mes "Hey did you see an ugly Goblin come by? He stole something from me!"; close; } .@chk_urquest = questprogress(2143,PLAYTIME); - .@chk_yourgdname$ = getguildname(getcharid(2)); + .@chk_yourgdname$ = getguildname(getcharid(CHAR_ID_GUILD)); if ($@gdeventv_a1 == 0) { if ($@gdevents_a$ == "") { $@gdeventv_a1 = 1; @@ -521,7 +521,7 @@ arug_que01,100,81,3 script Pierrot Pier#aru_gd 4_M_PIERROT,{ mes "- and come back later. -"; close; } - if (strcharinfo(PC_NAME) == getguildmaster(getcharid(2))) { + if (strcharinfo(PC_NAME) == getguildmaster(getcharid(CHAR_ID_GUILD))) { if ($@gdeventv_a2 == 0) { .@que_2143 = questprogress(2143,PLAYTIME); if (!.@que_2143) { diff --git a/npc/events/gdevent_sch.txt b/npc/events/gdevent_sch.txt index 1d6b892b7..e04a28075 100644 --- a/npc/events/gdevent_sch.txt +++ b/npc/events/gdevent_sch.txt @@ -79,13 +79,13 @@ OnMyMobDead: } schg_dun01,194,148,5 script Dwarf#sch_gd 4_M_DWARF,{ - if (getcharid(2) == 0) { + if (getcharid(CHAR_ID_GUILD) == 0) { mes "[Dwarf]"; mes "Hey did you see an ugly Goblin come by? He stole something from me!"; close; } .@chk_urquest = questprogress(2143,PLAYTIME); - .@chk_yourgdname$ = getguildname(getcharid(2)); + .@chk_yourgdname$ = getguildname(getcharid(CHAR_ID_GUILD)); if ($@gdeventv_s1 == 0) { if ($@gdevents_s$ == "") { $@gdeventv_s1 = 1; @@ -520,7 +520,7 @@ schg_que01,100,81,3 script Pierrot Pier#sch_gd 4_M_PIERROT,{ mes "- and come back later. -"; close; } - if (strcharinfo(PC_NAME) == getguildmaster(getcharid(2))) { + if (strcharinfo(PC_NAME) == getguildmaster(getcharid(CHAR_ID_GUILD))) { if ($@gdeventv_s2 == 0) { .@que_2143 = questprogress(2143,PLAYTIME); if (!.@que_2143) { diff --git a/npc/events/god_se_festival.txt b/npc/events/god_se_festival.txt index 1dbbe434a..7c0523cf5 100644 --- a/npc/events/god_se_festival.txt +++ b/npc/events/god_se_festival.txt @@ -66,7 +66,7 @@ yuno,1,1,0 script Festival Manager#gq_fes0 4_F_HUGIRL,{ } yuno,118,192,5 script Rmimi Ravies#gq_fes01 4_F_HUGIRL,{ - .@GID = getcharid(2); + .@GID = getcharid(CHAR_ID_GUILD); if (countitem(Valkyrie_Gift) > 0) { mes "[Rmimi Ravies]"; mes "This is the flower."; @@ -442,7 +442,7 @@ rachel,1,1,0 script Festival Manager#gq_fes2 4_F_HUGIRL,{ } rachel,132,117,3 script Rhehe Ravies#gq_fes03 4_F_HUGIRL,{ - .@GID = getcharid(2); + .@GID = getcharid(CHAR_ID_GUILD); if (countitem(Valkyrie_Gift) > 0) { mes "[Rhehe Ravies]"; mes "A flower!!"; diff --git a/npc/events/nguild/nguild_dunsw.txt b/npc/events/nguild/nguild_dunsw.txt index 23cd8ec8c..291b08db3 100644 --- a/npc/events/nguild/nguild_dunsw.txt +++ b/npc/events/nguild/nguild_dunsw.txt @@ -49,7 +49,7 @@ function script F_GldDunSw { next; if (select("Pull.", "Do not.") == 1) { - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { warp "gld_dun"+getarg(1),getarg(2),getarg(3); end; } diff --git a/npc/events/nguild/nguild_ev_agit.txt b/npc/events/nguild/nguild_ev_agit.txt index cbf6aec3c..99545bfff 100644 --- a/npc/events/nguild/nguild_ev_agit.txt +++ b/npc/events/nguild/nguild_ev_agit.txt @@ -67,7 +67,7 @@ function script F_AgitBreak { .@map$ = getarg(0); .@castle$ = getarg(1); - .@GID = getcharid(2); + .@GID = getcharid(CHAR_ID_GUILD); if (.@GID <= 0) return; .@Economy = getcastledata(.@map$,2) - 5; diff --git a/npc/events/nguild/nguild_flags.txt b/npc/events/nguild/nguild_flags.txt index d2a753003..999f79dca 100644 --- a/npc/events/nguild/nguild_flags.txt +++ b/npc/events/nguild/nguild_flags.txt @@ -53,12 +53,12 @@ function script F_Flags { return; } else { - if (getcharid(2) == .@GID && getarg(4) == 1) { + if (getcharid(CHAR_ID_GUILD) == .@GID && getarg(4) == 1) { mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if (select("Return to the guild castle.", "Quit.") == 1) { - if (getcharid(2) == getcastledata(getarg(1),1)) + if (getcharid(CHAR_ID_GUILD) == getcastledata(getarg(1),1)) warp getarg(1),getarg(2),getarg(3); } return; diff --git a/npc/events/nguild/nguild_kafras.txt b/npc/events/nguild/nguild_kafras.txt index 66c53ff2d..8b448bbe3 100644 --- a/npc/events/nguild/nguild_kafras.txt +++ b/npc/events/nguild/nguild_kafras.txt @@ -39,7 +39,7 @@ function script F_GKafra { cutin "kafra_01",2; @GID = getcastledata(getarg(0),1); - if (getcharid(2) == @GID && getgdskilllv(@GID,10001)) goto L_StartG; + if (getcharid(CHAR_ID_GUILD) == @GID && getgdskilllv(@GID,10001)) goto L_StartG; mes "[Kafra Service]"; mes "I am contracted to provide service only for the ^ff0000" + getguildname(@GID) + "^000000 Guild. Please use another Kafra Corporation staff member around here. I am Sorry for your inconvenience."; diff --git a/npc/events/nguild/nguild_managers.txt b/npc/events/nguild/nguild_managers.txt index 6ff1e7e2a..1d9b56966 100644 --- a/npc/events/nguild/nguild_managers.txt +++ b/npc/events/nguild/nguild_managers.txt @@ -47,7 +47,7 @@ function script F_GldManager { mes "I am waiting for my master. Brave adventurer, follow your destiny!"; return; } - if (getcharid(2) != @GID){ + if (getcharid(CHAR_ID_GUILD) != @GID){ mes "I am here to follow ^5533FF" + getguildmaster(@GID) + "^000000's command! Hey! Your not even a part of the guild!!"; mes "Where are the guardians? Destroy these intruders!"; return; diff --git a/npc/events/nguild/nguild_warper.txt b/npc/events/nguild/nguild_warper.txt index 07ee4b0ed..a2e2faed1 100644 --- a/npc/events/nguild/nguild_warper.txt +++ b/npc/events/nguild/nguild_warper.txt @@ -42,24 +42,24 @@ prontera,146,163,6 script Novice Castles 4_F_NOVICE,{ mes "[Cita]"; - if (!getcharid(2)) { + if (!getcharid(CHAR_ID_GUILD)) { mes "^FF0000You have to enter a guild to be able to hit Emperium!^000000"; - } else if (getgdskilllv(getcharid(2),10013) || - (getgdskilllv(getcharid(2),10000) + - getgdskilllv(getcharid(2),10001) + - getgdskilllv(getcharid(2),10002) + - getgdskilllv(getcharid(2),10003) + - getgdskilllv(getcharid(2),10004) + - getgdskilllv(getcharid(2),10005) + - getgdskilllv(getcharid(2),10006) + - getgdskilllv(getcharid(2),10007) + - getgdskilllv(getcharid(2),10008) + - getgdskilllv(getcharid(2),10009) + - getgdskilllv(getcharid(2),10010) + - getgdskilllv(getcharid(2),10011) + - getgdskilllv(getcharid(2),10012) + - getgdskilllv(getcharid(2),10013) + - getgdskilllv(getcharid(2),10014) > 9) + } else if (getgdskilllv(getcharid(CHAR_ID_GUILD),10013) || + (getgdskilllv(getcharid(CHAR_ID_GUILD),10000) + + getgdskilllv(getcharid(CHAR_ID_GUILD),10001) + + getgdskilllv(getcharid(CHAR_ID_GUILD),10002) + + getgdskilllv(getcharid(CHAR_ID_GUILD),10003) + + getgdskilllv(getcharid(CHAR_ID_GUILD),10004) + + getgdskilllv(getcharid(CHAR_ID_GUILD),10005) + + getgdskilllv(getcharid(CHAR_ID_GUILD),10006) + + getgdskilllv(getcharid(CHAR_ID_GUILD),10007) + + getgdskilllv(getcharid(CHAR_ID_GUILD),10008) + + getgdskilllv(getcharid(CHAR_ID_GUILD),10009) + + getgdskilllv(getcharid(CHAR_ID_GUILD),10010) + + getgdskilllv(getcharid(CHAR_ID_GUILD),10011) + + getgdskilllv(getcharid(CHAR_ID_GUILD),10012) + + getgdskilllv(getcharid(CHAR_ID_GUILD),10013) + + getgdskilllv(getcharid(CHAR_ID_GUILD),10014) > 9) ) { mes "I see... your guild has Emergency Call mastered."; mes "You cannot enter the Novice Castle area."; diff --git a/npc/instances/EndlessTower.txt b/npc/instances/EndlessTower.txt index 8fc6f973e..e6947d2a4 100644 --- a/npc/instances/EndlessTower.txt +++ b/npc/instances/EndlessTower.txt @@ -209,7 +209,7 @@ alberta,214,77,6 script Captain Janssen 4_M_SEAMAN,{ e_tower,81,105,0 script Tower Protection Stone 2_MONEMUS,{ - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); .@p_name$ = getpartyname(.@party_id); .@md_name$ = "Endless Tower"; @@ -221,7 +221,7 @@ e_tower,81,105,0 script Tower Protection Stone 2_MONEMUS,{ close; } if (!.@etower_timer) { - if (getcharid(0) == getpartyleader(.@party_id,2)) { + if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2)) { mes "Confirmed the party has been made. Would you like to reserve entrance to the Endless Tower?"; next; switch(select("Generate dungeon "+.@md_name$, "Enter the dungeon", "Return to Alberta", "Cancel")) { diff --git a/npc/instances/NydhoggsNest.txt b/npc/instances/NydhoggsNest.txt index c8f6c8567..bad1aacec 100644 --- a/npc/instances/NydhoggsNest.txt +++ b/npc/instances/NydhoggsNest.txt @@ -104,7 +104,7 @@ nyd_dun02,100,201,3 script Yggdrasil Gatekeeper HIDDEN_NPC,8,8,{ } } else if (ins_nyd == 131 || ins_nyd == 132 || ins_nyd > 199) { - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); .@md_name$ = "Nidhoggur's Nest"; .@ins_nyd_check = questprogress(3135,PLAYTIME); // 3 Day cooldown @@ -124,7 +124,7 @@ nyd_dun02,100,201,3 script Yggdrasil Gatekeeper HIDDEN_NPC,8,8,{ mes "And only 1 representative of you needs to talk to me, so don't annoy me..."; close; } - if (getcharid(0) == getpartyleader(.@party_id,2)) { + if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2)) { mes "[Yggdrasil Gatekeeper]"; mes "The loyal servants of the Guardian... what can I do for you?"; next; @@ -224,7 +224,7 @@ L_Enter: mes "You did not request for entrance. Please let your leader request entrance."; close; } else { - mapannounce "nyd_dun02", getpartyname(getcharid(1))+"'s party member "+strcharinfo(PC_NAME)+" has entered Nidhoggur's Nest.",bc_map,"0x00ff99"; + mapannounce "nyd_dun02", getpartyname(getcharid(CHAR_ID_PARTY))+"'s party member "+strcharinfo(PC_NAME)+" has entered Nidhoggur's Nest.",bc_map,"0x00ff99"; if (!questprogress(3135)) setquest 3135; if (!questprogress(3136)) setquest 3136; warp "1@nyd",32,37; @@ -1608,7 +1608,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."; next; mes "[World Tree Yggdrasil]"; - if (getcharid(0) == getpartyleader(getcharid(1),2)) { + if (getcharid(CHAR_ID_CHAR) == getpartyleader(getcharid(CHAR_ID_PARTY),2)) { 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; mes "[World Tree Yggdrasil]"; @@ -1860,7 +1860,7 @@ OnTouch: 2@nyd,199,268,0 script nyd_2f_boss_enter FAKE_NPC,8,8,{ OnTouch_: - if (getcharid(0) == getpartyleader(getcharid(1),2)) { + if (getcharid(CHAR_ID_CHAR) == getpartyleader(getcharid(CHAR_ID_PARTY),2)) { donpcevent instance_npcname("nyd_2f_boss_enter_call")+"::OnEnable"; disablenpc instance_npcname("nyd_2f_boss_enter"); end; diff --git a/npc/instances/OrcsMemory.txt b/npc/instances/OrcsMemory.txt index 4455124eb..48412a631 100644 --- a/npc/instances/OrcsMemory.txt +++ b/npc/instances/OrcsMemory.txt @@ -39,7 +39,7 @@ //== Entrance ============================================== gef_fild10,242,202,0 script Dimensional Gorge Piece 2_MONEMUS,{ - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); .@p_name$ = getpartyname(.@party_id); .@md_name$ = "Orc's Memory"; @@ -62,7 +62,7 @@ gef_fild10,242,202,0 script Dimensional Gorge Piece 2_MONEMUS,{ close; // Fall through to access the dungeon } else { // !.@orctime - if (getcharid(0) == getpartyleader(.@party_id,2)) { + if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2)) { mes "Party status confirmed. Would you like to book entrance to the "+.@md_name$+"?"; next; switch(select("Reserve the "+.@md_name$, "Enter the Dungeon", "Cancel")) { @@ -684,7 +684,7 @@ OnTimer23910: } 2@orcs,26,164,0 script Torch#1-1 CLEAR_NPC,{ - if(getpartyleader(getcharid(1),2) != getcharid(0)) end; + if(getpartyleader(getcharid(CHAR_ID_PARTY),2) != getcharid(CHAR_ID_CHAR)) end; progressbar "ffff00",5; setarray .@id[0], atoi(charat(strnpcinfo(NPC_NAME_HIDDEN),0)), atoi(charat(strnpcinfo(NPC_NAME_HIDDEN),2)); if (.@id[1] == 4) diff --git a/npc/instances/SealedShrine.txt b/npc/instances/SealedShrine.txt index fd33f16a0..90efe6f5c 100644 --- a/npc/instances/SealedShrine.txt +++ b/npc/instances/SealedShrine.txt @@ -105,7 +105,7 @@ monk_test,309,146,3 script Friar Patrick#edq 4_M_OLDFRIAR,{ case 2: if (BaseLevel >= 75) { - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); mes "[Friar Patrick]"; mes "Do you mean you'll go to the shrine and reseal Baphomet?"; @@ -117,7 +117,7 @@ monk_test,309,146,3 script Friar Patrick#edq 4_M_OLDFRIAR,{ //.@ins_bapho_check2 = questprogress(3045,PLAYTIME); if (!.@ins_bapho_check) { - if (getpartyleader(.@party_id,2) == getcharid(0) && instance_check_party(.@party_id,2,75)) { + if (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR) && instance_check_party(.@party_id,2,75)) { mes "[Friar Patrick]"; mes "Party name is "+getpartyname(.@party_id)+"..."; mes "Name of the leader is "+strcharinfo(PC_NAME)+"..."; @@ -491,7 +491,7 @@ OnMyMobDead: //== Soul of hero near the north grave ===================== 1@cata,141,221,0 script Gravestone# CLEAR_NPC,3,3,{ - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); if ('ins_baphomet == 0) { mes "The gravestone is trembling..."; next; @@ -548,7 +548,7 @@ OnMyMobDead: mes "If your ^0000FFparty leader^000000 brings me the pendant, my soul can be substantialized. So, hurry up."; close; } - else if (('ins_baphomet == 2) && (getpartyleader(.@party_id,2) == getcharid(0))) { + else if (('ins_baphomet == 2) && (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR))) { mes "[Voice of the Gravestone]"; mes "Did you find the pendant?"; next; @@ -598,7 +598,7 @@ OnInstanceInit: // Temporary fix for @reloadscript. } 1@cata,176,119,4 script Ancient Hero's Soul#1F 4_M_CHAMPSOUL,{ - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); cutin "ins_cata_champ_n",2; if ('ins_baphomet == 2) { mes "[Ancient Hero's Soul]"; @@ -660,7 +660,7 @@ OnInstanceInit: // Temporary fix for @reloadscript. break; case 3: ++.@ins_baphomet_1f_3; - if (getpartyleader(.@party_id,2) == getcharid(0)) { + if (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR)) { 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."; next; @@ -712,7 +712,7 @@ OnInstanceInit: // Temporary fix for @reloadscript. } if (.@exitloop) break; } - if (getpartyleader(.@party_id,2) == getcharid(0)) { + if (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR)) { 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!"; 'ins_baphomet = 3; @@ -729,7 +729,7 @@ OnInstanceInit: // Temporary fix for @reloadscript. cutin "",255; end; } - else if (('ins_baphomet == 3) && (getpartyleader(.@party_id,2) == getcharid(0))) { + else if (('ins_baphomet == 3) && (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR))) { cutin "ins_cata_champ_n",2; mes "[Ancient Hero's Soul]"; mes "Did you get 10 ^0000FFEssence of Fire^000000 and ^0000FFToken of Apostle^000000?"; @@ -766,7 +766,7 @@ OnInstanceInit: // Temporary fix for @reloadscript. cutin "",255; end; } - else if (('ins_baphomet == 4) && (getpartyleader(.@party_id,2) == getcharid(0))) { + else if (('ins_baphomet == 4) && (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR))) { cutin "ins_cata_champ_n",2; 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."; @@ -886,8 +886,8 @@ OnInstanceInit: //== Bobbing Torches ======================================= - script Bobbing Torch#SS FAKE_NPC,{ - .@party_id = getcharid(1); - if (getpartyleader(.@party_id,2) == getcharid(0)) { + .@party_id = getcharid(CHAR_ID_PARTY); + if (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR)) { if (('ins_baphomet == 3) && (countitem(Essence_Of_Fire) < 11)) { mes "A huge torch appearing as if it can burn everything is bobbing up and down in front of me."; next; @@ -1124,8 +1124,8 @@ OnInstanceInit: 2@cata,35,109,0 duplicate(Magical Seal#SS) Magical Seal#10 CLEAR_NPC 2@cata,79,65,0 script The Main Altar#ss CLEAR_NPC,{ - .@party_id = getcharid(1); - if (('ins_baphomet == 5) && (getpartyleader(.@party_id,2) == getcharid(0))) { + .@party_id = getcharid(CHAR_ID_PARTY); + if (('ins_baphomet == 5) && (getpartyleader(.@party_id,2) == getcharid(CHAR_ID_CHAR))) { mes "An evil power, too terrible to describe, lies under the great altar radiating a violet color."; next; mes "Complicated Magical Rune letters blink rapidly, attempting to suppress the dreadful power within."; diff --git a/npc/jobs/2-1/assassin.txt b/npc/jobs/2-1/assassin.txt index 86ce74644..fcc1c4c98 100644 --- a/npc/jobs/2-1/assassin.txt +++ b/npc/jobs/2-1/assassin.txt @@ -1103,7 +1103,7 @@ OnStartArena: warpwaitingpc "in_moc_16", 66, 151; attachrid($@warpwaitingpc[0]); if (ASSIN_Q2 < 5) { - warpchar "in_moc_16",20,145,getcharid(0); + warpchar "in_moc_16",20,145,getcharid(CHAR_ID_CHAR); end; } donpcevent "Beholder#ASNTEST::OnEnable"; diff --git a/npc/kafras/functions_kafras.txt b/npc/kafras/functions_kafras.txt index 379aabfb7..54db666e6 100644 --- a/npc/kafras/functions_kafras.txt +++ b/npc/kafras/functions_kafras.txt @@ -80,7 +80,7 @@ function script F_Kafra { break; case 2: // Guild Castle Kafra message - @GID = getcharid(2); + @GID = getcharid(CHAR_ID_GUILD); mes "[Kafra Employee]"; mes "Welcome. ^ff0000" + getguildname(@GID) + "^000000 Member."; mes "The Kafra Coporation will stay with you wherever you go."; diff --git a/npc/other/CashShop_Functions.txt b/npc/other/CashShop_Functions.txt index 3197b3838..629e91b8a 100644 --- a/npc/other/CashShop_Functions.txt +++ b/npc/other/CashShop_Functions.txt @@ -57,9 +57,9 @@ function script F_CashStore { // - No arguments. function script F_CashPartyCall { warp "Random",0,0; - if (getpartyleader(getcharid(1),2) == getcharid(0)) { + if (getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR)) { getmapxy(.@mapl$, .@xl, .@yl, UNITTYPE_PC); - warpparty .@mapl$, .@xl, .@yl, getcharid(1), .@mapl$; + warpparty .@mapl$, .@xl, .@yl, getcharid(CHAR_ID_PARTY), .@mapl$; } return; } @@ -285,7 +285,7 @@ function script F_Snowball { case 2: mes "Blessings."; mes "Holy night~"; - unitskilluseid getcharid(3),"SM_ENDURE",10; + unitskilluseid getcharid(CHAR_ID_ACCOUNT),"SM_ENDURE",10; close2; cutin "",255; break; diff --git a/npc/other/arena/arena_party.txt b/npc/other/arena/arena_party.txt index ad341e8a9..d7865d441 100644 --- a/npc/other/arena/arena_party.txt +++ b/npc/other/arena/arena_party.txt @@ -1025,7 +1025,7 @@ prt_are_in,77,135,3 script Staff#party-2 1_F_02,{ mes "[Staff]"; mes "^3131FF"+$arena_pttopn$+"^000000's running time was ^3131FF"+$top_ptmin+"^000000minutes ^3131FF"+$top_ptsec+"^000000seconds."; next; - .arn_party = getcharid(1); + .arn_party = getcharid(CHAR_ID_PARTY); if (@gappt < 0) { mes "[Staff]"; mes "Although you failed to make a new record, I hope you will succeed next time."; @@ -1053,7 +1053,7 @@ prt_are_in,77,135,3 script Staff#party-2 1_F_02,{ mes "See you later~"; close2; } - if(getpartyleader(.arn_party,2) == getcharid(0)) { + if(getpartyleader(.arn_party,2) == getcharid(CHAR_ID_CHAR)) { donpcevent "#arn_timer_pt::OnStop"; donpcevent "alloff#pt::OnEnable"; donpcevent "Ponox::OnStart"; @@ -1068,7 +1068,7 @@ prt_are_in,77,135,3 script Staff#party-2 1_F_02,{ mes "Wow! You have renewed the record!"; mes "What a great job!"; next; - if(getpartyleader(.arn_party,2) == getcharid(0)) { + if(getpartyleader(.arn_party,2) == getcharid(CHAR_ID_CHAR)) { mes "[Staff]"; 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."; @@ -1131,7 +1131,7 @@ prt_are_in,77,135,3 script Staff#party-2 1_F_02,{ mes "See you later~"; close2; } - if(getpartyleader(.arn_party,2) == getcharid(0)) { + if(getpartyleader(.arn_party,2) == getcharid(CHAR_ID_CHAR)) { donpcevent "#arn_timer_pt::OnStop"; donpcevent "alloff#pt::OnEnable"; donpcevent "Ponox::OnStart"; diff --git a/npc/other/marriage.txt b/npc/other/marriage.txt index ea43b347f..bbd659420 100644 --- a/npc/other/marriage.txt +++ b/npc/other/marriage.txt @@ -577,7 +577,7 @@ prt_church,100,128,4 script Bishop#w 1_M_PASTOR,{ if (!getpartnerid()) { if (!$@wedding) { if (wedding_sign == 1) { - getpartymember(getcharid(1)); + getpartymember(getcharid(CHAR_ID_PARTY)); .@partymembercount = $@partymembercount; if (.@partymembercount == 2) { if (Sex == SEX_MALE) { @@ -648,7 +648,7 @@ prt_church,100,128,4 script Bishop#w 1_M_PASTOR,{ } else if ($@wedding == 1) { if (wedding_sign == 1) { - getpartymember(getcharid(1)); + getpartymember(getcharid(CHAR_ID_PARTY)); .@partymembercount = $@partymembercount; if (.@partymembercount == 2) { if (Sex == SEX_FEMALE) { @@ -689,7 +689,7 @@ prt_church,100,128,4 script Bishop#w 1_M_PASTOR,{ mes "Will you marry "+$@wed_groom$+"?"; next; if (select("Yes, I do.", "^FF0000No.^000000") == 1) { - if (isloggedin(getcharid(3,$@wed_groom$))) { + if (isloggedin(getcharid(CHAR_ID_ACCOUNT,$@wed_groom$))) { if (marriage($@wed_groom$)) { //Call Wedding effect wedding; @@ -697,12 +697,12 @@ prt_church,100,128,4 script Bishop#w 1_M_PASTOR,{ sc_start SC_WEDDING,3600000,1; getitem Bride_Ring,1; //Give ring to Groom, and change to wedding sprite. - attachrid(getcharid(3,$@wed_groom$)); + attachrid(getcharid(CHAR_ID_ACCOUNT,$@wed_groom$)); sc_start SC_WEDDING,3600000,1; getitem Bridegroom_Ring,1; detachrid; //Switch Script progression back to Bride - attachrid(getcharid(3,$@wed_bride$)); + attachrid(getcharid(CHAR_ID_ACCOUNT,$@wed_bride$)); cutin "wedding_bomars02",2; mapannounce "prt_church","I now pronounce you, "+$@wed_groom$+" and "+$@wed_bride$+", husband and wife.",bc_map; mes "[Vomars]"; diff --git a/npc/other/poring_war.txt b/npc/other/poring_war.txt index 7d58569ef..b3e0eb15a 100644 --- a/npc/other/poring_war.txt +++ b/npc/other/poring_war.txt @@ -644,8 +644,8 @@ poring_w02,26,181,3 script Mr. Doppel#wop_team_a 8_DOPPEL,{ close; } .@a_tname$ = getpartyname($@wop_team_a); - .@pname$ = getpartyname(getcharid(1)); - if ($@wop_team_a != 0 && $@wop_team_a == getcharid(1)) { + .@pname$ = getpartyname(getcharid(CHAR_ID_PARTY)); + if ($@wop_team_a != 0 && $@wop_team_a == getcharid(CHAR_ID_PARTY)) { mes "[Mr. Doppel]"; mes "So, everyone joined the party?"; mes "The name of the party is... " + .@pname$ + ", right?"; @@ -662,7 +662,7 @@ poring_w02,26,181,3 script Mr. Doppel#wop_team_a 8_DOPPEL,{ mes "If you don't get there in time, you won't make it to the battle."; close; case 2: - if ((getpartyleader(getcharid(1),2) == getcharid(0))) { + if ((getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR))) { mes "[Mr. Doppel]"; mes "So, you are the leader. Before going to the battlefield, you should check all your members."; next; @@ -694,7 +694,7 @@ poring_w02,26,181,3 script Mr. Doppel#wop_team_a 8_DOPPEL,{ } } else { - if ((getpartyleader(getcharid(1),2) == getcharid(0))) { + if ((getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR))) { if ($@wop_team_a == 0) { mes "[Mr. Doppel]"; mes "So, you are the party leader of Angeling Team."; @@ -719,7 +719,7 @@ poring_w02,26,181,3 script Mr. Doppel#wop_team_a 8_DOPPEL,{ mes "So, I'll register your party name as - " +.@pname$ + " -."; mes "Now, Tell your ^4d4dffmembers to confirm your party^000000."; mes "I'll send you to the battlefield as soon as I confirm your party."; - $@wop_team_a = getcharid(1); + $@wop_team_a = getcharid(CHAR_ID_PARTY); mapannounce "poring_w02","The registration of the Angeling Team has been confirmed. The party members must confirm their team with Mr. Doppel.",0,0x33FF66; close; case 3: @@ -775,8 +775,8 @@ poring_w02,170,181,3 script Mr. Doppel#wop_team_d 8_DOPPEL,{ close; } .@d_tname$ = getpartyname($@wop_team_d); - .@pname$ = getpartyname(getcharid(1)); - if ($@wop_team_d != 0 && $@wop_team_d == getcharid(1)) { + .@pname$ = getpartyname(getcharid(CHAR_ID_PARTY)); + if ($@wop_team_d != 0 && $@wop_team_d == getcharid(CHAR_ID_PARTY)) { mes "[Mr. Doppel]"; mes "So, everyone joined the party?"; mes "The name of the party is... " + .@pname$ + ", right?"; @@ -793,7 +793,7 @@ poring_w02,170,181,3 script Mr. Doppel#wop_team_d 8_DOPPEL,{ mes "If you don't get there in time, you won't make it to the battle."; close; case 2: - if ((getpartyleader(getcharid(1),2) == getcharid(0))) { + if ((getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR))) { mes "[Mr. Doppel]"; mes "So, you are the leader. Before going to the battlefield, you should check all your members."; next; @@ -823,7 +823,7 @@ poring_w02,170,181,3 script Mr. Doppel#wop_team_d 8_DOPPEL,{ } } } else { - if ((getpartyleader(getcharid(1),2) == getcharid(0))) { + if ((getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR))) { if ($@wop_team_d == 0) { mes "[Mr. Doppel]"; mes "So, you are the party leader of Deviling Team."; @@ -848,7 +848,7 @@ poring_w02,170,181,3 script Mr. Doppel#wop_team_d 8_DOPPEL,{ mes "So, I'll register your party name as - " + .@pname$ + " -."; mes "Now, Tell your ^4d4dffmembers to confirm your party^000000."; mes "I'll send you to the battlefield as soon as I confirm your party."; - $@wop_team_d = getcharid(1); + $@wop_team_d = getcharid(CHAR_ID_PARTY); mapannounce "poring_w02","The registration of the Deviling Team has been confirmed. The party members must confirm their team with Mr. Doppel.",0,0x33FF66; close; case 3: @@ -1238,7 +1238,7 @@ poring_w02,99,201,3 script Deviruchi#wop_endmaster 4_DEVIRUCHI,{ } .@a_point = $@wop_deadcount_a; .@d_point = $@wop_deadcount_d; - if (getcharid(1) == $@wop_team_a) { + if (getcharid(CHAR_ID_PARTY) == $@wop_team_a) { if (.@a_point < .@d_point) { mes "[Devi]"; mes "Good work!"; @@ -1319,7 +1319,7 @@ poring_w02,99,201,3 script Deviruchi#wop_endmaster 4_DEVIRUCHI,{ } } } - else if (getcharid(1) == $@wop_team_d) { + else if (getcharid(CHAR_ID_PARTY) == $@wop_team_d) { if (.@a_point > .@d_point) { mes "[Devi]"; mes "Good work!"; diff --git a/npc/quests/guildrelay.txt b/npc/quests/guildrelay.txt index 55717e9ce..7cb580130 100644 --- a/npc/quests/guildrelay.txt +++ b/npc/quests/guildrelay.txt @@ -85,7 +85,7 @@ mes "head on your way.^000000"; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { if (strcharinfo(PC_NAME) == getguildmaster(.@GID)) { if (guildrelay_q == 100) { if (guildtime > 22) { @@ -1197,7 +1197,7 @@ } } else { - if (getcharid(2) == 0) { + if (getcharid(CHAR_ID_GUILD) == 0) { mes "[" + .@name$ + "]"; mes "You haven't joined"; mes "a guild yet? Why don't"; @@ -1264,7 +1264,7 @@ mes "head on your way.^000000"; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { if (strcharinfo(PC_NAME) == getguildmaster(.@GID)) { if (countitem(Soul_Of_Guild) > 0) { mes "[" + .@name$ + "]"; @@ -1768,7 +1768,7 @@ mes "there's no reason to be here.^000000"; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { if (strcharinfo(PC_NAME) == getguildmaster(.@GID)) { if (countitem(Soul_Of_Confidence) > 0) { mes "[" + .@name$ + "]"; @@ -2452,7 +2452,7 @@ mes "there's no reason to be here.^000000"; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { if (strcharinfo(PC_NAME) == getguildmaster(.@GID)) { if (countitem(Soul_Of_Peace) > 0) { mes "[" + .@name$ + "]"; @@ -2527,9 +2527,9 @@ close; } } - getpartymember(getcharid(1)); + getpartymember(getcharid(CHAR_ID_PARTY)); .@partymembercount = $@partymembercount; - .@partyleader = getpartyleader(getcharid(1),2); + .@partyleader = getpartyleader(getcharid(CHAR_ID_PARTY),2); if (guildrelay_q == 91) { if (.@partymembercount == 6) { mes "[" + .@name$ + "]"; diff --git a/npc/quests/okolnir.txt b/npc/quests/okolnir.txt index 4d5cb4910..6b3a52015 100644 --- a/npc/quests/okolnir.txt +++ b/npc/quests/okolnir.txt @@ -44,7 +44,7 @@ function script F_Okolnir { - script Guide#gq_main FAKE_NPC,{ .@sub$ = callfunc("F_Okolnir"); .@GID = getcastledata(strnpcinfo(NPC_MAP),1); - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { if (getd("$siz_"+.@sub$+"_on") == 0) { mes "[Guide]"; mes "This castle has a hidden secret."; @@ -192,7 +192,7 @@ que_qsch05,345,23,0 warp Gate02#gq_sch05 1,1,schg_cas05,369,306 .@sub$ = callfunc("F_Okolnir"); .@t$ = ((compare(strnpcinfo(NPC_MAP),"aru"))?"arug_cas0":"schg_cas0")+(charat(strnpcinfo(NPC_MAP),getstrlen(strnpcinfo(NPC_MAP))-1)); .@GID = getcastledata(.@t$,1); - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { cutin "wish_maiden31",1; if (strcharinfo(PC_NAME) == getguildmaster(.@GID)) { mes "[Wish Maiden]"; @@ -2161,7 +2161,7 @@ que_qsch05,251,255,3 duplicate(Wish Maiden#main_boss) Wish Maiden#sch05_boss WIS .@sub$ = callfunc("F_Okolnir"); .@t$ = ((compare(strnpcinfo(NPC_MAP),"aru"))?"arug_cas0":"schg_cas0")+(charat(strnpcinfo(NPC_MAP),getstrlen(strnpcinfo(NPC_MAP))-1)); .@GID = getcastledata(.@t$,1); - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { if (strcharinfo(PC_NAME) == getguildmaster(.@GID)) { if (compare(.@sub$,"aru")) { setarray .@n, 7835,1,7836,1,7837,1,7838,1,2513,1,7291,10,7293,10,7063,100,985,20; diff --git a/npc/quests/partyrelay.txt b/npc/quests/partyrelay.txt index 54d78bec6..f426106fc 100644 --- a/npc/quests/partyrelay.txt +++ b/npc/quests/partyrelay.txt @@ -34,9 +34,9 @@ //========================================================================= payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{ - getpartymember(getcharid(1)); + getpartymember(getcharid(CHAR_ID_PARTY)); .@partymembercount = $@partymembercount; - .@partyleader = getpartyleader(getcharid(1),2); + .@partyleader = getpartyleader(getcharid(CHAR_ID_PARTY),2); if (checkweight(Resin,300) == 0) { mes "^3355FFWait a minute! You're"; mes "carrying too many items"; @@ -54,7 +54,7 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{ mes "of your group members with you."; close; } - if ((countitem(Mission_Certificate12) > 0) && (.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5)) { + if ((countitem(Mission_Certificate12) > 0) && (.@partyleader == getcharid(CHAR_ID_CHAR)) && (getcharid(CHAR_ID_GUILD) > 0) && (.@partymembercount > 5)) { mes "[Ledrion]"; mes "Ah, you've brought the"; mes "last ticket from Rospii."; @@ -129,7 +129,7 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{ mes "over to Gatan right now?"; close; } - if ((countitem(Mission_Certificate8) > 0) && (.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5)) { + if ((countitem(Mission_Certificate8) > 0) && (.@partyleader == getcharid(CHAR_ID_CHAR)) && (getcharid(CHAR_ID_GUILD) > 0) && (.@partymembercount > 5)) { mes "[Ledrion]"; mes "Great, you've brought"; mes "me the eighth ticket from"; @@ -178,7 +178,7 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{ mes "a ticket to Gatan?"; close; } - if ((countitem(Mission_Certificate4) > 0) && (.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5)) { + if ((countitem(Mission_Certificate4) > 0) && (.@partyleader == getcharid(CHAR_ID_CHAR)) && (getcharid(CHAR_ID_GUILD) > 0) && (.@partymembercount > 5)) { mes "[Ledrion]"; mes "I see that you've brought"; mes "me the fourth ticket from"; @@ -219,7 +219,7 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{ mes "come to me, not yet."; close; } - if ((BaseLevel > 39) && (.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5) && (party_relay == 1)) { + if ((BaseLevel > 39) && (.@partyleader == getcharid(CHAR_ID_CHAR)) && (getcharid(CHAR_ID_GUILD) > 0) && (.@partymembercount > 5) && (party_relay == 1)) { mes "[Ledrion]"; mes "As I mentioned earlier,"; mes "I'm challenging guild"; @@ -271,7 +271,7 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{ mes "once the time is right."; close; } - if ((.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5) && (party_relay > 0)) { + if ((.@partyleader == getcharid(CHAR_ID_CHAR)) && (getcharid(CHAR_ID_GUILD) > 0) && (.@partymembercount > 5) && (party_relay > 0)) { mes "[Ledrion]"; mes "As leader of your"; mes "Party, you should"; @@ -280,7 +280,7 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{ mes "of your partners."; close; } - if ((.@partyleader != getcharid(0)) && (getcharid(2) > 0)) { + if ((.@partyleader != getcharid(CHAR_ID_CHAR)) && (getcharid(CHAR_ID_GUILD) > 0)) { mes "[Ledrion]"; mes "I'm sorry, but there's"; mes "nothing I can really offer"; @@ -363,7 +363,7 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{ next; switch(select("Sure!", "No.")) { case 1: - if ((BaseLevel > 39) && (.@partyleader == getcharid(0)) && (getcharid(2) > 0) && (.@partymembercount > 5)) { + if ((BaseLevel > 39) && (.@partyleader == getcharid(CHAR_ID_CHAR)) && (getcharid(CHAR_ID_GUILD) > 0) && (.@partymembercount > 5)) { mes "[Ledrion]"; mes "Great! Let's see..."; mes "Well, you meet all the"; @@ -402,9 +402,9 @@ payon,103,113,3 script Ledrion#payon::RelayLedrion 4_M_MANAGER,{ } payon,83,327,3 script Gatan#payon::RelayGatan 4_M_04,{ - getpartymember(getcharid(1)); + getpartymember(getcharid(CHAR_ID_PARTY)); .@partymembercount = $@partymembercount; - .@partyleader = getpartyleader(getcharid(1),2); + .@partyleader = getpartyleader(getcharid(CHAR_ID_PARTY),2); if (checkweight(Resin,300) == 0) { mes "^3355FFWait a minute! You're"; mes "carrying too many items"; @@ -1837,9 +1837,9 @@ payon,83,327,3 script Gatan#payon::RelayGatan 4_M_04,{ } payon,204,221,3 script Bafhail#payon::RelayBafhail 4_M_JOB_BLACKSMITH,{ - getpartymember(getcharid(1)); + getpartymember(getcharid(CHAR_ID_PARTY)); .@partymembercount = $@partymembercount; - .@partyleader = getpartyleader(getcharid(1),2); + .@partyleader = getpartyleader(getcharid(CHAR_ID_PARTY),2); if (checkweight(Resin,300) == 0) { mes "^3355FFWait a minute! You're"; mes "carrying too many items"; @@ -2470,9 +2470,9 @@ payon,204,221,3 script Bafhail#payon::RelayBafhail 4_M_JOB_BLACKSMITH,{ } payon,168,314,3 script Lospii#payon::RelayLospii 4_M_KID1,{ - getpartymember(getcharid(1)); + getpartymember(getcharid(CHAR_ID_PARTY)); .@partymembercount = $@partymembercount; - .@partyleader = getpartyleader(getcharid(1),2); + .@partyleader = getpartyleader(getcharid(CHAR_ID_PARTY),2); if (checkweight(Resin,300) == 0) { mes "^3355FFWait a minute! You're"; mes "carrying too many items"; diff --git a/npc/quests/quests_louyang.txt b/npc/quests/quests_louyang.txt index e9e76b99c..d9c07c597 100644 --- a/npc/quests/quests_louyang.txt +++ b/npc/quests/quests_louyang.txt @@ -4634,9 +4634,9 @@ lou_in02,77,37,7 script Hermit 4_M_CHNOLD,{ mes strcharinfo(PC_NAME)+ "...!"; mes "Your name is now engraved on this bloody pledge board. We will fight together to the death for Louyang's future!"; next; - getpartymember(getcharid(1)); + getpartymember(getcharid(CHAR_ID_PARTY)); @partymember = $@partymembercount; - if (getpartyleader(getcharid(1),1) == getcharid(0) || !@partymember) { + if (getpartyleader(getcharid(CHAR_ID_PARTY),1) == getcharid(CHAR_ID_CHAR) || !@partymember) { 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."; next; @@ -4659,7 +4659,7 @@ lou_in02,77,37,7 script Hermit 4_M_CHNOLD,{ mes "If you're a real tourist, you do not want to get involved in our business, one way or another."; close; } - } else if (getpartyleader(getcharid(1),2) == getcharid(0)) { + } else if (getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR)) { if (QL_REVOL == 9) { mes "[Sun Mao]"; mes "Once again,"; @@ -4668,7 +4668,7 @@ lou_in02,77,37,7 script Hermit 4_M_CHNOLD,{ mes "Go back safe."; close; } - getpartymember(getcharid(1)); + getpartymember(getcharid(CHAR_ID_PARTY)); @partymember = $@partymembercount; if (QL_REVOL < 8) { if (@partymember == QL_REVOL +1) { @@ -4860,7 +4860,7 @@ lou_in02,77,37,7 script Hermit 4_M_CHNOLD,{ lou_in01,43,147,3 script Gunpowder Expert 4_M_ALCHE_C,{ if (ch_make == 0) { - getpartymember(getcharid(1)); + getpartymember(getcharid(CHAR_ID_PARTY)); @partymember = $@partymembercount; if (!QL_REVOL) { mes "[Hao Chenryu]"; diff --git a/npc/quests/quests_morocc.txt b/npc/quests/quests_morocc.txt index c7acc986e..1b387be0c 100644 --- a/npc/quests/quests_morocc.txt +++ b/npc/quests/quests_morocc.txt @@ -938,12 +938,12 @@ moc_fild20,354,183,3 script Continental Guard#01::MocConGuard 4_M_MOC_SOLDIER,3, close; case 2: if ($@re_moc < 3) { - getpartymember(getcharid(1)); + getpartymember(getcharid(CHAR_ID_PARTY)); .@partymembercount = $@partymembercount; copyarray .@partymembername$[0],$@partymembername$[0],.@partymembercount; while (.@partymembercount >= 0) { .@name$ = .@partymembername$[.@partymembercount]; - if (isloggedin(getcharid(3,.@name$))) { + if (isloggedin(getcharid(CHAR_ID_ACCOUNT,.@name$))) { ++.@onlinemembers; } --.@partymembercount; @@ -1001,12 +1001,12 @@ moc_fild20,354,183,3 script Continental Guard#01::MocConGuard 4_M_MOC_SOLDIER,3, mes "[Continental Guard]"; mes "Ah, you're an adventurer working for the Continental Guard. Nice to meet you. Feel free to ask me if you need my assistance."; next; - getpartymember(getcharid(1)); + getpartymember(getcharid(CHAR_ID_PARTY)); .@partymembercount = $@partymembercount; copyarray .@partymembername$[0],$@partymembername$[0],.@partymembercount; while (.@partymembercount >= 0) { .@name$ = .@partymembername$[.@partymembercount]; - if (isloggedin(getcharid(3,.@name$))) { + if (isloggedin(getcharid(CHAR_ID_ACCOUNT,.@name$))) { ++.@onlinemembers; } --.@partymembercount; diff --git a/npc/quests/quests_nameless.txt b/npc/quests/quests_nameless.txt index f2e20c07f..1371c93bf 100644 --- a/npc/quests/quests_nameless.txt +++ b/npc/quests/quests_nameless.txt @@ -10174,7 +10174,7 @@ moc_fild18,108,116,0 script #treasure CLEAR_NPC,{ mes "protection to get the treasure.^000000"; next; input .@input$; - getpartymember(getcharid(1)); + getpartymember(getcharid(CHAR_ID_PARTY)); .@partymembercount = $@partymembercount; if (.@partymembercount > 1) { if (((.@input$ == "OpenSesame") && (treasure_nd == 9)) || ((.@input$ == "UnlockTreasure") && (treasure_nd == 10))) { diff --git a/npc/quests/seals/god_weapon_creation.txt b/npc/quests/seals/god_weapon_creation.txt index 87c231dd7..3f32461fa 100644 --- a/npc/quests/seals/god_weapon_creation.txt +++ b/npc/quests/seals/god_weapon_creation.txt @@ -89,7 +89,7 @@ gld_dun01,28,85,0 script Grunburti#1::GodDwarf 4_M_DWARF,{ mes "At least I was fortunate enough to find this cave. We Dwarves are most cozy living underground, after all."; close; case 3: - .@GID = getcharid(2); + .@GID = getcharid(CHAR_ID_GUILD); 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(PC_NAME) == getguildmaster(.@GID))) { mes "[Dwarf Grunburti]"; @@ -412,7 +412,7 @@ que_god01,154,112,4 script Grunburti#god 4_M_DWARF,{ mes "pity for you~"; close; } - .@GID = getcharid(2); + .@GID = getcharid(CHAR_ID_GUILD); if (strcharinfo(PC_NAME) != getguildmaster(.@GID)) { mes "[Dwarf Grunburti]"; mes "How in the..."; diff --git a/npc/quests/the_sign_quest.txt b/npc/quests/the_sign_quest.txt index 274848569..8a9cceb9b 100644 --- a/npc/quests/the_sign_quest.txt +++ b/npc/quests/the_sign_quest.txt @@ -6837,7 +6837,7 @@ yuno,330,100,4 script Knight#ss 4_M_JOB_KNIGHT2,{ } } else { - .@signid = getcharid(0,strcharinfo(PC_NAME)); + .@signid = getcharid(CHAR_ID_CHAR,strcharinfo(PC_NAME)); .@sign3 = .@signid & 65535; .@sign4 = .@signid >> 16; .@sign1 = 254; diff --git a/npc/re/cities/malaya.txt b/npc/re/cities/malaya.txt index afe816a3e..f18bbd0af 100644 --- a/npc/re/cities/malaya.txt +++ b/npc/re/cities/malaya.txt @@ -183,7 +183,7 @@ OnBingx2: donpcevent strnpcinfo(NPC_NAME)+"::OnDisable"; end; OnTouch: - if (getcharid(1)) { + if (getcharid(CHAR_ID_PARTY)) { if ($ma_name04$ == strcharinfo(PC_NAME) || $ma_name05$ == strcharinfo(PC_NAME) || $ma_name06$ == strcharinfo(PC_NAME)) { donpcevent strnpcinfo(NPC_NAME)+"::OnBingx2"; mes "The unidentified creature gets a glimpse of you, blushes and then disappears."; @@ -236,7 +236,7 @@ OnBingx2: OnTouch: .@i = atoi(strnpcinfo(NPC_NAME_HIDDEN)); if (.@i%4 == 2) { - if (getcharid(0) == getpartyleader(getcharid(1),2)) + if (getcharid(CHAR_ID_CHAR) == getpartyleader(getcharid(CHAR_ID_PARTY),2)) .@pass = 1; } else if (.@i%4 == 3) { if (questprogress(4229,PLAYTIME) && questprogress(9223,PLAYTIME) && questprogress(12278,PLAYTIME)) diff --git a/npc/re/instances/BakonawaLake.txt b/npc/re/instances/BakonawaLake.txt index 8214a3039..5e2ae7f33 100644 --- a/npc/re/instances/BakonawaLake.txt +++ b/npc/re/instances/BakonawaLake.txt @@ -56,7 +56,7 @@ ma_scene01,174,179,4 script Taho 4_M_DEWZATIMAN,{ close; } - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); .@md_name$ = "Bakonawa Lake"; .@baku_time = questprogress(12278,PLAYTIME); @@ -69,7 +69,7 @@ ma_scene01,174,179,4 script Taho 4_M_DEWZATIMAN,{ close; } if (!.@baku_time) { - if (getcharid(0) == getpartyleader(.@party_id,2)) { + if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2)) { 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?"; next; @@ -144,7 +144,7 @@ sec_in02,26,26,4 script Bakonawa's Rage 4_M_DEWZATIMAN,{ 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."; next; - if (getcharid(0) == getpartyleader(getcharid(1),2)) { + if (getcharid(CHAR_ID_CHAR) == getpartyleader(getcharid(CHAR_ID_PARTY),2)) { mes "[Taho]"; mes "Now I will make Bakonawa spring out from the lake."; next; @@ -528,7 +528,7 @@ OnTimer10000: mes "[Taho]"; mes "HMM. We almost got him but he is one fast creature..."; next; - if (getcharid(0) == getpartyleader(getcharid(1),2)) { + if (getcharid(CHAR_ID_CHAR) == getpartyleader(getcharid(CHAR_ID_PARTY),2)) { mes "[Taho]"; mes "Are we going to try again?"; next; diff --git a/npc/re/instances/BangungotHospital.txt b/npc/re/instances/BangungotHospital.txt index d45fdfc23..1504f892f 100644 --- a/npc/re/instances/BangungotHospital.txt +++ b/npc/re/instances/BangungotHospital.txt @@ -39,7 +39,7 @@ ma_dun01,147,10,5 script Nurse#ma_dun01 4_F_NURSE,{ if (BaseLevel < 100) end; - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); cutin "malaya_nurseB",2; if (!questprogress(9223)) { .@quest = questprogress(9222); @@ -60,7 +60,7 @@ ma_dun01,147,10,5 script Nurse#ma_dun01 4_F_NURSE,{ else if (malaya_bang == 31) callsub L_Closed,0; else if (malaya_bang > 39) - callsub L_Enter,(getcharid(0) == getpartyleader(.@party_id,2))?1:0,0,0; + callsub L_Enter,(getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2))?1:0,0,0; else { mes "[Nurse Maenne]"; mes ".........."; @@ -104,7 +104,7 @@ ma_dun01,147,10,5 script Nurse#ma_dun01 4_F_NURSE,{ } else { //if (!.@party_id) goto L_NoParty; //unneeded if (malaya_bang > 39) - callsub L_Enter,(getcharid(0) == getpartyleader(.@party_id,2))?1:0,1,1; + callsub L_Enter,(getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2))?1:0,1,1; else { mes "[Nurse Maenne]"; mes "......."; @@ -136,7 +136,7 @@ ma_dun01,147,10,5 script Nurse#ma_dun01 4_F_NURSE,{ } else if (.@playtime == 2) { //if (!.@party_id) goto L_NoParty; //unneeded if (malaya_bang > 39) - callsub L_Enter,(getcharid(0) == getpartyleader(.@party_id,2))?1:0,1,1; + callsub L_Enter,(getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2))?1:0,1,1; else { mes "[Nurse Maenne]"; mes "......."; @@ -215,7 +215,7 @@ ma_dun01,147,10,5 script Nurse#ma_dun01 4_F_NURSE,{ } else { if (!.@party_id) goto L_NoParty; if (malaya_bang > 39) - callsub L_Enter,(getcharid(0) == getpartyleader(.@party_id,2))?1:0,1,1; + callsub L_Enter,(getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2))?1:0,1,1; else { mes "[Nurse Maenne]"; mes "......."; @@ -275,7 +275,7 @@ L_Enter: next; switch(select(((getarg(0))?"Prepare to enter the second floor.":""), "Enter the second floor.", "Do not enter.")) { case 1: - .@instance = instance_create(.@md_name$,getcharid(1)); + .@instance = instance_create(.@md_name$,getcharid(CHAR_ID_PARTY)); if (.@instance < 0) { mes "[Nurse Maenne]"; mes "A critical situation has happened."; @@ -312,7 +312,7 @@ L_Enter: mes "The party leader did not generate the dungeon yet."; close; } else { - mapannounce "ma_dun01", getpartyname(getcharid(1))+" party's "+strcharinfo(PC_NAME)+" member entered "+.@md_name$+".",bc_map,"0x00ff99"; + mapannounce "ma_dun01", getpartyname(getcharid(CHAR_ID_PARTY))+" party's "+strcharinfo(PC_NAME)+" member entered "+.@md_name$+".",bc_map,"0x00ff99"; if (getarg(1)) { if (questprogress(9223)) { completequest 9223; diff --git a/npc/re/instances/BuwayaCave.txt b/npc/re/instances/BuwayaCave.txt index 878000d0f..242d0a8e4 100644 --- a/npc/re/instances/BuwayaCave.txt +++ b/npc/re/instances/BuwayaCave.txt @@ -44,7 +44,7 @@ ma_fild02,312,317,5 script Guard#buwaya_cave 4_MAL_SOLDIER,{ close; } - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); .@md_name$ = "Buwaya Cave"; if (!.@party_id) { @@ -54,7 +54,7 @@ ma_fild02,312,317,5 script Guard#buwaya_cave 4_MAL_SOLDIER,{ mes "team with other people."; close; } - if (getcharid(0) == getpartyleader(.@party_id,2)) { + if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2)) { mes "[Guard]"; mes "This place is dangerous. Please go back."; mes "If you dont have any business here, please go back."; @@ -159,7 +159,7 @@ OnTouch: mes "The party leader did not generate the dungeon yet."; close; } else { - mapannounce "ma_fild02",getpartyname(getcharid(1))+" party's "+strcharinfo(PC_NAME)+" member began hunting Buwaya in Buwaya Cave.",bc_map,"0x00ff99"; //FW_NORMAL 12 0 0 + mapannounce "ma_fild02",getpartyname(getcharid(CHAR_ID_PARTY))+" party's "+strcharinfo(PC_NAME)+" member began hunting Buwaya in Buwaya Cave.",bc_map,"0x00ff99"; //FW_NORMAL 12 0 0 setquest 4229; warp "1@ma_c",35,57; end; diff --git a/npc/re/instances/EclageInterior.txt b/npc/re/instances/EclageInterior.txt index 9b232ac99..9ad8519b4 100644 --- a/npc/re/instances/EclageInterior.txt +++ b/npc/re/instances/EclageInterior.txt @@ -33,7 +33,7 @@ //========================================================================= ecl_hub01,132,12,3 script Chief of Staff#tl01::EclInstance 4_F_FAIRY,{ - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); .@md_name$ = "Eclage Interior"; if (!.@party_id){ mes "-! Warning !-"; @@ -42,7 +42,7 @@ ecl_hub01,132,12,3 script Chief of Staff#tl01::EclInstance 4_F_FAIRY,{ close; } - if (getpartyleader(.@party_id,2) != getcharid(0)) { + if (getpartyleader(.@party_id,2) != getcharid(CHAR_ID_CHAR)) { mes "-! Warning !-"; mes "This current quest will be held at Memorial dungeon."; mes "Only the party leader will enter. Please create your party."; @@ -93,7 +93,7 @@ ecl_hub01,130,15,0 script It is closed shut. CLEAR_NPC,{ next; switch (select("Enter it.", "Forget it.")) { case 1: - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); if (has_instance("1@ecl") == "") { mes "It is closed shut."; @@ -101,7 +101,7 @@ ecl_hub01,130,15,0 script It is closed shut. CLEAR_NPC,{ } if (.@party_id) { .@md_name$ = "Eclage Interior"; - if (getpartyleader(.@party_id,2) != getcharid(0)){ + if (getpartyleader(.@party_id,2) != getcharid(CHAR_ID_CHAR)){ mes "-! Warning !-"; mes "This current quest will be held at Memorial dungeon."; mes "Only the party leader will enter. Please create your party."; diff --git a/npc/re/instances/HazyForest.txt b/npc/re/instances/HazyForest.txt index 7b12e1649..7f85fee50 100644 --- a/npc/re/instances/HazyForest.txt +++ b/npc/re/instances/HazyForest.txt @@ -38,7 +38,7 @@ //== Instance Creation ===================================== bif_fild01,158,340,5 script Laphine Soldier#mist 4_M_FAIRYSOLDIER,{ - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); .@md_name$ = "Mistwood Maze"; mes "[Laphine Soldier]"; @@ -51,7 +51,7 @@ bif_fild01,158,340,5 script Laphine Soldier#mist 4_M_FAIRYSOLDIER,{ close; } .@playtime = questprogress(7211,PLAYTIME); - if (getcharid(0) == getpartyleader(.@party_id,2)) { + if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2)) { if (.@playtime == 1) { mes "[Laphine Soldier]"; mes "...Are you sure you're not doing too much?"; @@ -177,7 +177,7 @@ bif_fild01,161,355,0 script Log Tunnel CLEAR_NPC,{ } else { if (questprogress(7211,PLAYTIME) == 2) erasequest 7211; if (!questprogress(7211,PLAYTIME)) setquest 7211; - mapannounce "bif_fild01",getpartyname(getcharid(1))+" party's "+strcharinfo(PC_NAME)+" member is entering the Mistwood Maze.",bc_map,"0x00ff99"; //FW_NORMAL 12 0 0 + mapannounce "bif_fild01",getpartyname(getcharid(CHAR_ID_PARTY))+" party's "+strcharinfo(PC_NAME)+" member is entering the Mistwood Maze.",bc_map,"0x00ff99"; //FW_NORMAL 12 0 0 warp "1@mist",89,29; close; } diff --git a/npc/re/instances/MalangdoCulvert.txt b/npc/re/instances/MalangdoCulvert.txt index e44fed03b..164caf548 100644 --- a/npc/re/instances/MalangdoCulvert.txt +++ b/npc/re/instances/MalangdoCulvert.txt @@ -399,7 +399,7 @@ mal_in01,160,34,4 script Missing, the Cleaner 4_CAT_SAILOR2,{ mes "You don't look like you have Seagod Protection. I can't open door at the moment!"; close; } - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); .@md_name$ = "Culvert"; if (!.@party_id) { mes "^0000ffYou have to organize a party of"; @@ -409,7 +409,7 @@ mal_in01,160,34,4 script Missing, the Cleaner 4_CAT_SAILOR2,{ } .@playtime = questprogress(12254,PLAYTIME); if (!.@playtime) { - if (getcharid(0) == getpartyleader(.@party_id,2)) { + if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2)) { mes "[Missing, the Cleaner]"; mes "Ummm? What's up? Tell me the password if you're the leader!"; next; @@ -476,7 +476,7 @@ L_Enter: //== Instance: Common Scripts ============================== 1@pump,63,100,4 script Missing, the Cleaner#0 4_CAT_SAILOR2,{ - if (getcharid(0) != getpartyleader(getcharid(1),2)) { + if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY),2)) { mes "[Missing, the Cleaner]"; mes "I am trying to have a conversation with your leader now. Please don't disturb and wait!"; close; @@ -497,7 +497,7 @@ L_Enter: mes "Huh? Not ready yet? Talk to me again when you're ready."; close; } - 'party_id = getcharid(1); + 'party_id = getcharid(CHAR_ID_PARTY); mapannounce instance_mapname("1@pump"),"Missing: Move toward the 3 o'clock direction and wait for my next order!",bc_map,"0xff88ff",FW_NORMAL,15; disablenpc instance_npcname("Missing, the Cleaner#0"); enablenpc instance_npcname("Missing, the Cleaner#n"); @@ -519,7 +519,7 @@ L_Enter: mes "Hmm? Talk to me again when you're ready."; close; } - 'party_id = getcharid(1); + 'party_id = getcharid(CHAR_ID_PARTY); mapannounce instance_mapname("1@pump"),"Missing: I'll go in first, so follow me! I'll open up a gate at the 3 o'clock direction!",bc_map,"0xff88ff",FW_NORMAL,15; disablenpc instance_npcname("Missing, the Cleaner#0"); enablenpc instance_npcname("Culvert Entrance#i"); @@ -566,7 +566,7 @@ function script F_mal_missing { 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!!"; next; - if (getcharid(0) != getpartyleader(getcharid(1),2)) { + if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY),2)) { mes "[Missing, the Cleaner]"; mes "Once your leader finishes preparing, it will begin, so get your hearts ready for it!!"; close; @@ -594,7 +594,7 @@ function script F_mal_missing { mes "[Missing, the Cleaner]"; mes "I see seaweed everywhere because you're wiggling! All the culverts will be blocked with seaweed!"; next; - if (getcharid(0) != getpartyleader(getcharid(1),2)) { + if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY),2)) { mes "[Missing, the Cleaner]"; mes "Once your leader finishes preparing, settlement will be decided so get your hearts ready for it!!"; close; diff --git a/npc/re/instances/OldGlastHeim.txt b/npc/re/instances/OldGlastHeim.txt index 0b7bb7e6e..0b21767f7 100644 --- a/npc/re/instances/OldGlastHeim.txt +++ b/npc/re/instances/OldGlastHeim.txt @@ -93,7 +93,7 @@ glast_01,204,273,6 script Hugin#ghinstance 4_M_SAGE_C,{ mes("Umm? Did you see me at another place? I don't think so. What about this time?"); next; if (!questprogress(12317, PLAYTIME)) { - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); .@p_name$ = getpartyname(.@party_id); .@md_name$ = "Old Glast Heim"; if (!instance_check_party(.@party_id)) { @@ -103,13 +103,13 @@ glast_01,204,273,6 script Hugin#ghinstance 4_M_SAGE_C,{ } if (!questprogress(12318, HUNTING)) setquest 12318; - if (getcharid(0) == getpartyleader(.@party_id, 2)) + if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id, 2)) .@menu1$ = "Generate Time Gap"; else .@menu1$ = ""; switch (select(.@menu1$, "Enter Old Glast Heim", "Cancel")) { case 1: - if (getcharid(0) != getpartyleader(.@party_id, 2)) + if (getcharid(CHAR_ID_CHAR) != getpartyleader(.@party_id, 2)) end; .@instance = instance_create(.@md_name$, .@party_id); if (.@instance < 0) { @@ -165,7 +165,7 @@ glast_01,204,273,6 script Hugin#ghinstance 4_M_SAGE_C,{ // Floor 1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1@gl_k,149,41,6 script Varmundt#ghinstance1 4_M_BARMUND,{ - if (getcharid(0) != getpartyleader(getcharid(1), 2)) { + if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2)) { cutin("gl_barmund2", 2); mes("[Varmundt]"); mes("Where's your leader? I need his help."); @@ -181,7 +181,7 @@ glast_01,204,273,6 script Hugin#ghinstance 4_M_SAGE_C,{ select("Oh. Well I..."); mesf("[%s]", strcharinfo(PC_NAME)); mes("Ah yes, I am. Herico told me to meet you."); - unittalk(getcharid(3), _("Ah yes, I am. Herico told me to meet you.")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("Ah yes, I am. Herico told me to meet you.")); next; cutin("gl_barmund2", 2); mes("[Varmundt]"); @@ -191,7 +191,7 @@ glast_01,204,273,6 script Hugin#ghinstance 4_M_SAGE_C,{ select("Himelmez..."); mesf("[%s]", strcharinfo(PC_NAME)); mes("Who is Himelmez?"); - unittalk(getcharid(3), _("Who is Himelmez?")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("Who is Himelmez?")); next; cutin("gl_barmund3", 2); mes("[Varmundt]"); @@ -277,7 +277,7 @@ OnEnable: 1@gl_k,154,104,3 duplicate(Khalitzburg Knight#1) Khalitzburg Knight#22 4_F_KHALITZBURG 1@gl_k,149,100,6 script Heinrich#ghinstance1 4_M_HEINRICH,{ - if (getcharid(0) != getpartyleader(getcharid(1), 2)) { + if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2)) { cutin("gl_heinrich2", 2); mes("[Heinrich]"); mes("Where is your leader? I must talk to him."); @@ -289,7 +289,7 @@ OnEnable: select("Sir. Heinrich. Varmundt..."); mesf("[%s]", strcharinfo(PC_NAME)); mes("Sir. Heinrich. Do you know what is happening in the castle now?"); - unittalk(getcharid(3), _("Sir. Heinrich. Do you know what is happening in the castle now?")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("Sir. Heinrich. Do you know what is happening in the castle now?")); next; mes("[Heinrich]"); mes("Aren't you the adventurer that came along with Varmundt?"); @@ -302,7 +302,7 @@ OnEnable: select("Himelmez's invasion..."); mesf("[%s]", strcharinfo(PC_NAME)); mes("Dead man's Valkyrie, Himelmez is coming to take the Ymir's Heart piece hidden inside this castle!"); - unittalk(getcharid(3), _("Dead man's Valkyrie, Himelmez is coming to take the Ymir's Heart piece hidden inside this castle!")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("Dead man's Valkyrie, Himelmez is coming to take the Ymir's Heart piece hidden inside this castle!")); next; cutin("gl_heinrich1", 2); mes("[Heinrich]"); @@ -321,7 +321,7 @@ OnEnable: select("Even if you don't believe me..."); mesf("[%s]", strcharinfo(PC_NAME)); mes("I can't make you believe me, but there's no time to argue!"); - unittalk(getcharid(3), _("I can't make you believe me, but there's no time to argue!")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("I can't make you believe me, but there's no time to argue!")); cutin("gl_barmund2", 255); next; cutin("gl_heinrich1", 2); @@ -801,7 +801,7 @@ OnMyMobDead: } 1@gl_k,17,51,3 script Altar boy Domun#clearGH 4_M_KID1,{ - if (getcharid(0) != getpartyleader(getcharid(1), 2)) { + if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2)) { mes("[Altar boy Domun]"); mes("Save me, save me, please..."); close; @@ -814,7 +814,7 @@ OnMyMobDead: mesf("[%s]", strcharinfo(PC_NAME)); mes("Hold on!\r" "Are you the only survivor?"); - unittalk(getcharid(3), _("Hold on! Are you the only survivor?")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("Hold on! Are you the only survivor?")); next; mes("[Altar boy Domun]"); mes("Chamberlains... monks...\r" @@ -830,7 +830,7 @@ OnMyMobDead: select("Pull it together!"); mesf("[%s]", strcharinfo(PC_NAME)); mes("Wake up kid! Go east and find the middle passage to the outside! That is safe!"); - unittalk(getcharid(3), _("Wake up kid! Go east and find the middle passage to the outside! That is safe!")); // Displays 1st Letter of char name in small? + unittalk(getcharid(CHAR_ID_ACCOUNT), _("Wake up kid! Go east and find the middle passage to the outside! That is safe!")); // Displays 1st Letter of char name in small? next; mes("[Altar boy Domun]"); mes("To the east passage?\r" @@ -841,7 +841,7 @@ OnMyMobDead: select("I will give you a weapon."); mesf("[%s]", strcharinfo(PC_NAME)); mes("Here's a weapon. Just close your eye and swing for those monsters."); - unittalk(getcharid(3), _("Here's a weapon. Just close your eye and swing for those monsters.")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("Here's a weapon. Just close your eye and swing for those monsters.")); next; mes("[Altar boy Domun]"); mes("Ok, I... I'l try."); @@ -898,7 +898,7 @@ OnMyMobDead: } 1@gl_k,291,145,3 script Holgren the Destroyer 4_F_JOB_BLACKSMITH,{ - if (getcharid(0) != getpartyleader(getcharid(1), 2)) { + if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2)) { mes("[Holgren the Destroyer]"); mes("Are you human?"); close; @@ -911,7 +911,7 @@ OnMyMobDead: select("Relax! I'm not a monster!"); mesf("[%s]", strcharinfo(PC_NAME)); mes("Relax! I am Human. Are you alone? Anyone else here?"); - unittalk(getcharid(3), _("Relax! I am Human. Are you alone? Anyone else here?")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("Relax! I am Human. Are you alone? Anyone else here?")); next; mes("[Holgren the Destroyer]"); mes("It's only me alive."); @@ -920,7 +920,7 @@ OnMyMobDead: select("It's dangerous here..."); mesf("[%s]", strcharinfo(PC_NAME)); mes("It's dangerous here. You know the way to the middle passage? Can you move?"); - unittalk(getcharid(3), _("It's dangerous here. You know the way to the middle passage? Can you move?")); // Displays 1st Letter of char name in small? + unittalk(getcharid(CHAR_ID_ACCOUNT), _("It's dangerous here. You know the way to the middle passage? Can you move?")); // Displays 1st Letter of char name in small? next; mes("[Holgren the Destroyer]"); mes("Yes, I can move. I need to get out of here."); @@ -929,7 +929,7 @@ OnMyMobDead: select("Be safe..."); mesf("[%s]", strcharinfo(PC_NAME)); mes("Sorry, I can't go with you."); - unittalk(getcharid(3), _("Sorry, I can't go with you.")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("Sorry, I can't go with you.")); next; mes("[Holgren the Destroyer]"); mes("It's ok. You've already done enough. I can help myself. Good luck to you too."); diff --git a/npc/re/instances/WolfchevLaboratory.txt b/npc/re/instances/WolfchevLaboratory.txt index ce0ca4c31..e88ec4332 100644 --- a/npc/re/instances/WolfchevLaboratory.txt +++ b/npc/re/instances/WolfchevLaboratory.txt @@ -1768,7 +1768,7 @@ lhz_dun04,151,276,3 script Researcher#memo 4_LGTSCIENCE,{ mes "So, please prepare your party members, and take care of those boss creatures. I'm not sure how long this place can hold."; close; } else if (lght_duk01 > 6) { - if (getcharid(1) > 0) { + if (getcharid(CHAR_ID_PARTY) > 0) { mes "[Wolfchev]"; mes "Are you all set there? I will prepare the entrance if you are the leader of that party."; next; @@ -1859,8 +1859,8 @@ lhz_dun04,151,276,3 script Researcher#memo 4_LGTSCIENCE,{ } } } - if (getpartyleader(getcharid(1),2) == getcharid(0)) { - .@instance = instance_create("Worsef", getcharid(1)); + if (getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR)) { + .@instance = instance_create("Worsef", getcharid(CHAR_ID_PARTY)); if (.@instance < 0) { mes "[Wolfchev]"; mes "Hmm.. Lab entering system is a bit weird. Would wait for me to check the system?"; @@ -2035,7 +2035,7 @@ lhz_dun04,147,279,0 script Laboratory Entrance#memo CLEAR_NPC,{ 1@lhz,39,168,0 script Manual Sheet#1_1 CLEAR_NPC,{ mes "There are valve manual sheets littered on the floor."; next; - if (getpartyleader(getcharid(1),2) == getcharid(0)) { + if (getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR)) { mes "You the party leader, started to read the manual."; next; mes "[Emergency Access Valve Manual]"; @@ -2112,7 +2112,7 @@ lhz_dun04,147,279,0 script Laboratory Entrance#memo CLEAR_NPC,{ 1@lhz,41,172,0 script Valve#1_2 CLEAR_NPC,{ .@open_portal = 0; mes "This is the left valve for the emergency access."; - if (getpartyleader(getcharid(1),2) == getcharid(0)) { + if (getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR)) { next; mes "To which direction do you wish to turn?"; next; @@ -2174,7 +2174,7 @@ lhz_dun04,147,279,0 script Laboratory Entrance#memo CLEAR_NPC,{ 1@lhz,52,172,0 script Valve#1_3 CLEAR_NPC,{ .@open_portal = 0; mes "This is the left valve for the emergency access."; - if (getpartyleader(getcharid(1),2) == getcharid(0)) { + if (getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR)) { next; mes "To which direction do you wish to turn?"; next; @@ -2562,7 +2562,7 @@ lhz_dun04,147,279,0 script Laboratory Entrance#memo CLEAR_NPC,{ //== The Lab No.2 Valves =================================== - script bio4FLab2Valve FAKE_NPC,{ - if (getpartyleader(getcharid(1),2) == getcharid(0)) { + if (getpartyleader(getcharid(CHAR_ID_PARTY),2) == getcharid(CHAR_ID_CHAR)) { progressbar "0xffff00", 20; stopnpctimer; donpcevent instance_npcname("Lab2#2_2")+"::OnDisableValve1"; diff --git a/npc/re/instances/ghost_palace.txt b/npc/re/instances/ghost_palace.txt index 8b0bbb866..08fe3b71b 100644 --- a/npc/re/instances/ghost_palace.txt +++ b/npc/re/instances/ghost_palace.txt @@ -59,13 +59,13 @@ dali02,44,129,5 script Unpleasent Royal Guard 4_M_SAKRAYROYAL,{ "I will be right behind you!"); close(); } - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); if (!.@party_id) { mes("[Unpleasent Royal Guard]"); mes("This is a solo instance. Please form a solo party before continuing."); close(); } - if (getcharid(0) != getpartyleader(.@party_id,2)) { + if (getcharid(CHAR_ID_CHAR) != getpartyleader(.@party_id,2)) { mes("[Unpleasent Royal Guard]"); mes("I'm looking for adventurers to help me!\r" "I want to talk to the team leader, can I?"); @@ -134,7 +134,7 @@ dali02,41,134,0 script Interdimensional Device::gpportal PORTAL,{ mes("The monsters that attacked the palace are wandering around the secret entrance. It would be very bad if they spotted us... Please wait until the time limit for re-entrance passed."); close(); } - if (getcharid(0) == getpartyleader(.@party_id,2) && !questprogress(1260)) { + if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id,2) && !questprogress(1260)) { mes("[Unpleasent Royal Guard]"); mes("I'm looking for adventurers to help me!\r" "I want to talk to the team leader, can I?"); @@ -155,7 +155,7 @@ dali02,41,134,0 script Interdimensional Device::gpportal PORTAL,{ mes("^FF0000Inside the device you see a dark hole. If you wish to enter you may wish to talk to the Unpleasant Royal Guard first.^000000"); close(); } - mapannounce("dali", sprintf(_$("%s of the party, %s, is entering the Ghost Palace."), strcharinfo(PC_NAME), getpartyname(getcharid(1))), bc_map, C_SPRINGGREEN); + mapannounce("dali", sprintf(_$("%s of the party, %s, is entering the Ghost Palace."), strcharinfo(PC_NAME), getpartyname(getcharid(CHAR_ID_PARTY))), bc_map, C_SPRINGGREEN); if (!questprogress(1260)) setquest 1260; setquest 1261; warp("1@spa", 198, 188); @@ -550,7 +550,7 @@ OnInstanceInit: next; mesf("[%s]", strcharinfo(PC_NAME)); mes("Sakray, What do you want sympathy? Or is it a trap?"); - unittalk(getcharid(3), _("Sakray, What do you want sympathy? Or is it a trap?")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("Sakray, What do you want sympathy? Or is it a trap?")); next; mes("[Sakray]"); mes("Non...I did not need to make an effort to catch a novice."); @@ -558,7 +558,7 @@ OnInstanceInit: next; mesf("[%s]", strcharinfo(PC_NAME)); mes("If so... then why...?"); - unittalk(getcharid(3), _("If so... then why...?")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("If so... then why...?")); next; cutin("cry-b", 3); mes("[Sakray]"); @@ -580,7 +580,7 @@ OnInstanceInit: next; mesf("[%s]", strcharinfo(PC_NAME)); mes("..."); - unittalk(getcharid(3), _("...")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("...")); next; mes("[Sakray]"); mes("Heh heh... I will keep watching you until the day you grow up enough."); diff --git a/npc/re/instances/octopus_cave.txt b/npc/re/instances/octopus_cave.txt index 71f164ff7..b09d243ab 100644 --- a/npc/re/instances/octopus_cave.txt +++ b/npc/re/instances/octopus_cave.txt @@ -38,7 +38,7 @@ //== Instance Creation ===================================== mal_dun01,151,235,5 script Starfish 4_ASTER,{ - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); .@md_name$ = "Octopus Cave"; if (!.@party_id) { @@ -46,7 +46,7 @@ mal_dun01,151,235,5 script Starfish 4_ASTER,{ mes("You alone is powerless, hehe! Better get someone to help you out. Make a party, and come back later."); close; } - if (getcharid(0) != getpartyleader(.@party_id, 2)) { + if (getcharid(CHAR_ID_CHAR) != getpartyleader(.@party_id, 2)) { mes("[Starfish]"); mes("Where is your leader, hehe. I don't talk to some random people. Bring your boss to me."); close; @@ -136,7 +136,7 @@ mal_dun01,153,237,5 script Weird Entrance CLEAR_NPC,{ close; } - mapannounce("mal_dun01", sprintf(_$("%s party's %s member started to hunt the Octopus!"), getpartyname(getcharid(1)), strcharinfo(PC_NAME)), bc_map, C_SPRINGGREEN); + mapannounce("mal_dun01", sprintf(_$("%s party's %s member started to hunt the Octopus!"), getpartyname(getcharid(CHAR_ID_PARTY)), strcharinfo(PC_NAME)), bc_map, C_SPRINGGREEN); if (!questprogress(4197)) setquest 4197; warp "1@cash", 199, 99; end; diff --git a/npc/re/instances/saras_memory.txt b/npc/re/instances/saras_memory.txt index 0c7f4a9cb..2b3b4f2c0 100644 --- a/npc/re/instances/saras_memory.txt +++ b/npc/re/instances/saras_memory.txt @@ -168,7 +168,7 @@ dali,138,118,0 script Dimensional Device#dimen PORTAL,{ erasequest 15002; end; } else if (!.@sara_time) { - .@party_id = getcharid(1); + .@party_id = getcharid(CHAR_ID_PARTY); .@p_name$ = getpartyname(.@party_id); .@md_name$ = "Sara's Memory"; if (!instance_check_party(.@party_id)) { @@ -177,13 +177,13 @@ dali,138,118,0 script Dimensional Device#dimen PORTAL,{ "can use quotes to put spaces in a party name."); close; } - if (getcharid(0) == getpartyleader(.@party_id, 2)) + if (getcharid(CHAR_ID_CHAR) == getpartyleader(.@party_id, 2)) .@menu1$ = "Boot up the dimensional device"; else .@menu1$ = ""; switch (select(.@menu1$, "Use the dimensional device", "Cancel")) { case 1: - if (getcharid(0) != getpartyleader(.@party_id, 2)) + if (getcharid(CHAR_ID_CHAR) != getpartyleader(.@party_id, 2)) end; .@instance = instance_create(.@md_name$, .@party_id); if (.@instance < 0) { @@ -219,11 +219,11 @@ dali,138,118,0 script Dimensional Device#dimen PORTAL,{ } 1@sara,261,156,5 script A girl#sarains 4_F_SARAH_BABY,{ - if (getcharid(0) != getpartyleader(getcharid(1), 2)) + if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2)) end; mesf("[%s]", strcharinfo(PC_NAME)); mes("Where am I?"); - unittalk(getcharid(3), _("Where am I?")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("Where am I?")); next; cutin "sara_9sara1.bmp", 2; mes("[A girl]"); @@ -232,7 +232,7 @@ dali,138,118,0 script Dimensional Device#dimen PORTAL,{ next; mesf("[%s]", strcharinfo(PC_NAME)); mes("Are you from here? You don't seem to quite match the locals either."); - unittalk(getcharid(3), _("Are you from here? You don't seem to quite match to locals either.")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("Are you from here? You don't seem to quite match to locals either.")); next; mes("[A girl]"); mes("Yes! I was born here! My name is Sara. Sara Irene!"); @@ -244,7 +244,7 @@ dali,138,118,0 script Dimensional Device#dimen PORTAL,{ next; mesf("[%s]", strcharinfo(PC_NAME)); mes("Oh! I am sorry! Uh... Why are you standing out here all alone?"); - unittalk(getcharid(3), _("Oh! I am sorry! Uh... Why are you standing out here all alone?")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("Oh! I am sorry! Uh... Why are you standing out here all alone?")); next; mes("[Sara Irene]"); mes("I am waiting for my father. He said that he will be here soon."); @@ -523,7 +523,7 @@ OnEnable: OnTouch: .@map$ = instance_mapname("1@sara"); warp .@map$, 89, 175; - if (getcharid(0) == getpartyleader(getcharid(1),2)) + if (getcharid(CHAR_ID_CHAR) == getpartyleader(getcharid(CHAR_ID_PARTY),2)) viewpoint 1, 39, 142, 1, C_GREEN; end; } @@ -546,7 +546,7 @@ OnTouch: } 1@sara,107,325,5 script Sara Irene#sarains1 4_F_SARAH_BABY,{ - if (getcharid(0) != getpartyleader(getcharid(1), 2)) + if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2)) end; cutin "sara_9sara1.bmp", 2; mes("[Sara Irene]"); @@ -1007,7 +1007,7 @@ OnMyMobDead: } 1@sara,152,233,5 script Sara Irene#sarains2 4_F_SARAH_BABY,{ - if (getcharid(0) != getpartyleader(getcharid(1), 2)) + if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2)) end; cutin "sara_9sara2.bmp", 2; mes("[Sara Irene]"); @@ -1031,7 +1031,7 @@ OnMyMobDead: next; mesf("[%s]", strcharinfo(PC_NAME)); mes("I won't let you take Sara!"); - unittalk(getcharid(3), _("I won't let you take Sara!")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("I won't let you take Sara!")); next; cutin "sara_elder_irine3.bmp", 2; mes("[Doyen Irene]"); @@ -1040,7 +1040,7 @@ OnMyMobDead: next; mesf("[%s]", strcharinfo(PC_NAME)); mes("Sara... run! Save yourself!"); - unittalk(getcharid(3), _("Sara... run! Save yourself!")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("Sara... run! Save yourself!")); next; cutin "sara_9sara2.bmp", 2; mes("[Sara Irene]"); @@ -1151,7 +1151,7 @@ OnMyMobDead: } 1@sara,156,236,3 script Doyen Irene#sarains3 4_M_CHIEF_IRIN,{ - if (getcharid(0) != getpartyleader(getcharid(1), 2)) + if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2)) end; cutin "sara_elder_irine4.bmp", 2; mes("[Doyen Irene]"); @@ -1164,7 +1164,7 @@ OnMyMobDead: next; mesf("[%s]", strcharinfo(PC_NAME)); mes("What are you talking about? We saw you standing over Sara's mother with your sword COVERED in blood!"); - unittalk(getcharid(3), _("What are you talking about? We saw you standing over Sara's mother with your sword COVERED in blood!")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("What are you talking about? We saw you standing over Sara's mother with your sword COVERED in blood!")); next; mes("[Doyen Irene]"); mes("You.. think I killed Sara's mother?"); @@ -1188,7 +1188,7 @@ OnMyMobDead: next; mesf("[%s]", strcharinfo(PC_NAME)); mes("I am just an adventurer who was passing through. I heard some men plotting their deaths and needed to intervene."); - unittalk(getcharid(3), _("I am just an adventurer who was passing through. I heard some men plotting their deaths and needed to intervene.")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("I am just an adventurer who was passing through. I heard some men plotting their deaths and needed to intervene.")); next; mes("[Doyen Irene]"); mes("If.. you are telling the truth...\r" @@ -1201,11 +1201,11 @@ OnMyMobDead: next; mesf("[%s]", strcharinfo(PC_NAME)); mes("There might be more assassins so we have to find Sara as fast as we can."); - unittalk(getcharid(3), _("There might be more assassins so we have to find Sara as fast as we can.")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("There might be more assassins so we have to find Sara as fast as we can.")); next; mesf("[%s]", strcharinfo(PC_NAME)); mes("Sara believes that you killed her mother. We need to tell her the truth."); - unittalk(getcharid(3), _("Sara believes that you killed her mother. We need to tell her the truth.")); + unittalk(getcharid(CHAR_ID_ACCOUNT), _("Sara believes that you killed her mother. We need to tell her the truth.")); next; mes("[Doyen Irene]"); mes("We must do our best to find her. Let's split up and search for her.\r" @@ -1233,7 +1233,7 @@ OnDisable: } 1@sara,39,142,3 script Sara Irene#sarains3 4_F_SARAH_BABY,{ - if (getcharid(0) != getpartyleader(getcharid(1), 2)) + if (getcharid(CHAR_ID_CHAR) != getpartyleader(getcharid(CHAR_ID_PARTY), 2)) end; mes("^FF0000As you are about to call out to Sara a sudden blow knocks you down from behind.^000000"); dispbottom(_("As you are about to call out to Sara a sudden blow knocks you down from behind.")); diff --git a/npc/re/woe-fe/invest_main.txt b/npc/re/woe-fe/invest_main.txt index 012a96afe..c912444cc 100644 --- a/npc/re/woe-fe/invest_main.txt +++ b/npc/re/woe-fe/invest_main.txt @@ -902,7 +902,7 @@ OnAgitInvest: mes "Please come back during the investment duration."; close; } - .@guild = getcharid(2); + .@guild = getcharid(CHAR_ID_GUILD); for(.@i = 1; .@i<=5; ++.@i) { .@castle_name$[.@i] = getcastlename(.@npc$+"g_cas0"+.@i); .@owner_id[.@i] = getcastledata(.@npc$+"g_cas0"+.@i,1); @@ -1114,7 +1114,7 @@ OnAgitInvest: } .@GID = getcastledata(strnpcinfo(NPC_MAP),1); - if (getcharid(2) != .@GID) { + if (getcharid(CHAR_ID_GUILD) != .@GID) { mes "[Gate Manager]"; mes "You don't seem to be the member of guild owning this castle."; mes "If you need any help, please visit any of our guild members at "+.@realm$+" Square."; @@ -1145,7 +1145,7 @@ OnAgitInvest: mes "Please come back during the investment duration."; close; } - if (getcharid(2) != .@GID) { + if (getcharid(CHAR_ID_GUILD) != .@GID) { mes "[Gate Manager]"; mes "You don't seem to be the member of the guild owning this castle."; mes "Please use the normal investment from "+.@realm$+" Square."; diff --git a/npc/woe-fe/agit_main.txt b/npc/woe-fe/agit_main.txt index 912063b8b..5ac5b8e9a 100644 --- a/npc/woe-fe/agit_main.txt +++ b/npc/woe-fe/agit_main.txt @@ -101,10 +101,10 @@ OnStartArena: // The Emperium has been broken. OnAgitBreak: - .@GID = getcharid(2); + .@GID = getcharid(CHAR_ID_GUILD); // Show and log error if an unguilded player breaks the Emperium. (Should NEVER happen) if (.@GID <= 0) { - .@notice$ = "Character "+strcharinfo(PC_NAME)+" ("+getcharid(0)+") broke the Emperium in Castle: "+strnpcinfo(NPC_NAME_HIDDEN)+" while guildless. No data will be saved and Emperium respawned."; + .@notice$ = "Character "+strcharinfo(PC_NAME)+" ("+getcharid(CHAR_ID_CHAR)+") broke the Emperium in Castle: "+strnpcinfo(NPC_NAME_HIDDEN)+" while guildless. No data will be saved and Emperium respawned."; logmes .@notice$; debugmes .@notice$; donpcevent "Agit#"+strnpcinfo(NPC_NAME_HIDDEN)+"::OnStartArena"; end; @@ -342,7 +342,7 @@ OnRecvCastle: } cutin "kafra_01",2; - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[Kafra Employee]"; mes "Welcome. ^ff0000" + getguildname(.@GID) + "^000000 Member."; mes "The Kafra Corporation will stay with you wherever you go."; @@ -969,7 +969,7 @@ OnRecvCastle: mes "There's a small lever. Will you pull it?"; next; if(select("Pull.", "Don't pull.") == 1) { - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { close2; warp .@destination$,.@coordinates[0],.@coordinates[1]; end; diff --git a/npc/woe-fe/aldeg_cas01.txt b/npc/woe-fe/aldeg_cas01.txt index 4472a0f46..5c76ca483 100644 --- a/npc/woe-fe/aldeg_cas01.txt +++ b/npc/woe-fe/aldeg_cas01.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("aldeg_cas01",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("aldeg_cas01",1)) { warp "aldeg_cas01",218,170; end; } diff --git a/npc/woe-fe/aldeg_cas02.txt b/npc/woe-fe/aldeg_cas02.txt index 9a9182d96..e588909a1 100644 --- a/npc/woe-fe/aldeg_cas02.txt +++ b/npc/woe-fe/aldeg_cas02.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("aldeg_cas02",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("aldeg_cas02",1)) { warp "aldeg_cas02",220,190; end; } diff --git a/npc/woe-fe/aldeg_cas03.txt b/npc/woe-fe/aldeg_cas03.txt index b4b1df558..a0076bfec 100644 --- a/npc/woe-fe/aldeg_cas03.txt +++ b/npc/woe-fe/aldeg_cas03.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("aldeg_cas03",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("aldeg_cas03",1)) { warp "aldeg_cas03",205,186; end; } diff --git a/npc/woe-fe/aldeg_cas04.txt b/npc/woe-fe/aldeg_cas04.txt index c0289ec45..f96586f48 100644 --- a/npc/woe-fe/aldeg_cas04.txt +++ b/npc/woe-fe/aldeg_cas04.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("aldeg_cas04",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("aldeg_cas04",1)) { warp "aldeg_cas04",116,217; end; } diff --git a/npc/woe-fe/aldeg_cas05.txt b/npc/woe-fe/aldeg_cas05.txt index 7a1747adb..79c5c77af 100644 --- a/npc/woe-fe/aldeg_cas05.txt +++ b/npc/woe-fe/aldeg_cas05.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("aldeg_cas05",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("aldeg_cas05",1)) { warp "aldeg_cas05",167,225; end; } diff --git a/npc/woe-fe/gefg_cas01.txt b/npc/woe-fe/gefg_cas01.txt index 65ae7f1e4..364222781 100644 --- a/npc/woe-fe/gefg_cas01.txt +++ b/npc/woe-fe/gefg_cas01.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("gefg_cas01",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("gefg_cas01",1)) { warp "gefg_cas01",197,36; end; } diff --git a/npc/woe-fe/gefg_cas02.txt b/npc/woe-fe/gefg_cas02.txt index 5229586df..5729b4033 100644 --- a/npc/woe-fe/gefg_cas02.txt +++ b/npc/woe-fe/gefg_cas02.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("gefg_cas02",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("gefg_cas02",1)) { warp "gefg_cas02",178,43; end; } diff --git a/npc/woe-fe/gefg_cas03.txt b/npc/woe-fe/gefg_cas03.txt index f52cce240..d74692200 100644 --- a/npc/woe-fe/gefg_cas03.txt +++ b/npc/woe-fe/gefg_cas03.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("gefg_cas03",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("gefg_cas03",1)) { warp "gefg_cas03",221,30; end; } diff --git a/npc/woe-fe/gefg_cas04.txt b/npc/woe-fe/gefg_cas04.txt index b15f87984..39141723f 100644 --- a/npc/woe-fe/gefg_cas04.txt +++ b/npc/woe-fe/gefg_cas04.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("gefg_cas04",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("gefg_cas04",1)) { warp "gefg_cas04",168,43; end; } diff --git a/npc/woe-fe/gefg_cas05.txt b/npc/woe-fe/gefg_cas05.txt index a7722d48b..caa9a10fc 100644 --- a/npc/woe-fe/gefg_cas05.txt +++ b/npc/woe-fe/gefg_cas05.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("gefg_cas05",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("gefg_cas05",1)) { warp "gefg_cas05",168,31; end; } diff --git a/npc/woe-fe/payg_cas01.txt b/npc/woe-fe/payg_cas01.txt index 0c5f54be1..d06883620 100644 --- a/npc/woe-fe/payg_cas01.txt +++ b/npc/woe-fe/payg_cas01.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("payg_cas01",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("payg_cas01",1)) { warp "payg_cas01",54,144; end; } diff --git a/npc/woe-fe/payg_cas02.txt b/npc/woe-fe/payg_cas02.txt index 9666a147f..9b5b97811 100644 --- a/npc/woe-fe/payg_cas02.txt +++ b/npc/woe-fe/payg_cas02.txt @@ -53,14 +53,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("payg_cas02",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("payg_cas02",1)) { warp "payg_cas02",278,251; end; } diff --git a/npc/woe-fe/payg_cas03.txt b/npc/woe-fe/payg_cas03.txt index 879866a62..10b859c8f 100644 --- a/npc/woe-fe/payg_cas03.txt +++ b/npc/woe-fe/payg_cas03.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("payg_cas03",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("payg_cas03",1)) { warp "payg_cas03",9,263; end; } diff --git a/npc/woe-fe/payg_cas04.txt b/npc/woe-fe/payg_cas04.txt index a6732b5b8..46f4fbb6b 100644 --- a/npc/woe-fe/payg_cas04.txt +++ b/npc/woe-fe/payg_cas04.txt @@ -53,14 +53,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("payg_cas04",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("payg_cas04",1)) { warp "payg_cas04",40,235; end; } diff --git a/npc/woe-fe/payg_cas05.txt b/npc/woe-fe/payg_cas05.txt index 7e5ce5aae..a2a35790a 100644 --- a/npc/woe-fe/payg_cas05.txt +++ b/npc/woe-fe/payg_cas05.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("payg_cas05",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("payg_cas05",1)) { warp "payg_cas05",243,27; end; } diff --git a/npc/woe-fe/prtg_cas01.txt b/npc/woe-fe/prtg_cas01.txt index 660dd11ef..33a564fe9 100644 --- a/npc/woe-fe/prtg_cas01.txt +++ b/npc/woe-fe/prtg_cas01.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("prtg_cas01",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("prtg_cas01",1)) { warp "prtg_cas01",96,173; end; } diff --git a/npc/woe-fe/prtg_cas02.txt b/npc/woe-fe/prtg_cas02.txt index 3333de0c2..6531b681f 100644 --- a/npc/woe-fe/prtg_cas02.txt +++ b/npc/woe-fe/prtg_cas02.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("prtg_cas02",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("prtg_cas02",1)) { warp "prtg_cas02",169,55; end; } diff --git a/npc/woe-fe/prtg_cas03.txt b/npc/woe-fe/prtg_cas03.txt index 9040cb697..2a3879f65 100644 --- a/npc/woe-fe/prtg_cas03.txt +++ b/npc/woe-fe/prtg_cas03.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("prtg_cas03",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("prtg_cas03",1)) { warp "prtg_cas03",181,215; end; } diff --git a/npc/woe-fe/prtg_cas04.txt b/npc/woe-fe/prtg_cas04.txt index 48c0f7026..3e0de365f 100644 --- a/npc/woe-fe/prtg_cas04.txt +++ b/npc/woe-fe/prtg_cas04.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("prtg_cas04",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("prtg_cas04",1)) { warp "prtg_cas04",258,247; end; } diff --git a/npc/woe-fe/prtg_cas05.txt b/npc/woe-fe/prtg_cas05.txt index 8ad8c6f77..56dc902a3 100644 --- a/npc/woe-fe/prtg_cas05.txt +++ b/npc/woe-fe/prtg_cas05.txt @@ -52,14 +52,14 @@ mes "ownership of this castle."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "[ Echoing Voice ]"; mes "Brave ones..."; mes "Do you wish to return to your honorable place?"; next; if(select("Return to the guild castle.", "Quit.") == 1) { close2; - if (getcharid(2) == getcastledata("prtg_cas05",1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata("prtg_cas05",1)) { warp "prtg_cas05",52,41; end; } diff --git a/npc/woe-se/agit_main_se.txt b/npc/woe-se/agit_main_se.txt index 9e01c6efd..c9b34f610 100644 --- a/npc/woe-se/agit_main_se.txt +++ b/npc/woe-se/agit_main_se.txt @@ -230,7 +230,7 @@ OnTreasureDied: mes "to conquer this stronghold?"; close; } - if (getcharid(2) != .@GID || strcharinfo(PC_NAME) != getguildmaster(.@GID)) { + if (getcharid(CHAR_ID_GUILD) != .@GID || strcharinfo(PC_NAME) != getguildmaster(.@GID)) { mes "[ Steward ]"; mes "Hmpf. Your threats don't"; mes "scare me! Guardians, drive"; @@ -619,7 +619,7 @@ OnStop: end; OnStartArena: - .@GID = getcharid(2); + .@GID = getcharid(CHAR_ID_GUILD); .@region$ = (compare(strnpcinfo(NPC_MAP),"arug"))?"Valfreyja":"Nithafjoll"; // Lower castle Economy .@Economy = getcastledata(strnpcinfo(NPC_MAP),2)-5; @@ -663,7 +663,7 @@ OnStartArena: mes "over this stronghold."; close; } - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { if (strcharinfo(PC_NAME) != getguildmaster(.@GID)) { mes .@n$; mes "As guardian of this"; @@ -854,7 +854,7 @@ OnInit: - script Kafra#template FAKE_NPC,{ cutin "kafra_01",2; .@GID = getcastledata(strnpcinfo(NPC_MAP),1); - if (getcharid(2) == .@GID && getgdskilllv(.@GID,10001)) { + if (getcharid(CHAR_ID_GUILD) == .@GID && getgdskilllv(.@GID,10001)) { mes "[Kafra Employee]"; mes "Welcome, proud member"; mes "of the ^FF0000"+getguildname(.@GID)+"^000000 Guild!"; @@ -967,7 +967,7 @@ OnInit: .@GID = getcastledata(strnpcinfo(NPC_MAP),1); .@num = atoi(charat(strnpcinfo(NPC_NAME_VISIBLE),0)); .@var$ = "$agit_"+strnpcinfo(NPC_NAME_HIDDEN); - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { mes "^3355FFYou will need the"; mes "following materials to"; mes "rebuild a destroyed"; @@ -1120,7 +1120,7 @@ OnEnable: .@GID = getcastledata(strnpcinfo(NPC_MAP),1); .@num = atoi(charat(strnpcinfo(NPC_NAME_VISIBLE),15)); .@var$ = "$agit_"+strnpcinfo(NPC_NAME_HIDDEN); - if (getcharid(2) == .@GID) { + if (getcharid(CHAR_ID_GUILD) == .@GID) { if (strcharinfo(PC_NAME) == getguildmaster(.@GID)) { if (getd(.@var$+"["+(.@num+1)+"]") == 2) { mes "^3355FFDemolished Fortress"; @@ -1707,7 +1707,7 @@ OnDisable: //== Link Flags (function) ================================= function script LinkFlag { - if (!getcharid(2) || getcharid(2) != getcastledata(strnpcinfo(NPC_MAP),1)) end; + if (!getcharid(CHAR_ID_GUILD) || getcharid(CHAR_ID_GUILD) != getcastledata(strnpcinfo(NPC_MAP),1)) end; if (getarg(0) == "Convenience Facility") { mes "^3355FFThis is the Stronghold"; mes "Teleport Service. Would"; @@ -1754,13 +1754,13 @@ function script ReturnFlag { mes "be recognized as its new owner."; close; } - if (getcharid(2) == .@GID && getarg(1,0)) { + if (getcharid(CHAR_ID_GUILD) == .@GID && getarg(1,0)) { mes "[ Ringing Voice ]"; mes "Courageous one,"; mes "do you wish to return"; mes "to your stronghold?"; next; - if(select("Return to the Stronghold", "Cancel") == 1 && getcharid(2) == getcastledata(getarg(0),1)) { + if(select("Return to the Stronghold", "Cancel") == 1 && getcharid(CHAR_ID_GUILD) == getcastledata(getarg(0),1)) { if (compare(getarg(0),"arug")) { if (getarg(0) == "arug_cas01") setarray .@i[0],67,193; else if (getarg(0) == "arug_cas02") setarray .@i[0],43,256; @@ -1814,7 +1814,7 @@ function script ReturnFlag { //== Guild Dungeon Warps =================================== - script Sunflower#template FAKE_NPC,{ - if (getcharid(2) == getcastledata(strnpcinfo(NPC_MAP),1)) { + if (getcharid(CHAR_ID_GUILD) == getcastledata(strnpcinfo(NPC_MAP),1)) { mes "- It's an amazingly huge sunflower; as big as a human! ... You feel something mysterious emanating from the flower. -"; next; switch(select("Hold the stem.", "Do nothing.")) { |