aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/World
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2021-11-23 18:38:36 +0200
committerShauren <shauren.trinity@gmail.com>2022-03-23 00:03:14 +0100
commit4281049e0c0d38a968d1d37bdd3ec04e35b81850 (patch)
tree05b2010f6cbe49b28a59d0bc6797b9f4563c04a3 /src/server/scripts/World
parentd3c9c14f83078736b1500e303da5ec575aaf22dc (diff)
Scripts/Misc: Migrate world event scripts to separate files 2 (#27309)
(cherry picked from commit eb812bf3d510d9c6712448c4bb35983c91f97b4c)
Diffstat (limited to 'src/server/scripts/World')
-rw-r--r--src/server/scripts/World/npcs_special.cpp280
1 files changed, 0 insertions, 280 deletions
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 32f6c9bde6f..69a06bbb433 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -1766,285 +1766,6 @@ public:
}
};
-enum Fireworks
-{
- NPC_OMEN = 15467,
- NPC_MINION_OF_OMEN = 15466,
- NPC_FIREWORK_BLUE = 15879,
- NPC_FIREWORK_GREEN = 15880,
- NPC_FIREWORK_PURPLE = 15881,
- NPC_FIREWORK_RED = 15882,
- NPC_FIREWORK_YELLOW = 15883,
- NPC_FIREWORK_WHITE = 15884,
- NPC_FIREWORK_BIG_BLUE = 15885,
- NPC_FIREWORK_BIG_GREEN = 15886,
- NPC_FIREWORK_BIG_PURPLE = 15887,
- NPC_FIREWORK_BIG_RED = 15888,
- NPC_FIREWORK_BIG_YELLOW = 15889,
- NPC_FIREWORK_BIG_WHITE = 15890,
-
- NPC_CLUSTER_BLUE = 15872,
- NPC_CLUSTER_RED = 15873,
- NPC_CLUSTER_GREEN = 15874,
- NPC_CLUSTER_PURPLE = 15875,
- NPC_CLUSTER_WHITE = 15876,
- NPC_CLUSTER_YELLOW = 15877,
- NPC_CLUSTER_BIG_BLUE = 15911,
- NPC_CLUSTER_BIG_GREEN = 15912,
- NPC_CLUSTER_BIG_PURPLE = 15913,
- NPC_CLUSTER_BIG_RED = 15914,
- NPC_CLUSTER_BIG_WHITE = 15915,
- NPC_CLUSTER_BIG_YELLOW = 15916,
- NPC_CLUSTER_ELUNE = 15918,
-
- GO_FIREWORK_LAUNCHER_1 = 180771,
- GO_FIREWORK_LAUNCHER_2 = 180868,
- GO_FIREWORK_LAUNCHER_3 = 180850,
- GO_CLUSTER_LAUNCHER_1 = 180772,
- GO_CLUSTER_LAUNCHER_2 = 180859,
- GO_CLUSTER_LAUNCHER_3 = 180869,
- GO_CLUSTER_LAUNCHER_4 = 180874,
-
- SPELL_ROCKET_BLUE = 26344,
- SPELL_ROCKET_GREEN = 26345,
- SPELL_ROCKET_PURPLE = 26346,
- SPELL_ROCKET_RED = 26347,
- SPELL_ROCKET_WHITE = 26348,
- SPELL_ROCKET_YELLOW = 26349,
- SPELL_ROCKET_BIG_BLUE = 26351,
- SPELL_ROCKET_BIG_GREEN = 26352,
- SPELL_ROCKET_BIG_PURPLE = 26353,
- SPELL_ROCKET_BIG_RED = 26354,
- SPELL_ROCKET_BIG_WHITE = 26355,
- SPELL_ROCKET_BIG_YELLOW = 26356,
- SPELL_LUNAR_FORTUNE = 26522,
-
- ANIM_GO_LAUNCH_FIREWORK = 3,
- ZONE_MOONGLADE = 493,
-};
-
-Position omenSummonPos = {7558.993f, -2839.999f, 450.0214f, 4.46f};
-
-class npc_firework : public CreatureScript
-{
-public:
- npc_firework() : CreatureScript("npc_firework") { }
-
- struct npc_fireworkAI : public ScriptedAI
- {
- npc_fireworkAI(Creature* creature) : ScriptedAI(creature) { }
-
- bool isCluster()
- {
- switch (me->GetEntry())
- {
- case NPC_FIREWORK_BLUE:
- case NPC_FIREWORK_GREEN:
- case NPC_FIREWORK_PURPLE:
- case NPC_FIREWORK_RED:
- case NPC_FIREWORK_YELLOW:
- case NPC_FIREWORK_WHITE:
- case NPC_FIREWORK_BIG_BLUE:
- case NPC_FIREWORK_BIG_GREEN:
- case NPC_FIREWORK_BIG_PURPLE:
- case NPC_FIREWORK_BIG_RED:
- case NPC_FIREWORK_BIG_YELLOW:
- case NPC_FIREWORK_BIG_WHITE:
- return false;
- case NPC_CLUSTER_BLUE:
- case NPC_CLUSTER_GREEN:
- case NPC_CLUSTER_PURPLE:
- case NPC_CLUSTER_RED:
- case NPC_CLUSTER_YELLOW:
- case NPC_CLUSTER_WHITE:
- case NPC_CLUSTER_BIG_BLUE:
- case NPC_CLUSTER_BIG_GREEN:
- case NPC_CLUSTER_BIG_PURPLE:
- case NPC_CLUSTER_BIG_RED:
- case NPC_CLUSTER_BIG_YELLOW:
- case NPC_CLUSTER_BIG_WHITE:
- case NPC_CLUSTER_ELUNE:
- default:
- return true;
- }
- }
-
- GameObject* FindNearestLauncher()
- {
- GameObject* launcher = nullptr;
-
- if (isCluster())
- {
- GameObject* launcher1 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_1, 0.5f);
- GameObject* launcher2 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_2, 0.5f);
- GameObject* launcher3 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_3, 0.5f);
- GameObject* launcher4 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_4, 0.5f);
-
- if (launcher1)
- launcher = launcher1;
- else if (launcher2)
- launcher = launcher2;
- else if (launcher3)
- launcher = launcher3;
- else if (launcher4)
- launcher = launcher4;
- }
- else
- {
- GameObject* launcher1 = GetClosestGameObjectWithEntry(me, GO_FIREWORK_LAUNCHER_1, 0.5f);
- GameObject* launcher2 = GetClosestGameObjectWithEntry(me, GO_FIREWORK_LAUNCHER_2, 0.5f);
- GameObject* launcher3 = GetClosestGameObjectWithEntry(me, GO_FIREWORK_LAUNCHER_3, 0.5f);
-
- if (launcher1)
- launcher = launcher1;
- else if (launcher2)
- launcher = launcher2;
- else if (launcher3)
- launcher = launcher3;
- }
-
- return launcher;
- }
-
- uint32 GetFireworkSpell(uint32 entry)
- {
- switch (entry)
- {
- case NPC_FIREWORK_BLUE:
- return SPELL_ROCKET_BLUE;
- case NPC_FIREWORK_GREEN:
- return SPELL_ROCKET_GREEN;
- case NPC_FIREWORK_PURPLE:
- return SPELL_ROCKET_PURPLE;
- case NPC_FIREWORK_RED:
- return SPELL_ROCKET_RED;
- case NPC_FIREWORK_YELLOW:
- return SPELL_ROCKET_YELLOW;
- case NPC_FIREWORK_WHITE:
- return SPELL_ROCKET_WHITE;
- case NPC_FIREWORK_BIG_BLUE:
- return SPELL_ROCKET_BIG_BLUE;
- case NPC_FIREWORK_BIG_GREEN:
- return SPELL_ROCKET_BIG_GREEN;
- case NPC_FIREWORK_BIG_PURPLE:
- return SPELL_ROCKET_BIG_PURPLE;
- case NPC_FIREWORK_BIG_RED:
- return SPELL_ROCKET_BIG_RED;
- case NPC_FIREWORK_BIG_YELLOW:
- return SPELL_ROCKET_BIG_YELLOW;
- case NPC_FIREWORK_BIG_WHITE:
- return SPELL_ROCKET_BIG_WHITE;
- default:
- return 0;
- }
- }
-
- uint32 GetFireworkGameObjectId()
- {
- uint32 spellId = 0;
-
- switch (me->GetEntry())
- {
- case NPC_CLUSTER_BLUE:
- spellId = GetFireworkSpell(NPC_FIREWORK_BLUE);
- break;
- case NPC_CLUSTER_GREEN:
- spellId = GetFireworkSpell(NPC_FIREWORK_GREEN);
- break;
- case NPC_CLUSTER_PURPLE:
- spellId = GetFireworkSpell(NPC_FIREWORK_PURPLE);
- break;
- case NPC_CLUSTER_RED:
- spellId = GetFireworkSpell(NPC_FIREWORK_RED);
- break;
- case NPC_CLUSTER_YELLOW:
- spellId = GetFireworkSpell(NPC_FIREWORK_YELLOW);
- break;
- case NPC_CLUSTER_WHITE:
- spellId = GetFireworkSpell(NPC_FIREWORK_WHITE);
- break;
- case NPC_CLUSTER_BIG_BLUE:
- spellId = GetFireworkSpell(NPC_FIREWORK_BIG_BLUE);
- break;
- case NPC_CLUSTER_BIG_GREEN:
- spellId = GetFireworkSpell(NPC_FIREWORK_BIG_GREEN);
- break;
- case NPC_CLUSTER_BIG_PURPLE:
- spellId = GetFireworkSpell(NPC_FIREWORK_BIG_PURPLE);
- break;
- case NPC_CLUSTER_BIG_RED:
- spellId = GetFireworkSpell(NPC_FIREWORK_BIG_RED);
- break;
- case NPC_CLUSTER_BIG_YELLOW:
- spellId = GetFireworkSpell(NPC_FIREWORK_BIG_YELLOW);
- break;
- case NPC_CLUSTER_BIG_WHITE:
- spellId = GetFireworkSpell(NPC_FIREWORK_BIG_WHITE);
- break;
- case NPC_CLUSTER_ELUNE:
- spellId = GetFireworkSpell(urand(NPC_FIREWORK_BLUE, NPC_FIREWORK_WHITE));
- break;
- }
-
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, DIFFICULTY_NONE);
-
- if (spellInfo && spellInfo->GetEffect(EFFECT_0).Effect == SPELL_EFFECT_SUMMON_OBJECT_WILD)
- return spellInfo->GetEffect(EFFECT_0).MiscValue;
-
- return 0;
- }
-
- void Reset() override
- {
- if (GameObject* launcher = FindNearestLauncher())
- {
- launcher->SendCustomAnim(ANIM_GO_LAUNCH_FIREWORK);
- me->SetOrientation(launcher->GetOrientation() + float(M_PI) / 2);
- }
- else
- return;
-
- if (isCluster())
- {
- // Check if we are near Elune'ara lake south, if so try to summon Omen or a minion
- if (me->GetZoneId() == ZONE_MOONGLADE)
- {
- if (!me->FindNearestCreature(NPC_OMEN, 100.0f) && me->GetDistance2d(omenSummonPos.GetPositionX(), omenSummonPos.GetPositionY()) <= 100.0f)
- {
- switch (urand(0, 9))
- {
- case 0:
- case 1:
- case 2:
- case 3:
- if (Creature* minion = me->SummonCreature(NPC_MINION_OF_OMEN, me->GetPositionX()+frand(-5.0f, 5.0f), me->GetPositionY()+frand(-5.0f, 5.0f), me->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20s))
- minion->AI()->AttackStart(me->SelectNearestPlayer(20.0f));
- break;
- case 9:
- me->SummonCreature(NPC_OMEN, omenSummonPos);
- break;
- }
- }
- }
- if (me->GetEntry() == NPC_CLUSTER_ELUNE)
- DoCast(SPELL_LUNAR_FORTUNE);
-
- float displacement = 0.7f;
- for (uint8 i = 0; i < 4; i++)
- me->SummonGameObject(GetFireworkGameObjectId(), me->GetPositionX() + (i % 2 == 0 ? displacement : -displacement), me->GetPositionY() + (i > 1 ? displacement : -displacement), me->GetPositionZ() + 4.0f, me->GetOrientation(), QuaternionData::fromEulerAnglesZYX(me->GetOrientation(), 0.0f, 0.0f), 1s);
- }
- else
- //me->CastSpell(me, GetFireworkSpell(me->GetEntry()), true);
- me->CastSpell(me->GetPosition(), GetFireworkSpell(me->GetEntry()), true);
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new npc_fireworkAI(creature);
- }
-};
-
/*#####
# npc_spring_rabbit
#####*/
@@ -2647,7 +2368,6 @@ void AddSC_npcs_special()
RegisterCreatureAI(npc_training_dummy);
new npc_wormhole();
new npc_experience();
- new npc_firework();
new npc_spring_rabbit();
new npc_imp_in_a_ball();
new npc_train_wrecker();