Skip to content

Commit 892fdfe

Browse files
committed
[3054] Add script support for quest 10286
Thanks to @Grz3s for providing the data
1 parent 7b88cad commit 892fdfe

6 files changed

Lines changed: 138 additions & 3 deletions

File tree

scripts/outland/hellfire_peninsula.cpp

Lines changed: 129 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/* ScriptData
1818
SDName: Hellfire_Peninsula
1919
SD%Complete: 100
20-
SDComment: Quest support: 9375, 9410, 9418, 10629, 10838, 10935.
20+
SDComment: Quest support: 9375, 9410, 9418, 10286, 10629, 10838, 10935.
2121
SDCategory: Hellfire Peninsula
2222
EndScriptData */
2323

@@ -29,6 +29,7 @@ npc_wounded_blood_elf
2929
npc_fel_guard_hound
3030
npc_anchorite_barada
3131
npc_colonel_jules
32+
npc_magister_aledis
3233
EndContentData */
3334

3435
#include "precompiled.h"
@@ -873,6 +874,128 @@ bool EffectDummyCreature_npc_colonel_jules(Unit* pCaster, uint32 uiSpellId, Spel
873874
return false;
874875
}
875876

877+
/*######
878+
## npc_magister_aledis
879+
######*/
880+
881+
enum
882+
{
883+
SAY_ALEDIS_DEFEAT = -1001172,
884+
885+
SPELL_PYROBLAST = 33975,
886+
SPELL_FROST_NOVA = 11831,
887+
SPELL_FIREBALL = 20823,
888+
};
889+
890+
struct npc_magister_aledisAI : public ScriptedAI
891+
{
892+
npc_magister_aledisAI(Creature* pCreature) : ScriptedAI(pCreature)
893+
{
894+
m_bIsDefeated = false;
895+
Reset();
896+
}
897+
898+
uint32 m_uiPyroblastTimer;
899+
uint32 m_uiFrostNovaTimer;
900+
uint32 m_uiFireballTimer;
901+
902+
bool m_bIsDefeated;
903+
904+
void Reset() override
905+
{
906+
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
907+
908+
m_uiPyroblastTimer = urand(10000, 14000);
909+
m_uiFrostNovaTimer = 0;
910+
m_uiFireballTimer = 1000;
911+
}
912+
913+
void AttackStart(Unit* pWho) override
914+
{
915+
if (m_creature->Attack(pWho, false))
916+
{
917+
m_creature->AddThreat(pWho);
918+
m_creature->SetInCombatWith(pWho);
919+
pWho->SetInCombatWith(m_creature);
920+
DoStartMovement(pWho, 10.0f);
921+
}
922+
}
923+
924+
void EnterEvadeMode() override
925+
{
926+
m_creature->RemoveAllAurasOnEvade();
927+
m_creature->DeleteThreatList();
928+
m_creature->CombatStop(true);
929+
930+
if (!m_bIsDefeated)
931+
m_creature->LoadCreatureAddon(true);
932+
933+
if (m_creature->isAlive())
934+
{
935+
if (!m_bIsDefeated)
936+
{
937+
m_creature->SetWalk(true);
938+
m_creature->GetMotionMaster()->MoveWaypoint();
939+
}
940+
else
941+
m_creature->GetMotionMaster()->MoveIdle();
942+
}
943+
944+
m_creature->SetLootRecipient(NULL);
945+
946+
Reset();
947+
}
948+
949+
void UpdateAI(const uint32 uiDiff) override
950+
{
951+
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
952+
return;
953+
954+
if (!m_bIsDefeated && m_creature->GetHealthPercent() < 25.0f)
955+
{
956+
// evade when defeated; faction is reset automatically
957+
m_bIsDefeated = true;
958+
EnterEvadeMode();
959+
960+
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
961+
DoScriptText(SAY_ALEDIS_DEFEAT, m_creature);
962+
m_creature->ForcedDespawn(60000);
963+
return;
964+
}
965+
966+
if (m_uiPyroblastTimer < uiDiff)
967+
{
968+
if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_PYROBLAST) == CAST_OK)
969+
m_uiPyroblastTimer = urand(18000, 21000);
970+
}
971+
else
972+
m_uiPyroblastTimer -= uiDiff;
973+
974+
if (m_uiFireballTimer < uiDiff)
975+
{
976+
if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_FIREBALL) == CAST_OK)
977+
m_uiFireballTimer = urand(3000, 4000);
978+
}
979+
else
980+
m_uiFireballTimer -= uiDiff;
981+
982+
if (m_uiFrostNovaTimer < uiDiff)
983+
{
984+
if (DoCastSpellIfCan(m_creature, SPELL_FROST_NOVA) == CAST_OK)
985+
m_uiFrostNovaTimer = urand(12000, 16000);
986+
}
987+
else
988+
m_uiFrostNovaTimer -= uiDiff;
989+
990+
DoMeleeAttackIfReady();
991+
}
992+
};
993+
994+
CreatureAI* GetAI_npc_magister_aledis(Creature* pCreature)
995+
{
996+
return new npc_magister_aledisAI(pCreature);
997+
}
998+
876999
void AddSC_hellfire_peninsula()
8771000
{
8781001
Script* pNewScript;
@@ -918,4 +1041,9 @@ void AddSC_hellfire_peninsula()
9181041
pNewScript->pGossipHello = &GossipHello_npc_colonel_jules;
9191042
pNewScript->pEffectDummyNPC = &EffectDummyCreature_npc_colonel_jules;
9201043
pNewScript->RegisterSelf();
1044+
1045+
pNewScript = new Script;
1046+
pNewScript->Name = "npc_magister_aledis";
1047+
pNewScript->GetAI = &GetAI_npc_magister_aledis;
1048+
pNewScript->RegisterSelf();
9211049
}

