mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-28 12:52:25 +01:00
Scripts/Halls of Lightning: Move criteria check for "Lightning Struck" achievement from criteria script to DB.
Thx to Vincent-Michael for pointing this out.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
-- Lightning Struck achievement move from criteria script to DB thx Vincent-Michael
|
||||
DELETE FROM `achievement_criteria_data` WHERE `ScriptName`='achievement_lightning_struck';
|
||||
DELETE FROM `achievement_criteria_data` WHERE `type`=7 AND `criteria_id`=6835;
|
||||
INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES
|
||||
(6835, 7, 52092, 0, '');
|
||||
@@ -77,8 +77,6 @@ enum eEnums
|
||||
STANCE_BATTLE = 2
|
||||
};
|
||||
|
||||
#define DATA_LIGHTNING_STRUCK 1834
|
||||
|
||||
/*######
|
||||
## boss_bjarngrim
|
||||
######*/
|
||||
@@ -106,7 +104,6 @@ public:
|
||||
InstanceScript* m_instance;
|
||||
|
||||
bool m_bIsChangingStance;
|
||||
bool achiLightningStruck;
|
||||
bool canBuff;
|
||||
|
||||
uint8 m_uiChargingStatus;
|
||||
@@ -135,7 +132,6 @@ public:
|
||||
if (!me->HasAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE))
|
||||
me->AddAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE, me);
|
||||
|
||||
achiLightningStruck = false;
|
||||
m_bIsChangingStance = false;
|
||||
|
||||
m_uiChargingStatus = 0;
|
||||
@@ -189,9 +185,6 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (me->HasAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE))
|
||||
achiLightningStruck = true;
|
||||
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
//must get both lieutenants here and make sure they are with him
|
||||
@@ -201,14 +194,6 @@ public:
|
||||
m_instance->SetData(TYPE_BJARNGRIM, IN_PROGRESS);
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
if (type == DATA_LIGHTNING_STRUCK)
|
||||
return achiLightningStruck ? 1 : 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me);
|
||||
@@ -463,27 +448,8 @@ public:
|
||||
|
||||
};
|
||||
|
||||
class achievement_lightning_struck : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_lightning_struck() : AchievementCriteriaScript("achievement_lightning_struck") { }
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
if (Creature* bjarngrim = target->ToCreature())
|
||||
if (bjarngrim->AI()->GetData(DATA_LIGHTNING_STRUCK))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_bjarngrim()
|
||||
{
|
||||
new boss_bjarngrim();
|
||||
new mob_stormforged_lieutenant();
|
||||
new achievement_lightning_struck();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user