--HG--
branch : trunk
This commit is contained in:
Brian
2010-04-01 12:56:52 -06:00
19 changed files with 95 additions and 50 deletions
+1
View File
@@ -518,6 +518,7 @@ UPDATE `creature_template` SET `ScriptName`='mob_shield_generator_channel' WHERE
/* DALARAN */ /* DALARAN */
UPDATE `creature_template` SET `ScriptName`='npc_mageguard_dalaran' WHERE `entry` IN (29254,29255); 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 */ /* DARKSHORE */
UPDATE `creature_template` SET `ScriptName`='npc_kerlonian' WHERE `entry`=11218; UPDATE `creature_template` SET `ScriptName`='npc_kerlonian' WHERE `entry`=11218;
+1
View File
@@ -0,0 +1 @@
UPDATE `creature_template` SET `ScriptName`='npc_hira_snowdawn' WHERE `entry`=31238;
+12
View File
@@ -3714,6 +3714,18 @@ void Map::ScriptsProcess()
break; 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: default:
sLog.outError("Unknown script command %u called.",step.script->command); sLog.outError("Unknown script command %u called.",step.script->command);
break; break;
+2 -2
View File
@@ -313,8 +313,8 @@ PlayerSocial *SocialMgr::LoadFromDB(QueryResult_AutoPtr result, uint32 guid)
social->m_playerSocialMap[friend_guid] = FriendInfo(flags, note); social->m_playerSocialMap[friend_guid] = FriendInfo(flags, note);
// client limit // client's friends list and ignore list limit
if(social->m_playerSocialMap.size() >= 50) if(social->m_playerSocialMap.size() >= (SOCIALMGR_FRIEND_LIMIT + SOCIALMGR_IGNORE_LIMIT))
break; break;
} }
while (result->NextRow()); while (result->NextRow());
+1 -3
View File
@@ -5029,10 +5029,8 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_TARGET_UNSKINNABLE; return SPELL_FAILED_TARGET_UNSKINNABLE;
Creature* creature = m_targets.getUnitTarget()->ToCreature(); 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; return SPELL_FAILED_TARGET_NOT_LOOTED;
}
uint32 skill = creature->GetCreatureInfo()->GetRequiredLootSkill(); uint32 skill = creature->GetCreatureInfo()->GetRequiredLootSkill();
+1
View File
@@ -415,6 +415,7 @@ enum RealmZone
//trinity only //trinity only
#define SCRIPT_COMMAND_ORIENTATION 30 // o = orientation #define SCRIPT_COMMAND_ORIENTATION 30 // o = orientation
#define SCRIPT_COMMAND_EQUIP 31 // datalong = equipment id #define SCRIPT_COMMAND_EQUIP 31 // datalong = equipment id
#define SCRIPT_COMMAND_MODEL 32 // datalong = model id
/// Storage class for commands issued for delayed execution /// Storage class for commands issued for delayed execution
struct CliCommandHolder struct CliCommandHolder
@@ -254,7 +254,8 @@ struct pyrewood_ambushAI : public ScriptedAI
if (PlayerGUID) if (PlayerGUID)
{ {
pPlayer = Unit::GetPlayer(PlayerGUID); pPlayer = Unit::GetPlayer(PlayerGUID);
pTarget = RAND((Unit*)m_creature, (Unit*)pPlayer); if (pPlayer)
pTarget = RAND((Unit*)m_creature, (Unit*)pPlayer);
} else } else
pTarget = m_creature; pTarget = m_creature;
+1 -1
View File
@@ -672,7 +672,7 @@ struct npc_nesingwary_trapperAI : public ScriptedAI
if (go_caribou && go_caribou->GetTypeId() == TYPEID_GAMEOBJECT) if (go_caribou && go_caribou->GetTypeId() == TYPEID_GAMEOBJECT)
go_caribou->SetLootState(GO_JUST_DEACTIVATED); go_caribou->SetLootState(GO_JUST_DEACTIVATED);
if (TempSummon *summon = (TempSummon*)m_creature) if (TempSummon *summon = m_creature->ToTempSummon())
if (summon->isSummon()) if (summon->isSummon())
if (Unit *pTemp = summon->GetSummoner()) if (Unit *pTemp = summon->GetSummoner())
if (pTemp->GetTypeId() == TYPEID_PLAYER) if (pTemp->GetTypeId() == TYPEID_PLAYER)
+38
View File
@@ -105,6 +105,38 @@ CreatureAI* GetAI_npc_mageguard_dalaran(Creature* pCreature)
return new npc_mageguard_dalaranAI(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() void AddSC_dalaran()
{ {
Script *newscript; Script *newscript;
@@ -113,4 +145,10 @@ void AddSC_dalaran()
newscript->Name = "npc_mageguard_dalaran"; newscript->Name = "npc_mageguard_dalaran";
newscript->GetAI = &GetAI_npc_mageguard_dalaran; newscript->GetAI = &GetAI_npc_mageguard_dalaran;
newscript->RegisterSelf(); newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_hira_snowdawn";
newscript->pGossipHello = &GossipHello_npc_hira_snowdawn;
newscript->pGossipSelect = &GossipSelect_npc_hira_snowdawn;
newscript->RegisterSelf();
} }
@@ -177,7 +177,7 @@ struct boss_keristraszaAI : public ScriptedAI
uiCheckIntenseColdTimer = 2*IN_MILISECONDS; uiCheckIntenseColdTimer = 2*IN_MILISECONDS;
} else uiCheckIntenseColdTimer -= diff; } else uiCheckIntenseColdTimer -= diff;
if (!bEnrage && (m_creature->GetHealth() < HealthBelowPct(25))) if (!bEnrage && HealthBelowPct(25))
{ {
DoScriptText(SAY_ENRAGE, m_creature); DoScriptText(SAY_ENRAGE, m_creature);
DoCast(m_creature, SPELL_ENRAGE); DoCast(m_creature, SPELL_ENRAGE);
@@ -163,13 +163,33 @@ struct boss_magus_telestraAI : public ScriptedAI
return 0; 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) void UpdateAI(const uint32 diff)
{ {
//Return since we have no target //Return since we have no target
if (!UpdateVictim()) if (!UpdateVictim())
{
return; return;
}
if (bIsWaitingToAppear) if (bIsWaitingToAppear)
{ {
@@ -185,33 +205,6 @@ struct boss_magus_telestraAI : public ScriptedAI
if ((Phase == 1) ||(Phase == 3)) 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) if (bIsAchievementTimerRunning)
uiAchievementTimer += diff; uiAchievementTimer += diff;
if (bFireMagusDead && bFrostMagusDead && bArcaneMagusDead) if (bFireMagusDead && bFrostMagusDead && bArcaneMagusDead)
@@ -1073,8 +1073,8 @@ struct mob_acolyte_of_shadronAI : public ScriptedAI
{ {
Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 999, true); Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 999, true);
Creature* pShadron = NULL; Creature* pShadron = NULL;
Creature* pSartharion = ((Creature*)Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SARTHARION))); Creature* pSartharion = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SARTHARION));
if (Creature* pShadron = ((Creature*)Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SHADRON)))) 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 not solo figth, buff main boss, else place debuff on mini-boss. both spells TARGET_SCRIPT
if (pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) if (pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
pSartharion->CastSpell(m_creature, SPELL_GIFT_OF_TWILIGTH_SAR, true); 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) if (pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
{ {
//not solo fight, so main boss has deduff //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)) if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SAR))
pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SAR); pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SAR);
} }
else else
{ {
//event not in progress, then solo fight and must remove debuff mini-boss //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)) if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA))
pDebuffTarget->RemoveAurasDueToSpell(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 // remove twilight torment on Vesperon
if (pInstance) 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)) if (pVesperon && pVesperon->isAlive() && pVesperon->HasAura(SPELL_TWILIGHT_TORMENT_VESP))
pVesperon->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP); pVesperon->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP);
@@ -333,7 +333,7 @@ struct mob_collapsing_starAI : public ScriptedAI
{ {
mob_collapsing_starAI(Creature *pCreature) : ScriptedAI(pCreature) mob_collapsing_starAI(Creature *pCreature) : ScriptedAI(pCreature)
{ {
pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); pInstance = pCreature->GetInstanceData();
} }
ScriptedInstance* pInstance; ScriptedInstance* pInstance;
@@ -23,7 +23,7 @@ The teleporter appears to be active and stable.
bool GoHello_ulduar_teleporter( Player *pPlayer, GameObject *pGO ) bool GoHello_ulduar_teleporter( Player *pPlayer, GameObject *pGO )
{ {
ScriptedInstance *pInstance = (ScriptedInstance *) pGO->GetInstanceData(); ScriptedInstance *pInstance = pGO->GetInstanceData();
if(!pInstance) return true; if(!pInstance) return true;
pPlayer->ADD_GOSSIP_ITEM(0, "Teleport to the Expedition Base Camp", GOSSIP_SENDER_MAIN, BASE_CAMP); pPlayer->ADD_GOSSIP_ITEM(0, "Teleport to the Expedition Base Camp", GOSSIP_SENDER_MAIN, BASE_CAMP);
@@ -723,7 +723,7 @@ struct mob_palehoof_orbAI : public ScriptedAI
{ {
pNext->RemoveAurasDueToSpell(SPELL_FREEZE); 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); 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->SetInCombatWithZone();
pNext->Attack(pNext->SelectNearestTarget(100),true); pNext->Attack(pNext->SelectNearestTarget(100),true);
@@ -344,7 +344,7 @@ struct boss_ymironAI : public ScriptedAI
void DespawnBoatGhosts(uint64& m_uiCreatureGUID) void DespawnBoatGhosts(uint64& m_uiCreatureGUID)
{ {
if (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(); pTemp->DisappearAndDie();
m_uiCreatureGUID = 0; m_uiCreatureGUID = 0;
@@ -349,7 +349,7 @@ struct mob_ichor_globuleAI : public ScriptedAI
{ {
if (pInstance) 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)) if (m_creature->IsWithinDist(pIchoron, 2.0f , false))
{ {
@@ -367,7 +367,7 @@ struct mob_ichor_globuleAI : public ScriptedAI
void JustDied(Unit* pKiller) void JustDied(Unit* pKiller)
{ {
DoCast(m_creature, SPELL_SPLASH); 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()) if (pIchoron->AI())
pIchoron->AI()->DoAction(ACTION_WATER_ELEMENT_KILLED); pIchoron->AI()->DoAction(ACTION_WATER_ELEMENT_KILLED);
} }
@@ -252,7 +252,7 @@ struct mob_ethereal_sphereAI : public ScriptedAI
{ {
if (pInstance) 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); float fDistance = m_creature->GetDistance2d(pXevozz);
if (fDistance <= 3) if (fDistance <= 3)
+1 -1
View File
@@ -277,7 +277,7 @@ struct npc_gurgthockAI : public ScriptedAI
for(std::list<uint64>::iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr) 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) if (pTemp)
pTemp->RemoveFromWorld(); pTemp->RemoveFromWorld();
} }