aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Kalimdor
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts/Kalimdor')
-rw-r--r--src/server/scripts/Kalimdor/CMakeLists.txt6
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp9
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp (renamed from src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp)0
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite_corruptor.cpp (renamed from src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp)0
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp (renamed from src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp)0
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp4
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp2
-rw-r--r--src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp2
-rw-r--r--src/server/scripts/Kalimdor/Firelands/firelands.h2
-rw-r--r--src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp4
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp5
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp9
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp32
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp4
-rw-r--r--src/server/scripts/Kalimdor/zone_desolace.cpp108
-rw-r--r--src/server/scripts/Kalimdor/zone_thunder_bluff.cpp3
16 files changed, 68 insertions, 122 deletions
diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt
index 44f48a1c35e..6f145d3e9a4 100644
--- a/src/server/scripts/Kalimdor/CMakeLists.txt
+++ b/src/server/scripts/Kalimdor/CMakeLists.txt
@@ -38,11 +38,11 @@ set(scripts_STAT_SRCS
Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h
Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp
Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp
- Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp
- Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp
+ Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite_corruptor.cpp
+ Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp
Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp
Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp
- Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp
+ Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp
Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp
Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.h
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
index 36f6f94b324..c28d70e2634 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp
@@ -1369,8 +1369,7 @@ public:
forcemove = false;
if (forcemove)
{
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (target)
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
me->Attack(target, false);
}
if (MoveTimer <= diff)
@@ -1409,11 +1408,11 @@ public:
return new alliance_riflemanAI(creature);
}
- struct alliance_riflemanAI : public Scripted_NoMovementAI
+ struct alliance_riflemanAI : public ScriptedAI
{
- alliance_riflemanAI(Creature* creature) : Scripted_NoMovementAI(creature)
+ alliance_riflemanAI(Creature* creature) : ScriptedAI(creature)
{
- Reset();
+ SetCombatMovement(false);
}
uint32 ExplodeTimer;
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp
index fad5736e18f..fad5736e18f 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_chrono_lord_epoch.cpp
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite_corruptor.cpp
index 8c2861db299..8c2861db299 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite_corruptor.cpp
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp
index d7d9beaedd4..d7d9beaedd4 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm_the_fleshcrafter.cpp
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp
index ea372621026..7ac8d4e783b 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp
@@ -124,8 +124,8 @@ public:
//Arcane Discharge
if (ArcaneDischarge_Timer <= diff)
{
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- DoCast(target, SPELL_ARCANE_DISCHARGE);
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ DoCast(target, SPELL_ARCANE_DISCHARGE);
ArcaneDischarge_Timer = 20000+rand()%10000;
} else ArcaneDischarge_Timer -= diff;
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp
index 9c17ed10d9c..78b655bb73b 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp
@@ -122,7 +122,7 @@ public:
bool IsEncounterInProgress() const
{
- if (const_cast<instance_dark_portal_InstanceMapScript*>(this)->GetData(TYPE_MEDIVH) == IN_PROGRESS)
+ if (GetData(TYPE_MEDIVH) == IN_PROGRESS)
return true;
return false;
diff --git a/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp b/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp
index 1dc70c5e505..b7816242afc 100644
--- a/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp
+++ b/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp
@@ -298,7 +298,7 @@ class npc_blazing_monstrosity : public CreatureScript
passenger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
// Hack to relocate vehicle on vehicle so exiting players are not moved under map
- Movement::MoveSplineInit init(*passenger);
+ Movement::MoveSplineInit init(passenger);
init.DisableTransportPathTransformations();
init.MoveTo(0.6654003f, 0.0f, 1.9815f);
init.SetFacing(0.0f);
diff --git a/src/server/scripts/Kalimdor/Firelands/firelands.h b/src/server/scripts/Kalimdor/Firelands/firelands.h
index 330158d6c94..cf12892b2c9 100644
--- a/src/server/scripts/Kalimdor/Firelands/firelands.h
+++ b/src/server/scripts/Kalimdor/Firelands/firelands.h
@@ -19,7 +19,7 @@
#define FIRELANDS_H_
#include "Map.h"
-#include "Creature.h"
+#include "CreatureAI.h"
#define FirelandsScriptName "instance_firelands"
diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp
index 1ea0ee0a343..2169320621b 100644
--- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp
+++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp
@@ -86,8 +86,8 @@ public:
return true;
}
protected:
- InstanceScript* _instance;
Unit* _owner;
+ InstanceScript* _instance;
};
class boss_earthrager_ptah : public CreatureScript
@@ -262,8 +262,8 @@ public:
}
protected:
- bool _hasDispersed;
uint8 _summonDeaths;
+ bool _hasDispersed;
};
CreatureAI* GetAI(Creature* creature) const
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
index 285d893fe41..c69a696827e 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
@@ -197,11 +197,12 @@ class npc_buru_egg : public CreatureScript
public:
npc_buru_egg() : CreatureScript("npc_buru_egg") { }
- struct npc_buru_eggAI : public Scripted_NoMovementAI
+ struct npc_buru_eggAI : public ScriptedAI
{
- npc_buru_eggAI(Creature* creature) : Scripted_NoMovementAI(creature)
+ npc_buru_eggAI(Creature* creature) : ScriptedAI(creature)
{
_instance = me->GetInstanceScript();
+ SetCombatMovement(false);
}
void EnterCombat(Unit* attacker)
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp
index 2a9ea4ba4fc..a16e9cfa89d 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp
@@ -274,10 +274,11 @@ public:
for (uint8 i = 0; i < 10; ++i)
{
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- Creature* Summoned = me->SummonCreature(15621, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000);
- if (Summoned && target)
- Summoned->AI()->AttackStart(target);
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ {
+ if (Creature* Summoned = me->SummonCreature(15621, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000))
+ Summoned->AI()->AttackStart(target);
+ }
}
}
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
index 3da1fc1dc5c..b5fbd644592 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
@@ -156,13 +156,15 @@ public:
return new eye_of_cthunAI (creature);
}
- struct eye_of_cthunAI : public Scripted_NoMovementAI
+ struct eye_of_cthunAI : public ScriptedAI
{
- eye_of_cthunAI(Creature* creature) : Scripted_NoMovementAI(creature)
+ eye_of_cthunAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
if (!instance)
sLog->outError(LOG_FILTER_TSCR, "No Instance eye_of_cthunAI");
+
+ SetCombatMovement(false);
}
InstanceScript* instance;
@@ -460,9 +462,9 @@ public:
return new cthunAI (creature);
}
- struct cthunAI : public Scripted_NoMovementAI
+ struct cthunAI : public ScriptedAI
{
- cthunAI(Creature* creature) : Scripted_NoMovementAI(creature)
+ cthunAI(Creature* creature) : ScriptedAI(creature)
{
SetCombatMovement(false);
@@ -916,15 +918,17 @@ public:
return new eye_tentacleAI (creature);
}
- struct eye_tentacleAI : public Scripted_NoMovementAI
+ struct eye_tentacleAI : public ScriptedAI
{
- eye_tentacleAI(Creature* creature) : Scripted_NoMovementAI(creature)
+ eye_tentacleAI(Creature* creature) : ScriptedAI(creature)
{
if (Creature* pPortal = me->SummonCreature(MOB_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
Portal = pPortal->GetGUID();
}
+
+ SetCombatMovement(false);
}
uint32 MindflayTimer;
@@ -989,9 +993,9 @@ public:
return new claw_tentacleAI (creature);
}
- struct claw_tentacleAI : public Scripted_NoMovementAI
+ struct claw_tentacleAI : public ScriptedAI
{
- claw_tentacleAI(Creature* creature) : Scripted_NoMovementAI(creature)
+ claw_tentacleAI(Creature* creature) : ScriptedAI(creature)
{
SetCombatMovement(false);
@@ -1099,9 +1103,9 @@ public:
return new giant_claw_tentacleAI (creature);
}
- struct giant_claw_tentacleAI : public Scripted_NoMovementAI
+ struct giant_claw_tentacleAI : public ScriptedAI
{
- giant_claw_tentacleAI(Creature* creature) : Scripted_NoMovementAI(creature)
+ giant_claw_tentacleAI(Creature* creature) : ScriptedAI(creature)
{
SetCombatMovement(false);
@@ -1218,9 +1222,9 @@ public:
return new giant_eye_tentacleAI (creature);
}
- struct giant_eye_tentacleAI : public Scripted_NoMovementAI
+ struct giant_eye_tentacleAI : public ScriptedAI
{
- giant_eye_tentacleAI(Creature* creature) : Scripted_NoMovementAI(creature)
+ giant_eye_tentacleAI(Creature* creature) : ScriptedAI(creature)
{
SetCombatMovement(false);
@@ -1282,9 +1286,9 @@ public:
return new flesh_tentacleAI (creature);
}
- struct flesh_tentacleAI : public Scripted_NoMovementAI
+ struct flesh_tentacleAI : public ScriptedAI
{
- flesh_tentacleAI(Creature* creature) : Scripted_NoMovementAI(creature)
+ flesh_tentacleAI(Creature* creature) : ScriptedAI(creature)
{
SetCombatMovement(false);
}
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp
index 80fdc111911..52d59efd0df 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp
@@ -137,9 +137,7 @@ public:
{
if (SpawnHatchlings_Timer <= diff)
{
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (target && target->GetTypeId() == TYPEID_PLAYER)
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
{
DoCast(target, SPELL_ROOT);
diff --git a/src/server/scripts/Kalimdor/zone_desolace.cpp b/src/server/scripts/Kalimdor/zone_desolace.cpp
index 0ecf5e51c1f..f4c0eed481e 100644
--- a/src/server/scripts/Kalimdor/zone_desolace.cpp
+++ b/src/server/scripts/Kalimdor/zone_desolace.cpp
@@ -37,7 +37,6 @@ EndContentData */
enum DyingKodo
{
- // signed for 9999
SAY_SMEED_HOME = 0,
QUEST_KODO = 5561,
@@ -49,7 +48,7 @@ enum DyingKodo
NPC_TAMED_KODO = 11627,
SPELL_KODO_KOMBO_ITEM = 18153,
- SPELL_KODO_KOMBO_PLAYER_BUFF = 18172, //spells here have unclear function, but using them at least for visual parts and checks
+ SPELL_KODO_KOMBO_PLAYER_BUFF = 18172,
SPELL_KODO_KOMBO_DESPAWN_BUFF = 18377,
SPELL_KODO_KOMBO_GOSSIP = 18362
@@ -64,110 +63,55 @@ public:
{
if (player->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && creature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
{
- //the expected quest objective
- player->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
-
+ player->TalkedToCreature(creature->GetEntry(), 0);
player->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF);
- creature->GetMotionMaster()->MoveIdle();
}
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
- bool EffectDummyCreature(Unit* pCaster, uint32 spellId, uint32 effIndex, Creature* creatureTarget)
- {
- //always check spellid and effectindex
- if (spellId == SPELL_KODO_KOMBO_ITEM && effIndex == 0)
- {
- //no effect if player/creature already have aura from spells
- if (pCaster->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) || creatureTarget->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
- return true;
-
- if (creatureTarget->GetEntry() == NPC_AGED_KODO ||
- creatureTarget->GetEntry() == NPC_DYING_KODO ||
- creatureTarget->GetEntry() == NPC_ANCIENT_KODO)
- {
- pCaster->CastSpell(pCaster, SPELL_KODO_KOMBO_PLAYER_BUFF, true);
-
- creatureTarget->UpdateEntry(NPC_TAMED_KODO);
- creatureTarget->CastSpell(creatureTarget, SPELL_KODO_KOMBO_DESPAWN_BUFF, false);
-
- if (creatureTarget->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
- creatureTarget->GetMotionMaster()->MoveIdle();
-
- creatureTarget->GetMotionMaster()->MoveFollow(pCaster, PET_FOLLOW_DIST, creatureTarget->GetFollowAngle());
- }
-
- //always return true when we are handling this spell and effect
- return true;
- }
- return false;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_aged_dying_ancient_kodoAI(creature);
- }
-
struct npc_aged_dying_ancient_kodoAI : public ScriptedAI
{
- npc_aged_dying_ancient_kodoAI(Creature* creature) : ScriptedAI(creature) { Reset(); }
-
- uint32 DespawnTimer;
+ npc_aged_dying_ancient_kodoAI(Creature* creature) : ScriptedAI(creature) {}
- void Reset()
+ void MoveInLineOfSight(Unit* who)
{
- DespawnTimer = 0;
+ if (who->GetEntry() == NPC_SMEED && me->IsWithinDistInMap(who, 10.0f) && !me->HasAura(SPELL_KODO_KOMBO_GOSSIP))
+ {
+ me->GetMotionMaster()->Clear();
+ DoCast(me, SPELL_KODO_KOMBO_GOSSIP, true);
+ if (Creature* smeed = who->ToCreature())
+ smeed->AI()->Talk(SAY_SMEED_HOME);
+ }
}
- void MoveInLineOfSight(Unit* who)
+ void SpellHit(Unit* caster, SpellInfo const* spell)
{
- if (who->GetEntry() == NPC_SMEED)
+ if (spell->Id == SPELL_KODO_KOMBO_ITEM)
{
- if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
- return;
-
- if (me->IsWithinDistInMap(who, 10.0f))
+ if (!(caster->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) || me->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
+ && (me->GetEntry() == NPC_AGED_KODO || me->GetEntry() == NPC_DYING_KODO || me->GetEntry() == NPC_ANCIENT_KODO))
{
- if (Creature* talker = who->ToCreature())
- talker->AI()->Talk(SAY_SMEED_HOME);
+ caster->CastSpell(caster, SPELL_KODO_KOMBO_PLAYER_BUFF, true);
+ DoCast(me, SPELL_KODO_KOMBO_DESPAWN_BUFF, true);
- //spell have no implemented effect (dummy), so useful to notify spellHit
- DoCast(me, SPELL_KODO_KOMBO_GOSSIP, true);
+ me->UpdateEntry(NPC_TAMED_KODO);
+ me->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, me->GetFollowAngle());
}
}
- }
-
- void SpellHit(Unit* /*pCaster*/, SpellInfo const* pSpell)
- {
- if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP)
+ else if (spell->Id == SPELL_KODO_KOMBO_GOSSIP)
{
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- DespawnTimer = 60000;
+ me->DespawnOrUnsummon(60000);
}
}
-
- 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.
- if (DespawnTimer && DespawnTimer <= diff)
- {
- if (!me->getVictim() && me->isAlive())
- {
- Reset();
- me->setDeathState(JUST_DIED);
- me->Respawn();
- return;
- }
- } else DespawnTimer -= diff;
-
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
};
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_aged_dying_ancient_kodoAI(creature);
+ }
};
diff --git a/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp
index 1139122f73b..52887928d0a 100644
--- a/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp
+++ b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp
@@ -81,8 +81,7 @@ public:
if (BerserkerChargeTimer <= diff)
{
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (target)
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_BERSERKER_CHARGE);
BerserkerChargeTimer = 25000;
} else BerserkerChargeTimer -= diff;