aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Map.cpp12
-rw-r--r--src/game/SocialMgr.cpp4
-rw-r--r--src/game/Spell.cpp4
-rw-r--r--src/game/World.h1
-rw-r--r--src/scripts/eastern_kingdoms/silverpine_forest.cpp3
-rw-r--r--src/scripts/northrend/borean_tundra.cpp2
-rw-r--r--src/scripts/northrend/dalaran.cpp38
-rw-r--r--src/scripts/northrend/nexus/nexus/boss_keristrasza.cpp2
-rw-r--r--src/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp51
-rw-r--r--src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp10
-rw-r--r--src/scripts/northrend/ulduar/ulduar/boss_algalon.cpp2
-rw-r--r--src/scripts/northrend/ulduar/ulduar/ulduar_teleporter.cpp2
-rw-r--r--src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp2
-rw-r--r--src/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp2
-rw-r--r--src/scripts/northrend/violet_hold/boss_ichoron.cpp4
-rw-r--r--src/scripts/northrend/violet_hold/boss_xevozz.cpp2
-rw-r--r--src/scripts/northrend/zuldrak.cpp2
17 files changed, 93 insertions, 50 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index 1214247efaf..dc20e33047c 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/SocialMgr.cpp b/src/game/SocialMgr.cpp
index c619da3178d..f11cc092ba0 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());
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 248a390c0b8..bad60d69cfd 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();
diff --git a/src/game/World.h b/src/game/World.h
index 1f3f9b87601..87450bc4828 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
diff --git a/src/scripts/eastern_kingdoms/silverpine_forest.cpp b/src/scripts/eastern_kingdoms/silverpine_forest.cpp
index 21667d1fc91..d7319a6e290 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 e4939cdb637..c07d2c58d60 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/dalaran.cpp b/src/scripts/northrend/dalaran.cpp
index 903118444ae..61dc6abc7cb 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();
}
diff --git a/src/scripts/northrend/nexus/nexus/boss_keristrasza.cpp b/src/scripts/northrend/nexus/nexus/boss_keristrasza.cpp
index 76faf74856e..bb020c911b2 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);
diff --git a/src/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp b/src/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp
index 84687732860..c5632f6c181 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)
diff --git a/src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp b/src/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp
index fa870d069d1..c87687ab721 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 e8fae4512ea..5ba5d011d1e 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 8489bf4272b..9330de94e6e 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 cb37b9fe50c..36a0f237787 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 f301c98e2c5..64e96b2a70e 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 2911b7f1463..0c470d2968e 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 2e99ea9bd3d..7b5461ca11c 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 6b43c7bf430..359a7389f3a 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<uint64>::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();
}