Merge branch 'master' into Playerbot
This commit is contained in:
@@ -962,9 +962,19 @@ uint32 SmartAI::GetData(uint32 /*id*/) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SmartAI::SetData(uint32 id, uint32 value, Unit* invoker)
|
||||
void SmartAI::SetData(uint32 id, uint32 value, WorldObject* invoker)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, invoker, id, value);
|
||||
Unit* unit = nullptr;
|
||||
GameObject* gob = nullptr;
|
||||
|
||||
if (invoker)
|
||||
{
|
||||
unit = invoker->ToUnit();
|
||||
if (!unit)
|
||||
gob = invoker->ToGameObject();
|
||||
}
|
||||
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, unit, id, value, false, nullptr, gob);
|
||||
}
|
||||
|
||||
void SmartAI::SetGUID(ObjectGuid /*guid*/, int32 /*id*/)
|
||||
@@ -1132,7 +1142,7 @@ void SmartAI::MoveAway(float distance)
|
||||
}
|
||||
}
|
||||
|
||||
void SmartAI::SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker)
|
||||
void SmartAI::SetScript9(SmartScriptHolder& e, uint32 entry, WorldObject* invoker)
|
||||
{
|
||||
if (invoker)
|
||||
GetScript()->mLastInvoker = invoker->GetGUID();
|
||||
@@ -1232,12 +1242,22 @@ void SmartGameObjectAI::Destroyed(Player* player, uint32 eventId)
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DEATH, player, eventId, 0, false, nullptr, me);
|
||||
}
|
||||
|
||||
void SmartGameObjectAI::SetData(uint32 id, uint32 value, Unit* invoker)
|
||||
void SmartGameObjectAI::SetData(uint32 id, uint32 value, WorldObject* invoker)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, invoker, id, value);
|
||||
Unit* unit = nullptr;
|
||||
GameObject* gob = nullptr;
|
||||
|
||||
if (invoker)
|
||||
{
|
||||
unit = invoker->ToUnit();
|
||||
if (!unit)
|
||||
gob = invoker->ToGameObject();
|
||||
}
|
||||
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, unit, id, value, false, nullptr, gob);
|
||||
}
|
||||
|
||||
void SmartGameObjectAI::SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker)
|
||||
void SmartGameObjectAI::SetScript9(SmartScriptHolder& e, uint32 entry, WorldObject* invoker)
|
||||
{
|
||||
if (invoker)
|
||||
GetScript()->mLastInvoker = invoker->GetGUID();
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
void StopFollow(bool complete);
|
||||
void MoveAway(float distance);
|
||||
|
||||
void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker);
|
||||
void SetScript9(SmartScriptHolder& e, uint32 entry, WorldObject* invoker);
|
||||
SmartScript* GetScript() { return &mScript; }
|
||||
bool IsEscortInvokerInRange();
|
||||
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
|
||||
// Used in scripts to share variables
|
||||
void SetData(uint32 id, uint32 value) override { SetData(id, value, nullptr); }
|
||||
void SetData(uint32 id, uint32 value, Unit* invoker);
|
||||
void SetData(uint32 id, uint32 value, WorldObject* invoker);
|
||||
|
||||
// Used in scripts to share variables
|
||||
void SetGUID(ObjectGuid guid, int32 id = 0) override;
|
||||
@@ -274,8 +274,8 @@ public:
|
||||
bool QuestReward(Player* player, Quest const* quest, uint32 opt) override;
|
||||
void Destroyed(Player* player, uint32 eventId) override;
|
||||
void SetData(uint32 id, uint32 value) override { SetData(id, value, nullptr); }
|
||||
void SetData(uint32 id, uint32 value, Unit* invoker);
|
||||
void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker);
|
||||
void SetData(uint32 id, uint32 value, WorldObject* invoker);
|
||||
void SetScript9(SmartScriptHolder& e, uint32 entry, WorldObject* invoker);
|
||||
void OnGameEvent(bool start, uint16 eventId) override;
|
||||
void OnStateChanged(uint32 state, Unit* unit) override;
|
||||
void EventInform(uint32 eventId) override;
|
||||
|
||||
@@ -167,21 +167,29 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
if (unit)
|
||||
mLastInvoker = unit->GetGUID();
|
||||
else if (gob)
|
||||
mLastInvoker = gob->GetGUID();
|
||||
|
||||
if (Unit* tempInvoker = GetLastInvoker())
|
||||
if (WorldObject* tempInvoker = GetLastInvoker())
|
||||
LOG_DEBUG("sql.sql", "SmartScript::ProcessAction: Invoker: {} ({})", tempInvoker->GetName(), tempInvoker->GetGUID().ToString());
|
||||
|
||||
bool isControlled = e.action.moveToPos.controlled > 0;
|
||||
|
||||
ObjectVector targets;
|
||||
GetTargets(targets, e, unit);
|
||||
WorldObject* invoker = nullptr;
|
||||
if (unit)
|
||||
invoker = unit;
|
||||
else if (gob)
|
||||
invoker = gob;
|
||||
|
||||
GetTargets(targets, e, invoker);
|
||||
|
||||
switch (e.GetActionType())
|
||||
{
|
||||
case SMART_ACTION_TALK:
|
||||
{
|
||||
Creature* talker = e.target.type == 0 ? me : nullptr;
|
||||
Unit* talkTarget = nullptr;
|
||||
WorldObject* talkTarget = nullptr;
|
||||
|
||||
for (WorldObject* target : targets)
|
||||
{
|
||||
@@ -232,7 +240,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
sCreatureTextMgr->SendChat(target->ToCreature(), uint8(e.action.simpleTalk.textGroupID), IsPlayer(GetLastInvoker()) ? GetLastInvoker() : 0);
|
||||
else if (IsPlayer(target) && me)
|
||||
{
|
||||
Unit* templastInvoker = GetLastInvoker();
|
||||
WorldObject* templastInvoker = GetLastInvoker();
|
||||
sCreatureTextMgr->SendChat(me, uint8(e.action.simpleTalk.textGroupID), IsPlayer(templastInvoker) ? templastInvoker : 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_NEUTRAL, false, target->ToPlayer());
|
||||
}
|
||||
|
||||
@@ -783,7 +791,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
case SMART_ACTION_INVOKER_CAST:
|
||||
{
|
||||
// Can be used for area trigger cast
|
||||
Unit* tempLastInvoker = GetLastInvoker(unit);
|
||||
WorldObject* tempLastInvoker = GetLastInvoker(unit);
|
||||
if (!tempLastInvoker)
|
||||
break;
|
||||
|
||||
@@ -798,11 +806,14 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (!IsUnit(target))
|
||||
continue;
|
||||
|
||||
if (!IsUnit(tempLastInvoker))
|
||||
continue;
|
||||
|
||||
if (!(e.action.cast.castFlags & SMARTCAST_AURA_NOT_PRESENT) || !target->ToUnit()->HasAura(e.action.cast.spell))
|
||||
{
|
||||
if (e.action.cast.castFlags & SMARTCAST_INTERRUPT_PREVIOUS)
|
||||
{
|
||||
tempLastInvoker->InterruptNonMeleeSpells(false);
|
||||
tempLastInvoker->ToUnit()->InterruptNonMeleeSpells(false);
|
||||
}
|
||||
|
||||
TriggerCastFlags triggerFlags = TRIGGERED_NONE;
|
||||
@@ -818,7 +829,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
}
|
||||
}
|
||||
|
||||
tempLastInvoker->CastSpell(target->ToUnit(), e.action.cast.spell, triggerFlags);
|
||||
tempLastInvoker->ToUnit()->CastSpell(target->ToUnit(), e.action.cast.spell, triggerFlags);
|
||||
LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_INVOKER_CAST: Invoker {} casts spell {} on target {} with castflags {}",
|
||||
tempLastInvoker->GetGUID().ToString(), e.action.cast.spell, target->GetGUID().ToString(), e.action.cast.castFlags);
|
||||
}
|
||||
@@ -1397,16 +1408,28 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (Creature* cTarget = target->ToCreature())
|
||||
{
|
||||
CreatureAI* ai = cTarget->AI();
|
||||
if (IsSmart(cTarget))
|
||||
ENSURE_AI(SmartAI, ai)->SetData(e.action.setData.field, e.action.setData.data, me);
|
||||
// Make sure we check that the sender is either a creature or gameobject
|
||||
if (IsSmart(cTarget, true) && (me || go))
|
||||
{
|
||||
if (me)
|
||||
ENSURE_AI(SmartAI, ai)->SetData(e.action.setData.field, e.action.setData.data, me);
|
||||
else
|
||||
ENSURE_AI(SmartAI, ai)->SetData(e.action.setData.field, e.action.setData.data, go);
|
||||
}
|
||||
else
|
||||
ai->SetData(e.action.setData.field, e.action.setData.data);
|
||||
}
|
||||
else if (GameObject* oTarget = target->ToGameObject())
|
||||
{
|
||||
GameObjectAI* ai = oTarget->AI();
|
||||
if (IsSmart(oTarget))
|
||||
ENSURE_AI(SmartGameObjectAI, ai)->SetData(e.action.setData.field, e.action.setData.data, me);
|
||||
// Make sure we check that the sender is either a creature or gameobject
|
||||
if (IsSmart(oTarget, true) && (me || go))
|
||||
{
|
||||
if (me)
|
||||
ENSURE_AI(SmartGameObjectAI, ai)->SetData(e.action.setData.field, e.action.setData.data, me);
|
||||
else
|
||||
ENSURE_AI(SmartGameObjectAI, ai)->SetData(e.action.setData.field, e.action.setData.data, go);
|
||||
}
|
||||
else
|
||||
ai->SetData(e.action.setData.field, e.action.setData.data);
|
||||
}
|
||||
@@ -2900,7 +2923,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
if (e.action.setGuid.invokerGUID)
|
||||
{
|
||||
if (Unit* invoker = GetLastInvoker())
|
||||
if (WorldObject* invoker = GetLastInvoker())
|
||||
{
|
||||
guidToSend = invoker->GetGUID();
|
||||
}
|
||||
@@ -3318,12 +3341,12 @@ SmartScriptHolder SmartScript::CreateSmartEvent(SMART_EVENT e, uint32 event_flag
|
||||
return script;
|
||||
}
|
||||
|
||||
void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e, Unit* invoker /*= nullptr*/) const
|
||||
void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e, WorldObject* invoker /*= nullptr*/) const
|
||||
{
|
||||
Unit* scriptTrigger = nullptr;
|
||||
WorldObject* scriptTrigger = nullptr;
|
||||
if (invoker)
|
||||
scriptTrigger = invoker;
|
||||
else if (Unit* tempLastInvoker = GetLastInvoker())
|
||||
else if (WorldObject* tempLastInvoker = GetLastInvoker())
|
||||
scriptTrigger = tempLastInvoker;
|
||||
|
||||
WorldObject* baseObject = GetBaseObject();
|
||||
@@ -3399,8 +3422,9 @@ void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e,
|
||||
targets.push_back(scriptTrigger);
|
||||
break;
|
||||
case SMART_TARGET_ACTION_INVOKER_VEHICLE:
|
||||
if (scriptTrigger && scriptTrigger->GetVehicle() && scriptTrigger->GetVehicle()->GetBase())
|
||||
targets.push_back(scriptTrigger->GetVehicle()->GetBase());
|
||||
if (scriptTrigger && IsUnit(scriptTrigger))
|
||||
if (scriptTrigger->ToUnit()->GetVehicle() && scriptTrigger->ToUnit()->GetVehicle()->GetBase())
|
||||
targets.push_back(scriptTrigger->ToUnit()->GetVehicle()->GetBase());
|
||||
break;
|
||||
case SMART_TARGET_INVOKER_PARTY:
|
||||
if (scriptTrigger)
|
||||
@@ -4323,7 +4347,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
if (e.event.dataSet.id != var0 || e.event.dataSet.value != var1)
|
||||
return;
|
||||
RecalcTimer(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax);
|
||||
ProcessAction(e, unit, var0, var1);
|
||||
ProcessAction(e, unit, var0, var1, false, nullptr, gob);
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_PASSENGER_REMOVED:
|
||||
@@ -4352,11 +4376,16 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
case SMART_EVENT_EVENT_PHASE_CHANGE:
|
||||
{
|
||||
if (!IsInPhase(e.event.eventPhaseChange.phasemask))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ProcessAction(e, GetLastInvoker());
|
||||
WorldObject* templastInvoker = GetLastInvoker();
|
||||
if (!templastInvoker)
|
||||
return;
|
||||
|
||||
if (!IsUnit(templastInvoker))
|
||||
return;
|
||||
|
||||
ProcessAction(e, templastInvoker->ToUnit());
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_GAME_EVENT_START:
|
||||
@@ -5178,14 +5207,14 @@ void SmartScript::SetScript9(SmartScriptHolder& e, uint32 entry)
|
||||
}
|
||||
}
|
||||
|
||||
Unit* SmartScript::GetLastInvoker(Unit* invoker) const
|
||||
WorldObject* SmartScript::GetLastInvoker(WorldObject* invoker) const
|
||||
{
|
||||
// Xinef: Look for invoker only on map of base object... Prevents multithreaded crashes
|
||||
if (GetBaseObject())
|
||||
return ObjectAccessor::GetUnit(*GetBaseObject(), mLastInvoker);
|
||||
return ObjectAccessor::GetWorldObject(*GetBaseObject(), mLastInvoker);
|
||||
// xinef: used for area triggers invoker cast
|
||||
else if (invoker)
|
||||
return ObjectAccessor::GetUnit(*invoker, mLastInvoker);
|
||||
return ObjectAccessor::GetWorldObject(*invoker, mLastInvoker);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
static void InitTimer(SmartScriptHolder& e);
|
||||
void ProcessAction(SmartScriptHolder& e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, SpellInfo const* spell = nullptr, GameObject* gob = nullptr);
|
||||
void ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, uint32 const& max, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, SpellInfo const* spell = nullptr, GameObject* gob = nullptr);
|
||||
void GetTargets(ObjectVector& targets, SmartScriptHolder const& e, Unit* invoker = nullptr) const;
|
||||
void GetTargets(ObjectVector& targets, SmartScriptHolder const& e, WorldObject* invoker = nullptr) const;
|
||||
void GetWorldObjectsInDist(ObjectVector& objects, float dist) const;
|
||||
void InstallTemplate(SmartScriptHolder const& e);
|
||||
static SmartScriptHolder CreateSmartEvent(SMART_EVENT e, uint32 event_flags, uint32 event_param1, uint32 event_param2, uint32 event_param3, uint32 event_param4, uint32 event_param5, uint32 event_param6, SMART_ACTION action, uint32 action_param1, uint32 action_param2, uint32 action_param3, uint32 action_param4, uint32 action_param5, uint32 action_param6, SMARTAI_TARGETS t, uint32 target_param1, uint32 target_param2, uint32 target_param3, uint32 target_param4, uint32 phaseMask);
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
|
||||
//TIMED_ACTIONLIST (script type 9 aka script9)
|
||||
void SetScript9(SmartScriptHolder& e, uint32 entry);
|
||||
Unit* GetLastInvoker(Unit* invoker = nullptr) const;
|
||||
WorldObject* GetLastInvoker(WorldObject* invoker = nullptr) const;
|
||||
ObjectGuid mLastInvoker;
|
||||
typedef std::unordered_map<uint32, uint32> CounterMap;
|
||||
CounterMap mCounterList;
|
||||
|
||||
@@ -2473,10 +2473,15 @@ bool AchievementGlobalMgr::IsStatisticAchievement(AchievementEntry const* achiev
|
||||
|
||||
bool AchievementGlobalMgr::IsAverageCriteria(AchievementCriteriaEntry const* criteria) const
|
||||
{
|
||||
if ((sAchievementStore.LookupEntry(criteria->referredAchievement))->flags & ACHIEVEMENT_FLAG_AVERAGE)
|
||||
auto referencedAchievement = sAchievementStore.LookupEntry(criteria->referredAchievement);
|
||||
|
||||
if (!referencedAchievement)
|
||||
return false;
|
||||
|
||||
if (referencedAchievement->flags & ACHIEVEMENT_FLAG_AVERAGE)
|
||||
return true;
|
||||
|
||||
if (AchievementEntryList const* achRefList = GetAchievementByReferencedId(criteria->referredAchievement))
|
||||
if (AchievementEntryList const* achRefList = GetAchievementByReferencedId(referencedAchievement->ID))
|
||||
for (AchievementEntryList::const_iterator itr = achRefList->begin(); itr != achRefList->end(); ++itr)
|
||||
if ((*itr)->flags & ACHIEVEMENT_FLAG_AVERAGE)
|
||||
return true;
|
||||
|
||||
@@ -120,9 +120,8 @@ void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer)
|
||||
//spawn destroyed aura
|
||||
for (uint8 i = 0; i <= 9; i++)
|
||||
SpawnBGObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE + i, RESPAWN_IMMEDIATELY);
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if (creature)
|
||||
YellToAll(creature, GetAcoreString(LANG_BG_AV_A_CAPTAIN_DEAD), LANG_UNIVERSAL);
|
||||
if (Creature* creature = GetBGCreature(AV_CPLACE_HERALD))
|
||||
creature->AI()->Talk(AV_TEXT_HERALD_STORMPIKE_GENERAL_DEAD);
|
||||
DelCreature(AV_CPLACE_TRIGGER16);
|
||||
}
|
||||
else if (entry == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN])
|
||||
@@ -139,9 +138,8 @@ void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer)
|
||||
//spawn destroyed aura
|
||||
for (uint8 i = 0; i <= 9; i++)
|
||||
SpawnBGObject(BG_AV_OBJECT_BURN_BUILDING_HORDE + i, RESPAWN_IMMEDIATELY);
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if (creature)
|
||||
YellToAll(creature, GetAcoreString(LANG_BG_AV_H_CAPTAIN_DEAD), LANG_UNIVERSAL);
|
||||
if (Creature* creature = GetBGCreature(AV_CPLACE_HERALD))
|
||||
creature->AI()->Talk(AV_TEXT_HERALD_FROSTWOLF_GENERAL_DEAD);
|
||||
DelCreature(AV_CPLACE_TRIGGER18);
|
||||
}
|
||||
else if (entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_N_4] || entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_A_4] || entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_H_4])
|
||||
@@ -646,16 +644,9 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
}
|
||||
}
|
||||
}
|
||||
//send a nice message to all :)
|
||||
char buf[256];
|
||||
if (IsTower(node))
|
||||
snprintf(buf, sizeof(buf), GetAcoreString(LANG_BG_AV_TOWER_TAKEN), GetNodeName(node), (ownerId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
|
||||
else
|
||||
snprintf(buf, sizeof(buf), GetAcoreString(LANG_BG_AV_GRAVE_TAKEN), GetNodeName(node), (ownerId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
|
||||
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if (creature)
|
||||
YellToAll(creature, buf, LANG_UNIVERSAL);
|
||||
if (Creature* creature = GetBGCreature(AV_CPLACE_HERALD))
|
||||
creature->AI()->Talk(GetDefendString(node, ownerId));
|
||||
}
|
||||
|
||||
void BattlegroundAV::ChangeMineOwner(uint8 mine, TeamId teamId, bool initial)
|
||||
@@ -727,12 +718,8 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, TeamId teamId, bool initial)
|
||||
if (teamId == TEAM_ALLIANCE || teamId == TEAM_HORDE)
|
||||
{
|
||||
m_Mine_Reclaim_Timer[mine] = AV_MINE_RECLAIM_TIMER;
|
||||
char buf[256];
|
||||
snprintf(buf, sizeof(buf), GetAcoreString(LANG_BG_AV_MINE_TAKEN), (teamId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE),
|
||||
GetAcoreString((mine == AV_NORTH_MINE) ? LANG_BG_AV_MINE_NORTH : LANG_BG_AV_MINE_SOUTH));
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if (creature)
|
||||
YellToAll(creature, buf, LANG_UNIVERSAL);
|
||||
if (Creature* creature = GetBGCreature(AV_CPLACE_HERALD))
|
||||
creature->AI()->Talk(GetMineString(mine, teamId));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -980,18 +967,12 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
|
||||
SpawnBGObject(((teamId == TEAM_ALLIANCE) ? BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H) + i, RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
}
|
||||
//send a nice message to all :)
|
||||
char buf[256];
|
||||
snprintf(buf, sizeof(buf), GetAcoreString((IsTower(node)) ? LANG_BG_AV_TOWER_DEFENDED : LANG_BG_AV_GRAVE_DEFENDED), GetNodeName(node), (teamId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if (creature)
|
||||
YellToAll(creature, buf, LANG_UNIVERSAL);
|
||||
|
||||
if (Creature* creature = GetBGCreature(AV_CPLACE_HERALD))
|
||||
creature->AI()->Talk(GetDefendString(node, teamId));
|
||||
|
||||
//update the statistic for the defending player
|
||||
UpdatePlayerScore(player, (IsTower(node)) ? SCORE_TOWERS_DEFENDED : SCORE_GRAVEYARDS_DEFENDED, 1);
|
||||
if (IsTower(node))
|
||||
PlaySoundToAll(AV_SOUND_BOTH_TOWER_DEFEND);
|
||||
else
|
||||
PlaySoundToAll((teamId == TEAM_ALLIANCE) ? AV_SOUND_ALLIANCE_GOOD : AV_SOUND_HORDE_GOOD);
|
||||
}
|
||||
|
||||
void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
@@ -1092,15 +1073,11 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
// xinef: change here is too late, AssaultNode(node, team);
|
||||
UpdateNodeWorldState(node);
|
||||
|
||||
//send a nice message to all :)
|
||||
char buf[256];
|
||||
snprintf(buf, sizeof(buf), (IsTower(node)) ? GetAcoreString(LANG_BG_AV_TOWER_ASSAULTED) : GetAcoreString(LANG_BG_AV_GRAVE_ASSAULTED), GetNodeName(node), (teamId == TEAM_ALLIANCE) ? GetAcoreString(LANG_BG_AV_ALLY) : GetAcoreString(LANG_BG_AV_HORDE));
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if (creature)
|
||||
YellToAll(creature, buf, LANG_UNIVERSAL);
|
||||
if (Creature* creature = GetBGCreature(AV_CPLACE_HERALD))
|
||||
creature->AI()->Talk(GetAttackString(node, teamId));
|
||||
|
||||
//update the statistic for the assaulting player
|
||||
UpdatePlayerScore(player, (IsTower(node)) ? SCORE_TOWERS_ASSAULTED : SCORE_GRAVEYARDS_ASSAULTED, 1);
|
||||
PlaySoundToAll((teamId == TEAM_ALLIANCE) ? AV_SOUND_ALLIANCE_ASSAULTS : AV_SOUND_HORDE_ASSAULTS);
|
||||
|
||||
player->KilledMonsterCredit((IsTower(node)) ? BG_AV_QUEST_CREDIT_TOWER : BG_AV_QUEST_CREDIT_GRAVEYARD);
|
||||
}
|
||||
@@ -1466,46 +1443,226 @@ bool BattlegroundAV::SetupBattleground()
|
||||
return true;
|
||||
}
|
||||
|
||||
char const* BattlegroundAV::GetNodeName(BG_AV_Nodes node)
|
||||
uint8 BattlegroundAV::GetAttackString(BG_AV_Nodes node, TeamId teamId)
|
||||
{
|
||||
uint8 strId = 0;
|
||||
switch (node)
|
||||
{
|
||||
case BG_AV_NODES_FIRSTAID_STATION:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_GRAVE_STORM_AID);
|
||||
case BG_AV_NODES_DUNBALDAR_SOUTH:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_TOWER_DUN_S);
|
||||
case BG_AV_NODES_DUNBALDAR_NORTH:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_TOWER_DUN_N);
|
||||
case BG_AV_NODES_STORMPIKE_GRAVE:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_GRAVE_STORMPIKE);
|
||||
case BG_AV_NODES_ICEWING_BUNKER:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_TOWER_ICEWING);
|
||||
case BG_AV_NODES_STONEHEART_GRAVE:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_GRAVE_STONE);
|
||||
case BG_AV_NODES_STONEHEART_BUNKER:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_TOWER_STONE);
|
||||
case BG_AV_NODES_SNOWFALL_GRAVE:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_GRAVE_SNOW);
|
||||
case BG_AV_NODES_ICEBLOOD_TOWER:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_TOWER_ICE);
|
||||
case BG_AV_NODES_ICEBLOOD_GRAVE:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_GRAVE_ICE);
|
||||
case BG_AV_NODES_TOWER_POINT:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_TOWER_POINT);
|
||||
case BG_AV_NODES_FROSTWOLF_GRAVE:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_GRAVE_FROST);
|
||||
case BG_AV_NODES_FROSTWOLF_ETOWER:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_TOWER_FROST_E);
|
||||
case BG_AV_NODES_FROSTWOLF_WTOWER:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_TOWER_FROST_W);
|
||||
case BG_AV_NODES_FROSTWOLF_HUT:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_GRAVE_FROST_HUT);
|
||||
default:
|
||||
LOG_ERROR("bg.battleground", "tried to get name for node {}", node);
|
||||
break;
|
||||
case BG_AV_NODES_FIRSTAID_STATION:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_STORMPIKE_AID_STATION_ATTACK;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_STORMPIKE_AID_STATION_ATTACK;
|
||||
break;
|
||||
case BG_AV_NODES_DUNBALDAR_SOUTH:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_DUN_BALDAR_SOUTH_ATTACK;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_DUN_BALDAR_SOUTH_ATTACK;
|
||||
break;
|
||||
case BG_AV_NODES_DUNBALDAR_NORTH:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_DUN_BALDAR_NORTH_ATTACK;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_DUN_BALDAR_NORTH_ATTACK;
|
||||
break;
|
||||
case BG_AV_NODES_STORMPIKE_GRAVE:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_STORMPIKE_GRAVEYARD_ATTACK;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_STORMPIKE_GRAVEYARD_ATTACK;
|
||||
break;
|
||||
case BG_AV_NODES_ICEWING_BUNKER:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_ICEWING_BUNKER_ATTACK;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_ICEWING_BUNKER_ATTACK;
|
||||
break;
|
||||
case BG_AV_NODES_STONEHEART_GRAVE:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_STONEHEARTH_GRAVEYARD_ATTACK;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_STONEHEARTH_GRAVEYARD_ATTACK;
|
||||
break;
|
||||
case BG_AV_NODES_STONEHEART_BUNKER:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_STONEHEARTH_BUNKER_ATTACK;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_STONEHEARTH_BUNKER_ATTACK;
|
||||
break;
|
||||
case BG_AV_NODES_SNOWFALL_GRAVE:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_SNOWFALL_GRAVEYARD_ATTACK;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_SNOWFALL_GRAVEYARD_ATTACK;
|
||||
break;
|
||||
case BG_AV_NODES_ICEBLOOD_TOWER:
|
||||
strId = AV_TEXT_A_HERALD_ICEBLOOD_TOWER_ATTACK;
|
||||
break;
|
||||
case BG_AV_NODES_ICEBLOOD_GRAVE:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_ICEBLOOD_GRAVEYARD_ATTACK;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_ICEBLOOD_GRAVEYARD_ATTACK;
|
||||
break;
|
||||
case BG_AV_NODES_TOWER_POINT:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_TOWER_POINT_ATTACK;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_TOWER_POINT_ATTACK;
|
||||
break;
|
||||
case BG_AV_NODES_FROSTWOLF_GRAVE:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_FROSTWOLF_GRAVEYARD_ATTACK;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_FROSTWOLF_GRAVEYARD_ATTACK;
|
||||
break;
|
||||
case BG_AV_NODES_FROSTWOLF_ETOWER:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_EAST_FROSTWOLF_TOWER_ATTACK;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_EAST_FROSTWOLF_TOWER_ATTACK;
|
||||
break;
|
||||
case BG_AV_NODES_FROSTWOLF_WTOWER:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_WEST_FROSTWOLF_TOWER_ATTACK;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_WEST_FROSTWOLF_TOWER_ATTACK;
|
||||
break;
|
||||
case BG_AV_NODES_FROSTWOLF_HUT:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_FROSTWOLF_RELIEF_HUT_ATTACK;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_FROSTWOLF_RELIEF_HUT_ATTACK;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return "Unknown";
|
||||
return strId;
|
||||
}
|
||||
|
||||
uint8 BattlegroundAV::GetDefendString(BG_AV_Nodes node, TeamId teamId)
|
||||
{
|
||||
uint8 strId = 0;
|
||||
switch (node)
|
||||
{
|
||||
case BG_AV_NODES_FIRSTAID_STATION:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_STORMPIKE_AID_STATION_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_STORMPIKE_AID_STATION_TAKEN;
|
||||
break;
|
||||
case BG_AV_NODES_DUNBALDAR_SOUTH:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_DUN_BALDAR_SOUTH_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_DUN_BALDAR_SOUTH_TAKEN;
|
||||
break;
|
||||
case BG_AV_NODES_DUNBALDAR_NORTH:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_DUN_BALDAR_NORTH_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_DUN_BALDAR_NORTH_TAKEN;
|
||||
break;
|
||||
case BG_AV_NODES_STORMPIKE_GRAVE:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_STORMPIKE_GRAVEYARD_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_STORMPIKE_GRAVEYARD_TAKEN;
|
||||
break;
|
||||
case BG_AV_NODES_ICEWING_BUNKER:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_ICEWING_BUNKER_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_ICEWING_BUNKER_TAKEN;
|
||||
break;
|
||||
case BG_AV_NODES_STONEHEART_GRAVE:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_STONEHEARTH_GRAVEYARD_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_STONEHEARTH_GRAVEYARD_TAKEN;
|
||||
break;
|
||||
case BG_AV_NODES_STONEHEART_BUNKER:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_STONEHEARTH_BUNKER_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_STONEHEARTH_BUNKER_TAKEN;
|
||||
break;
|
||||
case BG_AV_NODES_SNOWFALL_GRAVE:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_SNOWFALL_GRAVEYARD_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_SNOWFALL_GRAVEYARD_TAKEN;
|
||||
break;
|
||||
case BG_AV_NODES_ICEBLOOD_TOWER:
|
||||
strId = AV_TEXT_A_HERALD_ICEBLOOD_TOWER_TAKEN;
|
||||
break;
|
||||
case BG_AV_NODES_ICEBLOOD_GRAVE:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_ICEBLOOD_GRAVEYARD_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_ICEBLOOD_GRAVEYARD_TAKEN;
|
||||
break;
|
||||
case BG_AV_NODES_TOWER_POINT:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_TOWER_POINT_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_TOWER_POINT_TAKEN;
|
||||
break;
|
||||
case BG_AV_NODES_FROSTWOLF_GRAVE:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_FROSTWOLF_GRAVEYARD_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_FROSTWOLF_GRAVEYARD_TAKEN;
|
||||
break;
|
||||
case BG_AV_NODES_FROSTWOLF_ETOWER:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_EAST_FROSTWOLF_TOWER_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_EAST_FROSTWOLF_TOWER_TAKEN;
|
||||
break;
|
||||
case BG_AV_NODES_FROSTWOLF_WTOWER:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_WEST_FROSTWOLF_TOWER_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_WEST_FROSTWOLF_TOWER_TAKEN;
|
||||
break;
|
||||
case BG_AV_NODES_FROSTWOLF_HUT:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_FROSTWOLF_RELIEF_HUT_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_FROSTWOLF_RELIEF_HUT_TAKEN;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return strId;
|
||||
}
|
||||
|
||||
uint8 BattlegroundAV::GetMineString(uint8 mineId, TeamId teamId)
|
||||
{
|
||||
uint8 strId = 0;
|
||||
switch (mineId)
|
||||
{
|
||||
case AV_NORTH_MINE:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_IRONDEEP_MINE_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_IRONDEEP_MINE_TAKEN;
|
||||
break;
|
||||
case AV_SOUTH_MINE:
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
strId = AV_TEXT_A_HERALD_COLDTOOTH_MINE_TAKEN;
|
||||
else
|
||||
strId = AV_TEXT_H_HERALD_COLDTOOTH_MINE_TAKEN;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return strId;
|
||||
}
|
||||
|
||||
void BattlegroundAV::AssaultNode(BG_AV_Nodes node, TeamId teamId)
|
||||
|
||||
@@ -1645,6 +1645,78 @@ enum BG_AV_Objectives
|
||||
AV_OBJECTIVE_DEFEND_GRAVEYARD = 65
|
||||
};
|
||||
|
||||
enum BG_AV_HERALD
|
||||
{
|
||||
AV_TEXT_A_HERALD_STORMPIKE_GRAVEYARD_TAKEN = 1,
|
||||
AV_TEXT_A_HERALD_STORMPIKE_GRAVEYARD_ATTACK = 2,
|
||||
AV_TEXT_H_HERALD_STORMPIKE_GRAVEYARD_TAKEN = 3,
|
||||
AV_TEXT_H_HERALD_STORMPIKE_GRAVEYARD_ATTACK = 4,
|
||||
AV_TEXT_A_HERALD_SNOWFALL_GRAVEYARD_TAKEN = 5,
|
||||
AV_TEXT_A_HERALD_SNOWFALL_GRAVEYARD_ATTACK = 6,
|
||||
AV_TEXT_H_HERALD_SNOWFALL_GRAVEYARD_TAKEN = 7,
|
||||
AV_TEXT_H_HERALD_SNOWFALL_GRAVEYARD_ATTACK = 8,
|
||||
AV_TEXT_A_HERALD_FROSTWOLF_GRAVEYARD_TAKEN = 9,
|
||||
AV_TEXT_A_HERALD_FROSTWOLF_GRAVEYARD_ATTACK = 10,
|
||||
AV_TEXT_H_HERALD_FROSTWOLF_GRAVEYARD_TAKEN = 11,
|
||||
AV_TEXT_H_HERALD_FROSTWOLF_GRAVEYARD_ATTACK = 12,
|
||||
AV_TEXT_H_HERALD_DUN_BALDAR_SOUTH_ATTACK = 13,
|
||||
AV_TEXT_H_HERALD_DUN_BALDAR_SOUTH_TAKEN = 14,
|
||||
AV_TEXT_A_HERALD_DUN_BALDAR_SOUTH_ATTACK = 15,
|
||||
AV_TEXT_A_HERALD_DUN_BALDAR_SOUTH_TAKEN = 16,
|
||||
AV_TEXT_H_HERALD_DUN_BALDAR_NORTH_ATTACK = 17,
|
||||
AV_TEXT_H_HERALD_DUN_BALDAR_NORTH_TAKEN = 18,
|
||||
AV_TEXT_A_HERALD_DUN_BALDAR_NORTH_ATTACK = 19,
|
||||
AV_TEXT_A_HERALD_DUN_BALDAR_NORTH_TAKEN = 20,
|
||||
AV_TEXT_H_HERALD_ICEWING_BUNKER_ATTACK = 21,
|
||||
AV_TEXT_H_HERALD_ICEWING_BUNKER_TAKEN = 22,
|
||||
AV_TEXT_A_HERALD_ICEWING_BUNKER_ATTACK = 23,
|
||||
AV_TEXT_A_HERALD_ICEWING_BUNKER_TAKEN = 24,
|
||||
AV_TEXT_H_HERALD_STONEHEARTH_BUNKER_ATTACK = 25,
|
||||
AV_TEXT_H_HERALD_STONEHEARTH_BUNKER_TAKEN = 26,
|
||||
AV_TEXT_A_HERALD_STONEHEARTH_BUNKER_ATTACK = 27,
|
||||
AV_TEXT_A_HERALD_STONEHEARTH_BUNKER_TAKEN = 28,
|
||||
AV_TEXT_H_HERALD_WEST_FROSTWOLF_TOWER_ATTACK = 29,
|
||||
AV_TEXT_H_HERALD_WEST_FROSTWOLF_TOWER_TAKEN = 30,
|
||||
AV_TEXT_A_HERALD_WEST_FROSTWOLF_TOWER_ATTACK = 31,
|
||||
AV_TEXT_A_HERALD_WEST_FROSTWOLF_TOWER_TAKEN = 32,
|
||||
AV_TEXT_H_HERALD_EAST_FROSTWOLF_TOWER_ATTACK = 33,
|
||||
AV_TEXT_H_HERALD_EAST_FROSTWOLF_TOWER_TAKEN = 34,
|
||||
AV_TEXT_A_HERALD_EAST_FROSTWOLF_TOWER_ATTACK = 35,
|
||||
AV_TEXT_A_HERALD_EAST_FROSTWOLF_TOWER_TAKEN = 36,
|
||||
AV_TEXT_H_HERALD_TOWER_POINT_ATTACK = 37,
|
||||
AV_TEXT_H_HERALD_TOWER_POINT_TAKEN = 38,
|
||||
AV_TEXT_A_HERALD_TOWER_POINT_ATTACK = 39,
|
||||
AV_TEXT_A_HERALD_TOWER_POINT_TAKEN = 40,
|
||||
AV_TEXT_H_HERALD_ICEBLOOD_BUNKER_ATTACK = 41,
|
||||
AV_TEXT_H_HERALD_ICEBLOOD_BUNKER_TAKEN = 42,
|
||||
AV_TEXT_A_HERALD_ICEBLOOD_TOWER_ATTACK = 43,
|
||||
AV_TEXT_A_HERALD_ICEBLOOD_TOWER_TAKEN = 44,
|
||||
AV_TEXT_H_HERALD_STORMPIKE_AID_STATION_TAKEN = 45,
|
||||
AV_TEXT_H_HERALD_STORMPIKE_AID_STATION_ATTACK = 46,
|
||||
AV_TEXT_A_HERALD_STORMPIKE_AID_STATION_TAKEN = 47,
|
||||
AV_TEXT_A_HERALD_STORMPIKE_AID_STATION_ATTACK = 48,
|
||||
AV_TEXT_H_HERALD_FROSTWOLF_RELIEF_HUT_TAKEN = 49,
|
||||
AV_TEXT_H_HERALD_FROSTWOLF_RELIEF_HUT_ATTACK = 50,
|
||||
AV_TEXT_A_HERALD_FROSTWOLF_RELIEF_HUT_TAKEN = 51,
|
||||
AV_TEXT_A_HERALD_FROSTWOLF_RELIEF_HUT_ATTACK = 52,
|
||||
AV_TEXT_H_HERALD_STONEHEARTH_GRAVEYARD_TAKEN = 53,
|
||||
AV_TEXT_H_HERALD_STONEHEARTH_GRAVEYARD_ATTACK = 54,
|
||||
AV_TEXT_A_HERALD_STONEHEARTH_GRAVEYARD_TAKEN = 55,
|
||||
AV_TEXT_A_HERALD_STONEHEARTH_GRAVEYARD_ATTACK = 56,
|
||||
AV_TEXT_H_HERALD_ICEBLOOD_GRAVEYARD_TAKEN = 57,
|
||||
AV_TEXT_H_HERALD_ICEBLOOD_GRAVEYARD_ATTACK = 58,
|
||||
AV_TEXT_A_HERALD_ICEBLOOD_GRAVEYARD_TAKEN = 59,
|
||||
AV_TEXT_A_HERALD_ICEBLOOD_GRAVEYARD_ATTACK = 60,
|
||||
AV_TEXT_A_HERALD_COLDTOOTH_MINE_TAKEN = 61,
|
||||
AV_TEXT_A_HERALD_IRONDEEP_MINE_TAKEN = 62,
|
||||
AV_TEXT_H_HERALD_COLDTOOTH_MINE_TAKEN = 63,
|
||||
AV_TEXT_H_HERALD_IRONDEEP_MINE_TAKEN = 64,
|
||||
AV_TEXT_HERALD_FROSTWOLF_GENERAL_DEAD = 65,
|
||||
AV_TEXT_HERALD_STORMPIKE_GENERAL_DEAD = 66,
|
||||
AV_TEXT_A_HERALD_WIN = 67,
|
||||
AV_TEXT_H_HERALD_WIN = 68
|
||||
};
|
||||
|
||||
struct BG_AV_NodeInfo
|
||||
{
|
||||
BG_AV_States State;
|
||||
@@ -1766,9 +1838,12 @@ private:
|
||||
|
||||
BG_AV_Nodes GetNodeThroughObject(uint32 object);
|
||||
uint32 GetObjectThroughNode(BG_AV_Nodes node);
|
||||
char const* GetNodeName(BG_AV_Nodes node);
|
||||
bool IsTower(BG_AV_Nodes node) { return m_Nodes[node].Tower; }
|
||||
|
||||
uint8 GetAttackString(BG_AV_Nodes node, TeamId teamId);
|
||||
uint8 GetDefendString(BG_AV_Nodes node, TeamId teamId);
|
||||
uint8 GetMineString(uint8 mine, TeamId teamId);
|
||||
|
||||
/*mine*/
|
||||
void ChangeMineOwner(uint8 mine, TeamId teamId, bool initial = false);
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "GameTime.h"
|
||||
#include "Log.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "World.h"
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "ItemTemplate.h"
|
||||
#include "LootMgr.h"
|
||||
#include "Unit.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "World.h"
|
||||
#include <list>
|
||||
|
||||
|
||||
@@ -18,14 +18,11 @@
|
||||
#ifndef AZEROTHCORE_CREATUREDATA_H
|
||||
#define AZEROTHCORE_CREATUREDATA_H
|
||||
|
||||
#include "Cell.h"
|
||||
#include "Common.h"
|
||||
#include "DBCEnums.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "ItemTemplate.h"
|
||||
#include "LootMgr.h"
|
||||
#include "Unit.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "World.h"
|
||||
#include <list>
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "GameTime.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Opcodes.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "Transport.h"
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "CellImpl.h"
|
||||
#include "CreatureAISelector.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "DynamicTree.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "GameObjectModel.h"
|
||||
#include "GameTime.h"
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "Object.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "Unit.h"
|
||||
#include <array>
|
||||
|
||||
class GameObjectAI;
|
||||
class Transport;
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#ifndef _ITEMPROTOTYPE_H
|
||||
#define _ITEMPROTOTYPE_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "WorldPacket.h"
|
||||
#include <unordered_map>
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include "UpdateFields.h"
|
||||
|
||||
class ElunaEventProcessor;
|
||||
|
||||
enum TempSummonType
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
#include <deque>
|
||||
#include <functional>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <type_traits>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include "ByteBuffer.h"
|
||||
#include "Errors.h"
|
||||
#include "UpdateFields.h"
|
||||
|
||||
class UpdateMask
|
||||
{
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
#include "Formulas.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "GameGraveyard.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "GameTime.h"
|
||||
#include "GossipDef.h"
|
||||
#include "GridNotifiers.h"
|
||||
@@ -63,7 +62,6 @@
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "Pet.h"
|
||||
#include "PetitionMgr.h"
|
||||
#include "QueryHolder.h"
|
||||
#include "QuestDef.h"
|
||||
#include "Realm.h"
|
||||
#include "ReputationMgr.h"
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "GroupReference.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "Item.h"
|
||||
#include "KillRewarder.h"
|
||||
#include "MapReference.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Optional.h"
|
||||
@@ -38,7 +37,6 @@
|
||||
#include "QuestDef.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "TradeData.h"
|
||||
#include "Unit.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
@@ -20,9 +20,7 @@
|
||||
#include "ArenaTeam.h"
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "Battlefield.h"
|
||||
#include "BattlefieldMgr.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundAV.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Channel.h"
|
||||
#include "CharacterDatabaseCleaner.h"
|
||||
@@ -69,7 +67,6 @@
|
||||
#include "UpdateFieldFlags.h"
|
||||
#include "Util.h"
|
||||
#include "Vehicle.h"
|
||||
#include "Weather.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#define __PLAYER_TAXI_H__
|
||||
|
||||
#include "DBCStructure.h"
|
||||
#include <vector>
|
||||
|
||||
class ByteBuffer;
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#ifndef __ACORE_SOCIALMGR_H
|
||||
#define __ACORE_SOCIALMGR_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include <map>
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "Spell.h"
|
||||
#include "Vehicle.h"
|
||||
#include "World.h"
|
||||
#include "WorldModel.h"
|
||||
|
||||
MotionTransport::MotionTransport() : Transport(), _transportInfo(nullptr), _isMoving(true), _pendingStop(false), _triggeredArrivalEvent(false), _triggeredDepartureEvent(false), _passengersLoaded(false), _delayedTeleport(false)
|
||||
|
||||
@@ -33,12 +33,10 @@
|
||||
#include "CreatureGroups.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "DynamicVisibility.h"
|
||||
#include "Formulas.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "GameTime.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Group.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "Log.h"
|
||||
#include "MapMgr.h"
|
||||
#include "MoveSpline.h"
|
||||
@@ -2343,7 +2341,7 @@ void Unit::CalcAbsorbResist(DamageInfo& dmgInfo, bool Splited)
|
||||
{
|
||||
// We're going to call functions which can modify content of the list during iteration over it's elements
|
||||
// Let's copy the list so we can prevent iterator invalidation
|
||||
AuraEffectList vSplitDamageFlatCopy(victim->GetAuraEffectsByType(SPELL_AURA_SPLIT_DAMAGE_FLAT));
|
||||
AuraEffectList vSplitDamageFlatCopy(victim->GetAuraEffectsByType(SPELL_AURA_SPLIT_DAMAGE_FLAT)); // Not used by any spell
|
||||
for (AuraEffectList::iterator itr = vSplitDamageFlatCopy.begin(); (itr != vSplitDamageFlatCopy.end()) && (dmgInfo.GetDamage() > 0); ++itr)
|
||||
{
|
||||
// Check if aura was removed during iteration - we don't need to work on such auras
|
||||
@@ -2358,6 +2356,13 @@ void Unit::CalcAbsorbResist(DamageInfo& dmgInfo, bool Splited)
|
||||
if (!caster || (caster == victim) || !caster->IsInWorld() || !caster->IsAlive())
|
||||
continue;
|
||||
|
||||
// Limit effect range to spell's cast range. (Only for single target auras, AreaAuras don't need it)
|
||||
// Ignore LOS attribute is only used for the cast portion of the spell
|
||||
SpellInfo const* splitSpellInfo = (*itr)->GetSpellInfo();
|
||||
if (!splitSpellInfo->Effects[(*itr)->GetEffIndex()].IsAreaAuraEffect())
|
||||
if (!caster->IsWithinDist(victim, splitSpellInfo->GetMaxRange(splitSpellInfo->IsPositive(), caster)))
|
||||
continue;
|
||||
|
||||
int32 splitDamage = (*itr)->GetAmount();
|
||||
|
||||
// absorb must be smaller than the damage itself
|
||||
@@ -2418,10 +2423,11 @@ void Unit::CalcAbsorbResist(DamageInfo& dmgInfo, bool Splited)
|
||||
if (!caster || (caster == victim) || !caster->IsInWorld() || !caster->IsAlive())
|
||||
continue;
|
||||
|
||||
// Xinef: Single Target splits require LoS
|
||||
// Limit effect range to spell's cast range. (Only for single target auras, AreaAuras don't need it)
|
||||
// Ignore LOS attribute is only used for the cast portion of the spell
|
||||
SpellInfo const* splitSpellInfo = (*itr)->GetSpellInfo();
|
||||
if (!splitSpellInfo->Effects[(*itr)->GetEffIndex()].IsAreaAuraEffect() && !splitSpellInfo->HasAttribute(SPELL_ATTR2_IGNORE_LINE_OF_SIGHT))
|
||||
if (!caster->IsWithinLOSInMap(victim) || !caster->IsWithinDist(victim, splitSpellInfo->GetMaxRange(splitSpellInfo->IsPositive(), caster)))
|
||||
if (!splitSpellInfo->Effects[(*itr)->GetEffIndex()].IsAreaAuraEffect())
|
||||
if (!caster->IsWithinDist(victim, splitSpellInfo->GetMaxRange(splitSpellInfo->IsPositive(), caster)))
|
||||
continue;
|
||||
|
||||
uint32 splitDamage = CalculatePct(dmgInfo.GetDamage(), (*itr)->GetAmount());
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "ItemTemplate.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "Object.h"
|
||||
#include "Optional.h"
|
||||
#include "SpellAuraDefines.h"
|
||||
#include "SpellDefines.h"
|
||||
#include "ThreatMgr.h"
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "Unit.h"
|
||||
#include "Util.h"
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
#ifndef __ACORE_VEHICLE_H
|
||||
#define __ACORE_VEHICLE_H
|
||||
|
||||
#include "EventProcessor.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Unit.h"
|
||||
#include "VehicleDefines.h"
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include "Define.h"
|
||||
#include "Map.h"
|
||||
#include "Object.h"
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include "WorldSession.h"
|
||||
#include <iostream>
|
||||
|
||||
#include "SpellMgr.h"
|
||||
|
||||
class Player;
|
||||
//class Map;
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ void WorldSession::SendAuctionHello(ObjectGuid guid, Creature* unit)
|
||||
{
|
||||
if (GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_AUCTION_REQ), sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ));
|
||||
SendNotification(LANG_AUCTION_REQ, sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
break;
|
||||
default:
|
||||
{
|
||||
if (sWorld->getBoolConfig(CONFIG_CHAT_MUTE_FIRST_LOGIN))
|
||||
if (sWorld->getBoolConfig(CONFIG_CHAT_MUTE_FIRST_LOGIN) && lang != LANG_ADDON)
|
||||
{
|
||||
uint32 minutes = sWorld->getIntConfig(CONFIG_CHAT_TIME_MUTE_FIRST_LOGIN);
|
||||
|
||||
@@ -164,7 +164,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
|
||||
if (sender->HasAura(1852) && type != CHAT_MSG_WHISPER)
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_GM_SILENCE), sender->GetName().c_str());
|
||||
SendNotification(LANG_GM_SILENCE, sender->GetName());
|
||||
recvData.rfinish();
|
||||
return;
|
||||
}
|
||||
@@ -296,7 +296,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
if (!_player->CanSpeak())
|
||||
{
|
||||
std::string timeStr = secsToTimeString(m_muteTime - GameTime::GetGameTime().count());
|
||||
SendNotification(GetAcoreString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str());
|
||||
SendNotification(LANG_WAIT_BEFORE_SPEAKING, timeStr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -361,7 +361,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
|
||||
if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ));
|
||||
SendNotification(LANG_SAY_REQ, sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
|
||||
if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) && receiver != sender)
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_WHISPER_REQ), sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ));
|
||||
SendNotification(LANG_WHISPER_REQ, sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
// pussywizard: optimization
|
||||
if (GetPlayer()->HasAura(1852) && !receiver->IsGameMaster())
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_GM_SILENCE), GetPlayer()->GetName().c_str());
|
||||
SendNotification(LANG_GM_SILENCE, GetPlayer()->GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -601,7 +601,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
{
|
||||
if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_CHANNEL_REQ), sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ));
|
||||
SendNotification(LANG_CHANNEL_REQ, sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -746,7 +746,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData)
|
||||
if (!GetPlayer()->CanSpeak())
|
||||
{
|
||||
std::string timeStr = secsToTimeString(m_muteTime - GameTime::GetGameTime().count());
|
||||
SendNotification(GetAcoreString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str());
|
||||
SendNotification(LANG_WAIT_BEFORE_SPEAKING, timeStr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
|
||||
|
||||
if (player->GetLevel() < sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_MAIL_SENDER_REQ), sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ));
|
||||
SendNotification(LANG_MAIL_SENDER_REQ, sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recvData)
|
||||
|
||||
if (GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_TICKET_REQ), sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ));
|
||||
SendNotification(LANG_TICKET_REQ, sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -574,7 +574,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
|
||||
if (GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_TRADE_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
|
||||
SendNotification(LANG_TRADE_REQ, sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
|
||||
if (pOther->GetLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_TRADE_OTHER_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
|
||||
SendNotification(LANG_TRADE_OTHER_REQ, sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -468,9 +468,20 @@ bool LootItem::AllowedForPlayer(Player const* player, ObjectGuid source) const
|
||||
}
|
||||
|
||||
// check quest requirements
|
||||
if (!(pProto->FlagsCu & ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && ((needs_quest || (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE)) && !player->HasQuestForItem(itemid)))
|
||||
if (!(pProto->FlagsCu & ITEM_FLAGS_CU_IGNORE_QUEST_STATUS))
|
||||
{
|
||||
return false;
|
||||
// Don't drop quest items if the player is missing the relevant quest
|
||||
if (needs_quest && !player->HasQuestForItem(itemid))
|
||||
return false;
|
||||
|
||||
// for items that start quests
|
||||
if (pProto->StartQuest)
|
||||
{
|
||||
// Don't drop the item if the player has already finished the quest OR player already has the item in their inventory, and that item is unique OR the player has not finished a prerequisite quest
|
||||
uint32 prevQuestId = sObjectMgr->GetQuestTemplate(pProto->StartQuest) ? sObjectMgr->GetQuestTemplate(pProto->StartQuest)->GetPrevQuestId() : 0;
|
||||
if (player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE || (player->HasItemCount(itemid, pProto->MaxCount) && pProto->MaxCount) || (prevQuestId && !player->GetQuestRewardStatus(prevQuestId)))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!sScriptMgr->OnAllowedForPlayerLootCheck(player, source))
|
||||
|
||||
@@ -415,7 +415,12 @@ enum AcoreStrings
|
||||
LANG_COMMAND_RESET_ITEMS_ALL_BAGS = 372,
|
||||
// [END] reset items command strings
|
||||
|
||||
// Room for more level 2 373-399 not used
|
||||
// .aura stack
|
||||
LANG_COMMAND_AURASTACK_NO_AURA = 373,
|
||||
LANG_COMMAND_AURASTACK_NO_STACK = 374,
|
||||
LANG_COMMAND_AURASTACK_CANT_STACK = 375,
|
||||
|
||||
// Room for more level 2 376-399 not used
|
||||
|
||||
// level 3 chat
|
||||
LANG_SCRIPTS_RELOADED = 400,
|
||||
@@ -975,43 +980,7 @@ enum AcoreStrings
|
||||
LANG_DEBUG_AREATRIGGER_OFF = 1203,
|
||||
LANG_DEBUG_AREATRIGGER_REACHED = 1204,
|
||||
|
||||
// 1205-1299 - free
|
||||
|
||||
// 1300-1333
|
||||
// AV
|
||||
LANG_BG_AV_ALLY = 1300,
|
||||
LANG_BG_AV_HORDE = 1301,
|
||||
LANG_BG_AV_TOWER_TAKEN = 1302,
|
||||
LANG_BG_AV_TOWER_ASSAULTED = 1303,
|
||||
LANG_BG_AV_TOWER_DEFENDED = 1304,
|
||||
LANG_BG_AV_GRAVE_TAKEN = 1305,
|
||||
LANG_BG_AV_GRAVE_DEFENDED = 1306,
|
||||
LANG_BG_AV_GRAVE_ASSAULTED = 1307,
|
||||
|
||||
LANG_BG_AV_MINE_TAKEN = 1308,
|
||||
LANG_BG_AV_MINE_NORTH = 1309,
|
||||
LANG_BG_AV_MINE_SOUTH = 1310,
|
||||
|
||||
LANG_BG_AV_NODE_GRAVE_STORM_AID = 1311,
|
||||
LANG_BG_AV_NODE_TOWER_DUN_S = 1312,
|
||||
LANG_BG_AV_NODE_TOWER_DUN_N = 1313,
|
||||
LANG_BG_AV_NODE_GRAVE_STORMPIKE = 1314,
|
||||
LANG_BG_AV_NODE_TOWER_ICEWING = 1315,
|
||||
LANG_BG_AV_NODE_GRAVE_STONE = 1316,
|
||||
LANG_BG_AV_NODE_TOWER_STONE = 1317,
|
||||
LANG_BG_AV_NODE_GRAVE_SNOW = 1318,
|
||||
LANG_BG_AV_NODE_TOWER_ICE = 1319,
|
||||
LANG_BG_AV_NODE_GRAVE_ICE = 1320,
|
||||
LANG_BG_AV_NODE_TOWER_POINT = 1321,
|
||||
LANG_BG_AV_NODE_GRAVE_FROST = 1322,
|
||||
LANG_BG_AV_NODE_TOWER_FROST_E = 1323,
|
||||
LANG_BG_AV_NODE_TOWER_FROST_W = 1324,
|
||||
LANG_BG_AV_NODE_GRAVE_FROST_HUT = 1325,
|
||||
|
||||
// 1326-1330 - free
|
||||
|
||||
LANG_BG_AV_H_CAPTAIN_DEAD = 1331,
|
||||
LANG_BG_AV_A_CAPTAIN_DEAD = 1332,
|
||||
// 1205-1333 - free
|
||||
|
||||
//Player Ticket Strings
|
||||
LANG_TICKET_CLOSED = 1334,
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "QueryHolder.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SocialMgr.h"
|
||||
#include "Tokenize.h"
|
||||
#include "Transport.h"
|
||||
#include "Vehicle.h"
|
||||
#include "WardenMac.h"
|
||||
@@ -813,37 +814,12 @@ bool WorldSession::DisallowHyperlinksAndMaybeKick(std::string_view str)
|
||||
return false;
|
||||
}
|
||||
|
||||
void WorldSession::SendNotification(const char* format, ...)
|
||||
void WorldSession::SendNotification(std::string_view str)
|
||||
{
|
||||
if (format)
|
||||
WorldPacket data(SMSG_NOTIFICATION, str.size() + 1);
|
||||
for (std::string_view line : Acore::Tokenize(str, '\n', true))
|
||||
{
|
||||
va_list ap;
|
||||
char szStr[1024];
|
||||
szStr[0] = '\0';
|
||||
va_start(ap, format);
|
||||
vsnprintf(szStr, 1024, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
WorldPacket data(SMSG_NOTIFICATION, (strlen(szStr) + 1));
|
||||
data << szStr;
|
||||
SendPacket(&data);
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::SendNotification(uint32 string_id, ...)
|
||||
{
|
||||
char const* format = GetAcoreString(string_id);
|
||||
if (format)
|
||||
{
|
||||
va_list ap;
|
||||
char szStr[1024];
|
||||
szStr[0] = '\0';
|
||||
va_start(ap, string_id);
|
||||
vsnprintf(szStr, 1024, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
WorldPacket data(SMSG_NOTIFICATION, (strlen(szStr) + 1));
|
||||
data << szStr;
|
||||
data << line.data();
|
||||
SendPacket(&data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,9 +365,19 @@ public:
|
||||
void ReadMovementInfo(WorldPacket& data, MovementInfo* mi);
|
||||
void WriteMovementInfo(WorldPacket* data, MovementInfo* mi);
|
||||
|
||||
void SendNotification(std::string_view str);
|
||||
template<typename... Args>
|
||||
void SendNotification(uint32 strId, Args&&... args)
|
||||
{
|
||||
SendNotification(Acore::StringFormatFmt(GetAcoreString(strId), std::forward<Args>(args)...));
|
||||
}
|
||||
template<typename... Args>
|
||||
void SendNotification(char const* fmt, Args&&... args)
|
||||
{
|
||||
SendNotification(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
void SendPacket(WorldPacket const* packet);
|
||||
void SendNotification(const char* format, ...) ATTR_PRINTF(2, 3);
|
||||
void SendNotification(uint32 string_id, ...);
|
||||
void SendPetNameInvalid(uint32 error, std::string const& name, DeclinedName* declinedName);
|
||||
void SendPartyResult(PartyOperation operation, std::string const& member, PartyResult res, uint32 val = 0);
|
||||
void SendAreaTriggerMessage(const char* Text, ...) ATTR_PRINTF(2, 3);
|
||||
|
||||
@@ -290,7 +290,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS] =
|
||||
&AuraEffect::HandleNoImmediateEffect, //227 SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE implemented in AuraEffect::PeriodicTick
|
||||
&AuraEffect::HandleNoImmediateEffect, //228 SPELL_AURA_DETECT_STEALTH stealth detection
|
||||
&AuraEffect::HandleNoImmediateEffect, //229 SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE
|
||||
&AuraEffect::HandleAuraModIncreaseHealth, //230 SPELL_AURA_MOD_INCREASE_HEALTH_2
|
||||
&AuraEffect::HandleAuraModIncreaseMaxHealth, //230 SPELL_AURA_MOD_INCREASE_HEALTH_2 only Blood Pact and Commanding Shout
|
||||
&AuraEffect::HandleNoImmediateEffect, //231 SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE
|
||||
&AuraEffect::HandleNoImmediateEffect, //232 SPELL_AURA_MECHANIC_DURATION_MOD implement in Unit::CalculateSpellDuration
|
||||
&AuraEffect::HandleUnused, //233 set model id to the one of the creature with id GetMiscValue() - clientside
|
||||
|
||||
@@ -3607,62 +3607,6 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // 10yd
|
||||
});
|
||||
|
||||
// Dragonmaw Race: All parts
|
||||
ApplySpellFix({
|
||||
40890 // Oldie's Rotten Pumpkin
|
||||
}, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
|
||||
spellInfo->Effects[EFFECT_0].TriggerSpell = 40905;
|
||||
spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_MISSILE;
|
||||
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
|
||||
});
|
||||
|
||||
// Trope's Slime Cannon
|
||||
ApplySpellFix({ 40909 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
|
||||
spellInfo->Effects[EFFECT_0].TriggerSpell = 40905;
|
||||
spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_MISSILE;
|
||||
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
|
||||
});
|
||||
|
||||
// Corlok's Skull Barrage
|
||||
ApplySpellFix({ 40894 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
|
||||
spellInfo->Effects[EFFECT_0].TriggerSpell = 40900;
|
||||
spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_MISSILE;
|
||||
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
|
||||
});
|
||||
|
||||
// Ichman's Blazing Fireball
|
||||
ApplySpellFix({ 40928 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
|
||||
spellInfo->Effects[EFFECT_0].TriggerSpell = 40929;
|
||||
spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_MISSILE;
|
||||
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
|
||||
});
|
||||
|
||||
// Mulverick's Great Balls of Lightning
|
||||
ApplySpellFix({ 40930 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
|
||||
spellInfo->Effects[EFFECT_0].TriggerSpell = 40931;
|
||||
spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_MISSILE;
|
||||
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
|
||||
});
|
||||
|
||||
// Sky Shatter
|
||||
ApplySpellFix({ 40945 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION;
|
||||
spellInfo->Effects[EFFECT_0].TriggerSpell = 41064;
|
||||
spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_TRIGGER_MISSILE;
|
||||
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
|
||||
});
|
||||
|
||||
// Gauging the Resonant Frequency (10594)
|
||||
ApplySpellFix({ 37390 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
@@ -4834,6 +4778,12 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->AuraInterruptFlags &= ~AURA_INTERRUPT_FLAG_NOT_ABOVEWATER;
|
||||
});
|
||||
|
||||
// Molten Punch
|
||||
ApplySpellFix({ 40126 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_DEST_CASTER);
|
||||
});
|
||||
|
||||
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
|
||||
{
|
||||
SpellInfo* spellInfo = mSpellInfoMap[i];
|
||||
|
||||
Reference in New Issue
Block a user