aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/World
diff options
context:
space:
mode:
authorMachiavelli <machiavelli.trinity@gmail.com>2011-12-19 11:14:26 +0100
committerMachiavelli <machiavelli.trinity@gmail.com>2011-12-19 11:14:26 +0100
commit16df950fdb8e87a4cc931a68ca6e22c301e7e894 (patch)
treea64d43c5a7d882d4257bcacdf457298c4fd43a71 /src/server/scripts/World
parent829be0b82b2ecdb054e4059d0d2dc39f3df6ded6 (diff)
parent40e235a2ccf3661a5cf18c6946ae95ba2e544771 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore
Diffstat (limited to 'src/server/scripts/World')
-rw-r--r--src/server/scripts/World/go_scripts.cpp28
-rw-r--r--src/server/scripts/World/npcs_special.cpp179
2 files changed, 174 insertions, 33 deletions
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp
index 3bb969977b6..44c3ab9bdc9 100644
--- a/src/server/scripts/World/go_scripts.cpp
+++ b/src/server/scripts/World/go_scripts.cpp
@@ -47,6 +47,7 @@ go_jotunheim_cage
go_table_theka
go_soulwell
go_bashir_crystalforge
+go_ethereal_teleport_pad
EndContentData */
#include "ScriptPCH.h"
@@ -922,6 +923,32 @@ public:
};
/*######
+## go_ethereal_teleport_pad
+######*/
+
+enum eEtherealTeleportPad
+{
+ NPC_IMAGE_WIND_TRADER = 20518,
+ ITEM_TELEPORTER_POWER_PACK = 28969,
+};
+
+class go_ethereal_teleport_pad : public GameObjectScript
+{
+public:
+ go_ethereal_teleport_pad() : GameObjectScript("go_ethereal_teleport_pad") { }
+
+ bool OnGossipHello(Player* player, GameObject* pGO)
+ {
+ if (!player->HasItemCount(ITEM_TELEPORTER_POWER_PACK, 1))
+ return false;
+
+ pGO->SummonCreature(NPC_IMAGE_WIND_TRADER, pGO->GetPositionX(), pGO->GetPositionY(), pGO->GetPositionZ(), pGO->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
+
+ return true;
+ }
+};
+
+/*######
## go_soulwell
######*/
@@ -1282,6 +1309,7 @@ void AddSC_go_scripts()
new go_jotunheim_cage;
new go_table_theka;
new go_inconspicuous_landmark;
+ new go_ethereal_teleport_pad;
new go_soulwell;
new go_tadpole_cage;
new go_dragonflayer_cage;
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index a5e5b467fc7..38a56f7b64a 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -1623,46 +1623,44 @@ public:
## npc_winter_reveler
####*/
+enum WinterReveler
+{
+ SPELL_MISTLETOE_DEBUFF = 26218,
+ SPELL_CREATE_MISTLETOE = 26206,
+ SPELL_CREATE_HOLLY = 26207,
+ SPELL_CREATE_SNOWFLAKES = 45036,
+};
+
class npc_winter_reveler : public CreatureScript
{
-public:
- npc_winter_reveler() : CreatureScript("npc_winter_reveler") { }
+ public:
+ npc_winter_reveler() : CreatureScript("npc_winter_reveler") { }
- struct npc_winter_revelerAI : public ScriptedAI
- {
- npc_winter_revelerAI(Creature* c) : ScriptedAI(c) {}
- void ReceiveEmote(Player* player, uint32 emote)
+ struct npc_winter_revelerAI : public ScriptedAI
{
- if (!IsHolidayActive(HOLIDAY_FEAST_OF_WINTER_VEIL))
- return;
- //TODO: check auralist.
- if (player->HasAura(26218))
- return;
+ npc_winter_revelerAI(Creature* c) : ScriptedAI(c) {}
- if (emote == TEXT_EMOTE_KISS)
+ void ReceiveEmote(Player* player, uint32 emote)
{
- me->CastSpell(me, 26218, false);
- player->CastSpell(player, 26218, false);
- switch (urand(0, 2))
+ if (player->HasAura(SPELL_MISTLETOE_DEBUFF))
+ return;
+
+ if (!IsHolidayActive(HOLIDAY_FEAST_OF_WINTER_VEIL))
+ return;
+
+ if (emote == TEXT_EMOTE_KISS)
{
- case 0:
- me->CastSpell(player, 26207, false);
- break;
- case 1:
- me->CastSpell(player, 26206, false);
- break;
- case 2:
- me->CastSpell(player, 45036, false);
- break;
+ uint32 spellId = RAND<uint32>(SPELL_CREATE_MISTLETOE, SPELL_CREATE_HOLLY, SPELL_CREATE_SNOWFLAKES);
+ me->CastSpell(player, spellId, false);
+ me->CastSpell(player, SPELL_MISTLETOE_DEBUFF, false);
}
}
- }
- };
+ };
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_winter_revelerAI(creature);
- }
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_winter_revelerAI(creature);
+ }
};
/*####
@@ -1678,8 +1676,6 @@ public:
#define C_VIPER 19921
-#define RAND 5
-
class npc_snake_trap : public CreatureScript
{
public:
@@ -1726,7 +1722,7 @@ public:
float attackRadius = me->GetAttackDistance(who);
if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
{
- if (!(rand() % RAND))
+ if (!(rand() % 5))
{
me->setAttackTimer(BASE_ATTACK, (rand() % 10) * 100);
SpellTimer = (rand() % 10) * 100;
@@ -2164,6 +2160,121 @@ public:
};
/*######
+# npc_fire_elemental
+######*/
+#define SPELL_FIRENOVA 12470
+#define SPELL_FIRESHIELD 13376
+#define SPELL_FIREBLAST 57984
+
+class npc_fire_elemental : public CreatureScript
+{
+public:
+ npc_fire_elemental() : CreatureScript("npc_fire_elemental") { }
+
+ struct npc_fire_elementalAI : public ScriptedAI
+ {
+ npc_fire_elementalAI(Creature* creature) : ScriptedAI(creature) {}
+
+ uint32 FireNova_Timer;
+ uint32 FireShield_Timer;
+ uint32 FireBlast_Timer;
+
+ void Reset()
+ {
+ FireNova_Timer = 5000 + rand() % 15000; // 5-20 sec cd
+ FireBlast_Timer = 5000 + rand() % 15000; // 5-20 sec cd
+ FireShield_Timer = 0;
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (me->HasUnitState(UNIT_STAT_CASTING))
+ return;
+
+ if (FireShield_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_FIRESHIELD);
+ FireShield_Timer = 2 * IN_MILLISECONDS;
+ }
+ else
+ FireShield_Timer -= diff;
+
+ if (FireBlast_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_FIREBLAST);
+ FireBlast_Timer = 5000 + rand() % 15000; // 5-20 sec cd
+ }
+ else
+ FireBlast_Timer -= diff;
+
+ if (FireNova_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_FIRENOVA);
+ FireNova_Timer = 5000 + rand() % 15000; // 5-20 sec cd
+ }
+ else
+ FireNova_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI *GetAI(Creature* creature) const
+ {
+ return new npc_fire_elementalAI(creature);
+ }
+};
+
+/*######
+# npc_earth_elemental
+######*/
+#define SPELL_ANGEREDEARTH 36213
+
+class npc_earth_elemental : public CreatureScript
+{
+public:
+ npc_earth_elemental() : CreatureScript("npc_earth_elemental") { }
+
+ struct npc_earth_elementalAI : public ScriptedAI
+ {
+ npc_earth_elementalAI(Creature* creature) : ScriptedAI(creature) {}
+
+ uint32 AngeredEarth_Timer;
+
+ void Reset()
+ {
+ AngeredEarth_Timer = 0;
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (AngeredEarth_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_ANGEREDEARTH);
+ AngeredEarth_Timer = 5000 + rand() % 15000; // 5-20 sec cd
+ }
+ else
+ AngeredEarth_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI *GetAI(Creature* creature) const
+ {
+ return new npc_earth_elementalAI(creature);
+ }
+};
+
+/*######
# npc_wormhole
######*/
@@ -2673,5 +2784,7 @@ void AddSC_npcs_special()
new npc_locksmith;
new npc_tabard_vendor;
new npc_experience;
+ new npc_fire_elemental;
+ new npc_earth_elemental;
}