*Merged Scriptdev2 800

*Moved Scalding Water under function not used yet.

--HG--
branch : trunk
This commit is contained in:
Blaymoira
2008-12-15 18:54:16 +01:00
parent 8a0ca6b6a1
commit 9b1357a332
21 changed files with 1006 additions and 62 deletions
+3
View File
@@ -146,6 +146,9 @@ scripts/zone/burning_steppes/burning_steppes.cpp \
scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp \
scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp \
scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp \
scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp \
scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h \
scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp \
scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp \
scripts/zone/caverns_of_time/hyjal/def_hyjal.h \
scripts/zone/caverns_of_time/hyjal/hyjal.cpp \
+10 -6
View File
@@ -17,7 +17,6 @@
#endif _TRINITY_SCRIPT_CONFIG
//*** Global data ***
int num_db_scripts;
int num_sc_scripts;
Script *m_scripts[MAX_SCRIPTS];
@@ -230,6 +229,8 @@ extern void AddSC_old_hillsbrad();
extern void AddSC_boss_aeonus();
extern void AddSC_boss_chrono_lord_deja();
extern void AddSC_boss_temporus();
extern void AddSC_dark_portal();
extern void AddSC_instance_dark_portal();
//Coilfang Resevoir
//--Serpent Shrine Cavern
@@ -570,6 +571,8 @@ extern void AddSC_winterspring();
extern void AddSC_zangarmarsh();
//Zul'Farrak
extern void AddSC_zulfarrak();
//Zul'Gurub
extern void AddSC_boss_jeklik();
extern void AddSC_boss_venoxis();
@@ -1193,10 +1196,9 @@ void ScriptsFree()
delete []SpellSummary;
// Free resources before library unload
for(int i=0;i<num_db_scripts;i++)
for(int i=0;i<num_sc_scripts;i++)
delete m_scripts[i];
num_db_scripts = 0;
num_sc_scripts = 0;
}
@@ -1248,8 +1250,6 @@ void ScriptsInit()
if (CanLoadDB)
LoadDatabase();
num_db_scripts = GetScriptNames().size();
outstring_log("TSCR: Loading C++ scripts");
barGoLink bar(1);
bar.step();
@@ -1426,6 +1426,8 @@ void ScriptsInit()
AddSC_boss_aeonus();
AddSC_boss_chrono_lord_deja();
AddSC_boss_temporus();
AddSC_dark_portal();
AddSC_instance_dark_portal();
//Coilfang Resevoir
//--Serpent Shrine Cavern
@@ -1765,6 +1767,8 @@ void ScriptsInit()
AddSC_zangarmarsh();
//Zul'Farrak
AddSC_zulfarrak();
//Zul'Gurub
AddSC_boss_jeklik();
AddSC_boss_venoxis();
@@ -1793,7 +1797,7 @@ void ScriptsInit()
// -------------------
outstring_log(">> Loaded %i C++ Scripts (of %i ScriptNames defined in Mangos database)", num_sc_scripts, num_db_scripts);
outstring_log(">> Loaded %i C++ Scripts.", num_sc_scripts);
}
//*********************************
@@ -1847,6 +1847,18 @@
RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_temporus.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\caverns_of_time\dark_portal\dark_portal.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\caverns_of_time\dark_portal\def_dark_portal.h"
>
</File>
<File
RelativePath="..\scripts\zone\caverns_of_time\dark_portal\instance_dark_portal.cpp"
>
</File>
</Filter>
<Filter
Name="Battle for Mt. Hyjal"
@@ -2024,6 +2024,18 @@
RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_temporus.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\caverns_of_time\dark_portal\dark_portal.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\caverns_of_time\dark_portal\def_dark_portal.h"
>
</File>
<File
RelativePath="..\scripts\zone\caverns_of_time\dark_portal\instance_dark_portal.cpp"
>
</File>
</Filter>
<Filter
Name="Battle for Mt. Hyjal"
@@ -2017,6 +2017,18 @@
RelativePath="..\scripts\zone\caverns_of_time\dark_portal\boss_temporus.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\caverns_of_time\dark_portal\dark_portal.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\caverns_of_time\dark_portal\def_dark_portal.h"
>
</File>
<File
RelativePath="..\scripts\zone\caverns_of_time\dark_portal\instance_dark_portal.cpp"
>
</File>
</Filter>
<Filter
Name="Battle for Mt. Hyjal"
@@ -47,6 +47,7 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI
boss_ambassador_hellmawAI(Creature *c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
HeroicMode = m_creature->GetMap()->IsHeroic();
Reset();
}
@@ -62,8 +63,6 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI
void Reset()
{
HeroicMode = m_creature->GetMap()->IsHeroic();
EventCheck_Timer = 5000;
CorrosiveAcid_Timer = 25000;
Fear_Timer = 40000;
@@ -89,6 +88,14 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI
}
}
void MoveInLineOfSight(Unit *who)
{
if (m_creature->HasAura(SPELL_BANISH,0))
return;
ScriptedAI::MoveInLineOfSight(who);
}
void MovementInform(uint32 type, uint32 id)
{
if (type != POINT_MOTION_TYPE)
@@ -22,6 +22,7 @@ SDCategory: Caverns of Time, The Dark Portal
EndScriptData */
#include "precompiled.h"
#include "def_dark_portal.h"
#define SAY_ENTER -1269012
#define SAY_AGGRO -1269013
@@ -29,6 +30,7 @@ EndScriptData */
#define SAY_SLAY1 -1269015
#define SAY_SLAY2 -1269016
#define SAY_DEATH -1269017
#define EMOTE_FRENZY -1269018
#define SPELL_CLEAVE 40504
#define SPELL_TIME_STOP 31422
@@ -38,7 +40,15 @@ EndScriptData */
struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI
{
boss_aeonusAI(Creature *c) : ScriptedAI(c) {Reset();}
boss_aeonusAI(Creature *c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
HeroicMode = m_creature->GetMap()->IsHeroic();
Reset();
}
ScriptedInstance *pInstance;
bool HeroicMode;
uint32 SandBreath_Timer;
uint32 TimeStop_Timer;
@@ -56,9 +66,27 @@ struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI
DoScriptText(SAY_AGGRO, m_creature);
}
void MoveInLineOfSight(Unit *who)
{
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
{
if (m_creature->IsWithinDistInMap(who,20.0f))
{
DoScriptText(SAY_BANISH, m_creature);
m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
ScriptedAI::MoveInLineOfSight(who);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
if (pInstance)
pInstance->SetData(TYPE_RIFT,DONE);
}
void KilledUnit(Unit *victim)
@@ -79,18 +107,13 @@ struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI
//Sand Breath
if (SandBreath_Timer < diff)
{
Unit* target = NULL;
target = m_creature->getVictim();
if (target)
DoCast(target, SPELL_SAND_BREATH);
DoCast(m_creature->getVictim(), SPELL_SAND_BREATH);
SandBreath_Timer = 30000;
}else SandBreath_Timer -= diff;
//Time Stop
if (TimeStop_Timer < diff)
{
DoScriptText(SAY_BANISH, m_creature);
DoCast(m_creature->getVictim(), SPELL_TIME_STOP);
TimeStop_Timer = 40000;
}else TimeStop_Timer -= diff;
@@ -98,6 +121,7 @@ struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI
//Frenzy
if (Frenzy_Timer < diff)
{
DoScriptText(EMOTE_FRENZY, m_creature);
DoCast(m_creature, SPELL_ENRAGE);
Frenzy_Timer = 120000;
}else Frenzy_Timer -= diff;
@@ -22,6 +22,7 @@ SDCategory: Caverns of Time, The Dark Portal
EndScriptData */
#include "precompiled.h"
#include "def_dark_portal.h"
#define SAY_ENTER -1269006
#define SAY_AGGRO -1269007
@@ -39,7 +40,15 @@ EndScriptData */
struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI
{
boss_chrono_lord_dejaAI(Creature *c) : ScriptedAI(c) {Reset();}
boss_chrono_lord_dejaAI(Creature *c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
HeroicMode = m_creature->GetMap()->IsHeroic();
Reset();
}
ScriptedInstance *pInstance;
bool HeroicMode;
uint32 ArcaneBlast_Timer;
uint32 TimeLapse_Timer;
@@ -55,6 +64,21 @@ struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI
DoScriptText(SAY_AGGRO, m_creature);
}
void MoveInLineOfSight(Unit *who)
{
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
{
if (m_creature->IsWithinDistInMap(who,20.0f))
{
DoScriptText(SAY_BANISH, m_creature);
m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
ScriptedAI::MoveInLineOfSight(who);
}
void KilledUnit(Unit *victim)
{
switch(rand()%2)
@@ -67,6 +91,9 @@ struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
if (pInstance)
pInstance->SetData(TYPE_RIFT,SPECIAL);
}
void UpdateAI(const uint32 diff)
@@ -22,6 +22,7 @@ SDCategory: Caverns of Time, The Dark Portal
EndScriptData */
#include "precompiled.h"
#include "def_dark_portal.h"
#define SAY_ENTER -1269000
#define SAY_AGGRO -1269001
@@ -38,7 +39,15 @@ EndScriptData */
struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI
{
boss_temporusAI(Creature *c) : ScriptedAI(c) {Reset();}
boss_temporusAI(Creature *c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
HeroicMode = m_creature->GetMap()->IsHeroic();
Reset();
}
ScriptedInstance *pInstance;
bool HeroicMode;
uint32 Haste_Timer;
uint32 SpellReflection_Timer;
@@ -69,20 +78,19 @@ struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
if (pInstance)
pInstance->SetData(TYPE_RIFT,SPECIAL);
}
void MoveInLineOfSight(Unit *who)
{
if (!who || m_creature->getVictim())
return;
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT)
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
{
if(((Creature*)who)->GetEntry() == 17918 && m_creature->IsWithinDistInMap(who,20))
if (m_creature->IsWithinDistInMap(who,20.0f))
{
//This is the wrong yell & sound for despawning time keepers!
DoScriptText(SAY_ENTER, m_creature);
DoScriptText(SAY_BANISH, m_creature);
m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
@@ -107,8 +115,6 @@ struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI
//Spell Reflection
if (SpellReflection_Timer < diff)
{
DoScriptText(SAY_BANISH, m_creature);
DoCast(m_creature, SPELL_REFLECT);
SpellReflection_Timer = 40000+rand()%10000;
}else SpellReflection_Timer -= diff;
@@ -0,0 +1,405 @@
/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Dark_Portal
SD%Complete: 30
SDComment: Misc NPC's and mobs for instance. Most here far from complete.
SDCategory: Caverns of Time, The Dark Portal
EndScriptData */
/* ContentData
npc_medivh_bm
npc_time_rift
npc_saat
EndContentData */
#include "precompiled.h"
#include "def_dark_portal.h"
#define SAY_ENTER -1269020 //where does this belong?
#define SAY_INTRO -1269021
#define SAY_WEAK75 -1269022
#define SAY_WEAK50 -1269023
#define SAY_WEAK25 -1269024
#define SAY_DEATH -1269025
#define SAY_WIN -1269026
#define SAY_ORCS_ENTER -1269027
#define SAY_ORCS_ANSWER -1269028
#define SPELL_CHANNEL 31556
#define SPELL_PORTAL_RUNE 32570 //aura(portal on ground effect)
#define SPELL_BLACK_CRYSTAL 32563 //aura
#define SPELL_PORTAL_CRYSTAL 32564 //summon
#define SPELL_BANISH_PURPLE 32566 //aura
#define SPELL_BANISH_GREEN 32567 //aura
#define SPELL_CORRUPT 31326
#define SPELL_CORRUPT_AEONUS 37853
#define C_COUNCIL_ENFORCER 17023
struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
{
npc_medivh_bmAI(Creature *c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Reset();
}
ScriptedInstance *pInstance;
uint32 SpellCorrupt_Timer;
uint32 Check_Timer;
bool Life75;
bool Life50;
bool Life25;
void Reset()
{
SpellCorrupt_Timer = 0;
if (!pInstance)
return;
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
m_creature->CastSpell(m_creature,SPELL_CHANNEL,true);
else if (m_creature->HasAura(SPELL_CHANNEL,0))
m_creature->RemoveAura(SPELL_CHANNEL,0);
m_creature->CastSpell(m_creature,SPELL_PORTAL_RUNE,true);
}
void MoveInLineOfSight(Unit *who)
{
if (!pInstance)
return;
if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f))
{
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
return;
DoScriptText(SAY_INTRO, m_creature);
pInstance->SetData(TYPE_MEDIVH,IN_PROGRESS);
m_creature->CastSpell(m_creature,SPELL_CHANNEL,false);
Check_Timer = 5000;
}
else if (who->GetTypeId() == TYPEID_UNIT && m_creature->IsWithinDistInMap(who, 15.0f))
{
if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS)
return;
uint32 entry = who->GetEntry();
if (entry == C_ASSAS || entry == C_WHELP || entry == C_CHRON || entry == C_EXECU || entry == C_VANQU)
{
who->StopMoving();
who->CastSpell(m_creature,SPELL_CORRUPT,false);
}
else if (entry == C_AEONUS)
{
who->StopMoving();
who->CastSpell(m_creature,SPELL_CORRUPT_AEONUS,false);
}
}
}
void AttackStart(Unit *who)
{
//if (pInstance && pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
//return;
//ScriptedAI::AttackStart(who);
}
void Aggro(Unit *who) {}
void SpellHit(Unit* caster, const SpellEntry* spell)
{
if (SpellCorrupt_Timer)
return;
if (spell->Id == SPELL_CORRUPT_AEONUS)
SpellCorrupt_Timer = 1000;
if (spell->Id == SPELL_CORRUPT)
SpellCorrupt_Timer = 3000;
}
void JustDied(Unit* Killer)
{
if (Killer->GetEntry() == m_creature->GetEntry())
return;
DoScriptText(SAY_DEATH, m_creature);
}
void UpdateAI(const uint32 diff)
{
if (!pInstance)
return;
if (SpellCorrupt_Timer)
{
if (SpellCorrupt_Timer < diff)
{
pInstance->SetData(TYPE_MEDIVH,SPECIAL);
if (m_creature->HasAura(SPELL_CORRUPT_AEONUS,0))
SpellCorrupt_Timer = 1000;
else if (m_creature->HasAura(SPELL_CORRUPT,0))
SpellCorrupt_Timer = 3000;
else
SpellCorrupt_Timer = 0;
}else SpellCorrupt_Timer -= diff;
}
if (Check_Timer)
{
if (Check_Timer < diff)
{
uint32 pct = pInstance->GetData(DATA_SHIELD);
Check_Timer = 5000;
if (Life25 && pct <= 25)
{
DoScriptText(SAY_WEAK25, m_creature);
Life25 = false;
Check_Timer = 0;
}
else if (Life50 && pct <= 50)
{
DoScriptText(SAY_WEAK50, m_creature);
Life50 = false;
}
else if (Life75 && pct <= 75)
{
DoScriptText(SAY_WEAK75, m_creature);
Life75 = false;
}
//if we reach this it means event was running but at some point reset.
if (pInstance->GetData(TYPE_MEDIVH) == NOT_STARTED)
{
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
m_creature->RemoveCorpse();
m_creature->Respawn();
return;
}
if (pInstance->GetData(TYPE_MEDIVH) == DONE)
{
DoScriptText(SAY_WIN, m_creature);
Check_Timer = 0;
//TODO: start the post-event here
}
}else Check_Timer -= diff;
}
//if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
//return;
//DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_npc_medivh_bm(Creature *_Creature)
{
return new npc_medivh_bmAI (_Creature);
}
struct Wave
{
uint32 PortalMob[4]; //spawns for portal waves (in order)
};
static Wave PortalWaves[]=
{
{C_ASSAS, C_WHELP, C_CHRON, 0},
{C_EXECU, C_CHRON, C_WHELP, C_ASSAS},
{C_EXECU, C_VANQU, C_CHRON, C_ASSAS}
};
struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI
{
npc_time_riftAI(Creature *c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Reset();
}
ScriptedInstance *pInstance;
uint32 TimeRiftWave_Timer;
uint8 mRiftWaveCount;
uint8 mPortalCount;
uint8 mWaveId;
void Reset()
{
TimeRiftWave_Timer = 15000;
mRiftWaveCount = 0;
if (!pInstance)
return;
mPortalCount = pInstance->GetData(DATA_PORTAL_COUNT);
if (mPortalCount < 6)
mWaveId = 0;
else if (mPortalCount > 12)
mWaveId = 2;
else mWaveId = 1;
}
void Aggro(Unit *who) {}
void DoSummonAtRift(uint32 creature_entry)
{
if (!creature_entry)
return;
if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS)
{
m_creature->InterruptNonMeleeSpells(true);
m_creature->RemoveAllAuras();
return;
}
float x,y,z;
m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),10.0f,x,y,z);
//normalize Z-level if we can, if rift is not at ground level.
z = std::max(m_creature->GetMap()->GetHeight(x, y, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(x, y));
Unit *Summon = m_creature->SummonCreature(creature_entry,x,y,z,m_creature->GetOrientation(),
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
if (Summon)
{
if (Unit *temp = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MEDIVH)))
Summon->AddThreat(temp,0.0f);
}
}
void DoSelectSummon()
{
uint32 entry = 0;
if ((mRiftWaveCount > 2 && mWaveId < 1) || mRiftWaveCount > 3)
mRiftWaveCount = 0;
entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount];
debug_log("SD2: npc_time_rift: summoning wave creature (Wave %u, Entry %u).",mRiftWaveCount,entry);
++mRiftWaveCount;
if (entry == C_WHELP)
{
for(uint8 i = 0; i < 3; i++)
DoSummonAtRift(entry);
}else DoSummonAtRift(entry);
}
void UpdateAI(const uint32 diff)
{
if (!pInstance)
return;
if (TimeRiftWave_Timer < diff)
{
DoSelectSummon();
TimeRiftWave_Timer = 15000;
}else TimeRiftWave_Timer -= diff;
if (m_creature->IsNonMeleeSpellCasted(false))
return;
debug_log("SD2: npc_time_rift: not casting anylonger, i need to die.");
m_creature->setDeathState(JUST_DIED);
pInstance->SetData(TYPE_RIFT,SPECIAL);
}
};
CreatureAI* GetAI_npc_time_rift(Creature *_Creature)
{
return new npc_time_riftAI (_Creature);
}
#define SAY_SAAT_WELCOME -1269019
#define GOSSIP_ITEM_OBTAIN "[PH] Obtain Chrono-Beacon"
#define SPELL_CHRONO_BEACON 34975
#define ITEM_CHRONO_BEACON 24289
bool GossipHello_npc_saat(Player *player, Creature *_Creature)
{
if (_Creature->isQuestGiver())
player->PrepareQuestMenu(_Creature->GetGUID());
if (player->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(ITEM_CHRONO_BEACON,1))
{
player->ADD_GOSSIP_ITEM(0,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(10000,_Creature->GetGUID());
return true;
}
else if (player->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !player->HasItemCount(ITEM_CHRONO_BEACON,1))
{
player->ADD_GOSSIP_ITEM(0,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(10001,_Creature->GetGUID());
return true;
}
player->SEND_GOSSIP_MENU(10002,_Creature->GetGUID());
return true;
}
bool GossipSelect_npc_saat(Player *player, Creature *_Creature, uint32 sender, uint32 action)
{
if (action == GOSSIP_ACTION_INFO_DEF+1)
{
player->CLOSE_GOSSIP_MENU();
_Creature->CastSpell(player,SPELL_CHRONO_BEACON,false);
}
return true;
}
void AddSC_dark_portal()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_medivh_bm";
newscript->GetAI = &GetAI_npc_medivh_bm;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_time_rift";
newscript->GetAI = &GetAI_npc_time_rift;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_saat";
newscript->pGossipHello = &GossipHello_npc_saat;
newscript->pGossipSelect = &GossipSelect_npc_saat;
newscript->RegisterSelf();
}
@@ -0,0 +1,35 @@
/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef DEF_DARKPORTAL_H
#define DEF_DARKPORTAL_H
#define TYPE_MEDIVH 1
#define TYPE_RIFT 2
#define DATA_MEDIVH 10
#define DATA_PORTAL_COUNT 11
#define DATA_SHIELD 12
#define WORLD_STATE_BM 2541
#define WORLD_STATE_BM_SHIELD 2540
#define WORLD_STATE_BM_RIFT 2784
#define QUEST_OPENING_PORTAL 10297
#define QUEST_MASTER_TOUCH 9836
#define C_TIME_KEEPER 17918
#define C_RKEEP 21104
#define C_RLORD 17839
#define RIFT_BOSS urand(0,1) ? C_RKEEP : C_RLORD
#define C_DEJA 17879
#define C_TEMPO 17880
#define C_AEONUS 17881
#define C_ASSAS 17835
#define C_WHELP 21818
#define C_CHRON 17892
#define C_EXECU 18994
#define C_VANQU 18995
#endif
@@ -0,0 +1,376 @@
/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Instance_Dark_Portal
SD%Complete: 50
SDComment: Quest support: 9836, 10297. Currently in progress.
SDCategory: Caverns of Time, The Dark Portal
EndScriptData */
#include "precompiled.h"
#include "def_dark_portal.h"
#define ENCOUNTERS 2
#define C_MEDIVH 15608
#define C_TIME_RIFT 17838
#define SPELL_RIFT_CHANNEL 31387
float PortalLocation[4][4]=
{
{-2041.06, 7042.08, 29.99, 1.30},
{-1968.18, 7042.11, 21.93, 2.12},
{-1885.82, 7107.36, 22.32, 3.07},
{-1928.11, 7175.95, 22.11, 3.44}
};
struct Wave
{
uint32 PortalBoss; //protector of current portal
uint32 NextPortalTime; //time to next portal, or 0 if portal boss need to be killed
};
static Wave RiftWaves[]=
{
{RIFT_BOSS, 0},
{C_DEJA, 0},
{RIFT_BOSS, 120000},
{C_TEMPO, 140000},
{RIFT_BOSS, 120000},
{C_AEONUS, 0}
};
struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
{
instance_dark_portal(Map *map) : ScriptedInstance(map) {Initialize();};
uint32 Encounter[ENCOUNTERS];
uint32 mRiftPortalCount;
uint32 mShieldPercent;
uint8 mRiftWaveCount;
uint8 mRiftWaveId;
uint32 NextPortal_Timer;
uint64 MedivhGUID;
uint8 CurrentRiftId;
void Initialize()
{
MedivhGUID = 0;
Clear();
}
void Clear()
{
for(uint8 i = 0; i < ENCOUNTERS; i++)
Encounter[i] = NOT_STARTED;
mRiftPortalCount = 0;
mShieldPercent = 100;
mRiftWaveCount = 0;
mRiftWaveId = 0;
CurrentRiftId = 0;
NextPortal_Timer = 0;
}
Player* GetPlayerInMap()
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
{
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* plr = itr->getSource())
return plr;
}
}
debug_log("SD2: Instance Black Portal: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
void UpdateBMWorldState(uint32 id, uint32 state)
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
{
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* player = itr->getSource())
player->SendUpdateWorldState(id,state);
}
}else debug_log("SD2: Instance Black Portal: UpdateBMWorldState, but PlayerList is empty!");
}
void InitWorldState(bool Enable = true)
{
UpdateBMWorldState(WORLD_STATE_BM,Enable ? 1 : 0);
UpdateBMWorldState(WORLD_STATE_BM_SHIELD,100);
UpdateBMWorldState(WORLD_STATE_BM_RIFT,0);
}
bool IsEncounterInProgress()
{
if (GetData(TYPE_MEDIVH) == IN_PROGRESS)
return true;
return false;
}
void OnPlayerEnter(Player *player)
{
if (GetData(TYPE_MEDIVH) == IN_PROGRESS)
return;
player->SendUpdateWorldState(WORLD_STATE_BM,0);
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
{
if (creature->GetEntry() == C_MEDIVH)
MedivhGUID = creature->GetGUID();
}
//what other conditions to check?
bool CanProgressEvent()
{
if (!GetPlayerInMap())
return false;
return true;
}
uint8 GetRiftWaveId()
{
switch(mRiftPortalCount)
{
case 6:
mRiftWaveId = 2;
return 1;
case 12:
mRiftWaveId = 4;
return 3;
case 18:
return 5;
default:
return mRiftWaveId;
}
}
void SetData(uint32 type, uint32 data)
{
Player *player = GetPlayerInMap();
if (!player)
{
debug_log("SD2: Instance Black Portal: SetData (Type: %u Data %u) cannot find any player.", type, data);
return;
}
switch(type)
{
case TYPE_MEDIVH:
if (data == SPECIAL && Encounter[0] == IN_PROGRESS)
{
--mShieldPercent;
UpdateBMWorldState(WORLD_STATE_BM_SHIELD,mShieldPercent);
if (!mShieldPercent)
{
if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID))
{
if (medivh->isAlive())
{
medivh->DealDamage(medivh, medivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
Encounter[0] = FAIL;
Encounter[1] = NOT_STARTED;
}
}
}
}
else
{
if (data == IN_PROGRESS)
{
debug_log("SD2: Instance Dark Portal: Starting event.");
InitWorldState();
Encounter[1] = IN_PROGRESS;
NextPortal_Timer = 15000;
}
if (data == DONE)
{
//this may be completed further out in the post-event
if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID))
{
player->GroupEventHappens(QUEST_OPENING_PORTAL,medivh);
player->GroupEventHappens(QUEST_MASTER_TOUCH,medivh);
}
}
Encounter[0] = data;
}
break;
case TYPE_RIFT:
if (data == SPECIAL)
{
if (mRiftPortalCount < 7)
NextPortal_Timer = 5000;
}
else
Encounter[1] = data;
break;
}
}
uint32 GetData(uint32 type)
{
switch(type)
{
case TYPE_MEDIVH:
return Encounter[0];
case TYPE_RIFT:
return Encounter[1];
case DATA_PORTAL_COUNT:
return mRiftPortalCount;
case DATA_SHIELD:
return mShieldPercent;
}
return 0;
}
uint64 GetData64(uint32 data)
{
if (data == DATA_MEDIVH)
return MedivhGUID;
return 0;
}
Unit* SummonedPortalBoss(Unit* source)
{
uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss;
float x,y,z;
source->GetRandomPoint(source->GetPositionX(),source->GetPositionY(),source->GetPositionZ(),10.0f,x,y,z);
//normalize Z-level if we can, if rift is not at ground level.
z = std::max(instance->GetHeight(x, y, MAX_HEIGHT), instance->GetWaterLevel(x, y));
debug_log("SD2: Instance Dark Portal: Summoning rift boss entry %u.",entry);
Unit *Summon = source->SummonCreature(entry,x,y,z,source->GetOrientation(),
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
if (Summon)
return Summon;
debug_log("SD2: Instance Dark Portal: what just happened there? No boss, no loot, no fun...");
return NULL;
}
void DoSpawnPortal()
{
Player *player = GetPlayerInMap();
if (!player)
return;
if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID))
{
for(uint8 i = 0; i < 4; i++)
{
int tmp = rand()%4;
if (tmp != CurrentRiftId)
{
debug_log("SD2: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId);
CurrentRiftId = tmp;
Unit *temp = medivh->SummonCreature(C_TIME_RIFT,
PortalLocation[tmp][0],PortalLocation[tmp][1],PortalLocation[tmp][2],PortalLocation[tmp][3],
TEMPSUMMON_CORPSE_DESPAWN,0);
if (temp)
{
temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (Unit* boss = SummonedPortalBoss(temp))
{
if (boss->GetEntry() == C_AEONUS)
{
boss->AddThreat(medivh,0.0f);
}
else
{
boss->AddThreat(temp,0.0f);
temp->CastSpell(boss,SPELL_RIFT_CHANNEL,false);
}
}
}
break;
}
}
}
}
void Update(uint32 diff)
{
if (Encounter[1] != IN_PROGRESS)
return;
//add delay timer?
if (!CanProgressEvent())
{
Clear();
return;
}
if (NextPortal_Timer)
{
if (NextPortal_Timer < diff)
{
++mRiftPortalCount;
UpdateBMWorldState(WORLD_STATE_BM_RIFT,mRiftPortalCount);
DoSpawnPortal();
NextPortal_Timer = RiftWaves[GetRiftWaveId()].NextPortalTime;
}else NextPortal_Timer -= diff;
}
}
};
InstanceData* GetInstanceData_instance_dark_portal(Map* map)
{
return new instance_dark_portal(map);
}
void AddSC_instance_dark_portal()
{
Script *newscript;
newscript = new Script;
newscript->Name = "instance_dark_portal";
newscript->GetInstanceData = &GetInstanceData_instance_dark_portal;
newscript->RegisterSelf();
}
@@ -77,7 +77,7 @@ bool GossipHello_npc_jaina_proudmoore(Player *player, Creature *_Creature)
else if(RageEncounter == DONE && AnetheronEncounter == NOT_STARTED)
player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_ANETHERON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
else if(RageEncounter == DONE && AnetheronEncounter == DONE)
player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
if(player->isGameMaster())
player->ADD_GOSSIP_ITEM(2, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
@@ -130,14 +130,14 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance
debug_log("SD2: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount);
Encounter[0] = IN_PROGRESS;
if (mBarrelCount == 5)
SetData(TYPE_BARREL_DIVERSION,DONE);
}
if (data == DONE)
{
{
player->SummonCreature(DRAKE_ENTRY,2128.43,71.01,64.42,1.74,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000);
Encounter[0] = DONE;
}
}
Encounter[0] = data;
break;
}
case TYPE_THRALL_EVENT:
@@ -477,6 +477,9 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
}
void JustDied(Unit *slayer)
{
if (pInstance)
pInstance->SetData(TYPE_THRALL_EVENT,FAIL);
// Don't do a yell if he kills self (if player goes too far or at the end).
if(slayer == m_creature)
return;
@@ -486,9 +489,8 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
case 0: DoScriptText(SAY_TH_RANDOM_DIE1, m_creature); break;
case 1: DoScriptText(SAY_TH_RANDOM_DIE2, m_creature); break;
}
if( pInstance )
pInstance->SetData(TYPE_THRALL_EVENT,FAIL);
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
@@ -668,12 +670,15 @@ CreatureAI* GetAI_npc_thrall_old_hillsbrad(Creature *_Creature)
bool GossipHello_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature)
{
if( _Creature->isQuestGiver() )
player->PrepareQuestMenu( _Creature->GetGUID() );
{
player->PrepareQuestMenu( _Creature->GetGUID() );
player->SendPreparedQuest(_Creature->GetGUID());
}
ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
if( pInstance )
{
if( pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE && pInstance->GetData(TYPE_THRALL_EVENT) == NOT_STARTED )
if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE && !pInstance->GetData(TYPE_THRALL_EVENT))
{
player->ADD_GOSSIP_ITEM( 0, "[PH] Start walking.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(GOSSIP_ID_START, _Creature->GetGUID());
@@ -16,8 +16,8 @@
/* ScriptData
SDName: boss_the_lurker_below
SD%Complete: 80
SDComment: Other things.
SD%Complete: 75
SDComment: Pack summoning when it's does when it's appear how check this and check for coilfang frenzy if water is boiling they get deadstate
SDCategory: The Lurker Below
EndScriptData */
@@ -232,12 +232,8 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI
//DoCast(m_creature,SPELL_SPOUT_BREATH);//take breath anim
}
void UpdateAI(const uint32 diff)
void BoilingWater(bool active)
{
//Return since we have no target
if (!m_creature->SelectHostilTarget() /*|| !m_creature->getVictim()*/ )//rotate resets target
return;
//Check if players in water and if in water cast spell
Map *map = m_creature->GetMap();
if (map->IsDungeon() && pInstance->GetData(DATA_THELURKERBELOWEVENT) == IN_PROGRESS)
@@ -255,6 +251,13 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI
i->getSource()->RemoveAurasDueToSpell(SPELL_SCALDINGWATER);
}
}
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!m_creature->SelectHostilTarget() /*|| !m_creature->getVictim()*/ )//rotate resets target
return;
Rotate(diff);//always check rotate things
if(!Submerged)
@@ -594,9 +594,4 @@ void AddSC_boss_shade_of_aran()
newscript->Name="mob_aran_elemental";
newscript->GetAI = GetAI_water_elemental;
newscript->RegisterSelf();
//newscript = new Script;
//newscript->Name="mob_aran_blizzard";
//newscript->GetAI = GetAI_boss_aran;
//newscript->RegisterSelf();
}
@@ -827,7 +827,7 @@ struct TRINITY_DLL_DECL boss_bigbadwolfAI : public ScriptedAI
if(FearTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_TERRIFYING_HOWL);
FearTimer = 25000 + rand()%35000;
FearTimer = 25000 + rand()%10000;
}else FearTimer -= diff;
if(SwipeTimer < diff)
@@ -16,7 +16,7 @@
/* ScriptData
SDName: Boss_Astromancer
SD%Complete: 75
SD%Complete: 80
SDComment:
SDCategory: Tempest Keep, The Eye
EndScriptData */
@@ -171,7 +171,9 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
float Portal_X(float radius)
{
if ((rand()%2)==1) radius = -radius;
if ((rand()%2)==1)
radius = -radius;
return (radius * (float)(rand()%100)/100.0f + CENTER_X);
}
@@ -204,8 +206,6 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetVisibility(VISIBILITY_OFF);
}
if (Phase == 3)
Phase = 1;
AppearDelay_Timer = 2000;
}else AppearDelay_Timer -= diff;
@@ -306,15 +306,15 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
Portals[i][0] = Portal_X(SMALL_PORTAL_RADIUS);
Portals[i][1] = Portal_Y(Portals[i][0], SMALL_PORTAL_RADIUS);
Portals[i][2] = CENTER_Z;
}else
}
else
{
Portals[i][0] = Portal_X(LARGE_PORTAL_RADIUS);
Portals[i][1] = Portal_Y(Portals[i][0], LARGE_PORTAL_RADIUS);
Portals[i][2] = PORTAL_Z;
}
}
if((abs(Portals[2][0] - Portals[1][0]) < 7)
&& (abs(Portals[2][1] - Portals[1][1]) < 7))
if((abs(Portals[2][0] - Portals[1][0]) < 7) && (abs(Portals[2][1] - Portals[1][1]) < 7))
{
int i=1;
if(abs(CENTER_X + 26.0f - Portals[2][0]) < 7)
@@ -352,12 +352,15 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
}
else if(Phase == 3)
{
m_creature->AttackStop();
m_creature->StopMoving();
//Check Phase3_Timer
if(Phase3_Timer < diff)
{
Phase = 1;
//15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals.
m_creature->AttackStop();
m_creature->StopMoving();
int i = rand()%3;
m_creature->GetMotionMaster()->Clear();
m_creature->Relocate(Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O);
@@ -36,10 +36,6 @@ EndContentData */
## mob_unkor_the_ruthless
######*/
/*
UPDATE `creature_template` SET `ScriptName`='mob_unkor_the_ruthless' WHERE `entry`=18262;
*/
#define SAY_SUBMIT "I give up! Please don't kill me!"
#define FACTION_HOSTILE 45