Scripts/kalimdor: Use proper headers to optimize compile, code style and general cleanup.

Closes #6419 (pr)
This commit is contained in:
4m1g0
2012-05-19 15:11:09 +01:00
committed by Nay
parent 9474902479
commit 524e30e57b
27 changed files with 1114 additions and 1080 deletions
@@ -184,7 +184,7 @@ public:
{ {
if (Unit* victim = me->getVictim()) if (Unit* victim = me->getVictim())
{ {
DoCast(me->getVictim(), SPELL_BLACK_ARROW); DoCast(victim, SPELL_BLACK_ARROW);
BlackArrowTimer = 15000 + rand()%5000; BlackArrowTimer = 15000 + rand()%5000;
} }
} else BlackArrowTimer -= diff; } else BlackArrowTimer -= diff;
@@ -193,7 +193,7 @@ public:
{ {
if (Unit* victim = me->getVictim()) if (Unit* victim = me->getVictim())
{ {
DoCast(me->getVictim(), SPELL_SHOT); DoCast(victim, SPELL_SHOT);
ShotTimer = 8000 + rand()%2000; ShotTimer = 8000 + rand()%2000;
} }
} else ShotTimer -= diff; } else ShotTimer -= diff;
@@ -202,7 +202,7 @@ public:
{ {
if (Unit* victim = me->getVictim()) if (Unit* victim = me->getVictim())
{ {
DoCast(me->getVictim(), SPELL_MULTI_SHOT); DoCast(victim, SPELL_MULTI_SHOT);
MultiShotTimer = 10000 + rand()%3000; MultiShotTimer = 10000 + rand()%3000;
} }
} else MultiShotTimer -= diff; } else MultiShotTimer -= diff;
+65 -49
View File
@@ -28,7 +28,8 @@ npc_torek
npc_ruul_snowhoof npc_ruul_snowhoof
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h" #include "ScriptedEscortAI.h"
/*#### /*####
@@ -78,10 +79,8 @@ class npc_torek : public CreatureScript
void WaypointReached(uint32 waypointId) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); if (Player* player = GetPlayerForEscort())
if (!player) {
return;
switch (waypointId) switch (waypointId)
{ {
case 1: case 1:
@@ -106,6 +105,7 @@ class npc_torek : public CreatureScript
break; break;
} }
} }
}
void Reset() void Reset()
{ {
@@ -169,8 +169,26 @@ class npc_torek : public CreatureScript
# npc_ruul_snowhoof # npc_ruul_snowhoof
####*/ ####*/
#define QUEST_FREEDOM_TO_RUUL 6482 enum RuulSnowhoof
#define GO_CAGE 178147 {
NPC_THISTLEFUR_URSA = 3921,
NPC_THISTLEFUR_TOTEMIC = 3922,
NPC_THISTLEFUR_PATHFINDER = 3926,
QUEST_FREEDOM_TO_RUUL = 6482,
GO_CAGE = 178147
};
Position const RuulSnowhoofSummonsCoord[6] =
{
{3449.218018f, -587.825073f, 174.978867f, 4.714445f},
{3446.384521f, -587.830872f, 175.186279f, 4.714445f},
{3444.218994f, -587.835327f, 175.380600f, 4.714445f},
{3508.344482f, -492.024261f, 186.929031f, 4.145029f},
{3506.265625f, -490.531006f, 186.740128f, 4.239277f},
{3503.682373f, -489.393799f, 186.629684f, 4.349232f}
};
class npc_ruul_snowhoof : public CreatureScript class npc_ruul_snowhoof : public CreatureScript
{ {
@@ -195,14 +213,14 @@ class npc_ruul_snowhoof : public CreatureScript
Cage->SetGoState(GO_STATE_ACTIVE); Cage->SetGoState(GO_STATE_ACTIVE);
break; break;
case 13: case 13:
me->SummonCreature(3922, 3449.218018f, -587.825073f, 174.978867f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(NPC_THISTLEFUR_TOTEMIC, RuulSnowhoofSummonsCoord[0], TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3921, 3446.384521f, -587.830872f, 175.186279f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(NPC_THISTLEFUR_URSA, RuulSnowhoofSummonsCoord[1], TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3926, 3444.218994f, -587.835327f, 175.380600f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(NPC_THISTLEFUR_PATHFINDER, RuulSnowhoofSummonsCoord[2], TEMPSUMMON_DEAD_DESPAWN, 60000);
break; break;
case 19: case 19:
me->SummonCreature(3922, 3508.344482f, -492.024261f, 186.929031f, 4.145029f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(NPC_THISTLEFUR_TOTEMIC, RuulSnowhoofSummonsCoord[3], TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3921, 3506.265625f, -490.531006f, 186.740128f, 4.239277f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(NPC_THISTLEFUR_URSA, RuulSnowhoofSummonsCoord[4], TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3926, 3503.682373f, -489.393799f, 186.629684f, 4.349232f, TEMPSUMMON_DEAD_DESPAWN, 60000); me->SummonCreature(NPC_THISTLEFUR_PATHFINDER, RuulSnowhoofSummonsCoord[5], TEMPSUMMON_DEAD_DESPAWN, 60000);
break; break;
case 21: case 21:
player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me); player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me);
@@ -214,8 +232,7 @@ class npc_ruul_snowhoof : public CreatureScript
void Reset() void Reset()
{ {
GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20); if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
if (Cage)
Cage->SetGoState(GO_STATE_READY); Cage->SetGoState(GO_STATE_READY);
} }
@@ -249,7 +266,7 @@ class npc_ruul_snowhoof : public CreatureScript
} }
}; };
enum eEnums enum Muglash
{ {
SAY_MUG_START1 = -1800054, SAY_MUG_START1 = -1800054,
SAY_MUG_START2 = -1800055, SAY_MUG_START2 = -1800055,
@@ -278,21 +295,21 @@ enum eEnums
NPC_MUGLASH = 12717 NPC_MUGLASH = 12717
}; };
static float m_afFirstNagaCoord[3][3]= Position const FirstNagaCoord[3] =
{ {
{3603.504150f, 1122.631104f, 1.635f}, // rider {3603.504150f, 1122.631104f, 1.635f, 0.0f}, // rider
{3589.293945f, 1148.664063f, 5.565f}, // sorceress {3589.293945f, 1148.664063f, 5.565f, 0.0f}, // sorceress
{3609.925537f, 1168.759521f, -1.168f} // razortail {3609.925537f, 1168.759521f, -1.168f, 0.0f} // razortail
}; };
static float m_afSecondNagaCoord[3][3]= Position const SecondNagaCoord[3] =
{ {
{3609.925537f, 1168.759521f, -1.168f}, // witch {3609.925537f, 1168.759521f, -1.168f, 0.0f}, // witch
{3645.652100f, 1139.425415f, 1.322f}, // priest {3645.652100f, 1139.425415f, 1.322f, 0.0f}, // priest
{3583.602051f, 1128.405762f, 2.347f} // myrmidon {3583.602051f, 1128.405762f, 2.347f, 0.0f} // myrmidon
}; };
static float m_fVorshaCoord[]={3633.056885f, 1172.924072f, -5.388f}; Position const VorshaCoord = {3633.056885f, 1172.924072f, -5.388f, 0.0f};
class npc_muglash : public CreatureScript class npc_muglash : public CreatureScript
{ {
@@ -303,9 +320,9 @@ class npc_muglash : public CreatureScript
{ {
npc_muglashAI(Creature* creature) : npc_escortAI(creature) { } npc_muglashAI(Creature* creature) : npc_escortAI(creature) { }
uint32 m_uiWaveId; uint8 WaveId;
uint32 m_uiEventTimer; uint32 EventTimer;
bool m_bIsBrazierExtinguished; bool IsBrazierExtinguished;
void JustSummoned(Creature* summoned) void JustSummoned(Creature* summoned)
{ {
@@ -314,16 +331,14 @@ class npc_muglash : public CreatureScript
void WaypointReached(uint32 waypointId) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); if (Player* player = GetPlayerForEscort())
{
switch (waypointId) switch (waypointId)
{ {
case 0: case 0:
if (player)
DoScriptText(SAY_MUG_START2, me, player); DoScriptText(SAY_MUG_START2, me, player);
break; break;
case 24: case 24:
if (player)
DoScriptText(SAY_MUG_BRAZIER, me, player); DoScriptText(SAY_MUG_BRAZIER, me, player);
if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2)) if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2))
@@ -344,6 +359,7 @@ class npc_muglash : public CreatureScript
break; break;
} }
} }
}
void EnterCombat(Unit* /*who*/) void EnterCombat(Unit* /*who*/)
{ {
@@ -358,9 +374,9 @@ class npc_muglash : public CreatureScript
void Reset() void Reset()
{ {
m_uiEventTimer = 10000; EventTimer = 10000;
m_uiWaveId = 0; WaveId = 0;
m_bIsBrazierExtinguished = false; IsBrazierExtinguished = false;
} }
void JustDied(Unit* /*killer*/) void JustDied(Unit* /*killer*/)
@@ -372,20 +388,20 @@ class npc_muglash : public CreatureScript
void DoWaveSummon() void DoWaveSummon()
{ {
switch (m_uiWaveId) switch (WaveId)
{ {
case 1: case 1:
me->SummonCreature(NPC_WRATH_RIDER, m_afFirstNagaCoord[0][0], m_afFirstNagaCoord[0][1], m_afFirstNagaCoord[0][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); me->SummonCreature(NPC_WRATH_RIDER, FirstNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
me->SummonCreature(NPC_WRATH_SORCERESS, m_afFirstNagaCoord[1][0], m_afFirstNagaCoord[1][1], m_afFirstNagaCoord[1][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); me->SummonCreature(NPC_WRATH_SORCERESS, FirstNagaCoord[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
me->SummonCreature(NPC_WRATH_RAZORTAIL, m_afFirstNagaCoord[2][0], m_afFirstNagaCoord[2][1], m_afFirstNagaCoord[2][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); me->SummonCreature(NPC_WRATH_RAZORTAIL, FirstNagaCoord[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
break; break;
case 2: case 2:
me->SummonCreature(NPC_WRATH_PRIESTESS, m_afSecondNagaCoord[0][0], m_afSecondNagaCoord[0][1], m_afSecondNagaCoord[0][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); me->SummonCreature(NPC_WRATH_PRIESTESS, SecondNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
me->SummonCreature(NPC_WRATH_MYRMIDON, m_afSecondNagaCoord[1][0], m_afSecondNagaCoord[1][1], m_afSecondNagaCoord[1][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); me->SummonCreature(NPC_WRATH_MYRMIDON, SecondNagaCoord[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
me->SummonCreature(NPC_WRATH_SEAWITCH, m_afSecondNagaCoord[2][0], m_afSecondNagaCoord[2][1], m_afSecondNagaCoord[2][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); me->SummonCreature(NPC_WRATH_SEAWITCH, SecondNagaCoord[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
break; break;
case 3: case 3:
me->SummonCreature(NPC_VORSHA, m_fVorshaCoord[0], m_fVorshaCoord[1], m_fVorshaCoord[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); me->SummonCreature(NPC_VORSHA, VorshaCoord, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
break; break;
case 4: case 4:
SetEscortPaused(false); SetEscortPaused(false);
@@ -400,16 +416,16 @@ class npc_muglash : public CreatureScript
if (!me->getVictim()) if (!me->getVictim())
{ {
if (HasEscortState(STATE_ESCORT_PAUSED) && m_bIsBrazierExtinguished) if (HasEscortState(STATE_ESCORT_PAUSED) && IsBrazierExtinguished)
{ {
if (m_uiEventTimer < uiDiff) if (EventTimer < uiDiff)
{ {
++m_uiWaveId; ++WaveId;
DoWaveSummon(); DoWaveSummon();
m_uiEventTimer = 10000; EventTimer = 10000;
} }
else else
m_uiEventTimer -= uiDiff; EventTimer -= uiDiff;
} }
return; return;
} }
@@ -451,7 +467,7 @@ class go_naga_brazier : public GameObjectScript
{ {
DoScriptText(SAY_MUG_BRAZIER_WAIT, creature); DoScriptText(SAY_MUG_BRAZIER_WAIT, creature);
pEscortAI->m_bIsBrazierExtinguished = true; pEscortAI->IsBrazierExtinguished = true;
return false; return false;
} }
} }
+53 -56
View File
@@ -30,9 +30,9 @@ mob_rizzle_sprysprocket
mob_depth_charge mob_depth_charge
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "World.h" #include "ScriptedCreature.h"
#include "WorldPacket.h" #include "ScriptedGossip.h"
/*###### /*######
## mobs_spitelashes ## mobs_spitelashes
@@ -179,9 +179,12 @@ public:
# mob_rizzle_sprysprocket # mob_rizzle_sprysprocket
####*/ ####*/
enum eRizzleSprysprocketData enum RizzleSprysprocketData
{ {
QUEST_CHASING_THE_MOONSTONE = 10994,
MOB_DEPTH_CHARGE = 23025, MOB_DEPTH_CHARGE = 23025,
SPELL_RIZZLE_BLACKJACK = 39865, SPELL_RIZZLE_BLACKJACK = 39865,
SPELL_RIZZLE_ESCAPE = 39871, SPELL_RIZZLE_ESCAPE = 39871,
SPELL_RIZZLE_FROST_GRENADE = 40525, SPELL_RIZZLE_FROST_GRENADE = 40525,
@@ -199,9 +202,8 @@ enum eRizzleSprysprocketData
#define GOSSIP_GET_MOONSTONE "Hand over the Southfury moonstone and I'll let you go." #define GOSSIP_GET_MOONSTONE "Hand over the Southfury moonstone and I'll let you go."
float WPs[58][4] = Position const WPs[58] =
{ {
//pos_x pos_y pos_z orien
{3691.97f, -3962.41f, 35.9118f, 3.67f}, {3691.97f, -3962.41f, 35.9118f, 3.67f},
{3675.02f, -3960.49f, 35.9118f, 3.67f}, {3675.02f, -3960.49f, 35.9118f, 3.67f},
{3653.19f, -3958.33f, 33.9118f, 3.59f}, {3653.19f, -3958.33f, 33.9118f, 3.59f},
@@ -270,19 +272,19 @@ public:
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
{ {
player->PlayerTalkClass->ClearMenus(); player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_INFO_DEF + 1 && player->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE) if (action == GOSSIP_ACTION_INFO_DEF + 1 && player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE)
{ {
player->CLOSE_GOSSIP_MENU(); player->CLOSE_GOSSIP_MENU();
creature->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true); creature->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true);
CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->Must_Die_Timer = 3000; CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDieTimer = 3000;
CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->Must_Die = true; CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDie = true;
} }
return true; return true;
} }
bool OnGossipHello(Player* player, Creature* creature) bool OnGossipHello(Player* player, Creature* creature)
{ {
if (player->GetQuestStatus(10994) != QUEST_STATUS_INCOMPLETE) if (player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) != QUEST_STATUS_INCOMPLETE)
return true; return true;
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->SEND_GOSSIP_MENU(10811, creature->GetGUID()); player->SEND_GOSSIP_MENU(10811, creature->GetGUID());
@@ -298,32 +300,32 @@ public:
{ {
mob_rizzle_sprysprocketAI(Creature* creature) : ScriptedAI(creature) {} mob_rizzle_sprysprocketAI(Creature* creature) : ScriptedAI(creature) {}
uint32 spellEscape_Timer; uint32 SpellEscapeTimer;
uint32 Teleport_Timer; uint32 TeleportTimer;
uint32 Check_Timer; uint32 CheckTimer;
uint32 Grenade_Timer; uint32 GrenadeTimer;
uint32 Must_Die_Timer; uint32 MustDieTimer;
uint32 CurrWP; uint32 CurrWP;
uint64 PlayerGUID; uint64 PlayerGUID;
bool Must_Die; bool MustDie;
bool Escape; bool Escape;
bool ContinueWP; bool ContinueWP;
bool Reached; bool Reached;
void Reset() void Reset()
{ {
spellEscape_Timer = 1300; SpellEscapeTimer = 1300;
Teleport_Timer = 3500; TeleportTimer = 3500;
Check_Timer = 10000; CheckTimer = 10000;
Grenade_Timer = 30000; GrenadeTimer = 30000;
Must_Die_Timer = 3000; MustDieTimer = 3000;
CurrWP = 0; CurrWP = 0;
PlayerGUID = 0; PlayerGUID = 0;
Must_Die = false; MustDie = false;
Escape = false; Escape = false;
ContinueWP = false; ContinueWP = false;
Reached = false; Reached = false;
@@ -331,13 +333,13 @@ public:
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
{ {
if (Must_Die) if (MustDie)
{ {
if (Must_Die_Timer <= diff) if (MustDieTimer <= diff)
{ {
me->DespawnOrUnsummon(); me->DespawnOrUnsummon();
return; return;
} else Must_Die_Timer -= diff; } else MustDieTimer -= diff;
} }
if (!Escape) if (!Escape)
@@ -345,17 +347,16 @@ public:
if (!PlayerGUID) if (!PlayerGUID)
return; return;
if (spellEscape_Timer <= diff) if (SpellEscapeTimer <= diff)
{ {
DoCast(me, SPELL_RIZZLE_ESCAPE, false); DoCast(me, SPELL_RIZZLE_ESCAPE, false);
spellEscape_Timer = 10000; SpellEscapeTimer = 10000;
} else spellEscape_Timer -= diff; } else SpellEscapeTimer -= diff;
if (Teleport_Timer <= diff) if (TeleportTimer <= diff)
{ {
//temp solution - unit can't be teleported by core using spelleffect 5, only players //temp solution - unit can't be teleported by core using spelleffect 5, only players
Map* map = me->GetMap(); if (me->GetMap())
if (map)
{ {
me->SetPosition(3706.39f, -3969.15f, 35.9118f, 0); me->SetPosition(3706.39f, -3969.15f, 35.9118f, 0);
me->AI_SendMoveToPacket(3706.39f, -3969.15f, 35.9118f, 0, 0, 0); me->AI_SendMoveToPacket(3706.39f, -3969.15f, 35.9118f, 0, 0, 0);
@@ -367,20 +368,20 @@ public:
me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
me->SetSpeed(MOVE_RUN, 0.85f, true); me->SetSpeed(MOVE_RUN, 0.85f, true);
me->GetMotionMaster()->MovementExpired(); me->GetMotionMaster()->MovementExpired();
me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]); me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]);
Escape = true; Escape = true;
} else Teleport_Timer -= diff; } else TeleportTimer -= diff;
return; return;
} }
if (ContinueWP) if (ContinueWP)
{ {
me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]); me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]);
ContinueWP = false; ContinueWP = false;
} }
if (Grenade_Timer <= diff) if (GrenadeTimer <= diff)
{ {
Player* player = Unit::GetPlayer(*me, PlayerGUID); Player* player = Unit::GetPlayer(*me, PlayerGUID);
if (player) if (player)
@@ -388,10 +389,10 @@ public:
DoScriptText(SAY_RIZZLE_GRENADE, me, player); DoScriptText(SAY_RIZZLE_GRENADE, me, player);
DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true); DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true);
} }
Grenade_Timer = 30000; GrenadeTimer = 30000;
} else Grenade_Timer -= diff; } else GrenadeTimer -= diff;
if (Check_Timer <= diff) if (CheckTimer <= diff)
{ {
Player* player = Unit::GetPlayer(*me, PlayerGUID); Player* player = Unit::GetPlayer(*me, PlayerGUID);
if (!player) if (!player)
@@ -410,8 +411,8 @@ public:
Reached = true; Reached = true;
} }
Check_Timer = 1000; CheckTimer = 1000;
} else Check_Timer -= diff; } else CheckTimer -= diff;
} }
@@ -427,7 +428,7 @@ public:
if (!who || PlayerGUID) if (!who || PlayerGUID)
return; return;
if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE) if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE)
{ {
PlayerGUID = who->GetGUID(); PlayerGUID = who->GetGUID();
DoScriptText(SAY_RIZZLE_START, me); DoScriptText(SAY_RIZZLE_START, me);
@@ -472,25 +473,25 @@ public:
{ {
mob_depth_chargeAI(Creature* creature) : ScriptedAI(creature) {} mob_depth_chargeAI(Creature* creature) : ScriptedAI(creature) {}
bool we_must_die; bool WeMustDie;
uint32 must_die_timer; uint32 WeMustDieTimer;
void Reset() void Reset()
{ {
me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
we_must_die = false; WeMustDie = false;
must_die_timer = 1000; WeMustDieTimer = 1000;
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
{ {
if (we_must_die) if (WeMustDie)
{
if (must_die_timer <= diff)
{ {
if (WeMustDieTimer <= diff)
me->DespawnOrUnsummon(); me->DespawnOrUnsummon();
} else must_die_timer -= diff; else
WeMustDieTimer -= diff;
} }
return; return;
} }
@@ -503,18 +504,14 @@ public:
if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 5)) if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 5))
{ {
DoCast(who, SPELL_DEPTH_CHARGE_TRAP); DoCast(who, SPELL_DEPTH_CHARGE_TRAP);
we_must_die = true; WeMustDie = true;
return; return;
} }
} }
void AttackStart(Unit* /*who*/) void AttackStart(Unit* /*who*/) {}
{
}
void EnterCombat(Unit* /*who*/) void EnterCombat(Unit* /*who*/) {}
{
}
}; };
}; };
+38 -46
View File
@@ -33,15 +33,19 @@ go_ravager_cage
npc_death_ravager npc_death_ravager
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h" #include "ScriptedEscortAI.h"
#include <cmath> #include "ScriptedGossip.h"
#include "Cell.h"
#include "CellImpl.h"
#include "GridNotifiers.h"
/*###### /*######
## npc_draenei_survivor ## npc_draenei_survivor
######*/ ######*/
enum eEnums enum draeneiSurvivor
{ {
SAY_HEAL1 = -1000176, SAY_HEAL1 = -1000176,
SAY_HEAL2 = -1000177, SAY_HEAL2 = -1000177,
@@ -175,7 +179,7 @@ public:
## npc_engineer_spark_overgrind ## npc_engineer_spark_overgrind
######*/ ######*/
enum eOvergrind enum Overgrind
{ {
SAY_TEXT = -1000184, SAY_TEXT = -1000184,
SAY_EMOTE = -1000185, SAY_EMOTE = -1000185,
@@ -235,15 +239,15 @@ public:
uint32 NormFaction; uint32 NormFaction;
uint32 NpcFlags; uint32 NpcFlags;
uint32 Dynamite_Timer; uint32 DynamiteTimer;
uint32 Emote_Timer; uint32 EmoteTimer;
bool IsTreeEvent; bool IsTreeEvent;
void Reset() void Reset()
{ {
Dynamite_Timer = 8000; DynamiteTimer = 8000;
Emote_Timer = urand(120000, 150000); EmoteTimer = urand(120000, 150000);
me->setFaction(NormFaction); me->setFaction(NormFaction);
me->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags); me->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags);
@@ -260,12 +264,12 @@ public:
{ {
if (!me->isInCombat() && !IsTreeEvent) if (!me->isInCombat() && !IsTreeEvent)
{ {
if (Emote_Timer <= diff) if (EmoteTimer <= diff)
{ {
DoScriptText(SAY_TEXT, me); DoScriptText(SAY_TEXT, me);
DoScriptText(SAY_EMOTE, me); DoScriptText(SAY_EMOTE, me);
Emote_Timer = urand(120000, 150000); EmoteTimer = urand(120000, 150000);
} else Emote_Timer -= diff; } else EmoteTimer -= diff;
} }
else if (IsTreeEvent) else if (IsTreeEvent)
return; return;
@@ -273,11 +277,11 @@ public:
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (Dynamite_Timer <= diff) if (DynamiteTimer <= diff)
{ {
DoCast(me->getVictim(), SPELL_DYNAMITE); DoCast(me->getVictim(), SPELL_DYNAMITE);
Dynamite_Timer = 8000; DynamiteTimer = 8000;
} else Dynamite_Timer -= diff; } else DynamiteTimer -= diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
@@ -307,7 +311,7 @@ public:
{ {
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
me->SetHealth(me->CountPctFromMaxHealth(15)); me->SetHealth(me->CountPctFromMaxHealth(15));
switch (rand()%2) switch (urand(0, 1))
{ {
case 0: case 0:
me->SetStandState(UNIT_STAND_STATE_SIT); me->SetStandState(UNIT_STAND_STATE_SIT);
@@ -321,14 +325,9 @@ public:
void EnterCombat(Unit* /*who*/) {} void EnterCombat(Unit* /*who*/) {}
void MoveInLineOfSight(Unit* /*who*/) void MoveInLineOfSight(Unit* /*who*/) {}
{
}
void UpdateAI(const uint32 /*diff*/)
{
}
void UpdateAI(const uint32 /*diff*/) {}
}; };
}; };
@@ -337,7 +336,7 @@ public:
## npc_magwin ## npc_magwin
######*/ ######*/
enum eMagwin enum Magwin
{ {
SAY_START = -1000111, SAY_START = -1000111,
SAY_AGGRO = -1000112, SAY_AGGRO = -1000112,
@@ -376,10 +375,8 @@ public:
void WaypointReached(uint32 waypointId) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); if (Player* player = GetPlayerForEscort())
if (!player) {
return;
switch (waypointId) switch (waypointId)
{ {
case 0: case 0:
@@ -398,6 +395,7 @@ public:
break; break;
} }
} }
}
void EnterCombat(Unit* who) void EnterCombat(Unit* who)
{ {
@@ -413,7 +411,7 @@ public:
## npc_geezle ## npc_geezle
######*/ ######*/
enum eGeezle enum Geezle
{ {
QUEST_TREES_COMPANY = 9531, QUEST_TREES_COMPANY = 9531,
@@ -433,7 +431,7 @@ enum eGeezle
GO_NAGA_FLAG = 181694 GO_NAGA_FLAG = 181694
}; };
static float SparkPos[3] = {-5029.91f, -11291.79f, 8.096f}; Position const SparkPos = {-5029.91f, -11291.79f, 8.096f, 0.0f};
class npc_geezle : public CreatureScript class npc_geezle : public CreatureScript
{ {
@@ -451,7 +449,7 @@ public:
uint64 SparkGUID; uint64 SparkGUID;
uint32 Step; uint8 Step;
uint32 SayTimer; uint32 SayTimer;
bool EventStarted; bool EventStarted;
@@ -469,8 +467,7 @@ public:
{ {
Step = 0; Step = 0;
EventStarted = true; EventStarted = true;
Creature* Spark = me->SummonCreature(MOB_SPARK, SparkPos[0], SparkPos[1], SparkPos[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000); if (Creature* Spark = me->SummonCreature(MOB_SPARK, SparkPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000))
if (Spark)
{ {
SparkGUID = Spark->GetGUID(); SparkGUID = Spark->GetGUID();
Spark->setActive(true); Spark->setActive(true);
@@ -479,7 +476,7 @@ public:
SayTimer = 8000; SayTimer = 8000;
} }
uint32 NextStep(uint32 Step) uint32 NextStep(uint8 Step)
{ {
Creature* Spark = Unit::GetCreature(*me, SparkGUID); Creature* Spark = Unit::GetCreature(*me, SparkGUID);
@@ -511,7 +508,7 @@ public:
case 9: case 9:
me->GetMotionMaster()->MoveTargetedHome(); me->GetMotionMaster()->MoveTargetedHome();
if (Spark) if (Spark)
Spark->GetMotionMaster()->MovePoint(0, SparkPos[0], SparkPos[1], SparkPos[2]); Spark->GetMotionMaster()->MovePoint(0, SparkPos);
CompleteQuest(); CompleteQuest();
return 9000; return 9000;
case 10: case 10:
@@ -533,14 +530,9 @@ public:
me->VisitNearbyWorldObject(radius, searcher); me->VisitNearbyWorldObject(radius, searcher);
for (std::list<Player*>::const_iterator itr = players.begin(); itr != players.end(); ++itr) for (std::list<Player*>::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{ if ((*itr)->GetQuestStatus(QUEST_TREES_COMPANY) == QUEST_STATUS_INCOMPLETE && (*itr)->HasAura(SPELL_TREE_DISGUISE))
if ((*itr)->GetQuestStatus(QUEST_TREES_COMPANY) == QUEST_STATUS_INCOMPLETE
&&(*itr)->HasAura(SPELL_TREE_DISGUISE))
{
(*itr)->KilledMonsterCredit(MOB_SPARK, 0); (*itr)->KilledMonsterCredit(MOB_SPARK, 0);
} }
}
}
void DespawnNagaFlag(bool despawn) void DespawnNagaFlag(bool despawn)
{ {
@@ -552,13 +544,13 @@ public:
for (std::list<GameObject*>::const_iterator itr = FlagList.begin(); itr != FlagList.end(); ++itr) for (std::list<GameObject*>::const_iterator itr = FlagList.begin(); itr != FlagList.end(); ++itr)
{ {
if (despawn) if (despawn)
{
(*itr)->SetLootState(GO_JUST_DEACTIVATED); (*itr)->SetLootState(GO_JUST_DEACTIVATED);
}
else else
(*itr)->Respawn(); (*itr)->Respawn();
} }
} else sLog->outError("SD2 ERROR: FlagList is empty!"); }
else
sLog->outError("SD2 ERROR: FlagList is empty!");
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
@@ -566,16 +558,16 @@ public:
if (SayTimer <= diff) if (SayTimer <= diff)
{ {
if (EventStarted) if (EventStarted)
{
SayTimer = NextStep(Step++); SayTimer = NextStep(Step++);
} }
} else SayTimer -= diff; else
SayTimer -= diff;
} }
}; };
}; };
enum eRavegerCage enum RavegerCage
{ {
NPC_DEATH_RAVAGER = 17556, NPC_DEATH_RAVAGER = 17556,
@@ -28,14 +28,16 @@ mob_webbed_creature
npc_captured_sunhawk_agent npc_captured_sunhawk_agent
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
/*###### /*######
## mob_webbed_creature ## mob_webbed_creature
######*/ ######*/
//possible creatures to be spawned //possible creatures to be spawned
const uint32 possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327}; uint32 const possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327};
class mob_webbed_creature : public CreatureScript class mob_webbed_creature : public CreatureScript
{ {
@@ -51,13 +53,9 @@ public:
{ {
mob_webbed_creatureAI(Creature* creature) : ScriptedAI(creature) {} mob_webbed_creatureAI(Creature* creature) : ScriptedAI(creature) {}
void Reset() void Reset() {}
{
}
void EnterCombat(Unit* /*who*/) void EnterCombat(Unit* /*who*/) {}
{
}
void JustDied(Unit* killer) void JustDied(Unit* killer)
{ {
@@ -153,7 +151,7 @@ public:
## Quest 9667: Saving Princess Stillpine ## Quest 9667: Saving Princess Stillpine
######*/ ######*/
enum eStillpine enum Stillpine
{ {
QUEST_SAVING_PRINCESS_STILLPINE = 9667, QUEST_SAVING_PRINCESS_STILLPINE = 9667,
NPC_PRINCESS_STILLPINE = 17682, NPC_PRINCESS_STILLPINE = 17682,
+63 -56
View File
@@ -23,17 +23,24 @@ SDComment: Teleport not included, spell reflect not effecting dots (Core problem
SDCategory: Azshara SDCategory: Azshara
EndScriptData */ EndScriptData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#define SAY_TELEPORT -1000100 enum Say
{
SAY_TELEPORT = -1000100
};
#define SPELL_MARKOFFROST 23182 enum Spells
#define SPELL_MANASTORM 21097 {
#define SPELL_CHILL 21098 SPELL_MARKOFFROST = 23182,
#define SPELL_FROSTBREATH 21099 SPELL_MANASTORM = 21097,
#define SPELL_REFLECT 22067 SPELL_CHILL = 21098,
#define SPELL_CLEAVE 8255 //Perhaps not right ID SPELL_FROSTBREATH = 21099,
#define SPELL_ENRAGE 23537 SPELL_REFLECT = 22067,
SPELL_CLEAVE = 8255, //Perhaps not right ID
SPELL_ENRAGE = 23537
};
class boss_azuregos : public CreatureScript class boss_azuregos : public CreatureScript
{ {
@@ -49,26 +56,26 @@ public:
{ {
boss_azuregosAI(Creature* creature) : ScriptedAI(creature) {} boss_azuregosAI(Creature* creature) : ScriptedAI(creature) {}
uint32 MarkOfFrost_Timer; uint32 MarkOfFrostTimer;
uint32 ManaStorm_Timer; uint32 ManaStormTimer;
uint32 Chill_Timer; uint32 ChillTimer;
uint32 Breath_Timer; uint32 BreathTimer;
uint32 Teleport_Timer; uint32 TeleportTimer;
uint32 Reflect_Timer; uint32 ReflectTimer;
uint32 Cleave_Timer; uint32 CleaveTimer;
uint32 Enrage_Timer; uint32 EnrageTimer;
bool Enraged; bool Enraged;
void Reset() void Reset()
{ {
MarkOfFrost_Timer = 35000; MarkOfFrostTimer = 35000;
ManaStorm_Timer = urand(5000, 17000); ManaStormTimer = urand(5000, 17000);
Chill_Timer = urand(10000, 30000); ChillTimer = urand(10000, 30000);
Breath_Timer = urand(2000, 8000); BreathTimer = urand(2000, 8000);
Teleport_Timer = 30000; TeleportTimer = 30000;
Reflect_Timer = urand(15000, 30000); ReflectTimer = urand(15000, 30000);
Cleave_Timer = 7000; CleaveTimer = 7000;
Enrage_Timer = 0; EnrageTimer = 0;
Enraged = false; Enraged = false;
} }
@@ -80,12 +87,12 @@ public:
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (Teleport_Timer <= diff) if (TeleportTimer <= diff)
{ {
DoScriptText(SAY_TELEPORT, me); DoScriptText(SAY_TELEPORT, me);
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList(); std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); std::list<HostileReference*>::const_iterator i = threatlist.begin();
for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) for (i = threatlist.begin(); i!= threatlist.end(); ++i)
{ {
Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
@@ -95,53 +102,53 @@ public:
} }
DoResetThreat(); DoResetThreat();
Teleport_Timer = 30000; TeleportTimer = 30000;
} else Teleport_Timer -= diff; } else TeleportTimer -= diff;
// //MarkOfFrost_Timer // //MarkOfFrostTimer
// if (MarkOfFrost_Timer <= diff) // if (MarkOfFrostTimer <= diff)
// { // {
// DoCast(me->getVictim(), SPELL_MARKOFFROST); // DoCast(me->getVictim(), SPELL_MARKOFFROST);
// MarkOfFrost_Timer = 25000; // MarkOfFrostTimer = 25000;
// } else MarkOfFrost_Timer -= diff; // } else MarkOfFrostTimer -= diff;
//Chill_Timer //ChillTimer
if (Chill_Timer <= diff) if (ChillTimer <= diff)
{ {
DoCast(me->getVictim(), SPELL_CHILL); DoCast(me->getVictim(), SPELL_CHILL);
Chill_Timer = urand(13000, 25000); ChillTimer = urand(13000, 25000);
} else Chill_Timer -= diff; } else ChillTimer -= diff;
//Breath_Timer //BreathTimer
if (Breath_Timer <= diff) if (BreathTimer <= diff)
{ {
DoCast(me->getVictim(), SPELL_FROSTBREATH); DoCast(me->getVictim(), SPELL_FROSTBREATH);
Breath_Timer = urand(10000, 15000); BreathTimer = urand(10000, 15000);
} else Breath_Timer -= diff; } else BreathTimer -= diff;
//ManaStorm_Timer //ManaStormTimer
if (ManaStorm_Timer <= diff) if (ManaStormTimer <= diff)
{ {
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_MANASTORM); DoCast(target, SPELL_MANASTORM);
ManaStorm_Timer = urand(7500, 12500); ManaStormTimer = urand(7500, 12500);
} else ManaStorm_Timer -= diff; } else ManaStormTimer -= diff;
//Reflect_Timer //ReflectTimer
if (Reflect_Timer <= diff) if (ReflectTimer <= diff)
{ {
DoCast(me, SPELL_REFLECT); DoCast(me, SPELL_REFLECT);
Reflect_Timer = urand(20000, 35000); ReflectTimer = urand(20000, 35000);
} else Reflect_Timer -= diff; } else ReflectTimer -= diff;
//Cleave_Timer //CleaveTimer
if (Cleave_Timer <= diff) if (CleaveTimer <= diff)
{ {
DoCast(me->getVictim(), SPELL_CLEAVE); DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000; CleaveTimer = 7000;
} else Cleave_Timer -= diff; } else CleaveTimer -= diff;
//Enrage_Timer //EnrageTimer
if (HealthBelowPct(26) && !Enraged) if (HealthBelowPct(26) && !Enraged)
{ {
DoCast(me, SPELL_ENRAGE); DoCast(me, SPELL_ENRAGE);
+16 -15
View File
@@ -29,7 +29,9 @@ npc_prospector_remtravel
npc_threshwackonator npc_threshwackonator
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h" #include "ScriptedEscortAI.h"
#include "ScriptedFollowerAI.h" #include "ScriptedFollowerAI.h"
@@ -37,7 +39,7 @@ EndContentData */
# npc_kerlonian # npc_kerlonian
####*/ ####*/
enum eKerlonian enum Kerlonian
{ {
SAY_KER_START = -1000434, SAY_KER_START = -1000434,
@@ -94,11 +96,11 @@ public:
{ {
npc_kerlonianAI(Creature* creature) : FollowerAI(creature) { } npc_kerlonianAI(Creature* creature) : FollowerAI(creature) { }
uint32 m_uiFallAsleepTimer; uint32 FallAsleepTimer;
void Reset() void Reset()
{ {
m_uiFallAsleepTimer = urand(10000, 45000); FallAsleepTimer = urand(10000, 45000);
} }
void MoveInLineOfSight(Unit* who) void MoveInLineOfSight(Unit* who)
@@ -150,7 +152,7 @@ public:
SetFollowPaused(false); SetFollowPaused(false);
} }
void UpdateFollowerAI(const uint32 uiDiff) void UpdateFollowerAI(const uint32 Diff)
{ {
if (!UpdateVictim()) if (!UpdateVictim())
{ {
@@ -159,13 +161,13 @@ public:
if (!HasFollowState(STATE_FOLLOW_PAUSED)) if (!HasFollowState(STATE_FOLLOW_PAUSED))
{ {
if (m_uiFallAsleepTimer <= uiDiff) if (FallAsleepTimer <= Diff)
{ {
SetSleeping(); SetSleeping();
m_uiFallAsleepTimer = urand(25000, 90000); FallAsleepTimer = urand(25000, 90000);
} }
else else
m_uiFallAsleepTimer -= uiDiff; FallAsleepTimer -= Diff;
} }
return; return;
@@ -181,7 +183,7 @@ public:
# npc_prospector_remtravel # npc_prospector_remtravel
####*/ ####*/
enum eRemtravel enum Remtravel
{ {
SAY_REM_START = -1000327, SAY_REM_START = -1000327,
SAY_REM_AGGRO = -1000328, SAY_REM_AGGRO = -1000328,
@@ -233,10 +235,8 @@ public:
void WaypointReached(uint32 waypointId) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); if (Player* player = GetPlayerForEscort())
if (!player) {
return;
switch (waypointId) switch (waypointId)
{ {
case 0: case 0:
@@ -292,12 +292,13 @@ public:
break; break;
} }
} }
}
void Reset() {} void Reset() {}
void EnterCombat(Unit* who) void EnterCombat(Unit* who)
{ {
if (rand()%2) if (urand(0, 1))
DoScriptText(SAY_REM_AGGRO, me, who); DoScriptText(SAY_REM_AGGRO, me, who);
} }
@@ -314,7 +315,7 @@ public:
# npc_threshwackonator # npc_threshwackonator
####*/ ####*/
enum eThreshwackonator enum Threshwackonator
{ {
EMOTE_START = -1000325, //signed for 4966 EMOTE_START = -1000325, //signed for 4966
SAY_AT_CLOSE = -1000326, //signed for 4966 SAY_AT_CLOSE = -1000326, //signed for 4966
+16 -11
View File
@@ -30,10 +30,12 @@ npc_dalinda_malem
go_demon_portal go_demon_portal
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h" #include "ScriptedEscortAI.h"
enum eDyingKodo enum DyingKodo
{ {
// signed for 9999 // signed for 9999
SAY_SMEED_HOME_1 = -1000348, SAY_SMEED_HOME_1 = -1000348,
@@ -114,11 +116,11 @@ public:
{ {
npc_aged_dying_ancient_kodoAI(Creature* creature) : ScriptedAI(creature) { Reset(); } npc_aged_dying_ancient_kodoAI(Creature* creature) : ScriptedAI(creature) { Reset(); }
uint32 m_uiDespawnTimer; uint32 DespawnTimer;
void Reset() void Reset()
{ {
m_uiDespawnTimer = 0; DespawnTimer = 0;
} }
void MoveInLineOfSight(Unit* who) void MoveInLineOfSight(Unit* who)
@@ -143,14 +145,14 @@ public:
if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP) if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP)
{ {
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
m_uiDespawnTimer = 60000; DespawnTimer = 60000;
} }
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
{ {
//timer should always be == 0 unless we already updated entry of creature. Then not expect this updated to ever be in combat. //timer should always be == 0 unless we already updated entry of creature. Then not expect this updated to ever be in combat.
if (m_uiDespawnTimer && m_uiDespawnTimer <= diff) if (DespawnTimer && DespawnTimer <= diff)
{ {
if (!me->getVictim() && me->isAlive()) if (!me->getVictim() && me->isAlive())
{ {
@@ -159,7 +161,7 @@ public:
me->Respawn(); me->Respawn();
return; return;
} }
} else m_uiDespawnTimer -= diff; } else DespawnTimer -= diff;
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
@@ -175,7 +177,7 @@ public:
## Hand of Iruxos ## Hand of Iruxos
######*/ ######*/
enum enum Iruxos
{ {
QUEST_HAND_IRUXOS = 5381, QUEST_HAND_IRUXOS = 5381,
NPC_DEMON_SPIRIT = 11876, NPC_DEMON_SPIRIT = 11876,
@@ -199,7 +201,10 @@ class go_iruxos : public GameObjectScript
## npc_dalinda_malem. Quest 1440 ## npc_dalinda_malem. Quest 1440
######*/ ######*/
#define QUEST_RETURN_TO_VAHLARRIEL 1440 enum Dalinda
{
QUEST_RETURN_TO_VAHLARRIEL = 1440
};
class npc_dalinda : public CreatureScript class npc_dalinda : public CreatureScript
{ {
@@ -255,9 +260,9 @@ public:
return; return;
} }
void UpdateAI(const uint32 uiDiff) void UpdateAI(const uint32 Diff)
{ {
npc_escortAI::UpdateAI(uiDiff); npc_escortAI::UpdateAI(Diff);
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
+11 -9
View File
@@ -15,8 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "Vehicle.h" #include "Vehicle.h"
#include "SpellScript.h"
/*###### /*######
##Quest 5441: Lazy Peons ##Quest 5441: Lazy Peons
@@ -50,15 +52,15 @@ public:
{ {
npc_lazy_peonAI(Creature* creature) : ScriptedAI(creature) {} npc_lazy_peonAI(Creature* creature) : ScriptedAI(creature) {}
uint64 uiPlayerGUID; uint64 PlayerGUID;
uint32 m_uiRebuffTimer; uint32 RebuffTimer;
bool work; bool work;
void Reset() void Reset()
{ {
uiPlayerGUID = 0; PlayerGUID = 0;
m_uiRebuffTimer = 0; RebuffTimer = 0;
work = false; work = false;
} }
@@ -81,17 +83,17 @@ public:
} }
} }
void UpdateAI(const uint32 uiDiff) void UpdateAI(const uint32 Diff)
{ {
if (work == true) if (work == true)
me->HandleEmoteCommand(EMOTE_ONESHOT_WORK_CHOPWOOD); me->HandleEmoteCommand(EMOTE_ONESHOT_WORK_CHOPWOOD);
if (m_uiRebuffTimer <= uiDiff) if (RebuffTimer <= Diff)
{ {
DoCast(me, SPELL_BUFF_SLEEP); DoCast(me, SPELL_BUFF_SLEEP);
m_uiRebuffTimer = 300000; //Rebuff agian in 5 minutes RebuffTimer = 300000; //Rebuff agian in 5 minutes
} }
else else
m_uiRebuffTimer -= uiDiff; RebuffTimer -= Diff;
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
@@ -32,8 +32,11 @@ npc_private_hendel
npc_cassa_crimsonwing - handled by npc_taxi npc_cassa_crimsonwing - handled by npc_taxi
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h" #include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "SpellScript.h"
/*###### /*######
## mobs_risen_husk_spirit ## mobs_risen_husk_spirit
@@ -132,7 +135,7 @@ class mobs_risen_husk_spirit : public CreatureScript
## npc_deserter_agitator ## npc_deserter_agitator
######*/ ######*/
enum eDeserter enum Deserter
{ {
QUEST_TRAITORS_AMONG_US = 11126, QUEST_TRAITORS_AMONG_US = 11126,
NPC_THERAMORE_DESERTER = 23602, NPC_THERAMORE_DESERTER = 23602,
@@ -203,12 +206,12 @@ public:
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
} }
void MovementInform(uint32 uiType, uint32 uiId) void MovementInform(uint32 Type, uint32 Id)
{ {
if (uiType != POINT_MOTION_TYPE) if (Type != POINT_MOTION_TYPE)
return; return;
if (uiId == 1) if (Id == 1)
me->DisappearAndDie(); me->DisappearAndDie();
} }
}; };
@@ -218,7 +221,7 @@ public:
## npc_deserter_agitator ## npc_deserter_agitator
######*/ ######*/
enum eTheramoreGuard enum TheramoreGuard
{ {
SAY_QUEST1 = -1000641, SAY_QUEST1 = -1000641,
SAY_QUEST2 = -1000642, SAY_QUEST2 = -1000642,
@@ -266,7 +269,7 @@ public:
DoScriptText(SAY_QUEST1, creature); DoScriptText(SAY_QUEST1, creature);
creature->CastSpell(creature, SPELL_DOCTORED_LEAFLET, false); creature->CastSpell(creature, SPELL_DOCTORED_LEAFLET, false);
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->uiYellTimer = 4000; CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->YellTimer = 4000;
CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->bYellTimer = true; CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->bYellTimer = true;
} }
@@ -282,40 +285,40 @@ public:
{ {
npc_theramore_guardAI(Creature* creature) : ScriptedAI(creature) { } npc_theramore_guardAI(Creature* creature) : ScriptedAI(creature) { }
uint32 uiYellTimer; uint32 YellTimer;
uint32 uiStep; uint32 Step;
bool bYellTimer; bool bYellTimer;
void Reset() void Reset()
{ {
bYellTimer = false; bYellTimer = false;
uiStep = 0; Step = 0;
} }
void UpdateAI(const uint32 uiDiff) void UpdateAI(const uint32 Diff)
{ {
if (!me->HasAura(SPELL_PROPAGANDIZED)) if (!me->HasAura(SPELL_PROPAGANDIZED))
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
if (bYellTimer && uiYellTimer <= uiDiff) if (bYellTimer && YellTimer <= Diff)
{ {
switch (uiStep) switch (Step)
{ {
case 0: case 0:
DoScriptText(RAND(SAY_QUEST2, SAY_QUEST3, SAY_QUEST4, SAY_QUEST5, SAY_QUEST6), me); DoScriptText(RAND(SAY_QUEST2, SAY_QUEST3, SAY_QUEST4, SAY_QUEST5, SAY_QUEST6), me);
uiYellTimer = 3000; YellTimer = 3000;
++uiStep; ++Step;
break; break;
case 1: case 1:
DoScriptText(RAND(SAY_QUEST7, SAY_QUEST8, SAY_QUEST9), me); DoScriptText(RAND(SAY_QUEST7, SAY_QUEST8, SAY_QUEST9), me);
me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
uiStep = 0; Step = 0;
bYellTimer = false; bYellTimer = false;
break; break;
} }
} }
else else
uiYellTimer -= uiDiff; YellTimer -= Diff;
} }
}; };
}; };
@@ -324,7 +327,7 @@ public:
## npc_lady_jaina_proudmoore ## npc_lady_jaina_proudmoore
######*/ ######*/
enum eLadyJaina enum LadyJaina
{ {
QUEST_JAINAS_AUTOGRAPH = 558, QUEST_JAINAS_AUTOGRAPH = 558,
SPELL_JAINAS_AUTOGRAPH = 23122 SPELL_JAINAS_AUTOGRAPH = 23122
@@ -367,7 +370,7 @@ public:
## npc_nat_pagle ## npc_nat_pagle
######*/ ######*/
enum eNatPagle enum NatPagle
{ {
QUEST_NATS_MEASURING_TAPE = 8227 QUEST_NATS_MEASURING_TAPE = 8227
}; };
@@ -408,7 +411,7 @@ public:
## npc_private_hendel ## npc_private_hendel
######*/ ######*/
enum eHendel enum Hendel
{ {
// looks like all this text ids are wrong. // looks like all this text ids are wrong.
SAY_PROGRESS_1_TER = -1000411, // signed for 3568 SAY_PROGRESS_1_TER = -1000411, // signed for 3568
@@ -464,11 +467,11 @@ public:
AttackStart(pAttacker); AttackStart(pAttacker);
} }
void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) void DamageTaken(Unit* pDoneBy, uint32 &Damage)
{ {
if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(20, uiDamage)) if (Damage > me->GetHealth() || me->HealthBelowPctDamaged(20, Damage))
{ {
uiDamage = 0; Damage = 0;
if (Player* player = pDoneBy->GetCharmerOrOwnerPlayerOrPlayerItself()) if (Player* player = pDoneBy->GetCharmerOrOwnerPlayerOrPlayerItself())
player->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, me); player->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, me);
@@ -485,9 +488,9 @@ public:
## npc_zelfrax ## npc_zelfrax
######*/ ######*/
const Position MovePosition = {-2967.030f, -3872.1799f, 35.620f, 0.0f}; Position const MovePosition = {-2967.030f, -3872.1799f, 35.620f, 0.0f};
enum eZelfrax enum Zelfrax
{ {
SAY_ZELFRAX = -1000472, SAY_ZELFRAX = -1000472,
SAY_ZELFRAX_2 = -1000473 SAY_ZELFRAX_2 = -1000473
@@ -525,9 +528,9 @@ public:
} }
} }
void MovementInform(uint32 uiType, uint32 /*uiId*/) void MovementInform(uint32 Type, uint32 /*Id*/)
{ {
if (uiType != POINT_MOTION_TYPE) if (Type != POINT_MOTION_TYPE)
return; return;
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
@@ -547,7 +550,7 @@ public:
DoScriptText(SAY_ZELFRAX_2, me); DoScriptText(SAY_ZELFRAX_2, me);
} }
void UpdateAI(uint32 const /*uiDiff*/) void UpdateAI(uint32 const /*Diff*/)
{ {
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
@@ -562,7 +565,7 @@ public:
## npc_stinky ## npc_stinky
######*/ ######*/
enum eStinky enum Stinky
{ {
QUEST_STINKYS_ESCAPE_H = 1270, QUEST_STINKYS_ESCAPE_H = 1270,
QUEST_STINKYS_ESCAPE_A = 1222, QUEST_STINKYS_ESCAPE_A = 1222,
+19 -6
View File
@@ -27,7 +27,9 @@ EndScriptData */
npcs_riverbreeze_and_silversky npcs_riverbreeze_and_silversky
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
/*###### /*######
## npcs_riverbreeze_and_silversky ## npcs_riverbreeze_and_silversky
@@ -35,6 +37,17 @@ EndContentData */
#define GOSSIP_ITEM_BEACON "Please make me a Cenarion Beacon" #define GOSSIP_ITEM_BEACON "Please make me a Cenarion Beacon"
enum RiverbreezeAndSilversky
{
SPELL_CENARION_BEACON = 15120,
NPC_ARATHANDRIS_SILVERSKY = 9528,
NPC_MAYBESS_RIVERBREEZE = 9529,
QUEST_CLEASING_FELWOOD_A = 4101,
QUEST_CLEASING_FELWOOD_H = 4102
};
class npcs_riverbreeze_and_silversky : public CreatureScript class npcs_riverbreeze_and_silversky : public CreatureScript
{ {
public: public:
@@ -46,7 +59,7 @@ public:
if (action == GOSSIP_ACTION_INFO_DEF+1) if (action == GOSSIP_ACTION_INFO_DEF+1)
{ {
player->CLOSE_GOSSIP_MENU(); player->CLOSE_GOSSIP_MENU();
creature->CastSpell(player, 15120, false); creature->CastSpell(player, SPELL_CENARION_BEACON, false);
} }
return true; return true;
} }
@@ -58,9 +71,9 @@ public:
uint32 creatureId = creature->GetEntry(); uint32 creatureId = creature->GetEntry();
if (creatureId == 9528) if (creatureId == NPC_ARATHANDRIS_SILVERSKY)
{ {
if (player->GetQuestRewardStatus(4101)) if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_A))
{ {
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(2848, creature->GetGUID()); player->SEND_GOSSIP_MENU(2848, creature->GetGUID());
@@ -70,9 +83,9 @@ public:
player->SEND_GOSSIP_MENU(2844, creature->GetGUID()); player->SEND_GOSSIP_MENU(2844, creature->GetGUID());
} }
if (creatureId == 9529) if (creatureId == NPC_MAYBESS_RIVERBREEZE)
{ {
if (player->GetQuestRewardStatus(4102)) if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_H))
{ {
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(2849, creature->GetGUID()); player->SEND_GOSSIP_MENU(2849, creature->GetGUID());
+4 -2
View File
@@ -23,8 +23,10 @@ SDComment: Quest support: 3520, 2767, Special vendor Gregan Brewspewer
SDCategory: Feralas SDCategory: Feralas
EndScriptData */ EndScriptData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h" #include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
/*###### /*######
## npc_gregan_brewspewer ## npc_gregan_brewspewer
@@ -68,7 +70,7 @@ public:
## npc_oox22fe ## npc_oox22fe
######*/ ######*/
enum eOOX enum OOX
{ {
//signed for 7806 //signed for 7806
SAY_OOX_START = -1000287, SAY_OOX_START = -1000287,
+58 -64
View File
@@ -31,14 +31,16 @@ npc_clintar_spirit
npc_clintar_dreamwalker npc_clintar_dreamwalker
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h" #include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
/*###### /*######
## npc_bunthen_plainswind ## npc_bunthen_plainswind
######*/ ######*/
enum eBunthen enum Bunthen
{ {
QUEST_SEA_LION_HORDE = 30, QUEST_SEA_LION_HORDE = 30,
QUEST_SEA_LION_ALLY = 272, QUEST_SEA_LION_ALLY = 272,
@@ -218,7 +220,7 @@ public:
## npc_clintar_spirit ## npc_clintar_spirit
######*/ ######*/
float Clintar_spirit_WP[41][5] = float const Clintar_spirit_WP[41][5] =
{ {
//pos_x pos_y pos_z orien waitTime //pos_x pos_y pos_z orien waitTime
{7465.28f, -3115.46f, 439.327f, 0.83f, 4000}, {7465.28f, -3115.46f, 439.327f, 0.83f, 4000},
@@ -264,24 +266,22 @@ float Clintar_spirit_WP[41][5] =
{7517.51f, -3056.3f, 444.568f, 2.49f, 4500} {7517.51f, -3056.3f, 444.568f, 2.49f, 4500}
}; };
#define ASPECT_RAVEN 22915 Position const AspectRavenSummon = {7472.96f, -3074.18f, 427.566f, 0.0f};
Position const ClintarSpiritSummon = {7459.2275f, -3122.5632f, 438.9842f, 0.8594f};
#define ASPECT_RAVEN_SUMMON_X 7472.96f enum ClintarSpirit
#define ASPECT_RAVEN_SUMMON_Y -3074.18f {
#define ASPECT_RAVEN_SUMMON_Z 427.566f ASPECT_RAVEN = 22915,
#define CLINTAR_SPIRIT_SUMMON_X 7459.2275f
#define CLINTAR_SPIRIT_SUMMON_Y -3122.5632f
#define CLINTAR_SPIRIT_SUMMON_Z 438.9842f
#define CLINTAR_SPIRIT_SUMMON_O 0.8594f
//from -1000292 to -1000287 are signed for 7806. but all this texts ids wrong. //from -1000292 to -1000287 are signed for 7806. but all this texts ids wrong.
#define CLINTAR_SPIRIT_SAY_START -1000286 CLINTAR_SPIRIT_SAY_START = -1000286,
#define CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1 -1000287 CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1 = -1000287,
#define CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2 -1000288 CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2 = -1000288,
#define CLINTAR_SPIRIT_SAY_GET_ONE -1000289 CLINTAR_SPIRIT_SAY_GET_ONE = -1000289,
#define CLINTAR_SPIRIT_SAY_GET_TWO -1000290 CLINTAR_SPIRIT_SAY_GET_TWO = -1000290,
#define CLINTAR_SPIRIT_SAY_GET_THREE -1000291 CLINTAR_SPIRIT_SAY_GET_THREE = -1000291,
#define CLINTAR_SPIRIT_SAY_GET_FINAL -1000292 CLINTAR_SPIRIT_SAY_GET_FINAL = -1000292
};
class npc_clintar_spirit : public CreatureScript class npc_clintar_spirit : public CreatureScript
{ {
@@ -298,14 +298,14 @@ public:
public: public:
npc_clintar_spiritAI(Creature* creature) : npc_escortAI(creature) {} npc_clintar_spiritAI(Creature* creature) : npc_escortAI(creature) {}
uint32 Step; uint8 Step;
uint32 CurrWP; uint32 CurrWP;
uint32 Event_Timer; uint32 EventTimer;
uint32 checkPlayer_Timer; uint32 checkPlayerTimer;
uint64 PlayerGUID; uint64 PlayerGUID;
bool Event_onWait; bool EventOnWait;
void Reset() void Reset()
{ {
@@ -313,10 +313,10 @@ public:
{ {
Step = 0; Step = 0;
CurrWP = 0; CurrWP = 0;
Event_Timer = 0; EventTimer = 0;
PlayerGUID = 0; PlayerGUID = 0;
checkPlayer_Timer = 1000; checkPlayerTimer = 1000;
Event_onWait = false; EventOnWait = false;
} }
} }
@@ -347,8 +347,7 @@ public:
void EnterCombat(Unit* who) void EnterCombat(Unit* who)
{ {
uint32 rnd = rand()%2; switch (urand(0, 1))
switch (rnd)
{ {
case 0: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1, me, who); break; case 0: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1, me, who); break;
case 1: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2, me, who); break; case 1: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2, me, who); break;
@@ -357,9 +356,7 @@ public:
void StartEvent(Player* player) void StartEvent(Player* player)
{ {
if (!player) if (player && player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE)
return;
if (player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE)
{ {
for (uint8 i = 0; i < 41; ++i) for (uint8 i = 0; i < 41; ++i)
{ {
@@ -381,18 +378,18 @@ public:
return; return;
} }
if (!me->isInCombat() && !Event_onWait) if (!me->isInCombat() && !EventOnWait)
{ {
if (checkPlayer_Timer <= diff) if (checkPlayerTimer <= diff)
{ {
Player* player = Unit::GetPlayer(*me, PlayerGUID); Player* player = Unit::GetPlayer(*me, PlayerGUID);
if (player && player->isInCombat() && player->getAttackerForHelper()) if (player && player->isInCombat() && player->getAttackerForHelper())
AttackStart(player->getAttackerForHelper()); AttackStart(player->getAttackerForHelper());
checkPlayer_Timer = 1000; checkPlayerTimer = 1000;
} else checkPlayer_Timer -= diff; } else checkPlayerTimer -= diff;
} }
if (Event_onWait && Event_Timer <= diff) if (EventOnWait && EventTimer <= diff)
{ {
Player* player = Unit::GetPlayer(*me, PlayerGUID); Player* player = Unit::GetPlayer(*me, PlayerGUID);
@@ -409,11 +406,11 @@ public:
{ {
case 0: case 0:
me->Say(CLINTAR_SPIRIT_SAY_START, 0, PlayerGUID); me->Say(CLINTAR_SPIRIT_SAY_START, 0, PlayerGUID);
Event_Timer = 8000; EventTimer = 8000;
Step = 1; Step = 1;
break; break;
case 1: case 1:
Event_onWait = false; EventOnWait = false;
break; break;
} }
break; break;
@@ -422,13 +419,13 @@ public:
{ {
case 0: case 0:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
Event_Timer = 5000; EventTimer = 5000;
Step = 1; Step = 1;
break; break;
case 1: case 1:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
DoScriptText(CLINTAR_SPIRIT_SAY_GET_ONE, me, player); DoScriptText(CLINTAR_SPIRIT_SAY_GET_ONE, me, player);
Event_onWait = false; EventOnWait = false;
break; break;
} }
break; break;
@@ -437,12 +434,12 @@ public:
{ {
case 0: case 0:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
Event_Timer = 5000; EventTimer = 5000;
Step = 1; Step = 1;
break; break;
case 1: case 1:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
Event_onWait = false; EventOnWait = false;
break; break;
} }
break; break;
@@ -451,11 +448,11 @@ public:
{ {
case 0: case 0:
DoScriptText(CLINTAR_SPIRIT_SAY_GET_TWO, me, player); DoScriptText(CLINTAR_SPIRIT_SAY_GET_TWO, me, player);
Event_Timer = 15000; EventTimer = 15000;
Step = 1; Step = 1;
break; break;
case 1: case 1:
Event_onWait = false; EventOnWait = false;
break; break;
} }
break; break;
@@ -463,19 +460,16 @@ public:
switch (Step) switch (Step)
{ {
case 0: case 0:
{ if (Creature* mob = me->SummonCreature(ASPECT_RAVEN, AspectRavenSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
Creature* mob = me->SummonCreature(ASPECT_RAVEN, ASPECT_RAVEN_SUMMON_X, ASPECT_RAVEN_SUMMON_Y, ASPECT_RAVEN_SUMMON_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000);
if (mob)
{ {
mob->AddThreat(me, 10000.0f); mob->AddThreat(me, 10000.0f);
mob->AI()->AttackStart(me); mob->AI()->AttackStart(me);
} }
Event_Timer = 2000; EventTimer = 2000;
Step = 1; Step = 1;
break; break;
}
case 1: case 1:
Event_onWait = false; EventOnWait = false;
break; break;
} }
break; break;
@@ -484,12 +478,12 @@ public:
{ {
case 0: case 0:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
Event_Timer = 5000; EventTimer = 5000;
Step = 1; Step = 1;
break; break;
case 1: case 1:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
Event_onWait = false; EventOnWait = false;
break; break;
} }
break; break;
@@ -498,11 +492,11 @@ public:
{ {
case 0: case 0:
DoScriptText(CLINTAR_SPIRIT_SAY_GET_THREE, me, player); DoScriptText(CLINTAR_SPIRIT_SAY_GET_THREE, me, player);
Event_Timer = 4000; EventTimer = 4000;
Step = 1; Step = 1;
break; break;
case 1: case 1:
Event_onWait = false; EventOnWait = false;
break; break;
} }
break; break;
@@ -513,12 +507,12 @@ public:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2);
DoScriptText(CLINTAR_SPIRIT_SAY_GET_FINAL, me, player); DoScriptText(CLINTAR_SPIRIT_SAY_GET_FINAL, me, player);
player->CompleteQuest(10965); player->CompleteQuest(10965);
Event_Timer = 1500; EventTimer = 1500;
Step = 1; Step = 1;
break; break;
case 1: case 1:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
Event_Timer = 3000; EventTimer = 3000;
Step = 2; Step = 2;
break; break;
case 2: case 2:
@@ -530,19 +524,19 @@ public:
} }
break; break;
default: default:
Event_onWait = false; EventOnWait = false;
break; break;
} }
} else if (Event_onWait) Event_Timer -= diff; } else if (EventOnWait) EventTimer -= diff;
} }
void WaypointReached(uint32 waypointId) void WaypointReached(uint32 waypointId)
{ {
CurrWP = waypointId; CurrWP = waypointId;
Event_Timer = 0; EventTimer = 0;
Step = 0; Step = 0;
Event_onWait = true; EventOnWait = true;
} }
}; };
@@ -552,7 +546,10 @@ public:
# npc_clintar_dreamwalker # npc_clintar_dreamwalker
####*/ ####*/
#define CLINTAR_SPIRIT 22916 enum Clintar
{
CLINTAR_SPIRIT = 22916
};
class npc_clintar_dreamwalker : public CreatureScript class npc_clintar_dreamwalker : public CreatureScript
{ {
@@ -562,11 +559,8 @@ public:
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
{ {
if (quest->GetQuestId() == 10965) if (quest->GetQuestId() == 10965)
{ if (Creature* clintar_spirit = creature->SummonCreature(CLINTAR_SPIRIT, ClintarSpiritSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100000))
Creature* clintar_spirit = creature->SummonCreature(CLINTAR_SPIRIT, CLINTAR_SPIRIT_SUMMON_X, CLINTAR_SPIRIT_SUMMON_Y, CLINTAR_SPIRIT_SUMMON_Z, CLINTAR_SPIRIT_SUMMON_O, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100000);
if (clintar_spirit)
CAST_AI(npc_clintar_spirit::npc_clintar_spiritAI, clintar_spirit->AI())->StartEvent(player); CAST_AI(npc_clintar_spirit::npc_clintar_spiritAI, clintar_spirit->AI())->StartEvent(player);
}
return true; return true;
} }
+86 -85
View File
@@ -29,8 +29,9 @@ npc_kyle_frenzied
npc_plains_vision npc_plains_vision
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedEscortAI.h" #include "ScriptedCreature.h"
#include "ScriptedGossip.h"
/*###### /*######
# npc_skorn_whitecloud # npc_skorn_whitecloud
@@ -71,7 +72,7 @@ public:
# npc_kyle_frenzied # npc_kyle_frenzied
######*/ ######*/
enum eKyleFrenzied enum KyleFrenzied
{ {
//emote signed for 7780 but propably thats wrong id. //emote signed for 7780 but propably thats wrong id.
EMOTE_SEE_LUNCH = -1000340, EMOTE_SEE_LUNCH = -1000340,
@@ -98,30 +99,30 @@ public:
{ {
npc_kyle_frenziedAI(Creature* creature) : ScriptedAI(creature) {} npc_kyle_frenziedAI(Creature* creature) : ScriptedAI(creature) {}
bool bEvent; bool EventActive;
bool m_bIsMovingToLunch; bool IsMovingToLunch;
uint64 uiPlayerGUID; uint64 PlayerGUID;
uint32 uiEventTimer; uint32 EventTimer;
uint8 uiEventPhase; uint8 EventPhase;
void Reset() void Reset()
{ {
bEvent = false; EventActive = false;
m_bIsMovingToLunch = false; IsMovingToLunch = false;
uiPlayerGUID = 0; PlayerGUID = 0;
uiEventTimer = 5000; EventTimer = 5000;
uiEventPhase = 0; EventPhase = 0;
if (me->GetEntry() == NPC_KYLE_FRIENDLY) if (me->GetEntry() == NPC_KYLE_FRIENDLY)
me->UpdateEntry(NPC_KYLE_FRENZIED); me->UpdateEntry(NPC_KYLE_FRENZIED);
} }
void SpellHit(Unit* pCaster, SpellInfo const* pSpell) void SpellHit(Unit* Caster, SpellInfo const* Spell)
{ {
if (!me->getVictim() && !bEvent && pSpell->Id == SPELL_LUNCH) if (!me->getVictim() && !EventActive && Spell->Id == SPELL_LUNCH)
{ {
if (pCaster->GetTypeId() == TYPEID_PLAYER) if (Caster->GetTypeId() == TYPEID_PLAYER)
uiPlayerGUID = pCaster->GetGUID(); PlayerGUID = Caster->GetGUID();
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
{ {
@@ -130,41 +131,41 @@ public:
me->StopMoving(); me->StopMoving();
} }
bEvent = true; EventActive = true;
DoScriptText(EMOTE_SEE_LUNCH, me); DoScriptText(EMOTE_SEE_LUNCH, me);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CREATURE_SPECIAL); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CREATURE_SPECIAL);
} }
} }
void MovementInform(uint32 uiType, uint32 uiPointId) void MovementInform(uint32 Type, uint32 PointId)
{ {
if (uiType != POINT_MOTION_TYPE || !bEvent) if (Type != POINT_MOTION_TYPE || !EventActive)
return; return;
if (uiPointId == POINT_ID) if (PointId == POINT_ID)
m_bIsMovingToLunch = false; IsMovingToLunch = false;
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
{ {
if (bEvent) if (EventActive)
{ {
if (m_bIsMovingToLunch) if (IsMovingToLunch)
return; return;
if (uiEventTimer <= diff) if (EventTimer <= diff)
{ {
uiEventTimer = 5000; EventTimer = 5000;
++uiEventPhase; ++EventPhase;
switch (uiEventPhase) switch (EventPhase)
{ {
case 1: case 1:
if (Unit* unit = Unit::GetUnit(*me, uiPlayerGUID)) if (Unit* unit = Unit::GetUnit(*me, PlayerGUID))
{ {
if (GameObject* go = unit->GetGameObject(SPELL_LUNCH)) if (GameObject* go = unit->GetGameObject(SPELL_LUNCH))
{ {
m_bIsMovingToLunch = true; IsMovingToLunch = true;
me->GetMotionMaster()->MovePoint(POINT_ID, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ()); me->GetMotionMaster()->MovePoint(POINT_ID, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ());
} }
} }
@@ -174,13 +175,13 @@ public:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING);
break; break;
case 3: case 3:
if (Player* unit = Unit::GetPlayer(*me, uiPlayerGUID)) if (Player* unit = Unit::GetPlayer(*me, PlayerGUID))
unit->TalkedToCreature(me->GetEntry(), me->GetGUID()); unit->TalkedToCreature(me->GetEntry(), me->GetGUID());
me->UpdateEntry(NPC_KYLE_FRIENDLY); me->UpdateEntry(NPC_KYLE_FRIENDLY);
break; break;
case 4: case 4:
uiEventTimer = 30000; EventTimer = 30000;
DoScriptText(EMOTE_DANCE, me); DoScriptText(EMOTE_DANCE, me);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DANCESPECIAL); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DANCESPECIAL);
break; break;
@@ -192,7 +193,7 @@ public:
} }
} }
else else
uiEventTimer -= diff; EventTimer -= diff;
} }
} }
}; };
@@ -203,58 +204,58 @@ public:
# npc_plains_vision # npc_plains_vision
######*/ ######*/
float wp_plain_vision[50][3] = Position const wpPlainVision[50] =
{ {
{-2226.32f, -408.095f, -9.36235f}, {-2226.32f, -408.095f, -9.36235f, 0.0f},
{-2203.04f, -437.212f, -5.72498f}, {-2203.04f, -437.212f, -5.72498f, 0.0f},
{-2163.91f, -457.851f, -7.09049f}, {-2163.91f, -457.851f, -7.09049f, 0.0f},
{-2123.87f, -448.137f, -9.29591f}, {-2123.87f, -448.137f, -9.29591f, 0.0f},
{-2104.66f, -427.166f, -6.49513f}, {-2104.66f, -427.166f, -6.49513f, 0.0f},
{-2101.48f, -422.826f, -5.3567f}, {-2101.48f, -422.826f, -5.3567f, 0.0f},
{-2097.56f, -417.083f, -7.16716f}, {-2097.56f, -417.083f, -7.16716f, 0.0f},
{-2084.87f, -398.626f, -9.88973f}, {-2084.87f, -398.626f, -9.88973f, 0.0f},
{-2072.71f, -382.324f, -10.2488f}, {-2072.71f, -382.324f, -10.2488f, 0.0f},
{-2054.05f, -356.728f, -6.22468f}, {-2054.05f, -356.728f, -6.22468f, 0.0f},
{-2051.8f, -353.645f, -5.35791f}, {-2051.8f, -353.645f, -5.35791f, 0.0f},
{-2049.08f, -349.912f, -6.15723f}, {-2049.08f, -349.912f, -6.15723f, 0.0f},
{-2030.6f, -310.724f, -9.59302f}, {-2030.6f, -310.724f, -9.59302f, 0.0f},
{-2002.15f, -249.308f, -10.8124f}, {-2002.15f, -249.308f, -10.8124f, 0.0f},
{-1972.85f, -195.811f, -10.6316f}, {-1972.85f, -195.811f, -10.6316f, 0.0f},
{-1940.93f, -147.652f, -11.7055f}, {-1940.93f, -147.652f, -11.7055f, 0.0f},
{-1888.06f, -81.943f, -11.4404f}, {-1888.06f, -81.943f, -11.4404f, 0.0f},
{-1837.05f, -34.0109f, -12.258f}, {-1837.05f, -34.0109f, -12.258f, 0.0f},
{-1796.12f, -14.6462f, -10.3581f}, {-1796.12f, -14.6462f, -10.3581f, 0.0f},
{-1732.61f, -4.27746f, -10.0213f}, {-1732.61f, -4.27746f, -10.0213f, 0.0f},
{-1688.94f, -0.829945f, -11.7103f}, {-1688.94f, -0.829945f, -11.7103f, 0.0f},
{-1681.32f, 13.0313f, -9.48056f}, {-1681.32f, 13.0313f, -9.48056f, 0.0f},
{-1677.04f, 36.8349f, -7.10318f}, {-1677.04f, 36.8349f, -7.10318f, 0.0f},
{-1675.2f, 68.559f, -8.95384f}, {-1675.2f, 68.559f, -8.95384f, 0.0f},
{-1676.57f, 89.023f, -9.65104f}, {-1676.57f, 89.023f, -9.65104f, 0.0f},
{-1678.16f, 110.939f, -10.1782f}, {-1678.16f, 110.939f, -10.1782f, 0.0f},
{-1677.86f, 128.681f, -5.73869f}, {-1677.86f, 128.681f, -5.73869f, 0.0f},
{-1675.27f, 144.324f, -3.47916f}, {-1675.27f, 144.324f, -3.47916f, 0.0f},
{-1671.7f, 163.169f, -1.23098f}, {-1671.7f, 163.169f, -1.23098f, 0.0f},
{-1666.61f, 181.584f, 5.26145f}, {-1666.61f, 181.584f, 5.26145f, 0.0f},
{-1661.51f, 196.154f, 8.95252f}, {-1661.51f, 196.154f, 8.95252f, 0.0f},
{-1655.47f, 210.811f, 8.38727f}, {-1655.47f, 210.811f, 8.38727f, 0.0f},
{-1647.07f, 226.947f, 5.27755f}, {-1647.07f, 226.947f, 5.27755f, 0.0f},
{-1621.65f, 232.91f, 2.69579f}, {-1621.65f, 232.91f, 2.69579f, 0.0f},
{-1600.23f, 237.641f, 2.98539f}, {-1600.23f, 237.641f, 2.98539f, 0.0f},
{-1576.07f, 242.546f, 4.66541f}, {-1576.07f, 242.546f, 4.66541f, 0.0f},
{-1554.57f, 248.494f, 6.60377f}, {-1554.57f, 248.494f, 6.60377f, 0.0f},
{-1547.53f, 259.302f, 10.6741f}, {-1547.53f, 259.302f, 10.6741f, 0.0f},
{-1541.7f, 269.847f, 16.4418f}, {-1541.7f, 269.847f, 16.4418f, 0.0f},
{-1539.83f, 278.989f, 21.0597f}, {-1539.83f, 278.989f, 21.0597f, 0.0f},
{-1540.16f, 290.219f, 27.8247f}, {-1540.16f, 290.219f, 27.8247f, 0.0f},
{-1538.99f, 298.983f, 34.0032f}, {-1538.99f, 298.983f, 34.0032f, 0.0f},
{-1540.38f, 307.337f, 41.3557f}, {-1540.38f, 307.337f, 41.3557f, 0.0f},
{-1536.61f, 314.884f, 48.0179f}, {-1536.61f, 314.884f, 48.0179f, 0.0f},
{-1532.42f, 323.277f, 55.6667f}, {-1532.42f, 323.277f, 55.6667f, 0.0f},
{-1528.77f, 329.774f, 61.1525f}, {-1528.77f, 329.774f, 61.1525f, 0.0f},
{-1525.65f, 333.18f, 63.2161f}, {-1525.65f, 333.18f, 63.2161f, 0.0f},
{-1517.01f, 350.713f, 62.4286f}, {-1517.01f, 350.713f, 62.4286f, 0.0f},
{-1511.39f, 362.537f, 62.4539f}, {-1511.39f, 362.537f, 62.4539f, 0.0f},
{-1508.68f, 366.822f, 62.733f} {-1508.68f, 366.822f, 62.733f, 0.0f}
}; };
class npc_plains_vision : public CreatureScript class npc_plains_vision : public CreatureScript
@@ -305,7 +306,7 @@ public:
{ {
if (newWaypoint) if (newWaypoint)
{ {
me->GetMotionMaster()->MovePoint(WayPointId, wp_plain_vision[WayPointId][0], wp_plain_vision[WayPointId][1], wp_plain_vision[WayPointId][2]); me->GetMotionMaster()->MovePoint(WayPointId, wpPlainVision[WayPointId]);
newWaypoint = false; newWaypoint = false;
} }
} }
+29 -24
View File
@@ -28,13 +28,15 @@ npc_shenthul
npc_thrall_warchief npc_thrall_warchief
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
/*###### /*######
## npc_shenthul ## npc_shenthul
######*/ ######*/
enum eShenthul enum Shenthul
{ {
QUEST_SHATTERED_SALUTE = 2460 QUEST_SHATTERED_SALUTE = 2460
}; };
@@ -65,16 +67,16 @@ public:
bool CanTalk; bool CanTalk;
bool CanEmote; bool CanEmote;
uint32 Salute_Timer; uint32 SaluteTimer;
uint32 Reset_Timer; uint32 ResetTimer;
uint64 PlayerGUID; uint64 PlayerGUID;
void Reset() void Reset()
{ {
CanTalk = false; CanTalk = false;
CanEmote = false; CanEmote = false;
Salute_Timer = 6000; SaluteTimer = 6000;
Reset_Timer = 0; ResetTimer = 0;
PlayerGUID = 0; PlayerGUID = 0;
} }
@@ -84,7 +86,7 @@ public:
{ {
if (CanEmote) if (CanEmote)
{ {
if (Reset_Timer <= diff) if (ResetTimer <= diff)
{ {
if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) if (Player* player = Unit::GetPlayer(*me, PlayerGUID))
{ {
@@ -92,17 +94,17 @@ public:
player->FailQuest(QUEST_SHATTERED_SALUTE); player->FailQuest(QUEST_SHATTERED_SALUTE);
} }
Reset(); Reset();
} else Reset_Timer -= diff; } else ResetTimer -= diff;
} }
if (CanTalk && !CanEmote) if (CanTalk && !CanEmote)
{ {
if (Salute_Timer <= diff) if (SaluteTimer <= diff)
{ {
me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
CanEmote = true; CanEmote = true;
Reset_Timer = 60000; ResetTimer = 60000;
} else Salute_Timer -= diff; } else SaluteTimer -= diff;
} }
if (!UpdateVictim()) if (!UpdateVictim())
@@ -130,10 +132,13 @@ public:
## npc_thrall_warchief ## npc_thrall_warchief
######*/ ######*/
#define QUEST_6566 6566 enum ThrallWarchief
{
QUEST_6566 = 6566,
#define SPELL_CHAIN_LIGHTNING 16033 SPELL_CHAIN_LIGHTNING = 16033,
#define SPELL_SHOCK 16034 SPELL_SHOCK = 16034
};
#define GOSSIP_HTW "Please share your wisdom with me, Warchief." #define GOSSIP_HTW "Please share your wisdom with me, Warchief."
#define GOSSIP_STW1 "What discoveries?" #define GOSSIP_STW1 "What discoveries?"
@@ -207,13 +212,13 @@ public:
{ {
npc_thrall_warchiefAI(Creature* creature) : ScriptedAI(creature) {} npc_thrall_warchiefAI(Creature* creature) : ScriptedAI(creature) {}
uint32 ChainLightning_Timer; uint32 ChainLightningTimer;
uint32 Shock_Timer; uint32 ShockTimer;
void Reset() void Reset()
{ {
ChainLightning_Timer = 2000; ChainLightningTimer = 2000;
Shock_Timer = 8000; ShockTimer = 8000;
} }
void EnterCombat(Unit* /*who*/) {} void EnterCombat(Unit* /*who*/) {}
@@ -223,17 +228,17 @@ public:
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (ChainLightning_Timer <= diff) if (ChainLightningTimer <= diff)
{ {
DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING);
ChainLightning_Timer = 9000; ChainLightningTimer = 9000;
} else ChainLightning_Timer -= diff; } else ChainLightningTimer -= diff;
if (Shock_Timer <= diff) if (ShockTimer <= diff)
{ {
DoCast(me->getVictim(), SPELL_SHOCK); DoCast(me->getVictim(), SPELL_SHOCK);
Shock_Timer = 15000; ShockTimer = 15000;
} else Shock_Timer -= diff; } else ShockTimer -= diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
+13 -19
View File
@@ -29,7 +29,9 @@ npcs_rutgar_and_frankal
quest_a_pawn_on_the_eternal_pawn quest_a_pawn_on_the_eternal_pawn
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "Group.h" #include "Group.h"
/*### /*###
@@ -125,9 +127,11 @@ public:
#define GOSSIP_ITEM14 "I should ask the monkey about this" #define GOSSIP_ITEM14 "I should ask the monkey about this"
#define GOSSIP_ITEM15 "Then what..." #define GOSSIP_ITEM15 "Then what..."
//trigger creatures to kill enum RutgarAndFrankal //trigger creatures to kill
#define TRIGGER_RUTGAR 15222 {
#define TRIGGER_FRANKAL 15221 TRIGGER_FRANKAL = 15221,
TRIGGER_RUTGAR = 15222
};
class npcs_rutgar_and_frankal : public CreatureScript class npcs_rutgar_and_frankal : public CreatureScript
{ {
@@ -223,7 +227,7 @@ public:
/*#### /*####
# quest_a_pawn_on_the_eternal_board (Defines) # quest_a_pawn_on_the_eternal_board (Defines)
####*/ ####*/
enum eEternalBoard enum EternalBoard
{ {
QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519, QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519,
@@ -290,7 +294,6 @@ TO DO: get correct spell IDs and timings for spells cast upon dragon transformat
TO DO: Dragons should use the HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF) after transformation, but for some unknown reason it doesnt work. TO DO: Dragons should use the HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF) after transformation, but for some unknown reason it doesnt work.
EndContentData */ EndContentData */
#define QUEST_A_PAWN_ON_THE_ETERNAL_BOARD 8519
#define EVENT_AREA_RADIUS 65 //65yds #define EVENT_AREA_RADIUS 65 //65yds
#define EVENT_COOLDOWN 500000 //in ms. appear after event completed or failed (should be = Adds despawn time) #define EVENT_COOLDOWN 500000 //in ms. appear after event completed or failed (should be = Adds despawn time)
@@ -373,13 +376,8 @@ static QuestCinematic EventAnim[]=
{0, 0, 0} {0, 0, 0}
}; };
struct Location
{
float x, y, z, o;
};
//Cordinates for Spawns //Cordinates for Spawns
static Location SpawnLocation[]= Position const SpawnLocation[] =
{ {
{-8085.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry {-8085.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
{-8080.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry {-8080.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
@@ -460,7 +458,7 @@ struct WaveData
int32 WaveTextId; int32 WaveTextId;
}; };
static WaveData WavesInfo[] = static WaveData WavesInfo[5] =
{ {
{30, 0, 15423, 0, 0, 24000, 0}, // Kaldorei Soldier {30, 0, 15423, 0, 0, 24000, 0}, // Kaldorei Soldier
{ 3, 35, 15424, 0, 0, 24000, 0}, // Anubisath Conqueror { 3, 35, 15424, 0, 0, 24000, 0}, // Anubisath Conqueror
@@ -475,7 +473,7 @@ struct SpawnSpells
uint32 Timer1, Timer2, SpellId; uint32 Timer1, Timer2, SpellId;
}; };
static SpawnSpells SpawnCast[]=// static SpawnSpells SpawnCast[4] =
{ {
{100000, 2000, 33652}, // Stop Time {100000, 2000, 33652}, // Stop Time
{38500, 300000, 28528}, // Poison Cloud {38500, 300000, 28528}, // Poison Cloud
@@ -977,13 +975,9 @@ public:
for (uint8 i = locIndex; i <= count; ++i) for (uint8 i = locIndex; i <= count; ++i)
{ {
float x = SpawnLocation[i].x;
float y = SpawnLocation[i].y;
float z = SpawnLocation[i].z;
float o = SpawnLocation[i].o;
uint32 desptimer = WavesInfo[WaveCount].DespTimer; uint32 desptimer = WavesInfo[WaveCount].DespTimer;
if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, x, y, z, o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer)) if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, SpawnLocation[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer))
{ {
if (spawn->GetEntry() == 15423) if (spawn->GetEntry() == 15423)
spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15427+rand()%4); spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15427+rand()%4);
@@ -28,7 +28,9 @@ npc_braug_dimspirit
npc_kaya_flathoof npc_kaya_flathoof
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h" #include "ScriptedEscortAI.h"
/*###### /*######
@@ -90,7 +92,7 @@ public:
## npc_kaya_flathoof ## npc_kaya_flathoof
######*/ ######*/
enum eKaya enum Kaya
{ {
FACTION_ESCORTEE_H = 775, FACTION_ESCORTEE_H = 775,
+76 -72
View File
@@ -33,7 +33,9 @@ npc_OOX17
npc_tooga npc_tooga
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h" #include "ScriptedEscortAI.h"
#include "ScriptedFollowerAI.h" #include "ScriptedFollowerAI.h"
@@ -41,10 +43,13 @@ EndContentData */
## mob_aquementas ## mob_aquementas
######*/ ######*/
#define AGGRO_YELL_AQUE -1000350 enum Aquementas
{
AGGRO_YELL_AQUE = -1000350,
#define SPELL_AQUA_JET 13586 SPELL_AQUA_JET = 13586,
#define SPELL_FROST_SHOCK 15089 SPELL_FROST_SHOCK = 15089
};
class mob_aquementas : public CreatureScript class mob_aquementas : public CreatureScript
{ {
@@ -60,22 +65,22 @@ public:
{ {
mob_aquementasAI(Creature* creature) : ScriptedAI(creature) {} mob_aquementasAI(Creature* creature) : ScriptedAI(creature) {}
uint32 SendItem_Timer; uint32 SendItemTimer;
uint32 SwitchFaction_Timer; uint32 SwitchFactionTimer;
bool isFriendly; bool isFriendly;
uint32 FrostShock_Timer; uint32 FrostShockTimer;
uint32 AquaJet_Timer; uint32 AquaJetTimer;
void Reset() void Reset()
{ {
SendItem_Timer = 0; SendItemTimer = 0;
SwitchFaction_Timer = 10000; SwitchFactionTimer = 10000;
me->setFaction(35); me->setFaction(35);
isFriendly = true; isFriendly = true;
AquaJet_Timer = 5000; AquaJetTimer = 5000;
FrostShock_Timer = 1000; FrostShockTimer = 1000;
} }
void SendItem(Unit* receiver) void SendItem(Unit* receiver)
@@ -101,11 +106,11 @@ public:
{ {
if (isFriendly) if (isFriendly)
{ {
if (SwitchFaction_Timer <= diff) if (SwitchFactionTimer <= diff)
{ {
me->setFaction(91); me->setFaction(91);
isFriendly = false; isFriendly = false;
} else SwitchFaction_Timer -= diff; } else SwitchFactionTimer -= diff;
} }
if (!UpdateVictim()) if (!UpdateVictim())
@@ -113,25 +118,25 @@ public:
if (!isFriendly) if (!isFriendly)
{ {
if (SendItem_Timer <= diff) if (SendItemTimer <= diff)
{ {
if (me->getVictim()->GetTypeId() == TYPEID_PLAYER) if (me->getVictim()->GetTypeId() == TYPEID_PLAYER)
SendItem(me->getVictim()); SendItem(me->getVictim());
SendItem_Timer = 5000; SendItemTimer = 5000;
} else SendItem_Timer -= diff; } else SendItemTimer -= diff;
} }
if (FrostShock_Timer <= diff) if (FrostShockTimer <= diff)
{ {
DoCast(me->getVictim(), SPELL_FROST_SHOCK); DoCast(me->getVictim(), SPELL_FROST_SHOCK);
FrostShock_Timer = 15000; FrostShockTimer = 15000;
} else FrostShock_Timer -= diff; } else FrostShockTimer -= diff;
if (AquaJet_Timer <= diff) if (AquaJetTimer <= diff)
{ {
DoCast(me, SPELL_AQUA_JET); DoCast(me, SPELL_AQUA_JET);
AquaJet_Timer = 15000; AquaJetTimer = 15000;
} else AquaJet_Timer -= diff; } else AquaJetTimer -= diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
@@ -143,20 +148,23 @@ public:
## npc_custodian_of_time ## npc_custodian_of_time
######*/ ######*/
#define WHISPER_CUSTODIAN_1 -1000217 enum CustodianOfTime
#define WHISPER_CUSTODIAN_2 -1000218 {
#define WHISPER_CUSTODIAN_3 -1000219 WHISPER_CUSTODIAN_1 = -1000217,
#define WHISPER_CUSTODIAN_4 -1000220 WHISPER_CUSTODIAN_2 = -1000218,
#define WHISPER_CUSTODIAN_5 -1000221 WHISPER_CUSTODIAN_3 = -1000219,
#define WHISPER_CUSTODIAN_6 -1000222 WHISPER_CUSTODIAN_4 = -1000220,
#define WHISPER_CUSTODIAN_7 -1000223 WHISPER_CUSTODIAN_5 = -1000221,
#define WHISPER_CUSTODIAN_8 -1000224 WHISPER_CUSTODIAN_6 = -1000222,
#define WHISPER_CUSTODIAN_9 -1000225 WHISPER_CUSTODIAN_7 = -1000223,
#define WHISPER_CUSTODIAN_10 -1000226 WHISPER_CUSTODIAN_8 = -1000224,
#define WHISPER_CUSTODIAN_11 -1000227 WHISPER_CUSTODIAN_9 = -1000225,
#define WHISPER_CUSTODIAN_12 -1000228 WHISPER_CUSTODIAN_10 = -1000226,
#define WHISPER_CUSTODIAN_13 -1000229 WHISPER_CUSTODIAN_11 = -1000227,
#define WHISPER_CUSTODIAN_14 -1000230 WHISPER_CUSTODIAN_12 = -1000228,
WHISPER_CUSTODIAN_13 = -1000229,
WHISPER_CUSTODIAN_14 = -1000230
};
class npc_custodian_of_time : public CreatureScript class npc_custodian_of_time : public CreatureScript
{ {
@@ -174,10 +182,8 @@ public:
void WaypointReached(uint32 waypointId) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); if (Player* player = GetPlayerForEscort())
if (!player) {
return;
switch (waypointId) switch (waypointId)
{ {
case 0: case 0:
@@ -239,6 +245,7 @@ public:
break; break;
} }
} }
}
void MoveInLineOfSight(Unit* who) void MoveInLineOfSight(Unit* who)
{ {
@@ -416,7 +423,7 @@ public:
## npc_OOX17 ## npc_OOX17
######*/ ######*/
enum e00X17 enum Npc00X17
{ {
//texts are signed for 7806 //texts are signed for 7806
SAY_OOX_START = -1000287, SAY_OOX_START = -1000287,
@@ -464,10 +471,8 @@ public:
void WaypointReached(uint32 waypointId) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); if (Player* player = GetPlayerForEscort())
if (!player) {
return;
switch (waypointId) switch (waypointId)
{ {
case 23: case 23:
@@ -490,6 +495,7 @@ public:
break; break;
} }
} }
}
void Reset(){} void Reset(){}
@@ -509,7 +515,7 @@ public:
# npc_tooga # npc_tooga
####*/ ####*/
enum eTooga enum Tooga
{ {
SAY_TOOG_THIRST = -1000391, SAY_TOOG_THIRST = -1000391,
SAY_TOOG_WORRIED = -1000392, SAY_TOOG_WORRIED = -1000392,
@@ -527,7 +533,7 @@ enum eTooga
FACTION_TOOG_ESCORTEE = 113 FACTION_TOOG_ESCORTEE = 113
}; };
const float m_afToWaterLoc[] = {-7032.664551f, -4906.199219f, -1.606446f}; Position const ToWaterLoc = {-7032.664551f, -4906.199219f, -1.606446f, 0.0f};
class npc_tooga : public CreatureScript class npc_tooga : public CreatureScript
{ {
@@ -554,17 +560,17 @@ public:
{ {
npc_toogaAI(Creature* creature) : FollowerAI(creature) { } npc_toogaAI(Creature* creature) : FollowerAI(creature) { }
uint32 m_uiCheckSpeechTimer; uint32 CheckSpeechTimer;
uint32 m_uiPostEventTimer; uint32 PostEventTimer;
uint32 m_uiPhasePostEvent; uint32 PhasePostEvent;
uint64 TortaGUID; uint64 TortaGUID;
void Reset() void Reset()
{ {
m_uiCheckSpeechTimer = 2500; CheckSpeechTimer = 2500;
m_uiPostEventTimer = 1000; PostEventTimer = 1000;
m_uiPhasePostEvent = 0; PhasePostEvent = 0;
TortaGUID = 0; TortaGUID = 0;
} }
@@ -577,11 +583,9 @@ public:
{ {
if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE)) if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE))
{ {
if (Player* player = GetLeaderForFollower()) Player* player = GetLeaderForFollower();
{ if (player && player->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE)
if (player->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE)
player->GroupEventHappens(QUEST_TOOGA, me); player->GroupEventHappens(QUEST_TOOGA, me);
}
TortaGUID = who->GetGUID(); TortaGUID = who->GetGUID();
SetFollowComplete(true); SetFollowComplete(true);
@@ -589,27 +593,27 @@ public:
} }
} }
void MovementInform(uint32 uiMotionType, uint32 uiPointId) void MovementInform(uint32 MotionType, uint32 PointId)
{ {
FollowerAI::MovementInform(uiMotionType, uiPointId); FollowerAI::MovementInform(MotionType, PointId);
if (uiMotionType != POINT_MOTION_TYPE) if (MotionType != POINT_MOTION_TYPE)
return; return;
if (uiPointId == POINT_ID_TO_WATER) if (PointId == POINT_ID_TO_WATER)
SetFollowComplete(); SetFollowComplete();
} }
void UpdateFollowerAI(const uint32 uiDiff) void UpdateFollowerAI(const uint32 Diff)
{ {
if (!UpdateVictim()) if (!UpdateVictim())
{ {
//we are doing the post-event, or... //we are doing the post-event, or...
if (HasFollowState(STATE_FOLLOW_POSTEVENT)) if (HasFollowState(STATE_FOLLOW_POSTEVENT))
{ {
if (m_uiPostEventTimer <= uiDiff) if (PostEventTimer <= Diff)
{ {
m_uiPostEventTimer = 5000; PostEventTimer = 5000;
Unit* pTorta = Unit::GetUnit(*me, TortaGUID); Unit* pTorta = Unit::GetUnit(*me, TortaGUID);
if (!pTorta || !pTorta->isAlive()) if (!pTorta || !pTorta->isAlive())
@@ -619,7 +623,7 @@ public:
return; return;
} }
switch (m_uiPhasePostEvent) switch (PhasePostEvent)
{ {
case 1: case 1:
DoScriptText(SAY_TOOG_POST_1, me); DoScriptText(SAY_TOOG_POST_1, me);
@@ -638,27 +642,27 @@ public:
break; break;
case 6: case 6:
DoScriptText(SAY_TORT_POST_6, pTorta); DoScriptText(SAY_TORT_POST_6, pTorta);
me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, m_afToWaterLoc[0], m_afToWaterLoc[1], m_afToWaterLoc[2]); me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, ToWaterLoc);
break; break;
} }
++m_uiPhasePostEvent; ++PhasePostEvent;
} }
else else
m_uiPostEventTimer -= uiDiff; PostEventTimer -= Diff;
} }
//...we are doing regular speech check //...we are doing regular speech check
else if (HasFollowState(STATE_FOLLOW_INPROGRESS)) else if (HasFollowState(STATE_FOLLOW_INPROGRESS))
{ {
if (m_uiCheckSpeechTimer <= uiDiff) if (CheckSpeechTimer <= Diff)
{ {
m_uiCheckSpeechTimer = 5000; CheckSpeechTimer = 5000;
if (urand(0, 9) > 8) if (urand(0, 9) > 8)
DoScriptText(RAND(SAY_TOOG_THIRST, SAY_TOOG_WORRIED), me); DoScriptText(RAND(SAY_TOOG_THIRST, SAY_TOOG_WORRIED), me);
} }
else else
m_uiCheckSpeechTimer -= uiDiff; CheckSpeechTimer -= Diff;
} }
return; return;
+6 -9
View File
@@ -27,14 +27,15 @@ EndScriptData */
npc_mist npc_mist
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedFollowerAI.h" #include "ScriptedFollowerAI.h"
/*#### /*####
# npc_mist # npc_mist
####*/ ####*/
enum eMist enum Mist
{ {
SAY_AT_HOME = -1000323, SAY_AT_HOME = -1000323,
EMOTE_AT_HOME = -1000324, EMOTE_AT_HOME = -1000324,
@@ -51,10 +52,8 @@ public:
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
{ {
if (quest->GetQuestId() == QUEST_MIST) if (quest->GetQuestId() == QUEST_MIST)
{
if (npc_mistAI* pMistAI = CAST_AI(npc_mist::npc_mistAI, creature->AI())) if (npc_mistAI* pMistAI = CAST_AI(npc_mist::npc_mistAI, creature->AI()))
pMistAI->StartFollow(player, FACTION_DARNASSUS, quest); pMistAI->StartFollow(player, FACTION_DARNASSUS, quest);
}
return true; return true;
} }
@@ -88,18 +87,16 @@ public:
{ {
DoScriptText(EMOTE_AT_HOME, me); DoScriptText(EMOTE_AT_HOME, me);
if (Player* player = GetLeaderForFollower()) Player* player = GetLeaderForFollower();
{ if (player && player->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE)
if (player->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE)
player->GroupEventHappens(QUEST_MIST, me); player->GroupEventHappens(QUEST_MIST, me);
}
//The follow is over (and for later development, run off to the woods before really end) //The follow is over (and for later development, run off to the woods before really end)
SetFollowComplete(); SetFollowComplete();
} }
//call not needed here, no known abilities //call not needed here, no known abilities
/*void UpdateFollowerAI(const uint32 uiDiff) /*void UpdateFollowerAI(const uint32 Diff)
{ {
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
+51 -49
View File
@@ -32,7 +32,9 @@ npc_twiggy_flathead
npc_wizzlecrank_shredder npc_wizzlecrank_shredder
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h" #include "ScriptedEscortAI.h"
/*###### /*######
@@ -41,7 +43,7 @@ EndContentData */
#define GOSSIP_CORPSE "Examine corpse in detail..." #define GOSSIP_CORPSE "Examine corpse in detail..."
enum eQuests enum BeatenCorpse
{ {
QUEST_LOST_IN_BATTLE = 4921 QUEST_LOST_IN_BATTLE = 4921
}; };
@@ -77,7 +79,7 @@ public:
# npc_gilthares # npc_gilthares
######*/ ######*/
enum eGilthares enum Gilthares
{ {
SAY_GIL_START = -1000370, SAY_GIL_START = -1000370,
SAY_GIL_AT_LAST = -1000371, SAY_GIL_AT_LAST = -1000371,
@@ -214,7 +216,7 @@ public:
## npc_taskmaster_fizzule ## npc_taskmaster_fizzule
######*/ ######*/
enum eEnums enum TaskmasterFizzule
{ {
FACTION_FRIENDLY_F = 35, FACTION_FRIENDLY_F = 35,
SPELL_FLARE = 10113, SPELL_FLARE = 10113,
@@ -240,13 +242,13 @@ public:
uint32 factionNorm; uint32 factionNorm;
bool IsFriend; bool IsFriend;
uint32 Reset_Timer; uint32 ResetTimer;
uint8 FlareCount; uint8 FlareCount;
void Reset() void Reset()
{ {
IsFriend = false; IsFriend = false;
Reset_Timer = 120000; ResetTimer = 120000;
FlareCount = 0; FlareCount = 0;
me->setFaction(factionNorm); me->setFaction(factionNorm);
} }
@@ -281,11 +283,11 @@ public:
{ {
if (IsFriend) if (IsFriend)
{ {
if (Reset_Timer <= diff) if (ResetTimer <= diff)
{ {
EnterEvadeMode(); EnterEvadeMode();
return; return;
} else Reset_Timer -= diff; } else ResetTimer -= diff;
} }
if (!UpdateVictim()) if (!UpdateVictim())
@@ -315,7 +317,7 @@ public:
## npc_twiggy_flathead ## npc_twiggy_flathead
#####*/ #####*/
enum eTwiggyFlathead enum TwiggyFlathead
{ {
NPC_BIG_WILL = 6238, NPC_BIG_WILL = 6238,
NPC_AFFRAY_CHALLENGER = 6240, NPC_AFFRAY_CHALLENGER = 6240,
@@ -327,7 +329,7 @@ enum eTwiggyFlathead
SAY_TWIGGY_FLATHEAD_OVER = -1000127, SAY_TWIGGY_FLATHEAD_OVER = -1000127,
}; };
float AffrayChallengerLoc[6][4]= Position const AffrayChallengerLoc[6] =
{ {
{-1683.0f, -4326.0f, 2.79f, 0.0f}, {-1683.0f, -4326.0f, 2.79f, 0.0f},
{-1682.0f, -4329.0f, 2.79f, 0.0f}, {-1682.0f, -4329.0f, 2.79f, 0.0f},
@@ -354,10 +356,10 @@ public:
bool EventInProgress; bool EventInProgress;
bool EventGrate; bool EventGrate;
bool EventBigWill; bool EventBigWill;
bool Challenger_down[6]; bool ChallengerDown[6];
uint32 Wave; uint8 Wave;
uint32 Wave_Timer; uint32 WaveTimer;
uint32 Challenger_checker; uint32 ChallengerChecker;
uint64 PlayerGUID; uint64 PlayerGUID;
uint64 AffrayChallenger[6]; uint64 AffrayChallenger[6];
uint64 BigWill; uint64 BigWill;
@@ -367,15 +369,15 @@ public:
EventInProgress = false; EventInProgress = false;
EventGrate = false; EventGrate = false;
EventBigWill = false; EventBigWill = false;
Wave_Timer = 600000; WaveTimer = 600000;
Challenger_checker = 0; ChallengerChecker = 0;
Wave = 0; Wave = 0;
PlayerGUID = 0; PlayerGUID = 0;
for (uint8 i = 0; i < 6; ++i) for (uint8 i = 0; i < 6; ++i)
{ {
AffrayChallenger[i] = 0; AffrayChallenger[i] = 0;
Challenger_down[i] = false; ChallengerDown[i] = false;
} }
BigWill = 0; BigWill = 0;
} }
@@ -441,7 +443,7 @@ public:
for (uint8 i = 0; i < 6; ++i) for (uint8 i = 0; i < 6; ++i)
{ {
Creature* creature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); Creature* creature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
if (!creature) if (!creature)
continue; continue;
creature->setFaction(35); creature->setFaction(35);
@@ -450,31 +452,31 @@ public:
creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
AffrayChallenger[i] = creature->GetGUID(); AffrayChallenger[i] = creature->GetGUID();
} }
Wave_Timer = 5000; WaveTimer = 5000;
Challenger_checker = 1000; ChallengerChecker = 1000;
EventGrate = true; EventGrate = true;
} }
} }
else if (EventInProgress) else if (EventInProgress)
{ {
if (Challenger_checker <= diff) if (ChallengerChecker <= diff)
{ {
for (uint8 i = 0; i < 6; ++i) for (uint8 i = 0; i < 6; ++i)
{ {
if (AffrayChallenger[i]) if (AffrayChallenger[i])
{ {
Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]); Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]);
if ((!creature || (!creature->isAlive())) && !Challenger_down[i]) if ((!creature || (!creature->isAlive())) && !ChallengerDown[i])
{ {
DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me); DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me);
Challenger_down[i] = true; ChallengerDown[i] = true;
} }
} }
} }
Challenger_checker = 1000; ChallengerChecker = 1000;
} else Challenger_checker -= diff; } else ChallengerChecker -= diff;
if (Wave_Timer <= diff) if (WaveTimer <= diff)
{ {
if (Wave < 6 && AffrayChallenger[Wave] && !EventBigWill) if (Wave < 6 && AffrayChallenger[Wave] && !EventBigWill)
{ {
@@ -488,7 +490,7 @@ public:
creature->setFaction(14); creature->setFaction(14);
creature->AI()->AttackStart(pWarrior); creature->AI()->AttackStart(pWarrior);
++Wave; ++Wave;
Wave_Timer = 20000; WaveTimer = 20000;
} }
} }
else if (Wave >= 6 && !EventBigWill) { else if (Wave >= 6 && !EventBigWill) {
@@ -500,7 +502,7 @@ public:
creature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79f); creature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79f);
creature->HandleEmoteCommand(EMOTE_STATE_READY_UNARMED); creature->HandleEmoteCommand(EMOTE_STATE_READY_UNARMED);
EventBigWill = true; EventBigWill = true;
Wave_Timer = 1000; WaveTimer = 1000;
} }
} }
else if (Wave >= 6 && EventBigWill && BigWill) else if (Wave >= 6 && EventBigWill && BigWill)
@@ -512,7 +514,7 @@ public:
Reset(); Reset();
} }
} }
} else Wave_Timer -= diff; } else WaveTimer -= diff;
} }
} }
} }
@@ -524,7 +526,7 @@ public:
## npc_wizzlecrank_shredder ## npc_wizzlecrank_shredder
#####*/ #####*/
enum eEnums_Wizzlecrank enum Wizzlecrank
{ {
SAY_START = -1000298, SAY_START = -1000298,
SAY_STARTUP1 = -1000299, SAY_STARTUP1 = -1000299,
@@ -550,14 +552,14 @@ public:
{ {
npc_wizzlecrank_shredderAI(Creature* creature) : npc_escortAI(creature) npc_wizzlecrank_shredderAI(Creature* creature) : npc_escortAI(creature)
{ {
m_bIsPostEvent = false; IsPostEvent = false;
m_uiPostEventTimer = 1000; PostEventTimer = 1000;
m_uiPostEventCount = 0; PostEventCount = 0;
} }
bool m_bIsPostEvent; bool IsPostEvent;
uint32 m_uiPostEventTimer; uint32 PostEventTimer;
uint32 m_uiPostEventCount; uint32 PostEventCount;
void Reset() void Reset()
{ {
@@ -566,9 +568,9 @@ public:
if (me->getStandState() == UNIT_STAND_STATE_DEAD) if (me->getStandState() == UNIT_STAND_STATE_DEAD)
me->SetStandState(UNIT_STAND_STATE_STAND); me->SetStandState(UNIT_STAND_STATE_STAND);
m_bIsPostEvent = false; IsPostEvent = false;
m_uiPostEventTimer = 1000; PostEventTimer = 1000;
m_uiPostEventCount = 0; PostEventCount = 0;
} }
} }
@@ -590,19 +592,19 @@ public:
} }
break; break;
case 24: case 24:
m_bIsPostEvent = true; IsPostEvent = true;
break; break;
} }
} }
void WaypointStart(uint32 uiPointId) void WaypointStart(uint32 PointId)
{ {
Player* player = GetPlayerForEscort(); Player* player = GetPlayerForEscort();
if (!player) if (!player)
return; return;
switch (uiPointId) switch (PointId)
{ {
case 9: case 9:
DoScriptText(SAY_STARTUP2, me, player); DoScriptText(SAY_STARTUP2, me, player);
@@ -623,15 +625,15 @@ public:
summoned->AI()->AttackStart(me); summoned->AI()->AttackStart(me);
} }
void UpdateEscortAI(const uint32 uiDiff) void UpdateEscortAI(const uint32 Diff)
{ {
if (!UpdateVictim()) if (!UpdateVictim())
{ {
if (m_bIsPostEvent) if (IsPostEvent)
{ {
if (m_uiPostEventTimer <= uiDiff) if (PostEventTimer <= Diff)
{ {
switch (m_uiPostEventCount) switch (PostEventCount)
{ {
case 0: case 0:
DoScriptText(SAY_PROGRESS_2, me); DoScriptText(SAY_PROGRESS_2, me);
@@ -651,11 +653,11 @@ public:
break; break;
} }
++m_uiPostEventCount; ++PostEventCount;
m_uiPostEventTimer = 5000; PostEventTimer = 5000;
} }
else else
m_uiPostEventTimer -= uiDiff; PostEventTimer -= Diff;
} }
return; return;
@@ -32,14 +32,16 @@ npc_enraged_panther
go_panther_cage go_panther_cage
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h" #include "ScriptedEscortAI.h"
/*##### /*#####
# npc_kanati # npc_kanati
######*/ ######*/
enum eKanati enum Kanati
{ {
SAY_KAN_START = -1000410, SAY_KAN_START = -1000410,
@@ -47,7 +49,7 @@ enum eKanati
NPC_GALAK_ASS = 10720 NPC_GALAK_ASS = 10720
}; };
const float m_afGalakLoc[]= {-4867.387695f, -1357.353760f, -48.226f }; Position const GalakLoc = {-4867.387695f, -1357.353760f, -48.226f, 0.0f};
class npc_kanati : public CreatureScript class npc_kanati : public CreatureScript
{ {
@@ -57,10 +59,9 @@ public:
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
{ {
if (quest->GetQuestId() == QUEST_PROTECT_KANATI) if (quest->GetQuestId() == QUEST_PROTECT_KANATI)
{
if (npc_kanatiAI* pEscortAI = CAST_AI(npc_kanati::npc_kanatiAI, creature->AI())) if (npc_kanatiAI* pEscortAI = CAST_AI(npc_kanati::npc_kanatiAI, creature->AI()))
pEscortAI->Start(false, false, player->GetGUID(), quest, true); pEscortAI->Start(false, false, player->GetGUID(), quest, true);
}
return true; return true;
} }
@@ -93,9 +94,7 @@ public:
void DoSpawnGalak() void DoSpawnGalak()
{ {
for (int i = 0; i < 3; ++i) for (int i = 0; i < 3; ++i)
me->SummonCreature(NPC_GALAK_ASS, me->SummonCreature(NPC_GALAK_ASS, GalakLoc, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
m_afGalakLoc[0], m_afGalakLoc[1], m_afGalakLoc[2], 0.0f,
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
} }
void JustSummoned(Creature* summoned) void JustSummoned(Creature* summoned)
@@ -110,7 +109,7 @@ public:
# npc_lakota_windsong # npc_lakota_windsong
######*/ ######*/
enum eLakota enum Lakota
{ {
SAY_LAKO_START = -1000365, SAY_LAKO_START = -1000365,
SAY_LAKO_LOOK_OUT = -1000366, SAY_LAKO_LOOK_OUT = -1000366,
@@ -127,14 +126,14 @@ enum eLakota
ID_AMBUSH_3 = 4 ID_AMBUSH_3 = 4
}; };
float m_afBanditLoc[6][6]= Position const BanditLoc[6] =
{ {
{-4905.479492f, -2062.732666f, 84.352f}, {-4905.479492f, -2062.732666f, 84.352f, 0.0f},
{-4915.201172f, -2073.528320f, 84.733f}, {-4915.201172f, -2073.528320f, 84.733f, 0.0f},
{-4878.883301f, -1986.947876f, 91.966f}, {-4878.883301f, -1986.947876f, 91.966f, 0.0f},
{-4877.503906f, -1966.113403f, 91.859f}, {-4877.503906f, -1966.113403f, 91.859f, 0.0f},
{-4767.985352f, -1873.169189f, 90.192f}, {-4767.985352f, -1873.169189f, 90.192f, 0.0f},
{-4788.861328f, -1888.007813f, 89.888f} {-4788.861328f, -1888.007813f, 89.888f, 0.0f}
}; };
class npc_lakota_windsong : public CreatureScript class npc_lakota_windsong : public CreatureScript
@@ -189,12 +188,10 @@ public:
} }
} }
void DoSpawnBandits(int uiAmbushId) void DoSpawnBandits(int AmbushId)
{ {
for (int i = 0; i < 2; ++i) for (int i = 0; i < 2; ++i)
me->SummonCreature(NPC_GRIM_BANDIT, me->SummonCreature(NPC_GRIM_BANDIT, BanditLoc[i+AmbushId], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
m_afBanditLoc[i+uiAmbushId][0], m_afBanditLoc[i+uiAmbushId][1], m_afBanditLoc[i+uiAmbushId][2], 0.0f,
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
} }
}; };
@@ -204,7 +201,7 @@ public:
# npc_paoka_swiftmountain # npc_paoka_swiftmountain
######*/ ######*/
enum ePacka enum Packa
{ {
SAY_START = -1000362, SAY_START = -1000362,
SAY_WYVERN = -1000363, SAY_WYVERN = -1000363,
@@ -215,11 +212,11 @@ enum ePacka
FACTION_ESCORTEE = 232 //guessed FACTION_ESCORTEE = 232 //guessed
}; };
float m_afWyvernLoc[3][3]= Position const WyvernLoc[3] =
{ {
{-4990.606f, -906.057f, -5.343f}, {-4990.606f, -906.057f, -5.343f, 0.0f},
{-4970.241f, -927.378f, -4.951f}, {-4970.241f, -927.378f, -4.951f, 0.0f},
{-4985.364f, -952.528f, -5.199f} {-4985.364f, -952.528f, -5.199f, 0.0f}
}; };
class npc_paoka_swiftmountain : public CreatureScript class npc_paoka_swiftmountain : public CreatureScript
@@ -272,9 +269,7 @@ public:
void DoSpawnWyvern() void DoSpawnWyvern()
{ {
for (int i = 0; i < 3; ++i) for (int i = 0; i < 3; ++i)
me->SummonCreature(NPC_WYVERN, me->SummonCreature(NPC_WYVERN, WyvernLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
m_afWyvernLoc[i][0], m_afWyvernLoc[i][1], m_afWyvernLoc[i][2], 0.0f,
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
} }
}; };
}; };
@@ -285,7 +280,7 @@ public:
#define GOSSIP_P "Please tell me the Phrase.." #define GOSSIP_P "Please tell me the Phrase.."
enum ePlucky enum Plucky
{ {
FACTION_FRIENDLY = 35, FACTION_FRIENDLY = 35,
QUEST_SCOOP = 1950, QUEST_SCOOP = 1950,
@@ -328,17 +323,17 @@ public:
struct npc_pluckyAI : public ScriptedAI struct npc_pluckyAI : public ScriptedAI
{ {
npc_pluckyAI(Creature* creature) : ScriptedAI(creature) { m_uiNormFaction = creature->getFaction(); } npc_pluckyAI(Creature* creature) : ScriptedAI(creature) { NormFaction = creature->getFaction(); }
uint32 m_uiNormFaction; uint32 NormFaction;
uint32 m_uiResetTimer; uint32 ResetTimer;
void Reset() void Reset()
{ {
m_uiResetTimer = 120000; ResetTimer = 120000;
if (me->getFaction() != m_uiNormFaction) if (me->getFaction() != NormFaction)
me->setFaction(m_uiNormFaction); me->setFaction(NormFaction);
if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
@@ -346,11 +341,11 @@ public:
DoCast(me, SPELL_PLUCKY_CHICKEN, false); DoCast(me, SPELL_PLUCKY_CHICKEN, false);
} }
void ReceiveEmote(Player* player, uint32 uiTextEmote) void ReceiveEmote(Player* player, uint32 TextEmote)
{ {
if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE)
{ {
if (uiTextEmote == TEXT_EMOTE_BECKON) if (TextEmote == TEXT_EMOTE_BECKON)
{ {
me->setFaction(FACTION_FRIENDLY); me->setFaction(FACTION_FRIENDLY);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
@@ -358,7 +353,7 @@ public:
} }
} }
if (uiTextEmote == TEXT_EMOTE_CHICKEN) if (TextEmote == TEXT_EMOTE_CHICKEN)
{ {
if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
return; return;
@@ -372,11 +367,11 @@ public:
} }
} }
void UpdateAI(const uint32 uiDiff) void UpdateAI(const uint32 Diff)
{ {
if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
{ {
if (m_uiResetTimer <= uiDiff) if (ResetTimer <= Diff)
{ {
if (!me->getVictim()) if (!me->getVictim())
EnterEvadeMode(); EnterEvadeMode();
@@ -386,7 +381,7 @@ public:
return; return;
} }
else else
m_uiResetTimer -= uiDiff; ResetTimer -= Diff;
} }
if (!UpdateVictim()) if (!UpdateVictim())
@@ -398,7 +393,7 @@ public:
}; };
enum ePantherCage enum PantherCage
{ {
ENRAGED_PANTHER = 10992 ENRAGED_PANTHER = 10992
}; };
+36 -31
View File
@@ -23,17 +23,22 @@ SDComment: Quest support: 925
SDCategory: Thunder Bluff SDCategory: Thunder Bluff
EndScriptData */ EndScriptData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
/*##### /*#####
# npc_cairne_bloodhoof # npc_cairne_bloodhoof
######*/ ######*/
#define SPELL_BERSERKER_CHARGE 16636 enum CairneBloodhoof
#define SPELL_CLEAVE 16044 {
#define SPELL_MORTAL_STRIKE 16856 SPELL_BERSERKER_CHARGE = 16636,
#define SPELL_THUNDERCLAP 23931 SPELL_CLEAVE = 16044,
#define SPELL_UPPERCUT 22916 SPELL_MORTAL_STRIKE = 16856,
SPELL_THUNDERCLAP = 23931,
SPELL_UPPERCUT = 22916
};
#define GOSSIP_HCB "I know this is rather silly but a young ward who is a bit shy would like your hoofprint." #define GOSSIP_HCB "I know this is rather silly but a young ward who is a bit shy would like your hoofprint."
//TODO: verify abilities/timers //TODO: verify abilities/timers
@@ -75,19 +80,19 @@ public:
{ {
npc_cairne_bloodhoofAI(Creature* creature) : ScriptedAI(creature) {} npc_cairne_bloodhoofAI(Creature* creature) : ScriptedAI(creature) {}
uint32 BerserkerCharge_Timer; uint32 BerserkerChargeTimer;
uint32 Cleave_Timer; uint32 CleaveTimer;
uint32 MortalStrike_Timer; uint32 MortalStrikeTimer;
uint32 Thunderclap_Timer; uint32 ThunderclapTimer;
uint32 Uppercut_Timer; uint32 UppercutTimer;
void Reset() void Reset()
{ {
BerserkerCharge_Timer = 30000; BerserkerChargeTimer = 30000;
Cleave_Timer = 5000; CleaveTimer = 5000;
MortalStrike_Timer = 10000; MortalStrikeTimer = 10000;
Thunderclap_Timer = 15000; ThunderclapTimer = 15000;
Uppercut_Timer = 10000; UppercutTimer = 10000;
} }
void EnterCombat(Unit* /*who*/) {} void EnterCombat(Unit* /*who*/) {}
@@ -97,37 +102,37 @@ public:
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (BerserkerCharge_Timer <= diff) if (BerserkerChargeTimer <= diff)
{ {
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target) if (target)
DoCast(target, SPELL_BERSERKER_CHARGE); DoCast(target, SPELL_BERSERKER_CHARGE);
BerserkerCharge_Timer = 25000; BerserkerChargeTimer = 25000;
} else BerserkerCharge_Timer -= diff; } else BerserkerChargeTimer -= diff;
if (Uppercut_Timer <= diff) if (UppercutTimer <= diff)
{ {
DoCast(me->getVictim(), SPELL_UPPERCUT); DoCast(me->getVictim(), SPELL_UPPERCUT);
Uppercut_Timer = 20000; UppercutTimer = 20000;
} else Uppercut_Timer -= diff; } else UppercutTimer -= diff;
if (Thunderclap_Timer <= diff) if (ThunderclapTimer <= diff)
{ {
DoCast(me->getVictim(), SPELL_THUNDERCLAP); DoCast(me->getVictim(), SPELL_THUNDERCLAP);
Thunderclap_Timer = 15000; ThunderclapTimer = 15000;
} else Thunderclap_Timer -= diff; } else ThunderclapTimer -= diff;
if (MortalStrike_Timer <= diff) if (MortalStrikeTimer <= diff)
{ {
DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
MortalStrike_Timer = 15000; MortalStrikeTimer = 15000;
} else MortalStrike_Timer -= diff; } else MortalStrikeTimer -= diff;
if (Cleave_Timer <= diff) if (CleaveTimer <= diff)
{ {
DoCast(me->getVictim(), SPELL_CLEAVE); DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000; CleaveTimer = 7000;
} else Cleave_Timer -= diff; } else CleaveTimer -= diff;
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
+35 -38
View File
@@ -28,11 +28,12 @@ npc_a-me
npc_ringo npc_ringo
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h" #include "ScriptedEscortAI.h"
#include "ScriptedFollowerAI.h" #include "ScriptedFollowerAI.h"
enum eAMeData enum AmeData
{ {
SAY_READY = -1000517, SAY_READY = -1000517,
SAY_AGGRO1 = -1000518, SAY_AGGRO1 = -1000518,
@@ -76,14 +77,12 @@ public:
{ {
npc_ameAI(Creature* creature) : npc_escortAI(creature) {} npc_ameAI(Creature* creature) : npc_escortAI(creature) {}
uint32 DEMORALIZINGSHOUT_Timer; uint32 DemoralizingShoutTimer;
void WaypointReached(uint32 waypointId) void WaypointReached(uint32 waypointId)
{ {
Player* player = GetPlayerForEscort(); if (Player* player = GetPlayerForEscort())
if (!player) {
return;
switch (waypointId) switch (waypointId)
{ {
case 19: case 19:
@@ -107,10 +106,11 @@ public:
break; break;
} }
} }
}
void Reset() void Reset()
{ {
DEMORALIZINGSHOUT_Timer = 5000; DemoralizingShoutTimer = 5000;
} }
void JustSummoned(Creature* summoned) void JustSummoned(Creature* summoned)
@@ -130,11 +130,11 @@ public:
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
if (DEMORALIZINGSHOUT_Timer <= diff) if (DemoralizingShoutTimer <= diff)
{ {
DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT); DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT);
DEMORALIZINGSHOUT_Timer = 70000; DemoralizingShoutTimer = 70000;
} else DEMORALIZINGSHOUT_Timer -= diff; } else DemoralizingShoutTimer -= diff;
} }
}; };
}; };
@@ -143,7 +143,7 @@ public:
# npc_ringo # npc_ringo
####*/ ####*/
enum eRingo enum Ringo
{ {
SAY_RIN_START_1 = -1000416, SAY_RIN_START_1 = -1000416,
SAY_RIN_START_2 = -1000417, SAY_RIN_START_2 = -1000417,
@@ -201,17 +201,17 @@ public:
{ {
npc_ringoAI(Creature* creature) : FollowerAI(creature) { } npc_ringoAI(Creature* creature) : FollowerAI(creature) { }
uint32 m_uiFaintTimer; uint32 FaintTimer;
uint32 m_uiEndEventProgress; uint32 EndEventProgress;
uint32 m_uiEndEventTimer; uint32 EndEventTimer;
uint64 SpraggleGUID; uint64 SpraggleGUID;
void Reset() void Reset()
{ {
m_uiFaintTimer = urand(30000, 60000); FaintTimer = urand(30000, 60000);
m_uiEndEventProgress = 0; EndEventProgress = 0;
m_uiEndEventTimer = 1000; EndEventTimer = 1000;
SpraggleGUID = 0; SpraggleGUID = 0;
} }
@@ -266,13 +266,13 @@ public:
SetFollowPaused(false); SetFollowPaused(false);
} }
void UpdateFollowerAI(const uint32 uiDiff) void UpdateFollowerAI(const uint32 Diff)
{ {
if (!UpdateVictim()) if (!UpdateVictim())
{ {
if (HasFollowState(STATE_FOLLOW_POSTEVENT)) if (HasFollowState(STATE_FOLLOW_POSTEVENT))
{ {
if (m_uiEndEventTimer <= uiDiff) if (EndEventTimer <= Diff)
{ {
Unit* pSpraggle = Unit::GetUnit(*me, SpraggleGUID); Unit* pSpraggle = Unit::GetUnit(*me, SpraggleGUID);
if (!pSpraggle || !pSpraggle->isAlive()) if (!pSpraggle || !pSpraggle->isAlive())
@@ -281,64 +281,61 @@ public:
return; return;
} }
switch (m_uiEndEventProgress) switch (EndEventProgress)
{ {
case 1: case 1:
DoScriptText(SAY_RIN_END_1, me); DoScriptText(SAY_RIN_END_1, me);
m_uiEndEventTimer = 3000; EndEventTimer = 3000;
break; break;
case 2: case 2:
DoScriptText(SAY_SPR_END_2, pSpraggle); DoScriptText(SAY_SPR_END_2, pSpraggle);
m_uiEndEventTimer = 5000; EndEventTimer = 5000;
break; break;
case 3: case 3:
DoScriptText(SAY_RIN_END_3, me); DoScriptText(SAY_RIN_END_3, me);
m_uiEndEventTimer = 1000; EndEventTimer = 1000;
break; break;
case 4: case 4:
DoScriptText(EMOTE_RIN_END_4, me); DoScriptText(EMOTE_RIN_END_4, me);
SetFaint(); SetFaint();
m_uiEndEventTimer = 9000; EndEventTimer = 9000;
break; break;
case 5: case 5:
DoScriptText(EMOTE_RIN_END_5, me); DoScriptText(EMOTE_RIN_END_5, me);
ClearFaint(); ClearFaint();
m_uiEndEventTimer = 1000; EndEventTimer = 1000;
break; break;
case 6: case 6:
DoScriptText(SAY_RIN_END_6, me); DoScriptText(SAY_RIN_END_6, me);
m_uiEndEventTimer = 3000; EndEventTimer = 3000;
break; break;
case 7: case 7:
DoScriptText(SAY_SPR_END_7, pSpraggle); DoScriptText(SAY_SPR_END_7, pSpraggle);
m_uiEndEventTimer = 10000; EndEventTimer = 10000;
break; break;
case 8: case 8:
DoScriptText(EMOTE_RIN_END_8, me); DoScriptText(EMOTE_RIN_END_8, me);
m_uiEndEventTimer = 5000; EndEventTimer = 5000;
break; break;
case 9: case 9:
SetFollowComplete(); SetFollowComplete();
break; break;
} }
++m_uiEndEventProgress; ++EndEventProgress;
} }
else else
m_uiEndEventTimer -= uiDiff; EndEventTimer -= Diff;
} }
else if (HasFollowState(STATE_FOLLOW_INPROGRESS)) else if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !HasFollowState(STATE_FOLLOW_PAUSED))
{ {
if (!HasFollowState(STATE_FOLLOW_PAUSED)) if (FaintTimer <= Diff)
{
if (m_uiFaintTimer <= uiDiff)
{ {
SetFaint(); SetFaint();
m_uiFaintTimer = urand(60000, 120000); FaintTimer = urand(60000, 120000);
} }
else else
m_uiFaintTimer -= uiDiff; FaintTimer -= Diff;
}
} }
return; return;
+3 -1
View File
@@ -29,7 +29,9 @@ npc_rivern_frostwind
npc_witch_doctor_mauari npc_witch_doctor_mauari
EndContentData */ EndContentData */
#include "ScriptPCH.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
/*###### /*######
## npc_lorax ## npc_lorax
@@ -1044,7 +1044,7 @@ class spell_algalon_phase_punch : public SpellScriptLoader
{ {
PrepareAuraScript(spell_algalon_phase_punch_AuraScript); PrepareAuraScript(spell_algalon_phase_punch_AuraScript);
void HandlePeriodic(AuraEffect const* aurEff) void HandlePeriodic(AuraEffect const* /*aurEff*/)
{ {
PreventDefaultAction(); PreventDefaultAction();
if (GetStackAmount() != 1) if (GetStackAmount() != 1)
+1 -1
View File
@@ -2044,7 +2044,7 @@ public:
void HandleDummy(SpellEffIndex /*effIndex*/) void HandleDummy(SpellEffIndex /*effIndex*/)
{ {
if (Unit* target = GetHitUnit()) if (GetHitUnit())
GetCaster()->CastSpell(GetCaster(),SPELL_FORCE_CAST_SUMMON_GNOME_SOUL); GetCaster()->CastSpell(GetCaster(),SPELL_FORCE_CAST_SUMMON_GNOME_SOUL);
} }
+1 -1
View File
@@ -213,7 +213,7 @@ class spell_sha_earthbind_totem : public SpellScriptLoader
return true; return true;
} }
void HandleEffectPeriodic(AuraEffect const* aurEff) void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{ {
if (!GetCaster()) if (!GetCaster())
return; return;