Merge [SD2]

r1130 Update scripts using common way to initialize heroic and instance data and apply sd2 code style. - skip
r1131 Added more parts of vazruden/nazan -encounter. Note scriptCall MovementInform() must be corrected before this script can work as expected. - skip
r1132 Add custom patch for backport SD2 to 0.12 branch of Mangos. Please note this is not officially supported and bugs are not to be posted in regular way (use own thread in forums for help/improvements) - skip
r1133 Replace some needless use of script function DoSpawnCreature with direct call of SummonCreature.
r1134 Correct timer for najentus spine and remove obsolete code. - skip
r1135 Corrected a few variables in misc scripts, apply SD2 code style - skip
r1136 Added support for quest 12848 - skip (already scripted)
r1137 Correct timer and check if event already begun for mob_illidari - skip
r1138 Remove one custom MoveInLineOfSight and use only for intro
r1139 Remove useless cached copy of creature guid already cached in instance script. Call Reset for boss when encounter actually start to ensure adds list are filled and also simplify some additional for mob's script. - skip
r1140 Restore compile after changes in displayId. Requires Mangos 8015+ - skip
r1141 Added instance script for map 601 - skip (already have better)

--HG--
branch : trunk
This commit is contained in:
Kudlaty
2009-08-06 20:35:18 +02:00
parent 87f573752e
commit 6eb19cbe0f
14 changed files with 49 additions and 64 deletions

View File

@@ -228,7 +228,7 @@ struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI
{
DoScriptText(SAY_DEATH, m_creature);
//When Exarch Maladar is defeated D'ore appear.
DoSpawnCreature(19412,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN, 600000);
m_creature->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000);
}
void UpdateAI(const uint32 diff)
@@ -268,7 +268,7 @@ struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI
soulclass = target->getClass();
DoCast(target,SPELL_STOLEN_SOUL);
DoSpawnCreature(ENTRY_STOLEN_SOUL,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
m_creature->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
StolenSoul_Timer = 20000 + rand()% 10000;
} else StolenSoul_Timer = 1000;

View File

@@ -227,23 +227,11 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
void EnterCombat(Unit *who) {}
void MoveInLineOfSight(Unit *who)
void MoveInLineOfSight(Unit* pWho)
{
if(!who || (!who->isAlive())) return;
if(who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
if (!Intro && pWho->GetTypeId() == TYPEID_PLAYER && pWho->isTargetableForAttack() && m_creature->IsHostileTo(pWho) && pWho->isInAccessiblePlaceFor(m_creature))
{
float attackRadius = m_creature->GetAttackDistance(who);
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
{
//if(who->HasStealthAura())
// who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
m_creature->AddThreat(who, 1.0f);
}
if(!m_creature->isInCombat() && !Intro && m_creature->IsWithinDistInMap(who, 60.0f) && (who->GetTypeId() == TYPEID_PLAYER))
if (m_creature->IsWithinDistInMap(pWho, VISIBLE_RANGE) && m_creature->IsWithinLOSInMap(pWho))
{
if(pInstance)
pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS);
@@ -252,10 +240,12 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoScriptText(SAY_INTRO, m_creature);
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
AggroTargetGUID = who->GetGUID();
AggroTargetGUID = pWho->GetGUID();
Intro = true;
}
}
ScriptedAI::MoveInLineOfSight(pWho);
}
void KilledUnit(Unit *victim)

View File

@@ -65,7 +65,7 @@ struct TRINITY_DLL_DECL mob_webbed_creatureAI : public ScriptedAI
}
if(spawnCreatureID)
DoSpawnCreature(spawnCreatureID,0,0,0,m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
m_creature->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
}
};
CreatureAI* GetAI_mob_webbed_creature(Creature *_Creature)

View File

@@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL mobs_ghoul_flayerAI : public ScriptedAI
void JustDied(Unit* Killer)
{
if( Killer->GetTypeId() == TYPEID_PLAYER )
DoSpawnCreature(11064, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 60000);
m_creature->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000);
}
};

View File

