Scripts/Icecrown Citadel: Lock Deathbringer Saurfang and Valithria Dreamwalker chests to players who fought them
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=72257;
|
||||||
|
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
|
||||||
|
(13,1,72257,0,0,32,0,144,0,0,0,0,'','Remove Marks of the Fallen Champion - target player');
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
UPDATE `gameobject_template` SET `flags`=0x32 WHERE `entry` IN (202239,202240,202238,202241,201959,202339,202338,202340);
|
||||||
|
|
||||||
|
-- Set Deathbringer's Cache spawned by default
|
||||||
|
UPDATE `gameobject` SET `spawntimesecs`=604800 WHERE `id` IN (202239,202240,202238,202241);
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_deathbringer_remove_marks';
|
||||||
|
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||||
|
(72257,'spell_deathbringer_remove_marks');
|
||||||
@@ -111,6 +111,8 @@ enum Spells
|
|||||||
|
|
||||||
SPELL_RIDE_VEHICLE = 70640, // Outro
|
SPELL_RIDE_VEHICLE = 70640, // Outro
|
||||||
SPELL_ACHIEVEMENT = 72928,
|
SPELL_ACHIEVEMENT = 72928,
|
||||||
|
SPELL_REMOVE_MARKS_OF_THE_FALLEN_CHAMPION = 72257,
|
||||||
|
SPELL_PERMANENT_FEIGN_DEATH = 70628,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Helper to get id of the aura on different modes (HasAura(baseId) wont work)
|
// Helper to get id of the aura on different modes (HasAura(baseId) wont work)
|
||||||
@@ -254,6 +256,7 @@ class boss_deathbringer_saurfang : public CreatureScript
|
|||||||
me->SetReactState(REACT_DEFENSIVE);
|
me->SetReactState(REACT_DEFENSIVE);
|
||||||
events.SetPhase(PHASE_COMBAT);
|
events.SetPhase(PHASE_COMBAT);
|
||||||
_frenzied = false;
|
_frenzied = false;
|
||||||
|
_dead = false;
|
||||||
me->SetPower(POWER_ENERGY, 0);
|
me->SetPower(POWER_ENERGY, 0);
|
||||||
DoCast(me, SPELL_ZERO_POWER, true);
|
DoCast(me, SPELL_ZERO_POWER, true);
|
||||||
DoCast(me, SPELL_BLOOD_LINK, true);
|
DoCast(me, SPELL_BLOOD_LINK, true);
|
||||||
@@ -303,13 +306,6 @@ class boss_deathbringer_saurfang : public CreatureScript
|
|||||||
|
|
||||||
void JustDied(Unit* /*killer*/)
|
void JustDied(Unit* /*killer*/)
|
||||||
{
|
{
|
||||||
_JustDied();
|
|
||||||
DoCast(me, SPELL_ACHIEVEMENT, true);
|
|
||||||
Talk(SAY_DEATH);
|
|
||||||
|
|
||||||
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MARK_OF_THE_FALLEN_CHAMPION);
|
|
||||||
if (Creature* creature = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SAURFANG_EVENT_NPC)))
|
|
||||||
creature->AI()->DoAction(ACTION_START_OUTRO);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttackStart(Unit* victim)
|
void AttackStart(Unit* victim)
|
||||||
@@ -348,6 +344,22 @@ class boss_deathbringer_saurfang : public CreatureScript
|
|||||||
DoCast(me, SPELL_FRENZY);
|
DoCast(me, SPELL_FRENZY);
|
||||||
Talk(SAY_FRENZY);
|
Talk(SAY_FRENZY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_dead && me->GetHealth() < FightWonValue)
|
||||||
|
{
|
||||||
|
_dead = true;
|
||||||
|
_JustDied();
|
||||||
|
_EnterEvadeMode();
|
||||||
|
|
||||||
|
DoCastAOE(SPELL_REMOVE_MARKS_OF_THE_FALLEN_CHAMPION);
|
||||||
|
DoCast(me, SPELL_ACHIEVEMENT, true);
|
||||||
|
Talk(SAY_DEATH);
|
||||||
|
|
||||||
|
//instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MARK_OF_THE_FALLEN_CHAMPION);
|
||||||
|
DoCast(me, SPELL_PERMANENT_FEIGN_DEATH);
|
||||||
|
if (Creature* creature = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SAURFANG_EVENT_NPC)))
|
||||||
|
creature->AI()->DoAction(ACTION_START_OUTRO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustSummoned(Creature* summon)
|
void JustSummoned(Creature* summon)
|
||||||
@@ -542,10 +554,13 @@ class boss_deathbringer_saurfang : public CreatureScript
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint32 const FightWonValue;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32 _fallenChampionCastCount;
|
uint32 _fallenChampionCastCount;
|
||||||
bool _introDone;
|
bool _introDone;
|
||||||
bool _frenzied; // faster than iterating all auras to find Frenzy
|
bool _frenzied; // faster than iterating all auras to find Frenzy
|
||||||
|
bool _dead;
|
||||||
};
|
};
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const
|
CreatureAI* GetAI(Creature* creature) const
|
||||||
@@ -554,6 +569,8 @@ class boss_deathbringer_saurfang : public CreatureScript
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
uint32 const boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::FightWonValue = 100000;
|
||||||
|
|
||||||
class npc_high_overlord_saurfang_icc : public CreatureScript
|
class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -655,7 +672,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
|||||||
{
|
{
|
||||||
deathbringer->CastSpell(me, SPELL_RIDE_VEHICLE, true); // for the packet logs.
|
deathbringer->CastSpell(me, SPELL_RIDE_VEHICLE, true); // for the packet logs.
|
||||||
deathbringer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
deathbringer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||||
deathbringer->setDeathState(ALIVE);
|
deathbringer->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DROWNED);
|
||||||
}
|
}
|
||||||
_events.ScheduleEvent(EVENT_OUTRO_HORDE_5, 1000); // move
|
_events.ScheduleEvent(EVENT_OUTRO_HORDE_5, 1000); // move
|
||||||
_events.ScheduleEvent(EVENT_OUTRO_HORDE_6, 4000); // say
|
_events.ScheduleEvent(EVENT_OUTRO_HORDE_6, 4000); // say
|
||||||
@@ -818,6 +835,10 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
|
|||||||
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f);
|
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f);
|
||||||
for (std::list<Creature*>::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr)
|
for (std::list<Creature*>::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr)
|
||||||
(*itr)->AI()->DoAction(ACTION_DESPAWN);
|
(*itr)->AI()->DoAction(ACTION_DESPAWN);
|
||||||
|
|
||||||
|
// temp until outro fully done - to put deathbringer on respawn timer (until next reset)
|
||||||
|
if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_DEATHBRINGER_SAURFANG)))
|
||||||
|
deathbringer->DespawnOrUnsummon(5000);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ACTION_INTERRUPT_INTRO:
|
case ACTION_INTERRUPT_INTRO:
|
||||||
@@ -1175,6 +1196,9 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader
|
|||||||
|
|
||||||
void FilterTargetsInitial(std::list<Unit*>& unitList)
|
void FilterTargetsInitial(std::list<Unit*>& unitList)
|
||||||
{
|
{
|
||||||
|
if (unitList.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
// select one random target, with preference of ranged targets
|
// select one random target, with preference of ranged targets
|
||||||
uint32 targetsAtRange = 0;
|
uint32 targetsAtRange = 0;
|
||||||
uint32 const minTargets = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 10 : 4);
|
uint32 const minTargets = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 10 : 4);
|
||||||
@@ -1189,7 +1213,9 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader
|
|||||||
if (targetsAtRange < minTargets)
|
if (targetsAtRange < minTargets)
|
||||||
targetsAtRange = std::min<uint32>(unitList.size() - 1, minTargets);
|
targetsAtRange = std::min<uint32>(unitList.size() - 1, minTargets);
|
||||||
|
|
||||||
target = SelectRandomContainerElement(unitList);
|
std::list<Unit*>::const_iterator itr = unitList.begin();
|
||||||
|
std::advance(itr, urand(0, targetsAtRange));
|
||||||
|
target = *itr;
|
||||||
unitList.clear();
|
unitList.clear();
|
||||||
unitList.push_back(target);
|
unitList.push_back(target);
|
||||||
}
|
}
|
||||||
@@ -1256,6 +1282,33 @@ class spell_deathbringer_boiling_blood : public SpellScriptLoader
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class spell_deathbringer_remove_marks : public SpellScriptLoader
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
spell_deathbringer_remove_marks() : SpellScriptLoader("spell_deathbringer_remove_marks") { }
|
||||||
|
|
||||||
|
class spell_deathbringer_remove_marks_SpellScript : public SpellScript
|
||||||
|
{
|
||||||
|
PrepareSpellScript(spell_deathbringer_remove_marks_SpellScript);
|
||||||
|
|
||||||
|
void HandleScript(SpellEffIndex effIndex)
|
||||||
|
{
|
||||||
|
PreventHitDefaultEffect(effIndex);
|
||||||
|
GetHitUnit()->RemoveAurasDueToSpell(uint32(GetEffectValue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register()
|
||||||
|
{
|
||||||
|
OnEffectHitTarget += SpellEffectFn(spell_deathbringer_remove_marks_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
SpellScript* GetSpellScript() const
|
||||||
|
{
|
||||||
|
return new spell_deathbringer_remove_marks_SpellScript();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class achievement_ive_gone_and_made_a_mess : public AchievementCriteriaScript
|
class achievement_ive_gone_and_made_a_mess : public AchievementCriteriaScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -1285,5 +1338,6 @@ void AddSC_boss_deathbringer_saurfang()
|
|||||||
new spell_deathbringer_blood_nova();
|
new spell_deathbringer_blood_nova();
|
||||||
new spell_deathbringer_blood_nova_targeting();
|
new spell_deathbringer_blood_nova_targeting();
|
||||||
new spell_deathbringer_boiling_blood();
|
new spell_deathbringer_boiling_blood();
|
||||||
|
new spell_deathbringer_remove_marks();
|
||||||
new achievement_ive_gone_and_made_a_mess();
|
new achievement_ive_gone_and_made_a_mess();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -585,8 +585,8 @@ class boss_the_lich_king : public CreatureScript
|
|||||||
SendLightOverride(0, 5000);
|
SendLightOverride(0, 5000);
|
||||||
break;
|
break;
|
||||||
case ACTION_BREAK_FROSTMOURNE:
|
case ACTION_BREAK_FROSTMOURNE:
|
||||||
DoCastAOE(SPELL_SUMMON_BROKEN_FROSTMOURNE);
|
me->CastSpell((Unit*)NULL, SPELL_SUMMON_BROKEN_FROSTMOURNE, TRIGGERED_IGNORE_CAST_IN_PROGRESS);
|
||||||
DoCastAOE(SPELL_SUMMON_BROKEN_FROSTMOURNE_2);
|
me->CastSpell((Unit*)NULL, SPELL_SUMMON_BROKEN_FROSTMOURNE_2, TRIGGERED_IGNORE_CAST_IN_PROGRESS);
|
||||||
SetEquipmentSlots(false, EQUIP_BROKEN_FROSTMOURNE);
|
SetEquipmentSlots(false, EQUIP_BROKEN_FROSTMOURNE);
|
||||||
events.ScheduleEvent(EVENT_OUTRO_TALK_6, 2500, 0, PHASE_OUTRO);
|
events.ScheduleEvent(EVENT_OUTRO_TALK_6, 2500, 0, PHASE_OUTRO);
|
||||||
break;
|
break;
|
||||||
@@ -1065,12 +1065,11 @@ class boss_the_lich_king : public CreatureScript
|
|||||||
Talk(SAY_LK_OUTRO_6);
|
Talk(SAY_LK_OUTRO_6);
|
||||||
if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING)))
|
if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING)))
|
||||||
tirion->SetFacingToObject(me);
|
tirion->SetFacingToObject(me);
|
||||||
me->ClearUnitState(UNIT_STATE_CASTING);
|
me->CastSpell((Unit*)NULL, SPELL_SUMMON_BROKEN_FROSTMOURNE_3, TRIGGERED_IGNORE_CAST_IN_PROGRESS);
|
||||||
DoCastAOE(SPELL_SUMMON_BROKEN_FROSTMOURNE_3);
|
|
||||||
SetEquipmentSlots(false, EQUIP_UNEQUIP);
|
SetEquipmentSlots(false, EQUIP_UNEQUIP);
|
||||||
break;
|
break;
|
||||||
case EVENT_OUTRO_SOUL_BARRAGE:
|
case EVENT_OUTRO_SOUL_BARRAGE:
|
||||||
DoCastAOE(SPELL_SOUL_BARRAGE);
|
me->CastSpell((Unit*)NULL, SPELL_SOUL_BARRAGE, TRIGGERED_IGNORE_CAST_IN_PROGRESS);
|
||||||
sCreatureTextMgr->SendSound(me, SOUND_PAIN, CHAT_MSG_MONSTER_YELL, 0, TEXT_RANGE_NORMAL, TEAM_OTHER, false);
|
sCreatureTextMgr->SendSound(me, SOUND_PAIN, CHAT_MSG_MONSTER_YELL, 0, TEXT_RANGE_NORMAL, TEAM_OTHER, false);
|
||||||
// set flight
|
// set flight
|
||||||
me->SetDisableGravity(true);
|
me->SetDisableGravity(true);
|
||||||
|
|||||||
@@ -329,8 +329,13 @@ class boss_valithria_dreamwalker : public CreatureScript
|
|||||||
_events.ScheduleEvent(EVENT_BERSERK, 420000);
|
_events.ScheduleEvent(EVENT_BERSERK, 420000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HealReceived(Unit* /*healer*/, uint32& heal)
|
void HealReceived(Unit* healer, uint32& heal)
|
||||||
{
|
{
|
||||||
|
if (!me->hasLootRecipient())
|
||||||
|
me->SetLootRecipient(healer);
|
||||||
|
|
||||||
|
me->LowerPlayerDamageReq(heal);
|
||||||
|
|
||||||
// encounter complete
|
// encounter complete
|
||||||
if (me->HealthAbovePctHealed(100, heal) && !_done)
|
if (me->HealthAbovePctHealed(100, heal) && !_done)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -331,6 +331,10 @@ enum GameObjectsIds
|
|||||||
GO_DOODAD_ICECROWN_ROOSTPORTCULLIS_02 = 201381,
|
GO_DOODAD_ICECROWN_ROOSTPORTCULLIS_02 = 201381,
|
||||||
GO_DOODAD_ICECROWN_ROOSTPORTCULLIS_03 = 201382,
|
GO_DOODAD_ICECROWN_ROOSTPORTCULLIS_03 = 201382,
|
||||||
GO_DOODAD_ICECROWN_ROOSTPORTCULLIS_04 = 201383,
|
GO_DOODAD_ICECROWN_ROOSTPORTCULLIS_04 = 201383,
|
||||||
|
GO_CACHE_OF_THE_DREAMWALKER_10N = 201959,
|
||||||
|
GO_CACHE_OF_THE_DREAMWALKER_25N = 202339,
|
||||||
|
GO_CACHE_OF_THE_DREAMWALKER_10H = 202338,
|
||||||
|
GO_CACHE_OF_THE_DREAMWALKER_25H = 202340,
|
||||||
|
|
||||||
// Sindragosa
|
// Sindragosa
|
||||||
GO_SINDRAGOSA_ENTRANCE_DOOR = 201373,
|
GO_SINDRAGOSA_ENTRANCE_DOOR = 201373,
|
||||||
|
|||||||
@@ -452,6 +452,14 @@ class instance_icecrown_citadel : public InstanceMapScript
|
|||||||
case GO_DRINK_ME:
|
case GO_DRINK_ME:
|
||||||
PutricideTableGUID = go->GetGUID();
|
PutricideTableGUID = go->GetGUID();
|
||||||
break;
|
break;
|
||||||
|
case GO_CACHE_OF_THE_DREAMWALKER_10N:
|
||||||
|
case GO_CACHE_OF_THE_DREAMWALKER_25N:
|
||||||
|
case GO_CACHE_OF_THE_DREAMWALKER_10H:
|
||||||
|
case GO_CACHE_OF_THE_DREAMWALKER_25H:
|
||||||
|
if (Creature* valithria = instance->GetCreature(ValithriaDreamwalkerGUID))
|
||||||
|
go->SetLootRecipient(valithria->GetLootRecipient());
|
||||||
|
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE | GO_FLAG_NODESPAWN);
|
||||||
|
break;
|
||||||
case GO_ARTHAS_PLATFORM:
|
case GO_ARTHAS_PLATFORM:
|
||||||
// this enables movement at The Frozen Throne, when printed this value is 0.000000f
|
// this enables movement at The Frozen Throne, when printed this value is 0.000000f
|
||||||
// however, when represented as integer client will accept only this value
|
// however, when represented as integer client will accept only this value
|
||||||
@@ -638,7 +646,13 @@ class instance_icecrown_citadel : public InstanceMapScript
|
|||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case DONE:
|
case DONE:
|
||||||
DoRespawnGameObject(DeathbringersCacheGUID, 7*DAY);
|
if (GameObject* loot = instance->GetGameObject(DeathbringersCacheGUID))
|
||||||
|
{
|
||||||
|
if (Creature* deathbringer = instance->GetCreature(DeathbringerSaurfangGUID))
|
||||||
|
loot->SetLootRecipient(deathbringer->GetLootRecipient());
|
||||||
|
loot->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE | GO_FLAG_NODESPAWN);
|
||||||
|
}
|
||||||
|
// no break
|
||||||
case NOT_STARTED:
|
case NOT_STARTED:
|
||||||
if (GameObject* teleporter = instance->GetGameObject(SaurfangTeleportGUID))
|
if (GameObject* teleporter = instance->GetGameObject(SaurfangTeleportGUID))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user