aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/slave_pens/boss_rokmar.cpp66
-rw-r--r--src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_ghazan.cpp80
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp2
-rw-r--r--src/game/Creature.cpp2
-rw-r--r--src/game/Map.cpp8
-rw-r--r--src/game/MotionMaster.cpp8
-rw-r--r--src/game/MotionMaster.h4
-rw-r--r--src/game/SpellEffects.cpp2
-rw-r--r--src/game/Unit.cpp2
9 files changed, 19 insertions, 155 deletions
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/slave_pens/boss_rokmar.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/slave_pens/boss_rokmar.cpp
deleted file mode 100644
index aab4fbd1a85..00000000000
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/slave_pens/boss_rokmar.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Rokmar
-SD%Complete: 100
-SDComment:
-SDCategory: Coilfang Resevoir, Slave Pens
-EndScriptData */
-
-#include "../../../creature/simple_ai.h"
-
-#define SPELL_WATTER_SPIT 40086
-#define SPELL_GRIEVOUS_WOUND 31956
-#define SPELL_ENSARING_MOSS 31948
-
-CreatureAI* GetAI_boss_rokmar_the_crackler(Creature *_Creature)
-{
- SimpleAI* ai = new SimpleAI (_Creature);
-
- //Watter Spit
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = SPELL_WATTER_SPIT;
- ai->Spell[0].Cooldown = 15000;
- ai->Spell[0].First_Cast = 15000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- //Grievous Wound
- ai->Spell[1].Enabled = true;
- ai->Spell[1].Spell_Id = SPELL_GRIEVOUS_WOUND;
- ai->Spell[1].Cooldown = 25000;
- ai->Spell[1].First_Cast = 15000;
- ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- //Ensaring Moss
- ai->Spell[2].Enabled = true;
- ai->Spell[2].Spell_Id = SPELL_ENSARING_MOSS;
- ai->Spell[2].Cooldown = 15000 + (rand()%10000);
- ai->Spell[2].First_Cast = 25000;
- ai->Spell[2].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- return ai;
-}
-
-void AddSC_boss_rokmar_the_crackler()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_rokmar_the_crackler";
- newscript->GetAI = GetAI_boss_rokmar_the_crackler;
- m_scripts[nrscripts++] = newscript;
-}
-
diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_ghazan.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_ghazan.cpp
deleted file mode 100644
index 914e6b3f2aa..00000000000
--- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_ghazan.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Ghazan
-SD%Complete: 100
-SDComment:
-SDCategory: Coilfang Resevoir, Underbog
-EndScriptData */
-
-#include "../../../creature/simple_ai.h"
-#include "precompiled.h"
-
-/*
---== Ghaz'an ==--
-*Acid Spit - 34290; timer: 8sec
-*Enrage - 20% hp; 40683
-*Tail Sweep - 34267; timer: ~10sec
-*Acid Breath - 34268; timer: 5sec
-*/
-
-CreatureAI* GetAI_boss_ghazan(Creature *_Creature)
-{
- SimpleAI* ai = new SimpleAI (_Creature);
-
- // Acid Spit - 34290; timer: 8sec
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = 34290;
- ai->Spell[0].Cooldown = 8000;
- ai->Spell[0].First_Cast = 8000;
- ai->Spell[0].Cast_Target_Type = CAST_SELF;
-
- // Acid Breath - 34268; timer: 5sec
- ai->Spell[1].Enabled = true;
- ai->Spell[1].Spell_Id = 34268;
- ai->Spell[1].Cooldown = 5000;
- ai->Spell[1].First_Cast = 5000;
- ai->Spell[1].Cast_Target_Type = CAST_SELF;
-
- // Tail Sweep - 34267
- ai->Spell[2].Enabled = true;
- ai->Spell[2].Spell_Id = 34267;
- ai->Spell[2].Cooldown = 10000;
- ai->Spell[2].First_Cast = 10000;
- ai->Spell[2].Cast_Target_Type = CAST_SELF;
-
- // Enrage - 20% hp; 40683
- ai->Spell[3].Enabled = true;
- ai->Spell[3].Spell_Id = 40683;
- ai->Spell[3].Cooldown = -1;
- ai->Spell[3].First_Cast = -80;
- ai->Spell[3].Cast_Target_Type = CAST_SELF;
-
- ai->EnterEvadeMode();
-
- return ai;
-}
-
-void AddSC_boss_ghazan()
-{
- Script *newscript;
- newscript = new Script;
- newscript->Name="boss_ghazan";
- newscript->GetAI = GetAI_boss_ghazan;
- m_scripts[nrscripts++] = newscript;
-}
-
diff --git a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp
index c86fe3ead82..185c44c6cdc 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp
@@ -24,7 +24,7 @@ EndScriptData */
#include "precompiled.h"
#include "def_karazhan.h"
-#define ENCOUNTERS 11
+#define ENCOUNTERS 12
/*
0 - Attumen + Midnight (optional)
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index c075a33e92f..7cac1c6a460 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -598,8 +598,8 @@ bool Creature::AIM_Initialize(CreatureAI* ai)
}
if(i_AI) delete i_AI;
- i_AI = ai ? ai : FactorySelector::selectAI(this);
i_motionMaster.Initialize();
+ i_AI = ai ? ai : FactorySelector::selectAI(this);
IsAIEnabled = true;
return true;
}
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index 4866ecb540f..1d6b96a5cd9 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -594,14 +594,14 @@ void Map::RelocationNotify()
for(std::vector<uint64>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
{
Unit *unit = ObjectAccessor::GetObjectInWorld(*iter, (Unit*)NULL);
- if(!unit)
+ if(!unit || !unit->IsInWorld() || !unit->GetMapId() == GetId())
+ {
+ *iter = 0;
continue;
+ }
unit->m_Notified = true;
- if(!unit->IsInWorld())
- continue;
-
if(unit->GetTypeId() == TYPEID_PLAYER)
{
Trinity::PlayerRelocationNotifier notifier(*((Player*)unit));
diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp
index b64c17b6342..170a9b52211 100644
--- a/src/game/MotionMaster.cpp
+++ b/src/game/MotionMaster.cpp
@@ -460,6 +460,14 @@ MovementGeneratorType MotionMaster::GetCurrentMovementGeneratorType() const
return top()->GetMovementGeneratorType();
}
+MovementGeneratorType MotionMaster::GetMotionSlotType(int slot) const
+{
+ if(!Impl[slot])
+ return NULL_MOTION_TYPE;
+ else
+ return Impl[slot]->GetMovementGeneratorType();
+}
+
void MotionMaster::InitTop()
{
top()->Initialize(*i_owner);
diff --git a/src/game/MotionMaster.h b/src/game/MotionMaster.h
index bf3560da321..d68a94b7a1f 100644
--- a/src/game/MotionMaster.h
+++ b/src/game/MotionMaster.h
@@ -45,6 +45,7 @@ enum MovementGeneratorType
POINT_MOTION_TYPE = 8, // PointMovementGenerator.h
FLEEING_MOTION_TYPE = 9, // FleeingMovementGenerator.h
DISTRACT_MOTION_TYPE = 10, // IdleMovementGenerator.h
+ NULL_MOTION_TYPE = 11,
};
enum MovementSlot
@@ -94,7 +95,7 @@ class TRINITY_DLL_SPEC MotionMaster //: private std::stack<MovementGenerator *>
int size() const { return i_top + 1; }
_Ty top() const { return Impl[i_top]; }
- _Ty GetMotionSlot(int slot) { return Impl[slot]; }
+ _Ty GetMotionSlot(int slot) const { return Impl[slot]; }
void DirectDelete(_Ty curr);
void DelayedDelete(_Ty curr);
@@ -141,6 +142,7 @@ class TRINITY_DLL_SPEC MotionMaster //: private std::stack<MovementGenerator *>
void MovePath(uint32 path_id, bool repeatable);
MovementGeneratorType GetCurrentMovementGeneratorType() const;
+ MovementGeneratorType GetMotionSlotType(int slot) const;
void propagateSpeedChange();
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index e494274b751..5cfb00588c5 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -4589,7 +4589,7 @@ void Spell::EffectInterruptCast(uint32 i)
if (unitTarget->m_currentSpells[i])
{
// check if we can interrupt spell
- if ( unitTarget->m_currentSpells[i]->m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_INTERRUPT && unitTarget->m_currentSpells[i]->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE )
+ if ( (unitTarget->m_currentSpells[i]->getState() == SPELL_STATE_CASTING || (unitTarget->m_currentSpells[i]->getState() == SPELL_STATE_PREPARING && unitTarget->m_currentSpells[i]->GetCastTime() > 0.0f)) && unitTarget->m_currentSpells[i]->m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_INTERRUPT && unitTarget->m_currentSpells[i]->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE )
{
if(m_originalCaster)
{
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 27f11be57ba..edd099b63b7 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -9886,7 +9886,7 @@ void Unit::SetInCombatState(bool PvP)
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
- if(GetTypeId() != TYPEID_PLAYER)
+ if(GetTypeId() != TYPEID_PLAYER && GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_IDLE) != IDLE_MOTION_TYPE)
((Creature*)this)->SetHomePosition(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
if(GetTypeId() != TYPEID_PLAYER && ((Creature*)this)->isPet())