sd2_revision_nr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#ifndef __SD2_REVISION_NR_H__
22
#define __SD2_REVISION_NR_H__
3-
#define SD2_REVISION_NR "3053"
3+
#define SD2_REVISION_NR "3054"
44
#endif // __SD2_REVISION_NR_H__

sql/mangos_scriptname_full.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,7 @@ UPDATE creature_template SET ScriptName='npc_wounded_blood_elf' WHERE entry=1699
678678
UPDATE creature_template SET ScriptName='npc_fel_guard_hound' WHERE entry=21847;
679679
UPDATE creature_template SET ScriptName='npc_anchorite_barada' WHERE entry=22431;
680680
UPDATE creature_template SET ScriptName='npc_colonel_jules' WHERE entry=22432;
681+
UPDATE creature_template SET ScriptName='npc_magister_aledis' WHERE entry=20159;
681682

682683
/* HILLSBRAD FOOTHILLS */
683684

sql/scriptdev2_script_full.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,9 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
12711271
(-1001169,'The naga do not respect nature. They twist and corrupt it to meet their needs. They live to agitate the spirits.',0,0,0,0,'wilda SAY_WIL_PROGRESS_5'),
12721272

12731273
(-1001170,'Time only has meaning to mortals, insect. Dimensius is infinite!',0,1,0,0,'dimensius SAY_AGGRO'),
1274-
(-1001171,'I hunger! Feed me the power of this forge, my children!',0,1,0,0,'dimensius SAY_SUMMON');
1274+
(-1001171,'I hunger! Feed me the power of this forge, my children!',0,1,0,0,'dimensius SAY_SUMMON'),
1275+
1276+
(-1001172,'Spare my life! I will tell you about Arelion\'s secret.',0,0,0,0,'magister_aledis SAY_ALEDIS_DEFEAT');
12751277

12761278
-- -1 033 000 SHADOWFANG KEEP
12771279
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES

sql/updates/r3054_mangos.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
UPDATE creature_template SET ScriptName='npc_magister_aledis' WHERE entry=20159;

sql/updates/r3054_scriptdev2.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DELETE FROM script_texts WHERE entry=-1001172;
2+
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
3+
(-1001172,'Spare my life! I will tell you about Arelion\'s secret.',0,0,0,0,'magister_aledis SAY_ALEDIS_DEFEAT');

0 commit comments

Comments
 (0)