--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 */
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;
+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;
}
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;
+2 -2
View File
@@ -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());
+1 -3
View File
@@ -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();
+1
View File
@@ -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
@@ -254,6 +254,7 @@ struct pyrewood_ambushAI : public ScriptedAI
if (PlayerGUID)
{
pPlayer = Unit::GetPlayer(PlayerGUID);
if (pPlayer)
pTarget = RAND((Unit*)m_creature, (Unit*)pPlayer);
} else
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)
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)
+38
View File
@@ -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();
}
@@ -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);
@@ -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)
@@ -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);
@@ -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;
@@ -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);
@@ -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);
@@ -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;
@@ -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);
}
@@ -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)
+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)
{
if (Creature* pTemp = (Creature*)Unit::GetUnit(*m_creature, *itr))
if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr))
if (pTemp)
pTemp->RemoveFromWorld();
}