diff options
| -rw-r--r-- | sql/FULL/world_script_waypoints.sql | 27 | ||||
| -rw-r--r-- | sql/FULL/world_scripts_full.sql | 4 | ||||
| -rw-r--r-- | sql/updates/5908_world_script.sql | 2 | ||||
| -rw-r--r-- | src/bindings/scripts/scripts/northrend/howling_fjord.cpp | 124 |
4 files changed, 154 insertions, 3 deletions
diff --git a/sql/FULL/world_script_waypoints.sql b/sql/FULL/world_script_waypoints.sql index 727bf52b75c..68e150f271b 100644 --- a/sql/FULL/world_script_waypoints.sql +++ b/sql/FULL/world_script_waypoints.sql @@ -1643,3 +1643,30 @@ INSERT INTO script_waypoint VALUES (28070, 19, 928.070068, 363.296326, 204.091, 0, 'stealth'), (28070, 20, 934.817627, 370.136261, 207.421, 0, ''), (28070, 21, 941.501465, 377.254456, 207.421, 0, ''); + +DELETE FROM `script_waypoint` WHERE `entry`=23784; +INSERT INTO `script_waypoint` VALUES + (23784, 1, 1383.52, -6411.72, 1.2181, 5, 'Apothecary Hanes'), + (23784, 2, 1392.57, -6403.5, 1.9699, 2000, 'Apothecary Hanes'), + (23784, 3, 1397.42, -6378.76, 4.996, 5, 'Apothecary Hanes'), + (23784, 4, 1427.36, -6359.47, 6.385, 5, 'Apothecary Hanes'), + (23784, 5, 1406.46, -6334.45, 6.149, 2000, 'Apothecary Hanes'), + (23784, 6, 1400.77, -6339.71, 6.367, 5000, 'Apothecary Hanes'), + (23784, 7, 1424.09, -6326.67, 5.716, 5, 'Apothecary Hanes'), + (23784, 8, 1470, -6347.45, 7.596, 5000, 'Apothecary Hanes'), + (23784, 9, 1465.18, -6343.53, 7.58766, 2000, 'Apothecary Hanes'), + (23784, 10, 1463.9, -6339.28, 7.56152, 5, 'Apothecary Hanes'), + (23784, 11, 1474.6, -6327.65, 7.02011, 5, 'Apothecary Hanes'), + (23784, 12, 1486.59, -6319.08, 8.13591, 5, 'Apothecary Hanes'), + (23784, 13, 1499.87, -6312.24, 7.11185, 5, 'Apothecary Hanes'), + (23784, 14, 1507.95, -6315.27, 7.05227, 5000, 'Apothecary Hanes'), + (23784, 15, 1511.92, -6300.64, 6.43812, 5, 'Apothecary Hanes'), + (23784, 16, 1520.02, -6279.71, 5.31363, 5, 'Apothecary Hanes'), + (23784, 17, 1534.01, -6245, 6.31535, 5, 'Apothecary Hanes'), + (23784, 18, 1537.98, -6224.37, 6.36504, 5, 'Apothecary Hanes'), + (23784, 19, 1551.58, -6206.27, 6.9545, 2000, 'Apothecary Hanes'), + (23784, 20, 1572.99, -6197.74, 6.70809, 5, 'Apothecary Hanes'), + (23784, 21, 1608.51, -6175.83, 8.80075, 5, 'Apothecary Hanes'), + (23784, 22, 1619.15, -6167.6, 9.39125, 5, 'Apothecary Hanes'), + (23784, 23, 1634.05, -6153.81, 8.08527, 5, 'Apothecary Hanes'); + diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index bc9c2591079..0d43ba42db2 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -634,10 +634,10 @@ UPDATE `creature_template` SET `ScriptName`='npc_ancestral_wolf' WHERE `entry`=1 UPDATE `creature_template` SET `ScriptName`='npc_00x09hl' WHERE `entry`=7806; UPDATE `creature_template` SET `ScriptName`='npc_rinji' WHERE `entry`=7780; -/* Howling Fjord */ +/* HOWLING FJORD */ UPDATE `creature_template` SET `ScriptName`='npc_plaguehound_tracker' WHERE `entry`=24156; UPDATE `creature_template` SET `ScriptName`='npc_razael_and_lyana',`npcflag`=`npcflag`|1 WHERE `entry` IN (23778,23998); - +UPDATE `creature_template` SET `ScriptName`='npc_apothecary_hanes' WHERE `entry`=23784; /* ICECROWN */ UPDATE `creature_template` SET `ScriptName`='npc_arete' WHERE `entry`=29344; diff --git a/sql/updates/5908_world_script.sql b/sql/updates/5908_world_script.sql new file mode 100644 index 00000000000..9b02c9c6fb1 --- /dev/null +++ b/sql/updates/5908_world_script.sql @@ -0,0 +1,2 @@ + +UPDATE `creature_template` SET `ScriptName`='npc_apothecary_hanes'; diff --git a/src/bindings/scripts/scripts/northrend/howling_fjord.cpp b/src/bindings/scripts/scripts/northrend/howling_fjord.cpp index a005a3c6f64..2ee05fdecfd 100644 --- a/src/bindings/scripts/scripts/northrend/howling_fjord.cpp +++ b/src/bindings/scripts/scripts/northrend/howling_fjord.cpp @@ -18,18 +18,134 @@ /* ScriptData SDName: Sholazar_Basin SD%Complete: 100 -SDComment: Quest support: 11253. +SDComment: Quest support: 11253, 11241. SDCategory: howling_fjord EndScriptData */ /* ContentData npc_plaguehound_tracker +npc_apothecary_hanes EndContentData */ #include "precompiled.h" #include "escort_ai.h" /*###### +## npc_apothecary_hanes +######*/ +enum Entries +{ + NPC_APOTHECARY_HANES = 23784, + FACTION_ESCORTEE_A = 774, + FACTION_ESCORTEE_H = 775, + NPC_HANES_FIRE_TRIGGER = 23968, + QUEST_TRAIL_OF_FIRE = 11241, + SPELL_COSMETIC_LOW_POLY_FIRE = 56274 +}; + +bool QuestAccept_npc_apothecary_hanes(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_TRAIL_OF_FIRE) + { + switch (pPlayer->GetTeam()) + { + case ALLIANCE: + pCreature->setFaction(FACTION_ESCORTEE_A); + break; + case HORDE: + pCreature->setFaction(FACTION_ESCORTEE_H); + break; + } + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID()); + } + return true; +} + +struct TRINITY_DLL_DECL npc_Apothecary_HanesAI : public npc_escortAI +{ + npc_Apothecary_HanesAI(Creature* pCreature) : npc_escortAI(pCreature){} + uint32 PotTimer; + + void Reset () + { + SetDespawnAtFar(false); + PotTimer = 10000; //10 sec cooldown on potion + } + + void JustDied(Unit* killer) + { + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->FailQuest(QUEST_TRAIL_OF_FIRE); + } + + void UpdateEscortAI(const uint32 diff) + { + if(HealthBelowPct(75)) + { + if(PotTimer < diff) + { + DoCast(me,17534,true); + PotTimer = 10000; + } else PotTimer -= diff; + } + if (GetAttack() && UpdateVictim()) + DoMeleeAttackIfReady(); + } + + void WaypointReached(uint32 i) + { + Player* pPlayer = GetPlayerForEscort(); + if (!pPlayer) + return; + switch(i) + { + case 1: + me->SetReactState(REACT_AGGRESSIVE); + SetRun(true); + break; + case 23: + if (pPlayer) + pPlayer->GroupEventHappens(QUEST_TRAIL_OF_FIRE, m_creature); + me->ForcedDespawn(); + break; + case 5: + if (Unit* Trigger = m_creature->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f)) + Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false); + SetRun(false); + break; + case 6: + if (Unit* Trigger = m_creature->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f)) + Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false); + SetRun(true); + break; + case 8: + if (Unit* Trigger = m_creature->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f)) + Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false); + SetRun(false); + break; + case 9: + if (Unit* Trigger = m_creature->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f)) + Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false); + break; + case 10: + SetRun(true); + break; + case 13: + SetRun(false); + break; + case 14: + if (Unit* Trigger = m_creature->FindNearestCreature(NPC_HANES_FIRE_TRIGGER,10.0f)) + Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false); + SetRun(true); + break; + } + } +}; +CreatureAI* GetAI_npc_apothecary_hanes(Creature* pCreature) +{ + return new npc_Apothecary_HanesAI(pCreature); +} +/*###### ## npc_plaguehound_tracker ######*/ @@ -153,6 +269,12 @@ void AddSC_howling_fjord() Script *newscript; newscript = new Script; + newscript->Name = "npc_apothecary_hanes"; + newscript->GetAI = &GetAI_npc_apothecary_hanes; + newscript->pQuestAccept = &QuestAccept_npc_apothecary_hanes; + newscript->RegisterSelf(); + + newscript = new Script; newscript->Name = "npc_plaguehound_tracker"; newscript->GetAI = &GetAI_npc_plaguehound_tracker; newscript->RegisterSelf(); |
