From bb4499887cf9592905fd3cec55c3ab8799960013 Mon Sep 17 00:00:00 2001 From: Anubisss Date: Sun, 3 May 2009 13:47:52 +0200 Subject: *Add a missing script. --HG-- branch : trunk --- .../zone/karazhan/boss_terestian_illhoof.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp index f1b94c7422b..a7860bb9fb4 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp @@ -45,8 +45,6 @@ EndScriptData */ #define SPELL_FIENDISH_PORTAL 30171 // Opens portal and summons Fiendish Portal, 2 sec cast #define SPELL_FIENDISH_PORTAL_1 30179 // Opens portal and summons Fiendish Portal, instant cast -#define SPELL_FIREBOLT 18086 // Blasts a target for 150 Fire damage. - #define SPELL_BROKEN_PACT 30065 // All damage taken increased by 25%. #define SPELL_AMPLIFY_FLAMES 30053 // Increases the Fire damage taken by an enemy by 500 for 25 sec. #define SPELL_FIREBOLT 18086 // Blasts a target for 150 Fire damage. @@ -347,9 +345,11 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI } }; -struct TRINITY_DLL_DECL mob_karazhan_impAI : public ScriptedAI +#define SPELL_FIREBOLT 30050 // Blasts a target for 181-209 Fire damage. + +struct TRINITY_DLL_DECL mob_fiendish_impAI : public ScriptedAI { - mob_karazhan_impAI(Creature *c) : ScriptedAI(c) {} + mob_fiendish_impAI(Creature *c) : ScriptedAI(c) {} uint32 FireboltTimer; @@ -381,9 +381,9 @@ CreatureAI* GetAI_mob_kilrek(Creature *_Creature) return new mob_kilrekAI (_Creature); } -CreatureAI* GetAI_mob_karazhan_imp(Creature *_Creature) +CreatureAI* GetAI_mob_fiendish_imp(Creature *_Creature) { - return new mob_karazhan_impAI (_Creature); + return new mob_fiendish_impAI (_Creature); } CreatureAI* GetAI_mob_demon_chain(Creature *_Creature) @@ -404,11 +404,10 @@ void AddSC_boss_terestian_illhoof() newscript->GetAI = &GetAI_boss_terestian_illhoof; newscript->RegisterSelf(); - //Who can find out what is this for - //newscript = new Script; - //newscript->Name="mob_karazhan_imp"; - //newscript->GetAI = &GetAI_mob_karazhan_imp; - //newscript->RegisterSelf(); + newscript = new Script; + newscript->Name="mob_fiendish_imp"; + newscript->GetAI = &GetAI_mob_fiendish_imp; + newscript->RegisterSelf(); newscript = new Script; newscript->Name="mob_kilrek"; -- cgit v1.2.3 From 558a5707ff50edf93375ae6e50335422c9ec13e4 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 3 May 2009 10:34:02 -0500 Subject: *Only update object which are in world. --HG-- branch : trunk --- src/game/Creature.cpp | 2 +- src/game/GridNotifiers.cpp | 3 ++- src/game/GridNotifiersImpl.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index a1907c9525d..5d18140f200 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1724,7 +1724,7 @@ void Creature::Respawn() //Call AI respawn virtual function AI()->JustRespawned(); - GetMap()->Add(this); + //GetMap()->Add(this); } } diff --git a/src/game/GridNotifiers.cpp b/src/game/GridNotifiers.cpp index e27abeccd0c..fe1a072cf20 100644 --- a/src/game/GridNotifiers.cpp +++ b/src/game/GridNotifiers.cpp @@ -200,7 +200,8 @@ ObjectUpdater::Visit(GridRefManager &m) { for(typename GridRefManager::iterator iter = m.begin(); iter != m.end(); ++iter) { - iter->getSource()->Update(i_timeDiff); + if(iter->getSource()->IsInWorld()) + iter->getSource()->Update(i_timeDiff); } } diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h index 3b9a7b79204..70f77b95ae8 100644 --- a/src/game/GridNotifiersImpl.h +++ b/src/game/GridNotifiersImpl.h @@ -33,7 +33,7 @@ inline void Trinity::ObjectUpdater::Visit(CreatureMapType &m) { for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter) - if(!iter->getSource()->isSpiritService()) + if(iter->getSource()->IsInWorld() && !iter->getSource()->isSpiritService()) iter->getSource()->Update(i_timeDiff); } -- cgit v1.2.3 From eb3c3a8fb4a4bac2e01222bfd25efd80fc792ba2 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 3 May 2009 10:39:31 -0500 Subject: *Only set item target for spell when there is item mask. --HG-- branch : trunk --- src/game/Spell.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index ab075be8201..ca822db570c 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -165,8 +165,9 @@ void SpellCastTargets::Update(Unit* caster) { if(m_targetMask & TARGET_FLAG_ITEM) m_itemTarget = ((Player*)caster)->GetItemByGuid(m_itemTargetGUID); - else + else if(m_targetMask & TARGET_FLAG_TRADE_ITEM) { + // here it is not guid but slot Player* pTrader = ((Player*)caster)->GetTrader(); if(pTrader && m_itemTargetGUID < TRADE_SLOT_COUNT) m_itemTarget = pTrader->GetItemByPos(pTrader->GetItemPosByTradeSlot(m_itemTargetGUID)); -- cgit v1.2.3