mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Scripts/Ulduar: Fixed achievement Iron Dwarf, Medium Rare in Razorscale's encounter. Thanks to Shauren for help with this achievement
This commit is contained in:
@@ -129,6 +129,7 @@ enum Events
|
||||
#define GROUND_Z 391.517f
|
||||
#define GOSSIP_ITEM_1 "Activate Harpoons!"
|
||||
#define DATA_QUICK_SHAVE 29192921 // 2919, 2921 are achievement IDs
|
||||
#define DATA_IRON_DWARF_MEDIUM_RARE 29232924
|
||||
|
||||
const Position PosEngRepair[4] =
|
||||
{
|
||||
@@ -890,8 +891,21 @@ class npc_darkrune_guardian : public CreatureScript
|
||||
void Reset()
|
||||
{
|
||||
StormTimer = urand(3000, 6000);
|
||||
killedByBreath = false;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
return type == DATA_IRON_DWARF_MEDIUM_RARE ? killedByBreath : 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 value)
|
||||
{
|
||||
if (type == DATA_IRON_DWARF_MEDIUM_RARE)
|
||||
killedByBreath = value;
|
||||
}
|
||||
|
||||
|
||||
void UpdateAI(uint32 const Diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
@@ -907,6 +921,9 @@ class npc_darkrune_guardian : public CreatureScript
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
bool killedByBreath;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
@@ -1007,6 +1024,50 @@ class spell_razorscale_devouring_flame : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_razorscale_flame_breath : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_razorscale_flame_breath() : SpellScriptLoader("spell_razorscale_flame_breath") { }
|
||||
|
||||
class spell_razorscale_flame_breath_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_razorscale_flame_breath_SpellScript);
|
||||
|
||||
void CheckDamage()
|
||||
{
|
||||
Creature* target = GetHitCreature();
|
||||
if (!target || target->GetEntry() != NPC_DARK_RUNE_GUARDIAN)
|
||||
return;
|
||||
|
||||
if (GetHitDamage() >= int32(target->GetHealth()))
|
||||
target->AI()->SetData(DATA_IRON_DWARF_MEDIUM_RARE, 1);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnHit += SpellHitFn(spell_razorscale_flame_breath_SpellScript::CheckDamage);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_razorscale_flame_breath_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_iron_dwarf_medium_rare : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_iron_dwarf_medium_rare() : AchievementCriteriaScript("achievement_iron_dwarf_medium_rare")
|
||||
{
|
||||
}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
return target && target->IsAIEnabled && target->GetAI()->GetData(DATA_IRON_DWARF_MEDIUM_RARE);
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_quick_shave : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
@@ -1035,5 +1096,7 @@ void AddSC_boss_razorscale()
|
||||
new npc_darkrune_guardian();
|
||||
new npc_darkrune_sentinel();
|
||||
new spell_razorscale_devouring_flame();
|
||||
new spell_razorscale_flame_breath();
|
||||
new achievement_iron_dwarf_medium_rare();
|
||||
new achievement_quick_shave();
|
||||
}
|
||||
Reference in New Issue
Block a user