diff options
author | L0ne_W0lf <L0ne_W0lf@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-09-09 17:33:10 +0000 |
---|---|---|
committer | L0ne_W0lf <L0ne_W0lf@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-09-09 17:33:10 +0000 |
commit | e02e0c5cba6e83986da6fdce9c69a9201f9a271f (patch) | |
tree | 2cefad3c969bea2a2c5d25e3c220eafc2451301a | |
parent | 45e089c554e673f7dc017c45bdfa68663713cda9 (diff) | |
download | hercules-e02e0c5cba6e83986da6fdce9c69a9201f9a271f.tar.gz hercules-e02e0c5cba6e83986da6fdce9c69a9201f9a271f.tar.bz2 hercules-e02e0c5cba6e83986da6fdce9c69a9201f9a271f.tar.xz hercules-e02e0c5cba6e83986da6fdce9c69a9201f9a271f.zip |
Enabled WoE SE to be run independently of WoE. Let's see how long it is before something blows up, or Ultramage pulls out his hair while cursing my existence.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13202 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 3 | ||||
-rw-r--r-- | conf/msg_athena.conf | 5 | ||||
-rw-r--r-- | doc/script_commands.txt | 25 | ||||
-rw-r--r-- | npc/Changelog.txt | 1 | ||||
-rw-r--r-- | npc/guild2/agit_start_se.txt | 51 | ||||
-rw-r--r-- | npc/guild2/arug_cas01.txt | 22 | ||||
-rw-r--r-- | npc/guild2/arug_cas02.txt | 22 | ||||
-rw-r--r-- | npc/guild2/arug_cas03.txt | 22 | ||||
-rw-r--r-- | npc/guild2/arug_cas04.txt | 22 | ||||
-rw-r--r-- | npc/guild2/arug_cas05.txt | 22 | ||||
-rw-r--r-- | npc/guild2/schg_cas01.txt | 22 | ||||
-rw-r--r-- | npc/guild2/schg_cas02.txt | 22 | ||||
-rw-r--r-- | npc/guild2/schg_cas03.txt | 22 | ||||
-rw-r--r-- | npc/guild2/schg_cas04.txt | 22 | ||||
-rw-r--r-- | npc/guild2/schg_cas05.txt | 22 | ||||
-rw-r--r-- | npc/scripts_guild.conf | 2 | ||||
-rw-r--r-- | src/map/atcommand.c | 40 | ||||
-rw-r--r-- | src/map/battle.c | 4 | ||||
-rw-r--r-- | src/map/clif.c | 6 | ||||
-rw-r--r-- | src/map/guild.c | 39 | ||||
-rw-r--r-- | src/map/guild.h | 3 | ||||
-rw-r--r-- | src/map/map.c | 1 | ||||
-rw-r--r-- | src/map/map.h | 5 | ||||
-rw-r--r-- | src/map/party.c | 2 | ||||
-rw-r--r-- | src/map/script.c | 29 | ||||
-rw-r--r-- | src/map/skill.c | 4 | ||||
-rw-r--r-- | src/map/unit.c | 2 |
27 files changed, 306 insertions, 136 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 2f5a2ffe1..786cfb281 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,9 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. +2008/09/09 + * Rev. 13202 Added commands related to WoE SE, allowing it to run independantly of WoE. [L0ne_W0lf] + - Added: @agitstart2, @agitend2, agitstart2, agitend2, and agitcheck2. 2008/09/05 * Rev. 13192 Updated mmo.h, increased merc max count to 36. [L0ne_W0lf] * Fixed save crash related to non-guilded mercenaries. diff --git a/conf/msg_athena.conf b/conf/msg_athena.conf index 2fcf01013..734264578 100644 --- a/conf/msg_athena.conf +++ b/conf/msg_athena.conf @@ -406,6 +406,11 @@ 400: Usage: @jailfor <time> <character name> 401: You have been jailed for %d years, %d months, %d days, %d hours and %d minutes 402: %s in jail for %d years, %d months, %d days, %d hours and %d minutes +// WoE SE (@agitstart2) +403: War of Emperium SE has been initiated. +404: War of Emperium SE is currently in progress. +405: War of Emperium SE has been ended. +406: War of Emperium SE is currently not in progress. // Homunculus messages 450: You already have a homunculus diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 8b860eb33..c8737ac51 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -4,7 +4,7 @@ //= A reference manual for the eAthena scripting language. //= Commands are sorted depending on their functionality. //===== Version =========================================== -//= 3.22.20080622 +//= 3.23.20080909 //========================================================= //= 1.0 - First release, filled will as much info as I could //= remember or figure out, most likely there are errors, @@ -122,6 +122,8 @@ //= Extended 'set' to return the variable reference. [FlavioJS] //= 3.22.20080901 //= Adjusted the 'getequipname' description to match src [ultramage] +//= 3.23.20080909 +//= Added WoE SE related commands. [L0ne_W0lf] //========================================================= This document is a reference manual for all the scripting commands and functions @@ -880,6 +882,9 @@ once and will not execute if the map server reconnects to the char server later. OnAgitStart: OnAgitEnd: OnAgitInit: +OnAgitStart2: +OnAgitEnd2: +OnAgitInit2: OnAgitStart will run whenever the server shifts into WoE mode, whether it is done with @agitstart GM command or with 'AgitStart' script command. OnAgitEnd @@ -890,6 +895,9 @@ No RID will be attached while any of the abovementioned labels are triggered, so no character or account-based variables will be accessible, until you attach a RID with 'attachrid' (see below). +The above also applies to, the last three laels, the only difference is that +these labels are used exclusively for WoE SE, and are called independantly. + OnTouch: This label will be executed if a trigger area is defined for the NPC object it's @@ -3158,9 +3166,11 @@ if (checkChatting()) mes "You are currently chatting!"; --------------------------------------- *agitcheck() +*agitcheck2() -This function will let you check whether the server is currently in WoE mode. -It will return 1 if the War of Emperium is on and 0 if it isn't. +These function will let you check whether the server is currently in WoE mode +(or WoE SE mode if the second function is called) and will return 1 if War of +Emperium is on and 0 if it isn't. --------------------------------------- @@ -5432,13 +5442,16 @@ For examples, check the WoE scripts in the distribution. *agitstart; *agitend; +*agitstart2; +*agitend2; -These two commands will start and end War of Emperium. +These four commands will start and end War of Emperium or War of Emperium SE. This is a bit more complex than it sounds, since the commands themselves won't actually do anything interesting, except causing all 'OnAgitStart:' and -'OnAgitEnd:' events to run everywhere, respectively. They are used as -simple triggers to run a lot of complex scripts all across the server, and they, +'OnAgitEnd:', or 'OnAgitStart2:' and 'OnAgitEnd2:' in the case of latter two +commands, events to run everywhere, respectively. They are used as simple +triggers to run a lot of complex scripts all across the server, and they, in turn, are triggered by clock with an 'OnClock<time>:' time-triggering label. --------------------------------------- diff --git a/npc/Changelog.txt b/npc/Changelog.txt index ebe029a45..e38ff860d 100644 --- a/npc/Changelog.txt +++ b/npc/Changelog.txt @@ -1,6 +1,7 @@ Date Added ====== 2008/09/09 + * Rev. 13202 Enabled WoE SE to be run independently of normal WoE. [L0ne_W0lf] * Rev. 13201 Small bugfixes to arug_cas02 [Yommy] - Typo fixes in advanced refiner [Yommy] - Nameless entrance layout fix [Yommy] diff --git a/npc/guild2/agit_start_se.txt b/npc/guild2/agit_start_se.txt new file mode 100644 index 000000000..744f3dea0 --- /dev/null +++ b/npc/guild2/agit_start_se.txt @@ -0,0 +1,51 @@ +//===== eAthena Script ======================================= +//= War of Emperium SE - Auto-Start +//===== By: ================================================== +//= L0ne_W0lf +//===== Current Version: ===================================== +//= 1.0 +//===== Compatible With: ===================================== +//= eAthena SVN; RO Episode 11.3 +//===== Description: ========================================= +//= Auto Start for War of Emperium +//= To know how to set up WoE times, go to doc\woe_time_explanation.txt +//============================================= +//= gettime(3): Gets hour (24 hour time) +//= gettime(4): Gets day of week 1=Monday, 2=Tuesday, +//= 3=Wednesday, 4=Thursday, etc. +//===== Additional Comments: ================================= +//= 1.0 Copy/Paste of the original setter. +//============================================================ + +// WoE Start/Stop times +//============================================================ +- script Agit2_Event -1,{ + end; + +OnClock1800: //start time for Tues(2), Thurs(4) +OnClock2000: //end time for Tues(2), Thurs(4) +OnClock2100: //start time for Sat(6) +OnClock2300: //end time for Sat(6) + +OnAgitInit2: + // starting time checks + if((gettime(4)==2) && (gettime(3)>=18 && gettime(3)<21) || + (gettime(4)==4) && (gettime(3)>=18 && gettime(3)<21) || + (gettime(4)==6) && (gettime(3)>=22 && gettime(3)<23)) { + if (!agitcheck2()) { + AgitStart2; + } + end; + } + + // end time checks + if ((gettime(4)==2) && (gettime(3)==21) || + (gettime(4)==4) && (gettime(3)==21) || + (gettime(4)==6) && (gettime(3)==23)) { + if (agitcheck2()) { + AgitEnd2; + } + end; + } + end; +} diff --git a/npc/guild2/arug_cas01.txt b/npc/guild2/arug_cas01.txt index 5fa19ff70..e9cf38751 100644 --- a/npc/guild2/arug_cas01.txt +++ b/npc/guild2/arug_cas01.txt @@ -34,8 +34,8 @@ OnRecvCastleAr01: } end; -OnAgitStart: - if (agitcheck()) { +OnAgitStart2: + if (agitcheck2()) { MapRespawnGuildID "arug_cas01",GetCastleData("arug_cas01",1),2; GvgOn "arug_cas01"; donpcevent "Manager#aru01_02::Onstart"; @@ -48,7 +48,7 @@ OnAgitStart: } end; -OnAgitEnd: +OnAgitEnd2: GvgOff "arug_cas01"; if (GetCastleData("arug_cas01",1)) { KillMonster "arug_cas01","Steward#aru01::OnStartArena"; @@ -89,7 +89,7 @@ Onreset: donpcevent "Control Device01#aru01::OnDisable"; donpcevent "Control Device02#aru01::OnDisable"; donpcevent "Control Device03#aru01::OnDisable"; - if (agitcheck()) { + if (agitcheck2()) { setarray $agit_ar01[0],0,0,1,1,1,0; } end; @@ -182,7 +182,7 @@ arug_cas01,112,193,1 script Brace#aru01_01 868,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "[Brace]"; mes "I am Brace, guardian of"; mes "this stronghold. For now,"; @@ -787,7 +787,7 @@ arug_cas01,211,234,0 script 1st Guardian Stone#aru01 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1096,7 +1096,7 @@ arug_cas01,308,189,0 script 2nd Guardian Stone#aru01 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1444,7 +1444,7 @@ arug_cas01,247,52,0 script Control Device01#aru01 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1681,7 +1681,7 @@ arug_cas01,118,131,0 script Control Device02#aru01 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1920,7 +1920,7 @@ arug_cas01,82,172,0 script Control Device03#aru01 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -2645,7 +2645,7 @@ OnStartArena: else if (.msg == 2) { announce "The [" + getguildname(.@gid) + "] conquered the [Valfreyja 1] stronghold of " + GetCastleName("arug_cas01"),bc_all; mapannounce "arug_cas01","The emperium has been shattered!",bc_map,"0x00FF00"; - if (agitcheck()) { + if (agitcheck2()) { donpcevent "Manager#aru01_02::Onreset"; initnpctimer; } diff --git a/npc/guild2/arug_cas02.txt b/npc/guild2/arug_cas02.txt index d09b4ce38..4505dc66b 100644 --- a/npc/guild2/arug_cas02.txt +++ b/npc/guild2/arug_cas02.txt @@ -36,8 +36,8 @@ OnRecvCastleAr02: } end; -OnAgitStart: - if (agitcheck()) { +OnAgitStart2: + if (agitcheck2()) { MapRespawnGuildID "arug_cas02",GetCastleData("arug_cas02",1),2; GvgOn "arug_cas02"; donpcevent "Manager#aru02_02::Onstart"; @@ -50,7 +50,7 @@ OnAgitStart: } end; -OnAgitEnd: +OnAgitEnd2: GvgOff "arug_cas02"; if (GetCastleData("arug_cas02",1)) { KillMonster "arug_cas02","Steward#aru02::OnStartArena"; @@ -91,7 +91,7 @@ Onreset: donpcevent "Control Device01#aru02::OnDisable"; donpcevent "Control Device02#aru02::OnDisable"; donpcevent "Control Device03#aru02::OnDisable"; - if (agitcheck()) { + if (agitcheck2()) { setarray $agit_ar02[0],0,0,1,1,1,0; } end; @@ -184,7 +184,7 @@ arug_cas02,38,259,5 script Yumenes#aru02_01 868,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "[Yumenes]"; mes "I am Yumenes, guardian of"; mes "this stronghold. For now,"; @@ -789,7 +789,7 @@ arug_cas02,33,168,0 script 1st Guardian Stone#aru02 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1098,7 +1098,7 @@ arug_cas02,245,168,0 script 2nd Guardian Stone#aru02 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1449,7 +1449,7 @@ arug_cas02,143,228,0 script Control Device01#aru02 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1686,7 +1686,7 @@ arug_cas02,118,356,0 script Control Device02#aru02 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1925,7 +1925,7 @@ arug_cas02,56,308,0 script Control Device03#aru02 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -2606,7 +2606,7 @@ OnStartArena: else if (.msg == 2) { announce "The [" + getguildname(.@gid) + "] conquered the [Valfreyja 2] stronghold of "+GetCastleName("arug_cas02"),bc_all; mapannounce "arug_cas02","The emperium has been shattered!",bc_map,"0x00FF00"; - if (agitcheck()) { + if (agitcheck2()) { donpcevent "Manager#aru02_02::Onreset"; initnpctimer; } diff --git a/npc/guild2/arug_cas03.txt b/npc/guild2/arug_cas03.txt index 12fff2581..0578f2aa2 100644 --- a/npc/guild2/arug_cas03.txt +++ b/npc/guild2/arug_cas03.txt @@ -35,8 +35,8 @@ OnRecvCastleAr03: } end; -OnAgitStart: - if (agitcheck()) { +OnAgitStart2: + if (agitcheck2()) { MapRespawnGuildID "arug_cas03",GetCastleData("arug_cas03",1),2; GvgOn "arug_cas03"; donpcevent "Manager#aru03_02::Onstart"; @@ -49,7 +49,7 @@ OnAgitStart: } end; -OnAgitEnd: +OnAgitEnd2: GvgOff "arug_cas03"; if (GetCastleData("arug_cas03",1)) { KillMonster "arug_cas03","Steward#aru03::OnStartArena"; @@ -90,7 +90,7 @@ Onreset: donpcevent "Control Device01#aru03::OnDisable"; donpcevent "Control Device02#aru03::OnDisable"; donpcevent "Control Device03#aru03::OnDisable"; - if (agitcheck()) { + if (agitcheck2()) { setarray $agit_ar03[0],0,0,1,1,1,0; } end; @@ -183,7 +183,7 @@ arug_cas03,146,315,3 script Yehsus#aru03_01 868,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "[Yehsus]"; mes "I am Yehsus, guardian of"; mes "this stronghold. For now,"; @@ -788,7 +788,7 @@ arug_cas03,65,171,0 script 1st Guardian Stone#aru03 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1097,7 +1097,7 @@ arug_cas03,212,149,0 script 2nd Guardian Stone#aru03 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1448,7 +1448,7 @@ arug_cas03,136,158,0 script Control Device01#aru03 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1685,7 +1685,7 @@ arug_cas03,135,212,0 script Control Device02#aru03 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1924,7 +1924,7 @@ arug_cas03,134,266,0 script Control Device03#aru03 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -2651,7 +2651,7 @@ OnStartArena: else if (.msg == 2) { announce "The [" + getguildname(.@gid) + "] conquered the [Valfreyja 3] stronghold of "+GetCastleName("arug_cas03"),bc_all; mapannounce "arug_cas03","The emperium has been shattered!",bc_map,"0x00FF00"; - if (agitcheck()) { + if (agitcheck2()) { donpcevent "Manager#aru03_02::Onreset"; initnpctimer; } diff --git a/npc/guild2/arug_cas04.txt b/npc/guild2/arug_cas04.txt index 7348d4559..c863a4aae 100644 --- a/npc/guild2/arug_cas04.txt +++ b/npc/guild2/arug_cas04.txt @@ -34,8 +34,8 @@ OnRecvCastlear04: } end; -OnAgitStart: - if (agitcheck()) { +OnAgitStart2: + if (agitcheck2()) { MapRespawnGuildID "arug_cas04",GetCastleData("arug_cas04",1),2; GvgOn "arug_cas04"; donpcevent "Manager#aru04_02::Onstart"; @@ -48,7 +48,7 @@ OnAgitStart: } end; -OnAgitEnd: +OnAgitEnd2: GvgOff "arug_cas04"; if (GetCastleData("arug_cas04",1)) { KillMonster "arug_cas04","Steward#aru04::OnStartArena"; @@ -89,7 +89,7 @@ Onreset: donpcevent "Control Device01#aru04::OnDisable"; donpcevent "Control Device02#aru04::OnDisable"; donpcevent "Control Device03#aru04::OnDisable"; - if (agitcheck()) { + if (agitcheck2()) { setarray $agit_ar04[0],0,0,1,1,1,0; } end; @@ -182,7 +182,7 @@ arug_cas04,146,315,3 script Nios#aru04_01 868,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "[Nios]"; mes "I am Nios, guardian of"; mes "this stronghold. For now,"; @@ -787,7 +787,7 @@ arug_cas04,65,171,0 script 1st Guardian Stone#aru04 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1096,7 +1096,7 @@ arug_cas04,212,149,0 script 2nd Guardian Stone#aru04 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1447,7 +1447,7 @@ arug_cas04,143,158,0 script Control Device01#aru04 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1684,7 +1684,7 @@ arug_cas04,135,212,0 script Control Device02#aru04 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1923,7 +1923,7 @@ arug_cas04,134,266,0 script Control Device03#aru04 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -2650,7 +2650,7 @@ OnStartArena: else if (.msg == 2) { announce "The [" + getguildname(.@gid) + "] conquered the [Valfreyja 4] stronghold of "+GetCastleName("arug_cas04"),bc_all; mapannounce "arug_cas04","The emperium has been shattered!",bc_map,"0x00FF00"; - if (agitcheck()) { + if (agitcheck2()) { donpcevent "Manager#aru04_02::Onreset"; initnpctimer; } diff --git a/npc/guild2/arug_cas05.txt b/npc/guild2/arug_cas05.txt index 5fe840ea6..ab23d11b0 100644 --- a/npc/guild2/arug_cas05.txt +++ b/npc/guild2/arug_cas05.txt @@ -34,8 +34,8 @@ OnRecvCastlear05: } end; -OnAgitStart: - if (agitcheck()) { +OnAgitStart2: + if (agitcheck2()) { MapRespawnGuildID "arug_cas05",GetCastleData("arug_cas05",1),2; GvgOn "arug_cas05"; donpcevent "Manager#aru05_02::Onstart"; @@ -48,7 +48,7 @@ OnAgitStart: } end; -OnAgitEnd: +OnAgitEnd2: GvgOff "arug_cas05"; if (GetCastleData("arug_cas05",1)) { KillMonster "arug_cas05","Steward#aru05::OnStartArena"; @@ -89,7 +89,7 @@ Onreset: donpcevent "Control Device01#aru05::OnDisable"; donpcevent "Control Device02#aru05::OnDisable"; donpcevent "Control Device03#aru05::OnDisable"; - if (agitcheck()) { + if (agitcheck2()) { setarray $agit_ar05[0],0,0,1,1,1,0; } end; @@ -182,7 +182,7 @@ arug_cas05,146,315,3 script Eeos#aru05_01 868,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "[Eeos]"; mes "I am Eeos, guardian of"; mes "this stronghold. For now,"; @@ -787,7 +787,7 @@ arug_cas05,65,171,0 script 1st Guardian Stone#aru05 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1096,7 +1096,7 @@ arug_cas05,212,149,0 script 2nd Guardian Stone#aru05 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1447,7 +1447,7 @@ arug_cas05,136,158,0 script Control Device01#aru05 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1684,7 +1684,7 @@ arug_cas05,135,212,0 script Control Device02#aru05 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1923,7 +1923,7 @@ arug_cas05,134,266,0 script Control Device03#aru05 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -2650,7 +2650,7 @@ OnStartArena: else if (.msg == 2) { announce "The [" + getguildname(.@gid) + "] conquered the [Valfreyja 5] stronghold of "+GetCastleName("arug_cas05"),bc_all; mapannounce "arug_cas05","The emperium has been shattered!",bc_map,"0x00FF00"; - if (agitcheck()) { + if (agitcheck2()) { donpcevent "Manager#aru05_02::Onreset"; initnpctimer; } diff --git a/npc/guild2/schg_cas01.txt b/npc/guild2/schg_cas01.txt index 8492b78e9..daff2fd2a 100644 --- a/npc/guild2/schg_cas01.txt +++ b/npc/guild2/schg_cas01.txt @@ -35,8 +35,8 @@ OnRecvCastleSc01: } end; -OnAgitStart: - if (agitcheck()) { +OnAgitStart2: + if (agitcheck2()) { MapRespawnGuildID "schg_cas01",GetCastleData("schg_cas01",1),2; GvgOn "schg_cas01"; donpcevent "Manager#sch01_02::Onstart"; @@ -49,7 +49,7 @@ OnAgitStart: } end; -OnAgitEnd: +OnAgitEnd2: GvgOff "schg_cas01"; if (GetCastleData("schg_cas01",1)) { KillMonster "schg_cas01","Steward#sch01::OnStartArena"; @@ -90,7 +90,7 @@ Onreset: donpcevent "Control Device01#sch01::OnDisable"; donpcevent "Control Device02#sch01::OnDisable"; donpcevent "Control Device03#sch01::OnDisable"; - if (agitcheck()) { + if (agitcheck2()) { setarray $agit_sc01[0],0,0,1,1,1,0; } end; @@ -183,7 +183,7 @@ schg_cas01,123,306,3 script Ef#sch01_01 868,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "[Ef]"; mes "I am Ef, guardian of"; mes "this stronghold. For now,"; @@ -788,7 +788,7 @@ schg_cas01,27,36,0 script 1st Guardian Stone#sch01 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1097,7 +1097,7 @@ schg_cas01,208,75,0 script 2nd Guardian Stone#sch01 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1448,7 +1448,7 @@ schg_cas01,124,52,0 script Control Device01#sch01 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1685,7 +1685,7 @@ schg_cas01,128,157,0 script Control Device02#sch01 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1924,7 +1924,7 @@ schg_cas01,109,247,0 script Control Device03#sch01 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -2651,7 +2651,7 @@ OnStartArena: else if (.msg == 2) { announce "The [" + getguildname(.@gid) + "] conquered the [Nithafjoll 1] stronghold of "+GetCastleName("schg_cas01"),bc_all; mapannounce "schg_cas01","The emperium has been shattered!",bc_map,"0x00FF00"; - if (agitcheck()) { + if (agitcheck2()) { donpcevent "Manager#sch01_02::Onreset"; initnpctimer; } diff --git a/npc/guild2/schg_cas02.txt b/npc/guild2/schg_cas02.txt index e9ba924d9..8e835a743 100644 --- a/npc/guild2/schg_cas02.txt +++ b/npc/guild2/schg_cas02.txt @@ -37,8 +37,8 @@ OnRecvCastlesc02: } end; -OnAgitStart: - if (agitcheck()) { +OnAgitStart2: + if (agitcheck2()) { MapRespawnGuildID "schg_cas02",GetCastleData("schg_cas02",1),2; GvgOn "schg_cas02"; donpcevent "Manager#sch02_02::Onstart"; @@ -51,7 +51,7 @@ OnAgitStart: } end; -OnAgitEnd: +OnAgitEnd2: GvgOff "schg_cas02"; if (GetCastleData("schg_cas02",1)) { KillMonster "schg_cas02","Steward#sch02::OnStartArena"; @@ -92,7 +92,7 @@ Onreset: donpcevent "Control Device01#sch02::OnDisable"; donpcevent "Control Device02#sch02::OnDisable"; donpcevent "Control Device03#sch02::OnDisable"; - if (agitcheck()) { + if (agitcheck2()) { setarray $agit_sc02[0],0,0,1,1,1,0; } end; @@ -185,7 +185,7 @@ schg_cas02,140,184,3 script Endeef#sch02_01 868,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "[Endeef]"; mes "I am Endeef, guardian of"; mes "this stronghold. For now,"; @@ -790,7 +790,7 @@ schg_cas02,231,57,0 script 1st Guardian Stone#sch02 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1099,7 +1099,7 @@ schg_cas02,335,231,0 script 2nd Guardian Stone#sch02 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1447,7 +1447,7 @@ schg_cas02,288,97,0 script Control Device01#sch02 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1684,7 +1684,7 @@ schg_cas02,230,209,0 script Control Device02#sch02 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1923,7 +1923,7 @@ schg_cas02,159,143,0 script Control Device03#sch02 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -2587,7 +2587,7 @@ OnStartArena: else if (.msg == 2) { announce "The [" + getguildname(.@gid) + "] conquered the [Nithafjoll 2] stronghold of "+GetCastleName("schg_cas02"),bc_all; mapannounce "schg_cas02","The emperium has been shattered!",bc_map,"0x00FF00"; - if (agitcheck()) { + if (agitcheck2()) { donpcevent "Manager#sch02_02::Onreset"; initnpctimer; } diff --git a/npc/guild2/schg_cas03.txt b/npc/guild2/schg_cas03.txt index 71be08f1c..6717aeab4 100644 --- a/npc/guild2/schg_cas03.txt +++ b/npc/guild2/schg_cas03.txt @@ -39,8 +39,8 @@ OnRecvCastlesc03: } end; -OnAgitStart: - if (agitcheck()) { +OnAgitStart2: + if (agitcheck2()) { MapRespawnGuildID "schg_cas03",GetCastleData("schg_cas03",1),2; GvgOn "schg_cas03"; donpcevent "manager#sch03_02::Onstart"; @@ -53,7 +53,7 @@ OnAgitStart: } end; -OnAgitEnd: +OnAgitEnd2: GvgOff "schg_cas03"; if (GetCastleData("schg_cas03",1)) { KillMonster "schg_cas03","Steward#sch03::OnStartArena"; @@ -94,7 +94,7 @@ Onreset: donpcevent "Control Device01#sch03::OnDisable"; donpcevent "Control Device02#sch03::OnDisable"; donpcevent "Control Device03#sch03::OnDisable"; - if (agitcheck()) { + if (agitcheck2()) { setarray $agit_sc03[0],0,0,1,1,1,0; } end; @@ -187,7 +187,7 @@ schg_cas03,287,226,5 script Elzee#sch03_01 868,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "[Elzee]"; mes "I am Elzee, guardian of"; mes "this stronghold. For now,"; @@ -792,7 +792,7 @@ schg_cas03,242,309,0 script 1st Guardian Stone#sch03 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1101,7 +1101,7 @@ schg_cas03,376,250,0 script 2nd Guardian Stone#sch03 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1448,7 +1448,7 @@ schg_cas03,335,298,0 script Control Device01#sch03 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1685,7 +1685,7 @@ schg_cas03,200,227,0 script Control Device02#sch03 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1924,7 +1924,7 @@ schg_cas03,273,205,0 script Control Device03#sch03 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -2645,7 +2645,7 @@ OnStartArena: else if (.msg == 2) { announce "The [" + getguildname(.@gid) + "] conquered the [Nithafjoll 3] stronghold of "+GetCastleName("schg_cas03"),bc_all; mapannounce "schg_cas03","The emperium has been shattered!",bc_map,"0x00FF00"; - if (agitcheck()) { + if (agitcheck2()) { donpcevent "Manager#sch03_02::Onreset"; initnpctimer; } diff --git a/npc/guild2/schg_cas04.txt b/npc/guild2/schg_cas04.txt index d98277985..a7ec5c6ee 100644 --- a/npc/guild2/schg_cas04.txt +++ b/npc/guild2/schg_cas04.txt @@ -33,8 +33,8 @@ OnRecvCastlesc04: } end; -OnAgitStart: - if (agitcheck()) { +OnAgitStart2: + if (agitcheck2()) { MapRespawnGuildID "schg_cas04",GetCastleData("schg_cas04",1),2; GvgOn "schg_cas04"; donpcevent "Manager#sch04_02::Onstart"; @@ -47,7 +47,7 @@ OnAgitStart: } end; -OnAgitEnd: +OnAgitEnd2: GvgOff "schg_cas04"; if (GetCastleData("schg_cas04",1)) { KillMonster "schg_cas04","Steward#sch04::OnStartArena"; @@ -88,7 +88,7 @@ Onreset: donpcevent "Control Device01#sch04::OnDisable"; donpcevent "Control Device02#sch04::OnDisable"; donpcevent "Control Device03#sch04::OnDisable"; - if (agitcheck()) { + if (agitcheck2()) { setarray $agit_sc04[0],0,0,1,1,1,0; } end; @@ -181,7 +181,7 @@ schg_cas04,123,306,3 script Ef#sch04_01 868,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "[Ef]"; mes "I am Ef, guardian of"; mes "this stronghold. For now,"; @@ -786,7 +786,7 @@ schg_cas04,27,36,0 script 1st Guardian Stone#sch04 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1095,7 +1095,7 @@ schg_cas04,208,75,0 script 2nd Guardian Stone#sch04 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1446,7 +1446,7 @@ schg_cas04,124,52,0 script Control Device01#sch04 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1683,7 +1683,7 @@ schg_cas04,128,157,0 script Control Device02#sch04 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1922,7 +1922,7 @@ schg_cas04,109,247,0 script Control Device03#sch04 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -2649,7 +2649,7 @@ OnStartArena: else if (.msg == 2) { announce "The [" + getguildname(.@gid) + "] conquered the [Nithafjoll 4] stronghold of "+GetCastleName("schg_cas04"),bc_all; mapannounce "schg_cas04","The emperium has been shattered!",bc_map,"0x00FF00"; - if (agitcheck()) { + if (agitcheck2()) { donpcevent "Manager#sch04_02::Onreset"; initnpctimer; } diff --git a/npc/guild2/schg_cas05.txt b/npc/guild2/schg_cas05.txt index 8bc0b6aea..8833733b4 100644 --- a/npc/guild2/schg_cas05.txt +++ b/npc/guild2/schg_cas05.txt @@ -33,8 +33,8 @@ OnRecvCastlesc05: } end; -OnAgitStart: - if (agitcheck()) { +OnAgitStart2: + if (agitcheck2()) { MapRespawnGuildID "schg_cas05",GetCastleData("schg_cas05",1),2; GvgOn "schg_cas05"; donpcevent "Manager#sch05_02::Onstart"; @@ -47,7 +47,7 @@ OnAgitStart: } end; -OnAgitEnd: +OnAgitEnd2: GvgOff "schg_cas05"; if (GetCastleData("schg_cas05",1)) { KillMonster "schg_cas05","Steward#sch05::OnStartArena"; @@ -88,7 +88,7 @@ Onreset: donpcevent "Control Device01#sch05::OnDisable"; donpcevent "Control Device02#sch05::OnDisable"; donpcevent "Control Device03#sch05::OnDisable"; - if (agitcheck()) { + if (agitcheck2()) { setarray $agit_sc05[0],0,0,1,1,1,0; } end; @@ -181,7 +181,7 @@ schg_cas05,123,306,3 script Ef#sch05_01 868,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "[Ef]"; mes "I am Ef, guardian of"; mes "this stronghold. For now,"; @@ -786,7 +786,7 @@ schg_cas05,27,36,0 script 1st Guardian Stone#sch05 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1095,7 +1095,7 @@ schg_cas05,208,75,0 script 2nd Guardian Stone#sch05 844,{ close; } else { - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFIt is impossible to"; mes "rebuild the Guardian"; mes "Stone because the"; @@ -1446,7 +1446,7 @@ schg_cas05,124,52,0 script Control Device01#sch05 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1683,7 +1683,7 @@ schg_cas05,128,157,0 script Control Device02#sch05 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -1922,7 +1922,7 @@ schg_cas05,109,247,0 script Control Device03#sch05 111,{ mes "you're just about done"; mes "with repairing the gate.^000000"; next; - if (agitcheck() == 0) { + if (agitcheck2() == 0) { mes "^3355FFUnfortunately, the Fortress"; mes "Gate can't be reconstructed:"; mes "the Emperium is no longer here.^000000"; @@ -2649,7 +2649,7 @@ OnStartArena: else if (.msg == 2) { announce "The [" + getguildname(.@gid) + "] conquered the [Nithafjoll 5] stronghold of "+GetCastleName("schg_cas05"),bc_all; mapannounce "schg_cas05","The emperium has been shattered!",bc_map,"0x00FF00"; - if (agitcheck()) { + if (agitcheck2()) { donpcevent "Manager#sch05_02::Onreset"; initnpctimer; } diff --git a/npc/scripts_guild.conf b/npc/scripts_guild.conf index 313fa7dc8..0ac20252b 100644 --- a/npc/scripts_guild.conf +++ b/npc/scripts_guild.conf @@ -36,6 +36,8 @@ npc: npc/guild/prtg_cas05.txt // WoE SE scripts in their purest form, unoptomized. // To disable any single castle, comment it out. // -------------------------------------------------------------- +// WoE SE time settings. +npc: npc/guild2/agit_start_se.txt // Town Flags npc: npc/guild2/guild_flags.txt // Arunafeltz diff --git a/src/map/atcommand.c b/src/map/atcommand.c index f734b76da..26d53acbe 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -3805,6 +3805,24 @@ int atcommand_agitstart(const int fd, struct map_session_data* sd, const char* c /*========================================== * *------------------------------------------*/ +int atcommand_agitstart2(const int fd, struct map_session_data* sd, const char* command, const char* message) +{ + nullpo_retr(-1, sd); + if (agit2_flag == 1) { + clif_displaymessage(fd, msg_txt(404)); // "War of Emperium SE is currently in progress." + return -1; + } + + agit2_flag = 1; + guild_agit2_start(); + clif_displaymessage(fd, msg_txt(403)); // "War of Emperium SE has been initiated." + + return 0; +} + +/*========================================== + * + *------------------------------------------*/ int atcommand_agitend(const int fd, struct map_session_data* sd, const char* command, const char* message) { nullpo_retr(-1, sd); @@ -3821,6 +3839,24 @@ int atcommand_agitend(const int fd, struct map_session_data* sd, const char* com } /*========================================== + * + *------------------------------------------*/ +int atcommand_agitend2(const int fd, struct map_session_data* sd, const char* command, const char* message) +{ + nullpo_retr(-1, sd); + if (agit2_flag == 0) { + clif_displaymessage(fd, msg_txt(406)); // "War of Emperium SE is currently not in progress." + return -1; + } + + agit2_flag = 0; + guild_agit2_end(); + clif_displaymessage(fd, msg_txt(405)); // "War of Emperium SE has been ended." + + return 0; +} + +/*========================================== * @mapexit - shuts down the map server *------------------------------------------*/ int atcommand_mapexit(const int fd, struct map_session_data* sd, const char* command, const char* message) @@ -8086,7 +8122,7 @@ int atcommand_main(const int fd, struct map_session_data* sd, const char* comman intif_announce(atcmd_output, strlen(atcmd_output) + 1, 0xFE000000, 0); // Chat logging type 'M' / Main Chat - if( log_config.chat&1 || (log_config.chat&32 && !(agit_flag && log_config.chat&64)) ) + if( log_config.chat&1 || (log_config.chat&32 && !((agit_flag || agit2_flag) && log_config.chat&64)) ) log_chat("M", 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message); } @@ -8506,6 +8542,8 @@ AtCommandInfo atcommand_info[] = { { "allowks", 6, atcommand_allowks }, { "cash", 60, atcommand_cash }, { "points", 60, atcommand_cash }, + { "agitstart2", 60, atcommand_agitstart2 }, + { "agitend2", 60, atcommand_agitend2 }, }; diff --git a/src/map/battle.c b/src/map/battle.c index 1140c6640..8dc6eb394 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3150,7 +3150,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f { struct mob_data *md = BL_CAST(BL_MOB, t_bl); - if( !(agit_flag && map[m].flag.gvg_castle) && md->guardian_data && md->guardian_data->guild_id ) + if( !((agit_flag || agit2_flag) && map[m].flag.gvg_castle) && md->guardian_data && md->guardian_data->guild_id ) return 0; // Disable guardians/emperiums owned by Guilds on non-woe times. break; } @@ -3213,7 +3213,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f case BL_MOB: { struct mob_data *md = BL_CAST(BL_MOB, s_bl); - if( !(agit_flag && map[m].flag.gvg_castle) && md->guardian_data && md->guardian_data->guild_id ) + if( !((agit_flag || agit2_flag) && map[m].flag.gvg_castle) && md->guardian_data && md->guardian_data->guild_id ) return 0; // Disable guardians/emperium owned by Guilds on non-woe times. if( !md->special_state.ai ) diff --git a/src/map/clif.c b/src/map/clif.c index f6014fe3a..489a765cf 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8250,7 +8250,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd) } // Chat logging type 'O' / Global Chat - if( log_config.chat&1 || (log_config.chat&2 && !(agit_flag && log_config.chat&64)) ) + if( log_config.chat&1 || (log_config.chat&2 && !((agit_flag || agit2_flag) && log_config.chat&64)) ) log_chat("O", 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message); return; @@ -8509,7 +8509,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd) } // Chat logging type 'W' / Whisper - if( log_config.chat&1 || (log_config.chat&4 && !(agit_flag && log_config.chat&64)) ) + if( log_config.chat&1 || (log_config.chat&4 && !((agit_flag || agit2_flag) && log_config.chat&64)) ) log_chat("W", 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, target, message); //-------------------------------------------------------// @@ -8566,7 +8566,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd) } // Chat logging type 'M' / Main Chat - if( log_config.chat&1 || (log_config.chat&32 && !(agit_flag && log_config.chat&64)) ) + if( log_config.chat&1 || (log_config.chat&32 && !((agit_flag || agit2_flag) && log_config.chat&64)) ) log_chat("M", 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message); return; diff --git a/src/map/guild.c b/src/map/guild.c index fced17189..8af73acba 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -64,6 +64,7 @@ struct{ // timer for auto saving guild data during WoE #define GUILD_SAVE_INTERVAL 300000 int guild_save_timer = INVALID_TIMER; +int guild_save_timer2 = INVALID_TIMER; int guild_payexp_timer(int tid, unsigned int tick, int id, intptr data); int guild_save_sub(int tid, unsigned int tick, int id, intptr data); @@ -640,7 +641,7 @@ int guild_invite(struct map_session_data *sd,struct map_session_data *tsd) if(tsd->status.guild_id>0 || tsd->guild_invite>0 || - (agit_flag && map[tsd->bl.m].flag.gvg_castle)) + ((agit_flag || agit2_flag) && map[tsd->bl.m].flag.gvg_castle)) { //Can't invite people inside castles. [Skotlex] clif_guild_inviteack(sd,0); return 0; @@ -798,7 +799,7 @@ int guild_leave(struct map_session_data* sd, int guild_id, int account_id, int c if(sd->status.account_id!=account_id || sd->status.char_id!=char_id || sd->status.guild_id!=guild_id || - (agit_flag && map[sd->bl.m].flag.gvg_castle)) + ((agit_flag || agit2_flag) && map[sd->bl.m].flag.gvg_castle)) return 0; intif_guild_leave(sd->status.guild_id, sd->status.account_id, sd->status.char_id,0,mes); @@ -828,7 +829,7 @@ int guild_expulsion(struct map_session_data* sd, int guild_id, int account_id, i //Can't leave inside guild castles. if ((tsd = map_id2sd(account_id)) && tsd->status.char_id == char_id && - (agit_flag && map[tsd->bl.m].flag.gvg_castle)) + ((agit_flag || agit2_flag) && map[tsd->bl.m].flag.gvg_castle)) return 0; // find the member and perform expulsion @@ -989,7 +990,7 @@ int guild_send_message(struct map_session_data *sd,const char *mes,int len) guild_recv_message(sd->status.guild_id,sd->status.account_id,mes,len); // Chat logging type 'G' / Guild Chat - if( log_config.chat&1 || (log_config.chat&16 && !(agit_flag && log_config.chat&64)) ) + if( log_config.chat&1 || (log_config.chat&16 && !((agit_flag || agit2_flag) && log_config.chat&64)) ) log_chat("G", sd->status.guild_id, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, mes); return 0; @@ -1301,7 +1302,7 @@ int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd) struct guild *g[2]; int i; - if(agit_flag) { // Disable alliance creation during woe [Valaris] + if(agit_flag || agit2_flag) { // Disable alliance creation during woe [Valaris] clif_displaymessage(sd->fd,"Alliances cannot be made during Guild Wars!"); return 0; } // end addition [Valaris] @@ -1414,7 +1415,7 @@ int guild_delalliance(struct map_session_data *sd,int guild_id,int flag) { nullpo_retr(0, sd); - if(agit_flag) { // Disable alliance breaking during woe [Valaris] + if(agit_flag || agit2_flag) { // Disable alliance breaking during woe [Valaris] clif_displaymessage(sd->fd,"Alliances cannot be broken during Guild Wars!"); return 0; } // end addition [Valaris] @@ -1854,8 +1855,10 @@ int guild_castlealldataload(int len,struct guild_castle *gc) for( i = n-1; i >= 0 && !(gc[i].guild_id); --i ); ev = i; // offset of castle or -1 - if( ev < 0 ) //No castles owned, invoke OnAgitInit as it is. + if( ev < 0 ) { //No castles owned, invoke OnAgitInit as it is. npc_event_doall("OnAgitInit"); + npc_event_doall("OnAgitInit2"); + } else // load received castles into memory, one by one for( i = 0; i < n; i++, gc++ ) { @@ -1872,8 +1875,10 @@ int guild_castlealldataload(int len,struct guild_castle *gc) { if( i != ev ) guild_request_info(c->guild_id); - else // last owned one + else { // last owned one guild_npc_request_info(c->guild_id, "::OnAgitInit"); + guild_npc_request_info(c->guild_id, "::OnAgitInit2"); + } } } @@ -1898,6 +1903,24 @@ int guild_agit_end(void) return 0; } +int guild_agit2_start(void) +{ // Run All NPC_Event[OnAgitStart2] + int c = npc_event_doall("OnAgitStart2"); + ShowStatus("NPC_Event:[OnAgitStart2] Run (%d) Events by @AgitStart2.\n",c); + // Start auto saving + guild_save_timer2 = add_timer_interval (gettick() + GUILD_SAVE_INTERVAL, guild_save_sub, 0, 0, GUILD_SAVE_INTERVAL); + return 0; +} + +int guild_agit2_end(void) +{ // Run All NPC_Event[OnAgitEnd2] + int c = npc_event_doall("OnAgitEnd2"); + ShowStatus("NPC_Event:[OnAgitEnd2] Run (%d) Events by @AgitEnd2.\n",c); + // Stop auto saving + delete_timer (guild_save_timer2, guild_save_sub); + return 0; +} + int guild_save_sub(int tid, unsigned int tick, int id, intptr data) { static int Gid[MAX_GUILDCASTLE]; // previous owning guild diff --git a/src/map/guild.h b/src/map/guild.h index 61c02124b..67cfd3544 100644 --- a/src/map/guild.h +++ b/src/map/guild.h @@ -100,6 +100,9 @@ int guild_castlealldataload(int len,struct guild_castle *gc); int guild_agit_start(void); int guild_agit_end(void); +int guild_agit2_start(void); +int guild_agit2_end(void); + void do_final_guild(void); #endif /* _GUILD_H_ */ diff --git a/src/map/map.c b/src/map/map.c index 61c827ff0..d1da19e7f 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -122,6 +122,7 @@ int autosave_interval = DEFAULT_AUTOSAVE_INTERVAL; int minsave_interval = 100; int save_settings = 0xFFFF; int agit_flag = 0; +int agit2_flag = 0; int night_flag = 0; // 0=day, 1=night [Yor] struct charid_request { diff --git a/src/map/map.h b/src/map/map.h index 4a8be92ed..01ac74cba 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -156,9 +156,9 @@ enum { #define DEFAULT_AUTOSAVE_INTERVAL 5*60*1000 //Specifies maps where players may hit each other -#define map_flag_vs(m) (map[m].flag.pvp || map[m].flag.gvg_dungeon || map[m].flag.gvg || (agit_flag && map[m].flag.gvg_castle)) +#define map_flag_vs(m) (map[m].flag.pvp || map[m].flag.gvg_dungeon || map[m].flag.gvg || ((agit_flag || agit2_flag) && map[m].flag.gvg_castle)) //Specifies maps that have special GvG/WoE restrictions -#define map_flag_gvg(m) (map[m].flag.gvg || (agit_flag && map[m].flag.gvg_castle)) +#define map_flag_gvg(m) (map[m].flag.gvg || ((agit_flag || agit2_flag) && map[m].flag.gvg_castle)) //Specifies if the map is tagged as GvG/WoE (regardless of agit_flag status) #define map_flag_gvg2(m) (map[m].flag.gvg || map[m].flag.gvg_castle) // No Kill Steal Protection @@ -496,6 +496,7 @@ extern int autosave_interval; extern int minsave_interval; extern int save_settings; extern int agit_flag; +extern int agit2_flag; extern int night_flag; // 0=day, 1=night [Yor] extern int enable_spy; //Determines if @spy commands are active. extern char db_path[256]; diff --git a/src/map/party.c b/src/map/party.c index 07ce7634d..a6f2c454f 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -675,7 +675,7 @@ int party_send_message(struct map_session_data *sd,const char *mes,int len) party_recv_message(sd->status.party_id,sd->status.account_id,mes,len); // Chat logging type 'P' / Party Chat - if( log_config.chat&1 || (log_config.chat&8 && !(agit_flag && log_config.chat&64)) ) + if( log_config.chat&1 || (log_config.chat&8 && !((agit_flag || agit2_flag) && log_config.chat&64)) ) log_chat("P", sd->status.party_id, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, mes); return 0; diff --git a/src/map/script.c b/src/map/script.c index dc1a0fa6d..ceb0dab50 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -9079,6 +9079,22 @@ BUILDIN_FUNC(agitend) return 0; } +BUILDIN_FUNC(agitstart2) +{ + if(agit2_flag==1) return 0; // Agit2 already Start. + agit2_flag=1; + guild_agit2_start(); + return 0; +} + +BUILDIN_FUNC(agitend2) +{ + if(agit2_flag==0) return 0; // Agit2 already End. + agit2_flag=0; + guild_agit2_end(); + return 0; +} + /*========================================== * Returns whether woe is on or off. // choice script *------------------------------------------*/ @@ -9088,6 +9104,15 @@ BUILDIN_FUNC(agitcheck) return 0; } +/*========================================== + * Returns whether woese is on or off. // choice script + *------------------------------------------*/ +BUILDIN_FUNC(agitcheck2) +{ + script_pushint(st,agit2_flag); + return 0; +} + /// Sets the guild_id of this npc. /// /// flagemblem <guild_id>; @@ -13419,5 +13444,9 @@ struct script_function buildin_func[] = { BUILDIN_DEF(mercenary_get_faith,"i"), BUILDIN_DEF(mercenary_set_calls,"ii"), BUILDIN_DEF(mercenary_set_faith,"ii"), + // WoE SE + BUILDIN_DEF(agitstart2,""), + BUILDIN_DEF(agitend2,""), + BUILDIN_DEF(agitcheck2,""), {NULL,NULL,NULL}, }; diff --git a/src/map/skill.c b/src/map/skill.c index 2b242821d..1a8cdf0a1 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -340,7 +340,7 @@ int skillnotok (int skillid, struct map_session_data *sd) return 1; if(map_flag_gvg(m) && skill_get_nocast (skillid) & 4) return 1; - if(agit_flag && skill_get_nocast (skillid) & 8) + if((agit_flag || agit2_flag) && skill_get_nocast (skillid) & 8) return 1; if(map[m].flag.restricted && map[m].zone && skill_get_nocast (skillid) & (8*map[m].zone)) return 1; @@ -379,7 +379,7 @@ int skillnotok (int skillid, struct map_session_data *sd) break; case GD_EMERGENCYCALL: if ( - !(battle_config.emergency_call&(agit_flag?2:1)) || + !(battle_config.emergency_call&((agit_flag || agit2_flag)?2:1)) || !(battle_config.emergency_call&(map[m].flag.gvg || map[m].flag.gvg_castle?8:4)) || (battle_config.emergency_call&16 && map[m].flag.nowarpto && !map[m].flag.gvg_castle) ) { diff --git a/src/map/unit.c b/src/map/unit.c index 59924a108..4003e89c6 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -170,7 +170,7 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr data) } else sd->areanpc_id=0; if (sd->state.gmaster_flag && - (battle_config.guild_aura&(agit_flag?2:1)) && + (battle_config.guild_aura&((agit_flag || agit2_flag)?2:1)) && (battle_config.guild_aura&(map_flag_gvg2(bl->m)?8:4)) ) { //Guild Aura: Likely needs to be recoded, this method seems inefficient. |