*Merge.
--HG-- branch : trunk
This commit is contained in:
+1
-1
@@ -255,7 +255,7 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
|
||||
m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true);
|
||||
if( m_creature->GetOwner() )
|
||||
if( m_creature->isPet() )
|
||||
((Pet*)m_creature)->SetDuration(0);
|
||||
CanEvade = true;
|
||||
}else Apprentice_Timer -= diff;
|
||||
|
||||
@@ -110,6 +110,7 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
hyjal_trashAI::JustDied(victim);
|
||||
if(pInstance && IsEvent)
|
||||
pInstance->SetData(DATA_ANETHERONEVENT, DONE);
|
||||
DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
|
||||
|
||||
@@ -24,6 +24,7 @@ EndScriptData */
|
||||
#include "precompiled.h"
|
||||
#include "def_hyjal.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "hyjal_trash.h"
|
||||
|
||||
//text id -1534018 are the text used when previous events complete. Not part of this script.
|
||||
#define SAY_AGGRO -1534019
|
||||
@@ -201,9 +202,9 @@ struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit,
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI
|
||||
struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
|
||||
{
|
||||
boss_archimondeAI(Creature *c) : ScriptedAI(c)
|
||||
boss_archimondeAI(Creature *c) : hyjal_trashAI(c)
|
||||
{
|
||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||
}
|
||||
@@ -310,6 +311,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
hyjal_trashAI::JustDied(victim);
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
@@ -608,6 +610,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void WaypointReached(uint32 i){}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_archimonde(Creature *_Creature)
|
||||
|
||||
@@ -103,6 +103,7 @@ struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
hyjal_trashAI::JustDied(victim);
|
||||
if(pInstance && IsEvent)
|
||||
pInstance->SetData(DATA_AZGALOREVENT, DONE);
|
||||
DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
|
||||
|
||||
@@ -98,6 +98,7 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
hyjal_trashAI::JustDied(victim);
|
||||
if(pInstance && IsEvent)
|
||||
pInstance->SetData(DATA_KAZROGALEVENT, DONE);
|
||||
DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
|
||||
|
||||
@@ -94,6 +94,7 @@ struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
hyjal_trashAI::JustDied(victim);
|
||||
if(pInstance && IsEvent)
|
||||
pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, DONE);
|
||||
DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#define DATA_RESET_TRASH_COUNT 15
|
||||
#define DATA_ALLIANCE_RETREAT 16
|
||||
#define DATA_HORDE_RETREAT 17
|
||||
#define DATA_RAIDDAMAGE 18
|
||||
#define DATA_RESET_RAIDDAMAGE 19
|
||||
|
||||
#define ERROR_INST_DATA "TSCR: Instance data not set properly for Mount Hyjal. Encounters will be buggy"
|
||||
#endif
|
||||
|
||||
@@ -83,17 +83,11 @@ bool GossipHello_npc_jaina_proudmoore(Player *player, Creature *_Creature)
|
||||
player->ADD_GOSSIP_ITEM(2, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
|
||||
player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_jaina_proudmoore(Player *player, Creature *_Creature, uint32 sender, uint32 action)
|
||||
{
|
||||
if(_Creature->GetMap()->GetPlayersCountExceptGMs() < MINPLAYERS && !player->isGameMaster())
|
||||
{
|
||||
_Creature->MonsterSay("Did you come to die with me?",0,0);
|
||||
return true;
|
||||
}
|
||||
hyjalAI* ai = ((hyjalAI*)_Creature->AI());
|
||||
switch(action)
|
||||
{
|
||||
@@ -113,7 +107,6 @@ bool GossipSelect_npc_jaina_proudmoore(Player *player, Creature *_Creature, uint
|
||||
debug_log("SD2: HyjalAI - Debug mode has been toggled");
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -138,12 +131,10 @@ CreatureAI* GetAI_npc_thrall(Creature *_Creature)
|
||||
bool GossipHello_npc_thrall(Player *player, Creature *_Creature)
|
||||
{
|
||||
hyjalAI* ai = ((hyjalAI*)_Creature->AI());
|
||||
|
||||
if (ai->EventBegun)
|
||||
return false;
|
||||
|
||||
uint32 AnetheronEvent = ai->GetInstanceData(DATA_ANETHERONEVENT);
|
||||
|
||||
// Only let them start the Horde phases if Anetheron is dead.
|
||||
if (AnetheronEvent == DONE && ai->GetInstanceData(DATA_ALLIANCE_RETREAT))
|
||||
{
|
||||
@@ -161,17 +152,11 @@ bool GossipHello_npc_thrall(Player *player, Creature *_Creature)
|
||||
player->ADD_GOSSIP_ITEM(2, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
|
||||
player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_thrall(Player *player, Creature *_Creature, uint32 sender, uint32 action)
|
||||
{
|
||||
if(_Creature->GetMap()->GetPlayersCountExceptGMs() < MINPLAYERS && !player->isGameMaster())//to stop idiot farmers
|
||||
{
|
||||
_Creature->MonsterSay("Did you come to die with me?",0,0);
|
||||
return true;
|
||||
}
|
||||
hyjalAI* ai = ((hyjalAI*)_Creature->AI());
|
||||
ai->DeSpawnVeins();//despawn the alliance veins
|
||||
switch(action)
|
||||
@@ -192,7 +177,6 @@ bool GossipSelect_npc_thrall(Player *player, Creature *_Creature, uint32 sender,
|
||||
debug_log("SD2: HyjalAI - Debug mode has been toggled");
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -201,14 +185,12 @@ CreatureAI* GetAI_npc_tyrande_whisperwind(Creature *_Creature)
|
||||
hyjalAI* ai = new hyjalAI(_Creature);
|
||||
ai->Reset();
|
||||
ai->EnterEvadeMode();
|
||||
|
||||
return ai;
|
||||
}
|
||||
|
||||
bool GossipHello_npc_tyrande_whisperwind(Player* player, Creature* _Creature)
|
||||
{
|
||||
hyjalAI* ai = ((hyjalAI*)_Creature->AI());
|
||||
//ai->DeSpawnVeins();//dont despawn the horde veins if someone takes the item from Tyrande
|
||||
uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT);
|
||||
|
||||
// Only let them get item if Azgalor is dead.
|
||||
@@ -233,7 +215,6 @@ bool GossipSelect_npc_tyrande_whisperwind(Player *player, Creature *_Creature, u
|
||||
player->SEND_GOSSIP_MENU(907, _Creature->GetGUID());
|
||||
hyjalAI* ai = ((hyjalAI*)_Creature->AI());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -499,7 +499,11 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
|
||||
((hyjal_trashAI*)pCreature->AI())->IsEvent = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(pInstance)
|
||||
{
|
||||
if(pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE)
|
||||
pCreature->SetDisableReputationGain(true);//no repu for solo farming
|
||||
}
|
||||
// Check if creature is a boss.
|
||||
if (pCreature->isWorldBoss())
|
||||
{
|
||||
@@ -972,6 +976,7 @@ void hyjalAI::JustDied(Unit* killer)
|
||||
pInstance->SetData(DATA_KAZROGALEVENT, NOT_STARTED);
|
||||
if(pInstance->GetData(DATA_AZGALOREVENT) == IN_PROGRESS)
|
||||
pInstance->SetData(DATA_AZGALOREVENT, NOT_STARTED);
|
||||
pInstance->SetData(DATA_RESET_RAIDDAMAGE, NULL);//reset damage on die
|
||||
}
|
||||
}
|
||||
void hyjalAI::HideNearPos(float x, float y)
|
||||
|
||||
@@ -8,10 +8,6 @@
|
||||
#include "def_hyjal.h"
|
||||
#include "../../../npc/npc_escortAI.h"
|
||||
|
||||
|
||||
#define MINPLAYERS 1//min players on the map (except gms) to start the events, to prevent one player farming
|
||||
|
||||
|
||||
// Trash Mobs summoned in waves
|
||||
#define NECROMANCER 17899//done
|
||||
#define ABOMINATION 17898//done
|
||||
|
||||
@@ -145,13 +145,18 @@ hyjal_trashAI::hyjal_trashAI(Creature *c) : npc_escortAI(c)
|
||||
SetupOverrun = false;
|
||||
faction = 0;
|
||||
useFlyPath = false;
|
||||
damageTaken = 0;
|
||||
Reset();
|
||||
}
|
||||
|
||||
void hyjal_trashAI::DamageTaken(Unit *done_by, uint32 &damage)
|
||||
{
|
||||
if(IsOverrun && done_by->GetTypeId() == TYPEID_UNIT && ((Creature*)done_by)->GetEntry() == 17931)//don't take dmg from the dummy target
|
||||
damage = 0;
|
||||
if(done_by->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
damageTaken += damage;
|
||||
if(pInstance)
|
||||
pInstance->SetData(DATA_RAIDDAMAGE,damage);//store raid's damage
|
||||
}
|
||||
}
|
||||
|
||||
void hyjal_trashAI::Aggro(Unit *who){}
|
||||
@@ -328,9 +333,13 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
|
||||
|
||||
void hyjal_trashAI::JustDied(Unit *victim)
|
||||
{
|
||||
if(pInstance && IsEvent)
|
||||
if(!pInstance)return;
|
||||
if(IsEvent && !m_creature->isWorldBoss())
|
||||
pInstance->SetData(DATA_TRASH, 0);//signal trash is dead
|
||||
|
||||
if((pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !m_creature->isWorldBoss()) || (damageTaken < m_creature->GetMaxHealth()/2 && m_creature->isWorldBoss()))
|
||||
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot
|
||||
|
||||
if(IsOverrun)
|
||||
{
|
||||
float x,y,z,o;
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include "def_hyjal.h"
|
||||
#include "../../../npc/npc_escortAI.h"
|
||||
|
||||
#define MINRAIDDAMAGE 1000000//minimal damage before trash can drop loot and reputation
|
||||
|
||||
struct TRINITY_DLL_DECL hyjal_trashAI : public npc_escortAI
|
||||
{
|
||||
hyjal_trashAI(Creature *c);
|
||||
@@ -31,6 +33,7 @@ struct TRINITY_DLL_DECL hyjal_trashAI : public npc_escortAI
|
||||
uint32 OverrunType;
|
||||
uint8 faction;
|
||||
bool useFlyPath;
|
||||
uint32 damageTaken;
|
||||
|
||||
//private:
|
||||
};
|
||||
|
||||
@@ -23,6 +23,7 @@ EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "def_hyjal.h"
|
||||
#include "hyjal_trash.h"
|
||||
|
||||
#define ENCOUNTERS 5
|
||||
|
||||
@@ -59,6 +60,8 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
|
||||
uint32 allianceRetreat;
|
||||
bool ArchiYell;
|
||||
|
||||
uint32 RaidDamage;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
RageWinterchill = 0;
|
||||
@@ -72,6 +75,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
|
||||
HordeGate = 0;
|
||||
ElfGate = 0;
|
||||
ArchiYell = false;
|
||||
RaidDamage = 0;
|
||||
|
||||
Trash = 0;
|
||||
for(uint8 i = 0; i < ENCOUNTERS; ++i)
|
||||
@@ -214,6 +218,14 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
|
||||
OpenDoor(ElfGate,true);
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_RAIDDAMAGE:
|
||||
RaidDamage += data;
|
||||
if(RaidDamage >= MINRAIDDAMAGE)
|
||||
RaidDamage = MINRAIDDAMAGE;
|
||||
break;
|
||||
case DATA_RESET_RAIDDAMAGE:
|
||||
RaidDamage = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
debug_log("SD2: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data);
|
||||
@@ -225,7 +237,8 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
|
||||
std::ostringstream saveStream;
|
||||
saveStream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " "
|
||||
<< Encounters[3] << " " << Encounters[4]
|
||||
<< " " << allianceRetreat << " " << hordeRetreat;
|
||||
<< " " << allianceRetreat << " " << hordeRetreat
|
||||
<< " " << RaidDamage;
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
@@ -247,6 +260,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
|
||||
case DATA_TRASH: return Trash;
|
||||
case DATA_ALLIANCE_RETREAT: return allianceRetreat;
|
||||
case DATA_HORDE_RETREAT: return hordeRetreat;
|
||||
case DATA_RAIDDAMAGE: return RaidDamage;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -280,7 +294,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3] >> Encounters[4] >> allianceRetreat >> hordeRetreat;
|
||||
loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3] >> Encounters[4] >> allianceRetreat >> hordeRetreat >> RaidDamage;
|
||||
for(uint8 i = 0; i < ENCOUNTERS; ++i)
|
||||
if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as IN_PROGRESS - reset it instead.
|
||||
Encounters[i] = NOT_STARTED;
|
||||
|
||||
@@ -101,7 +101,8 @@ struct TRINITY_DLL_DECL npc_converted_sentryAI : public ScriptedAI
|
||||
else DoScriptText(SAY_CONVERTED_2, m_creature);
|
||||
|
||||
DoCast(m_creature, SPELL_CONVERT_CREDIT);
|
||||
((Pet*)m_creature)->SetDuration(7500);
|
||||
if(m_creature->isPet())
|
||||
((Pet*)m_creature)->SetDuration(7500);
|
||||
Credit = true;
|
||||
}else Timer -= diff;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user