Skip to content

Instantly share code, notes, and snippets.

View walkline's full-sized avatar
🇺🇦

Anton Popovichenko walkline

🇺🇦
  • Mendix
  • The Hague
View GitHub Profile
DELETE FROM `command` WHERE `name` = 'spectate';
INSERT INTO `command` (`name`, `security`, `help`) VALUES ('spectate', 0, 'Syntax: .spectate #player\nAllow player to spectate arena.');
DELETE FROM `command` WHERE `name` = 'spectatefrom';
INSERT INTO `command` (`name`, `security`, `help`) VALUES ('spectatefrom', 0, 'Syntax: .spectatefrom #player\nAllow player to spectate arena from anotherplayer.');
DELETE FROM `command` WHERE `name` = 'spectatecancel';
INSERT INTO `command` (`name`, `security`, `help`) VALUES ('spectatecancel', 0, 'Syntax: .spectatecancel\nDisable spectator mode.');
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 4ad00f5..5356680 100755
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -1237,16 +1237,19 @@ void Battleground::EventPlayerLoggedOut(Player* player)
m_Players[guid].OfflineRemoveTime = sWorld->GetGameTime() + MAX_OFFLINE_TIME;
if (GetStatus() == STATUS_IN_PROGRESS)
{
- // drop flag and handle other cleanups
- RemovePlayer(player, guid, GetPlayerTeam(guid));
diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp
index 9f9cedf..3449d9e 100755
--- a/src/server/game/Chat/Commands/Level0.cpp
+++ b/src/server/game/Chat/Commands/Level0.cpp
@@ -244,9 +244,9 @@ bool ChatHandler::HandleSpectateCommand(const char *args)
float x, y, z;
target->GetContactPoint(_player, x, y, z);
+ _player->SetSpectate(true);
_player->TeleportTo(target->GetMapId(), x, y, z, _player->GetAngle(target), TELE_TO_GM_MODE);
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
index 0d76759..8bd9a0a 100755
--- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
@@ -166,6 +166,14 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, Battlegr
sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, Team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
}
+ //arena 3x3 & 5x5 announce
+ if (isRated && ginfo->ArenaType > 2)
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
index 0d76759..012cd1d 100755
--- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
@@ -166,6 +166,17 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, Battlegr
sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, Team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
}
+ //arena 3x3 & 5x5 announce
+ if (isRated && ginfo->ArenaType > 2 && leader)
diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp
index 3449d9e..cd7ef2c 100755
--- a/src/server/game/Chat/Commands/Level0.cpp
+++ b/src/server/game/Chat/Commands/Level0.cpp
@@ -28,6 +28,7 @@
#include "SystemConfig.h"
#include "revision.h"
#include "Util.h"
+#include "ArenaTeamMgr.h"
UPDATE `gameobject_template` SET `flags` = 36 WHERE entry IN (185918, 185917, 183970, 183971, 183972, 183973, 183977, 183979, 183978, 183980);
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 4ad00f5..5356680 100755
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -1237,16 +1237,19 @@ void Battleground::EventPlayerLoggedOut(Player* player)
m_Players[guid].OfflineRemoveTime = sWorld->GetGameTime() + MAX_OFFLINE_TIME;
if (GetStatus() == STATUS_IN_PROGRESS)
{
- // drop flag and handle other cleanups
- RemovePlayer(player, guid, GetPlayerTeam(guid));
diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp
index cd7ef2c..fe408b6 100755
--- a/src/server/game/Chat/Commands/Level0.cpp
+++ b/src/server/game/Chat/Commands/Level0.cpp
@@ -352,8 +352,8 @@ bool ChatHandler::HandleSpectateFromCommand(const char *args)
return false;
}
- (target == _player) ? _player->SetViewpoint(_player->getSpectateFrom(), false) :
- _player->SetViewpoint(target, true);
@walkline
walkline / gist:2629831
Created May 7, 2012 19:24
Dynamic teleporter
diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp
index 6322151..e7890cb 100755
@@ -63,6 +63,10 @@ void AddSC_wp_commandscript();
void AddSC_gps_commandscript();
#ifdef SCRIPTS
+//custom
+void AddSC_npc_teleporter();
+void AddSC_tp_commandscript();
+