aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp111
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/deadmines.h13
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp44
-rw-r--r--src/server/scripts/Pet/pet_generic.cpp173
-rw-r--r--src/server/scripts/Spells/spell_holiday.cpp163
-rw-r--r--src/server/scripts/World/npcs_special.cpp168
7 files changed, 455 insertions, 219 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index c7f674ec72c..464c3125ce4 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -15475,7 +15475,7 @@ bool Player::SatisfyQuestDay(Quest const* qInfo, bool msg)
if (qInfo->IsDFQuest())
{
- if (!m_DFQuests.empty())
+ if (m_DFQuests.find(qInfo->GetQuestId()) != m_DFQuests.end())
return false;
return true;
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
index 541ddc0e1c8..8f246ab9bf0 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp
@@ -25,17 +25,25 @@ EndScriptData */
#include "ScriptedCreature.h"
#include "deadmines.h"
-enum Spels
+enum Spells
{
SPELL_TRASH = 3391,
SPELL_SMITE_STOMP = 6432,
SPELL_SMITE_SLAM = 6435,
- SPELL_NIMBLE_REFLEXES = 6264,
+ SPELL_NIMBLE_REFLEXES = 6264
+};
+enum Equips
+{
EQUIP_SWORD = 5191,
- EQUIP_MACE = 7230,
+ EQUIP_AXE = 5196,
+ EQUIP_MACE = 7230
+};
- SAY_AGGRO = 0,
+enum Texts
+{
+ SAY_PHASE_1 = 2,
+ SAY_PHASE_2 = 3
};
class boss_mr_smite : public CreatureScript
@@ -66,6 +74,8 @@ public:
uiPhase = 0;
uiTimer = 0;
+
+ uiIsMoving = false;
}
InstanceScript* instance;
@@ -79,16 +89,19 @@ public:
uint32 uiPhase;
uint32 uiTimer;
+ bool uiIsMoving;
+
void Reset() override
{
Initialize();
SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ me->SetReactState(REACT_AGGRESSIVE);
}
void EnterCombat(Unit* /*who*/) override
{
- Talk(SAY_AGGRO);
}
bool bCheckChances()
@@ -105,38 +118,52 @@ public:
if (!UpdateVictim())
return;
- /*START ACID-AI*/
- if (uiTrashTimer <= uiDiff)
+ if (!uiIsMoving) // halt abilities in between phases
{
- if (bCheckChances())
- DoCast(me, SPELL_TRASH);
- uiTrashTimer = urand(6000, 15500);
- } else uiTrashTimer -= uiDiff;
+ if (uiTrashTimer <= uiDiff)
+ {
+ if (bCheckChances())
+ DoCast(me, SPELL_TRASH);
+ uiTrashTimer = urand(6000, 15500);
+ }
+ else uiTrashTimer -= uiDiff;
- if (uiSlamTimer <= uiDiff)
- {
- if (bCheckChances())
- DoCastVictim(SPELL_SMITE_SLAM);
- uiSlamTimer = 11000;
- } else uiSlamTimer -= uiDiff;
+ if (uiSlamTimer <= uiDiff)
+ {
+ if (bCheckChances())
+ DoCastVictim(SPELL_SMITE_SLAM);
+ uiSlamTimer = 11000;
+ }
+ else uiSlamTimer -= uiDiff;
- if (uiNimbleReflexesTimer <= uiDiff)
- {
- if (bCheckChances())
- DoCast(me, SPELL_NIMBLE_REFLEXES);
- uiNimbleReflexesTimer = urand(27300, 60100);
- } else uiNimbleReflexesTimer -= uiDiff;
- /*END ACID-AI*/
+ if (uiNimbleReflexesTimer <= uiDiff)
+ {
+ if (bCheckChances())
+ DoCast(me, SPELL_NIMBLE_REFLEXES);
+ uiNimbleReflexesTimer = urand(27300, 60100);
+ }
+ else uiNimbleReflexesTimer -= uiDiff;
+ }
if ((uiHealth == 0 && !HealthAbovePct(66)) || (uiHealth == 1 && !HealthAbovePct(33)))
{
++uiHealth;
DoCastAOE(SPELL_SMITE_STOMP, false);
SetCombatMovement(false);
- if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_SMITE_CHEST)))
+ me->AttackStop();
+ me->InterruptNonMeleeSpells(false);
+ me->SetReactState(REACT_PASSIVE);
+ uiTimer = 2500;
+ uiPhase = 1;
+
+ switch (uiHealth)
{
- me->GetMotionMaster()->Clear();
- me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 3.0f, go->GetPositionY(), go->GetPositionZ());
+ case 1:
+ Talk(SAY_PHASE_1);
+ break;
+ case 2:
+ Talk(SAY_PHASE_2);
+ break;
}
}
@@ -147,21 +174,36 @@ public:
switch (uiPhase)
{
case 1:
- me->HandleEmoteCommand(EMOTE_STATE_KNEEL); //dosen't work?
- uiTimer = 1000;
- uiPhase = 2;
+ {
+ if (uiIsMoving)
+ break;
+
+ if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_SMITE_CHEST)))
+ {
+ me->GetMotionMaster()->Clear();
+ me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 1.5f, go->GetPositionY() + 1.4f, go->GetPositionZ());
+ uiIsMoving = true;
+ }
break;
+ }
case 2:
if (uiHealth == 1)
- SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE);
+ SetEquipmentSlots(false, EQUIP_AXE, EQUIP_AXE, EQUIP_NO_CHANGE);
else
SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
uiTimer = 500;
uiPhase = 3;
break;
case 3:
+ me->SetStandState(UNIT_STAND_STATE_STAND);
+ uiTimer = 750;
+ uiPhase = 4;
+ break;
+ case 4:
+ me->SetReactState(REACT_AGGRESSIVE);
SetCombatMovement(true);
me->GetMotionMaster()->MoveChase(me->GetVictim(), me->m_CombatDistance);
+ uiIsMoving = false;
uiPhase = 0;
break;
}
@@ -176,8 +218,11 @@ public:
if (uiType != POINT_MOTION_TYPE)
return;
- uiTimer = 1500;
- uiPhase = 1;
+ me->SetFacingTo(5.47f);
+ me->SetStandState(UNIT_STAND_STATE_KNEEL);
+
+ uiTimer = 2000;
+ uiPhase = 2;
}
};
};
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
index dff4243617e..01ebabb160e 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
+++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h
@@ -26,6 +26,7 @@ enum CannonState
CANNON_GUNPOWDER_USED,
CANNON_BLAST_INITIATED,
PIRATES_ATTACK,
+ SMITE_ALARMED,
EVENT_DONE
};
@@ -48,4 +49,16 @@ enum GameObjects
GO_DOOR_LEVER = 101833,
GO_MR_SMITE_CHEST = 144111
};
+
+enum CreaturesIds
+{
+ NPC_MR_SMITE = 646
+};
+
+enum InstanceTexts
+{
+ SAY_ALARM1 = 0,
+ SAY_ALARM2 = 1
+};
+
#endif
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
index 6714b243765..b827fdf7e8b 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
@@ -32,18 +32,14 @@ EndScriptData */
enum Sounds
{
SOUND_CANNONFIRE = 1400,
- SOUND_DESTROYDOOR = 3079,
- SOUND_MR_SMITE_ALARM1 = 5775,
- SOUND_MR_SMITE_ALARM2 = 5777
+ SOUND_DESTROYDOOR = 3079
};
-#define SAY_MR_SMITE_ALARM1 "You there, check out that noise!"
-#define SAY_MR_SMITE_ALARM2 "We're under attack! A vast, ye swabs! Repel the invaders!"
-
enum Misc
{
DATA_CANNON_BLAST_TIMER = 3000,
- DATA_PIRATES_DELAY_TIMER = 1000
+ DATA_PIRATES_DELAY_TIMER = 1000,
+ DATA_SMITE_ALARM_DELAY_TIMER = 5000
};
class instance_deadmines : public InstanceMapScript
@@ -72,10 +68,12 @@ class instance_deadmines : public InstanceMapScript
ObjectGuid DefiasPirate1GUID;
ObjectGuid DefiasPirate2GUID;
ObjectGuid DefiasCompanionGUID;
+ ObjectGuid MrSmiteGUID;
uint32 State;
uint32 CannonBlast_Timer;
uint32 PiratesDelay_Timer;
+ uint32 SmiteAlarmDelay_Timer;
ObjectGuid uiSmiteChestGUID;
virtual void Update(uint32 diff) override
@@ -91,22 +89,20 @@ class instance_deadmines : public InstanceMapScript
{
case CANNON_GUNPOWDER_USED:
CannonBlast_Timer = DATA_CANNON_BLAST_TIMER;
- // it's a hack - Mr. Smite should do that but his too far away
- //pIronCladDoor->SetName("Mr. Smite");
- //pIronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM1, LANG_UNIVERSAL, NULL);
- pIronCladDoor->PlayDirectSound(SOUND_MR_SMITE_ALARM1);
State = CANNON_BLAST_INITIATED;
break;
case CANNON_BLAST_INITIATED:
PiratesDelay_Timer = DATA_PIRATES_DELAY_TIMER;
+ SmiteAlarmDelay_Timer = DATA_SMITE_ALARM_DELAY_TIMER;
if (CannonBlast_Timer <= diff)
{
SummonCreatures();
ShootCannon();
BlastOutDoor();
LeverStucked();
- //pIronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM2, LANG_UNIVERSAL, NULL);
- pIronCladDoor->PlayDirectSound(SOUND_MR_SMITE_ALARM2);
+ instance->LoadGrid(-22.8f, -797.24f); // Loads Mr. Smite's grid.
+ if (Creature* smite = instance->GetCreature(MrSmiteGUID)) // goes off when door blows up
+ smite->AI()->Talk(SAY_ALARM1);
State = PIRATES_ATTACK;
} else CannonBlast_Timer -= diff;
break;
@@ -114,9 +110,17 @@ class instance_deadmines : public InstanceMapScript
if (PiratesDelay_Timer <= diff)
{
MoveCreaturesInside();
- State = EVENT_DONE;
+ State = SMITE_ALARMED;
} else PiratesDelay_Timer -= diff;
break;
+ case SMITE_ALARMED:
+ if (SmiteAlarmDelay_Timer <= diff)
+ {
+ if (Creature* smite = instance->GetCreature(MrSmiteGUID))
+ smite->AI()->Talk(SAY_ALARM2);
+ State = EVENT_DONE;
+ } else SmiteAlarmDelay_Timer -= diff;
+ break;
}
}
@@ -180,6 +184,18 @@ class instance_deadmines : public InstanceMapScript
pDoorLever->SetUInt32Value(GAMEOBJECT_FLAGS, 4);
}
+ void OnCreatureCreate(Creature* creature) override
+ {
+ switch (creature->GetEntry())
+ {
+ case NPC_MR_SMITE:
+ MrSmiteGUID = creature->GetGUID();
+ break;
+ default:
+ break;
+ }
+ }
+
void OnGameObjectCreate(GameObject* go) override
{
switch (go->GetEntry())
diff --git a/src/server/scripts/Pet/pet_generic.cpp b/src/server/scripts/Pet/pet_generic.cpp
index 35455bc474b..0ec6f08ae58 100644
--- a/src/server/scripts/Pet/pet_generic.cpp
+++ b/src/server/scripts/Pet/pet_generic.cpp
@@ -20,10 +20,181 @@
* Scriptnames of files in this file should be prefixed with "npc_pet_gen_".
*/
+ /* ContentData
+ npc_pet_gen_egbert 100% Egbert run's around
+ npc_pet_gen_pandaren_monk 100% Pandaren Monk drinks and bows with you
+ npc_pet_gen_mojo 100% Mojo follows you when you kiss it
+ EndContentData */
+
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
+#include "PassiveAI.h"
#include "Player.h"
+enum EgbertMisc
+{
+ SPELL_EGBERT = 40669,
+ EVENT_RETURN = 3
+};
+
+class npc_pet_gen_egbert : public CreatureScript
+{
+public:
+ npc_pet_gen_egbert() : CreatureScript("npc_pet_gen_egbert") {}
+
+ struct npc_pet_gen_egbertAI : public NullCreatureAI
+ {
+ npc_pet_gen_egbertAI(Creature* creature) : NullCreatureAI(creature)
+ {
+ if (Unit* owner = me->GetCharmerOrOwner())
+ if (owner->GetMap()->GetEntry()->addon > 1)
+ me->SetCanFly(true);
+ }
+
+ void Reset() override
+ {
+ _events.Reset();
+ if (Unit* owner = me->GetCharmerOrOwner())
+ me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
+ }
+
+ void EnterEvadeMode(EvadeReason why) override
+ {
+ if (!_EnterEvadeMode(why))
+ return;
+
+ Reset();
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ _events.Update(diff);
+
+ if (Unit* owner = me->GetCharmerOrOwner())
+ {
+ if (!me->IsWithinDist(owner, 40.f))
+ {
+ me->RemoveAura(SPELL_EGBERT);
+ me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
+ }
+ }
+
+ if (me->HasAura(SPELL_EGBERT))
+ _events.ScheduleEvent(EVENT_RETURN, urandms(5, 20));
+
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_RETURN:
+ me->RemoveAura(SPELL_EGBERT);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ private:
+ EventMap _events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_pet_gen_egbertAI(creature);
+ }
+};
+
+enum PandarenMonkMisc
+{
+ SPELL_PANDAREN_MONK = 69800,
+ EVENT_FOCUS = 1,
+ EVENT_EMOTE = 2,
+ EVENT_FOLLOW = 3,
+ EVENT_DRINK = 4
+};
+
+class npc_pet_gen_pandaren_monk : public CreatureScript
+{
+public:
+ npc_pet_gen_pandaren_monk() : CreatureScript("npc_pet_gen_pandaren_monk") {}
+
+ struct npc_pet_gen_pandaren_monkAI : public NullCreatureAI
+ {
+ npc_pet_gen_pandaren_monkAI(Creature* creature) : NullCreatureAI(creature) { }
+
+ void Reset() override
+ {
+ _events.Reset();
+ _events.ScheduleEvent(EVENT_FOCUS, 1000);
+ }
+
+ void EnterEvadeMode(EvadeReason why) override
+ {
+ if (!_EnterEvadeMode(why))
+ return;
+
+ Reset();
+ }
+
+ void ReceiveEmote(Player* /*player*/, uint32 emote) override
+ {
+ me->InterruptSpell(CURRENT_CHANNELED_SPELL);
+ me->StopMoving();
+
+ switch (emote)
+ {
+ case TEXT_EMOTE_BOW:
+ _events.ScheduleEvent(EVENT_FOCUS, 1000);
+ break;
+ case TEXT_EMOTE_DRINK:
+ _events.ScheduleEvent(EVENT_DRINK, 1000);
+ break;
+ }
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ _events.Update(diff);
+
+ if (Unit* owner = me->GetCharmerOrOwner())
+ if (!me->IsWithinDist(owner, 30.f))
+ me->InterruptSpell(CURRENT_CHANNELED_SPELL);
+
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_FOCUS:
+ if (Unit* owner = me->GetCharmerOrOwner())
+ me->SetFacingToObject(owner);
+ _events.ScheduleEvent(EVENT_EMOTE, 1000);
+ break;
+ case EVENT_EMOTE:
+ me->HandleEmoteCommand(EMOTE_ONESHOT_BOW);
+ _events.ScheduleEvent(EVENT_FOLLOW, 1000);
+ break;
+ case EVENT_FOLLOW:
+ if (Unit* owner = me->GetCharmerOrOwner())
+ me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ break;
+ case EVENT_DRINK:
+ me->CastSpell(me, SPELL_PANDAREN_MONK, false);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ private:
+ EventMap _events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_pet_gen_pandaren_monkAI(creature);
+ }
+};
+
enum Mojo
{
SAY_MOJO = 0,
@@ -89,5 +260,7 @@ class npc_pet_gen_mojo : public CreatureScript
void AddSC_generic_pet_scripts()
{
+ new npc_pet_gen_egbert();
+ new npc_pet_gen_pandaren_monk();
new npc_pet_gen_mojo();
}
diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp
index 7fe1f54a594..a3359fdf6f9 100644
--- a/src/server/scripts/Spells/spell_holiday.cpp
+++ b/src/server/scripts/Spells/spell_holiday.cpp
@@ -29,6 +29,7 @@
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
+#include "Vehicle.h"
// 45102 Romantic Picnic
enum SpellsPicnic
@@ -410,6 +411,84 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
}
};
+enum FeastOnSpells
+{
+ FEAST_ON_TURKEY = 61784,
+ FEAST_ON_CRANBERRIES = 61785,
+ FEAST_ON_SWEET_POTATOES = 61786,
+ FEAST_ON_PIE = 61787,
+ FEAST_ON_STUFFING = 61788,
+ SPELL_CRANBERRY_HELPINS = 61841,
+ SPELL_TURKEY_HELPINS = 61842,
+ SPELL_STUFFING_HELPINS = 61843,
+ SPELL_SWEET_POTATO_HELPINS = 61844,
+ SPELL_PIE_HELPINS = 61845,
+ SPELL_ON_PLATE_EAT_VISUAL = 61826
+};
+
+class spell_pilgrims_bounty_feast_on : public SpellScriptLoader
+{
+ public:
+ spell_pilgrims_bounty_feast_on() : SpellScriptLoader("spell_pilgrims_bounty_feast_on") { }
+
+ class spell_pilgrims_bounty_feast_on_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pilgrims_bounty_feast_on_SpellScript);
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+
+ uint32 _spellId = 0;
+ switch (GetSpellInfo()->Id)
+ {
+ case FEAST_ON_TURKEY:
+ _spellId = SPELL_TURKEY_HELPINS;
+ break;
+ case FEAST_ON_CRANBERRIES:
+ _spellId = SPELL_CRANBERRY_HELPINS;
+ break;
+ case FEAST_ON_SWEET_POTATOES:
+ _spellId = SPELL_SWEET_POTATO_HELPINS;
+ break;
+ case FEAST_ON_PIE:
+ _spellId = SPELL_PIE_HELPINS;
+ break;
+ case FEAST_ON_STUFFING:
+ _spellId = SPELL_STUFFING_HELPINS;
+ break;
+ default:
+ return;
+ }
+
+ if (Vehicle* vehicle = caster->GetVehicleKit())
+ if (Unit* target = vehicle->GetPassenger(0))
+ if (Player* player = target->ToPlayer())
+ {
+ player->CastSpell(player, SPELL_ON_PLATE_EAT_VISUAL, true);
+ caster->CastSpell(player, _spellId, true, NULL, NULL, player->GetGUID());
+ }
+
+ if (Aura* aura = caster->GetAura(GetEffectValue()))
+ {
+ if (aura->GetStackAmount() == 1)
+ caster->RemoveAurasDueToSpell(aura->GetSpellInfo()->Effects[EFFECT_0].CalcValue());
+ aura->ModStackAmount(-1);
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_feast_on_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_pilgrims_bounty_feast_on_SpellScript();
+ }
+};
+
enum TheTurkinator
{
SPELL_KILL_COUNTER_VISUAL = 62015,
@@ -429,7 +508,7 @@ class spell_pilgrims_bounty_turkey_tracker : public SpellScriptLoader
{
PrepareSpellScript(spell_pilgrims_bounty_turkey_tracker_SpellScript);
- bool Validate(SpellInfo const* /*spell*/)
+ bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_KILL_COUNTER_VISUAL) || !sSpellMgr->GetSpellInfo(SPELL_KILL_COUNTER_VISUAL_MAX))
return false;
@@ -472,18 +551,90 @@ class spell_pilgrims_bounty_turkey_tracker : public SpellScriptLoader
}
}
- void Register()
+ void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_turkey_tracker_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
- SpellScript* GetSpellScript() const
+ SpellScript* GetSpellScript() const override
{
return new spell_pilgrims_bounty_turkey_tracker_SpellScript();
}
};
+enum SpiritOfSharing
+{
+ SPELL_THE_SPIRIT_OF_SHARING = 61849
+};
+
+class spell_pilgrims_bounty_well_fed : public SpellScriptLoader
+{
+ private:
+ uint32 _triggeredSpellId;
+
+ public:
+ spell_pilgrims_bounty_well_fed(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { }
+
+ class spell_pilgrims_bounty_well_fed_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pilgrims_bounty_well_fed_SpellScript);
+ private:
+ uint32 _triggeredSpellId;
+
+ public:
+ spell_pilgrims_bounty_well_fed_SpellScript(uint32 triggeredSpellId) : SpellScript(), _triggeredSpellId(triggeredSpellId) { }
+
+ bool Validate(SpellInfo const* /*spell*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(_triggeredSpellId))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex effIndex)
+ {
+ PreventHitDefaultEffect(effIndex);
+ Player* target = GetHitPlayer();
+ if (!target)
+ return;
+
+ if (Aura const* aura = target->GetAura(GetSpellInfo()->Id))
+ {
+ if (aura->GetStackAmount() == 5)
+ target->CastSpell(target, _triggeredSpellId, true);
+ }
+
+ Aura const* turkey = target->GetAura(SPELL_TURKEY_HELPINS);
+ Aura const* cranberies = target->GetAura(SPELL_CRANBERRY_HELPINS);
+ Aura const* stuffing = target->GetAura(SPELL_STUFFING_HELPINS);
+ Aura const* sweetPotatoes = target->GetAura(SPELL_SWEET_POTATO_HELPINS);
+ Aura const* pie = target->GetAura(SPELL_PIE_HELPINS);
+
+ if ((turkey && turkey->GetStackAmount() == 5) && (cranberies && cranberies->GetStackAmount() == 5) && (stuffing && stuffing->GetStackAmount() == 5)
+ && (sweetPotatoes && sweetPotatoes->GetStackAmount() == 5) && (pie && pie->GetStackAmount() == 5))
+ {
+ target->CastSpell(target, SPELL_THE_SPIRIT_OF_SHARING, true);
+ target->RemoveAurasDueToSpell(SPELL_TURKEY_HELPINS);
+ target->RemoveAurasDueToSpell(SPELL_CRANBERRY_HELPINS);
+ target->RemoveAurasDueToSpell(SPELL_STUFFING_HELPINS);
+ target->RemoveAurasDueToSpell(SPELL_SWEET_POTATO_HELPINS);
+ target->RemoveAurasDueToSpell(SPELL_PIE_HELPINS);
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_pilgrims_bounty_well_fed_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_pilgrims_bounty_well_fed_SpellScript(_triggeredSpellId);
+ }
+};
+
enum Mistletoe
{
SPELL_CREATE_MISTLETOE = 26206,
@@ -1047,6 +1198,12 @@ void AddSC_holiday_spell_scripts()
new spell_pilgrims_bounty_buff_food("spell_gen_spice_bread_stuffing", SPELL_WELL_FED_HIT_TRIGGER);
new spell_pilgrims_bounty_buff_food("spell_gen_pumpkin_pie", SPELL_WELL_FED_SPIRIT_TRIGGER);
new spell_pilgrims_bounty_buff_food("spell_gen_candied_sweet_potato", SPELL_WELL_FED_HASTE_TRIGGER);
+ new spell_pilgrims_bounty_feast_on();
+ new spell_pilgrims_bounty_well_fed("spell_pilgrims_bounty_well_fed_turkey", SPELL_WELL_FED_AP_TRIGGER);
+ new spell_pilgrims_bounty_well_fed("spell_pilgrims_bounty_well_fed_cranberry", SPELL_WELL_FED_ZM_TRIGGER);
+ new spell_pilgrims_bounty_well_fed("spell_pilgrims_bounty_well_fed_stuffing", SPELL_WELL_FED_HIT_TRIGGER);
+ new spell_pilgrims_bounty_well_fed("spell_pilgrims_bounty_well_fed_sweet_potatoes", SPELL_WELL_FED_HASTE_TRIGGER);
+ new spell_pilgrims_bounty_well_fed("spell_pilgrims_bounty_well_fed_pie", SPELL_WELL_FED_SPIRIT_TRIGGER);
new spell_pilgrims_bounty_turkey_tracker();
// Winter Veil
new spell_winter_veil_mistletoe();
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 80b4fac4333..159faa38c62 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -39,7 +39,6 @@ npc_shadowfiend 100% restore 5% of owner's mana when shadowfiend die f
npc_locksmith 75% list of keys needs to be confirmed
npc_firework 100% NPC's summoned by rockets and rocket clusters, for making them cast visual
npc_train_wrecker 100% Wind-Up Train Wrecker that kills train set
-npc_egbert 100% Egbert run's around
EndContentData */
#include "ScriptMgr.h"
@@ -58,7 +57,6 @@ EndContentData */
#include "SpellHistory.h"
#include "SpellAuras.h"
#include "Pet.h"
-#include "PetAI.h"
#include "CreatureTextMgr.h"
#include "SmartAI.h"
@@ -2573,170 +2571,6 @@ class npc_train_wrecker : public CreatureScript
}
};
-enum EgbertMisc
-{
- SPELL_EGBERT = 40669,
- EVENT_RETURN = 3
-};
-
-class npc_egbert : public CreatureScript
-{
-public:
- npc_egbert() : CreatureScript("npc_egbert") {}
-
- struct npc_egbertAI : public NullCreatureAI
- {
- npc_egbertAI(Creature* creature) : NullCreatureAI(creature)
- {
- if (Unit* owner = me->GetCharmerOrOwner())
- if (owner->GetMap()->GetEntry()->addon > 1)
- me->SetCanFly(true);
- }
-
- void Reset() override
- {
- _events.Reset();
- if (Unit* owner = me->GetCharmerOrOwner())
- me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
- }
-
- void EnterEvadeMode(EvadeReason why) override
- {
- if (!_EnterEvadeMode(why))
- return;
-
- Reset();
- }
-
- void UpdateAI(uint32 diff) override
- {
- _events.Update(diff);
-
- if (Unit* owner = me->GetCharmerOrOwner())
- {
- if (!me->IsWithinDist(owner, 40.f))
- {
- me->RemoveAura(SPELL_EGBERT);
- me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
- }
- }
-
- if (me->HasAura(SPELL_EGBERT))
- _events.ScheduleEvent(EVENT_RETURN, urandms(5, 20));
-
- while (uint32 eventId = _events.ExecuteEvent())
- {
- switch (eventId)
- {
- case EVENT_RETURN:
- me->RemoveAura(SPELL_EGBERT);
- break;
- default:
- break;
- }
- }
- }
- private:
- EventMap _events;
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_egbertAI(creature);
- }
-};
-
-enum PandarenMonkMisc
-{
- SPELL_PANDAREN_MONK = 69800,
- EVENT_FOCUS = 1,
- EVENT_EMOTE = 2,
- EVENT_FOLLOW = 3,
- EVENT_DRINK = 4
-};
-
-class npc_pandaren_monk : public CreatureScript
-{
-public:
- npc_pandaren_monk() : CreatureScript("npc_pandaren_monk") {}
-
- struct npc_pandaren_monkAI : public NullCreatureAI
- {
- npc_pandaren_monkAI(Creature* creature) : NullCreatureAI(creature) { }
-
- void Reset() override
- {
- _events.Reset();
- _events.ScheduleEvent(EVENT_FOCUS, 1000);
- }
-
- void EnterEvadeMode(EvadeReason why) override
- {
- if (!_EnterEvadeMode(why))
- return;
-
- Reset();
- }
-
- void ReceiveEmote(Player* /*player*/, uint32 emote) override
- {
- me->InterruptSpell(CURRENT_CHANNELED_SPELL);
- me->StopMoving();
-
- switch (emote)
- {
- case TEXT_EMOTE_BOW:
- _events.ScheduleEvent(EVENT_FOCUS, 1000);
- break;
- case TEXT_EMOTE_DRINK:
- _events.ScheduleEvent(EVENT_DRINK, 1000);
- break;
- }
- }
-
- void UpdateAI(uint32 diff) override
- {
- _events.Update(diff);
-
- if (Unit* owner = me->GetCharmerOrOwner())
- if (!me->IsWithinDist(owner, 30.f))
- me->InterruptSpell(CURRENT_CHANNELED_SPELL);
-
- while (uint32 eventId = _events.ExecuteEvent())
- {
- switch (eventId)
- {
- case EVENT_FOCUS:
- if (Unit* owner = me->GetCharmerOrOwner())
- me->SetFacingToObject(owner);
- _events.ScheduleEvent(EVENT_EMOTE, 1000);
- break;
- case EVENT_EMOTE:
- me->HandleEmoteCommand(EMOTE_ONESHOT_BOW);
- _events.ScheduleEvent(EVENT_FOLLOW, 1000);
- break;
- case EVENT_FOLLOW:
- if (Unit* owner = me->GetCharmerOrOwner())
- me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
- break;
- case EVENT_DRINK:
- me->CastSpell(me, SPELL_PANDAREN_MONK, false);
- break;
- default:
- break;
- }
- }
- }
- private:
- EventMap _events;
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_pandaren_monkAI(creature);
- }
-};
-
void AddSC_npcs_special()
{
new npc_air_force_bots();
@@ -2762,6 +2596,4 @@ void AddSC_npcs_special()
new npc_imp_in_a_ball();
new npc_stable_master();
new npc_train_wrecker();
- new npc_egbert();
- new npc_pandaren_monk();
}