Przeglądaj źródła

Added WOE:TE Restrictions
* Added mapflag `gvg_te`, `gvg_te_castle`, this is will be activated during WOE:TE sessions. These changes are needed because of:
* If `gvgon` is used, TE castles become `gvg`, it makes the restriction failure. Items that are supposed to only can be used/equipped in TE Castles, also affected in 'normal' GVG/WOE maps.
* These flags used form `item_noequip`, `skill_nocast`, and `status_disabled` flag 16. (If just assume TE Castles are Restricted Zone 8, the failure will occurs as point 1 above).
* Added Restricted Zone 8 for TE Guild Dungeons, to prevent marriage skills can be casted there.
* Added command `gvgon3` to set GVG for WOE:TE Castles.
* Added command `canParticipateSiegeTE` is 'hardcoded' function to check player's job that can participate in WOE:TE.
* Current usages in `GD_EMERGENCYCALL` and replace the in-script function.
* Changed default config `allow_consume_restricted_item` to 'no'. All restricted usable/consumable/healing items are always failed to be used.
* Changed the GVG items/skills restriction check. "Item cannot be equipped in GVG maps" are supposed to ignore the agit flag statuses, as long as the map is GVG flagged, items/skills are always restricted and otherwise.
* Moved previous entries of `skill_nocast` flag 16 as hardcode (for now).

Signed-off-by: Cydh Ramdh <cydh@pservero.com>

Cydh Ramdh 9 lat temu
rodzic
commit
26dcf345fe

+ 1 - 1
conf/battle/items.conf

@@ -81,7 +81,7 @@ autospell_stacking: no
 // Allow the consumption of usable items that are disabled by item_noequip.txt? (Note 1)
 // no = can't be consumed
 // yes = consumed with no effect
-allow_consume_restricted_item: yes
+allow_consume_restricted_item: no
 
 // Allow equipping items that are disabled by item_noequip.txt? (Note 1)
 // no = can't be equipped and will be unequipped when entering the map

+ 2 - 0
db/pre-re/item_noequip.txt

@@ -9,6 +9,7 @@
 // 2    - restricted in PVP
 // 4    - restricted in GVG
 // 8    - restricted in Battlegrounds
+// 16   - restricted in WOE:TE castles
 // Restricted zones - configured by 'restricted <number>' mapflag
 // 32   - restricted in zone 1
 // 64   - restricted in zone 2
@@ -17,6 +18,7 @@
 // 512  - restricted in zone 5
 // 1024 - restricted in zone 6
 // 2048 - restricted in zone 7
+// 4096 - restricted in zone 8
 //
 // Examples:
 // 1201,1   // Knife can't be worn on normal maps

+ 20 - 5
db/pre-re/skill_nocast_db.txt

@@ -9,7 +9,7 @@
 // 2    - cannot be used in PvP maps (use this instead of 1 for PK-mode servers)
 // 4    - cannot be used in GvG maps
 // 8    - cannot be used in Battleground maps
-// 16   - cannot be cloned (clones will not copy this skill)
+// 16   - cannot be used in WOE:TE castles
 // Restricted zones - configured by 'restricted <number>' mapflag
 // 32   - cannot be used in zone 1 maps
 // 64   - cannot be used in zone 2 maps
@@ -18,6 +18,7 @@
 // 512  - cannot be used in zone 5 maps
 // 1024 - cannot be used in zone 6 maps
 // 2048 - cannot be used in zone 7 maps
+// 4096 - cannot be used in zone 8 maps
 //
 // Example:
 // 8,6  // Endure cannot be used in PvP and GvG maps (2+4)
@@ -100,10 +101,24 @@
 3013,3	//KO_KYOUGAKU
 
 //----------------------------------------------------------------------------
-// Clone Forbidden/pointless skills
-//----------------------------------------------------------------------------
-77,16	//PR_TURNUNDEAD
-79,16	//PR_MAGNUS
+// Restircted in WOE:TE maps
+//----------------------------------------------------------------------------
+26,16	//AL_TELEPORT
+27,16	//AL_WARP
+87,16	//WZ_ICEWALL
+150,16	//TF_BACKSLIDING
+219,16	//RG_INTIMIDATE
+336,16	//WE_CALLPARTNER
+361,16	//HP_ASSUMPTIO
+362,16	//HP_BASILICA
+395,16	//CG_MOONLIT
+409,16	//WE_CALLPARENT
+410,16	//WE_CALLBABY
+491,16	//CR_CULTIVATION
+530,16	//NJ_KIRIKAGE
+691,16	//CASH_ASSUMPTIO
+2284,16	//SC_FATALMENACE
+2300,16	//SC_DIMENSIONDOOR
 
 //----------------------------------------------------------------------------
 // Zone 1 - Aldebaran Turbo Track

+ 72 - 46
db/re/item_noequip.txt

@@ -9,6 +9,7 @@
 // 2    - restricted in PVP
 // 4    - restricted in GVG
 // 8    - restricted in Battlegrounds
+// 16   - restricted in WOE:TE castles
 // Restricted zones - configured by 'restricted <number>' mapflag
 // 32   - restricted in zone 1
 // 64   - restricted in zone 2
@@ -17,6 +18,7 @@
 // 512  - restricted in zone 5
 // 1024 - restricted in zone 6
 // 2048 - restricted in zone 7
+// 4096 - restricted in zone 8
 //
 // Examples:
 // 1201,1   // Knife can't be worn on normal maps
@@ -78,6 +80,32 @@
 12218,8	//Assumptio_5_Scroll
 14590,8	//Pty_Assumptio_Scroll
 
+//----------------------------------------------------------------------------
+// CANNOT be consumed/equipped in WoE:TE Castles (16)
+// !TODO: [iRO] Vellums, Siege Equipment & Items, Battlegrounds, God Items 1 & 2
+// !CONFIRM: [idRO] Siege Equipment, God Items 1 & 2: are still usable
+//----------------------------------------------------------------------------
+2365,16   // Orleans_Gown
+4077,16   // Phen_Card
+4327,16   // Blood_Butterfly_Card
+12033,16  // Box_Of_Sunlight
+12388,16  // Runstone_Crush
+12389,16  // Runstone_Storm
+12390,16  // Runstone_Millennium
+12213,16  // Neuralizer
+12429,16  // Savage_Full_Roast
+12430,16  // Cocktail_Warg_Blood
+12431,16  // Minor_Stew
+12432,16  // Siroma_Iced_Tea
+12433,16  // Drosera_Herb_Salad
+12434,16  // Petite_Tail_Noodles
+12435,16  // Black_Mass
+12436,16  // Vitata_500
+12437,16  // Concentrated_Ceromain_Soup
+12580,16  // Vending_Search_Scroll
+12581,16  // Vending_Search_Scroll2
+12591,16  // Uni_Catalog_Bz
+
 //----------------------------------------------------------------------------
 // Zone 1 - Aldebaran Turbo Track
 //----------------------------------------------------------------------------
