mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Merge pull request #12278 from MitchesD/misc
Scripts/Misc: random fixes
This commit is contained in:
@@ -144,7 +144,7 @@ class npc_core_rager : public CreatureScript
|
||||
if (HealthAbovePct(50) || !instance)
|
||||
return;
|
||||
|
||||
if (Creature* pGolemagg = instance->instance->GetCreature(instance->GetData64(BOSS_GOLEMAGG_THE_INCINERATOR)))
|
||||
if (Creature* pGolemagg = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_GOLEMAGG_THE_INCINERATOR)))
|
||||
{
|
||||
if (pGolemagg->IsAlive())
|
||||
{
|
||||
|
||||
@@ -141,9 +141,9 @@ class instance_ahnkahet : public InstanceMapScript
|
||||
SwitchTrigger = data;
|
||||
break;
|
||||
case DATA_JEDOGA_RESET_INITIANDS:
|
||||
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
|
||||
for (uint64 guid : InitiandGUIDs)
|
||||
{
|
||||
if (Creature* creature = instance->GetCreature(*itr))
|
||||
if (Creature* creature = instance->GetCreature(guid))
|
||||
{
|
||||
creature->Respawn();
|
||||
if (!creature->IsInEvadeMode())
|
||||
@@ -164,9 +164,9 @@ class instance_ahnkahet : public InstanceMapScript
|
||||
case DATA_SPHERE_2:
|
||||
return SpheresState[type - DATA_SPHERE_1];
|
||||
case DATA_ALL_INITIAND_DEAD:
|
||||
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
|
||||
for (uint64 guid : InitiandGUIDs)
|
||||
{
|
||||
Creature* cr = instance->GetCreature(*itr);
|
||||
Creature* cr = instance->GetCreature(guid);
|
||||
if (!cr || cr->IsAlive())
|
||||
return 0;
|
||||
}
|
||||
@@ -214,11 +214,11 @@ class instance_ahnkahet : public InstanceMapScript
|
||||
{
|
||||
std::vector<uint64> vInitiands;
|
||||
vInitiands.clear();
|
||||
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
|
||||
for (uint64 guid : InitiandGUIDs)
|
||||
{
|
||||
Creature* cr = instance->GetCreature(*itr);
|
||||
Creature* cr = instance->GetCreature(guid);
|
||||
if (cr && cr->IsAlive())
|
||||
vInitiands.push_back(*itr);
|
||||
vInitiands.push_back(guid);
|
||||
}
|
||||
if (vInitiands.empty())
|
||||
return 0;
|
||||
@@ -245,9 +245,9 @@ class instance_ahnkahet : public InstanceMapScript
|
||||
case DATA_JEDOGA_SHADOWSEEKER:
|
||||
if (state == DONE)
|
||||
{
|
||||
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
|
||||
for (uint64 guid : InitiandGUIDs)
|
||||
{
|
||||
if (Creature* cr = instance->GetCreature(*itr))
|
||||
if (Creature* cr = instance->GetCreature(guid))
|
||||
cr->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ public:
|
||||
{
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
if (uint64 guid = instance->GetData64(summoners[i].data))
|
||||
if (Creature* crystalChannelTarget = instance->instance->GetCreature(guid))
|
||||
if (Creature* crystalChannelTarget = ObjectAccessor::GetCreature(*me, guid))
|
||||
{
|
||||
if (active)
|
||||
crystalChannelTarget->AI()->SetData(summoners[i].spell, summoners[i].timer);
|
||||
@@ -221,7 +221,7 @@ public:
|
||||
{
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
if (uint64 guid = instance->GetData64(DATA_NOVOS_CRYSTAL_1 + i))
|
||||
if (GameObject* crystal = instance->instance->GetGameObject(guid))
|
||||
if (GameObject* crystal = ObjectAccessor::GetGameObject(*me, guid))
|
||||
SetCrystalStatus(crystal, active);
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ public:
|
||||
{
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
if (uint64 guid = instance->GetData64(DATA_NOVOS_CRYSTAL_1 + i))
|
||||
if (GameObject* crystal = instance->instance->GetGameObject(guid))
|
||||
if (GameObject* crystal = ObjectAccessor::GetGameObject(*me, guid))
|
||||
if (crystal->GetGoState() == GO_STATE_ACTIVE)
|
||||
{
|
||||
SetCrystalStatus(crystal, false);
|
||||
@@ -258,7 +258,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_SUMMON_MINIONS, 15000);
|
||||
}
|
||||
else if (uint64 guid = instance->GetData64(DATA_NOVOS_SUMMONER_4))
|
||||
if (Creature* crystalChannelTarget = instance->instance->GetCreature(guid))
|
||||
if (Creature* crystalChannelTarget = ObjectAccessor::GetCreature(*me, guid))
|
||||
crystalChannelTarget->AI()->SetData(SPELL_SUMMON_CRYSTAL_HANDLER, 15000);
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,6 @@ public:
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
|
||||
{
|
||||
if (!hasTaunted && me->IsWithinDistInMap(who, 60.0f) && who->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
|
||||
@@ -84,7 +84,6 @@ class boss_faerlina : public CreatureScript
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
|
||||
{
|
||||
if (!_introDone && who->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
|
||||
@@ -70,7 +70,6 @@ public:
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
|
||||
{
|
||||
if (who->GetEntry() == NPC_ZOMBIE && me->IsWithinDistInMap(who, 7))
|
||||
{
|
||||
|
||||
@@ -368,9 +368,9 @@ class instance_naxxramas : public InstanceMapScript
|
||||
if (i == section)
|
||||
continue;
|
||||
|
||||
for (std::set<uint64>::const_iterator itr = HeiganEruptionGUID[i].begin(); itr != HeiganEruptionGUID[i].end(); ++itr)
|
||||
for (uint64 guid : HeiganEruptionGUID[i])
|
||||
{
|
||||
if (GameObject* heiganEruption = instance->GetGameObject(*itr))
|
||||
if (GameObject* heiganEruption = instance->GetGameObject(guid))
|
||||
{
|
||||
heiganEruption->SendCustomAnim(heiganEruption->GetGoAnimProgress());
|
||||
heiganEruption->CastSpell(NULL, SPELL_ERUPTION);
|
||||
|
||||
@@ -281,8 +281,8 @@ class instance_oculus : public InstanceMapScript
|
||||
|
||||
void GreaterWhelps()
|
||||
{
|
||||
for (std::list<uint64>::const_iterator itr = GreaterWhelpList.begin(); itr != GreaterWhelpList.end(); ++itr)
|
||||
if (Creature* gwhelp = instance->GetCreature(*itr))
|
||||
for (uint64 guid : GreaterWhelpList)
|
||||
if (Creature* gwhelp = instance->GetCreature(guid))
|
||||
gwhelp->SetPhaseMask(1, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -164,11 +164,9 @@ public:
|
||||
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
if (Creature* pStormforgedLieutenant = (ObjectAccessor::GetCreature((*me), m_auiStormforgedLieutenantGUID[i])))
|
||||
{
|
||||
if (Creature* pStormforgedLieutenant = ObjectAccessor::GetCreature(*me, m_auiStormforgedLieutenantGUID[i]))
|
||||
if (!pStormforgedLieutenant->IsAlive())
|
||||
pStormforgedLieutenant->Respawn();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_uiStance != STANCE_DEFENSIVE)
|
||||
@@ -411,7 +409,7 @@ public:
|
||||
|
||||
void EnterCombat(Unit* who) override
|
||||
{
|
||||
if (Creature* pBjarngrim = instance->instance->GetCreature(instance->GetData64(DATA_BJARNGRIM)))
|
||||
if (Creature* pBjarngrim = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BJARNGRIM)))
|
||||
{
|
||||
if (pBjarngrim->IsAlive() && !pBjarngrim->GetVictim())
|
||||
pBjarngrim->AI()->AttackStart(who);
|
||||
@@ -434,7 +432,7 @@ public:
|
||||
|
||||
if (m_uiRenewSteel_Timer <= uiDiff)
|
||||
{
|
||||
if (Creature* pBjarngrim = instance->instance->GetCreature(instance->GetData64(DATA_BJARNGRIM)))
|
||||
if (Creature* pBjarngrim = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BJARNGRIM)))
|
||||
{
|
||||
if (pBjarngrim->IsAlive())
|
||||
DoCast(pBjarngrim, SPELL_RENEW_STEEL_N);
|
||||
|
||||
@@ -165,9 +165,9 @@ public:
|
||||
|
||||
Position pos = me->GetPosition();
|
||||
|
||||
for (std::list<uint64>::const_iterator itr = lSparkList.begin(); itr != lSparkList.end(); ++itr)
|
||||
for (uint64 guid : lSparkList)
|
||||
{
|
||||
if (Creature* pSpark = ObjectAccessor::GetCreature(*me, *itr))
|
||||
if (Creature* pSpark = ObjectAccessor::GetCreature(*me, guid))
|
||||
{
|
||||
if (pSpark->IsAlive())
|
||||
{
|
||||
|
||||
@@ -162,13 +162,11 @@ public:
|
||||
if (m_lGolemGUIDList.empty())
|
||||
return;
|
||||
|
||||
for (std::list<uint64>::const_iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr)
|
||||
for (uint64 guid : m_lGolemGUIDList)
|
||||
{
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, *itr))
|
||||
{
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, guid))
|
||||
if (temp->IsAlive())
|
||||
temp->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
|
||||
m_lGolemGUIDList.clear();
|
||||
@@ -179,9 +177,9 @@ public:
|
||||
if (m_lGolemGUIDList.empty())
|
||||
return;
|
||||
|
||||
for (std::list<uint64>::const_iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr)
|
||||
for (uint64 guid : m_lGolemGUIDList)
|
||||
{
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, *itr))
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, guid))
|
||||
{
|
||||
// Only shatter brittle golems
|
||||
if (temp->IsAlive() && temp->GetEntry() == NPC_BRITTLE_GOLEM)
|
||||
|
||||
@@ -37,7 +37,7 @@ enum Spells
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_PARTING_SORROW = 1,
|
||||
EVENT_PARTING_SORROW = 1,
|
||||
EVENT_STORM_OF_GRIEF,
|
||||
EVENT_SHOCK_OF_SORROW,
|
||||
EVENT_PILLAR_OF_WOE
|
||||
|
||||
@@ -76,20 +76,18 @@ public:
|
||||
GetCreatureListWithEntryInGrid(orbList, me, NPC_TRANSITUS_SHIELD_DUMMY, 32.0f);
|
||||
if (!orbList.empty())
|
||||
{
|
||||
for (std::list<Creature*>::const_iterator itr = orbList.begin(); itr != orbList.end(); ++itr)
|
||||
for (Creature* orb : orbList)
|
||||
{
|
||||
if (Creature* pOrb = *itr)
|
||||
if (orb->GetPositionY() < 1000)
|
||||
{
|
||||
if (pOrb->GetPositionY() < 1000)
|
||||
{
|
||||
targetGUID = pOrb->GetGUID();
|
||||
break;
|
||||
}
|
||||
targetGUID = orb->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!targetGUID)
|
||||
if (Creature* pOrb = GetClosestCreatureWithEntry(me, NPC_TRANSITUS_SHIELD_DUMMY, 32.0f))
|
||||
|
||||
@@ -73,7 +73,6 @@ public:
|
||||
void AttackStart(Unit* /*who*/) override { }
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
|
||||
{
|
||||
if (!who || !who->IsInWorld() || who->GetZoneId() != 4395)
|
||||
return;
|
||||
|
||||
@@ -246,13 +246,10 @@ class npc_commander_eligor_dawnbringer : public CreatureScript
|
||||
{
|
||||
std::list<Creature*> creatureList;
|
||||
GetCreatureListWithEntryInGrid(creatureList, me, AudienceMobs[ii], 15.0f);
|
||||
for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
|
||||
for (Creature* creature : creatureList)
|
||||
{
|
||||
if (Creature* creatureList = *itr)
|
||||
{
|
||||
audienceList[creaturecount] = creatureList->GetGUID();
|
||||
++creaturecount;
|
||||
}
|
||||
audienceList[creaturecount] = creature->GetGUID();
|
||||
++creaturecount;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,11 +51,7 @@ enum CoilfangGOs
|
||||
class AreaTrigger_at_coilfang_waterfall : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
|
||||
AreaTrigger_at_coilfang_waterfall()
|
||||
: AreaTriggerScript("at_coilfang_waterfall")
|
||||
{
|
||||
}
|
||||
AreaTrigger_at_coilfang_waterfall() : AreaTriggerScript("at_coilfang_waterfall") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/) override
|
||||
{
|
||||
@@ -83,11 +79,7 @@ enum LegionTeleporter
|
||||
class AreaTrigger_at_legion_teleporter : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
|
||||
AreaTrigger_at_legion_teleporter()
|
||||
: AreaTriggerScript("at_legion_teleporter")
|
||||
{
|
||||
}
|
||||
AreaTrigger_at_legion_teleporter() : AreaTriggerScript("at_legion_teleporter") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/) override
|
||||
{
|
||||
@@ -125,11 +117,7 @@ enum StormwrightShelf
|
||||
class AreaTrigger_at_stormwright_shelf : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
|
||||
AreaTrigger_at_stormwright_shelf()
|
||||
: AreaTriggerScript("at_stormwright_shelf")
|
||||
{
|
||||
}
|
||||
AreaTrigger_at_stormwright_shelf() : AreaTriggerScript("at_stormwright_shelf") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/) override
|
||||
{
|
||||
@@ -153,11 +141,7 @@ enum ScentLarkorwi
|
||||
class AreaTrigger_at_scent_larkorwi : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
|
||||
AreaTrigger_at_scent_larkorwi()
|
||||
: AreaTriggerScript("at_scent_larkorwi")
|
||||
{
|
||||
}
|
||||
AreaTrigger_at_scent_larkorwi() : AreaTriggerScript("at_scent_larkorwi") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/) override
|
||||
{
|
||||
@@ -184,11 +168,7 @@ enum AtLastRites
|
||||
class AreaTrigger_at_last_rites : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
|
||||
AreaTrigger_at_last_rites()
|
||||
: AreaTriggerScript("at_last_rites")
|
||||
{
|
||||
}
|
||||
AreaTrigger_at_last_rites() : AreaTriggerScript("at_last_rites") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) override
|
||||
{
|
||||
@@ -246,7 +226,6 @@ enum Waygate
|
||||
class AreaTrigger_at_sholazar_waygate : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
|
||||
AreaTrigger_at_sholazar_waygate() : AreaTriggerScript("at_sholazar_waygate") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) override
|
||||
|
||||
@@ -118,7 +118,8 @@ public:
|
||||
|
||||
enum GildedBrazier
|
||||
{
|
||||
NPC_STILLBLADE = 17716,
|
||||
NPC_STILLBLADE = 17716,
|
||||
QUEST_THE_FIRST_TRIAL = 9678
|
||||
};
|
||||
|
||||
class go_gilded_brazier : public GameObjectScript
|
||||
@@ -130,7 +131,7 @@ public:
|
||||
{
|
||||
if (go->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
|
||||
{
|
||||
if (player->GetQuestStatus(9678) == QUEST_STATUS_INCOMPLETE)
|
||||
if (player->GetQuestStatus(QUEST_THE_FIRST_TRIAL) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (Creature* Stillblade = player->SummonCreature(NPC_STILLBLADE, 8106.11f, -7542.06f, 151.775f, 3.02598f, TEMPSUMMON_DEAD_DESPAWN, 60000))
|
||||
Stillblade->AI()->AttackStart(player);
|
||||
|
||||
@@ -387,7 +387,7 @@ public:
|
||||
|
||||
void AddSC_guards()
|
||||
{
|
||||
new guard_generic;
|
||||
new guard_shattrath_aldor;
|
||||
new guard_shattrath_scryer;
|
||||
new guard_generic();
|
||||
new guard_shattrath_aldor();
|
||||
new guard_shattrath_scryer();
|
||||
}
|
||||
|
||||
@@ -229,6 +229,6 @@ public:
|
||||
void AddSC_generic_creature()
|
||||
{
|
||||
//new generic_creature;
|
||||
new trigger_periodic;
|
||||
new trigger_periodic();
|
||||
//new trigger_death;
|
||||
}
|
||||
|
||||
@@ -134,6 +134,6 @@ public:
|
||||
|
||||
void AddSC_npc_innkeeper()
|
||||
{
|
||||
new npc_innkeeper;
|
||||
new npc_innkeeper();
|
||||
}
|
||||
|
||||
|
||||
@@ -185,7 +185,6 @@ public:
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
|
||||
{
|
||||
if (!SpawnAssoc)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user