aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms/undercity.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts/EasternKingdoms/undercity.cpp')
-rw-r--r--src/server/scripts/EasternKingdoms/undercity.cpp112
1 files changed, 88 insertions, 24 deletions
diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp
index fe9c40e6dbd..a9b627ded34 100644
--- a/src/server/scripts/EasternKingdoms/undercity.cpp
+++ b/src/server/scripts/EasternKingdoms/undercity.cpp
@@ -47,7 +47,15 @@ enum Sylvanas
SPELL_HIGHBORNE_AURA = 37090,
SPELL_SYLVANAS_CAST = 36568,
- SPELL_RIBBON_OF_SOULS = 34432, //the real one to use might be 37099
+ SPELL_RIBBON_OF_SOULS = 34432, // the real one to use might be 37099
+
+ // Combat spells
+ SPELL_BLACK_ARROW = 59712,
+ SPELL_FADE = 20672,
+ SPELL_FADE_BLINK = 29211,
+ SPELL_MULTI_SHOT = 59713,
+ SPELL_SHOT = 59710,
+ SPELL_SUMMON_SKELETON = 59711
};
float HighborneLoc[4][3]=
@@ -88,17 +96,29 @@ public:
struct npc_lady_sylvanas_windrunnerAI : public ScriptedAI
{
- npc_lady_sylvanas_windrunnerAI(Creature* c) : ScriptedAI(c) {}
+ npc_lady_sylvanas_windrunnerAI(Creature* creature) : ScriptedAI(creature) {}
- uint32 LamentEvent_Timer;
+ uint32 LamentEventTimer;
bool LamentEvent;
uint64 targetGUID;
+ uint32 FadeTimer;
+ uint32 SummonSkeletonTimer;
+ uint32 BlackArrowTimer;
+ uint32 ShotTimer;
+ uint32 MultiShotTimer;
+
void Reset()
{
- LamentEvent_Timer = 5000;
+ LamentEventTimer = 5000;
LamentEvent = false;
targetGUID = 0;
+
+ FadeTimer = 30000;
+ SummonSkeletonTimer = 20000;
+ BlackArrowTimer = 15000;
+ ShotTimer = 8000;
+ MultiShotTimer = 10000;
}
void EnterCombat(Unit* /*who*/) {}
@@ -114,7 +134,7 @@ public:
summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false);
}
- summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ summoned->SetDisableGravity(true);
targetGUID = summoned->GetGUID();
}
}
@@ -123,27 +143,73 @@ public:
{
if (LamentEvent)
{
- if (LamentEvent_Timer <= diff)
+ if (LamentEventTimer <= diff)
{
DoSummon(ENTRY_HIGHBORNE_BUNNY, me, 10.0f, 3000, TEMPSUMMON_TIMED_DESPAWN);
- LamentEvent_Timer = 2000;
+ LamentEventTimer = 2000;
if (!me->HasAura(SPELL_SYLVANAS_CAST))
{
DoScriptText(SAY_LAMENT_END, me);
DoScriptText(EMOTE_LAMENT_END, me);
LamentEvent = false;
}
- } else LamentEvent_Timer -= diff;
+ } else LamentEventTimer -= diff;
}
if (!UpdateVictim())
return;
+ // Combat spells
+
+ if (FadeTimer <= diff)
+ {
+ DoCast(me, SPELL_FADE);
+ // add a blink to simulate a stealthed movement and reappearing elsewhere
+ DoCast(me, SPELL_FADE_BLINK);
+ FadeTimer = 30000 + rand()%5000;
+ // if the victim is out of melee range she cast multi shot
+ if (Unit* victim = me->getVictim())
+ if (me->GetDistance(victim) > 10.0f)
+ DoCast(victim, SPELL_MULTI_SHOT);
+ } else FadeTimer -= diff;
+
+ if (SummonSkeletonTimer <= diff)
+ {
+ DoCast(me, SPELL_SUMMON_SKELETON);
+ SummonSkeletonTimer = 20000 + rand()%10000;
+ } else SummonSkeletonTimer -= diff;
+
+ if (BlackArrowTimer <= diff)
+ {
+ if (Unit* victim = me->getVictim())
+ {
+ DoCast(victim, SPELL_BLACK_ARROW);
+ BlackArrowTimer = 15000 + rand()%5000;
+ }
+ } else BlackArrowTimer -= diff;
+
+ if (ShotTimer <= diff)
+ {
+ if (Unit* victim = me->getVictim())
+ {
+ DoCast(victim, SPELL_SHOT);
+ ShotTimer = 8000 + rand()%2000;
+ }
+ } else ShotTimer -= diff;
+
+ if (MultiShotTimer <= diff)
+ {
+ if (Unit* victim = me->getVictim())
+ {
+ DoCast(victim, SPELL_MULTI_SHOT);
+ MultiShotTimer = 10000 + rand()%3000;
+ }
+ } else MultiShotTimer -= diff;
+
DoMeleeAttackIfReady();
}
};
-
};
/*######
@@ -162,17 +228,17 @@ public:
struct npc_highborne_lamenterAI : public ScriptedAI
{
- npc_highborne_lamenterAI(Creature* c) : ScriptedAI(c) {}
+ npc_highborne_lamenterAI(Creature* creature) : ScriptedAI(creature) {}
- uint32 EventMove_Timer;
- uint32 EventCast_Timer;
+ uint32 EventMoveTimer;
+ uint32 EventCastTimer;
bool EventMove;
bool EventCast;
void Reset()
{
- EventMove_Timer = 10000;
- EventCast_Timer = 17500;
+ EventMoveTimer = 10000;
+ EventCastTimer = 17500;
EventMove = true;
EventCast = true;
}
@@ -183,25 +249,24 @@ public:
{
if (EventMove)
{
- if (EventMove_Timer <= diff)
+ if (EventMoveTimer <= diff)
{
- me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ me->SetDisableGravity(true);
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetDistance(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW) / (5000 * 0.001f));
me->SetPosition(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation());
EventMove = false;
- } else EventMove_Timer -= diff;
+ } else EventMoveTimer -= diff;
}
if (EventCast)
{
- if (EventCast_Timer <= diff)
+ if (EventCastTimer <= diff)
{
DoCast(me, SPELL_HIGHBORNE_AURA);
EventCast = false;
- } else EventCast_Timer -= diff;
+ } else EventCastTimer -= diff;
}
}
};
-
};
/*######
@@ -219,15 +284,15 @@ class npc_parqual_fintallas : public CreatureScript
public:
npc_parqual_fintallas() : CreatureScript("npc_parqual_fintallas") { }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
- if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
{
player->CLOSE_GOSSIP_MENU();
creature->CastSpell(player, SPELL_MARK_OF_SHAME, false);
}
- if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
+ if (action == GOSSIP_ACTION_INFO_DEF+2)
{
player->CLOSE_GOSSIP_MENU();
player->AreaExploredOrEventHappens(6628);
@@ -252,7 +317,6 @@ public:
return true;
}
-
};
/*######