@@ -108,49 +136,47 @@
 14529,2048	//Greed_Scroll
 
 //----------------------------------------------------------------------------
-// WoE TE Items - Only can be used in WoE TE maps
-// Assumed WOE TE maps are restricted zone 8.
-// TODO: &1 (Normal) is currently removed since if the map is restricted, it'll fail.
-//----------------------------------------------------------------------------
-//1299,4094	// TE_Woe_Katar
-//1319,4094	// TE_Woe_Axe
-//1399,4094	// TE_Woe_Two_Handed_Axe
-//1437,4094	// TE_Woe_Pike
-//1495,4094	// TE_Woe_Lance
-//1591,4094	// TE_Woe_Book
-//1667,4094	// TE_Woe_Staff
-//1834,4094	// TE_Woe_Fist
-//1932,4094	// TE_Woe_Guitar
-//1987,4094	// TE_Woe_Rope
-//2019,4094	// TE_Woe_Two_Hand_Staff
-//2178,4094	// TE_Woe_Buckler
-//2179,4094	// TE_Woe_Shield
-//2180,4094	// TE_Woe_Magic_Guard
-//2496,4094	// TE_Woe_Shoes
-//2497,4094	// TE_Woe_Boots
-//2498,4094	// TE_Woe_Magic_Sandal
-//2944,4094	// TE_Ring_Of_Protection
-//2945,4094	// TE_Ring_Of_Rage
-//2946,4094	// TE_Ring_Of_Defiance
-//11557,4094	// TE_White_Potion
-//11558,4094	// TE_White_Slim_Potion
-//13083,4094	// TE_Woe_Knife
-//13117,4094	// TE_Woe_Pistol
-//13184,4094	// TE_Woe_Rifle
-//13185,4094	// TE_Woe_Gatling
-//13186,4094	// TE_Woe_Shotgun
-//13187,4094	// TE_Woe_Grenade
-//13317,4094	// TE_Woe_Huuma
-//13439,4094	// TE_Woe_Sword
-//15062,4094	// TE_Woe_Coat
-//15063,4094	// TE_Woe_Chain_Mail
-//15064,4094	// TE_Woe_Mage_Coat
-//16025,4094	// TE_Woe_Mace
-//18118,4094	// TE_Woe_Bow
-//18732,4094	// TE_Woe_Cap
-//18733,4094	// TE_Woe_Bone_Helm
-//18734,4094	// TE_Woe_Magic_Eyes
-//20702,4094	// TE_Woe_Muffler
-//20703,4094	// TE_Woe_Manteau
-//20704,4094	// TE_Woe_Magic_Manteau
-//21006,4094	// TE_Woe_Two_Hand_Sword
+// WoE:TE Items - Only can be used in WoE:TE Castles (All except &16)
+//----------------------------------------------------------------------------
+1299,8175	// TE_Woe_Katar
+1319,8175	// TE_Woe_Axe
+1399,8175	// TE_Woe_Two_Handed_Axe
+1437,8175	// TE_Woe_Pike
+1495,8175	// TE_Woe_Lance
+1591,8175	// TE_Woe_Book
+1667,8175	// TE_Woe_Staff
+1834,8175	// TE_Woe_Fist
+1932,8175	// TE_Woe_Guitar
+1987,8175	// TE_Woe_Rope
+2019,8175	// TE_Woe_Two_Hand_Staff
+2178,8175	// TE_Woe_Buckler
+2179,8175	// TE_Woe_Shield
+2180,8175	// TE_Woe_Magic_Guard
+2496,8175	// TE_Woe_Shoes
+2497,8175	// TE_Woe_Boots
+2498,8175	// TE_Woe_Magic_Sandal
+2944,8175	// TE_Ring_Of_Protection
+2945,8175	// TE_Ring_Of_Rage
+2946,8175	// TE_Ring_Of_Defiance
+11557,8175	// TE_White_Potion
+11558,8175	// TE_White_Slim_Potion
+13083,8175	// TE_Woe_Knife
+13117,8175	// TE_Woe_Pistol
+13184,8175	// TE_Woe_Rifle
+13185,8175	// TE_Woe_Gatling
+13186,8175	// TE_Woe_Shotgun
+13187,8175	// TE_Woe_Grenade
+13317,8175	// TE_Woe_Huuma
+13439,8175	// TE_Woe_Sword
+15062,8175	// TE_Woe_Coat
+15063,8175	// TE_Woe_Chain_Mail
+15064,8175	// TE_Woe_Mage_Coat
+16025,8175	// TE_Woe_Mace
+18118,8175	// TE_Woe_Bow
+18732,8175	// TE_Woe_Cap
+18733,8175	// TE_Woe_Bone_Helm
+18734,8175	// TE_Woe_Magic_Eyes
+20702,8175	// TE_Woe_Muffler
+20703,8175	// TE_Woe_Manteau
+20704,8175	// TE_Woe_Magic_Manteau
+21006,8175	// TE_Woe_Two_Hand_Sword

+ 35 - 5
db/re/skill_nocast_db.txt

@@ -9,7 +9,7 @@
 // 2    - cannot be used in PvP maps (use this instead of 1 for PK-mode servers)
 // 4    - cannot be used in GvG maps
 // 8    - cannot be used in Battleground maps
-// 16   - cannot be cloned (clones will not copy this skill)
+// 16   - cannot be used in WOE:TE castles
 // Restricted zones - configured by 'restricted <number>' mapflag
 // 32   - cannot be used in zone 1 maps
 // 64   - cannot be used in zone 2 maps
@@ -18,6 +18,7 @@
 // 512  - cannot be used in zone 5 maps
 // 1024 - cannot be used in zone 6 maps
 // 2048 - cannot be used in zone 7 maps
+// 4096 - cannot be used in zone 8 maps
 //
 // Example:
 // 8,6  // Endure cannot be used in PvP and GvG maps (2+4)
@@ -99,10 +100,32 @@
 3013,3	//KO_KYOUGAKU
 
 //----------------------------------------------------------------------------
-// Clone Forbidden/pointless skills
-//----------------------------------------------------------------------------
-77,16	//PR_TURNUNDEAD
-79,16	//PR_MAGNUS
+// Restircted in WOE:TE Castles
+//----------------------------------------------------------------------------
+26,16	// AL_TELEPORT
+27,16	// AL_WARP
+41,16	// MC_VENDING
+87,16	// WZ_ICEWALL
+147,16	// AC_MAKINGARROW
+150,16	// TF_BACKSLIDING
+211,16	// RG_STEALCOIN
+219,16	// RG_INTIMIDATE
+336,16	// WE_CALLPARTNER
+361,16	// HP_ASSUMPTIO
+362,16	// HP_BASILICA
+395,16	// CG_MOONLIT
+409,16	// WE_CALLPARENT
+410,16	// WE_CALLBABY
+491,16	// CR_CULTIVATION
+530,16	// NJ_KIRIKAGE
+691,16	// CASH_ASSUMPTIO
+//!TODO: More 3rd Class skills
+2284,16	// SC_FATALMENACE
+2300,16	// SC_DIMENSIONDOOR
+2293,16	// SC_GROOMY
+2296,16	// SC_UNLUCKY
+2494,16	// GN_CHANGEMATERIAL
+2462,16	// SO_EL_ANALYSIS
 
 //----------------------------------------------------------------------------
 // Zone 1 - Aldebaran Turbo Track
