mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
Core/Battlefield:
* Update Logs filter * Fix typo in worldserver config (thx filo) * Fix some code style
This commit is contained in:
@@ -263,7 +263,7 @@ void Battlefield::InvitePlayerToWar(Player* player)
|
||||
{
|
||||
if (m_PlayersWillBeKick[player->GetTeamId()].count(player->GetGUID()) == 0)
|
||||
m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = time(NULL) + 10;
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if player is not already in war
|
||||
@@ -280,7 +280,7 @@ void Battlefield::InitStalker(uint32 entry, float x, float y, float z, float o)
|
||||
if (Creature* creature = SpawnCreature(entry, x, y, z, o, TEAM_NEUTRAL))
|
||||
StalkerGuid = creature->GetGUID();
|
||||
else
|
||||
sLog->outError(LOG_FILTER_GENERAL, "Battlefield::InitStalker: could not spawn Stalker (Creature entry %u), zone messeges will be un-available", entry);
|
||||
sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::InitStalker: could not spawn Stalker (Creature entry %u), zone messeges will be un-available", entry);
|
||||
}
|
||||
|
||||
void Battlefield::KickAfkPlayers()
|
||||
@@ -587,10 +587,10 @@ BfGraveyard* Battlefield::GetGraveyardById(uint32 id)
|
||||
if (m_GraveyardList[id])
|
||||
return m_GraveyardList[id];
|
||||
else
|
||||
sLog->outError(LOG_FILTER_GENERAL, "Battlefield::GetGraveyardById Id:%u not existed", id);
|
||||
sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::GetGraveyardById Id:%u not existed", id);
|
||||
}
|
||||
else
|
||||
sLog->outError(LOG_FILTER_GENERAL, "Battlefield::GetGraveyardById Id:%u cant be found", id);
|
||||
sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::GetGraveyardById Id:%u cant be found", id);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -684,7 +684,7 @@ void BfGraveyard::SetSpirit(Creature* spirit, TeamId team)
|
||||
{
|
||||
if (!spirit)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "BfGraveyard::SetSpirit: Invalid Spirit.");
|
||||
sLog->outError(LOG_FILTER_BATTLEFIELD, "BfGraveyard::SetSpirit: Invalid Spirit.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -798,14 +798,14 @@ Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl
|
||||
Map* map = const_cast < Map * >(sMapMgr->CreateBaseMap(m_MapId));
|
||||
if (!map)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "Battlefield::SpawnCreature: Can't create creature entry: %u map not found", entry);
|
||||
sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::SpawnCreature: Can't create creature entry: %u map not found", entry);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Creature* creature = new Creature;
|
||||
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, team, x, y, z, o))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_GENERAL, "Battlefield::SpawnCreature: Can't create creature entry: %u", entry);
|
||||
sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::SpawnCreature: Can't create creature entry: %u", entry);
|
||||
delete creature;
|
||||
return NULL;
|
||||
}
|
||||
@@ -1066,7 +1066,7 @@ bool BfCapturePoint::Update(uint32 diff)
|
||||
|
||||
if (m_OldState != m_State)
|
||||
{
|
||||
//sLog->outError(LOG_FILTER_GENERAL, "%u->%u", m_OldState, m_State);
|
||||
//sLog->outError(LOG_FILTER_BATTLEFIELD, "%u->%u", m_OldState, m_State);
|
||||
if (oldTeam != m_team)
|
||||
ChangeTeam(oldTeam);
|
||||
return true;
|
||||
|
||||
@@ -238,7 +238,7 @@ void BattlefieldWG::OnBattleStart()
|
||||
m_titansRelic->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
}
|
||||
else
|
||||
sLog->outError(LOG_FILTER_GENERAL, "WG: Failed to spawn titan relic.");
|
||||
sLog->outError(LOG_FILTER_BATTLEFIELD, "WG: Failed to spawn titan relic.");
|
||||
|
||||
|
||||
// Update tower visibility and update faction
|
||||
@@ -490,7 +490,7 @@ uint8 BattlefieldWG::GetSpiritGraveyardId(uint32 areaId)
|
||||
case AREA_THE_CHILLED_QUAGMIRE:
|
||||
return BATTLEFIELD_WG_GY_HORDE;
|
||||
default:
|
||||
sLog->outError(LOG_FILTER_GENERAL, "BattlefieldWG::GetSpiritGraveyardId: Unexpected Area Id %u", areaId);
|
||||
sLog->outError(LOG_FILTER_BATTLEFIELD, "BattlefieldWG::GetSpiritGraveyardId: Unexpected Area Id %u", areaId);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ enum WintergraspAreaIds
|
||||
class BfGraveyardWG : public BfGraveyard
|
||||
{
|
||||
public:
|
||||
BfGraveyardWG(BattlefieldWG *Bf);
|
||||
BfGraveyardWG(BattlefieldWG* Bf);
|
||||
|
||||
void SetTextId(uint32 textid) { m_GossipTextId = textid; }
|
||||
uint32 GetTextId() { return m_GossipTextId; }
|
||||
@@ -841,7 +841,8 @@ struct WintergraspTowerData
|
||||
uint8 const WG_MAX_ATTACKTOWERS = 3;
|
||||
// 192414 : 0 in sql, 1 in header
|
||||
// 192278 : 0 in sql, 3 in header
|
||||
const WintergraspTowerData AttackTowers[WG_MAX_ATTACKTOWERS] = {
|
||||
const WintergraspTowerData AttackTowers[WG_MAX_ATTACKTOWERS] =
|
||||
{
|
||||
// West tower
|
||||
{
|
||||
190356,
|
||||
|
||||
@@ -139,7 +139,7 @@ class npc_wg_demolisher_engineer : public CreatureScript
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender */, uint32 action)
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
|
||||
@@ -207,7 +207,7 @@ class npc_wg_spirit_guide : public CreatureScript
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* /*creature */ , uint32 /*sender */ , uint32 action)
|
||||
bool OnGossipSelect(Player* player, Creature* /*creature*/ , uint32 /*sender */ , uint32 action)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
|
||||
@@ -225,17 +225,16 @@ class npc_wg_spirit_guide : public CreatureScript
|
||||
|
||||
struct npc_wg_spirit_guideAI : public ScriptedAI
|
||||
{
|
||||
npc_wg_spirit_guideAI(Creature* creature) : ScriptedAI(creature)
|
||||
{ }
|
||||
npc_wg_spirit_guideAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void UpdateAI(const uint32 /* diff */)
|
||||
void UpdateAI(uint32 const /*diff*/)
|
||||
{
|
||||
if (!me->HasUnitState(UNIT_STATE_CASTING))
|
||||
DoCast(me, SPELL_CHANNEL_SPIRIT_HEAL);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature* creature) const
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_wg_spirit_guideAI(creature);
|
||||
}
|
||||
@@ -258,7 +257,7 @@ class npc_wg_queue : public CreatureScript
|
||||
if (wintergrasp->IsWarTime())
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam()? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, creature->GetGUID());
|
||||
player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, creature->GetGUID());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -275,7 +274,7 @@ class npc_wg_queue : public CreatureScript
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* /*creature */ , uint32 /*sender */ , uint32 /*action*/)
|
||||
bool OnGossipSelect(Player* player, Creature* /*creature*/ , uint32 /*sender*/ , uint32 /*action*/)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
|
||||
@@ -302,9 +301,7 @@ class go_wg_vehicle_teleporter : public GameObjectScript
|
||||
|
||||
struct go_wg_vehicle_teleporterAI : public GameObjectAI
|
||||
{
|
||||
go_wg_vehicle_teleporterAI(GameObject* gameObject) : GameObjectAI(gameObject),
|
||||
_checkTimer(1000)
|
||||
{ }
|
||||
go_wg_vehicle_teleporterAI(GameObject* gameObject) : GameObjectAI(gameObject), _checkTimer(1000) { }
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
@@ -324,6 +321,7 @@ class go_wg_vehicle_teleporter : public GameObjectScript
|
||||
}
|
||||
else _checkTimer -= diff;
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _checkTimer;
|
||||
};
|
||||
@@ -358,12 +356,12 @@ class npc_wg_quest_giver : public CreatureScript
|
||||
|
||||
for (QuestRelations::const_iterator i = objectQIR.first; i != objectQIR.second; ++i)
|
||||
{
|
||||
uint32 quest_id = i->second;
|
||||
QuestStatus status = player->GetQuestStatus(quest_id);
|
||||
uint32 questId = i->second;
|
||||
QuestStatus status = player->GetQuestStatus(questId);
|
||||
if (status == QUEST_STATUS_COMPLETE)
|
||||
qm.AddMenuItem(quest_id, 4);
|
||||
qm.AddMenuItem(questId, 4);
|
||||
else if (status == QUEST_STATUS_INCOMPLETE)
|
||||
qm.AddMenuItem(quest_id, 4);
|
||||
qm.AddMenuItem(questId, 4);
|
||||
//else if (status == QUEST_STATUS_AVAILABLE)
|
||||
// qm.AddMenuItem(quest_id, 2);
|
||||
}
|
||||
@@ -549,17 +547,14 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
void AddSC_wintergrasp()
|
||||
{
|
||||
new npc_wg_queue();
|
||||
new npc_wg_spirit_guide();
|
||||
new npc_wg_demolisher_engineer();
|
||||
new go_wg_vehicle_teleporter();
|
||||
new npc_wg_quest_giver();
|
||||
new achievement_wg_didnt_stand_a_chance();
|
||||
new spell_wintergrasp_force_building();
|
||||
new spell_wintergrasp_grab_passenger();
|
||||
|
||||
new go_wg_vehicle_teleporter();
|
||||
new achievement_wg_didnt_stand_a_chance();
|
||||
}
|
||||
|
||||
@@ -2185,7 +2185,7 @@ Battleground.Random.ResetHour = 6
|
||||
###################################################################################################
|
||||
|
||||
###################################################################################################
|
||||
# BATTLEFILED CONFIG
|
||||
# BATTLEFIELD CONFIG
|
||||
#
|
||||
# Wintergrasp.Enable
|
||||
# Description: Enable the Wintergrasp battlefield.
|
||||
|
||||
Reference in New Issue
Block a user