From 82686437fb3c9fff5ec456e9fefdbe782b0604ee Mon Sep 17 00:00:00 2001 From: Anubisss Date: Tue, 30 Mar 2010 21:38:03 +0200 Subject: [PATCH 1/7] Fix a typo in Keristrasza's script. Patch by havenard, #1373. --HG-- branch : trunk --- src/scripts/northrend/nexus/nexus/boss_keristrasza.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/northrend/nexus/nexus/boss_keristrasza.cpp b/src/scripts/northrend/nexus/nexus/boss_keristrasza.cpp index 76faf74856..bb020c911b 100644 --- a/src/scripts/northrend/nexus/nexus/boss_keristrasza.cpp +++ b/src/scripts/northrend/nexus/nexus/boss_keristrasza.cpp @@ -177,7 +177,7 @@ struct boss_keristraszaAI : public ScriptedAI uiCheckIntenseColdTimer = 2*IN_MILISECONDS; } else uiCheckIntenseColdTimer -= diff; - if (!bEnrage && (m_creature->GetHealth() < HealthBelowPct(25))) + if (!bEnrage && HealthBelowPct(25)) { DoScriptText(SAY_ENRAGE, m_creature); DoCast(m_creature, SPELL_ENRAGE); From 83500cb1e4388937a98bba1903de37430415ea16 Mon Sep 17 00:00:00 2001 From: "malcromdev@gmail.com>" Date: Tue, 30 Mar 2010 19:01:25 -0230 Subject: [PATCH 2/7] Added SCRIPT_COMMAND_MODEL 32 Allows changing of npc model in db scripts. --HG-- branch : trunk --- src/game/Map.cpp | 12 ++++++++++++ src/game/World.h | 1 + 2 files changed, 13 insertions(+) diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 1214247efa..dc20e33047 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -3714,6 +3714,18 @@ void Map::ScriptsProcess() break; } + case SCRIPT_COMMAND_MODEL: + { + if(!source) + { + sLog.outError("SCRIPT_COMMAND_MODEL call for NULL creature."); + break; + } + + source->ToCreature()->SetDisplayId(step.script->datalong); + + break; + } default: sLog.outError("Unknown script command %u called.",step.script->command); break; diff --git a/src/game/World.h b/src/game/World.h index 1f3f9b8760..87450bc482 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -415,6 +415,7 @@ enum RealmZone //trinity only #define SCRIPT_COMMAND_ORIENTATION 30 // o = orientation #define SCRIPT_COMMAND_EQUIP 31 // datalong = equipment id +#define SCRIPT_COMMAND_MODEL 32 // datalong = model id /// Storage class for commands issued for delayed execution struct CliCommandHolder From 7cc192e97361b705ef8f3e6c82015021842e8c8d Mon Sep 17 00:00:00 2001 From: Trazom62 Date: Tue, 30 Mar 2010 23:39:18 +0200 Subject: [PATCH 3/7] Fix Skinning where there is no loot on creature. Fixes issue #1174. --HG-- branch : trunk --- src/game/Spell.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 248a390c0b..bad60d69cf 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -5029,10 +5029,8 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_TARGET_UNSKINNABLE; Creature* creature = m_targets.getUnitTarget()->ToCreature(); - if ( creature->GetCreatureType() != CREATURE_TYPE_CRITTER && ( !creature->lootForBody || !creature->loot.empty() ) ) - { + if (creature->GetCreatureType() != CREATURE_TYPE_CRITTER && !creature->loot.isLooted()) return SPELL_FAILED_TARGET_NOT_LOOTED; - } uint32 skill = creature->GetCreatureInfo()->GetRequiredLootSkill(); From e280d4e45bf8496cf92a6f33cf6753560325d0cc Mon Sep 17 00:00:00 2001 From: Trazom62 Date: Wed, 31 Mar 2010 00:12:49 +0200 Subject: [PATCH 4/7] Fix Script Grand Magus Telestra to reappear when the 3 adds are killed. Fixes issue #1382. --HG-- branch : trunk --- .../nexus/nexus/boss_magus_telestra.cpp | 51 ++++++++----------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/src/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp b/src/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp index 8468773286..c5632f6c18 100644 --- a/src/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp +++ b/src/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp @@ -163,13 +163,33 @@ struct boss_magus_telestraAI : public ScriptedAI return 0; } + void SummonedCreatureDespawn(Creature *summon) + { + if (summon->isAlive()) + return; + + if (summon->GetGUID() == uiFireMagusGUID) + { + bFireMagusDead = true; + bIsAchievementTimerRunning = true; + } + else if (summon->GetGUID() == uiFrostMagusGUID) + { + bFrostMagusDead = true; + bIsAchievementTimerRunning = true; + } + else if (summon->GetGUID() == uiArcaneMagusGUID) + { + bArcaneMagusDead = true; + bIsAchievementTimerRunning = true; + } + } + void UpdateAI(const uint32 diff) { //Return since we have no target if (!UpdateVictim()) - { return; - } if (bIsWaitingToAppear) { @@ -185,33 +205,6 @@ struct boss_magus_telestraAI : public ScriptedAI if ((Phase == 1) ||(Phase == 3)) { - Unit* pFireMagus; - Unit* pFrostMagus; - Unit* pArcaneMagus; - if (uiFireMagusGUID) - pFireMagus = Unit::GetUnit((*m_creature), uiFireMagusGUID); - if (uiFrostMagusGUID) - pFrostMagus = Unit::GetUnit((*m_creature), uiFrostMagusGUID); - if (uiArcaneMagusGUID) - pArcaneMagus = Unit::GetUnit((*m_creature), uiArcaneMagusGUID); - if (pFireMagus && pFireMagus->isDead()) - { - bFireMagusDead = true; - if (!bIsAchievementTimerRunning) - bIsAchievementTimerRunning = true; - } - if (pFrostMagus && pFrostMagus->isDead()) - { - bFrostMagusDead = true; - if (!bIsAchievementTimerRunning) - bIsAchievementTimerRunning = true; - } - if (pArcaneMagus && pArcaneMagus->isDead()) - { - bArcaneMagusDead = true; - if (!bIsAchievementTimerRunning) - bIsAchievementTimerRunning = true; - } if (bIsAchievementTimerRunning) uiAchievementTimer += diff; if (bFireMagusDead && bFrostMagusDead && bArcaneMagusDead) From ab4c7cbd983c6efc51ee37846e15fdc804487829 Mon Sep 17 00:00:00 2001 From: Anubisss Date: Thu, 1 Apr 2010 17:28:59 +0200 Subject: [PATCH 5/7] Fix a typo in friends list and ignore list loading. This fixes the bugs which appear when you have more than 50 entries on friends or ignore list. For example: You have 40 friends and 20 ignores, it's 60. But the core loads just 50 entries so some of them not loaded. Fixes issue #134. Patch by johnholiver. --HG-- branch : trunk --- src/game/SocialMgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/SocialMgr.cpp b/src/game/SocialMgr.cpp index c619da3178..f11cc092ba 100644 --- a/src/game/SocialMgr.cpp +++ b/src/game/SocialMgr.cpp @@ -313,8 +313,8 @@ PlayerSocial *SocialMgr::LoadFromDB(QueryResult_AutoPtr result, uint32 guid) social->m_playerSocialMap[friend_guid] = FriendInfo(flags, note); - // client limit - if(social->m_playerSocialMap.size() >= 50) + // client's friends list and ignore list limit + if(social->m_playerSocialMap.size() >= (SOCIALMGR_FRIEND_LIMIT + SOCIALMGR_IGNORE_LIMIT)) break; } while (result->NextRow()); From 9f544d2f934420be5c6ce0bbe3db5d84153c9d61 Mon Sep 17 00:00:00 2001 From: _manuel_ Date: Thu, 1 Apr 2010 12:58:02 -0300 Subject: [PATCH 6/7] Implemented script for vendor/trainer Hira Snowdawn. --HG-- branch : trunk --- sql/FULL/world_scripts_full.sql | 1 + sql/updates/7739_world_scriptname.sql | 1 + src/scripts/northrend/dalaran.cpp | 38 +++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 sql/updates/7739_world_scriptname.sql diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index c87f9e6196..146465b3e0 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -518,6 +518,7 @@ UPDATE `creature_template` SET `ScriptName`='mob_shield_generator_channel' WHERE /* DALARAN */ UPDATE `creature_template` SET `ScriptName`='npc_mageguard_dalaran' WHERE `entry` IN (29254,29255); +UPDATE `creature_template` SET `ScriptName`='npc_hira_snowdawn' WHERE `entry`=31238; /* DARKSHORE */ UPDATE `creature_template` SET `ScriptName`='npc_kerlonian' WHERE `entry`=11218; diff --git a/sql/updates/7739_world_scriptname.sql b/sql/updates/7739_world_scriptname.sql new file mode 100644 index 0000000000..407466425a --- /dev/null +++ b/sql/updates/7739_world_scriptname.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_hira_snowdawn' WHERE `entry`=31238; diff --git a/src/scripts/northrend/dalaran.cpp b/src/scripts/northrend/dalaran.cpp index 903118444a..61dc6abc7c 100644 --- a/src/scripts/northrend/dalaran.cpp +++ b/src/scripts/northrend/dalaran.cpp @@ -105,6 +105,38 @@ CreatureAI* GetAI_npc_mageguard_dalaran(Creature* pCreature) return new npc_mageguard_dalaranAI(pCreature); } +/*###### +## npc_hira_snowdawn +######*/ + +#define GOSSIP_TEXT_TRAIN_HIRA "I seek training to ride a steed." + +bool GossipHello_npc_hira_snowdawn(Player* pPlayer, Creature* pCreature) +{ + if (!pCreature->isVendor() || !pCreature->isTrainer()) + return false; + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_TRAIN_HIRA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); + + if (pPlayer->getLevel() == 80) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_hira_snowdawn(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRAIN) + pPlayer->SEND_TRAINERLIST(pCreature->GetGUID()); + + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + void AddSC_dalaran() { Script *newscript; @@ -113,4 +145,10 @@ void AddSC_dalaran() newscript->Name = "npc_mageguard_dalaran"; newscript->GetAI = &GetAI_npc_mageguard_dalaran; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_hira_snowdawn"; + newscript->pGossipHello = &GossipHello_npc_hira_snowdawn; + newscript->pGossipSelect = &GossipSelect_npc_hira_snowdawn; + newscript->RegisterSelf(); } From f78b766705104444f695a265bce712d59a22cbb3 Mon Sep 17 00:00:00 2001 From: Anubisss Date: Thu, 1 Apr 2010 19:09:56 +0200 Subject: [PATCH 7/7] Use ToTempSummon() in a case instead of a C style cast. Use correct Unit::GetCreature() instead of Unit::GetUnit() with casting the object to Creature pointer. Remove some usless casts. Fix a possible crash in pyrewood_ambushAI. TODO: Remove ugly cast macros(like CAST_PLR(), CAST_CRE()) from scripts and use the correct ToX() functions(like ToPlayer(), ToCreature()). --HG-- branch : trunk --- src/scripts/eastern_kingdoms/silverpine_forest.cpp | 3 ++- src/scripts/northrend/borean_tundra.cpp | 2 +- .../northrend/obsidian_sanctum/boss_sartharion.cpp | 10 +++++----- src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp | 2 +- .../northrend/ulduar/ulduar/ulduar_teleporter.cpp | 2 +- .../utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp | 2 +- .../utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp | 2 +- src/scripts/northrend/violet_hold/boss_ichoron.cpp | 4 ++-- src/scripts/northrend/violet_hold/boss_xevozz.cpp | 2 +- src/scripts/northrend/zuldrak.cpp | 2 +- 10 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/scripts/eastern_kingdoms/silverpine_forest.cpp b/src/scripts/eastern_kingdoms/silverpine_forest.cpp index 21667d1fc9..d7319a6e29 100644 --- a/src/scripts/eastern_kingdoms/silverpine_forest.cpp +++ b/src/scripts/eastern_kingdoms/silverpine_forest.cpp @@ -254,7 +254,8 @@ struct pyrewood_ambushAI : public ScriptedAI if (PlayerGUID) { pPlayer = Unit::GetPlayer(PlayerGUID); - pTarget = RAND((Unit*)m_creature, (Unit*)pPlayer); + if (pPlayer) + pTarget = RAND((Unit*)m_creature, (Unit*)pPlayer); } else pTarget = m_creature; diff --git a/src/scripts/northrend/borean_tundra.cpp b/src/scripts/northrend/borean_tundra.cpp index e4939cdb63..c07d2c58d6 100644 --- a/src/scripts/northrend/borean_tundra.cpp +++ b/src/scripts/northrend/borean_tundra.cpp @@ -672,7 +672,7 @@ struct npc_nesingwary_trapperAI : public ScriptedAI if (go_caribou && go_caribou->GetTypeId() == TYPEID_GAMEOBJECT) go_caribou->SetLootState(GO_JUST_DEACTIVATED); - if (TempSummon *summon = (TempSummon*)m_creature) + if (TempSummon *summon = m_creature->ToTempSummon()) if (summon->isSummon()) if (Unit *pTemp = summon->GetSummoner()) if (pTemp->GetTypeId() == TYPEID_PLAYER) diff --git a/src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp b/src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp index fa870d069d..c87687ab72 100644 --- a/src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp +++ b/src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp @@ -1073,8 +1073,8 @@ struct mob_acolyte_of_shadronAI : public ScriptedAI { Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 999, true); Creature* pShadron = NULL; - Creature* pSartharion = ((Creature*)Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SARTHARION))); - if (Creature* pShadron = ((Creature*)Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SHADRON)))) + Creature* pSartharion = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SARTHARION)); + if (Creature* pShadron = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SHADRON))) //if not solo figth, buff main boss, else place debuff on mini-boss. both spells TARGET_SCRIPT if (pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) pSartharion->CastSpell(m_creature, SPELL_GIFT_OF_TWILIGTH_SAR, true); @@ -1116,14 +1116,14 @@ struct mob_acolyte_of_shadronAI : public ScriptedAI if (pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) { //not solo fight, so main boss has deduff - Creature* pDebuffTarget = ((Creature*)Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SARTHARION))); + Creature* pDebuffTarget = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SARTHARION)); if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SAR)) pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SAR); } else { //event not in progress, then solo fight and must remove debuff mini-boss - Creature* pDebuffTarget = ((Creature*)Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SHADRON))); + Creature* pDebuffTarget = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SHADRON)); if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); } @@ -1171,7 +1171,7 @@ struct mob_acolyte_of_vesperonAI : public ScriptedAI // remove twilight torment on Vesperon if (pInstance) { - Creature* pVesperon = ((Creature*)Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_VESPERON))); + Creature* pVesperon = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_VESPERON)); if (pVesperon && pVesperon->isAlive() && pVesperon->HasAura(SPELL_TWILIGHT_TORMENT_VESP)) pVesperon->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP); diff --git a/src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp b/src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp index e8fae4512e..5ba5d011d1 100644 --- a/src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp +++ b/src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp @@ -333,7 +333,7 @@ struct mob_collapsing_starAI : public ScriptedAI { mob_collapsing_starAI(Creature *pCreature) : ScriptedAI(pCreature) { - pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + pInstance = pCreature->GetInstanceData(); } ScriptedInstance* pInstance; diff --git a/src/scripts/northrend/ulduar/ulduar/ulduar_teleporter.cpp b/src/scripts/northrend/ulduar/ulduar/ulduar_teleporter.cpp index 8489bf4272..9330de94e6 100644 --- a/src/scripts/northrend/ulduar/ulduar/ulduar_teleporter.cpp +++ b/src/scripts/northrend/ulduar/ulduar/ulduar_teleporter.cpp @@ -23,7 +23,7 @@ The teleporter appears to be active and stable. bool GoHello_ulduar_teleporter( Player *pPlayer, GameObject *pGO ) { - ScriptedInstance *pInstance = (ScriptedInstance *) pGO->GetInstanceData(); + ScriptedInstance *pInstance = pGO->GetInstanceData(); if(!pInstance) return true; pPlayer->ADD_GOSSIP_ITEM(0, "Teleport to the Expedition Base Camp", GOSSIP_SENDER_MAIN, BASE_CAMP); diff --git a/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp b/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp index cb37b9fe50..36a0f23778 100644 --- a/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp +++ b/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp @@ -723,7 +723,7 @@ struct mob_palehoof_orbAI : public ScriptedAI { pNext->RemoveAurasDueToSpell(SPELL_FREEZE); pNext->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE); - ((Unit*)pNext)->SetStandState(UNIT_STAND_STATE_STAND); + pNext->SetStandState(UNIT_STAND_STATE_STAND); pNext->SetInCombatWithZone(); pNext->Attack(pNext->SelectNearestTarget(100),true); diff --git a/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp b/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp index f301c98e2c..64e96b2a70 100644 --- a/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp +++ b/src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp @@ -344,7 +344,7 @@ struct boss_ymironAI : public ScriptedAI void DespawnBoatGhosts(uint64& m_uiCreatureGUID) { if (m_uiCreatureGUID) - if (Creature* pTemp = (Creature*)Unit::GetUnit(*m_creature, m_uiCreatureGUID)) + if (Creature* pTemp = Unit::GetCreature(*m_creature, m_uiCreatureGUID)) pTemp->DisappearAndDie(); m_uiCreatureGUID = 0; diff --git a/src/scripts/northrend/violet_hold/boss_ichoron.cpp b/src/scripts/northrend/violet_hold/boss_ichoron.cpp index 2911b7f146..0c470d2968 100644 --- a/src/scripts/northrend/violet_hold/boss_ichoron.cpp +++ b/src/scripts/northrend/violet_hold/boss_ichoron.cpp @@ -349,7 +349,7 @@ struct mob_ichor_globuleAI : public ScriptedAI { if (pInstance) { - if (Creature* pIchoron = ((Creature*)Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ICHORON)))) + if (Creature* pIchoron = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ICHORON))) { if (m_creature->IsWithinDist(pIchoron, 2.0f , false)) { @@ -367,7 +367,7 @@ struct mob_ichor_globuleAI : public ScriptedAI void JustDied(Unit* pKiller) { DoCast(m_creature, SPELL_SPLASH); - if (Creature* pIchoron = ((Creature*)Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ICHORON)))) + if (Creature* pIchoron = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ICHORON))) if (pIchoron->AI()) pIchoron->AI()->DoAction(ACTION_WATER_ELEMENT_KILLED); } diff --git a/src/scripts/northrend/violet_hold/boss_xevozz.cpp b/src/scripts/northrend/violet_hold/boss_xevozz.cpp index 2e99ea9bd3..7b5461ca11 100644 --- a/src/scripts/northrend/violet_hold/boss_xevozz.cpp +++ b/src/scripts/northrend/violet_hold/boss_xevozz.cpp @@ -252,7 +252,7 @@ struct mob_ethereal_sphereAI : public ScriptedAI { if (pInstance) { - if (Creature* pXevozz = ((Creature*)Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_XEVOZZ)))) + if (Creature* pXevozz = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_XEVOZZ))) { float fDistance = m_creature->GetDistance2d(pXevozz); if (fDistance <= 3) diff --git a/src/scripts/northrend/zuldrak.cpp b/src/scripts/northrend/zuldrak.cpp index 6b43c7bf43..359a7389f3 100644 --- a/src/scripts/northrend/zuldrak.cpp +++ b/src/scripts/northrend/zuldrak.cpp @@ -277,7 +277,7 @@ struct npc_gurgthockAI : public ScriptedAI for(std::list::iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr) { - if (Creature* pTemp = (Creature*)Unit::GetUnit(*m_creature, *itr)) + if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr)) if (pTemp) pTemp->RemoveFromWorld(); }