Scripts/Icecrown Citadel: Fixed Deathbound wards & their trap linking
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
UPDATE `creature_template` SET `unit_flags`=`unit_flags`&~0x02000100 WHERE `entry` IN (37007,38031);
|
||||
|
||||
DELETE FROM `creature_template_addon` WHERE `entry` IN (37007,38031);
|
||||
INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
|
||||
(37007,0,0x0000000,0,0,'70733'),
|
||||
(38031,0,0x0000000,0,0,'70733');
|
||||
@@ -0,0 +1,8 @@
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_icc_stoneform';
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_icc_sprit_alarm';
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(70733, 'spell_icc_stoneform'),
|
||||
(70546, 'spell_icc_sprit_alarm'),
|
||||
(70536, 'spell_icc_sprit_alarm'),
|
||||
(70545, 'spell_icc_sprit_alarm'),
|
||||
(70547, 'spell_icc_sprit_alarm');
|
||||
@@ -262,6 +262,14 @@ enum Actions
|
||||
ACTION_RESET_EVENT = 5,
|
||||
};
|
||||
|
||||
enum EventIds
|
||||
{
|
||||
EVENT_AWAKEN_WARD_1 = 22900,
|
||||
EVENT_AWAKEN_WARD_2 = 22907,
|
||||
EVENT_AWAKEN_WARD_3 = 22908,
|
||||
EVENT_AWAKEN_WARD_4 = 22909,
|
||||
};
|
||||
|
||||
class FrostwingVrykulSearcher
|
||||
{
|
||||
public:
|
||||
@@ -1651,6 +1659,109 @@ class npc_impaling_spear : public CreatureScript
|
||||
}
|
||||
};
|
||||
|
||||
class spell_icc_stoneform : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_icc_stoneform() : SpellScriptLoader("spell_icc_stoneform") { }
|
||||
|
||||
class spell_icc_stoneform_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_icc_stoneform_AuraScript);
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Creature* target = GetTarget()->ToCreature())
|
||||
{
|
||||
target->SetReactState(REACT_PASSIVE);
|
||||
target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
target->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_CUSTOM_SPELL_02);
|
||||
}
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Creature* target = GetTarget()->ToCreature())
|
||||
{
|
||||
target->SetReactState(REACT_AGGRESSIVE);
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
target->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_icc_stoneform_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_icc_stoneform_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_icc_stoneform_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_icc_sprit_alarm : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_icc_sprit_alarm() : SpellScriptLoader("spell_icc_sprit_alarm") { }
|
||||
|
||||
class spell_icc_sprit_alarm_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_icc_sprit_alarm_SpellScript);
|
||||
|
||||
void HandleEvent(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
uint32 trapId = 0;
|
||||
switch (GetSpellInfo()->EffectMiscValue[effIndex])
|
||||
{
|
||||
case EVENT_AWAKEN_WARD_1:
|
||||
trapId = GO_SPIRIT_ALARM_1;
|
||||
break;
|
||||
case EVENT_AWAKEN_WARD_2:
|
||||
trapId = GO_SPIRIT_ALARM_2;
|
||||
break;
|
||||
case EVENT_AWAKEN_WARD_3:
|
||||
trapId = GO_SPIRIT_ALARM_3;
|
||||
break;
|
||||
case EVENT_AWAKEN_WARD_4:
|
||||
trapId = GO_SPIRIT_ALARM_4;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (GameObject* trap = GetCaster()->FindNearestGameObject(trapId, 5.0f))
|
||||
trap->SetRespawnTime(trap->GetGOInfo()->trap.autoCloseTime);
|
||||
|
||||
std::list<Creature*> wards;
|
||||
GetCaster()->GetCreatureListWithEntryInGrid(wards, NPC_DEATHBOUND_WARD, 150.0f);
|
||||
wards.sort(Trinity::ObjectDistanceOrderPred(GetCaster()));
|
||||
for (std::list<Creature*>::iterator itr = wards.begin(); itr != wards.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->isAlive() && (*itr)->HasAura(SPELL_STONEFORM))
|
||||
{
|
||||
(*itr)->RemoveAurasDueToSpell(SPELL_STONEFORM);
|
||||
if (Unit* target = (*itr)->SelectNearestTarget(150.0f))
|
||||
(*itr)->AI()->AttackStart(target);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffect += SpellEffectFn(spell_icc_sprit_alarm_SpellScript::HandleEvent, EFFECT_2, SPELL_EFFECT_SEND_EVENT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_icc_sprit_alarm_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class DeathPlagueTargetSelector
|
||||
{
|
||||
public:
|
||||
@@ -1925,6 +2036,8 @@ void AddSC_icecrown_citadel()
|
||||
new npc_captain_rupert();
|
||||
new npc_frostwing_vrykul();
|
||||
new npc_impaling_spear();
|
||||
new spell_icc_stoneform();
|
||||
new spell_icc_sprit_alarm();
|
||||
new spell_frost_giant_death_plague();
|
||||
new spell_icc_harvest_blight_specimen();
|
||||
new spell_trigger_spell_from_caster("spell_svalna_caress_of_death", SPELL_IMPALING_SPEAR_KILL);
|
||||
|
||||
@@ -38,6 +38,9 @@ enum SharedSpells
|
||||
SPELL_BERSERK = 26662,
|
||||
SPELL_BERSERK2 = 47008,
|
||||
|
||||
// Deathbound Ward
|
||||
SPELL_STONEFORM = 70733,
|
||||
|
||||
// Residue Rendezvous
|
||||
SPELL_ORANGE_BLIGHT_RESIDUE = 72144,
|
||||
SPELL_GREEN_BLIGHT_RESIDUE = 72145,
|
||||
@@ -120,6 +123,7 @@ enum CreaturesIds
|
||||
NPC_NIBY_THE_ALMIGHTY = 38182, // Warlock Armor N
|
||||
NPC_GARROSH_HELLSCREAM = 39372,
|
||||
NPC_KING_VARIAN_WRYNN = 39371,
|
||||
NPC_DEATHBOUND_WARD = 37007,
|
||||
|
||||
// Weekly quests
|
||||
NPC_INFILTRATOR_MINCHAR = 38471,
|
||||
@@ -243,6 +247,12 @@ enum CreaturesIds
|
||||
|
||||
enum GameObjectsIds
|
||||
{
|
||||
// Lower Spire Trash
|
||||
GO_SPIRIT_ALARM_1 = 201814,
|
||||
GO_SPIRIT_ALARM_2 = 201815,
|
||||
GO_SPIRIT_ALARM_3 = 201816,
|
||||
GO_SPIRIT_ALARM_4 = 201817,
|
||||
|
||||
// Lord Marrogar
|
||||
GO_DOODAD_ICECROWN_ICEWALL02 = 201910,
|
||||
GO_ICEWALL = 201911,
|
||||
|
||||
Reference in New Issue
Block a user