diff options
3 files changed, 211 insertions, 48 deletions
diff --git a/sql/updates/world/master/2017_03_03_12_world_2016_09_25_03_world.sql b/sql/updates/world/master/2017_03_03_12_world_2016_09_25_03_world.sql new file mode 100644 index 00000000000..3d9d25539ae --- /dev/null +++ b/sql/updates/world/master/2017_03_03_12_world_2016_09_25_03_world.sql @@ -0,0 +1,68 @@ +-- +UPDATE `creature` SET `spawntimesecs`=0 WHERE `id`=23784; + +DELETE FROM `creature_text` WHERE `entry`=23784; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(23784, 0, 0, "You couldn't have come at a better time! Let's get out of here.", 12, 1, 100, 0, 0, 0, 22485, 0, "Apothecary Hanes"), +(23784, 1, 0, "Yes, let us leave... but not before we leave our Alliance hosts something to remember us by!", 12, 1, 100, 0, 0, 0, 22486, 0, "Apothecary Hanes"), +(23784, 2, 0, "They have limited supplies in this camp. It would be a real shame if something were to happen to them.", 12, 1, 100, 0, 0, 0, 22487, 0, "Apothecary Hanes"), +(23784, 3, 0, "Ah, yes... watch it burn!", 12, 1, 100, 0, 0, 0, 22489, 0, "Apothecary Hanes"), +(23784, 4, 0, "We're almost done!", 12, 1, 100, 0, 0, 0, 22490, 0, "Apothecary Hanes"), +(23784, 5, 0, "That'll teach you to mess with an apothecary, you motherless Alliance dogs!", 14, 1, 100, 0, 0, 0, 22491, 0, "Apothecary Hanes"), +(23784, 6, 0, "Let's high-tail it out of here.", 12, 1, 100, 0, 0, 0, 22492, 0, "Apothecary Hanes"), +(23784, 7, 0, "Don't shoot! Apothecary coming through!", 14, 1, 100, 0, 0, 0, 22493, 0, "Apothecary Hanes"), +(23784, 8, 0, "We're in your debt, friend. Speak to Lysander at Vengeance Landing; he will arrange a suitable reward for you.", 12, 1, 100, 0, 0, 0, 22494, 0, "Apothecary Hanes"); + +DELETE FROM `script_waypoint` WHERE `entry`=23784; +INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES +(23784, 1, 1379.813, -6409.201, 1.664683, 0, "Apothecary Hanes"), +(23784, 2, 1380.114, -6401.745, 2.539683, 8000, "Apothecary Hanes"), +(23784, 3, 1382.692, -6398.32, 3.308795, 0, "Apothecary Hanes"), +(23784, 4, 1386.27, -6393.396, 3.577907, 0, "Apothecary Hanes"), +(23784, 5, 1394.768, -6387.708, 3.702907, 0, "Apothecary Hanes"), +(23784, 6, 1405.694, -6380.924, 4.62476, 0, "Apothecary Hanes"), +(23784, 7, 1416.18, -6370.656, 6.12476, 0, "Apothecary Hanes"), +(23784, 8, 1425.048, -6361.604, 6.229269, 0, "Apothecary Hanes"), +(23784, 9, 1427.955, -6350.528, 6.354269, 0, "Apothecary Hanes"), +(23784, 10, 1424.617, -6340.581, 5.729269, 0, "Apothecary Hanes"), +(23784, 11, 1416.344, -6335.909, 5.729269, 0, "Apothecary Hanes"), +(23784, 12, 1404.921, -6335.286, 6.229269, 0, "Apothecary Hanes"), +(23784, 13, 1400.859, -6340.079, 6.479269, 8000, "Apothecary Hanes"), +(23784, 14, 1407.071, -6332.194, 6.256171, 0, "Apothecary Hanes"), +(23784, 15, 1418.821, -6332.194, 6.006171, 0, "Apothecary Hanes"), +(23784, 16, 1419.282, -6332.309, 5.533074, 0, "Apothecary Hanes"), +(23784, 17, 1428.454, -6335.082, 5.604269, 0, "Apothecary Hanes"), +(23784, 18, 1446.955, -6338.777, 8.005317, 0, "Apothecary Hanes"), +(23784, 19, 1457.27, -6343.141, 8.380317, 0, "Apothecary Hanes"), +(23784, 20, 1465.724, -6345.168, 7.755317, 2000, "Apothecary Hanes"), +(23784, 21, 1471.415, -6348.291, 7.692434, 7000, "Apothecary Hanes"), +(23784, 22, 1462.058, -6341.999, 8.005317, 0, "Apothecary Hanes"), +(23784, 23, 1465.077, -6331.357, 7.559553, 0, "Apothecary Hanes"), +(23784, 24, 1475.621, -6327.219, 7.073432, 0, "Apothecary Hanes"), +(23784, 25, 1490.551, -6315.318, 8.323432, 0, "Apothecary Hanes"), +(23784, 26, 1497.682, -6311.022, 7.448432, 0, "Apothecary Hanes"), +(23784, 27, 1505.303, -6313.513, 6.831386, 0, "Apothecary Hanes"), +(23784, 28, 1506.431, -6317.528, 7.331386, 24000, "Apothecary Hanes"), +(23784, 29, 1504.416, -6305.003, 6.581386, 0, "Apothecary Hanes"), +(23784, 30, 1513.499, -6287.491, 5.818699, 0, "Apothecary Hanes"), +(23784, 31, 1513.937, -6277.724, 5.568699, 0, "Apothecary Hanes"), +(23784, 32, 1523.013, -6259.255, 4.647499, 0, "Apothecary Hanes"), +(23784, 33, 1538.941, -6220.414, 6.448732, 0, "Apothecary Hanes"), +(23784, 34, 1554.772, -6204.828, 6.698732, 0, "Apothecary Hanes"), +(23784, 35, 1566.746, -6192.293, 7.72767, 0, "Apothecary Hanes"), +(23784, 36, 1583.782, -6168.592, 8.35267, 0, "Apothecary Hanes"), +(23784, 37, 1588.554, -6163.325, 7.94416, 0, "Apothecary Hanes"), +(23784, 38, 1600.514, -6157.163, 8.714622, 0, "Apothecary Hanes"), +(23784, 39, 1606.814 ,-6158.777, 8.839622, 0, "Apothecary Hanes"), +(23784, 40, 1615.063 ,-6157.817, 9.339622, 10000, "Apothecary Hanes"); + +DELETE FROM `creature_equip_template` WHERE `creatureid`=23784; +INSERT INTO `creature_equip_template` (`CreatureID`, `ID`, `ItemID1`, `ItemID2`, `ItemID3`, `VerifiedBuild`) VALUES +(23784, 2, 1906, 0, 0, 0); + +-- UPDATE `spell_dbc` SET `Effect1`=76, `EffectMiscValue1`=182071 WHERE `Id`=42686; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=42685; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 42685, 0, 0, 31, 0, 3, 23968, 0, 0, 0, 0, "", "Spell 'Burn' targets NPC 'Hanes Fire Trigger' OR"), +(13, 1, 42685, 0, 1, 31, 0, 3, 23784, 0, 0, 0, 0, "", "Spell 'Burn' targets NPC 'Apothecary Hanes'"); diff --git a/sql/updates/world/master/2017_03_03_13_world_2016_09_25_04_world.sql b/sql/updates/world/master/2017_03_03_13_world_2016_09_25_04_world.sql new file mode 100644 index 00000000000..b38d749af4c --- /dev/null +++ b/sql/updates/world/master/2017_03_03_13_world_2016_09_25_04_world.sql @@ -0,0 +1,3 @@ +-- +UPDATE `smart_scripts` SET `action_type`=11, `action_param1`=42686, `action_param2`=2, `comment`="Dead Caravan Guard - On Spellhit 'Ragefist's Torch' - Cast spell 'Summon Fire'" WHERE `entryorguid`=25342 AND `id`=3; +UPDATE `smart_scripts` SET `action_type`=11, `action_param1`=42686, `action_param2`=2, `comment`="Dead Caravan Worker - On Spellhit 'Ragefist's Torch' - Cast spell 'Summon Fire'" WHERE `entryorguid`=25343 AND `id`=3; diff --git a/src/server/scripts/Northrend/zone_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp index 85711c037de..80b4e0c0ead 100644 --- a/src/server/scripts/Northrend/zone_howling_fjord.cpp +++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp @@ -40,13 +40,38 @@ EndContentData */ ######*/ 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, - SPELL_HEALING_POTION = 17534 + NPC_APOTHECARY_HANES = 23784, + FACTION_ESCORTEE_H = 775, + QUEST_TRAIL_OF_FIRE = 11241, + + SPELL_HEALING_POTION = 17534, + SPELL_BURN = 42685, + + EVENT_EMOTE_BEG = 1, + EVENT_BEGIN = 2, + EVENT_START_ESCORT = 3, + EVENT_TALK_1 = 4, + EVENT_KNEEL = 5, + EVENT_TALK_2 = 6, + EVENT_BURN_CRATES = 7, + EVENT_TALK_3 = 8, + EVENT_TALK_4 = 9, + EVENT_LAUGH = 10, + EVENT_TALK_5 = 11, + EVENT_TALK_6 = 12, + EVENT_TALK_8 = 13, + + TALK_0 = 0, + TALK_1 = 1, + TALK_2 = 2, + TALK_3 = 3, + TALK_4 = 4, + TALK_5 = 5, + TALK_6 = 6, + TALK_7 = 7, + TALK_8 = 8, + + EQUIP_TORCH = 2 }; class npc_apothecary_hanes : public CreatureScript @@ -58,16 +83,7 @@ public: { if (quest->GetQuestId() == QUEST_TRAIL_OF_FIRE) { - switch (player->GetTeam()) - { - case ALLIANCE: - creature->setFaction(FACTION_ESCORTEE_A); - break; - case HORDE: - creature->setFaction(FACTION_ESCORTEE_H); - break; - } - ENSURE_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); + ENSURE_AI(npc_Apothecary_HanesAI, (creature->AI()))->StartEscort(player); } return true; } @@ -79,12 +95,25 @@ public: Initialize(); } + void StartEscort(Player* player) + { + events.ScheduleEvent(EVENT_BEGIN, Seconds(2)); + events.ScheduleEvent(EVENT_START_ESCORT, Seconds(6)); + _player = player->GetGUID(); + } + void Initialize() { PotTimer = 10000; //10 sec cooldown on potion + events.Reset(); + events.ScheduleEvent(EVENT_EMOTE_BEG, Seconds(2)); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + _player = ObjectGuid(); } uint32 PotTimer; + EventMap events; + ObjectGuid _player; void Reset() override { @@ -98,7 +127,7 @@ public: player->FailQuest(QUEST_TRAIL_OF_FIRE); } - void UpdateEscortAI(uint32 diff) override + void UpdateAI(uint32 diff) override { if (HealthBelowPct(75)) { @@ -108,8 +137,77 @@ public: PotTimer = 10000; } else PotTimer -= diff; } + if (GetAttack() && UpdateVictim()) DoMeleeAttackIfReady(); + + npc_escortAI::UpdateAI(diff); + + if (me->IsInCombat()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_EMOTE_BEG: + me->HandleEmoteCommand(EMOTE_ONESHOT_BEG); + events.ScheduleEvent(EVENT_EMOTE_BEG, Seconds(25)); + break; + case EVENT_BEGIN: + if (Player* player = ObjectAccessor::GetPlayer(*me, _player)) + Talk(TALK_0, player); + break; + case EVENT_START_ESCORT: + events.Reset(); + me->setFaction(FACTION_ESCORTEE_H); + me->SetReactState(REACT_AGGRESSIVE); + ENSURE_AI(npc_escortAI, (me->AI()))->Start(true, true, _player); + break; + case EVENT_TALK_1: + if (Player* player = ObjectAccessor::GetPlayer(*me, _player)) + Talk(TALK_1, player); + break; + case EVENT_KNEEL: + me->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); + break; + case EVENT_TALK_2: + if (Player* player = ObjectAccessor::GetPlayer(*me, _player)) + Talk(TALK_2, player); + me->LoadEquipment(EQUIP_TORCH); + me->SetSheath(SHEATH_STATE_MELEE); + break; + case EVENT_BURN_CRATES: + DoCastAOE(SPELL_BURN, true); + break; + case EVENT_TALK_3: + if (Player* player = ObjectAccessor::GetPlayer(*me, _player)) + Talk(TALK_3, player); + break; + case EVENT_TALK_4: + if (Player* player = ObjectAccessor::GetPlayer(*me, _player)) + Talk(TALK_4, player); + break; + case EVENT_LAUGH: + me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); + break; + case EVENT_TALK_5: + if (Player* player = ObjectAccessor::GetPlayer(*me, _player)) + Talk(TALK_5, player); + me->HandleEmoteCommand(EMOTE_ONESHOT_RUDE); + break; + case EVENT_TALK_6: + if (Player* player = ObjectAccessor::GetPlayer(*me, _player)) + Talk(TALK_6, player); + break; + case EVENT_TALK_8: + if (Player* player = ObjectAccessor::GetPlayer(*me, _player)) + Talk(TALK_8, player); + break; + } + } } void WaypointReached(uint32 waypointId) override @@ -121,42 +219,36 @@ public: switch (waypointId) { case 1: - me->SetReactState(REACT_AGGRESSIVE); - SetRun(true); - break; - case 23: - player->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me); - me->DespawnOrUnsummon(); - break; - case 5: - if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f)) - Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false); - SetRun(false); + events.ScheduleEvent(EVENT_TALK_1, Seconds(3)); + events.ScheduleEvent(EVENT_KNEEL, Seconds(5)); + events.ScheduleEvent(EVENT_TALK_2, Seconds(6)); + me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 6: - if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f)) - Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false); - SetRun(true); + case 12: + events.ScheduleEvent(EVENT_BURN_CRATES, Seconds(1)); + events.ScheduleEvent(EVENT_TALK_3, Seconds(3)); break; - case 8: - if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f)) - Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false); - SetRun(false); + case 20: + events.ScheduleEvent(EVENT_BURN_CRATES, 0); break; - case 9: - if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f)) - Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false); + case 21: + events.ScheduleEvent(EVENT_BURN_CRATES, 0); + events.ScheduleEvent(EVENT_TALK_4, Seconds(3)); break; - case 10: - SetRun(true); + case 28: + events.ScheduleEvent(EVENT_BURN_CRATES, 0); + events.ScheduleEvent(EVENT_LAUGH, Seconds(7)); + events.ScheduleEvent(EVENT_TALK_5, Seconds(9)); + events.ScheduleEvent(EVENT_TALK_6, Seconds(17)); break; - case 13: - SetRun(false); + case 35: + if (Player* player = ObjectAccessor::GetPlayer(*me, _player)) + Talk(TALK_7, player); break; - case 14: - if (Unit* Trigger = me->FindNearestCreature(NPC_HANES_FIRE_TRIGGER, 10.0f)) - Trigger->CastSpell(Trigger, SPELL_COSMETIC_LOW_POLY_FIRE, false); - SetRun(true); + case 40: + if (Player* player = ObjectAccessor::GetPlayer(*me, _player)) + player->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me); + events.ScheduleEvent(EVENT_TALK_8, Seconds(4)); break; } } |