@@ -184,3 +207,10 @@
 2419,2048	//WM_POEMOFNETHERWORLD
 2482,2048	//GN_WALLOFTHORN
 2493,2048	//GN_SLINGITEM
+
+//----------------------------------------------------------------------------
+// Zone 8 - WOE:TE Dungeons
+//----------------------------------------------------------------------------
+336,4096 // WE_CALLPARTNER
+409,4096 // WE_CALLPARENT
+410,4096 // WE_CALLBABY

+ 16 - 0
db/status_disabled.txt

@@ -11,6 +11,7 @@
 // 2    - restricted in PVP
 // 4    - restricted in GVG
 // 8    - restricted in Battlegrounds
+// 16   - restricted in WOE:TE castles
 // Restricted zones - configured by 'restricted <number>' mapflag
 // 32   - restricted in zone 1
 // 64   - restricted in zone 2
@@ -23,3 +24,18 @@
 // Example:
 // SC_ENDURE,4   // Endure status will be removed when the player enters GvG and WoE Castle maps; Also cannot be inflicted again.
 
+//----------------------------------------------------------------------------
+// Disabled/Removed statuses in WoE:TE Castles (16)
+//----------------------------------------------------------------------------
+SC_ENDURE,16
+SC_SAVAGE_STEAK,16
+SC_COCKTAIL_WARG_BLOOD,16
+SC_MINOR_BBQ,16
+SC_SIROMA_ICE_TEA,16
+SC_DROCERA_HERB_STEAMED,16
+SC_PUTTI_TAILS_NOODLES,16
+SC_STOMACHACHE,16
+SC_VITATA_500,16
+SC_EXTRACT_SALAMINE_JUICE,16
+// !TODO: All 3rd Class skill's effects
+SC_SECRAMENT,16

+ 16 - 0
doc/mapflags.txt

@@ -170,6 +170,16 @@ Disables certain items and skills on a map through a specified zone number. The
 located in 'db/(pre-)re/item_noequip.txt' and 'db/(pre-)re/skill_nocast_db.txt', both of which
 contain explanations and examples of how this mapflag is used.
 
+Restricted Zones:
+1 - Aldebaran Turbo Track
+2 - Jail
+3 - Izlude Battle Arena
+4 - WoE:SE Maps
+5 - Sealed Shrine
+6 - Instances: Endless Tower, Orc's Memory, Nidhoggr's Instance
+7 - Towns
+8 - WOE:TE Dungeons
+
 ---------------------------------------
 
 *monster_noteleport
@@ -264,6 +274,12 @@ Enables Guild vs. Guild mode on a map and applies the corresponding damage adjus
 
 ---------------------------------------
 
+*gvg_te_castle
+
+Used to determines map is WOE:TE area. Special restrcitions are apllied.
+
+---------------------------------------
+
 *battleground	{<type>}
 
 Enables Battlegrounds on a map and applies the corresponding damage adjustments.

+ 1 - 0
npc/mapflag/gvg.txt

@@ -12,6 +12,7 @@
 //= gvg: Turns on GvG mode.
 //= gvg_castle: Describes castle maps for WoE.
 //= gvg_dungeon: Describes dungeon maps for WoE.
+//= gvg_te_castle: Describes castle maps for WoE:TE.
 //===== Additional Comments: ================================= 
 //= 1.1 Added Novice Guild Castles.
 //= 1.2 Updated with new meanings of gvg and gvg_castle.

+ 13 - 12
npc/re/mapflag/gvg.txt

@@ -12,22 +12,11 @@
 //= gvg: Turns on GvG mode.
 //= gvg_castle: Describes castle maps for WoE.
 //= gvg_dungeon: Describes dungeon maps for WoE.
+//= gvg_te_castle: Describes castle maps for WoE:TE.
 //===== Additional Comments: ================================= 
 //= 1.0 Renewal split. [Euphy]
 //============================================================
 
-// Guild Castles ==========
-te_aldecas1	mapflag	gvg_castle
-te_aldecas2	mapflag	gvg_castle
-te_aldecas3	mapflag	gvg_castle
-te_aldecas4	mapflag	gvg_castle
-te_aldecas5	mapflag	gvg_castle
-te_prtcas01	mapflag	gvg_castle
-te_prtcas02	mapflag	gvg_castle
-te_prtcas03	mapflag	gvg_castle
-te_prtcas04	mapflag	gvg_castle
-te_prtcas05	mapflag	gvg_castle
-
 // Guild Dungeons =========
 gld2_ald	mapflag	gvg_dungeon
 gld2_gef	mapflag	gvg_dungeon
@@ -35,3 +24,15 @@ gld2_pay	mapflag	gvg_dungeon
 gld2_prt	mapflag	gvg_dungeon
 teg_dun01	mapflag	gvg_dungeon
 teg_dun02	mapflag	gvg_dungeon
+
+// WOE:Training Edition Castles =====
+te_prtcas01	mapflag	gvg_te_castle
+te_prtcas02	mapflag	gvg_te_castle
+te_prtcas03	mapflag	gvg_te_castle
+te_prtcas04	mapflag	gvg_te_castle
+te_prtcas05	mapflag	gvg_te_castle
+te_aldecas1	mapflag	gvg_te_castle
+te_aldecas2	mapflag	gvg_te_castle
+te_aldecas3	mapflag	gvg_te_castle
+te_aldecas4	mapflag	gvg_te_castle
+te_aldecas5	mapflag	gvg_te_castle

+ 12 - 0
npc/re/mapflag/nobranch.txt

@@ -91,3 +91,15 @@ izlude_a	mapflag	nobranch
 izlude_b	mapflag	nobranch
 izlude_c	mapflag	nobranch
 izlude_d	mapflag	nobranch
+
+// WOE:TE Maps ===================
+te_prtcas01	mapflag	nobranch
+te_prtcas02	mapflag	nobranch
+te_prtcas03	mapflag	nobranch
+te_prtcas04	mapflag	nobranch
+te_prtcas05	mapflag	nobranch
+te_aldecas1	mapflag	nobranch
+te_aldecas2	mapflag	nobranch
+te_aldecas3	mapflag	nobranch
+te_aldecas4	mapflag	nobranch
+te_aldecas5	mapflag	nobranch

+ 12 - 0
npc/re/mapflag/noicewall.txt

@@ -36,3 +36,15 @@
 
 // Inside Eclage ===========
 1@ecl	mapflag	noicewall
