mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-29 05:11:55 +01:00
Scripts/Icecrown Citadel
* Minor corrections to Sister Svalna event * Removed unneeded workarounds for Deathbringer Saurfang procs * Changed GM check to use account level (makes no sense to check isGameMaster as that does not allow entering combat at all)
This commit is contained in:
@@ -796,6 +796,7 @@ class boss_sister_svalna : public CreatureScript
|
||||
{
|
||||
_JustReachedHome();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetFlying(false);
|
||||
}
|
||||
|
||||
void DoAction(int32 const action)
|
||||
@@ -843,22 +844,13 @@ class boss_sister_svalna : public CreatureScript
|
||||
_isEventInProgress = false;
|
||||
me->setActive(false);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE);
|
||||
me->SetFlying(false);
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* target, SpellInfo const* spell)
|
||||
{
|
||||
switch (spell->Id)
|
||||
{
|
||||
case SPELL_REVIVE_CHAMPION:
|
||||
{
|
||||
if (!_isEventInProgress)
|
||||
break;
|
||||
Position pos;
|
||||
me->GetPosition(&pos);
|
||||
me->UpdateGroundPositionZ(pos.GetPositionX(), pos.GetPositionY(), pos.m_positionZ);
|
||||
me->GetMotionMaster()->MovePoint(POINT_LAND, pos);
|
||||
break;
|
||||
}
|
||||
case SPELL_IMPALING_SPEAR_KILL:
|
||||
me->Kill(target);
|
||||
break;
|
||||
@@ -866,8 +858,8 @@ class boss_sister_svalna : public CreatureScript
|
||||
if (TempSummon* summon = target->SummonCreature(NPC_IMPALING_SPEAR, *target))
|
||||
{
|
||||
Talk(EMOTE_SVALNA_IMPALE, target->GetGUID());
|
||||
summon->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_UNK1 | 0x4000);
|
||||
summon->CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, 1, target, false);
|
||||
summon->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_UNK1 | UNIT_FLAG2_ALLOW_ENEMY_INTERACT);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -902,7 +894,10 @@ class boss_sister_svalna : public CreatureScript
|
||||
break;
|
||||
case EVENT_IMPALING_SPEAR:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_IMPALING_SPEAR))
|
||||
{
|
||||
DoCast(me, SPELL_AETHER_SHIELD);
|
||||
DoCast(target, SPELL_IMPALING_SPEAR);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_IMPALING_SPEAR, urand(20000, 25000));
|
||||
break;
|
||||
default:
|
||||
@@ -1913,13 +1908,29 @@ class spell_svalna_revive_champion : public SpellScriptLoader
|
||||
|
||||
void RemoveAliveTarget(std::list<Unit*>& unitList)
|
||||
{
|
||||
unitList.remove_if (AliveCheck());
|
||||
unitList.remove_if(AliveCheck());
|
||||
Trinity::RandomResizeList(unitList, 2);
|
||||
}
|
||||
|
||||
void Land(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Creature* caster = GetCaster()->ToCreature();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
Position pos;
|
||||
caster->GetPosition(&pos);
|
||||
caster->GetNearPosition(pos, 5.0f, 0.0f);
|
||||
pos.m_positionZ = caster->GetBaseMap()->GetHeight(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), true, 20.0f);
|
||||
pos.m_positionZ += 0.05f;
|
||||
caster->SetHomePosition(pos);
|
||||
caster->GetMotionMaster()->MovePoint(POINT_LAND, pos);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnUnitTargetSelect += SpellUnitTargetFn(spell_svalna_revive_champion_SpellScript::RemoveAliveTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENTRY);
|
||||
OnEffectHit += SpellEffectFn(spell_svalna_revive_champion_SpellScript::Land, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1942,7 +1953,11 @@ class spell_svalna_remove_spear : public SpellScriptLoader
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Creature* target = GetHitCreature())
|
||||
target->DespawnOrUnsummon();
|
||||
{
|
||||
if (Unit* vehicle = target->GetVehicleBase())
|
||||
vehicle->RemoveAurasDueToSpell(SPELL_IMPALING_SPEAR);
|
||||
target->DespawnOrUnsummon(1);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Map.h"
|
||||
#include "PoolMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "icecrown_citadel.h"
|
||||
|
||||
enum EventIds
|
||||
@@ -949,7 +950,7 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
|
||||
bool CheckRequiredBosses(uint32 bossId, Player const* player = NULL) const
|
||||
{
|
||||
if (player && player->isGameMaster())
|
||||
if (player && AccountMgr::IsGMAccount(player->GetSession()->GetSecurity()))
|
||||
return true;
|
||||
|
||||
switch (bossId)
|
||||
|
||||
Reference in New Issue
Block a user