@@ -215,8 +215,8 @@ struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoSpawnCreature(NPC_LEFT_HEAD,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,90000);
DoSpawnCreature(NPC_RIGHT_HEAD,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,90000);
m_creature->SummonCreature(NPC_LEFT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0);
m_creature->SummonCreature(NPC_RIGHT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0);
if (Unit *pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID))
{

View File

@@ -81,8 +81,7 @@ struct TRINITY_DLL_DECL boss_midnightAI : public ScriptedAI
if(Phase == 1 && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 95)
{
Phase = 2;
Creature *pAttumen = DoSpawnCreature(SUMMON_ATTUMEN, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
if(pAttumen)
if (Creature* pAttumen = m_creature->SummonCreature(SUMMON_ATTUMEN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000))
{
Attumen = pAttumen->GetGUID();
pAttumen->AI()->AttackStart(m_creature->getVictim());

View File

@@ -415,12 +415,10 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
else
DoScriptText(SAY_BLIZZARD2, m_creature);
Creature* Spawn = NULL;
Spawn = DoSpawnCreature(CREATURE_ARAN_BLIZZARD, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 25000);
if (Spawn)
if (Creature* pSpawn = m_creature->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000))
{
Spawn->setFaction(m_creature->getFaction());
Spawn->CastSpell(Spawn, SPELL_CIRCULAR_BLIZZARD, false);
pSpawn->setFaction(m_creature->getFaction());
pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false);
}
break;
}
@@ -434,8 +432,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
for (uint32 i = 0; i < 4; i++)
{
Creature* pUnit = DoSpawnCreature(CREATURE_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 90000);
if (pUnit)
if (Creature* pUnit = m_creature->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000))
{
pUnit->Attack(m_creature->getVictim(), true);
pUnit->setFaction(m_creature->getFaction());
@@ -449,8 +446,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
{
for (uint32 i = 0; i < 5; i++)
{
Creature* pUnit = DoSpawnCreature(CREATURE_SHADOW_OF_ARAN, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
if (pUnit)
if (Creature* pUnit = m_creature->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
{
pUnit->Attack(m_creature->getVictim(), true);
pUnit->setFaction(m_creature->getFaction());

View File

@@ -243,12 +243,11 @@ struct TRINITY_DLL_DECL mob_titoAI : public ScriptedAI
void boss_dorotheeAI::SummonTito()
{
Creature* Tito = DoSpawnCreature(CREATURE_TITO, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
if(Tito)
if (Creature* pTito = m_creature->SummonCreature(CREATURE_TITO, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
{
DoScriptText(SAY_DOROTHEE_SUMMON, m_creature);
CAST_AI(mob_titoAI, Tito->AI())->DorotheeGUID = m_creature->GetGUID();
Tito->AI()->AttackStart(m_creature->getVictim());
CAST_AI(mob_titoAI, pTito->AI())->DorotheeGUID = m_creature->GetGUID();
pTito->AI()->AttackStart(m_creature->getVictim());
SummonedTito = true;
TitoDied = false;
}

View File

@@ -511,7 +511,7 @@ struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI
void JustDied(Unit* slayer)
{
DoSpawnCreature(CREATURE_PHOENIX_EGG, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
m_creature->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
}
void UpdateAI(const uint32 diff)
@@ -531,7 +531,7 @@ struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI
if (Death_Timer < diff)
{
DoSpawnCreature(CREATURE_PHOENIX_EGG, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
m_creature->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
m_creature->setDeathState(JUST_DIED);
m_creature->RemoveCorpse();
Rebirth = false;
@@ -576,7 +576,7 @@ struct TRINITY_DLL_DECL mob_felkael_phoenix_eggAI : public ScriptedAI
{
if (HatchTimer < diff)
{
DoSpawnCreature(CREATURE_PHOENIX, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
m_creature->SummonCreature(CREATURE_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}else HatchTimer -= diff;

View File

@@ -143,10 +143,10 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
m_creature->CastSpell(m_creature,SPELL_SUMMON_PURE_ENERGY,false);
//below are workaround summons, remove when summoning spells w/implicitTarget 73 implemented in Mangos
DoSpawnCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
m_creature->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (Heroic)
DoSpawnCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
m_creature->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
}
if (ChainLightningTimer < diff)

View File

@@ -147,7 +147,7 @@ struct TRINITY_DLL_DECL mob_restless_soulAI : public ScriptedAI
void JustDied(Unit* Killer)
{
if (Tagged)
DoSpawnCreature(ENTRY_FREED, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 300000);
m_creature->SummonCreature(ENTRY_FREED, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000);
}
void UpdateAI(const uint32 diff)

View File

@@ -913,8 +913,8 @@ struct TRINITY_DLL_DECL eye_tentacleAI : public Scripted_NoMovementAI
{
eye_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
{
if (Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0))
Portal = p->GetGUID();
if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0))
Portal = pPortal->GetGUID();
}
uint32 MindflayTimer;
@@ -972,8 +972,8 @@ struct TRINITY_DLL_DECL claw_tentacleAI : public Scripted_NoMovementAI
{
claw_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
{
if (Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0))
Portal = p->GetGUID();
if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0))
Portal = pPortal->GetGUID();
}
uint32 GroundRuptureTimer;
@@ -1026,8 +1026,8 @@ struct TRINITY_DLL_DECL claw_tentacleAI : public Scripted_NoMovementAI
if (!target->HasAura(SPELL_DIGESTIVE_ACID))
{
m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
if (Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0))
Portal = p->GetGUID();
if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0))
Portal = pPortal->GetGUID();
GroundRuptureTimer = 500;
HamstringTimer = 2000;
@@ -1061,8 +1061,8 @@ struct TRINITY_DLL_DECL giant_claw_tentacleAI : public Scripted_NoMovementAI
{
giant_claw_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
{
if (Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0))
Portal = p->GetGUID();
if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0))
Portal = pPortal->GetGUID();
}
uint32 GroundRuptureTimer;
@@ -1117,8 +1117,8 @@ struct TRINITY_DLL_DECL giant_claw_tentacleAI : public Scripted_NoMovementAI
if (!target->HasAura(SPELL_DIGESTIVE_ACID))
{
m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
if (Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0))
Portal = p->GetGUID();
if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0))
Portal = pPortal->GetGUID();
GroundRuptureTimer = 500;
HamstringTimer = 2000;
@@ -1160,8 +1160,8 @@ struct TRINITY_DLL_DECL giant_eye_tentacleAI : public Scripted_NoMovementAI
{
giant_eye_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
{
if (Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0))
Portal = p->GetGUID();
if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0))
Portal = pPortal->GetGUID();
}
uint32 BeamTimer;

View File

@@ -219,14 +219,15 @@ struct TRINITY_DLL_DECL mob_netherweb_victimAI : public ScriptedAI
{
if( rand()%100 < 25 )
{
DoSpawnCreature(QUEST_TARGET,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
m_creature->SummonCreature(QUEST_TARGET, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
CAST_PLR(Killer)->KilledMonsterCredit(QUEST_TARGET, m_creature->GetGUID());
}else
DoSpawnCreature(netherwebVictims[rand()%6],0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
}
else
m_creature->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
if( rand()%100 < 75 )
DoSpawnCreature(netherwebVictims[rand()%6],0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
DoSpawnCreature(netherwebVictims[rand()%6],0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
m_creature->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f,0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
m_creature->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
}
}
}

View File

@@ -167,7 +167,7 @@ struct TRINITY_DLL_DECL npc_the_scourge_cauldronAI : public ScriptedAI
if( CAST_PLR(who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE ||
CAST_PLR(who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE )
{
DoSpawnCreature(11075,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
m_creature->SummonCreature(11075, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
DoDie();
}
break;
@@ -175,7 +175,7 @@ struct TRINITY_DLL_DECL npc_the_scourge_cauldronAI : public ScriptedAI
if( CAST_PLR(who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE ||
CAST_PLR(who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE )
{
DoSpawnCreature(11077,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
m_creature->SummonCreature(11077, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
DoDie();
}
break;
@@ -183,7 +183,7 @@ struct TRINITY_DLL_DECL npc_the_scourge_cauldronAI : public ScriptedAI
if( CAST_PLR(who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE ||
CAST_PLR(who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE )
{
DoSpawnCreature(11078,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
m_creature->SummonCreature(11078, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
DoDie();
}
break;
@@ -191,7 +191,7 @@ struct TRINITY_DLL_DECL npc_the_scourge_cauldronAI : public ScriptedAI
if( CAST_PLR(who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE ||
CAST_PLR(who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE )
{
DoSpawnCreature(11076,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
m_creature->SummonCreature(11076, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
DoDie();
}
break;