+
+// WOE:TE Maps ===================
+te_prtcas01	mapflag	noicewall
+te_prtcas02	mapflag	noicewall
+te_prtcas03	mapflag	noicewall
+te_prtcas04	mapflag	noicewall
+te_prtcas05	mapflag	noicewall
+te_aldecas1	mapflag	noicewall
+te_aldecas2	mapflag	noicewall
+te_aldecas3	mapflag	noicewall
+te_aldecas4	mapflag	noicewall
+te_aldecas5	mapflag	noicewall

+ 12 - 0
npc/re/mapflag/nomemo.txt

@@ -125,3 +125,15 @@ gl_cas02_	mapflag	nomemo
 1@sara	mapflag	nomemo
 1@gef_in	mapflag	nomemo
 dali	mapflag	nomemo
+
+// WOE:TE Maps ===================
+te_prtcas01	mapflag	nomemo
+te_prtcas02	mapflag	nomemo
+te_prtcas03	mapflag	nomemo
+te_prtcas04	mapflag	nomemo
+te_prtcas05	mapflag	nomemo
+te_aldecas1	mapflag	nomemo
+te_aldecas2	mapflag	nomemo
+te_aldecas3	mapflag	nomemo
+te_aldecas4	mapflag	nomemo
+te_aldecas5	mapflag	nomemo

+ 12 - 0
npc/re/mapflag/noteleport.txt

@@ -96,3 +96,15 @@ gl_cas02_	mapflag	noteleport
 1@gef_in	mapflag	noteleport
 1@gef_in	mapflag	monster_noteleport
 dali	mapflag	noteleport
+
+// WOE:TE Maps ===================
+te_prtcas01	mapflag	noteleport
+te_prtcas02	mapflag	noteleport
+te_prtcas03	mapflag	noteleport
+te_prtcas04	mapflag	noteleport
+te_prtcas05	mapflag	noteleport
+te_aldecas1	mapflag	noteleport
+te_aldecas2	mapflag	noteleport
+te_aldecas3	mapflag	noteleport
+te_aldecas4	mapflag	noteleport
+te_aldecas5	mapflag	noteleport

+ 12 - 0
npc/re/mapflag/nowarpto.txt

@@ -57,3 +57,15 @@ gl_cas02_	mapflag	nowarpto
 1@face	mapflag	nowarpto
 1@sara	mapflag	nowarpto
 1@gef_in	mapflag	nowarpto
+
+// WOE:TE Maps ===================
+te_prtcas01	mapflag	nowarpto
+te_prtcas02	mapflag	nowarpto
+te_prtcas03	mapflag	nowarpto
+te_prtcas04	mapflag	nowarpto
+te_prtcas05	mapflag	nowarpto
+te_aldecas1	mapflag	nowarpto
+te_aldecas2	mapflag	nowarpto
+te_aldecas3	mapflag	nowarpto
+te_aldecas4	mapflag	nowarpto
+te_aldecas5	mapflag	nowarpto

+ 38 - 0
npc/re/mapflag/restricted.txt

@@ -37,3 +37,41 @@ izlude_d	mapflag	restricted	7
 malangdo	mapflag	restricted	7
 malaya	mapflag	restricted	7
 mora	mapflag	restricted	7
+
+// Restricted maps for WOE:TE Items ==
+teg_dun01	mapflag	restricted	8
+teg_dun02	mapflag	restricted	8
+//aldeg_cas01	mapflag	restricted	8
+//aldeg_cas02	mapflag	restricted	8
+//aldeg_cas03	mapflag	restricted	8
+//aldeg_cas04	mapflag	restricted	8
+//aldeg_cas05	mapflag	restricted	8
+//gefg_cas01	mapflag	restricted	8
+//gefg_cas02	mapflag	restricted	8
+//gefg_cas03	mapflag	restricted	8
+//gefg_cas04	mapflag	restricted	8
+//gefg_cas05	mapflag	restricted	8
+//payg_cas01	mapflag	restricted	8
+//payg_cas02	mapflag	restricted	8
+//payg_cas03	mapflag	restricted	8
+//payg_cas04	mapflag	restricted	8
+//payg_cas05	mapflag	restricted	8
+//prtg_cas01	mapflag	restricted	8
+//prtg_cas02	mapflag	restricted	8
+//prtg_cas03	mapflag	restricted	8
+//prtg_cas04	mapflag	restricted	8
+//prtg_cas05	mapflag	restricted	8
+//schg_cas01	mapflag	restricted	8
+//schg_cas02	mapflag	restricted	8
+//schg_cas03	mapflag	restricted	8
+//schg_cas04	mapflag	restricted	8
+//schg_cas05	mapflag	restricted	8
+//arug_cas01	mapflag	restricted	8
+//arug_cas02	mapflag	restricted	8
+//arug_cas03	mapflag	restricted	8
+//arug_cas04	mapflag	restricted	8
+//arug_cas05	mapflag	restricted	8
+//gld2_ald	mapflag	restricted	8
+//gld2_gef	mapflag	restricted	8
+//gld2_pay	mapflag	restricted	8
+//gld2_prt	mapflag	restricted	8

+ 3 - 3
npc/re/woe_te/main_TE.txt

@@ -14,7 +14,7 @@
 //============================================================
 
 function	script	CanParticipatewoeTE	{
-	return ( (eaclass()&EAJL_THIRD || Class == JOB_KAGEROU || Class == JOB_OBORO || Class == JOB_REBELLION) ? 0 : 1 );
+	return canParticipateSiegeTE();
 }
 
 -	script	Manager_TE	-1,{
@@ -116,7 +116,7 @@ OnAgitStart3:
 	if (.@map$ == "") end;
 	if (agitcheck3()) {
 		maprespawnguildid .@map$, getcastledata(.@map$,1),6;// warp all non-guild members and remove monsters (like woe fe)
-		gvgon .@map$;
+		gvgon3 .@map$;
 		donpcevent strnpcinfo(0)+"::OnEmpSpawn";
 		callsub S_Message,"OnCommandOn";
 	}
@@ -125,7 +125,7 @@ OnAgitStart3:
 OnAgitEnd3:
 	.@map$ = strnpcinfo(4);
 	if (.@map$ == "") end;
-	gvgoff .@map$;
+	gvgoff3 .@map$;
 	if (getcastledata(.@map$,1))
 		killmonster .@map$, strnpcinfo(0) +"::OnAgitBreak";
 	callsub S_Message,"OnReset";

+ 0 - 4
npc/re/woe_te/te_goditem_alde1.txt

@@ -13,13 +13,9 @@ te_aldecas1,226,34,3	script	Blacksmith Cano#tegod01	4_M_RACHMAN1,{
 		mes "Please lighten your load and try again.";
 		close;
	}
 	// .@time_check = OpenHour_SiegeMode 3 14400
-	// .@siege_check = CheckSiegeTime 3
-
-	// .@time_check = OpenHour_SiegeMode 3 14400
 
 	.@guild_id = getcastledata( "te_aldecas1",1 );
 	.@economy = getcastledata("te_aldecas1",2);
