mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +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:
18
sql/updates/world/2011_07_01_02_world_misc.sql
Normal file
18
sql/updates/world/2011_07_01_02_world_misc.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id` IN (63317,64021);
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`)
|
||||
VALUES
|
||||
(63317,'spell_razorscale_flame_breath'),
|
||||
(64021,'spell_razorscale_flame_breath');
|
||||
|
||||
DELETE FROM `disables` WHERE `sourceType`=4 AND `entry` IN (10066,10067);
|
||||
|
||||
DELETE FROM `conditions` WHERE `SourceEntry`=63317;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`comment`)
|
||||
VALUES
|
||||
(13,0,63317,0,18,1,33388,0,0,'','Flame Breath - Dark Rune Guardian');
|
||||
|
||||
DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (10066,10067) AND `type`=11;
|
||||
INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`)
|
||||
VALUES
|
||||
(10066,11,0,0,'achievement_iron_dwarf_medium_rare'),
|
||||
(10067,11,0,0,'achievement_iron_dwarf_medium_rare');
|
||||
@@ -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