diff options
-rw-r--r-- | db/packet_db.txt | 2 | ||||
-rw-r--r-- | npc/battleground/bg_tierra_01.txt | 336 | ||||
-rw-r--r-- | npc/battleground/bg_tierra_02.txt | 332 | ||||
-rw-r--r-- | src/map/battleground.c | 2 | ||||
-rw-r--r-- | src/map/clif.c | 116 | ||||
-rw-r--r-- | src/map/clif.h | 8 | ||||
-rw-r--r-- | src/map/map.h | 3 | ||||
-rw-r--r-- | src/map/script.c | 53 |
8 files changed, 366 insertions, 486 deletions
diff --git a/db/packet_db.txt b/db/packet_db.txt index 389ae6a6a..6d116a200 100644 --- a/db/packet_db.txt +++ b/db/packet_db.txt @@ -1037,7 +1037,7 @@ packet_ver: 22 0x02d8,10,equiptickbox,6 0x02d9,10 0x02da,3 -0x02db,-1 +0x02db,-1,battlechat,2:4 0x02dc,-1 0x02dd,32 0x02de,6 diff --git a/npc/battleground/bg_tierra_01.txt b/npc/battleground/bg_tierra_01.txt index f12ce6cf9..884f15e17 100644 --- a/npc/battleground/bg_tierra_01.txt +++ b/npc/battleground/bg_tierra_01.txt @@ -32,8 +32,6 @@ OnEnterBG: end;
OnInit:
- disablenpc "Tierra Neutral#lion1";
- disablenpc "Tierra Neutral#eagle1";
disablenpc "Croix Vintenar#tv1";
disablenpc "Guillaume Vintenar#tv1";
disablenpc "Therapist in battle#tv11";
@@ -71,8 +69,14 @@ OnReadyCheck: bg_monster $@TierraBG1_id1,"bat_a01",176,345,"Food Depot",1909,"Tierra_BG1::OnGuillaumeBreak";
bg_monster $@TierraBG1_id2,"bat_a01",167,50,"Food Storage",1910,"Tierra_BG1::OnCroixBreak";
bg_monster 0,"bat_a01",273,204,"Neutrality Flag",1911,"Tierra_BG1::OnNeutralBreak";
- set $@TierraBG1_Base, 0;
+
+ set .Neutral_Base, 0;
set $@TierraBG1_Victory, 0;
+
+ set .Guardian_1, 0;
+ set .Guardian_2, 0;
+ set .Guardian_3, 0;
+
enablenpc "Therapist in battle#tv11";
enablenpc "Therapist in battle#tv12";
disablenpc "Croix Vintenar#tv1";
@@ -80,6 +84,7 @@ OnReadyCheck: // Respawner
donpcevent "#gtv1_respawn::OnBGStart";
donpcevent "#ctv1_respawn::OnBGStart";
+ donpcevent "#ntv1_respawn::OnBGStart";
// Warp Teams
announce "Battleground -- Tierra Valley [80-99] has started!",0,0xFFA500;
bg_warp $@TierraBG1_id1,"bat_a01",353,344;
@@ -94,33 +99,51 @@ OnReadyCheck: end;
OnNeutralBreak:
- if( Bat_Team == 1 )
+ if( getcharid(4) == $@TierraBG1_id1 )
{
mapannounce "bat_a01","Guillaume obtained a neurality banner, so they have an advantage.",1,0x0000FF;
- setnpcdisplay("Tierra Neutral#lion1","Guillaume Base",973);
- enablenpc "Tierra Neutral#lion1";
- bg_monster $@TierraBG1_id1,"bat_a01",28,185,"Guillaume Camp Guardian",1949,"Tierra_BG1::OnGuardian";
- bg_monster $@TierraBG1_id1,"bat_a01",287,203,"Guillaume Camp Guardian",1950,"Tierra_BG1::OnGuardian";
- bg_monster $@TierraBG1_id1,"bat_a01",268,204,"Guillaume Camp Guardian",1949,"Tierra_BG1::OnGuardian";
- bg_monster $@TierraBG1_id1,"bat_a01",280,233,"Guillaume Camp Guardian",1950,"Tierra_BG1::OnGuardian";
+ bg_team_setxy $@TierraBG1_id2,42,16;
+ areawarp "bat_a01",52,208,61,217,"bat_a01",42,16;
}
- else if( Bat_Team == 2 )
+ else if( getcharid(4) == $@TierraBG1_id2 )
{
mapannounce "bat_a01","Croix obtained a neutrality banner, so they have an advantage.",1,0xFF0000;
- setnpcdisplay("Tierra Neutral#eagle1","Croix Base",974);
- enablenpc "Tierra Neutral#eagle1";
- bg_monster $@TierraBG1_id2,"bat_a01",28,185,"Croix Camp Guardian",1949,"Tierra_BG1::OnGuardian";
- bg_monster $@TierraBG1_id2,"bat_a01",287,203,"Croix Camp Guardian",1950,"Tierra_BG1::OnGuardian";
- bg_monster $@TierraBG1_id2,"bat_a01",268,204,"Croix Camp Guardian",1949,"Tierra_BG1::OnGuardian";
- bg_monster $@TierraBG1_id2,"bat_a01",280,233,"Croix Camp Guardian",1950,"Tierra_BG1::OnGuardian";
+ bg_team_setxy $@TierraBG1_id1,50,374;
+ areawarp "bat_a01",52,208,61,217,"bat_a01",50,374;
}
- else end; // Should not happend
- set $@TierraBG1_Base, Bat_Team;
- end;
+ else end;
+
+ set .Neutral_Base, getcharid(4);
+ bg_team_setxy .Neutral_Base,56,212;
+
+ if( .Guardian_1 == 0 )
+ set .Guardian_1, bg_monster(.Neutral_Base,"bat_a01",280,233,"Guardian",1949,"Tierra_BG1::OnGuardian1");
+ else
+ bg_monster_set_team .Guardian_1, .Neutral_Base;
+
+ if( .Guardian_2 == 0 )
+ set .Guardian_2, bg_monster(.Neutral_Base,"bat_a01",287,203,"Guardian",1950,"Tierra_BG1::OnGuardian2");
+ else
+ bg_monster_set_team .Guardian_2, .Neutral_Base;
+
+ if( .Guardian_3 == 0 )
+ set .Guardian_3, bg_monster(.Neutral_Base,"bat_a01",268,204,"Guardian",1949,"Tierra_BG1::OnGuardian3");
+ else
+ bg_monster_set_team .Guardian_3, .Neutral_Base;
-OnGuardian:
+ sleep 10000;
+ if( $@TierraBG1 != 1 ) end;
+
+ if( .Neutral_Base == $@TierraBG1_id1 )
+ bg_monster .Neutral_Base,"bat_a01",273,204,"Guillaume Flag",1912,"Tierra_BG1::OnNeutralBreak";
+ else if( .Neutral_Base == $@TierraBG1_id2 )
+ bg_monster .Neutral_Base,"bat_a01",273,204,"Croix Flag",1913,"Tierra_BG1::OnNeutralBreak";
end;
+OnGuardian1: set .Guardian_1, 0; end;
+OnGuardian2: set .Guardian_2, 0; end;
+OnGuardian3: set .Guardian_3, 0; end;
+
OnGuillaumeBreak:
set $@TierraBG1_Victory, 2;
mapannounce "bat_a01","Croix Vintenar Swandery: We destroyed Guillaume's food storehause. We won that! Wow!",1,0xFF0000;
@@ -152,12 +175,15 @@ OnStop: disablenpc "Therapist in battle#tv12";
donpcevent "#gtv1_respawn::OnBGStop";
donpcevent "#ctv1_respawn::OnBGStop";
+ donpcevent "#ntv1_respawn::OnBGStop";
enablenpc "Croix Vintenar#tv1";
enablenpc "Guillaume Vintenar#tv1";
killmonster "bat_a01","Tierra_BG1::OnGuillaumeBreak";
killmonster "bat_a01","Tierra_BG1::OnCroixBreak";
killmonster "bat_a01","Tierra_BG1::OnNeutralBreak";
- killmonster "bat_a01","Tierra_BG1::OnGuardian";
+ killmonster "bat_a01","Tierra_BG1::OnGuardian1";
+ killmonster "bat_a01","Tierra_BG1::OnGuardian2";
+ killmonster "bat_a01","Tierra_BG1::OnGuardian3";
stopnpctimer;
sleep 3000;
bg_warp $@TierraBG1_id1,"bat_a01",50,374;
@@ -169,11 +195,11 @@ OnStop: OnTimer30000:
if( $@TierraBG1 == 2 )
- mapannounce "bat_a01","Battle of Tierra Gorge will close in 30 seconds!",1,0xFFA500;
+ mapannounce "bat_a01","Battle of Tierra Valley will close in 30 seconds!",1,0xFFA500;
end;
OnTimer50000:
if( $@TierraBG1 == 2 )
- mapannounce "bat_a01","Battle of Tierra Gorge will close in 10 seconds!",1,0xFFA500;
+ mapannounce "bat_a01","Battle of Tierra Valley will close in 10 seconds!",1,0xFFA500;
end;
OnTimer60000:
@@ -181,20 +207,21 @@ OnTimer60000: end;
OnReset:
stopnpctimer;
- set $@TierraBG1_Base, 0;
- disablenpc "Tierra Neutral#lion1";
- disablenpc "Tierra Neutral#eagle1";
+ set .Neutral_Base, 0;
disablenpc "Croix Vintenar#tv1";
disablenpc "Guillaume Vintenar#tv1";
disablenpc "Therapist in battle#tv11";
disablenpc "Therapist in battle#tv12";
donpcevent "#gtv1_respawn::OnBGStop";
donpcevent "#ctv1_respawn::OnBGStop";
+ donpcevent "#ntv1_respawn::OnBGStop";
killmonster "bat_a01","Tierra_BG1::OnGuillaumeBreak";
killmonster "bat_a01","Tierra_BG1::OnCroixBreak";
killmonster "bat_a01","Tierra_BG1::OnNeutralBreak";
- killmonster "bat_a01","Tierra_BG1::OnGuardian";
+ killmonster "bat_a01","Tierra_BG1::OnGuardian1";
+ killmonster "bat_a01","Tierra_BG1::OnGuardian2";
+ killmonster "bat_a01","Tierra_BG1::OnGuardian3";
donpcevent "Guillaume_TV1B::OnDestroy";
donpcevent "Croix_TV1B::OnDestroy";
@@ -224,12 +251,6 @@ bat_a01 mapflag noreturn bat_a01 mapflag nobranch
bat_a01 mapflag nopenalty
-// Neutral Point Flags
-// *********************************************************************
-
-bat_a01,273,204,1 script Tierra Neutral#lion1 973,{ end; }
-bat_a01,273,204,1 script Tierra Neutral#eagle1 974,{ end; }
-
// Other Flags
// *********************************************************************
@@ -258,106 +279,24 @@ bat_a01,119,336,1 duplicate(Guillaume camp#bat) Guillaume camp#bat18 973 end;
OnBuild:
- bg_monster $@TierraBG1_id1,"bat_a01",160,380,"Barricade",1906,"Guillaume_TV1B::OnWall1";
- bg_monster $@TierraBG1_id1,"bat_a01",161,380,"Barricade",1906,"Guillaume_TV1B::OnWall1";
- bg_monster $@TierraBG1_id1,"bat_a01",162,380,"Barricade",1906,"Guillaume_TV1B::OnWall1";
- bg_monster $@TierraBG1_id1,"bat_a01",163,380,"Barricade",1906,"Guillaume_TV1B::OnWall1";
- setwall "bat_a01",160,380,4,6,0,"bat_a01_g1";
-
- bg_monster $@TierraBG1_id1,"bat_a01",160,363,"Barricade",1906,"Guillaume_TV1B::OnWall2";
- bg_monster $@TierraBG1_id1,"bat_a01",161,363,"Barricade",1906,"Guillaume_TV1B::OnWall2";
- bg_monster $@TierraBG1_id1,"bat_a01",162,363,"Barricade",1906,"Guillaume_TV1B::OnWall2";
- setwall "bat_a01",160,363,3,6,0,"bat_a01_g2";
-
- bg_monster $@TierraBG1_id1,"bat_a01",119,344,"Barricade",1906,"Guillaume_TV1B::OnWall3";
- bg_monster $@TierraBG1_id1,"bat_a01",119,345,"Barricade",1906,"Guillaume_TV1B::OnWall3";
- bg_monster $@TierraBG1_id1,"bat_a01",119,346,"Barricade",1906,"Guillaume_TV1B::OnWall3";
- bg_monster $@TierraBG1_id1,"bat_a01",119,347,"Barricade",1906,"Guillaume_TV1B::OnWall3";
- setwall "bat_a01",119,344,4,0,0,"bat_a01_g3";
-
- bg_monster $@TierraBG1_id1,"bat_a01",134,345,"Barricade",1906,"Guillaume_TV1B::OnWall4";
- bg_monster $@TierraBG1_id1,"bat_a01",134,346,"Barricade",1906,"Guillaume_TV1B::OnWall4";
- bg_monster $@TierraBG1_id1,"bat_a01",134,347,"Barricade",1906,"Guillaume_TV1B::OnWall4";
- setwall "bat_a01",134,345,3,0,0,"bat_a01_g4";
-
- bg_monster $@TierraBG1_id1,"bat_a01",159,311,"Barricade",1906,"Guillaume_TV1B::OnWall5";
- bg_monster $@TierraBG1_id1,"bat_a01",160,311,"Barricade",1906,"Guillaume_TV1B::OnWall5";
- bg_monster $@TierraBG1_id1,"bat_a01",161,311,"Barricade",1906,"Guillaume_TV1B::OnWall5";
- bg_monster $@TierraBG1_id1,"bat_a01",162,311,"Barricade",1906,"Guillaume_TV1B::OnWall5";
- setwall "bat_a01",159,311,4,6,0,"bat_a01_g5";
-
- bg_monster $@TierraBG1_id1,"bat_a01",159,327,"Barricade",1906,"Guillaume_TV1B::OnWall6";
- bg_monster $@TierraBG1_id1,"bat_a01",160,327,"Barricade",1906,"Guillaume_TV1B::OnWall6";
- bg_monster $@TierraBG1_id1,"bat_a01",161,327,"Barricade",1906,"Guillaume_TV1B::OnWall6";
- bg_monster $@TierraBG1_id1,"bat_a01",162,327,"Barricade",1906,"Guillaume_TV1B::OnWall6";
- setwall "bat_a01",159,327,4,6,0,"bat_a01_g6";
-
- bg_monster $@TierraBG1_id1,"bat_a01",163,344,"Barricade",1906,"Guillaume_TV1B::OnWall7";
- bg_monster $@TierraBG1_id1,"bat_a01",163,345,"Barricade",1906,"Guillaume_TV1B::OnWall7";
- bg_monster $@TierraBG1_id1,"bat_a01",163,346,"Barricade",1906,"Guillaume_TV1B::OnWall7";
- bg_monster $@TierraBG1_id1,"bat_a01",163,347,"Barricade",1906,"Guillaume_TV1B::OnWall7";
- setwall "bat_a01",163,344,4,0,0,"bat_a01_g7";
+ for( set .@i, 0; .@i < 16; set .@i, .@i + 1 )
+ bg_monster 0,"bat_a01",170+.@i,130,"Barricade",1906,"Guillaume_TV1B::OnWall";
- setarray .MyMobCount[1],4,3,4,3,4,4,4;
+ setwall "bat_a01",170,130,16,6,1,"bat_a01_g1";
+ set .MyMobCount,16;
end;
OnDestroy:
- for( set .@i, 1; .@i < 8; set .@i, .@i + 1 )
- {
- killmonster "bat_a01","Guillaume_TV1B::OnWall" + .@i + "";
- delwall "bat_a01_g" + .@i + "";
- }
-
- setarray .MyMobCount[1],0,0,0,0,0,0,0;
+ killmonster "bat_a01","Guillaume_TV1B::OnWall";
+ delwall "bat_a01_g1";
+ set .MyMobCount,0;
end;
-OnWall1:
- if( set(.MyMobCount[1],.MyMobCount[1] - 1) < 1 )
+OnWall:
+ if( set(.MyMobCount,.MyMobCount - 1) < 1 )
{
delwall "bat_a01_g1";
- mapannounce "bat_a01","Guillaume Camp : A Gate has been Destroy!!",1,0xffb85d;
- }
- end;
-OnWall2:
- if( set(.MyMobCount[2],.MyMobCount[2] - 1) < 1 )
- {
- delwall "bat_a01_g2";
- mapannounce "bat_a01","Guillaume Camp : A Gate has been Destroy!!",1,0xffb85d;
- }
- end;
-OnWall3:
- if( set(.MyMobCount[3],.MyMobCount[3] - 1) < 1 )
- {
- delwall "bat_a01_g3";
- mapannounce "bat_a01","Guillaume Camp : A Gate has been Destroy!!",1,0xffb85d;
- }
- end;
-OnWall4:
- if( set(.MyMobCount[4],.MyMobCount[4] - 1) < 1 )
- {
- delwall "bat_a01_g4";
- mapannounce "bat_a01","Guillaume Camp : A Gate has been Destroy!!",1,0xffb85d;
- }
- end;
-OnWall5:
- if( set(.MyMobCount[5],.MyMobCount[5] - 1) < 1 )
- {
- delwall "bat_a01_g5";
- mapannounce "bat_a01","Guillaume Camp : A Gate has been Destroy!!",1,0xffb85d;
- }
- end;
-OnWall6:
- if( set(.MyMobCount[6],.MyMobCount[6] - 1) < 1 )
- {
- delwall "bat_a01_g6";
- mapannounce "bat_a01","Guillaume Camp : A Gate has been Destroy!!",1,0xffb85d;
- }
- end;
-OnWall7:
- if( set(.MyMobCount[7],.MyMobCount[7] - 1) < 1 )
- {
- delwall "bat_a01_g7";
- mapannounce "bat_a01","Guillaume Camp : Main Gate has been Destroy, our Food Storehouse is unprotected!!",1,0xffb85d;
+ mapannounce "bat_a01","South Gate : The Gate has been Destroy!!",1,0xFFA500;
}
end;
}
@@ -366,108 +305,24 @@ OnWall7: end;
OnBuild:
- bg_monster $@TierraBG1_id2,"bat_a01",150,83,"Barricade",1906,"Croix_TV1B::OnWall1";
- bg_monster $@TierraBG1_id2,"bat_a01",151,83,"Barricade",1906,"Croix_TV1B::OnWall1";
- bg_monster $@TierraBG1_id2,"bat_a01",152,83,"Barricade",1906,"Croix_TV1B::OnWall1";
- bg_monster $@TierraBG1_id2,"bat_a01",153,83,"Barricade",1906,"Croix_TV1B::OnWall1";
- setwall "bat_a01",150,83,4,6,0,"bat_a01_c1";
-
- bg_monster $@TierraBG1_id2,"bat_a01",150,67,"Barricade",1906,"Croix_TV1B::OnWall2";
- bg_monster $@TierraBG1_id2,"bat_a01",151,67,"Barricade",1906,"Croix_TV1B::OnWall2";
- bg_monster $@TierraBG1_id2,"bat_a01",152,67,"Barricade",1906,"Croix_TV1B::OnWall2";
- bg_monster $@TierraBG1_id2,"bat_a01",153,67,"Barricade",1906,"Croix_TV1B::OnWall2";
- setwall "bat_a01",150,67,4,6,0,"bat_a01_c2";
-
- bg_monster $@TierraBG1_id2,"bat_a01",109,47,"Barricade",1906,"Croix_TV1B::OnWall3";
- bg_monster $@TierraBG1_id2,"bat_a01",109,48,"Barricade",1906,"Croix_TV1B::OnWall3";
- bg_monster $@TierraBG1_id2,"bat_a01",109,49,"Barricade",1906,"Croix_TV1B::OnWall3";
- bg_monster $@TierraBG1_id2,"bat_a01",109,50,"Barricade",1906,"Croix_TV1B::OnWall3";
- setwall "bat_a01",109,47,4,0,0,"bat_a01_c3";
-
- bg_monster $@TierraBG1_id2,"bat_a01",127,47,"Barricade",1906,"Croix_TV1B::OnWall4";
- bg_monster $@TierraBG1_id2,"bat_a01",127,48,"Barricade",1906,"Croix_TV1B::OnWall4";
- bg_monster $@TierraBG1_id2,"bat_a01",127,49,"Barricade",1906,"Croix_TV1B::OnWall4";
- bg_monster $@TierraBG1_id2,"bat_a01",127,50,"Barricade",1906,"Croix_TV1B::OnWall4";
- setwall "bat_a01",127,47,4,0,0,"bat_a01_c4";
-
- bg_monster $@TierraBG1_id2,"bat_a01",152,13,"Barricade",1906,"Croix_TV1B::OnWall5";
- bg_monster $@TierraBG1_id2,"bat_a01",153,13,"Barricade",1906,"Croix_TV1B::OnWall5";
- bg_monster $@TierraBG1_id2,"bat_a01",154,13,"Barricade",1906,"Croix_TV1B::OnWall5";
- bg_monster $@TierraBG1_id2,"bat_a01",155,13,"Barricade",1906,"Croix_TV1B::OnWall5";
- setwall "bat_a01",152,13,4,6,0,"bat_a01_c5";
-
- bg_monster $@TierraBG1_id2,"bat_a01",152,32,"Barricade",1906,"Croix_TV1B::OnWall6";
- bg_monster $@TierraBG1_id2,"bat_a01",153,32,"Barricade",1906,"Croix_TV1B::OnWall6";
- bg_monster $@TierraBG1_id2,"bat_a01",154,32,"Barricade",1906,"Croix_TV1B::OnWall6";
- bg_monster $@TierraBG1_id2,"bat_a01",155,32,"Barricade",1906,"Croix_TV1B::OnWall6";
- setwall "bat_a01",152,32,4,6,0,"bat_a01_c6";
-
- bg_monster $@TierraBG1_id2,"bat_a01",153,48,"Barricade",1906,"Croix_TV1B::OnWall7";
- bg_monster $@TierraBG1_id2,"bat_a01",153,49,"Barricade",1906,"Croix_TV1B::OnWall7";
- bg_monster $@TierraBG1_id2,"bat_a01",153,50,"Barricade",1906,"Croix_TV1B::OnWall7";
- bg_monster $@TierraBG1_id2,"bat_a01",153,51,"Barricade",1906,"Croix_TV1B::OnWall7";
- setwall "bat_a01",153,48,4,0,0,"bat_a01_c7";
-
- setarray .MyMobCount[1],4,4,4,4,4,4,4;
+ for( set .@i, 0; .@i < 16; set .@i, .@i + 1 )
+ bg_monster 0,"bat_a01",186+.@i,266,"Barricade",1906,"Croix_TV1B::OnWall";
+
+ setwall "bat_a01",186,266,16,6,1,"bat_a01_c1";
+ set .MyMobCount,16;
end;
OnDestroy:
- for( set .@i, 1; .@i < 8; set .@i, .@i + 1 )
- {
- killmonster "bat_a01","Croix_TV1B::OnWall" + .@i + "";
- delwall "bat_a01_c" + .@i + "";
- }
-
- setarray .MyMobCount[1],0,0,0,0,0,0,0;
+ killmonster "bat_a01","Croix_TV1B::OnWall";
+ delwall "bat_a01_c1";
+ set .MyMobCount,0;
end;
-OnWall1:
- if( set(.MyMobCount[1],.MyMobCount[1] - 1) < 1 )
+OnWall:
+ if( set(.MyMobCount,.MyMobCount - 1) < 1 )
{
delwall "bat_a01_c1";
- mapannounce "bat_a01","Croix Camp : A Gate has been Destroy!!",1,0xff9fa1;
- }
- end;
-OnWall2:
- if( set(.MyMobCount[2],.MyMobCount[2] - 1) < 1 )
- {
- delwall "bat_a01_c2";
- mapannounce "bat_a01","Croix Camp : A Gate has been Destroy!!",1,0xff9fa1;
- }
- end;
-OnWall3:
- if( set(.MyMobCount[3],.MyMobCount[3] - 1) < 1 )
- {
- delwall "bat_a01_c3";
- mapannounce "bat_a01","Croix Camp : A Gate has been Destroy!!",1,0xff9fa1;
- }
- end;
-OnWall4:
- if( set(.MyMobCount[4],.MyMobCount[4] - 1) < 1 )
- {
- delwall "bat_a01_c4";
- mapannounce "bat_a01","Croix Camp : A Gate has been Destroy!!",1,0xff9fa1;
- }
- end;
-OnWall5:
- if( set(.MyMobCount[5],.MyMobCount[5] - 1) < 1 )
- {
- delwall "bat_a01_c5";
- mapannounce "bat_a01","Croix Camp : A Gate has been Destroy!!",1,0xff9fa1;
- }
- end;
-OnWall6:
- if( set(.MyMobCount[6],.MyMobCount[6] - 1) < 1 )
- {
- delwall "bat_a01_c6";
- mapannounce "bat_a01","Croix Camp : A Gate has been Destroy!!",1,0xff9fa1;
- }
- end;
-OnWall7:
- if( set(.MyMobCount[7],.MyMobCount[7] - 1) < 1 )
- {
- delwall "bat_a01_c7";
- mapannounce "bat_a01","Croix Camp : Main Gate has been Destroy, our Food Storehouse is unprotected!!",1,0xff9fa1;
+ mapannounce "bat_a01","North Gate : A Gate has been Destroy!!",1,0xFFA500;
}
end;
}
@@ -540,6 +395,13 @@ bat_a01,53,377,3 script Guillaume Vintenar#tv1 419,{ // Battleground Therapist
// *********************************************************************
+bat_a01,60,216,3 script Ghost#tv13 950,{
+ mes "[Ghost in valley]";
+ mes "Boo...Boo...";
+ specialeffect2 312;
+ close;
+}
+
bat_a01,53,377,3 script Therapist in battle#tv12 95,{
mes "[Therapist in battle]";
mes "Just close your eyes, and take a deep breathe.";
@@ -559,6 +421,28 @@ bat_a01,45,18,3 script Therapist in battle#tv11 95,{ // Battleground Respawn
// *********************************************************************
+bat_a01,57,213,0 script #ntv1_respawn 139,{
+ end;
+
+OnBGStart:
+ initnpctimer;
+ end;
+
+OnBGStop:
+ stopnpctimer;
+ end;
+
+OnTimer19000:
+ misceffect 83;
+ end;
+
+OnTimer20000:
+ areapercentheal "bat_a01",52,208,61,217,100,100;
+ areawarp "bat_a01",52,208,61,217,"bat_a01",301,208;
+ initnpctimer;
+ end;
+}
+
bat_a01,50,374,0 script #gtv1_respawn 139,{
end;
@@ -576,10 +460,7 @@ OnTimer24000: OnTimer25000:
areapercentheal "bat_a01",46,370,54,378,100,100;
- if( $@TierraBG1_Base == 1 )
- areawarp "bat_a01",46,370,54,378,"bat_a01",285,226;
- else
- areawarp "bat_a01",46,370,54,378,"bat_a01",354,340;
+ areawarp "bat_a01",46,370,54,378,"bat_a01",354,340;
initnpctimer;
end;
}
@@ -601,10 +482,7 @@ OnTimer24000: OnTimer25000:
areapercentheal "bat_a01",38,12,47,21,100,100;
- if( $@TierraBG1_Base == 2 )
- areawarp "bat_a01",38,12,47,21,"bat_a01",260,183;
- else
- areawarp "bat_a01",38,12,47,21,"bat_a01",354,57;
+ areawarp "bat_a01",38,12,47,21,"bat_a01",354,57;
initnpctimer;
end;
}
diff --git a/npc/battleground/bg_tierra_02.txt b/npc/battleground/bg_tierra_02.txt index 310176272..3789cd4bd 100644 --- a/npc/battleground/bg_tierra_02.txt +++ b/npc/battleground/bg_tierra_02.txt @@ -32,8 +32,6 @@ OnEnterBG: end;
OnInit:
- disablenpc "Tierra Neutral#lion2";
- disablenpc "Tierra Neutral#eagle2";
disablenpc "Croix Vintenar#tv2";
disablenpc "Guillaume Vintenar#tv2";
disablenpc "Therapist in battle#tv21";
@@ -71,8 +69,14 @@ OnReadyCheck: bg_monster $@TierraBG2_id1,"bat_a02",176,345,"Food Depot",1909,"Tierra_BG2::OnGuillaumeBreak";
bg_monster $@TierraBG2_id2,"bat_a02",167,50,"Food Storage",1910,"Tierra_BG2::OnCroixBreak";
bg_monster 0,"bat_a02",273,204,"Neutrality Flag",1911,"Tierra_BG2::OnNeutralBreak";
- set $@TierraBG2_Base, 0;
+
+ set .Neutral_Base, 0;
set $@TierraBG2_Victory, 0;
+
+ set .Guardian_1, 0;
+ set .Guardian_2, 0;
+ set .Guardian_3, 0;
+
enablenpc "Therapist in battle#tv21";
enablenpc "Therapist in battle#tv22";
disablenpc "Croix Vintenar#tv2";
@@ -80,6 +84,7 @@ OnReadyCheck: // Respawner
donpcevent "#gtv2_respawn::OnBGStart";
donpcevent "#ctv2_respawn::OnBGStart";
+ donpcevent "#ntv2_respawn::OnBGStart";
// Warp Teams
announce "Battleground -- Tierra Valley [80-99] has started!",0,0xF4A460;
bg_warp $@TierraBG2_id1,"bat_a02",353,344;
@@ -94,33 +99,51 @@ OnReadyCheck: end;
OnNeutralBreak:
- if( Bat_Team == 1 )
+ if( getcharid(4) == $@TierraBG2_id1 )
{
mapannounce "bat_a02","Guillaume obtained a neurality banner, so they have an advantage.",1,0x0000FF;
- setnpcdisplay("Tierra Neutral#lion2","Guillaume Base",973);
- enablenpc "Tierra Neutral#lion2";
- bg_monster $@TierraBG2_id1,"bat_a02",28,185,"Guillaume Camp Guardian",1949,"Tierra_BG2::OnGuardian";
- bg_monster $@TierraBG2_id1,"bat_a02",287,203,"Guillaume Camp Guardian",1950,"Tierra_BG2::OnGuardian";
- bg_monster $@TierraBG2_id1,"bat_a02",268,204,"Guillaume Camp Guardian",1949,"Tierra_BG2::OnGuardian";
- bg_monster $@TierraBG2_id1,"bat_a02",280,233,"Guillaume Camp Guardian",1950,"Tierra_BG2::OnGuardian";
+ bg_team_setxy $@TierraBG2_id2,42,16;
+ areawarp "bat_a02",52,208,61,217,"bat_a02",42,16;
}
- else if( Bat_Team == 2 )
+ else if( getcharid(4) == $@TierraBG2_id2 )
{
mapannounce "bat_a02","Croix obtained a neutrality banner, so they have an advantage.",1,0xFF0000;
- setnpcdisplay("Tierra Neutral#eagle2","Croix Base",974);
- enablenpc "Tierra Neutral#eagle2";
- bg_monster $@TierraBG2_id2,"bat_a02",28,185,"Croix Camp Guardian",1949,"Tierra_BG2::OnGuardian";
- bg_monster $@TierraBG2_id2,"bat_a02",287,203,"Croix Camp Guardian",1950,"Tierra_BG2::OnGuardian";
- bg_monster $@TierraBG2_id2,"bat_a02",268,204,"Croix Camp Guardian",1949,"Tierra_BG2::OnGuardian";
- bg_monster $@TierraBG2_id2,"bat_a02",280,233,"Croix Camp Guardian",1950,"Tierra_BG2::OnGuardian";
+ bg_team_setxy $@TierraBG2_id1,50,374;
+ areawarp "bat_a02",52,208,61,217,"bat_a02",50,374;
}
- else end; // Should not happend
- set $@TierraBG2_Base, Bat_Team;
- end;
+ else end;
+
+ set .Neutral_Base, getcharid(4);
+ bg_team_setxy .Neutral_Base,56,212;
+
+ if( .Guardian_1 == 0 )
+ set .Guardian_1, bg_monster(.Neutral_Base,"bat_a02",280,233,"Guardian",1949,"Tierra_BG2::OnGuardian1");
+ else
+ bg_monster_set_team .Guardian_1, .Neutral_Base;
+
+ if( .Guardian_2 == 0 )
+ set .Guardian_2, bg_monster(.Neutral_Base,"bat_a02",287,203,"Guardian",1950,"Tierra_BG2::OnGuardian2");
+ else
+ bg_monster_set_team .Guardian_2, .Neutral_Base;
+
+ if( .Guardian_3 == 0 )
+ set .Guardian_3, bg_monster(.Neutral_Base,"bat_a02",268,204,"Guardian",1949,"Tierra_BG2::OnGuardian3");
+ else
+ bg_monster_set_team .Guardian_3, .Neutral_Base;
+
+ sleep 10000;
+ if( $@TierraBG2 != 1 ) end;
-OnGuardian:
+ if( .Neutral_Base == $@TierraBG2_id1 )
+ bg_monster .Neutral_Base,"bat_a02",273,204,"Guillaume Flag",1912,"Tierra_BG2::OnNeutralBreak";
+ else if( .Neutral_Base == $@TierraBG2_id2 )
+ bg_monster .Neutral_Base,"bat_a02",273,204,"Croix Flag",1913,"Tierra_BG2::OnNeutralBreak";
end;
+OnGuardian1: set .Guardian_1, 0; end;
+OnGuardian2: set .Guardian_2, 0; end;
+OnGuardian3: set .Guardian_3, 0; end;
+
OnGuillaumeBreak:
set $@TierraBG2_Victory, 2;
mapannounce "bat_a02","Croix Vintenar Swandery: We destroyed Guillaume's food storehause. We won that! Wow!",1,0xFF0000;
@@ -152,12 +175,15 @@ OnStop: disablenpc "Therapist in battle#tv22";
donpcevent "#gtv2_respawn::OnBGStop";
donpcevent "#ctv2_respawn::OnBGStop";
+ donpcevent "#ntv2_respawn::OnBGStop";
enablenpc "Croix Vintenar#tv2";
enablenpc "Guillaume Vintenar#tv2";
killmonster "bat_a02","Tierra_BG2::OnGuillaumeBreak";
killmonster "bat_a02","Tierra_BG2::OnCroixBreak";
killmonster "bat_a02","Tierra_BG2::OnNeutralBreak";
- killmonster "bat_a02","Tierra_BG2::OnGuardian";
+ killmonster "bat_a02","Tierra_BG2::OnGuardian1";
+ killmonster "bat_a02","Tierra_BG2::OnGuardian2";
+ killmonster "bat_a02","Tierra_BG2::OnGuardian3";
stopnpctimer;
sleep 3000;
bg_warp $@TierraBG2_id1,"bat_a02",50,374;
@@ -181,20 +207,21 @@ OnTimer60000: end;
OnReset:
stopnpctimer;
- set $@TierraBG2_Base, 0;
- disablenpc "Tierra Neutral#lion2";
- disablenpc "Tierra Neutral#eagle2";
+ set .Neutral_Base, 0;
disablenpc "Croix Vintenar#tv2";
disablenpc "Guillaume Vintenar#tv2";
disablenpc "Therapist in battle#tv21";
disablenpc "Therapist in battle#tv22";
donpcevent "#gtv2_respawn::OnBGStop";
+ donpcevent "#gtv2_respawn::OnBGStop";
donpcevent "#ctv2_respawn::OnBGStop";
killmonster "bat_a02","Tierra_BG2::OnGuillaumeBreak";
killmonster "bat_a02","Tierra_BG2::OnCroixBreak";
killmonster "bat_a02","Tierra_BG2::OnNeutralBreak";
- killmonster "bat_a02","Tierra_BG2::OnGuardian";
+ killmonster "bat_a02","Tierra_BG2::OnGuardian1";
+ killmonster "bat_a02","Tierra_BG2::OnGuardian2";
+ killmonster "bat_a02","Tierra_BG2::OnGuardian3";
donpcevent "Guillaume_TV2B::OnDestroy";
donpcevent "Croix_TV2B::OnDestroy";
@@ -224,12 +251,6 @@ bat_a02 mapflag noreturn bat_a02 mapflag nobranch
bat_a02 mapflag nopenalty
-// Neutral Point Flags
-// *********************************************************************
-
-bat_a02,273,204,1 script Tierra Neutral#lion2 973,{ end; }
-bat_a02,273,204,1 script Tierra Neutral#eagle2 974,{ end; }
-
// Other Flags
// *********************************************************************
@@ -258,106 +279,24 @@ bat_a02,119,336,1 duplicate(Guillaume camp#bat) Guillaume camp#bat31 973 end;
OnBuild:
- bg_monster $@TierraBG2_id1,"bat_a02",160,380,"Barricade",1906,"Guillaume_TV2B::OnWall1";
- bg_monster $@TierraBG2_id1,"bat_a02",161,380,"Barricade",1906,"Guillaume_TV2B::OnWall1";
- bg_monster $@TierraBG2_id1,"bat_a02",162,380,"Barricade",1906,"Guillaume_TV2B::OnWall1";
- bg_monster $@TierraBG2_id1,"bat_a02",163,380,"Barricade",1906,"Guillaume_TV2B::OnWall1";
- setwall "bat_a02",160,380,4,6,0,"bat_a02_g1";
-
- bg_monster $@TierraBG2_id1,"bat_a02",160,363,"Barricade",1906,"Guillaume_TV2B::OnWall2";
- bg_monster $@TierraBG2_id1,"bat_a02",161,363,"Barricade",1906,"Guillaume_TV2B::OnWall2";
- bg_monster $@TierraBG2_id1,"bat_a02",162,363,"Barricade",1906,"Guillaume_TV2B::OnWall2";
- setwall "bat_a02",160,363,3,6,0,"bat_a02_g2";
-
- bg_monster $@TierraBG2_id1,"bat_a02",119,344,"Barricade",1906,"Guillaume_TV2B::OnWall3";
- bg_monster $@TierraBG2_id1,"bat_a02",119,345,"Barricade",1906,"Guillaume_TV2B::OnWall3";
- bg_monster $@TierraBG2_id1,"bat_a02",119,346,"Barricade",1906,"Guillaume_TV2B::OnWall3";
- bg_monster $@TierraBG2_id1,"bat_a02",119,347,"Barricade",1906,"Guillaume_TV2B::OnWall3";
- setwall "bat_a02",119,344,4,0,0,"bat_a02_g3";
-
- bg_monster $@TierraBG2_id1,"bat_a02",134,345,"Barricade",1906,"Guillaume_TV2B::OnWall4";
- bg_monster $@TierraBG2_id1,"bat_a02",134,346,"Barricade",1906,"Guillaume_TV2B::OnWall4";
- bg_monster $@TierraBG2_id1,"bat_a02",134,347,"Barricade",1906,"Guillaume_TV2B::OnWall4";
- setwall "bat_a02",134,345,3,0,0,"bat_a02_g4";
-
- bg_monster $@TierraBG2_id1,"bat_a02",159,311,"Barricade",1906,"Guillaume_TV2B::OnWall5";
- bg_monster $@TierraBG2_id1,"bat_a02",160,311,"Barricade",1906,"Guillaume_TV2B::OnWall5";
- bg_monster $@TierraBG2_id1,"bat_a02",161,311,"Barricade",1906,"Guillaume_TV2B::OnWall5";
- bg_monster $@TierraBG2_id1,"bat_a02",162,311,"Barricade",1906,"Guillaume_TV2B::OnWall5";
- setwall "bat_a02",159,311,4,6,0,"bat_a02_g5";
-
- bg_monster $@TierraBG2_id1,"bat_a02",159,327,"Barricade",1906,"Guillaume_TV2B::OnWall6";
- bg_monster $@TierraBG2_id1,"bat_a02",160,327,"Barricade",1906,"Guillaume_TV2B::OnWall6";
- bg_monster $@TierraBG2_id1,"bat_a02",161,327,"Barricade",1906,"Guillaume_TV2B::OnWall6";
- bg_monster $@TierraBG2_id1,"bat_a02",162,327,"Barricade",1906,"Guillaume_TV2B::OnWall6";
- setwall "bat_a02",159,327,4,6,0,"bat_a02_g6";
-
- bg_monster $@TierraBG2_id1,"bat_a02",163,344,"Barricade",1906,"Guillaume_TV2B::OnWall7";
- bg_monster $@TierraBG2_id1,"bat_a02",163,345,"Barricade",1906,"Guillaume_TV2B::OnWall7";
- bg_monster $@TierraBG2_id1,"bat_a02",163,346,"Barricade",1906,"Guillaume_TV2B::OnWall7";
- bg_monster $@TierraBG2_id1,"bat_a02",163,347,"Barricade",1906,"Guillaume_TV2B::OnWall7";
- setwall "bat_a02",163,344,4,0,0,"bat_a02_g7";
+ for( set .@i, 0; .@i < 16; set .@i, .@i + 1 )
+ bg_monster 0,"bat_a02",170+.@i,130,"Barricade",1906,"Guillaume_TV2B::OnWall";
- setarray .MyMobCount[1],4,3,4,3,4,4,4;
+ setwall "bat_a02",170,130,16,6,1,"bat_a02_g1";
+ set .MyMobCount,16;
end;
OnDestroy:
- for( set .@i, 1; .@i < 8; set .@i, .@i + 1 )
- {
- killmonster "bat_a02","Guillaume_TV2B::OnWall" + .@i + "";
- delwall "bat_a02_g" + .@i + "";
- }
-
- setarray .MyMobCount[1],0,0,0,0,0,0,0;
+ killmonster "bat_a02","Guillaume_TV2B::OnWall";
+ delwall "bat_a02_g1";
+ set .MyMobCount,0;
end;
-OnWall1:
- if( set(.MyMobCount[1],.MyMobCount[1] - 1) < 1 )
+OnWall:
+ if( set(.MyMobCount,.MyMobCount - 1) < 1 )
{
delwall "bat_a02_g1";
- mapannounce "bat_a02","Guillaume Camp : A Gate has been Destroy!!",1,0xffb85d;
- }
- end;
-OnWall2:
- if( set(.MyMobCount[2],.MyMobCount[2] - 1) < 1 )
- {
- delwall "bat_a02_g2";
- mapannounce "bat_a02","Guillaume Camp : A Gate has been Destroy!!",1,0xffb85d;
- }
- end;
-OnWall3:
- if( set(.MyMobCount[3],.MyMobCount[3] - 1) < 1 )
- {
- delwall "bat_a02_g3";
- mapannounce "bat_a02","Guillaume Camp : A Gate has been Destroy!!",1,0xffb85d;
- }
- end;
-OnWall4:
- if( set(.MyMobCount[4],.MyMobCount[4] - 1) < 1 )
- {
- delwall "bat_a02_g4";
- mapannounce "bat_a02","Guillaume Camp : A Gate has been Destroy!!",1,0xffb85d;
- }
- end;
-OnWall5:
- if( set(.MyMobCount[5],.MyMobCount[5] - 1) < 1 )
- {
- delwall "bat_a02_g5";
- mapannounce "bat_a02","Guillaume Camp : A Gate has been Destroy!!",1,0xffb85d;
- }
- end;
-OnWall6:
- if( set(.MyMobCount[6],.MyMobCount[6] - 1) < 1 )
- {
- delwall "bat_a02_g6";
- mapannounce "bat_a02","Guillaume Camp : A Gate has been Destroy!!",1,0xffb85d;
- }
- end;
-OnWall7:
- if( set(.MyMobCount[7],.MyMobCount[7] - 1) < 1 )
- {
- delwall "bat_a02_g7";
- mapannounce "bat_a02","Guillaume Camp : Main Gate has been Destroy, our Food Storehouse is unprotected!!",1,0xffb85d;
+ mapannounce "bat_a02","South Gate : The Gate has been Destroy!!",1,0xF4A460;
}
end;
}
@@ -366,108 +305,24 @@ OnWall7: end;
OnBuild:
- bg_monster $@TierraBG2_id2,"bat_a02",150,83,"Barricade",1906,"Croix_TV2B::OnWall1";
- bg_monster $@TierraBG2_id2,"bat_a02",151,83,"Barricade",1906,"Croix_TV2B::OnWall1";
- bg_monster $@TierraBG2_id2,"bat_a02",152,83,"Barricade",1906,"Croix_TV2B::OnWall1";
- bg_monster $@TierraBG2_id2,"bat_a02",153,83,"Barricade",1906,"Croix_TV2B::OnWall1";
- setwall "bat_a02",150,83,4,6,0,"bat_a02_c1";
-
- bg_monster $@TierraBG2_id2,"bat_a02",150,67,"Barricade",1906,"Croix_TV2B::OnWall2";
- bg_monster $@TierraBG2_id2,"bat_a02",151,67,"Barricade",1906,"Croix_TV2B::OnWall2";
- bg_monster $@TierraBG2_id2,"bat_a02",152,67,"Barricade",1906,"Croix_TV2B::OnWall2";
- bg_monster $@TierraBG2_id2,"bat_a02",153,67,"Barricade",1906,"Croix_TV2B::OnWall2";
- setwall "bat_a02",150,67,4,6,0,"bat_a02_c2";
-
- bg_monster $@TierraBG2_id2,"bat_a02",109,47,"Barricade",1906,"Croix_TV2B::OnWall3";
- bg_monster $@TierraBG2_id2,"bat_a02",109,48,"Barricade",1906,"Croix_TV2B::OnWall3";
- bg_monster $@TierraBG2_id2,"bat_a02",109,49,"Barricade",1906,"Croix_TV2B::OnWall3";
- bg_monster $@TierraBG2_id2,"bat_a02",109,50,"Barricade",1906,"Croix_TV2B::OnWall3";
- setwall "bat_a02",109,47,4,0,0,"bat_a02_c3";
-
- bg_monster $@TierraBG2_id2,"bat_a02",127,47,"Barricade",1906,"Croix_TV2B::OnWall4";
- bg_monster $@TierraBG2_id2,"bat_a02",127,48,"Barricade",1906,"Croix_TV2B::OnWall4";
- bg_monster $@TierraBG2_id2,"bat_a02",127,49,"Barricade",1906,"Croix_TV2B::OnWall4";
- bg_monster $@TierraBG2_id2,"bat_a02",127,50,"Barricade",1906,"Croix_TV2B::OnWall4";
- setwall "bat_a02",127,47,4,0,0,"bat_a02_c4";
-
- bg_monster $@TierraBG2_id2,"bat_a02",152,13,"Barricade",1906,"Croix_TV2B::OnWall5";
- bg_monster $@TierraBG2_id2,"bat_a02",153,13,"Barricade",1906,"Croix_TV2B::OnWall5";
- bg_monster $@TierraBG2_id2,"bat_a02",154,13,"Barricade",1906,"Croix_TV2B::OnWall5";
- bg_monster $@TierraBG2_id2,"bat_a02",155,13,"Barricade",1906,"Croix_TV2B::OnWall5";
- setwall "bat_a02",152,13,4,6,0,"bat_a02_c5";
-
- bg_monster $@TierraBG2_id2,"bat_a02",152,32,"Barricade",1906,"Croix_TV2B::OnWall6";
- bg_monster $@TierraBG2_id2,"bat_a02",153,32,"Barricade",1906,"Croix_TV2B::OnWall6";
- bg_monster $@TierraBG2_id2,"bat_a02",154,32,"Barricade",1906,"Croix_TV2B::OnWall6";
- bg_monster $@TierraBG2_id2,"bat_a02",155,32,"Barricade",1906,"Croix_TV2B::OnWall6";
- setwall "bat_a02",152,32,4,6,0,"bat_a02_c6";
-
- bg_monster $@TierraBG2_id2,"bat_a02",153,48,"Barricade",1906,"Croix_TV2B::OnWall7";
- bg_monster $@TierraBG2_id2,"bat_a02",153,49,"Barricade",1906,"Croix_TV2B::OnWall7";
- bg_monster $@TierraBG2_id2,"bat_a02",153,50,"Barricade",1906,"Croix_TV2B::OnWall7";
- bg_monster $@TierraBG2_id2,"bat_a02",153,51,"Barricade",1906,"Croix_TV2B::OnWall7";
- setwall "bat_a02",153,48,4,0,0,"bat_a02_c7";
-
- setarray .MyMobCount[1],4,4,4,4,4,4,4;
+ for( set .@i, 0; .@i < 16; set .@i, .@i + 1 )
+ bg_monster 0,"bat_a02",186+.@i,266,"Barricade",1906,"Croix_TV2B::OnWall";
+
+ setwall "bat_a02",186,266,16,6,1,"bat_a02_c1";
+ set .MyMobCount,16;
end;
OnDestroy:
- for( set .@i, 1; .@i < 8; set .@i, .@i + 1 )
- {
- killmonster "bat_a02","Croix_TV2B::OnWall" + .@i + "";
- delwall "bat_a02_c" + .@i + "";
- }
-
- setarray .MyMobCount[1],0,0,0,0,0,0,0;
+ killmonster "bat_a02","Croix_TV2B::OnWall";
+ delwall "bat_a02_c1";
+ set .MyMobCount,0;
end;
-OnWall1:
- if( set(.MyMobCount[1],.MyMobCount[1] - 1) < 1 )
+OnWall:
+ if( set(.MyMobCount,.MyMobCount - 1) < 1 )
{
delwall "bat_a02_c1";
- mapannounce "bat_a02","Croix Camp : A Gate has been Destroy!!",1,0xff9fa1;
- }
- end;
-OnWall2:
- if( set(.MyMobCount[2],.MyMobCount[2] - 1) < 1 )
- {
- delwall "bat_a02_c2";
- mapannounce "bat_a02","Croix Camp : A Gate has been Destroy!!",1,0xff9fa1;
- }
- end;
-OnWall3:
- if( set(.MyMobCount[3],.MyMobCount[3] - 1) < 1 )
- {
- delwall "bat_a02_c3";
- mapannounce "bat_a02","Croix Camp : A Gate has been Destroy!!",1,0xff9fa1;
- }
- end;
-OnWall4:
- if( set(.MyMobCount[4],.MyMobCount[4] - 1) < 1 )
- {
- delwall "bat_a02_c4";
- mapannounce "bat_a02","Croix Camp : A Gate has been Destroy!!",1,0xff9fa1;
- }
- end;
-OnWall5:
- if( set(.MyMobCount[5],.MyMobCount[5] - 1) < 1 )
- {
- delwall "bat_a02_c5";
- mapannounce "bat_a02","Croix Camp : A Gate has been Destroy!!",1,0xff9fa1;
- }
- end;
-OnWall6:
- if( set(.MyMobCount[6],.MyMobCount[6] - 1) < 1 )
- {
- delwall "bat_a02_c6";
- mapannounce "bat_a02","Croix Camp : A Gate has been Destroy!!",1,0xff9fa1;
- }
- end;
-OnWall7:
- if( set(.MyMobCount[7],.MyMobCount[7] - 1) < 1 )
- {
- delwall "bat_a02_c7";
- mapannounce "bat_a02","Croix Camp : Main Gate has been Destroy, our Food Storehouse is unprotected!!",1,0xff9fa1;
+ mapannounce "bat_a02","North Gate : A Gate has been Destroy!!",1,0xF4A460;
}
end;
}
@@ -540,6 +395,13 @@ bat_a02,53,377,3 script Guillaume Vintenar#tv2 419,{ // Battleground Therapist
// *********************************************************************
+bat_a02,60,216,3 script Ghost#tv23 950,{
+ mes "[Ghost in valley]";
+ mes "Boo...Boo...";
+ specialeffect2 312;
+ close;
+}
+
bat_a02,53,377,3 script Therapist in battle#tv22 95,{
mes "[Therapist in battle]";
mes "Just close your eyes, and take a deep breathe.";
@@ -559,6 +421,28 @@ bat_a02,45,18,3 script Therapist in battle#tv21 95,{ // Battleground Respawn
// *********************************************************************
+bat_a02,57,213,0 script #ntv2_respawn 139,{
+ end;
+
+OnBGStart:
+ initnpctimer;
+ end;
+
+OnBGStop:
+ stopnpctimer;
+ end;
+
+OnTimer19000:
+ misceffect 83;
+ end;
+
+OnTimer20000:
+ areapercentheal "bat_a02",52,208,61,217,100,100;
+ areawarp "bat_a02",52,208,61,217,"bat_a02",301,208;
+ initnpctimer;
+ end;
+}
+
bat_a02,50,374,0 script #gtv2_respawn 139,{
end;
@@ -576,10 +460,7 @@ OnTimer24000: OnTimer25000:
areapercentheal "bat_a02",46,370,54,378,100,100;
- if( $@TierraBG2_Base == 1 )
- areawarp "bat_a02",46,370,54,378,"bat_a02",285,226;
- else
- areawarp "bat_a02",46,370,54,378,"bat_a02",354,340;
+ areawarp "bat_a02",46,370,54,378,"bat_a02",354,340;
initnpctimer;
end;
}
@@ -601,10 +482,7 @@ OnTimer24000: OnTimer25000:
areapercentheal "bat_a02",38,12,47,21,100,100;
- if( $@TierraBG2_Base == 2 )
- areawarp "bat_a02",38,12,47,21,"bat_a02",260,183;
- else
- areawarp "bat_a02",38,12,47,21,"bat_a02",354,57;
+ areawarp "bat_a02",38,12,47,21,"bat_a02",354,57;
initnpctimer;
end;
}
diff --git a/src/map/battleground.c b/src/map/battleground.c index b72e28fb2..f26f1efb9 100644 --- a/src/map/battleground.c +++ b/src/map/battleground.c @@ -269,7 +269,7 @@ int bg_send_message(struct map_session_data *sd, const char *mes, int len) nullpo_retr(0, sd); if( sd->state.bg_id == 0 || (bg = bg_team_search(sd->state.bg_id)) == NULL ) return 0; - clif_bg_message(bg, sd->status.account_id, mes, len); + clif_bg_message(bg, sd->status.name, mes, len); return 0; } diff --git a/src/map/clif.c b/src/map/clif.c index fe10a41d7..063240899 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -812,8 +812,8 @@ static int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool if( bl->type == BL_NPC && vd->class_ == FLAG_CLASS ) { //The hell, why flags work like this? - WBUFL(buf,22) = clif_bg_emblem_id(bl); - WBUFL(buf,26) = clif_bg_guild_id(bl); + WBUFL(buf,22) = clif_visual_emblem_id(bl); + WBUFL(buf,26) = clif_visual_guild_id(bl); } WBUFW(buf,28) = vd->hair_color; @@ -827,8 +827,8 @@ static int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool WBUFB(buf,40) = 0; return packet_len(0x7c); } - WBUFL(buf,34) = clif_bg_guild_id(bl); - WBUFW(buf,38) = clif_bg_emblem_id(bl); + WBUFL(buf,34) = clif_visual_guild_id(bl); + WBUFW(buf,38) = clif_visual_emblem_id(bl); WBUFW(buf,40) = (sd)? sd->status.manner : 0; #if PACKETVER >= 7 if (!type) { @@ -908,8 +908,8 @@ static int clif_set_unit_walking(struct block_list* bl, struct unit_data* ud, un WBUFW(buf,32) = vd->hair_color; WBUFW(buf,34) = vd->cloth_color; WBUFW(buf,36) = (sd)? sd->head_dir : 0; - WBUFL(buf,38) = clif_bg_guild_id(bl); - WBUFW(buf,42) = clif_bg_emblem_id(bl); + WBUFL(buf,38) = clif_visual_guild_id(bl); + WBUFW(buf,42) = clif_visual_emblem_id(bl); WBUFW(buf,44) = (sd)? sd->status.manner : 0; #if PACKETVER < 7 WBUFW(buf,46) = (sc)? sc->opt3 : 0; @@ -4730,9 +4730,8 @@ void clif_set0199(struct map_session_data* sd, int mode) WFIFOSET(fd,packet_len(0x199)); } -#if 0 -/// Set the map mode? -/// Differs from the behaviour of clif_set0199 with unknown consequences. +/// Set the map mode (special) +/// 19 = battleground void clif_set01D6(struct map_session_data* sd, int mode) { int fd; @@ -4745,7 +4744,6 @@ void clif_set01D6(struct map_session_data* sd, int mode) WFIFOW(fd,2)=mode; WFIFOSET(fd,packet_len(0x1D6)); } -#endif /*========================================== * PVP実装?(仮) @@ -6486,8 +6484,8 @@ void clif_guild_emblem_area(struct block_list* bl) // (emblem in the flag npcs and emblem over the head in agit maps) [FlavioJS] WBUFW(buf,0) = 0x1B4; WBUFL(buf,2) = bl->id; - WBUFL(buf,6) = clif_bg_guild_id(bl); - WBUFW(buf,10) = clif_bg_emblem_id(bl); + WBUFL(buf,6) = clif_visual_guild_id(bl); + WBUFW(buf,10) = clif_visual_emblem_id(bl); clif_send(buf, 12, bl, AREA_WOS); } @@ -7964,8 +7962,12 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) clif_party_hp(sd); // Show hp after displacement [LuzZza] } - if( sd->state.bg_id ) - clif_bg_hp(sd); // BattleGround System + if( sd->state.bg_id ) clif_bg_hp(sd); // BattleGround System + if( sd->state.changemap && map[sd->bl.m].flag.battleground == 2 ) + { + clif_set01D6(sd,19); // Battleground Mode + clif_bg_updatescore_single(sd); + } if(map[sd->bl.m].flag.pvp) { if(!battle_config.pk_mode) { // remove pvp stuff for pk_mode [Valaris] @@ -12885,7 +12887,7 @@ int clif_bg_belonginfo(struct map_session_data *sd) return 1; } -int clif_bg_guild_id(struct block_list *bl) +int clif_visual_guild_id(struct block_list *bl) { struct battleground_data *bg; int bg_id; @@ -12897,7 +12899,7 @@ int clif_bg_guild_id(struct block_list *bl) return status_get_guild_id(bl); } -int clif_bg_emblem_id(struct block_list *bl) +int clif_visual_emblem_id(struct block_list *bl) { struct battleground_data *bg; int bg_id; @@ -12993,19 +12995,22 @@ int clif_bg_leave_single(struct map_session_data *sd, const char *name, const ch return 0; } -int clif_bg_message(struct battleground_data *bg, int account_id, const char *mes, int len) +int clif_bg_message(struct battleground_data *bg, const char *name, const char *mes, int len) { struct map_session_data *sd; unsigned char *buf; + if( (sd = bg_getavailablesd(bg)) == NULL ) + return 0; - buf = (unsigned char*)aMallocA((len + 4)*sizeof(unsigned char)); + buf = (unsigned char*)aMallocA((len + NAME_LENGTH + 8)*sizeof(unsigned char)); - WBUFW(buf, 0) = 0x17f; - WBUFW(buf, 2) = len + 4; - memcpy(WBUFP(buf,4), mes, len); + WBUFW(buf,0) = 0x2dc; + WBUFW(buf,2) = len + NAME_LENGTH + 8; + WBUFL(buf,4) = sd->state.bg_id; + memcpy(WBUFP(buf,8), name, NAME_LENGTH); + memcpy(WBUFP(buf,32), mes, len); + clif_send(buf,WBUFW(buf,2), &sd->bl, BG); - if( (sd = bg_getavailablesd(bg)) != NULL ) - clif_send(buf, WBUFW(buf,2), &sd->bl, BG); if( buf ) aFree(buf); return 0; } @@ -13026,6 +13031,68 @@ int clif_bg_expulsion_single(struct map_session_data *sd, const char *name, cons } /*========================================== + * Validates and processes battlechat messages [pakpil] + * S 0x2db <packet len>.w <text>.?B (<name> : <message>) 00 + *------------------------------------------*/ +void clif_parse_BattleChat(int fd, struct map_session_data* sd) +{ + const char* text = (char*)RFIFOP(fd,4); + int textlen = RFIFOW(fd,2) - 4; + + char *name, *message; + int namelen, messagelen; + + if( !clif_process_message(sd, 0, &name, &namelen, &message, &messagelen) ) + return; + + if( is_atcommand(fd, sd, message, 1) ) + return; + + if( sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) ) + return; + + if( battle_config.min_chat_delay ) + { + if( DIFF_TICK(sd->cantalk_tick, gettick()) > 0 ) + return; + sd->cantalk_tick = gettick() + battle_config.min_chat_delay; + } + + bg_send_message(sd, text, textlen); +} + +int clif_bg_updatescore(int m) +{ + struct block_list bl; + unsigned char buf[6]; + + bl.id = 0; + bl.type = BL_NUL; + bl.m = m; + + WBUFW(buf,0) = 0x2de; + WBUFW(buf,2) = map[m].bgscore_lion; + WBUFW(buf,4) = map[m].bgscore_eagle; + clif_send(buf,6,&bl,ALL_SAMEMAP); + + return 0; +} + +int clif_bg_updatescore_single(struct map_session_data *sd) +{ + int fd; + nullpo_retr(0,sd); + fd = sd->fd; + + WFIFOHEAD(fd,6); + WFIFOW(fd,0) = 0x2de; + WFIFOW(fd,2) = map[sd->bl.m].bgscore_lion; + WFIFOW(fd,4) = map[sd->bl.m].bgscore_eagle; + WFIFOSET(fd,6); + return 0; +} + +/*========================================== * パケットデバッグ *------------------------------------------*/ void clif_parse_debug(int fd,struct map_session_data *sd) @@ -13294,7 +13361,7 @@ static int packetdb_readdb(void) 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 0, 0, 0, 0, //#0x02C0 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 6, -1, 10, 10, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 6, -1, 10, 10, 0, 0, -1, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; @@ -13470,6 +13537,7 @@ static int packetdb_readdb(void) {clif_parse_cashshop_buy,"cashshopbuy"}, {clif_parse_ViewPlayerEquip,"viewplayerequip"}, {clif_parse_EquipTick,"equiptickbox"}, + {clif_parse_BattleChat,"battlechat"}, {clif_parse_mercenary_action,"mermenu"}, {NULL,NULL} }; diff --git a/src/map/clif.h b/src/map/clif.h index 87c6a2953..6356a0c89 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -343,14 +343,16 @@ int clif_bg_hp(struct map_session_data *sd); int clif_bg_xy(struct map_session_data *sd); int clif_bg_xy_remove(struct map_session_data *sd); int clif_bg_belonginfo(struct map_session_data *sd); -int clif_bg_guild_id(struct block_list *bl); -int clif_bg_emblem_id(struct block_list *bl); +int clif_visual_guild_id(struct block_list *bl); +int clif_visual_emblem_id(struct block_list *bl); int clif_bg_emblem(struct map_session_data *sd, struct guild *g); int clif_bg_memberlist(struct map_session_data *sd); int clif_bg_leave(struct map_session_data *sd, const char *name, const char *mes); int clif_bg_leave_single(struct map_session_data *sd, const char *name, const char *mes); -int clif_bg_message(struct battleground_data *bg, int account_id, const char *mes, int len); +int clif_bg_message(struct battleground_data *bg, const char *name, const char *mes, int len); int clif_bg_expulsion_single(struct map_session_data *sd, const char *name, const char *mes); +int clif_bg_updatescore(int m); +int clif_bg_updatescore_single(struct map_session_data *sd); // atcommand int clif_displaymessage(const int fd,const char* mes); diff --git a/src/map/map.h b/src/map/map.h index 8fcfc6195..f96ae8db9 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -411,6 +411,7 @@ struct map_data { int m; short xs,ys; // map dimensions (in cells) short bxs,bys; // map dimensions (in blocks) + short bgscore_lion, bgscore_eagle; // Battleground ScoreBoard int npc_num; int users; int iwall_num; // Total of invisible walls in this map @@ -434,7 +435,7 @@ struct map_data { unsigned gvg : 1; // Now it identifies gvg versus maps that are active 24/7 unsigned gvg_dungeon : 1; // Celest unsigned gvg_noparty : 1; - unsigned battleground : 1; // [BattleGround System] + unsigned battleground : 2; // [BattleGround System] unsigned nozenypenalty : 1; unsigned notrade : 1; unsigned noskill : 1; diff --git a/src/map/script.c b/src/map/script.c index d7a3b1e07..5c1836c97 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -13405,6 +13405,20 @@ BUILDIN_FUNC(waitingroom2bg_single) return 0; } +BUILDIN_FUNC(bg_team_setxy) +{ + struct battleground_data *bg; + int bg_id; + + bg_id = script_getnum(st,2); + if( (bg = bg_team_search(bg_id)) == NULL ) + return 0; + + bg->x = script_getnum(st,3); + bg->y = script_getnum(st,4); + return 0; +} + BUILDIN_FUNC(bg_warp) { int x, y, mapindex, bg_id; @@ -13437,6 +13451,26 @@ BUILDIN_FUNC(bg_monster) return 0; } +BUILDIN_FUNC(bg_monster_set_team) +{ + struct mob_data *md; + struct block_list *mbl; + int id = script_getnum(st,2), + bg_id = script_getnum(st,3); + + if( (mbl = map_id2bl(id)) == NULL || mbl->type != BL_MOB ) + return 0; + md = (TBL_MOB *)mbl; + md->state.bg_id = bg_id; + + mob_stop_attack(md); + mob_stop_walking(md, 0); + md->target_id = md->attacked_id = 0; + clif_charnameack(0, &md->bl); + + return 0; +} + BUILDIN_FUNC(bg_leave) { struct map_session_data *sd = script_rid2sd(st); @@ -13489,6 +13523,22 @@ BUILDIN_FUNC(bg_getareausers) return 0; } +BUILDIN_FUNC(bg_updatescore) +{ + const char *str; + int m; + + str = script_getstr(st,2); + if( (m = map_mapname2mapid(str)) < 0 ) + return 0; + + map[m].bgscore_lion = script_getnum(st,3); + map[m].bgscore_eagle = script_getnum(st,4); + + clif_bg_updatescore(m); + return 0; +} + BUILDIN_FUNC(bg_get_data) { struct battleground_data *bg; @@ -13874,12 +13924,15 @@ struct script_function buildin_func[] = { // BattleGround BUILDIN_DEF(waitingroom2bg,"siiiss?"), BUILDIN_DEF(waitingroom2bg_single,"isiis"), + BUILDIN_DEF(bg_team_setxy,"iii"), BUILDIN_DEF(bg_warp,"isii"), BUILDIN_DEF(bg_monster,"isiisi*"), + BUILDIN_DEF(bg_monster_set_team,"ii"), BUILDIN_DEF(bg_leave,""), BUILDIN_DEF(bg_destroy,"i"), BUILDIN_DEF(areapercentheal,"siiiiii"), BUILDIN_DEF(bg_get_data,"ii"), BUILDIN_DEF(bg_getareausers,"isiiii"), + BUILDIN_DEF(bg_updatescore,"sii"), {NULL,NULL,NULL}, }; |