-
 	.@npc_name$ = "Cano";
 
 	mes "["+ .@npc_name$ +"]";

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

@@ -13,7 +13,6 @@ te_prtcas01,204,204,3	script	Blacksmith Kai#tegod01	4_M_RACHMAN2,{
 		mes "Please lighten your load and try again.";
 		close;
	}
 	// .@time_check = OpenHour_SiegeMode 3 14400
-	// var .@siege_check = CheckSiegeTime 3
 
 	.@guild_id = getcastledata( "te_prtcas01",1 );
 	.@economy = getcastledata( "te_prtcas01",2 );

+ 7 - 2
src/map/atcommand.c

@@ -4072,6 +4072,10 @@ ACMD_FUNC(mapinfo) {
 		strcat(atcmd_output, " GvG Dungeon |");
 	if (map[m_id].flag.gvg_castle)
 		strcat(atcmd_output, " GvG Castle |");
+	if (map[m_id].flag.gvg_te)
+		strcat(atcmd_output, " GvG TE |");
+	if (map[m_id].flag.gvg_te_castle)
+		strcat(atcmd_output, " GvG TE Castle |");
 	if (map[m_id].flag.gvg_noparty)
 		strcat(atcmd_output, " NoParty |");
 	clif_displaymessage(fd, atcmd_output);
@@ -8060,7 +8064,7 @@ ACMD_FUNC(mapflag) {
 		checkflag(nodrop);				checkflag(novending);			checkflag(loadevent);			checkflag(nochat);
 		checkflag(partylock);			checkflag(guildlock);			checkflag(reset);				checkflag(chmautojoin);
 		checkflag(nousecart);			checkflag(noitemconsumption);	checkflag(nosumstarmiracle);	checkflag(nomineeffect);
-		checkflag(nolockon);			checkflag(notomb);
+		checkflag(nolockon);			checkflag(notomb);				checkflag(gvg_te);				checkflag(gvg_te_castle);
 #ifdef ADJUST_SKILL_DAMAGE
 		checkflag(skill_damage);
 #endif
@@ -8084,7 +8088,7 @@ ACMD_FUNC(mapflag) {
 	setflag(nodrop);			setflag(novending);			setflag(loadevent);				setflag(nochat);
 	setflag(partylock);			setflag(guildlock);			setflag(reset);					setflag(chmautojoin);
 	setflag(nousecart);			setflag(noitemconsumption);	setflag(nosumstarmiracle);		setflag(nomineeffect);
-	setflag(nolockon);			setflag(notomb);
+	setflag(nolockon);			setflag(notomb);			setflag(gvg_te);				setflag(gvg_te_castle);
 #ifdef ADJUST_SKILL_DAMAGE
 	setflag(skill_damage);
 #endif
@@ -8100,6 +8104,7 @@ ACMD_FUNC(mapflag) {
 	clif_displaymessage(sd->fd,"fog, fireworks, sakura, leaves, nogo, nobaseexp, nojobexp, nomobloot, nomvploot,");
 	clif_displaymessage(sd->fd,"nightenabled, restricted, nodrop, novending, loadevent, nochat, partylock, guildlock,");
 	clif_displaymessage(sd->fd,"reset, chmautojoin, nousecart, noitemconsumption, nosumstarmiracle, nolockon, notomb");
+	clif_displaymessage(sd->fd,"gvg_te, gvg_te_castle");
 #ifdef ADJUST_SKILL_DAMAGE
 	clif_displaymessage(sd->fd,"skill_damage");
 #endif

+ 1 - 1
src/map/guild.c

@@ -1511,7 +1511,7 @@ int guild_reply_reqalliance(struct map_session_data *sd,uint32 account_id,int fl
 int guild_delalliance(struct map_session_data *sd,int guild_id,int flag) {
 	nullpo_ret(sd);
 
-	if(is_agit_start())	{	// Disable alliance breaking during woe [Valaris]
+	if(is_agit_start()) {	// Disable alliance breaking during woe [Valaris]
 		clif_displaymessage(sd->fd,msg_txt(sd,677)); //"Alliances cannot be broken during Guild Wars!"
 		return 0;
 	}	// end addition [Valaris]

+ 3 - 3
src/map/itemdb.c

@@ -1549,11 +1549,11 @@ static int itemdb_read_sqldb(void) {
 bool itemdb_isNoEquip(struct item_data *id, uint16 m) {
 	if (!id->flag.no_equip)
 		return false;
-	/* on restricted maps the item is consumed but the effect is not used */
-	if ((!map_flag_vs(m) && id->flag.no_equip&1) || // Normal
+	if ((!map_flag_vs2(m) && id->flag.no_equip&1) || // Normal
 		(map[m].flag.pvp && id->flag.no_equip&2) || // PVP
-		(map_flag_gvg(m) && id->flag.no_equip&4) || // GVG
+		(map_flag_gvg2_no_te(m) && id->flag.no_equip&4) || // GVG
 		(map[m].flag.battleground && id->flag.no_equip&8) || // Battleground
+		(map_flag_gvg2_te(m) && id->flag.no_equip&16) || // WOE:TE
 		(map[m].flag.restricted && id->flag.no_equip&(8*map[m].zone)) // Zone restriction
 		)
 		return true;

+ 20 - 8
src/map/map.h

@@ -106,6 +106,9 @@ enum MOBID {
 	MOBID_S_HORNET			= 2158,
 	MOBID_S_GIANT_HORNET,
 	MOBID_S_LUCIOLA_VESPA,
+	// TE Treasure Boxes
+	MOBID_TREA_TE0 = 2452,
+	MOBID_TREA_TE10 = 2462,
 };
 
 //The following system marks a different job ID system used by the map server,
@@ -272,14 +275,21 @@ enum e_mapid {
 
 #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 || agit2_flag || agit3_flag) && map[m].flag.gvg_castle) || map[m].flag.battleground)
-//Specifies maps that have special GvG/WoE restrictions
-#define map_flag_gvg(m) (map[m].flag.gvg || ((agit_flag || agit2_flag || agit3_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
-#define map_flag_ks(m) (map[m].flag.town || map[m].flag.pvp || map[m].flag.gvg || map[m].flag.battleground)
+/// 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 || agit2_flag) && map[m].flag.gvg_castle) || map[m].flag.gvg_te || (agit3_flag && map[m].flag.gvg_te_castle) || map[m].flag.battleground)
+/// Versus map: PVP, BG, GVG, GVG Dungeons, and GVG Castles (regardless of agit_flag status)
+#define map_flag_vs2(m) (map[m].flag.pvp || map[m].flag.gvg_dungeon || map[m].flag.gvg || map[m].flag.gvg_castle || map[m].flag.gvg_te || map[m].flag.gvg_te_castle || map[m].flag.battleground)
+/// Specifies maps that have special GvG/WoE restrictions
+#define map_flag_gvg(m) (map[m].flag.gvg || ((agit_flag || agit2_flag) && map[m].flag.gvg_castle) || map[m].flag.gvg_te || (agit3_flag && map[m].flag.gvg_te_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_te || map[m].flag.gvg_castle || map[m].flag.gvg_te_castle)
+/// No Kill Steal Protection
+#define map_flag_ks(m) (map[m].flag.town || map[m].flag.pvp || map[m].flag.gvg || map[m].flag.gvg_te || map[m].flag.battleground)
+
+/// WOE:TE Maps (regardless of agit_flag status) [Cydh]
+#define map_flag_gvg2_te(m) (map[m].flag.gvg_te || map[m].flag.gvg_te_castle)
+/// Check if map is GVG maps exclusion for item, skill, and status restriction check (regardless of agit_flag status) [Cydh]
+#define map_flag_gvg2_no_te(m) (map[m].flag.gvg || map[m].flag.gvg_castle)
 
 //This stackable implementation does not means a BL can be more than one type at a time, but it's
 //meant to make it easier to check for multiple types at a time on invocations such as map_foreach* calls [Skotlex]
@@ -710,6 +720,8 @@ struct map_data {
 		unsigned nomineeffect : 1; //allow /mineeffect
 		unsigned nolockon : 1;
 		unsigned notomb : 1;
+		unsigned gvg_te : 1; // GVG WOE:TE. This was added as purpose to change 'gvg' for GVG TE, so item_noequp, skill_nocast exlude GVG TE maps from 'gvg' (flag &4)
+		unsigned gvg_te_castle : 1; // GVG WOE:TE Castle
 #ifdef ADJUST_SKILL_DAMAGE
 		unsigned skill_damage : 1;
 #endif

+ 18 - 2
src/map/mob.c

@@ -3505,6 +3505,21 @@ int mob_is_clone(int mob_id)
 	return mob_id;
 }
 
+/**
+ * Previously, using skill_nocast with flag 16
+ * @param skill_id
+ * @return True:If disabled, False:If enabled
+ * @!TODO : Move this hardcodes!
+ **/
+static bool mob_clone_disabled_skills(uint16 skill_id) {
+	switch (skill_id) {
+		case PR_TURNUNDEAD:
+		case PR_MAGNUS:
+			return true;
+	}
+	return false;
+}
+
 //Flag values:
 //&1: Set special ai (fight mobs, not players)
 //If mode is not passed, a default aggressive mode is used.
@@ -3569,7 +3584,7 @@ int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, cons
 		uint16 sk_idx = 0;
 		if (!skill_id || !(sk_idx = skill_get_index(skill_id)) || sd->status.skill[sk_idx].lv < 1 ||
 			(skill_get_inf2(skill_id)&(INF2_WEDDING_SKILL|INF2_GUILD_SKILL)) ||
-			skill_get_nocast(skill_id)&16
+			mob_clone_disabled_skills(skill_id)
 		)
 			continue;
 		//Normal aggressive mob, disable skills that cannot help them fight
@@ -4740,7 +4755,8 @@ static void mob_drop_ratio_adjust(void){
 			}
 
 			// Treasure box drop rates [Skotlex]
-			if( ( mob_id >= MOBID_TREAS01 && mob_id <= MOBID_TREAS40 ) || ( mob_id >= MOBID_TREAS41 && mob_id <= MOBID_TREAS49 ) ){
+			// !TODO: Can we do something better than this?
+			if( ( mob_id >= MOBID_TREAS01 && mob_id <= MOBID_TREAS40 ) || ( mob_id >= MOBID_TREAS41 && mob_id <= MOBID_TREAS49 ) || ( mob_id >= MOBID_TREA_TE0 && mob_id <= MOBID_TREA_TE10 ) ){
 				is_treasurechest = true;
 
 				rate_adjust = battle_config.item_rate_treasure;

+ 18 - 0
src/map/npc.c

@@ -3907,6 +3907,24 @@ static const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, con
 		map[m].flag.gvg_castle=state;
 		if (state) map[m].flag.pvp=0;
 	}
+	else if (!strcmpi(w3,"gvg_te")) {
+		map[m].flag.gvg_te = state;
+		if( state && map[m].flag.pvp ) {
+			map[m].flag.pvp = 0;
+			ShowWarning("npc_parse_mapflag: You can't set PvP and GvG flags for the same map! Removing PvP flag from %s (file '%s', line '%d').\n", map[m].name, filepath, strline(buffer,start-buffer));
+		}
+		if( state && map[m].flag.battleground ) {
+			map[m].flag.battleground = 0;
+			ShowWarning("npc_parse_mapflag: You can't set GvG and BattleGround flags for the same map! Removing BattleGround flag from %s (file '%s', line '%d').\n", map[m].name, filepath, strline(buffer,start-buffer));
+		}
+	}
+	else if (!strcmpi(w3,"gvg_te_castle")) {
+		map[m].flag.gvg_te_castle = state;
+		if (state) {
+			map[m].flag.gvg_castle = 0;
+			map[m].flag.pvp = 0;
+		}
+	}
 	else if (!strcmpi(w3,"battleground")) {
 		if( state ) {
 			if( sscanf(w4, "%11d", &state) == 1 )

+ 18 - 0
src/map/pc.c

@@ -11893,6 +11893,24 @@ void pc_show_questinfo_reinit(struct map_session_data *sd) {
 #endif
 }
 
+/**
+ * Check if player can participate in WOE:TE
+ * @param sd
+ * @return True:If allowed, False:Doesn't
+ **/
+bool pc_canParticipateSiegeTE(uint32 mapid) {
+
+	if (mapid&JOBL_THIRD)
+		return false;
+
+	switch (mapid) {
+		case MAPID_REBELLION:
+		case MAPID_KAGEROUOBORO:
+			return false;
+	}
+
+	return true;
+}
 
 /*==========================================
  * pc Init/Terminate

+ 2 - 0
src/map/pc.h

@@ -1220,6 +1220,8 @@ void pc_validate_skill(struct map_session_data *sd);
 void pc_show_questinfo(struct map_session_data *sd);
 void pc_show_questinfo_reinit(struct map_session_data *sd);
 
+bool pc_canParticipateSiegeTE(uint32 mapid);
+
 #if defined(RENEWAL_DROP) || defined(RENEWAL_EXP)
 int pc_level_penalty_mod(struct map_session_data *sd, int mob_level, uint32 mob_class, enum e_mode mode, int type);
 #endif

+ 73 - 11
src/map/script.c

@@ -361,7 +361,9 @@ enum {
 	MF_NOMINEEFFECT,
 	MF_NOLOCKON,
 	MF_NOTOMB,
-	MF_SKILL_DAMAGE	//60
+	MF_SKILL_DAMAGE,	//60
+	MF_GVG_TE_CASTLE,
+	MF_GVG_TE_DUNGEON,
 };
 
 const char* script_op2name(int op)
@@ -11797,6 +11799,7 @@ BUILDIN_FUNC(getmapflag)
 			case MF_NOMINEEFFECT:		script_pushint(st,map[m].flag.nomineeffect); break;
 			case MF_NOLOCKON:			script_pushint(st,map[m].flag.nolockon); break;
 			case MF_NOTOMB:				script_pushint(st,map[m].flag.notomb); break;
+			case MF_GVG_TE_CASTLE:		script_pushint(st,map[m].flag.gvg_te_castle); break;
 #ifdef ADJUST_SKILL_DAMAGE
 			case MF_SKILL_DAMAGE:
 				{
@@ -11920,6 +11923,7 @@ BUILDIN_FUNC(setmapflag)
 			case MF_NOMINEEFFECT:		map[m].flag.nomineeffect = 1 ; break;
 			case MF_NOLOCKON:			map[m].flag.nolockon = 1 ; break;
 			case MF_NOTOMB:				map[m].flag.notomb = 1; break;
+			case MF_GVG_TE_CASTLE:		map[m].flag.gvg_te_castle = 1; break;
 #ifdef ADJUST_SKILL_DAMAGE
 			case MF_SKILL_DAMAGE:
 				{
@@ -12031,6 +12035,7 @@ BUILDIN_FUNC(removemapflag)
 			case MF_NOMINEEFFECT:		map[m].flag.nomineeffect = 0 ; break;
 			case MF_NOLOCKON:			map[m].flag.nolockon = 0 ; break;
 			case MF_NOTOMB:				map[m].flag.notomb = 0; break;
+			case MF_GVG_TE_CASTLE:		map[m].flag.gvg_te_castle = 0; break;
 #ifdef ADJUST_SKILL_DAMAGE
 			case MF_SKILL_DAMAGE:
 				{
@@ -12154,6 +12159,43 @@ BUILDIN_FUNC(gvgoff)
 	}
 	return SCRIPT_CMD_SUCCESS;
 }
+
+BUILDIN_FUNC(gvgon3)
+{
+	int16 m;
+	const char *str;
+	struct block_list bl;
+
+	str = script_getstr(st,2);
+	m = map_mapname2mapid(str);
+	if (m >= 0 && !map[m].flag.gvg_te) {
+		map[m].flag.gvg_te = 1;
+		clif_map_property_mapall(m, MAPPROPERTY_AGITZONE);
+		bl.type = BL_NUL;
+		bl.m = m;
+		clif_maptypeproperty2(&bl,ALL_SAMEMAP);
+	}
+	return SCRIPT_CMD_SUCCESS;
+}
+
+BUILDIN_FUNC(gvgoff3)
+{
+	int16 m;
+	const char *str;
+
+	str = script_getstr(st,2);
+	m = map_mapname2mapid(str);
+	if (m >= 0 && map[m].flag.gvg_te) {
+		struct block_list bl;
+		map[m].flag.gvg_te = 0;
+		clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
+		bl.type = BL_NUL;
+		bl.m = m;
+		clif_maptypeproperty2(&bl,ALL_SAMEMAP);
+	}
+	return SCRIPT_CMD_SUCCESS;
+}
+
 /*==========================================
  *	Shows an emoticon on top of the player/npc
  *	emotion emotion#, <target: 0 - NPC, 1 - PC>, <NPC/PC name>
@@ -12309,12 +12351,12 @@ BUILDIN_FUNC(agitend2)
  */
 BUILDIN_FUNC(agitstart3)
 {
-    if (agit3_flag)
+	if (agit3_flag)
 		return SCRIPT_CMD_SUCCESS;// AgitTE already Started.
-    agit3_flag = true;
-    guild_agit3_start();
+	agit3_flag = true;
+	guild_agit3_start();
 
-    return SCRIPT_CMD_SUCCESS;
+	return SCRIPT_CMD_SUCCESS;
 }
 
 /**
@@ -12323,12 +12365,12 @@ BUILDIN_FUNC(agitstart3)
  */
 BUILDIN_FUNC(agitend3)
 {
-    if (!agit3_flag)
+	if (!agit3_flag)
 		return SCRIPT_CMD_SUCCESS;// AgitTE already Ended.
-    agit3_flag = false;
-    guild_agit3_end();
+	agit3_flag = false;
+	guild_agit3_end();
 
-    return SCRIPT_CMD_SUCCESS;
+	return SCRIPT_CMD_SUCCESS;
 }
 
 /**
@@ -12357,8 +12399,8 @@ BUILDIN_FUNC(agitcheck2)
  */
 BUILDIN_FUNC(agitcheck3)
 {
-    script_pushint(st, agit3_flag);
-    return SCRIPT_CMD_SUCCESS;
+	script_pushint(st, agit3_flag);
+	return SCRIPT_CMD_SUCCESS;
 }
 
 /// Sets the guild_id of this npc.
@@ -21172,6 +21214,23 @@ BUILDIN_FUNC(getguildalliance)
 	return SCRIPT_CMD_SUCCESS;
 }
 
+/**
+ * canParticipateSiegeTE([<char_id>]);
+ * Check if player can participate in WOE:TE
+ * @param char_id Player's CharID (optional)
+ **/
+BUILDIN_FUNC(canParticipateSiegeTE) {
+	TBL_PC *sd = NULL;
+
+	if (!script_charid2sd(2, sd)) {
+		script_pushint(st, 0);
+		return SCRIPT_CMD_FAILURE;
+	}
+
+	script_pushint(st, pc_canParticipateSiegeTE(sd->class_) ? 1 : 0);
+	return SCRIPT_CMD_SUCCESS;
+}
+
 #include "../custom/script.inc"
 
 // declarations that were supposed to be exported from npc_chat.c
@@ -21744,6 +21803,9 @@ struct script_function buildin_func[] = {
 	BUILDIN_DEF(agitstart3,""),
 	BUILDIN_DEF(agitend3,""),
 	BUILDIN_DEF(agitcheck3,""),
+	BUILDIN_DEF(gvgon3,"s"),
+	BUILDIN_DEF(gvgoff3,"s"),
+	BUILDIN_DEF(canParticipateSiegeTE,"?"),
 
 #include "../custom/script_def.inc"
 

+ 17 - 7
src/map/skill.c

@@ -605,7 +605,10 @@ static int8 skill_isCopyable(struct map_session_data *sd, uint16 skill_idx) {
 bool skill_isNotOk(uint16 skill_id, struct map_session_data *sd)
 {
 	int16 idx,m;
+	uint32 skill_nocast = 0;
+
 	nullpo_retr(1,sd);
+
 	m = sd->bl.m;
 	idx = skill_get_index(skill_id);
 
@@ -642,12 +645,15 @@ bool skill_isNotOk(uint16 skill_id, struct map_session_data *sd)
 	 */
 	if( sd->skillitem == skill_id )
 		return false;
+
+	skill_nocast = skill_get_nocast(skill_id);
 	// Check skill restrictions [Celest]
-	if( (!map_flag_vs(m) && skill_get_nocast (skill_id) & 1) ||
-		(map[m].flag.pvp && skill_get_nocast (skill_id) & 2) ||
-		(map_flag_gvg(m) && skill_get_nocast (skill_id) & 4) ||
-		(map[m].flag.battleground && skill_get_nocast (skill_id) & 8) ||
-		(map[m].flag.restricted && map[m].zone && skill_get_nocast (skill_id) & (8*map[m].zone)) ){
+	if( (!map_flag_vs2(m) && skill_nocast&1) ||
+		(map[m].flag.pvp && skill_nocast&2) ||
+		(map_flag_gvg2_no_te(m) && skill_nocast&4) ||
+		(map[m].flag.battleground && skill_nocast&8) ||
+		(map_flag_gvg2_te(m) && skill_nocast&16) || // WOE:TE
+		(map[m].flag.restricted && map[m].zone && skill_nocast&(8*map[m].zone)) ){
 			clif_msg(sd, SKILL_CANT_USE_AREA); // This skill cannot be used within this area
 			return true;
 	}
@@ -721,8 +727,8 @@ bool skill_isNotOk(uint16 skill_id, struct map_session_data *sd)
 		case GD_ITEMEMERGENCYCALL:
 			if (
 				!(battle_config.emergency_call&((is_agit_start())?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)
+				!(battle_config.emergency_call&(map_flag_gvg2(m)?8:4)) ||
+				(battle_config.emergency_call&16 && map[m].flag.nowarpto && !(map[m].flag.gvg_castle || map[m].flag.gvg_te_castle))
 			)	{
 				clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
 				return true;
@@ -8432,6 +8438,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 			int8 dy[9] = { 0, 0, 1,-1, 1,-1,-1, 1, 0};
 			uint8 j = 0, calls = 0, called = 0;
 			struct guild *g;
+			bool is_te_castle = map_flag_gvg2_te(src->m);
+
 			// i don't know if it actually summons in a circle, but oh well. ;P
 			g = sd?sd->guild:guild_search(status_get_guild_id(src));
 			if (!g)
@@ -8452,6 +8460,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 				if ((dstsd = g->member[i].sd) != NULL && sd != dstsd && !dstsd->state.autotrade && !pc_isdead(dstsd)) {
 					if (map[dstsd->bl.m].flag.nowarp && !map_flag_gvg2(dstsd->bl.m))
 						continue;
+					if (is_te_castle && !pc_canParticipateSiegeTE(dstsd->class_))
+						continue;
 					if(map_getcell(src->m,src->x+dx[j],src->y+dy[j],CELL_CHKNOREACH))
 						dx[j] = dy[j] = 0;
 					if (!pc_setpos(dstsd, map_id2index(src->m), src->x+dx[j], src->y+dy[j], CLR_RESPAWN))

+ 9 - 6
src/map/status.c

@@ -88,8 +88,8 @@ static int status_get_hpbonus(struct block_list *bl, enum e_status_bonus type);
 static int status_get_spbonus(struct block_list *bl, enum e_status_bonus type);
 static unsigned int status_calc_maxhpsp_pc(struct map_session_data* sd, unsigned int stat, bool isHP);
 
-static bool status_change_isDisabledOnMap_(sc_type type, bool mapIsVS, bool mapIsPVP, bool mapIsGVG, bool mapIsBG, unsigned int mapZone);
-#define status_change_isDisabledOnMap(type, m) ( status_change_isDisabledOnMap_((type), map_flag_vs((m)), map[(m)].flag.pvp, map_flag_gvg((m)), map[(m)].flag.battleground, map[(m)].zone << 3) )
+static bool status_change_isDisabledOnMap_(sc_type type, bool mapIsVS, bool mapIsPVP, bool mapIsGVG, bool mapIsBG, unsigned int mapZone, bool mapIsTE);
+#define status_change_isDisabledOnMap(type, m) ( status_change_isDisabledOnMap_((type), map_flag_vs2((m)), map[(m)].flag.pvp, map_flag_gvg2_no_te((m)), map[(m)].flag.battleground, map[(m)].zone << 3, map_flag_gvg2_te((m))) )
 
 /**
  * Returns the status change associated with a skill.
@@ -13325,9 +13325,10 @@ int status_get_refine_chance(enum refine_type wlv, int refine)
  * @param mapIsGVG: If the map is a map_flag_gvg type
  * @param mapIsBG: If the map is a Battleground type
  * @param mapZone: Map Zone type
+ * @param mapIsTE: If the map us WOE TE
  * @return True - SC disabled on map; False - SC not disabled on map/Invalid SC
  */
-static bool status_change_isDisabledOnMap_(sc_type type, bool mapIsVS, bool mapIsPVP, bool mapIsGVG, bool mapIsBG, unsigned int mapZone)
+static bool status_change_isDisabledOnMap_(sc_type type, bool mapIsVS, bool mapIsPVP, bool mapIsGVG, bool mapIsBG, unsigned int mapZone, bool mapIsTE)
 {
 	if (type <= SC_NONE || type >= SC_MAX)
 		return false;
@@ -13336,6 +13337,7 @@ static bool status_change_isDisabledOnMap_(sc_type type, bool mapIsVS, bool mapI
 		(mapIsPVP && SCDisabled[type]&2) ||
 		(mapIsGVG && SCDisabled[type]&4) ||
 		(mapIsBG && SCDisabled[type]&8) ||
+		(mapIsTE && SCDisabled[type]&16) ||
 		(SCDisabled[type]&(mapZone)))
 	{
 		return true;
@@ -13355,17 +13357,18 @@ void status_change_clear_onChangeMap(struct block_list *bl, struct status_change
 
 	if (sc && sc->count) {
 		unsigned short i;
-		bool mapIsVS = map_flag_vs(bl->m);
+		bool mapIsVS = map_flag_vs2(bl->m);
 		bool mapIsPVP = map[bl->m].flag.pvp;
-		bool mapIsGVG = map_flag_gvg(bl->m);
+		bool mapIsGVG = map_flag_gvg2_no_te(bl->m);
 		bool mapIsBG = map[bl->m].flag.battleground;
+		bool mapIsTE = map_flag_gvg2_te(bl->m);
 		unsigned int mapZone = map[bl->m].zone << 3;
 
 		for (i = 0; i < SC_MAX; i++) {
 			if (!sc->data[i] || !SCDisabled[i])
 				continue;
 
-			if (status_change_isDisabledOnMap_((sc_type)i, mapIsVS, mapIsPVP, mapIsGVG, mapIsBG, mapZone))
+			if (status_change_isDisabledOnMap_((sc_type)i, mapIsVS, mapIsPVP, mapIsGVG, mapIsBG, mapZone, mapIsTE))
 				status_change_end(bl, (sc_type)i, INVALID_TIMER);
 		}
 	}