Scripts/Halls of Lightning: Implement "Lightning Struck" achievement.
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
-- HoL General Bjarngrim event Temporary Electrical Charge
|
||||||
|
-- Clear wrong aura
|
||||||
|
UPDATE `creature_addon` SET `auras`='' WHERE `guid` = 126981;
|
||||||
|
|
||||||
|
-- add spell link for Temporary Electrical Charge
|
||||||
|
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`='-52098' AND `spell_effect`='52092';
|
||||||
|
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
|
||||||
|
('-52098', '52092', '0', 'Charge Up - Temporary Electrical Charge');
|
||||||
|
|
||||||
|
-- Set 10 sec delay on platforms where boss gets Temporary Electrical Charge
|
||||||
|
UPDATE `waypoint_data` SET `delay`=10000 WHERE `id`=1269810 AND `point` IN (2, 5, 11, 14);
|
||||||
|
|
||||||
|
-- Cast self Charge Up to get Temporary Electrical Charge
|
||||||
|
DELETE FROM `waypoint_scripts` WHERE `id`=12698101;
|
||||||
|
INSERT INTO `waypoint_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`, `guid`) VALUES
|
||||||
|
(12698101, 0, 14, 52092, 1, 0, 0, 0, 0, 0, 855),
|
||||||
|
(12698101, 2, 15, 52098, 1, 0, 0, 0, 0, 0, 856);
|
||||||
|
UPDATE `waypoint_data` SET `action`=12698101 WHERE `id`=1269810 AND `point` IN (5, 14);
|
||||||
|
|
||||||
|
-- Remove aura Temporary Electrical Charge
|
||||||
|
DELETE FROM `waypoint_scripts` WHERE `id`=12698102;
|
||||||
|
INSERT INTO `waypoint_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`, `guid`) VALUES
|
||||||
|
(12698102, 0, 14, 52092, 1, 0, 0, 0, 0, 0, 857);
|
||||||
|
UPDATE `waypoint_data` SET `action`=12698102 WHERE `id`=1269810 AND `point` IN (2, 3, 4, 11, 12, 13);
|
||||||
|
|
||||||
|
-- Lightning Struck achievement
|
||||||
|
DELETE FROM `disables` WHERE `sourceType`=4 AND `entry`=6835;
|
||||||
|
DELETE FROM `achievement_criteria_data` WHERE `type`=11 AND `criteria_id`=6835;
|
||||||
|
INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES
|
||||||
|
(6835, 11, 0, 0, 'achievement_lightning_struck');
|
||||||
@@ -61,7 +61,7 @@ enum eEnums
|
|||||||
|
|
||||||
//OTHER SPELLS
|
//OTHER SPELLS
|
||||||
//SPELL_CHARGE_UP = 52098, // only used when starting walk from one platform to the other
|
//SPELL_CHARGE_UP = 52098, // only used when starting walk from one platform to the other
|
||||||
//SPELL_TEMPORARY_ELECTRICAL_CHARGE = 52092, // triggered part of above
|
SPELL_TEMPORARY_ELECTRICAL_CHARGE = 52092, // triggered part of above
|
||||||
|
|
||||||
NPC_STORMFORGED_LIEUTENANT = 29240,
|
NPC_STORMFORGED_LIEUTENANT = 29240,
|
||||||
SPELL_ARC_WELD = 59085,
|
SPELL_ARC_WELD = 59085,
|
||||||
@@ -77,6 +77,8 @@ enum eEnums
|
|||||||
STANCE_BATTLE = 2
|
STANCE_BATTLE = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define DATA_LIGHTNING_STRUCK 1834
|
||||||
|
|
||||||
/*######
|
/*######
|
||||||
## boss_bjarngrim
|
## boss_bjarngrim
|
||||||
######*/
|
######*/
|
||||||
@@ -98,11 +100,14 @@ public:
|
|||||||
m_instance = creature->GetInstanceScript();
|
m_instance = creature->GetInstanceScript();
|
||||||
m_uiStance = STANCE_DEFENSIVE;
|
m_uiStance = STANCE_DEFENSIVE;
|
||||||
memset(&m_auiStormforgedLieutenantGUID, 0, sizeof(m_auiStormforgedLieutenantGUID));
|
memset(&m_auiStormforgedLieutenantGUID, 0, sizeof(m_auiStormforgedLieutenantGUID));
|
||||||
|
canBuff = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
InstanceScript* m_instance;
|
InstanceScript* m_instance;
|
||||||
|
|
||||||
bool m_bIsChangingStance;
|
bool m_bIsChangingStance;
|
||||||
|
bool achiLightningStruck;
|
||||||
|
bool canBuff;
|
||||||
|
|
||||||
uint8 m_uiChargingStatus;
|
uint8 m_uiChargingStatus;
|
||||||
uint8 m_uiStance;
|
uint8 m_uiStance;
|
||||||
@@ -126,6 +131,11 @@ public:
|
|||||||
|
|
||||||
void Reset()
|
void Reset()
|
||||||
{
|
{
|
||||||
|
if (canBuff)
|
||||||
|
if (!me->HasAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE))
|
||||||
|
me->AddAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE, me);
|
||||||
|
|
||||||
|
achiLightningStruck = false;
|
||||||
m_bIsChangingStance = false;
|
m_bIsChangingStance = false;
|
||||||
|
|
||||||
m_uiChargingStatus = 0;
|
m_uiChargingStatus = 0;
|
||||||
@@ -167,8 +177,21 @@ public:
|
|||||||
m_instance->SetData(TYPE_BJARNGRIM, NOT_STARTED);
|
m_instance->SetData(TYPE_BJARNGRIM, NOT_STARTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EnterEvadeMode()
|
||||||
|
{
|
||||||
|
if (me->HasAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE))
|
||||||
|
canBuff = true;
|
||||||
|
else
|
||||||
|
canBuff = false;
|
||||||
|
|
||||||
|
ScriptedAI::EnterEvadeMode();
|
||||||
|
}
|
||||||
|
|
||||||
void EnterCombat(Unit* /*who*/)
|
void EnterCombat(Unit* /*who*/)
|
||||||
{
|
{
|
||||||
|
if (me->HasAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE))
|
||||||
|
achiLightningStruck = true;
|
||||||
|
|
||||||
DoScriptText(SAY_AGGRO, me);
|
DoScriptText(SAY_AGGRO, me);
|
||||||
|
|
||||||
//must get both lieutenants here and make sure they are with him
|
//must get both lieutenants here and make sure they are with him
|
||||||
@@ -178,6 +201,14 @@ public:
|
|||||||
m_instance->SetData(TYPE_BJARNGRIM, IN_PROGRESS);
|
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*/)
|
void KilledUnit(Unit* /*victim*/)
|
||||||
{
|
{
|
||||||
DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me);
|
DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me);
|
||||||
@@ -432,8 +463,27 @@ 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()
|
void AddSC_boss_bjarngrim()
|
||||||
{
|
{
|
||||||
new boss_bjarngrim();
|
new boss_bjarngrim();
|
||||||
new mob_stormforged_lieutenant();
|
new mob_stormforged_lieutenant();
|
||||||
|
new achievement_lightning_struck();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user