aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/World/npcs_special.cpp62
1 files changed, 29 insertions, 33 deletions
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 6ea25149734..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;