Scripts/Icecrown Citadel

* Properly remove glow aura during outro from Tirion
* Improved Wicked Spirit behaviour & visibility on heroic mode
* Removed gossip npcflag from Tirion after LK death
This commit is contained in:
Shauren
2011-10-06 17:57:28 +02:00
parent 0ef92d85b7
commit fc9926a97e
2 changed files with 45 additions and 11 deletions
+3
View File
@@ -3417,6 +3417,9 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->rangeIndex = 3; // 20yd
spellInfo->EffectRadiusIndex[0] = 20; // 25yd
break;
case 72405: // Broken Frostmourne
spellInfo->EffectRadiusIndex[1] = 22; // 200yd
break;
default:
break;
}
@@ -499,6 +499,16 @@ class boss_the_lich_king : public CreatureScript
{
_JustDied();
DoCastAOE(SPELL_PLAY_MOVIE, false);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x03);
float x, y, z;
me->GetPosition(x, y, z);
// use larger distance for vmap height search than in most other cases
float ground_Z = me->GetMap()->GetHeight(x, y, z, true, MAX_FALL_DISTANCE);
if (fabs(ground_Z - z) < 0.1f)
return;
me->GetMotionMaster()->MoveFall(ground_Z);
}
void EnterCombat(Unit* target)
@@ -722,16 +732,7 @@ class boss_the_lich_king : public CreatureScript
summons.Summon(summon);
if (events.GetPhaseMask() & PHASE_MASK_FROSTMOURNE)
{
Position offset;
me->GetPositionOffsetTo(*summon, offset);
offset.m_positionZ += 5.0f;
Position dest = TerenasSpawnHeroic;
dest.RelocateOffset(offset);
summon->NearTeleportTo(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(), dest.GetOrientation());
summon->UpdateEntry(NPC_WICKED_SPIRIT);
summon->SetSpeed(MOVE_FLIGHT, 0.5f);
summon->CastSpell(summon, SPELL_VILE_SPIRIT_MOVE_SEARCH, true);
summon->CastSpell((Unit*)NULL, SPELL_VILE_SPIRIT_DAMAGE_SEARCH, true);
TeleportSpirit(summon);
return;
}
@@ -1028,6 +1029,13 @@ class boss_the_lich_king : public CreatureScript
spawner->CastSpell(spawner, SPELL_SUMMON_SPIRIT_BOMB_1, true); // summons bombs randomly
spawner->CastSpell(spawner, SPELL_SUMMON_SPIRIT_BOMB_2, true); // summons bombs on players
}
for (SummonList::iterator i = summons.begin(); i != summons.end(); ++i)
{
Creature* summon = ObjectAccessor::GetCreature(*me, *i);
if (summon && summon->GetEntry() == NPC_VILE_SPIRIT)
TeleportSpirit(summon);
}
}
break;
case EVENT_OUTRO_TALK_1:
@@ -1099,6 +1107,21 @@ class boss_the_lich_king : public CreatureScript
private:
void TeleportSpirit(Creature* summon)
{
float dist = me->GetObjectSize() + (15.0f - me->GetObjectSize()) * float(rand_norm());
float angle = float(rand_norm()) * float(2.0f * M_PI);
Position dest = TerenasSpawnHeroic;
me->MovePosition(dest, dist, angle);
dest.m_positionZ += 15.0f;
summon->UpdateEntry(NPC_WICKED_SPIRIT);
summon->SetReactState(REACT_PASSIVE);
summon->NearTeleportTo(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(), dest.GetOrientation());
summon->SetSpeed(MOVE_FLIGHT, 0.5f);
summon->m_Events.KillAllEvents(true);
summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(1000));
}
void SendMusicToPlayers(uint32 musicId) const
{
WorldPacket data(SMSG_PLAY_MUSIC, 4);
@@ -1160,6 +1183,8 @@ class npc_tirion_fordring_tft : public CreatureScript
void Reset()
{
_events.Reset();
if (_instance->GetBossState(DATA_THE_LICH_KING) == DONE)
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
void MovementInform(uint32 type, uint32 id)
@@ -1220,6 +1245,10 @@ class npc_tirion_fordring_tft : public CreatureScript
void JustReachedHome()
{
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
if (_instance->GetBossState(DATA_THE_LICH_KING) == DONE)
return;
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
@@ -2787,7 +2816,9 @@ class spell_the_lich_king_vile_spirit_damage_target_search : public SpellScriptL
// this spell has SPELL_AURA_BLOCK_SPELL_FAMILY so every next cast of this
// searcher spell will be blocked
GetCaster()->GetAI()->SetData(DATA_VILE, 1);
if (TempSummon* summon = GetCaster()->ToTempSummon())
if (Unit* summoner = summon->GetSummoner())
summoner->GetAI()->SetData(DATA_VILE, 1);
GetCaster()->CastSpell((Unit*)NULL, SPELL_SPIRIT_BURST, true);
GetCaster()->ToCreature()->DespawnOrUnsummon(3000);
GetCaster()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);