mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripted/Misc: Fix random stuff
This commit is contained in:
@@ -1630,7 +1630,7 @@ struct WintergraspWorkshopData
|
||||
|
||||
// Found associate graveyard and update it
|
||||
if (m_Type < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST)
|
||||
if (m_WG && m_WG->GetGraveyardById(m_Type))
|
||||
if (m_WG->GetGraveyardById(m_Type))
|
||||
m_WG->GetGraveyardById(m_Type)->GiveControlTo(TEAM_ALLIANCE);
|
||||
|
||||
m_TeamControl = team;
|
||||
@@ -1668,7 +1668,7 @@ struct WintergraspWorkshopData
|
||||
|
||||
// Update graveyard control
|
||||
if (m_Type < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST)
|
||||
if (m_WG && m_WG->GetGraveyardById(m_Type))
|
||||
if (m_WG->GetGraveyardById(m_Type))
|
||||
m_WG->GetGraveyardById(m_Type)->GiveControlTo(TEAM_HORDE);
|
||||
|
||||
m_TeamControl = team;
|
||||
|
||||
@@ -281,7 +281,7 @@ public:
|
||||
if (name.empty())
|
||||
continue;
|
||||
|
||||
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
|
||||
char const* activeStr = target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
|
||||
? handler->GetTrinityString(LANG_ACTIVE)
|
||||
: "";
|
||||
|
||||
|
||||
@@ -246,23 +246,29 @@ class instance_stratholme : public InstanceMapScript
|
||||
case TYPE_BARONESS:
|
||||
EncounterState[1] = data;
|
||||
if (data == IN_PROGRESS)
|
||||
{
|
||||
HandleGameObject(ziggurat1GUID, true);
|
||||
if (data == IN_PROGRESS) //change to DONE when crystals implemented
|
||||
//change to DONE when crystals implemented
|
||||
StartSlaugtherSquare();
|
||||
}
|
||||
break;
|
||||
case TYPE_NERUB:
|
||||
EncounterState[2] = data;
|
||||
if (data == IN_PROGRESS)
|
||||
{
|
||||
HandleGameObject(ziggurat2GUID, true);
|
||||
if (data == IN_PROGRESS) //change to DONE when crystals implemented
|
||||
//change to DONE when crystals implemented
|
||||
StartSlaugtherSquare();
|
||||
}
|
||||
break;
|
||||
case TYPE_PALLID:
|
||||
EncounterState[3] = data;
|
||||
if (data == IN_PROGRESS)
|
||||
{
|
||||
HandleGameObject(ziggurat3GUID, true);
|
||||
if (data == IN_PROGRESS) //change to DONE when crystals implemented
|
||||
//change to DONE when crystals implemented
|
||||
StartSlaugtherSquare();
|
||||
}
|
||||
break;
|
||||
case TYPE_RAMSTEIN:
|
||||
if (data == IN_PROGRESS)
|
||||
|
||||
@@ -556,8 +556,8 @@ public:
|
||||
if (i->GetSource() && i->GetSource()->GetPositionZ() < DEMON_REALM_Z + 5)
|
||||
++SpectralPlayers;
|
||||
}
|
||||
uint8 MaxSpectralPlayers = MAX_PLAYERS_IN_SPECTRAL_REALM;
|
||||
if (player->HasAura(AURA_SPECTRAL_EXHAUSTION) || (MaxSpectralPlayers && SpectralPlayers >= MaxSpectralPlayers))
|
||||
|
||||
if (player->HasAura(AURA_SPECTRAL_EXHAUSTION) || SpectralPlayers >= MAX_PLAYERS_IN_SPECTRAL_REALM)
|
||||
player->GetSession()->SendNotification(GO_FAILED);
|
||||
else
|
||||
player->CastSpell(player, SPELL_TELEPORT_SPECTRAL, true);
|
||||
|
||||
@@ -174,7 +174,7 @@ class boss_akilzon : public CreatureScript
|
||||
{
|
||||
if (Unit* target = (*i))
|
||||
{
|
||||
if (!Cloud->IsWithinDist(target, 6, false))
|
||||
if (Cloud && !Cloud->IsWithinDist(target, 6, false))
|
||||
Cloud->CastCustomSpell(target, SPELL_ZAP, &bp0, NULL, NULL, true, 0, 0, me->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,6 +333,9 @@ class npc_harrison_jones : public CreatureScript
|
||||
{
|
||||
if (_gongTimer <= diff)
|
||||
{
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
switch (_gongEvent)
|
||||
{
|
||||
case GONG_EVENT_1:
|
||||
@@ -362,8 +365,7 @@ class npc_harrison_jones : public CreatureScript
|
||||
|
||||
// trigger or gong will need to be scripted to set IN_PROGRESS after enough hits.
|
||||
// This is temp workaround.
|
||||
if (instance)
|
||||
instance->SetData(DATA_GONGEVENT, IN_PROGRESS); // to be removed.
|
||||
instance->SetData(DATA_GONGEVENT, IN_PROGRESS); // to be removed.
|
||||
|
||||
if (instance->GetData(DATA_GONGEVENT) == IN_PROGRESS)
|
||||
{
|
||||
@@ -437,16 +439,16 @@ class npc_harrison_jones : public CreatureScript
|
||||
_gongEvent = GONG_EVENT_10;
|
||||
break;
|
||||
case GONG_EVENT_10:
|
||||
me->SetFacingTo(1.59044f);
|
||||
_gongEvent = 11;
|
||||
_gongTimer = 6000;
|
||||
me->SetFacingTo(1.59044f);
|
||||
_gongEvent = 11;
|
||||
_gongTimer = 6000;
|
||||
break;
|
||||
case GONG_EVENT_11:
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
if (instance)
|
||||
instance->SetData(DATA_GONGEVENT, NOT_STARTED);
|
||||
_gongEvent = 0;
|
||||
_gongTimer = 1000;
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
|
||||
instance->SetData(DATA_GONGEVENT, NOT_STARTED);
|
||||
_gongEvent = 0;
|
||||
_gongTimer = 1000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ class boss_lich_king_toc : public CreatureScript
|
||||
_instance->SetData(TYPE_EVENT, 5080);
|
||||
break;
|
||||
case 5080:
|
||||
if (GameObject* go = _instance->instance->GetGameObject(_instance->GetData64(GO_ARGENT_COLISEUM_FLOOR)))
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, _instance->GetData64(GO_ARGENT_COLISEUM_FLOOR)))
|
||||
{
|
||||
go->SetDisplayId(DISPLAYID_DESTROYED_FLOOR);
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED | GO_FLAG_NODESPAWN);
|
||||
@@ -328,15 +328,13 @@ class boss_lich_king_toc : public CreatureScript
|
||||
me->CastSpell(me, SPELL_CORPSE_TELEPORT, false);
|
||||
me->CastSpell(me, SPELL_DESTROY_FLOOR_KNOCKUP, false);
|
||||
|
||||
if (_instance)
|
||||
{
|
||||
_instance->SetBossState(BOSS_LICH_KING, DONE);
|
||||
Creature* temp = Unit::GetCreature(*me, _instance->GetData64(NPC_ANUBARAK));
|
||||
if (!temp || !temp->IsAlive())
|
||||
temp = me->SummonCreature(NPC_ANUBARAK, AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 3, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME);
|
||||
_instance->SetBossState(BOSS_LICH_KING, DONE);
|
||||
Creature* temp = Unit::GetCreature(*me, _instance->GetData64(NPC_ANUBARAK));
|
||||
if (!temp || !temp->IsAlive())
|
||||
temp = me->SummonCreature(NPC_ANUBARAK, AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 3, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME);
|
||||
|
||||
_instance->SetData(TYPE_EVENT, 0);
|
||||
|
||||
_instance->SetData(TYPE_EVENT, 0);
|
||||
}
|
||||
me->DespawnOrUnsummon();
|
||||
_updateTimer = 20*IN_MILLISECONDS;
|
||||
break;
|
||||
|
||||
@@ -354,9 +354,7 @@ public:
|
||||
void MovementInform(uint32 type, uint32 id) OVERRIDE
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && id == 0)
|
||||
{
|
||||
me->SetDisableGravity(false); // Needed this for proper animation after spawn, the summon in air fall to ground bug leave no other option for now, if this isn't used the drake will only walk on move.
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -388,9 +386,7 @@ public:
|
||||
}
|
||||
else WelcomeSequelTimer -= diff;
|
||||
}
|
||||
}
|
||||
if (me->HasAuraType(SPELL_AURA_CONTROL_VEHICLE))
|
||||
{
|
||||
|
||||
if (instance->GetBossState(DATA_UROM_EVENT) == DONE)
|
||||
{
|
||||
if (!(SpecialOff))
|
||||
@@ -403,9 +399,7 @@ public:
|
||||
else SpecialTimer -= diff;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (me->HasAuraType(SPELL_AURA_CONTROL_VEHICLE))
|
||||
{
|
||||
|
||||
if (!(HealthWarningOff))
|
||||
{
|
||||
if (me->GetHealthPct() <= 40.0f)
|
||||
@@ -414,9 +408,7 @@ public:
|
||||
HealthWarningOff = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (me->HasAuraType(SPELL_AURA_CONTROL_VEHICLE))
|
||||
{
|
||||
|
||||
if (HealthWarningOff)
|
||||
{
|
||||
if (WarningTimer <= diff)
|
||||
@@ -427,6 +419,7 @@ public:
|
||||
else WarningTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(me->HasAuraType(SPELL_AURA_CONTROL_VEHICLE)))
|
||||
{
|
||||
if (!(DisableTakeOff))
|
||||
|
||||
@@ -234,7 +234,9 @@ public:
|
||||
{
|
||||
if (currentPhase == PHASE_NONE)
|
||||
{
|
||||
instance->SetData(DATA_GORTOK_PALEHOOF_EVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_GORTOK_PALEHOOF_EVENT, IN_PROGRESS);
|
||||
|
||||
me->SummonCreature(NPC_STASIS_CONTROLLER, moveLocs[5].x, moveLocs[5].y, moveLocs[5].z, 0, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
}
|
||||
Phase move = PHASE_NONE;
|
||||
|
||||
@@ -105,7 +105,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript
|
||||
Cleave_Timer = 5000;
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_DIE);
|
||||
|
||||
@@ -113,7 +113,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript
|
||||
instance->SetBossState(DATA_NETHEKURSE, DONE);
|
||||
}
|
||||
|
||||
void SetData(uint32 data, uint32 value)
|
||||
void SetData(uint32 data, uint32 value) OVERRIDE
|
||||
{
|
||||
if (data != SETDATA_DATA)
|
||||
return;
|
||||
@@ -340,9 +340,9 @@ class npc_fel_orc_convert : public CreatureScript
|
||||
{
|
||||
if (instance->GetBossState(DATA_NETHEKURSE) != IN_PROGRESS)
|
||||
return;
|
||||
if (instance->GetData64(NPC_GRAND_WARLOCK_NETHEKURSE))
|
||||
if (Creature* Kurse = Unit::GetCreature(*me, instance->GetData64(NPC_GRAND_WARLOCK_NETHEKURSE)))
|
||||
Kurse->AI()->SetData(SETDATA_DATA, SETDATA_PEON_DEATH);
|
||||
|
||||
if (Creature* Kurse = Unit::GetCreature(*me, instance->GetData64(NPC_GRAND_WARLOCK_NETHEKURSE)))
|
||||
Kurse->AI()->SetData(SETDATA_DATA, SETDATA_PEON_DEATH);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,4 +404,3 @@ void AddSC_boss_grand_warlock_nethekurse()
|
||||
new npc_fel_orc_convert();
|
||||
new npc_lesser_shadow_fissure();
|
||||
}
|
||||
|
||||
|
||||
@@ -447,4 +447,3 @@ void AddSC_boss_warbringer_omrogg()
|
||||
new boss_warbringer_omrogg();
|
||||
new npc_omrogg_heads();
|
||||
}
|
||||
|
||||
|
||||
@@ -319,4 +319,3 @@ void AddSC_boss_warchief_kargath_bladefist()
|
||||
{
|
||||
new boss_warchief_kargath_bladefist();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
nethekurseDoor2GUID = 0;
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
void OnGameObjectCreate(GameObject* go) OVERRIDE
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
@@ -62,7 +62,7 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
}
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
void OnCreatureCreate(Creature* creature) OVERRIDE
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
@@ -72,7 +72,7 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
}
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state)
|
||||
bool SetBossState(uint32 type, EncounterState state) OVERRIDE
|
||||
{
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
@@ -168,4 +168,3 @@ void AddSC_instance_shattered_halls()
|
||||
{
|
||||
new instance_shattered_halls();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user