mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
DB/Quest: Rework 'Avruu's Orb' (9418)
This commit is contained in:
44
sql/updates/world/3.3.5/2021_03_15_01_world.sql
Normal file
44
sql/updates/world/3.3.5/2021_03_15_01_world.sql
Normal file
@@ -0,0 +1,44 @@
|
||||
-- There is a chance it was added in Cata but in that case gossip menu too was added in Cata since gossip
|
||||
-- text id is 33066 and gossip option id is 33065. So both should be added or both should be removed
|
||||
DELETE FROM `gossip_menu_option` WHERE `MenuID` = 10219;
|
||||
INSERT INTO `gossip_menu_option` (`MenuID`,`OptionID`,`OptionIcon`,`OptionText`,`OptionBroadcastTextID`,`OptionType`,`OptionNpcFlag`,`ActionMenuID`,`ActionPoiID`,`BoxCoded`,`BoxMoney`,`BoxText`,`BoxBroadcastTextID`,`VerifiedBuild`) VALUES
|
||||
(10219,0,0,"Place Avruu's Orb on the altar.",33065,1,0,0,0,0,0,"",0,14007);
|
||||
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` = 10219;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
|
||||
(15,10219,0,0,0,47,0,9418,10,0,0,0,0,"","Group 0: Show Gossip Option 0 if quest 'Avruu's Orb' is taken");
|
||||
|
||||
UPDATE `smart_scripts` SET `target_x` = -1323.9098, `target_y` = 4042.4487, `target_z` = 116.62573, `target_o` = 0.296705961227416992 WHERE `entryorguid` = 181606 AND `source_type` = 1 AND `id` = 0;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid` = 181606 AND `source_type` = 1 AND `id` > 0;
|
||||
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
|
||||
(181606,1,1,2,62,0,100,0,10219,0,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Haal'eshi Altar - On Gossip Option 0 Selected - Store Targetlist"),
|
||||
(181606,1,2,3,61,0,100,0,0,0,0,0,0,100,1,0,0,0,0,0,19,17085,0,0,0,0,0,0,0,"Haal'eshi Altar - On Link - Send Target 1 (Aeranas)"),
|
||||
(181606,1,3,4,61,0,100,0,0,0,0,0,0,45,0,1,0,0,0,0,19,17085,0,0,0,0,0,0,0,"Haal'eshi Altar - On Link - Set Data 0 1 (Aeranas)"),
|
||||
(181606,1,4,0,61,0,100,0,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Haal'eshi Altar - On Link - Close Gossip");
|
||||
|
||||
UPDATE `creature_text` SET `comment` = "Aeranas" WHERE `CreatureID` = 17085;
|
||||
UPDATE `creature_template` SET `speed_walk` = 1.4, `speed_run` = 1.42857142857, `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = 17085;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid` = 17085 AND `source_type` = 0;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (1708500,1708501,1708502) AND `source_type` = 9;
|
||||
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
|
||||
(17085,0,0,0,63,0,100,0,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Aeranas - On Just Created - Remove NPC Flag Questgiver"),
|
||||
(17085,0,1,0,63,0,100,0,0,0,0,0,0,42,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Aeranas - On Just Created - Set Invincibility HP 1"),
|
||||
(17085,0,2,0,0,0,100,0,5000,5000,10000,10000,0,11,12553,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Aeranas - In Combat - Cast 'Shock'"),
|
||||
(17085,0,3,0,0,0,100,0,9000,9000,25000,25000,0,11,15535,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Aeranas - In Combat - Cast 'Enveloping Winds'"),
|
||||
|
||||
(17085,0,4,0,38,0,100,257,0,1,0,0,0,80,1708500,2,0,0,0,0,1,0,0,0,0,0,0,0,0,"Aeranas - On Data Set 0 1 - Run Script (No Repeat) (No Reset)"),
|
||||
|
||||
(1708500,9,0,0,0,0,100,0,2000,2000,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Aeranas - On Script - Say Line 0"),
|
||||
(1708500,9,1,0,0,0,100,0,6000,6000,0,0,0,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Aeranas - On Script - Set Faction 14"),
|
||||
(1708500,9,2,0,0,0,100,0,0,0,0,0,0,49,0,0,0,0,0,0,12,1,0,0,0,0,0,0,0,"Aeranas - On Script - Start Attack Stored Target 1"),
|
||||
|
||||
(17085,0,5,0,2,0,100,1,0,30,0,0,0,80,1708501,2,0,0,0,0,1,0,0,0,0,0,0,0,0,"Aeranas - Between 0-30% Health - Run Script (No Repeat)"),
|
||||
-- This part should be more complex
|
||||
(1708501,9,0,0,0,0,100,0,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Aeranas - On Script - Set Event Phase 1"),
|
||||
(1708501,9,1,0,0,0,100,0,0,0,0,0,0,2,35,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Aeranas - On Script - Set Faction 35"),
|
||||
(1708501,9,2,0,0,0,100,0,0,0,0,0,0,27,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Aeranas - On Script - Stop Combat"),
|
||||
|
||||
(17085,0,6,0,21,1,100,0,0,0,0,0,0,80,1708502,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Aeranas - On Reached Home - Run Script (Phase 1)"),
|
||||
|
||||
(1708502,9,0,0,0,0,100,0,2000,2000,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Aeranas - On Script - Say Line 1"),
|
||||
(1708502,9,1,0,0,0,100,0,0,0,0,0,0,82,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Aeranas - On Script - Add NPC Flag Questgiver");
|
||||
@@ -27,99 +27,6 @@
|
||||
#include "TemporarySummon.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
/*######
|
||||
## npc_aeranas
|
||||
######*/
|
||||
|
||||
enum Aeranas
|
||||
{
|
||||
SAY_SUMMON = 0,
|
||||
SAY_FREE = 1,
|
||||
SPELL_ENVELOPING_WINDS = 15535,
|
||||
SPELL_SHOCK = 12553
|
||||
};
|
||||
|
||||
class npc_aeranas : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_aeranas() : CreatureScript("npc_aeranas") { }
|
||||
|
||||
struct npc_aeranasAI : public ScriptedAI
|
||||
{
|
||||
npc_aeranasAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
faction_Timer = 8000;
|
||||
envelopingWinds_Timer = 9000;
|
||||
shock_Timer = 5000;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
me->SetFaction(FACTION_FRIENDLY);
|
||||
|
||||
Talk(SAY_SUMMON);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (faction_Timer)
|
||||
{
|
||||
if (faction_Timer <= diff)
|
||||
{
|
||||
me->SetFaction(FACTION_MONSTER_2);
|
||||
faction_Timer = 0;
|
||||
} else faction_Timer -= diff;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (HealthBelowPct(30))
|
||||
{
|
||||
me->SetFaction(FACTION_FRIENDLY);
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
me->RemoveAllAuras();
|
||||
me->CombatStop(true);
|
||||
EngagementOver();
|
||||
Talk(SAY_FREE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (shock_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SHOCK);
|
||||
shock_Timer = 10000;
|
||||
} else shock_Timer -= diff;
|
||||
|
||||
if (envelopingWinds_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_ENVELOPING_WINDS);
|
||||
envelopingWinds_Timer = 25000;
|
||||
} else envelopingWinds_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 faction_Timer;
|
||||
uint32 envelopingWinds_Timer;
|
||||
uint32 shock_Timer;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_aeranasAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
enum ExorcismSpells
|
||||
{
|
||||
SPELL_JULES_GOES_PRONE = 39283,
|
||||
@@ -888,7 +795,6 @@ struct npc_fear_controller : public ScriptedAI
|
||||
|
||||
void AddSC_hellfire_peninsula()
|
||||
{
|
||||
new npc_aeranas();
|
||||
new npc_colonel_jules();
|
||||
new npc_barada();
|
||||
new npc_magister_aledis();
|
||||
|
||||
Reference in New Issue
Block a user