Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

Conflicts:
	src/server/scripts/Commands/cs_misc.cpp
	src/server/scripts/Events/childrens_week.cpp
	src/server/scripts/Kalimdor/boss_azuregos.cpp
	src/server/scripts/Kalimdor/zone_azshara.cpp
	src/server/scripts/Kalimdor/zone_darkshore.cpp
	src/server/scripts/Kalimdor/zone_durotar.cpp
	src/server/scripts/Kalimdor/zone_moonglade.cpp
	src/server/scripts/Kalimdor/zone_mulgore.cpp
	src/server/scripts/Kalimdor/zone_orgrimmar.cpp
	src/server/scripts/Kalimdor/zone_thousand_needles.cpp
	src/server/scripts/Kalimdor/zone_ungoro_crater.cpp
	src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp
This commit is contained in:
Vincent-Michael
2014-09-06 02:41:45 +02:00
86 changed files with 1604 additions and 664 deletions

View File

@@ -287,7 +287,7 @@ public:
bool permanent = (fields[1].GetUInt64() == uint64(0));
std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);
handler->PSendSysMessage(LANG_BANINFO_HISTORYENTRY,
fields[0].GetCString(), banTime.c_str(), active ? handler->GetTrinityString(LANG_BANINFO_YES) : handler->GetTrinityString(LANG_BANINFO_NO), fields[4].GetCString(), fields[5].GetCString());
fields[0].GetCString(), banTime.c_str(), active ? handler->GetTrinityString(LANG_YES) : handler->GetTrinityString(LANG_NO), fields[4].GetCString(), fields[5].GetCString());
}
while (result->NextRow());
@@ -340,7 +340,7 @@ public:
bool permanent = (fields[1].GetUInt32() == uint32(0));
std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt32(), true);
handler->PSendSysMessage(LANG_BANINFO_HISTORYENTRY,
fields[0].GetCString(), banTime.c_str(), active ? handler->GetTrinityString(LANG_BANINFO_YES) : handler->GetTrinityString(LANG_BANINFO_NO), fields[4].GetCString(), fields[5].GetCString());
fields[0].GetCString(), banTime.c_str(), active ? handler->GetTrinityString(LANG_YES) : handler->GetTrinityString(LANG_NO), fields[4].GetCString(), fields[5].GetCString());
}
while (result->NextRow());

View File

@@ -191,17 +191,17 @@ public:
if (haveVMap)
{
if (map->IsOutdoors(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()))
handler->PSendSysMessage("You are outdoors");
handler->PSendSysMessage(LANG_GPS_POSITION_OUTDOORS);
else
handler->PSendSysMessage("You are indoors");
handler->PSendSysMessage(LANG_GPS_POSITION_INDOORS);
}
else
handler->PSendSysMessage("no VMAP available for area info");
handler->PSendSysMessage(LANG_GPS_NO_VMAP);
handler->PSendSysMessage(LANG_MAP_POSITION,
mapId, (mapEntry ? mapEntry->name : "<unknown>"),
zoneId, (zoneEntry ? zoneEntry->area_name : "<unknown>"),
areaId, (areaEntry ? areaEntry->area_name : "<unknown>"),
mapId, (mapEntry ? mapEntry->name : handler->GetTrinityString(LANG_UNKNOWN)),
zoneId, (zoneEntry ? zoneEntry->area_name : handler->GetTrinityString(LANG_UNKNOWN)),
areaId, (areaEntry ? areaEntry->area_name : handler->GetTrinityString(LANG_UNKNOWN)),
object->GetPhaseMask(),
object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(),
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(),
@@ -809,7 +809,7 @@ public:
if (handler->HasLowerSecurity(target, 0))
return false;
std::string kickReasonStr = "No reason";
std::string kickReasonStr = handler->GetTrinityString(LANG_NO_REASON);
if (*args != '\0')
{
char const* kickReason = strtok(NULL, "\r");
@@ -1442,22 +1442,22 @@ public:
std::string lastLogin = handler->GetTrinityString(LANG_ERROR);
uint32 failedLogins = 0;
uint32 latency = 0;
std::string OS = "None";
std::string OS = handler->GetTrinityString(LANG_UNKNOWN);
// Mute data print variables
int64 muteTime = -1;
std::string muteReason = "unknown";
std::string muteBy = "unknown";
std::string muteReason = handler->GetTrinityString(LANG_NO_REASON);
std::string muteBy = handler->GetTrinityString(LANG_UNKNOWN);
// Ban data print variables
int64 banTime = -1;
std::string banType = "None";
std::string banReason = "Unknown";
std::string bannedBy = "Unknown";
std::string banType = handler->GetTrinityString(LANG_UNKNOWN);
std::string banReason = handler->GetTrinityString(LANG_NO_REASON);
std::string bannedBy = handler->GetTrinityString(LANG_UNKNOWN);
// Character data print variables
uint8 raceid, classid = 0; //RACE_NONE, CLASS_NONE
std::string raceStr, classStr = "None";
std::string raceStr, classStr = handler->GetTrinityString(LANG_UNKNOWN);
uint8 gender = 0;
int8 locale = handler->GetSessionDbcLocale();
uint32 totalPlayerTime = 0;
@@ -1471,8 +1471,8 @@ public:
uint32 mapId;
uint32 areaId;
uint32 phase = 0;
std::string areaName = "<unknown>";
std::string zoneName = "<unknown>";
std::string areaName = handler->GetTrinityString(LANG_UNKNOWN);
std::string zoneName = handler->GetTrinityString(LANG_UNKNOWN);
// Guild data print variables defined so that they exist, but are not necessarily used
uint32 guildId = 0;
@@ -1500,7 +1500,7 @@ public:
muteTime = target->GetSession()->m_muteTime;
mapId = target->GetMapId();
areaId = target->GetAreaId();
alive = target->IsAlive() ? "Yes" : "No";
alive = target->IsAlive() ? handler->GetTrinityString(LANG_YES) : handler->GetTrinityString(LANG_NO);
gender = target->getGender();
phase = target->GetPhaseMask();
}
@@ -1533,9 +1533,9 @@ public:
uint32 playerFlags = fields[10].GetUInt32();
if (!health || playerFlags & PLAYER_FLAGS_GHOST)
alive = "No";
alive = handler->GetTrinityString(LANG_NO);
else
alive = "Yes";
alive = handler->GetTrinityString(LANG_YES);
}
// Query the prepared statement for login data
@@ -1575,9 +1575,10 @@ public:
}
else
{
eMail = "Unauthorized";
lastIp = "Unauthorized";
lastLogin = "Unauthorized";
eMail = handler->GetTrinityString(LANG_UNAUTHORIZED);
regMail = handler->GetTrinityString(LANG_UNAUTHORIZED);
lastIp = handler->GetTrinityString(LANG_UNAUTHORIZED);
lastLogin = handler->GetTrinityString(LANG_UNAUTHORIZED);
}
muteTime = fields[6].GetUInt64();
muteReason = fields[7].GetString();
@@ -1596,7 +1597,7 @@ public:
PreparedQueryResult result2 = LoginDatabase.Query(stmt2);
if (!result2)
{
banType = "Character";
banType = handler->GetTrinityString(LANG_CHARACTER);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_BANS);
stmt->setUInt32(0, lowguid);
result2 = CharacterDatabase.Query(stmt);
@@ -1653,7 +1654,7 @@ public:
// Output III. LANG_PINFO_BANNED if ban exists and is applied
if (banTime >= 0)
handler->PSendSysMessage(LANG_PINFO_BANNED, banType.c_str(), banReason.c_str(), banTime > 0 ? secsToTimeString(banTime - time(NULL), true).c_str() : "permanently", bannedBy.c_str());
handler->PSendSysMessage(LANG_PINFO_BANNED, banType.c_str(), banReason.c_str(), banTime > 0 ? secsToTimeString(banTime - time(NULL), true).c_str() : handler->GetTrinityString(LANG_PERMANENTLY), bannedBy.c_str());
// Output IV. LANG_PINFO_MUTED if mute is applied
if (muteTime > 0)
@@ -1672,7 +1673,7 @@ public:
handler->PSendSysMessage(LANG_PINFO_ACC_REGMAILS, regMail.c_str(), eMail.c_str());
// Output IX. LANG_PINFO_ACC_IP
handler->PSendSysMessage(LANG_PINFO_ACC_IP, lastIp.c_str(), locked ? "Yes" : "No");
handler->PSendSysMessage(LANG_PINFO_ACC_IP, lastIp.c_str(), locked ? handler->GetTrinityString(LANG_YES) : handler->GetTrinityString(LANG_NO));
// Output X. LANG_PINFO_CHR_LEVEL
if (level != sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
@@ -1711,7 +1712,7 @@ public:
}
if (target)
handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->name, (!zoneName.empty() ? zoneName.c_str() : "<Unknown>"), (!areaName.empty() ? areaName.c_str() : "<Unknown>"));
handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->name, (!zoneName.empty() ? zoneName.c_str() : handler->GetTrinityString(LANG_UNKNOWN)), (!areaName.empty() ? areaName.c_str() : handler->GetTrinityString(LANG_UNKNOWN)));
// Output XVII. - XVIX. if they are not empty
if (!guildName.empty())
@@ -1791,7 +1792,7 @@ public:
return false;
char const* muteReason = strtok(NULL, "\r");
std::string muteReasonStr = "No reason";
std::string muteReasonStr = handler->GetTrinityString(LANG_NO_REASON);
if (muteReason != NULL)
muteReasonStr = muteReason;
@@ -1819,7 +1820,7 @@ public:
if (handler->GetSession())
muteBy = handler->GetSession()->GetPlayerName();
else
muteBy = "Console";
muteBy = handler->GetTrinityString(LANG_CONSOLE);
if (target)
{

View File

@@ -126,7 +126,7 @@ public:
ticket->SaveToDB(trans);
sTicketMgr->UpdateLastChange();
std::string msg = ticket->FormatMessageString(*handler, NULL, target.c_str(), NULL, NULL);
std::string msg = ticket->FormatMessageString(*handler, NULL, target.c_str(), NULL, NULL, NULL);
handler->SendGlobalGMSysMessage(msg.c_str());
return true;
}
@@ -156,7 +156,7 @@ public:
sTicketMgr->CloseTicket(ticket->GetId(), player ? player->GetGUID() : -1);
sTicketMgr->UpdateLastChange();
std::string msg = ticket->FormatMessageString(*handler, player ? player->GetName().c_str() : "Console", NULL, NULL, NULL);
std::string msg = ticket->FormatMessageString(*handler, player ? player->GetName().c_str() : "Console", NULL, NULL, NULL, NULL);
handler->SendGlobalGMSysMessage(msg.c_str());
// Inform player, who submitted this ticket, that it is closed
@@ -205,7 +205,7 @@ public:
ticket->SaveToDB(trans);
sTicketMgr->UpdateLastChange();
std::string msg = ticket->FormatMessageString(*handler, NULL, ticket->GetAssignedToName().c_str(), NULL, NULL);
std::string msg = ticket->FormatMessageString(*handler, NULL, ticket->GetAssignedToName().c_str(), NULL, NULL, NULL);
msg += handler->PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, player ? player->GetName().c_str() : "Console", comment);
handler->SendGlobalGMSysMessage(msg.c_str());
@@ -239,6 +239,9 @@ public:
ticket->SetCompleted();
ticket->SaveToDB(trans);
std::string msg = ticket->FormatMessageString(*handler, NULL, NULL,
NULL, NULL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console");
handler->SendGlobalGMSysMessage(msg.c_str());
sTicketMgr->UpdateLastChange();
return true;
}
@@ -262,7 +265,7 @@ public:
return true;
}
std::string msg = ticket->FormatMessageString(*handler, NULL, NULL, NULL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console");
std::string msg = ticket->FormatMessageString(*handler, NULL, NULL, NULL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", NULL);
handler->SendGlobalGMSysMessage(msg.c_str());
sTicketMgr->RemoveTicket(ticket->GetId());
@@ -394,7 +397,7 @@ public:
sTicketMgr->UpdateLastChange();
std::string msg = ticket->FormatMessageString(*handler, NULL, assignedTo.c_str(),
handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", NULL);
handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console", NULL, NULL);
handler->SendGlobalGMSysMessage(msg.c_str());
return true;

View File

@@ -319,19 +319,24 @@ public:
struct npc_anchorite_truuenAI : public npc_escortAI
{
npc_anchorite_truuenAI(Creature* creature) : npc_escortAI(creature) { }
npc_anchorite_truuenAI(Creature* creature) : npc_escortAI(creature)
{
Initialize();
UghostGUID = 0;
}
void Initialize()
{
m_uiChatTimer = 7000;
}
uint32 m_uiChatTimer;
uint64 UghostGUID;
uint64 TheldanisGUID;
Creature* Ughost;
Creature* Theldanis;
void Reset() override
{
m_uiChatTimer = 7000;
Initialize();
}
void JustSummoned(Creature* summoned) override
@@ -364,26 +369,25 @@ public:
Talk(SAY_WP_2);
break;
case 21:
Theldanis = GetClosestCreatureWithEntry(me, NPC_THEL_DANIS, 150);
if (Theldanis)
if (Creature* Theldanis = GetClosestCreatureWithEntry(me, NPC_THEL_DANIS, 150))
Theldanis->AI()->Talk(SAY_WP_3);
break;
case 23:
Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86f, -1825.42f, 81.99f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
if (Ughost)
if (Creature* Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86f, -1825.42f, 81.99f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
{
UghostGUID = Ughost->GetGUID();
Ughost->SetDisableGravity(true);
Ughost->AI()->Talk(SAY_WP_4, me);
}
m_uiChatTimer = 4000;
break;
case 24:
if (Ughost)
if (Creature* Ughost = ObjectAccessor::GetCreature(*me, UghostGUID))
Ughost->AI()->Talk(SAY_WP_5, me);
m_uiChatTimer = 4000;
break;
case 25:
if (Ughost)
if (Creature* Ughost = ObjectAccessor::GetCreature(*me, UghostGUID))
Ughost->AI()->Talk(SAY_WP_6, me);
m_uiChatTimer = 4000;
break;

View File

@@ -59,14 +59,22 @@ public:
struct npc_tapoke_slim_jahnAI : public npc_escortAI
{
npc_tapoke_slim_jahnAI(Creature* creature) : npc_escortAI(creature) { }
npc_tapoke_slim_jahnAI(Creature* creature) : npc_escortAI(creature)
{
Initialize();
}
void Initialize()
{
IsFriendSummoned = false;
}
bool IsFriendSummoned;
void Reset() override
{
if (!HasEscortState(STATE_ESCORT_ESCORTING))
IsFriendSummoned = false;
Initialize();
}
void WaypointReached(uint32 waypointId) override

View File

@@ -150,9 +150,12 @@ class npc_winterfin_playmate : public CreatureScript
struct npc_winterfin_playmateAI : public ScriptedAI
{
npc_winterfin_playmateAI(Creature* creature) : ScriptedAI(creature) { }
npc_winterfin_playmateAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Reset() override
void Initialize()
{
timer = 0;
phase = 0;
@@ -160,6 +163,11 @@ class npc_winterfin_playmate : public CreatureScript
orphanGUID = 0;
}
void Reset() override
{
Initialize();
}
void MoveInLineOfSight(Unit* who) override
{
@@ -249,9 +257,12 @@ class npc_snowfall_glade_playmate : public CreatureScript
struct npc_snowfall_glade_playmateAI : public ScriptedAI
{
npc_snowfall_glade_playmateAI(Creature* creature) : ScriptedAI(creature) { }
npc_snowfall_glade_playmateAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Reset() override
void Initialize()
{
timer = 0;
phase = 0;
@@ -259,6 +270,11 @@ class npc_snowfall_glade_playmate : public CreatureScript
orphanGUID = 0;
}
void Reset() override
{
Initialize();
}
void MoveInLineOfSight(Unit* who) override
{
@@ -349,10 +365,11 @@ class npc_the_biggest_tree : public CreatureScript
{
npc_the_biggest_treeAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
me->SetDisplayId(DISPLAY_INVISIBLE);
}
void Reset() override
void Initialize()
{
timer = 1000;
phase = 0;
@@ -360,8 +377,12 @@ class npc_the_biggest_tree : public CreatureScript
orphanGUID = 0;
}
void MoveInLineOfSight(Unit* who) override
void Reset() override
{
Initialize();
}
void MoveInLineOfSight(Unit* who) override
{
if (!phase && who && who->GetDistance2d(me) < 10.0f)
if (Player* player = who->ToPlayer())
@@ -437,9 +458,12 @@ class npc_high_oracle_soo_roo : public CreatureScript
struct npc_high_oracle_soo_rooAI : public ScriptedAI
{
npc_high_oracle_soo_rooAI(Creature* creature) : ScriptedAI(creature) { }
npc_high_oracle_soo_rooAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Reset() override
void Initialize()
{
timer = 0;
phase = 0;
@@ -447,6 +471,11 @@ class npc_high_oracle_soo_roo : public CreatureScript
orphanGUID = 0;
}
void Reset() override
{
Initialize();
}
void MoveInLineOfSight(Unit* who) override
{
@@ -526,9 +555,12 @@ class npc_elder_kekek : public CreatureScript
struct npc_elder_kekekAI : public ScriptedAI
{
npc_elder_kekekAI(Creature* creature) : ScriptedAI(creature) { }
npc_elder_kekekAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Reset() override
void Initialize()
{
timer = 0;
phase = 0;
@@ -536,6 +568,11 @@ class npc_elder_kekek : public CreatureScript
orphanGUID = 0;
}
void Reset() override
{
Initialize();
}
void MoveInLineOfSight(Unit* who) override
{
@@ -615,9 +652,12 @@ class npc_the_etymidian : public CreatureScript
struct npc_the_etymidianAI : public ScriptedAI
{
npc_the_etymidianAI(Creature* creature) : ScriptedAI(creature) { }
npc_the_etymidianAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Reset() override
void Initialize()
{
timer = 0;
phase = 0;
@@ -625,8 +665,12 @@ class npc_the_etymidian : public CreatureScript
orphanGUID = 0;
}
void MoveInLineOfSight(Unit* who) override
void Reset() override
{
Initialize();
}
void MoveInLineOfSight(Unit* who) override
{
if (!phase && who && who->GetDistance2d(me) < 10.0f)
if (Player* player = who->ToPlayer())
@@ -711,9 +755,12 @@ class npc_alexstraza_the_lifebinder : public CreatureScript
struct npc_alexstraza_the_lifebinderAI : public ScriptedAI
{
npc_alexstraza_the_lifebinderAI(Creature* creature) : ScriptedAI(creature) { }
npc_alexstraza_the_lifebinderAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Reset() override
void Initialize()
{
timer = 0;
phase = 0;
@@ -721,6 +768,11 @@ class npc_alexstraza_the_lifebinder : public CreatureScript
orphanGUID = 0;
}
void Reset() override
{
Initialize();
}
void SetData(uint32 type, uint32 data) override
{
// Existing SmartAI
@@ -871,7 +923,7 @@ class at_bring_your_orphan_to : public AreaTriggerScript
public:
at_bring_your_orphan_to() : AreaTriggerScript("at_bring_your_orphan_to") { }
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger)
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) override
{
if (player->isDead() || !player->HasAura(SPELL_ORPHAN_OUT))
return false;
@@ -934,7 +986,6 @@ class npc_cw_area_trigger : public CreatureScript
}
void MoveInLineOfSight(Unit* who) override
{
if (who && me->GetDistance2d(who) < 20.0f)
if (Player* player = who->ToPlayer())

View File

@@ -80,6 +80,7 @@ public:
{
npc_blackfathom_deeps_eventAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
if (creature->IsSummon())
{
creature->SetHomePosition(HomePosition);
@@ -89,6 +90,15 @@ public:
instance = creature->GetInstanceScript();
}
void Initialize()
{
Flee = false;
ravageTimer = urand(5000, 8000);
frostNovaTimer = urand(9000, 12000);
frostBoltVolleyTimer = urand(2000, 4000);
}
InstanceScript* instance;
uint32 ravageTimer;
@@ -99,11 +109,7 @@ public:
void Reset() override
{
Flee = false;
ravageTimer = urand(5000, 8000);
frostNovaTimer = urand(9000, 12000);
frostBoltVolleyTimer = urand(2000, 4000);
Initialize();
}
void AttackPlayer()

View File

@@ -38,11 +38,19 @@ public:
struct boss_aku_maiAI : public BossAI
{
boss_aku_maiAI(Creature* creature) : BossAI(creature, TYPE_AKU_MAI) { }
boss_aku_maiAI(Creature* creature) : BossAI(creature, TYPE_AKU_MAI)
{
Initialize();
}
void Initialize()
{
IsEnraged = false;
}
void Reset() override
{
IsEnraged = false;
Initialize();
_Reset();
}

View File

@@ -38,16 +38,22 @@ public:
{
boss_gelihastAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
netTimer = urand(2000, 4000);
}
uint32 netTimer;
InstanceScript* instance;
void Reset() override
{
netTimer = urand(2000, 4000);
Initialize();
instance->SetData(TYPE_GELIHAST, NOT_STARTED);
}

View File

@@ -43,9 +43,16 @@ public:
{
boss_kelrisAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
mindBlastTimer = urand(2000, 5000);
sleepTimer = urand(9000, 12000);
}
uint32 mindBlastTimer;
uint32 sleepTimer;
@@ -53,8 +60,7 @@ public:
void Reset() override
{
mindBlastTimer = urand(2000, 5000);
sleepTimer = urand(9000, 12000);
Initialize();
instance->SetData(TYPE_KELRIS, NOT_STARTED);
}

View File

@@ -54,10 +54,20 @@ public:
{
boss_anetheronAI(Creature* creature) : hyjal_trashAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
go = false;
}
void Initialize()
{
SwarmTimer = 45000;
SleepTimer = 60000;
AuraTimer = 5000;
InfernoTimer = 45000;
damageTaken = 0;
}
uint32 SwarmTimer;
uint32 SleepTimer;
uint32 AuraTimer;
@@ -66,11 +76,7 @@ public:
void Reset() override
{
damageTaken = 0;
SwarmTimer = 45000;
SleepTimer = 60000;
AuraTimer = 5000;
InfernoTimer = 45000;
Initialize();
if (IsEvent)
instance->SetData(DATA_ANETHERONEVENT, NOT_STARTED);

View File

@@ -90,7 +90,13 @@ public:
{
npc_ancient_wispAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
CheckTimer = 1000;
ArchimondeGUID = 0;
}
@@ -100,7 +106,7 @@ public:
void Reset() override
{
CheckTimer = 1000;
Initialize();
ArchimondeGUID = instance->GetData64(DATA_ARCHIMONDE);
@@ -174,15 +180,23 @@ public:
struct npc_doomfire_targettingAI : public ScriptedAI
{
npc_doomfire_targettingAI(Creature* creature) : ScriptedAI(creature) { }
npc_doomfire_targettingAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
TargetGUID = 0;
ChangeTargetTimer = 5000;
}
uint64 TargetGUID;
uint32 ChangeTargetTimer;
void Reset() override
{
TargetGUID = 0;
ChangeTargetTimer = 5000;
Initialize();
}
void MoveInLineOfSight(Unit* who) override
@@ -244,9 +258,36 @@ public:
{
boss_archimondeAI(Creature* creature) : hyjal_trashAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
DoomfireSpiritGUID = 0;
damageTaken = 0;
WorldTreeGUID = 0;
DrainNordrassilTimer = 0;
FearTimer = 42000;
AirBurstTimer = 30000;
GripOfTheLegionTimer = urand(5000, 25000);
DoomfireTimer = 20000;
SoulChargeTimer = urand(2000, 30000);
SoulChargeCount = 0;
MeleeRangeCheckTimer = 15000;
HandOfDeathTimer = 2000;
WispCount = 0; // When ~30 wisps are summoned, Archimonde dies
EnrageTimer = 600000; // 10 minutes
CheckDistanceTimer = 30000; // This checks if he's too close to the World Tree (75 yards from a point on the tree), if true then he will enrage
SummonWispTimer = 0;
Enraged = false;
BelowTenPercent = false;
HasProtected = false;
IsChanneling = false;
}
InstanceScript* instance;
uint64 DoomfireSpiritGUID;
@@ -275,28 +316,7 @@ public:
{
instance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED);
DoomfireSpiritGUID = 0;
damageTaken = 0;
WorldTreeGUID = 0;
DrainNordrassilTimer = 0;
FearTimer = 42000;
AirBurstTimer = 30000;
GripOfTheLegionTimer = urand(5000, 25000);
DoomfireTimer = 20000;
SoulChargeTimer = urand(2000, 30000);
SoulChargeCount = 0;
MeleeRangeCheckTimer = 15000;
HandOfDeathTimer = 2000;
WispCount = 0; // When ~30 wisps are summoned, Archimonde dies
EnrageTimer = 600000; // 10 minutes
CheckDistanceTimer = 30000; // This checks if he's too close to the World Tree (75 yards from a point on the tree), if true then he will enrage
SummonWispTimer = 0;
Enraged = false;
BelowTenPercent = false;
HasProtected = false;
IsChanneling = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override

View File

@@ -55,10 +55,22 @@ public:
{
boss_azgalorAI(Creature* creature) : hyjal_trashAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
go = false;
}
void Initialize()
{
damageTaken = 0;
RainTimer = 20000;
DoomTimer = 50000;
HowlTimer = 30000;
CleaveTimer = 10000;
EnrageTimer = 600000;
enraged = false;
}
uint32 RainTimer;
uint32 DoomTimer;
uint32 HowlTimer;
@@ -70,13 +82,7 @@ public:
void Reset() override
{
damageTaken = 0;
RainTimer = 20000;
DoomTimer = 50000;
HowlTimer = 30000;
CleaveTimer = 10000;
EnrageTimer = 600000;
enraged = false;
Initialize();
if (IsEvent)
instance->SetData(DATA_AZGALOREVENT, NOT_STARTED);

View File

@@ -56,10 +56,20 @@ public:
{
boss_kazrogalAI(Creature* creature) : hyjal_trashAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
go = false;
}
void Initialize()
{
damageTaken = 0;
CleaveTimer = 5000;
WarStompTimer = 15000;
MarkTimer = 45000;
MarkTimerBase = 45000;
}
uint32 CleaveTimer;
uint32 WarStompTimer;
uint32 MarkTimer;
@@ -68,11 +78,7 @@ public:
void Reset() override
{
damageTaken = 0;
CleaveTimer = 5000;
WarStompTimer = 15000;
MarkTimer = 45000;
MarkTimerBase = 45000;
Initialize();
if (IsEvent)
instance->SetData(DATA_KAZROGALEVENT, NOT_STARTED);

View File

@@ -51,10 +51,20 @@ public:
{
boss_rage_winterchillAI(Creature* creature) : hyjal_trashAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
go = false;
}
void Initialize()
{
damageTaken = 0;
FrostArmorTimer = 37000;
DecayTimer = 45000;
NovaTimer = 15000;
IceboltTimer = 10000;
}
uint32 FrostArmorTimer;
uint32 DecayTimer;
uint32 NovaTimer;
@@ -63,11 +73,7 @@ public:
void Reset() override
{
damageTaken = 0;
FrostArmorTimer = 37000;
DecayTimer = 45000;
NovaTimer = 15000;
IceboltTimer = 10000;
Initialize();
if (IsEvent)
instance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED);

View File

@@ -317,6 +317,7 @@ float HordeFirePos[65][8]=//spawn points for the fire visuals (GO) in the horde
hyjalAI::hyjalAI(Creature* creature) : npc_escortAI(creature), Summons(me)
{
Initialize();
instance = creature->GetInstanceScript();
VeinsSpawned[0] = false;
VeinsSpawned[1] = false;
@@ -332,11 +333,45 @@ hyjalAI::hyjalAI(Creature* creature) : npc_escortAI(creature), Summons(me)
InfernalPoint = 0;
RespawnTimer = 10000;
DoRespawn = false;
DoHide = false;
MassTeleportTimer = 0;
DoMassTeleport = false;
}
void hyjalAI::Initialize()
{
IsDummy = false;
// GUIDs
PlayerGUID = 0;
BossGUID[0] = 0;
BossGUID[1] = 0;
// Timers
NextWaveTimer = 10000;
CheckTimer = 0;
RetreatTimer = 1000;
// Misc
WaveCount = 0;
EnemyCount = 0;
//Bools
EventBegun = false;
FirstBossDead = false;
SecondBossDead = false;
Summon = false;
bRetreat = false;
Debug = false;
//Visibility
DoHide = true;
//Initialize spells
memset(Spells, 0, sizeof(Spell) * HYJAL_AI_MAX_SPELLS);
Faction = 0;
}
void hyjalAI::JustSummoned(Creature* summoned)
{
Summons.Summon(summoned);
@@ -349,21 +384,9 @@ void hyjalAI::SummonedCreatureDespawn(Creature* summoned)
void hyjalAI::Reset()
{
IsDummy = false;
me->setActive(true);
// GUIDs
PlayerGUID = 0;
BossGUID[0] = 0;
BossGUID[1] = 0;
// Timers
NextWaveTimer = 10000;
CheckTimer = 0;
RetreatTimer = 1000;
// Misc
WaveCount = 0;
EnemyCount = 0;
Initialize();
// Set faction properly based on Creature entry
switch (me->GetEntry())
@@ -382,20 +405,9 @@ void hyjalAI::Reset()
break;
}
//Bools
EventBegun = false;
FirstBossDead = false;
SecondBossDead = false;
Summon = false;
bRetreat = false;
Debug = false;
//Flags
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
//Initialize spells
memset(Spells, 0, sizeof(Spell) * HYJAL_AI_MAX_SPELLS);
//Reset Instance Data for trash count
if ((!instance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == JAINA) || (instance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == THRALL))
{
@@ -405,9 +417,6 @@ void hyjalAI::Reset()
instance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0);
instance->SetData(DATA_RESET_TRASH_COUNT, 0);
}
//Visibility
DoHide = true;
}
void hyjalAI::EnterEvadeMode()

View File

@@ -119,6 +119,8 @@ struct hyjalAI : public npc_escortAI
{
hyjalAI(Creature* creature);
void Initialize();
void Reset(); // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat
void EnterEvadeMode(); // Send creature back to spawn location and evade.

View File

@@ -1135,9 +1135,15 @@ public:
{
npc_frost_wyrmAI(Creature* creature) : hyjal_trashAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
go = false;
Reset();
}
void Initialize()
{
FrostBreathTimer = 5000;
MoveTimer = 0;
}
bool go;
@@ -1146,8 +1152,7 @@ public:
void Reset() override
{
FrostBreathTimer = 5000;
MoveTimer = 0;
Initialize();
me->SetDisableGravity(true);
}
@@ -1388,9 +1393,15 @@ public:
{
alliance_riflemanAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
SetCombatMovement(false);
}
void Initialize()
{
ExplodeTimer = 5000 + rand32() % 5000;
}
uint32 ExplodeTimer;
void JustDied(Unit* /*killer*/) override
@@ -1399,7 +1410,7 @@ public:
void Reset() override
{
ExplodeTimer = 5000 + rand32() % 5000;
Initialize();
}
void MoveInLineOfSight(Unit* who) override

View File

@@ -59,9 +59,20 @@ public:
{
boss_epochAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
uiStep = 1;
uiStepTimer = 26000;
uiCurseOfExertionTimer = 9300;
uiTimeWarpTimer = 25300;
uiTimeStopTimer = 21300;
uiWoundingStrikeTimer = 5300;
}
uint8 uiStep;
uint32 uiStepTimer;
@@ -74,12 +85,7 @@ public:
void Reset() override
{
uiStep = 1;
uiStepTimer = 26000;
uiCurseOfExertionTimer = 9300;
uiTimeWarpTimer = 25300;
uiTimeStopTimer = 21300;
uiWoundingStrikeTimer = 5300;
Initialize();
instance->SetData(DATA_EPOCH_EVENT, NOT_STARTED);
}

View File

@@ -73,7 +73,21 @@ public:
{
boss_mal_ganisAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
uiOutroStep = 0;
}
void Initialize()
{
bYelled = false;
bYelled2 = false;
Phase = COMBAT;
uiCarrionSwarmTimer = 6000;
uiMindBlastTimer = 11000;
uiVampiricTouchTimer = urand(10000, 15000);
uiSleepTimer = urand(15000, 20000);
uiOutroTimer = 1000;
}
uint32 uiCarrionSwarmTimer;
@@ -93,16 +107,9 @@ public:
void Reset() override
{
bYelled = false;
bYelled2 = false;
Phase = COMBAT;
uiCarrionSwarmTimer = 6000;
uiMindBlastTimer = 11000;
uiVampiricTouchTimer = urand(10000, 15000);
uiSleepTimer = urand(15000, 20000);
uiOutroTimer = 1000;
Initialize();
instance->SetData(DATA_MAL_GANIS_EVENT, NOT_STARTED);
instance->SetData(DATA_MAL_GANIS_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) override

View File

@@ -58,10 +58,18 @@ public:
{
boss_meathookAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
Talk(SAY_SPAWN);
}
void Initialize()
{
uiChainTimer = urand(12000, 17000); //seen on video 13, 17, 15, 12, 16
uiDiseaseTimer = urand(2000, 4000); //approx 3s
uiFrenzyTimer = urand(21000, 26000); //made it up
}
uint32 uiChainTimer;
uint32 uiDiseaseTimer;
uint32 uiFrenzyTimer;
@@ -70,9 +78,7 @@ public:
void Reset() override
{
uiChainTimer = urand(12000, 17000); //seen on video 13, 17, 15, 12, 16
uiDiseaseTimer = urand(2000, 4000); //approx 3s
uiFrenzyTimer = urand(21000, 26000); //made it up
Initialize();
instance->SetData(DATA_MEATHOOK_EVENT, NOT_STARTED);
}

View File

@@ -63,10 +63,20 @@ public:
{
boss_salrammAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
Talk(SAY_SPAWN);
}
void Initialize()
{
uiCurseFleshTimer = 30000; //30s DBM
uiExplodeGhoulTimer = urand(25000, 28000); //approx 6 sec after summon ghouls
uiShadowBoltTimer = urand(8000, 12000); // approx 10s
uiStealFleshTimer = 12345;
uiSummonGhoulsTimer = urand(19000, 24000); //on a video approx 24s after aggro
}
uint32 uiCurseFleshTimer;
uint32 uiExplodeGhoulTimer;
uint32 uiShadowBoltTimer;
@@ -77,13 +87,9 @@ public:
void Reset() override
{
uiCurseFleshTimer = 30000; //30s DBM
uiExplodeGhoulTimer = urand(25000, 28000); //approx 6 sec after summon ghouls
uiShadowBoltTimer = urand(8000, 12000); // approx 10s
uiStealFleshTimer = 12345;
uiSummonGhoulsTimer = urand(19000, 24000); //on a video approx 24s after aggro
Initialize();
instance->SetData(DATA_SALRAMM_EVENT, NOT_STARTED);
instance->SetData(DATA_SALRAMM_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* /*who*/) override

View File

@@ -351,35 +351,15 @@ public:
{
npc_arthasAI(Creature* creature) : npc_escortAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
Reset();
bStepping = false;
step = 0;
gossipStep = 0;
bossEvent = 0;
}
InstanceScript* instance;
bool bStepping;
uint32 step;
uint32 phaseTimer;
uint32 gossipStep;
uint32 playerFaction;
uint32 bossEvent;
uint32 wave;
uint64 utherGUID;
uint64 jainaGUID;
uint64 citymenGUID[2];
uint64 waveGUID[ENCOUNTER_WAVES_MAX_SPAWNS];
uint64 infiniteDraconianGUID[ENCOUNTER_DRACONIAN_NUMBER];
uint64 stalkerGUID;
uint64 bossGUID;
uint64 epochGUID;
uint64 malganisGUID;
uint64 infiniteGUID;
uint32 exorcismTimer;
void Reset() override
void Initialize()
{
utherGUID = 0;
jainaGUID = 0;
@@ -399,6 +379,38 @@ public:
malganisGUID = 0;
infiniteGUID = 0;
phaseTimer = 1000;
exorcismTimer = 7300;
wave = 0;
}
InstanceScript* instance;
bool bStepping;
uint32 step;
uint32 phaseTimer;
uint32 gossipStep;
uint32 bossEvent;
uint32 wave;
uint64 utherGUID;
uint64 jainaGUID;
uint64 citymenGUID[2];
uint64 waveGUID[ENCOUNTER_WAVES_MAX_SPAWNS];
uint64 infiniteDraconianGUID[ENCOUNTER_DRACONIAN_NUMBER];
uint64 stalkerGUID;
uint64 bossGUID;
uint64 epochGUID;
uint64 malganisGUID;
uint64 infiniteGUID;
uint32 exorcismTimer;
void Reset() override
{
Initialize();
instance->SetData(DATA_ARTHAS_EVENT, NOT_STARTED);
switch (instance->GetData(DATA_ARTHAS_EVENT))
{
@@ -410,9 +422,6 @@ public:
gossipStep = 0;
break;
}
phaseTimer = 1000;
exorcismTimer = 7300;
wave = 0;
}
void EnterCombat(Unit* /*who*/) override

View File

@@ -61,9 +61,20 @@ public:
{
boss_captain_skarlocAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
Holy_Light_Timer = urand(20000, 30000);
Cleanse_Timer = 10000;
HammerOfJustice_Timer = urand(20000, 35000);
HolyShield_Timer = 240000;
DevotionAura_Timer = 3000;
Consecration_Timer = 8000;
}
InstanceScript* instance;
uint32 Holy_Light_Timer;
@@ -75,12 +86,7 @@ public:
void Reset() override
{
Holy_Light_Timer = urand(20000, 30000);
Cleanse_Timer = 10000;
HammerOfJustice_Timer = urand(20000, 35000);
HolyShield_Timer = 240000;
DevotionAura_Timer = 3000;
Consecration_Timer = 8000;
Initialize();
}
void EnterCombat(Unit* /*who*/) override

View File

@@ -59,9 +59,18 @@ public:
{
boss_epoch_hunterAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
SandBreath_Timer = urand(8000, 16000);
ImpendingDeath_Timer = urand(25000, 30000);
WingBuffet_Timer = 35000;
Mda_Timer = 40000;
}
InstanceScript* instance;
uint32 SandBreath_Timer;
@@ -71,10 +80,7 @@ public:
void Reset() override
{
SandBreath_Timer = urand(8000, 16000);
ImpendingDeath_Timer = urand(25000, 30000);
WingBuffet_Timer = 35000;
Mda_Timer = 40000;
Initialize();
}
void EnterCombat(Unit* /*who*/) override

View File

@@ -114,7 +114,21 @@ public:
struct boss_lieutenant_drakeAI : public ScriptedAI
{
boss_lieutenant_drakeAI(Creature* creature) : ScriptedAI(creature) { }
boss_lieutenant_drakeAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
CanPatrol = true;
wpId = 0;
Whirlwind_Timer = 20000;
Fear_Timer = 30000;
MortalStrike_Timer = 45000;
ExplodingShout_Timer = 25000;
}
bool CanPatrol;
uint32 wpId;
@@ -126,13 +140,7 @@ public:
void Reset() override
{
CanPatrol = true;
wpId = 0;
Whirlwind_Timer = 20000;
Fear_Timer = 30000;
MortalStrike_Timer = 45000;
ExplodingShout_Timer = 25000;
Initialize();
}
void EnterCombat(Unit* /*who*/) override

View File

@@ -276,11 +276,17 @@ public:
{
npc_thrall_old_hillsbradAI(Creature* creature) : npc_escortAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
HadMount = false;
me->setActive(true);
}
void Initialize()
{
LowHp = false;
}
InstanceScript* instance;
bool LowHp;
@@ -451,7 +457,7 @@ public:
void Reset() override
{
LowHp = false;
Initialize();
if (HadMount)
DoMount();

View File

@@ -77,9 +77,19 @@ public:
{
npc_medivh_bmAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
SpellCorrupt_Timer = 0;
Check_Timer = 0;
Life75 = true;
Life50 = true;
Life25 = true;
}
InstanceScript* instance;
uint32 SpellCorrupt_Timer;
@@ -91,11 +101,7 @@ public:
void Reset() override
{
SpellCorrupt_Timer = 0;
Check_Timer = 0;
Life75 = true;
Life50 = true;
Life25 = true;
Initialize();
if (instance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
DoCast(me, SPELL_CHANNEL, true);
@@ -265,23 +271,28 @@ public:
{
npc_time_riftAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
TimeRiftWave_Timer = 15000;
mRiftWaveCount = 0;
mWaveId = 0;
}
InstanceScript* instance;
uint32 TimeRiftWave_Timer;
uint8 mRiftWaveCount;
uint8 mPortalCount;
uint8 mWaveId;
void Reset() override
{
Initialize();
TimeRiftWave_Timer = 15000;
mRiftWaveCount = 0;
mPortalCount = instance->GetData(DATA_PORTAL_COUNT);
uint8 mPortalCount = instance->GetData(DATA_PORTAL_COUNT);
if (mPortalCount < 6)
mWaveId = 0;

View File

@@ -45,7 +45,17 @@ public:
struct celebras_the_cursedAI : public ScriptedAI
{
celebras_the_cursedAI(Creature* creature) : ScriptedAI(creature) { }
celebras_the_cursedAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
WrathTimer = 8000;
EntanglingRootsTimer = 2000;
CorruptForcesTimer = 30000;
}
uint32 WrathTimer;
uint32 EntanglingRootsTimer;
@@ -53,9 +63,7 @@ public:
void Reset() override
{
WrathTimer = 8000;
EntanglingRootsTimer = 2000;
CorruptForcesTimer = 30000;
Initialize();
}
void EnterCombat(Unit* /*who*/) override { }

View File

@@ -45,7 +45,17 @@ public:
struct boss_landslideAI : public ScriptedAI
{
boss_landslideAI(Creature* creature) : ScriptedAI(creature) { }
boss_landslideAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
KnockAwayTimer = 8000;
TrampleTimer = 2000;
LandslideTimer = 0;
}
uint32 KnockAwayTimer;
uint32 TrampleTimer;
@@ -53,9 +63,7 @@ public:
void Reset() override
{
KnockAwayTimer = 8000;
TrampleTimer = 2000;
LandslideTimer = 0;
Initialize();
}
void EnterCombat(Unit* /*who*/) override

View File

@@ -44,7 +44,19 @@ public:
struct boss_noxxionAI : public ScriptedAI
{
boss_noxxionAI(Creature* creature) : ScriptedAI(creature) { }
boss_noxxionAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
ToxicVolleyTimer = 7000;
UppercutTimer = 16000;
AddsTimer = 19000;
InvisibleTimer = 15000; //Too much too low?
Invisible = false;
}
uint32 ToxicVolleyTimer;
uint32 UppercutTimer;
@@ -54,11 +66,7 @@ public:
void Reset() override
{
ToxicVolleyTimer = 7000;
UppercutTimer = 16000;
AddsTimer = 19000;
InvisibleTimer = 15000; //Too much too low?
Invisible = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override { }

View File

@@ -47,7 +47,18 @@ public:
struct boss_ptheradrasAI : public ScriptedAI
{
boss_ptheradrasAI(Creature* creature) : ScriptedAI(creature) { }
boss_ptheradrasAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
DustfieldTimer = 8000;
BoulderTimer = 2000;
ThrashTimer = 5000;
RepulsiveGazeTimer = 23000;
}
uint32 DustfieldTimer;
uint32 BoulderTimer;
@@ -56,10 +67,7 @@ public:
void Reset() override
{
DustfieldTimer = 8000;
BoulderTimer = 2000;
ThrashTimer = 5000;
RepulsiveGazeTimer = 23000;
Initialize();
}
void EnterCombat(Unit* /*who*/) override { }

View File

@@ -111,6 +111,7 @@ static OnyxMove MoveData[8]=
Position const MiddleRoomLocation = {-23.6155f, -215.357f, -55.7344f, 0.0f};
Position const Phase2Location = {-80.924f, -214.299f, -82.942f, 0.0f};
Position const Phase2Floating = { -80.924f, -214.299f, -57.942f, 0.0f };
Position const SpawnLocations[3]=
{
@@ -128,7 +129,7 @@ public:
struct boss_onyxiaAI : public BossAI
{
boss_onyxiaAI(Creature* creature) : BossAI(creature, DATA_ONYXIA), Summons(me)
boss_onyxiaAI(Creature* creature) : BossAI(creature, DATA_ONYXIA)
{
Reset();
}
@@ -138,16 +139,16 @@ public:
if (!IsCombatMovementAllowed())
SetCombatMovement(true);
_Reset();
Phase = PHASE_START;
MovePoint = urand(0, 5);
PointData = GetMoveData();
Summons.DespawnAll();
SummonWhelpCount = 0;
IsMoving = false;
instance->SetBossState(DATA_ONYXIA, NOT_STARTED);
instance->SetData(DATA_ONYXIA_PHASE, Phase);
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
void EnterCombat(Unit* /*who*/) override
@@ -155,20 +156,15 @@ public:
Talk(SAY_AGGRO);
me->SetInCombatWithZone();
events.ScheduleEvent(EVENT_FLAME_BREATH, urand (10000, 20000));
events.ScheduleEvent(EVENT_TAIL_SWEEP, urand (15000, 20000));
events.ScheduleEvent(EVENT_CLEAVE, urand (2000, 5000));
events.ScheduleEvent(EVENT_WING_BUFFET, urand (10000, 20000));
events.Reset();
events.ScheduleEvent(EVENT_FLAME_BREATH, urand(10000, 20000));
events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(15000, 20000));
events.ScheduleEvent(EVENT_CLEAVE, urand(2000, 5000));
events.ScheduleEvent(EVENT_WING_BUFFET, urand(10000, 20000));
instance->SetBossState(DATA_ONYXIA, IN_PROGRESS);
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
void JustDied(Unit* /*killer*/) override
{
instance->SetBossState(DATA_ONYXIA, DONE);
Summons.DespawnAll();
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
void JustSummoned(Creature* summoned) override
@@ -186,13 +182,9 @@ public:
summoned->setActive(true);
break;
}
Summons.Summon(summoned);
summons.Summon(summoned);
}
void SummonedCreatureDespawn(Creature* summon) override
{
Summons.Despawn(summon);
}
void KilledUnit(Unit* /*victim*/) override
{
@@ -231,22 +223,43 @@ public:
}
break;
case 9:
me->GetMotionMaster()->MoveChase(me->GetVictim());
events.ScheduleEvent(EVENT_BELLOWING_ROAR, 1000);
me->SetCanFly(false);
me->SetDisableGravity(false);
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
if (Creature* trigger = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_TRIGGER_GUID)))
me->Kill(trigger);
me->SetReactState(REACT_AGGRESSIVE);
// tank selection based on phase one. If tank is not there i take nearest one
if (Unit* tank = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_TANK_GUID)))
me->GetMotionMaster()->MoveChase(tank);
else if (Unit* newtarget = SelectTarget(SELECT_TARGET_NEAREST, 0))
me->GetMotionMaster()->MoveChase(newtarget);
events.ScheduleEvent(EVENT_BELLOWING_ROAR, 5000);
events.ScheduleEvent(EVENT_FLAME_BREATH, urand(10000, 20000));
events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(15000, 20000));
events.ScheduleEvent(EVENT_CLEAVE, urand(2000, 5000));
events.ScheduleEvent(EVENT_WING_BUFFET, urand(15000, 30000));
break;
case 10:
me->SetCanFly(true);
me->GetMotionMaster()->MovePoint(11, Phase2Location.GetPositionX(), Phase2Location.GetPositionY(), Phase2Location.GetPositionZ()+25);
me->SetDisableGravity(true);
me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->SetFacingTo(me->GetOrientation() + float(M_PI));
if (Creature * trigger = me->SummonCreature(NPC_TRIGGER, MiddleRoomLocation, TEMPSUMMON_CORPSE_DESPAWN))
instance->SetData64(DATA_TRIGGER_GUID, trigger->GetGUID());
me->GetMotionMaster()->MoveTakeoff(11, Phase2Floating);
me->SetSpeed(MOVE_FLIGHT, 1.0f);
Talk(SAY_PHASE_2_TRANS);
instance->SetData(DATA_ONYXIA_PHASE, Phase);
events.ScheduleEvent(EVENT_WHELP_SPAWN, 5000);
events.ScheduleEvent(EVENT_LAIR_GUARD, 15000);
events.ScheduleEvent(EVENT_DEEP_BREATH, 75000);
events.ScheduleEvent(EVENT_MOVEMENT, 10000);
events.ScheduleEvent(EVENT_FIREBALL, 18000);
break;
case 11:
if (PointData)
me->GetMotionMaster()->MovePoint(PointData->LocId, PointData->fX, PointData->fY, PointData->fZ);
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveIdle();
break;
default:
@@ -272,13 +285,13 @@ public:
(Spell->Id >= 22267 && Spell->Id <= 22268)) &&
(target->GetTypeId() == TYPEID_PLAYER))
{
instance->SetData(DATA_SHE_DEEP_BREATH_MORE, FAIL);
instance->SetData(DATA_SHE_DEEP_BREATH_MORE, FAIL);
}
}
OnyxMove* GetMoveData()
{
uint8 MaxCount = sizeof(MoveData)/sizeof(OnyxMove);
uint8 MaxCount = sizeof(MoveData) / sizeof(OnyxMove);
for (uint8 i = 0; i < MaxCount; ++i)
{
@@ -291,9 +304,9 @@ public:
void SetNextRandomPoint()
{
uint8 MaxCount = sizeof(MoveData)/sizeof(OnyxMove);
uint8 MaxCount = sizeof(MoveData) / sizeof(OnyxMove);
uint8 iTemp = urand(0, MaxCount-1);
uint8 iTemp = urand(0, MaxCount - 1);
if (iTemp >= MovePoint)
++iTemp;
@@ -312,15 +325,13 @@ public:
//Specific to PHASE_START || PHASE_END
if (Phase == PHASE_START)
{
if (HealthBelowPct(60))
if (HealthBelowPct(65))
{
SetCombatMovement(false);
Phase = PHASE_BREATH;
events.ScheduleEvent(EVENT_DEEP_BREATH, 85000);
events.ScheduleEvent(EVENT_MOVEMENT, 14000);
events.ScheduleEvent(EVENT_FIREBALL, 15000);
events.ScheduleEvent(EVENT_LAIR_GUARD, 60000);
events.ScheduleEvent(EVENT_WHELP_SPAWN, 60000);
instance->SetData64(DATA_TANK_GUID, me->GetVictim()->GetGUID());
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
me->GetMotionMaster()->MovePoint(10, Phase2Location);
return;
}
@@ -347,19 +358,19 @@ public:
}
case EVENT_FLAME_BREATH: // Phase PHASE_START and PHASE_END
DoCastVictim(SPELL_FLAME_BREATH);
events.ScheduleEvent(EVENT_FLAME_BREATH, urand (10000, 20000));
events.ScheduleEvent(EVENT_FLAME_BREATH, urand(10000, 20000));
break;
case EVENT_TAIL_SWEEP: // Phase PHASE_START and PHASE_END
DoCastAOE(SPELL_TAIL_SWEEP);
events.ScheduleEvent(EVENT_TAIL_SWEEP, urand (15000, 20000));
events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(15000, 20000));
break;
case EVENT_CLEAVE: // Phase PHASE_START and PHASE_END
DoCastVictim(SPELL_CLEAVE);
events.ScheduleEvent(EVENT_CLEAVE, urand (2000, 5000));
events.ScheduleEvent(EVENT_CLEAVE, urand(2000, 5000));
break;
case EVENT_WING_BUFFET: // Phase PHASE_START and PHASE_END
DoCastVictim(SPELL_WING_BUFFET);
events.ScheduleEvent(EVENT_WING_BUFFET, urand (15000, 30000));
events.ScheduleEvent(EVENT_WING_BUFFET, urand(15000, 30000));
break;
default:
break;
@@ -374,15 +385,18 @@ public:
Phase = PHASE_END;
instance->SetData(DATA_ONYXIA_PHASE, PHASE_END);
Talk(SAY_PHASE_3_TRANS);
SetCombatMovement(true);
me->SetCanFly(false);
IsMoving = false;
me->GetMotionMaster()->MovePoint(9, me->GetHomePosition());
Position const pos = me->GetHomePosition();
me->GetMotionMaster()->MovePoint(9, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ() + 12.0f);
events.ScheduleEvent(EVENT_BELLOWING_ROAR, 30000);
return;
}
if (!me->isMoving())
if (Creature* trigger = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_TRIGGER_GUID)))
me->SetFacingToObject(trigger);
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
@@ -398,8 +412,10 @@ public:
Talk(EMOTE_BREATH);
if (PointData) /// @todo: In what cases is this null? What should we do?
DoCast(me, PointData->SpellId);
events.ScheduleEvent(EVENT_DEEP_BREATH, 70000);
events.ScheduleEvent(EVENT_DEEP_BREATH, 75000);
}
else
events.ScheduleEvent(EVENT_DEEP_BREATH, 1000);
break;
case EVENT_MOVEMENT: // Phase PHASE_BREATH
if (!IsMoving && !(me->HasUnitState(UNIT_STATE_CASTING)))
@@ -414,18 +430,21 @@ public:
IsMoving = true;
events.ScheduleEvent(EVENT_MOVEMENT, 25000);
}
else
events.ScheduleEvent(EVENT_MOVEMENT, 500);
break;
case EVENT_FIREBALL: // Phase PHASE_BREATH
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
if (!IsMoving)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_FIREBALL);
events.ScheduleEvent(EVENT_FIREBALL, 8000);
}
else
events.ScheduleEvent(EVENT_FIREBALL, 1000);
break;
case EVENT_LAIR_GUARD: // Phase PHASE_BREATH
me->SummonCreature(NPC_LAIRGUARD, SpawnLocations[2], TEMPSUMMON_CORPSE_DESPAWN);
me->SummonCreature(NPC_LAIRGUARD, SpawnLocations[2], TEMPSUMMON_CORPSE_DESPAWN);
events.ScheduleEvent(EVENT_LAIR_GUARD, 30000);
break;
case EVENT_WHELP_SPAWN: // Phase PHASE_BREATH
@@ -437,7 +456,7 @@ public:
events.ScheduleEvent(EVENT_WHELP_SPAWN, 90000);
}
else
events.ScheduleEvent(EVENT_WHELP_SPAWN, 500);
events.ScheduleEvent(EVENT_WHELP_SPAWN, 500);
break;
default:
break;
@@ -447,7 +466,6 @@ public:
}
private:
SummonList Summons;
OnyxMove* PointData;
uint8 Phase;
uint8 MovePoint;

View File

@@ -53,6 +53,8 @@ public:
SetBossNumber(EncounterCount);
onyxiaGUID = 0;
triggerGUID = 0;
tankGUID = 0;
onyxiaLiftoffTimer = 0;
manyWhelpsCounter = 0;
eruptTimer = 0;
@@ -181,6 +183,12 @@ public:
FloorEruptionGUIDQueue.push(data);
eruptTimer = 2500;
break;
case DATA_TRIGGER_GUID:
triggerGUID = data;
break;
case DATA_TANK_GUID:
tankGUID = data;
break;
}
}
@@ -190,6 +198,13 @@ public:
{
case NPC_ONYXIA:
return onyxiaGUID;
break;
case DATA_TRIGGER_GUID:
return triggerGUID;
break;
case DATA_TANK_GUID:
return tankGUID;
break;
}
return 0;
@@ -298,6 +313,8 @@ public:
std::map<uint64, uint32> FloorEruptionGUID[2];
std::queue<uint64> FloorEruptionGUIDQueue;
uint64 onyxiaGUID;
uint64 triggerGUID;
uint64 tankGUID;
uint32 onyxiaLiftoffTimer;
uint32 manyWhelpsCounter;
uint32 eruptTimer;

View File

@@ -35,7 +35,9 @@ enum Data32
enum Data64
{
DATA_ONYXIA_GUID = 0,
DATA_FLOOR_ERUPTION_GUID = 1
DATA_FLOOR_ERUPTION_GUID = 1,
DATA_TRIGGER_GUID = 2,
DATA_TANK_GUID = 3
};
enum OnyxiaPhases
@@ -49,7 +51,8 @@ enum CreatureIds
{
NPC_WHELP = 11262,
NPC_LAIRGUARD = 36561,
NPC_ONYXIA = 10184
NPC_ONYXIA = 10184,
NPC_TRIGGER = 14495
};
enum GameObjectIds

View File

@@ -50,14 +50,22 @@ public:
struct boss_amnennar_the_coldbringerAI : public BossAI
{
boss_amnennar_the_coldbringerAI(Creature* creature) : BossAI(creature, DATA_AMNENNAR_THE_COLD_BRINGER) { }
boss_amnennar_the_coldbringerAI(Creature* creature) : BossAI(creature, DATA_AMNENNAR_THE_COLD_BRINGER)
{
Initialize();
}
void Initialize()
{
hp60Spectrals = false;
hp30Spectrals = false;
hp50 = false;
}
void Reset() override
{
_Reset();
hp60Spectrals = false;
hp30Spectrals = false;
hp50 = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override

View File

@@ -80,13 +80,19 @@ class boss_ayamiss : public CreatureScript
{
boss_ayamissAI(Creature* creature) : BossAI(creature, DATA_AYAMISS)
{
Initialize();
}
void Initialize()
{
_phase = PHASE_AIR;
_enraged = false;
}
void Reset() override
{
_Reset();
_phase = PHASE_AIR;
_enraged = false;
Initialize();
SetCombatMovement(false);
}

View File

@@ -69,6 +69,7 @@ class boss_buru : public CreatureScript
{
boss_buruAI(Creature* creature) : BossAI(creature, DATA_BURU)
{
_phase = 0;
}
void EnterEvadeMode() override

View File

@@ -53,12 +53,18 @@ class boss_kurinnaxx : public CreatureScript
{
boss_kurinnaxxAI(Creature* creature) : BossAI(creature, DATA_KURINNAXX)
{
Initialize();
}
void Initialize()
{
_enraged = false;
}
void Reset() override
{
_Reset();
_enraged = false;
Initialize();
events.ScheduleEvent(EVENT_MORTAL_WOUND, 8000);
events.ScheduleEvent(EVENT_SANDTRAP, urand(5000, 15000));
events.ScheduleEvent(EVENT_TRASH, 1000);

View File

@@ -60,13 +60,19 @@ class boss_moam : public CreatureScript
{
boss_moamAI(Creature* creature) : BossAI(creature, DATA_MOAM)
{
Initialize();
}
void Initialize()
{
_isStonePhase = false;
}
void Reset() override
{
_Reset();
me->SetPower(POWER_MANA, 0);
_isStonePhase = false;
Initialize();
events.ScheduleEvent(EVENT_STONE_PHASE, 90000);
//events.ScheduleEvent(EVENT_WIDE_SLASH, 11000);
}

View File

@@ -88,9 +88,17 @@ class boss_ossirian : public CreatureScript
{
boss_ossirianAI(Creature* creature) : BossAI(creature, DATA_OSSIRIAN)
{
Initialize();
SaidIntro = false;
}
void Initialize()
{
CrystalIterator = 0;
TriggerGUID = 0;
CrystalGUID = 0;
}
uint64 TriggerGUID;
uint64 CrystalGUID;
uint8 CrystalIterator;
@@ -99,9 +107,7 @@ class boss_ossirian : public CreatureScript
void Reset() override
{
_Reset();
CrystalIterator = 0;
TriggerGUID = 0;
CrystalGUID = 0;
Initialize();
}
void SpellHit(Unit* caster, SpellInfo const* spell) override

View File

@@ -65,12 +65,18 @@ class boss_rajaxx : public CreatureScript
{
boss_rajaxxAI(Creature* creature) : BossAI(creature, DATA_RAJAXX)
{
Initialize();
}
void Initialize()
{
enraged = false;
}
void Reset() override
{
_Reset();
enraged = false;
Initialize();
events.ScheduleEvent(EVENT_DISARM, 10000);
events.ScheduleEvent(EVENT_THUNDERCRASH, 12000);
}

View File

@@ -55,9 +55,20 @@ public:
{
boss_kriAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
Cleave_Timer = urand(4000, 8000);
ToxicVolley_Timer = urand(6000, 12000);
Check_Timer = 2000;
VemDead = false;
Death = false;
}
InstanceScript* instance;
uint32 Cleave_Timer;
@@ -69,12 +80,7 @@ public:
void Reset() override
{
Cleave_Timer = urand(4000, 8000);
ToxicVolley_Timer = urand(6000, 12000);
Check_Timer = 2000;
VemDead = false;
Death = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override
@@ -148,9 +154,19 @@ public:
{
boss_vemAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
Charge_Timer = urand(15000, 27000);
KnockBack_Timer = urand(8000, 20000);
Enrage_Timer = 120000;
Enraged = false;
}
InstanceScript* instance;
uint32 Charge_Timer;
@@ -161,11 +177,7 @@ public:
void Reset() override
{
Charge_Timer = urand(15000, 27000);
KnockBack_Timer = urand(8000, 20000);
Enrage_Timer = 120000;
Enraged = false;
Initialize();
}
void JustDied(Unit* /*killer*/) override
@@ -237,9 +249,19 @@ public:
{
boss_yaujAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
Heal_Timer = urand(25000, 40000);
Fear_Timer = urand(12000, 24000);
Check_Timer = 2000;
VemDead = false;
}
InstanceScript* instance;
uint32 Heal_Timer;
@@ -250,11 +272,7 @@ public:
void Reset() override
{
Heal_Timer = urand(25000, 40000);
Fear_Timer = urand(12000, 24000);
Check_Timer = 2000;
VemDead = false;
Initialize();
}
void JustDied(Unit* /*killer*/) override

View File

@@ -160,11 +160,29 @@ public:
{
eye_of_cthunAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
SetCombatMovement(false);
}
void Initialize()
{
//Phase information
PhaseTimer = 50000; //First dark glare in 50 seconds
//Eye beam phase 50 seconds
BeamTimer = 3000;
EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam
ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn during Dark beam)
//Dark Beam phase 35 seconds (each tick = 1 second, 35 ticks)
DarkGlareTick = 0;
DarkGlareTickTimer = 1000;
DarkGlareAngle = 0;
ClockWise = false;
}
InstanceScript* instance;
//Global variables
@@ -183,19 +201,7 @@ public:
void Reset() override
{
//Phase information
PhaseTimer = 50000; //First dark glare in 50 seconds
//Eye beam phase 50 seconds
BeamTimer = 3000;
EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam
ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn during Dark beam)
//Dark Beam phase 35 seconds (each tick = 1 second, 35 ticks)
DarkGlareTick = 0;
DarkGlareTickTimer = 1000;
DarkGlareAngle = 0;
ClockWise = false;
Initialize();
//Reset flags
me->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
@@ -454,11 +460,34 @@ public:
{
cthunAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
SetCombatMovement(false);
instance = creature->GetInstanceScript();
}
void Initialize()
{
//One random wisper every 90 - 300 seconds
WisperTimer = 90000;
//Phase information
PhaseTimer = 10000; //Emerge in 10 seconds
//No hold player for transition
HoldPlayer = 0;
//Body Phase
EyeTentacleTimer = 30000;
FleshTentaclesKilled = 0;
GiantClawTentacleTimer = 15000; //15 seconds into body phase (1 min repeat)
GiantEyeTentacleTimer = 45000; //15 seconds into body phase (1 min repeat)
StomachAcidTimer = 4000; //Every 4 seconds
StomachEnterTimer = 10000; //Every 10 seconds
StomachEnterVisTimer = 0; //Always 3.5 seconds after Stomach Enter Timer
StomachEnterTarget = 0; //Target to be teleported to stomach
}
InstanceScript* instance;
//Out of combat whisper timer
@@ -487,24 +516,7 @@ public:
void Reset() override
{
//One random wisper every 90 - 300 seconds
WisperTimer = 90000;
//Phase information
PhaseTimer = 10000; //Emerge in 10 seconds
//No hold player for transition
HoldPlayer = 0;
//Body Phase
EyeTentacleTimer = 30000;
FleshTentaclesKilled = 0;
GiantClawTentacleTimer = 15000; //15 seconds into body phase (1 min repeat)
GiantEyeTentacleTimer = 45000; //15 seconds into body phase (1 min repeat)
StomachAcidTimer = 4000; //Every 4 seconds
StomachEnterTimer = 10000; //Every 10 seconds
StomachEnterVisTimer = 0; //Always 3.5 seconds after Stomach Enter Timer
StomachEnterTarget = 0; //Target to be teleported to stomach
Initialize();
//Clear players in stomach and outside
Stomach_Map.clear();

View File

@@ -53,23 +53,28 @@ public:
struct boss_fankrissAI : public ScriptedAI
{
boss_fankrissAI(Creature* creature) : ScriptedAI(creature) { }
boss_fankrissAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
MortalWound_Timer = urand(10000, 15000);
SpawnHatchlings_Timer = urand(6000, 12000);
SpawnSpawns_Timer = urand(15000, 45000);
}
uint32 MortalWound_Timer;
uint32 SpawnHatchlings_Timer;
uint32 SpawnSpawns_Timer;
int Rand;
float RandX;
float RandY;
Creature* Hatchling;
Creature* Spawn;
void Reset() override
{
MortalWound_Timer = urand(10000, 15000);
SpawnHatchlings_Timer = urand(6000, 12000);
SpawnSpawns_Timer = urand(15000, 45000);
Initialize();
}
void SummonSpawn(Unit* victim)
@@ -77,7 +82,10 @@ public:
if (!victim)
return;
Rand = 10 + (rand32() % 10);
int Rand = 10 + (rand32() % 10);
float RandX = 0.f;
float RandY = 0.f;
switch (rand32() % 2)
{
case 0: RandX = 0.0f - Rand; break;

View File

@@ -51,7 +51,23 @@ public:
struct boss_huhuranAI : public ScriptedAI
{
boss_huhuranAI(Creature* creature) : ScriptedAI(creature) { }
boss_huhuranAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
Frenzy_Timer = urand(25000, 35000);
Wyvern_Timer = urand(18000, 28000);
Spit_Timer = 8000;
PoisonBolt_Timer = 4000;
NoxiousPoison_Timer = urand(10000, 20000);
FrenzyBack_Timer = 15000;
Frenzy = false;
Berserk = false;
}
uint32 Frenzy_Timer;
uint32 Wyvern_Timer;
@@ -65,15 +81,7 @@ public:
void Reset() override
{
Frenzy_Timer = urand(25000, 35000);
Wyvern_Timer = urand(18000, 28000);
Spit_Timer = 8000;
PoisonBolt_Timer = 4000;
NoxiousPoison_Timer = urand(10000, 20000);
FrenzyBack_Timer = 15000;
Frenzy = false;
Berserk = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override

View File

@@ -48,7 +48,23 @@ public:
struct boss_ouroAI : public ScriptedAI
{
boss_ouroAI(Creature* creature) : ScriptedAI(creature) { }
boss_ouroAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
Sweep_Timer = urand(5000, 10000);
SandBlast_Timer = urand(20000, 35000);
Submerge_Timer = urand(90000, 150000);
Back_Timer = urand(30000, 45000);
ChangeTarget_Timer = urand(5000, 8000);
Spawn_Timer = urand(10000, 20000);
Enrage = false;
Submerged = false;
}
uint32 Sweep_Timer;
uint32 SandBlast_Timer;
@@ -62,15 +78,7 @@ public:
void Reset() override
{
Sweep_Timer = urand(5000, 10000);
SandBlast_Timer = urand(20000, 35000);
Submerge_Timer = urand(90000, 150000);
Back_Timer = urand(30000, 45000);
ChangeTarget_Timer = urand(5000, 8000);
Spawn_Timer = urand(10000, 20000);
Enrage = false;
Submerged = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override

View File

@@ -53,7 +53,25 @@ public:
struct boss_sarturaAI : public ScriptedAI
{
boss_sarturaAI(Creature* creature) : ScriptedAI(creature) { }
boss_sarturaAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
WhirlWind_Timer = 30000;
WhirlWindRandom_Timer = urand(3000, 7000);
WhirlWindEnd_Timer = 15000;
AggroReset_Timer = urand(45000, 55000);
AggroResetEnd_Timer = 5000;
EnrageHard_Timer = 10 * 60000;
WhirlWind = false;
AggroReset = false;
Enraged = false;
EnragedHard = false;
}
uint32 WhirlWind_Timer;
uint32 WhirlWindRandom_Timer;
@@ -69,18 +87,7 @@ public:
void Reset() override
{
WhirlWind_Timer = 30000;
WhirlWindRandom_Timer = urand(3000, 7000);
WhirlWindEnd_Timer = 15000;
AggroReset_Timer = urand(45000, 55000);
AggroResetEnd_Timer = 5000;
EnrageHard_Timer = 10*60000;
WhirlWind = false;
AggroReset = false;
Enraged = false;
EnragedHard = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override
@@ -196,7 +203,23 @@ public:
struct npc_sartura_royal_guardAI : public ScriptedAI
{
npc_sartura_royal_guardAI(Creature* creature) : ScriptedAI(creature) { }
npc_sartura_royal_guardAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
WhirlWind_Timer = 30000;
WhirlWindRandom_Timer = urand(3000, 7000);
WhirlWindEnd_Timer = 15000;
AggroReset_Timer = urand(45000, 55000);
AggroResetEnd_Timer = 5000;
KnockBack_Timer = 10000;
WhirlWind = false;
AggroReset = false;
}
uint32 WhirlWind_Timer;
uint32 WhirlWindRandom_Timer;
@@ -210,15 +233,7 @@ public:
void Reset() override
{
WhirlWind_Timer = 30000;
WhirlWindRandom_Timer = urand(3000, 7000);
WhirlWindEnd_Timer = 15000;
AggroReset_Timer = urand(45000, 55000);
AggroResetEnd_Timer = 5000;
KnockBack_Timer = 10000;
WhirlWind = false;
AggroReset = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override

View File

@@ -55,12 +55,20 @@ class boss_skeram : public CreatureScript
struct boss_skeramAI : public BossAI
{
boss_skeramAI(Creature* creature) : BossAI(creature, DATA_SKERAM) { }
boss_skeramAI(Creature* creature) : BossAI(creature, DATA_SKERAM)
{
Initialize();
}
void Reset() override
void Initialize()
{
_flag = 0;
_hpct = 75.0f;
}
void Reset() override
{
Initialize();
me->SetVisible(true);
}

View File

@@ -69,9 +69,24 @@ struct boss_twinemperorsAI : public ScriptedAI
{
boss_twinemperorsAI(Creature* creature): ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
Heal_Timer = 0; // first heal immediately when they get close together
Teleport_Timer = TELEPORTTIME;
AfterTeleport = false;
tspellcast = false;
AfterTeleportTimer = 0;
Abuse_Bug_Timer = urand(10000, 17000);
BugsTimer = 2000;
DontYellWhenDead = false;
EnrageTimer = 15 * 60000;
}
InstanceScript* instance;
uint32 Heal_Timer;
@@ -89,16 +104,8 @@ struct boss_twinemperorsAI : public ScriptedAI
void TwinReset()
{
Heal_Timer = 0; // first heal immediately when they get close together
Teleport_Timer = TELEPORTTIME;
AfterTeleport = false;
tspellcast = false;
AfterTeleportTimer = 0;
Abuse_Bug_Timer = urand(10000, 17000);
BugsTimer = 2000;
Initialize();
me->ClearUnitState(UNIT_STATE_STUNNED);
DontYellWhenDead = false;
EnrageTimer = 15*60000;
}
Creature* GetOtherBoss()
@@ -394,24 +401,28 @@ public:
struct boss_veknilashAI : public boss_twinemperorsAI
{
bool IAmVeklor() {return false;}
boss_veknilashAI(Creature* creature) : boss_twinemperorsAI(creature) { }
boss_veknilashAI(Creature* creature) : boss_twinemperorsAI(creature)
{
Initialize();
}
void Initialize()
{
UpperCut_Timer = urand(14000, 29000);
UnbalancingStrike_Timer = urand(8000, 18000);
Scarabs_Timer = urand(7000, 14000);
}
uint32 UpperCut_Timer;
uint32 UnbalancingStrike_Timer;
uint32 Scarabs_Timer;
int Rand;
int RandX;
int RandY;
Creature* Summoned;
void Reset() override
{
TwinReset();
UpperCut_Timer = urand(14000, 29000);
UnbalancingStrike_Timer = urand(8000, 18000);
Scarabs_Timer = urand(7000, 14000);
Initialize();
//Added. Can be removed if its included in DB.
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
}
@@ -480,25 +491,30 @@ public:
struct boss_veklorAI : public boss_twinemperorsAI
{
bool IAmVeklor() {return true;}
boss_veklorAI(Creature* creature) : boss_twinemperorsAI(creature) { }
boss_veklorAI(Creature* creature) : boss_twinemperorsAI(creature)
{
Initialize();
}
void Initialize()
{
ShadowBolt_Timer = 0;
Blizzard_Timer = urand(15000, 20000);
ArcaneBurst_Timer = 1000;
Scorpions_Timer = urand(7000, 14000);
}
uint32 ShadowBolt_Timer;
uint32 Blizzard_Timer;
uint32 ArcaneBurst_Timer;
uint32 Scorpions_Timer;
int Rand;
int RandX;
int RandY;
Creature* Summoned;
void Reset() override
{
TwinReset();
ShadowBolt_Timer = 0;
Blizzard_Timer = urand(15000, 20000);
ArcaneBurst_Timer = 1000;
Scorpions_Timer = urand(7000, 14000);
Initialize();
//Added. Can be removed if its included in DB.
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);

View File

@@ -91,13 +91,21 @@ class boss_viscidus : public CreatureScript
struct boss_viscidusAI : public BossAI
{
boss_viscidusAI(Creature* creature) : BossAI(creature, DATA_VISCIDUS) { }
boss_viscidusAI(Creature* creature) : BossAI(creature, DATA_VISCIDUS)
{
Initialize();
}
void Initialize()
{
_hitcounter = 0;
_phase = PHASE_FROST;
}
void Reset() override
{
_Reset();
_hitcounter = 0;
_phase = PHASE_FROST;
Initialize();
}
void DamageTaken(Unit* attacker, uint32& /*damage*/) override

View File

@@ -92,8 +92,15 @@ public:
aqsentinelAI(Creature* creature) : ScriptedAI(creature)
{
ClearBuddyList();
Initialize();
abselected = 0; // just initialization of variable
ability = 0;
}
void Initialize()
{
ClearBuddyList();
gatherOthersWhenAggro = true;
}
uint64 NearbyGUID[3];
@@ -183,8 +190,8 @@ public:
void GetOtherSentinels(Unit* who)
{
bool *chosenAbilities = new bool[9];
memset(chosenAbilities, 0, 9*sizeof(bool));
bool chosenAbilities[9];
memset(chosenAbilities, 0, sizeof(chosenAbilities));
selectAbility(pickAbilityRandom(chosenAbilities));
ClearBuddyList();
@@ -207,8 +214,6 @@ public:
DoYell("I dont have enough buddies.", LANG_NEUTRAL, 0);*/
SendMyListToBuddies();
CallBuddiesToAttack(who);
delete[] chosenAbilities;
}
bool gatherOthersWhenAggro;
@@ -228,8 +233,7 @@ public:
}
}
}
ClearBuddyList();
gatherOthersWhenAggro = true;
Initialize();
}
void GainSentinelAbility(uint32 id)

View File

@@ -59,14 +59,22 @@ public:
struct boss_zum_rahAI : public BossAI
{
boss_zum_rahAI(Creature* creature) : BossAI(creature, DATA_ZUM_RAH) { }
boss_zum_rahAI(Creature* creature) : BossAI(creature, DATA_ZUM_RAH)
{
Initialize();
}
void Initialize()
{
_ward80 = false;
_ward40 = false;
_heal30 = false;
}
void Reset() override
{
me->setFaction(ZUMRAH_FRIENDLY_FACTION); // areatrigger sets faction to enemy
_ward80 = false;
_ward40 = false;
_heal30 = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override

View File

@@ -104,8 +104,17 @@ public:
{
npc_sergeant_blyAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
postGossipStep = 0;
Text_Timer = 0;
PlayerGUID = 0;
}
void Initialize()
{
ShieldBash_Timer = 5000;
Revenge_Timer = 8000;
}
InstanceScript* instance;
@@ -118,8 +127,7 @@ public:
void Reset() override
{
ShieldBash_Timer = 5000;
Revenge_Timer = 8000;
Initialize();
me->setFaction(FACTION_FRIENDLY);
}

View File

@@ -61,13 +61,21 @@ public:
struct npc_torekAI : public npc_escortAI
{
npc_torekAI(Creature* creature) : npc_escortAI(creature) { }
npc_torekAI(Creature* creature) : npc_escortAI(creature)
{
Initialize();
}
void Initialize()
{
rend_Timer = 5000;
thunderclap_Timer = 8000;
_completed = false;
}
void Reset() override
{
rend_Timer = 5000;
thunderclap_Timer = 8000;
_completed = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override { }
@@ -298,15 +306,23 @@ public:
struct npc_muglashAI : public npc_escortAI
{
npc_muglashAI(Creature* creature) : npc_escortAI(creature) { }
npc_muglashAI(Creature* creature) : npc_escortAI(creature)
{
Initialize();
}
void Reset() override
void Initialize()
{
eventTimer = 10000;
waveId = 0;
_isBrazierExtinguished = false;
}
void Reset() override
{
Initialize();
}
void EnterCombat(Unit* /*who*/) override
{
if (Player* player = GetPlayerForEscort())

View File

@@ -60,7 +60,21 @@ public:
struct npc_draenei_survivorAI : public ScriptedAI
{
npc_draenei_survivorAI(Creature* creature) : ScriptedAI(creature) { }
npc_draenei_survivorAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
pCaster = 0;
SayThanksTimer = 0;
RunAwayTimer = 0;
SayHelpTimer = 10000;
CanSayHelp = true;
}
uint64 pCaster;
@@ -72,13 +86,7 @@ public:
void Reset() override
{
pCaster = 0;
SayThanksTimer = 0;
RunAwayTimer = 0;
SayHelpTimer = 10000;
CanSayHelp = true;
Initialize();
DoCast(me, SPELL_IRRIDATION, true);
@@ -192,22 +200,28 @@ public:
{
npc_engineer_spark_overgrindAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
NormFaction = creature->getFaction();
NpcFlags = creature->GetUInt32Value(UNIT_NPC_FLAGS);
if (creature->GetAreaId() == AREA_COVE || creature->GetAreaId() == AREA_ISLE)
IsTreeEvent = true;
}
void Reset() override
void Initialize()
{
DynamiteTimer = 8000;
EmoteTimer = urand(120000, 150000);
if (me->GetAreaId() == AREA_COVE || me->GetAreaId() == AREA_ISLE)
IsTreeEvent = true;
else
IsTreeEvent = false;
}
void Reset() override
{
Initialize();
me->setFaction(NormFaction);
me->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags);
IsTreeEvent = false;
}
void EnterCombat(Unit* who) override
@@ -409,7 +423,18 @@ public:
struct npc_geezleAI : public ScriptedAI
{
npc_geezleAI(Creature* creature) : ScriptedAI(creature) { }
npc_geezleAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
SparkGUID = 0;
Step = 0;
EventStarted = false;
SayTimer = 0;
}
uint64 SparkGUID;
@@ -420,8 +445,7 @@ public:
void Reset() override
{
SparkGUID = 0;
Step = 0;
Initialize();
StartEvent();
}
@@ -581,15 +605,23 @@ public:
struct npc_death_ravagerAI : public ScriptedAI
{
npc_death_ravagerAI(Creature* creature) : ScriptedAI(creature){ }
npc_death_ravagerAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
RendTimer = 30000;
EnragingBiteTimer = 20000;
}
uint32 RendTimer;
uint32 EnragingBiteTimer;
void Reset() override
{
RendTimer = 30000;
EnragingBiteTimer = 20000;
Initialize();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_PASSIVE);
@@ -647,7 +679,16 @@ class npc_stillpine_capitive : public CreatureScript
struct npc_stillpine_capitiveAI : public ScriptedAI
{
npc_stillpine_capitiveAI(Creature* creature) : ScriptedAI(creature) { }
npc_stillpine_capitiveAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
_playerGUID = 0;
_movementComplete = false;
}
void Reset() override
{
@@ -657,8 +698,7 @@ class npc_stillpine_capitive : public CreatureScript
cage->SetGoState(GO_STATE_READY);
}
_events.Reset();
_player = NULL;
_movementComplete = false;
Initialize();
}
void StartMoving(Player* owner)
@@ -666,7 +706,7 @@ class npc_stillpine_capitive : public CreatureScript
if (owner)
{
Talk(CAPITIVE_SAY, owner);
_player = owner;
_playerGUID = owner->GetGUID();
}
Position pos = me->GetNearPosition(3.0f, 0.0f);
me->GetMotionMaster()->MovePoint(POINT_INIT, pos);
@@ -677,7 +717,7 @@ class npc_stillpine_capitive : public CreatureScript
if (type != POINT_MOTION_TYPE || id != POINT_INIT)
return;
if (_player)
if (Player* _player = ObjectAccessor::GetPlayer(*me, _playerGUID))
_player->KilledMonsterCredit(me->GetEntry(), me->GetGUID());
_movementComplete = true;
@@ -696,7 +736,7 @@ class npc_stillpine_capitive : public CreatureScript
}
private:
Player* _player;
uint64 _playerGUID;
EventMap _events;
bool _movementComplete;
};

View File

@@ -50,7 +50,17 @@ public:
struct npc_lazy_peonAI : public ScriptedAI
{
npc_lazy_peonAI(Creature* creature) : ScriptedAI(creature) { }
npc_lazy_peonAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
PlayerGUID = 0;
RebuffTimer = 0;
work = false;
}
uint64 PlayerGUID;
@@ -59,9 +69,7 @@ public:
void Reset() override
{
PlayerGUID = 0;
RebuffTimer = 0;
work = false;
Initialize();
}
void MovementInform(uint32 /*type*/, uint32 id)

View File

@@ -61,7 +61,19 @@ public:
struct npc_kyle_frenziedAI : public ScriptedAI
{
npc_kyle_frenziedAI(Creature* creature) : ScriptedAI(creature) { }
npc_kyle_frenziedAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
EventActive = false;
IsMovingToLunch = false;
PlayerGUID = 0;
EventTimer = 5000;
EventPhase = 0;
}
bool EventActive;
bool IsMovingToLunch;
@@ -71,11 +83,7 @@ public:
void Reset() override
{
EventActive = false;
IsMovingToLunch = false;
PlayerGUID = 0;
EventTimer = 5000;
EventPhase = 0;
Initialize();
if (me->GetEntry() == NPC_KYLE_FRIENDLY)
me->UpdateEntry(NPC_KYLE_FRENZIED);

View File

@@ -422,7 +422,23 @@ public:
struct npc_anachronos_the_ancientAI : public ScriptedAI
{
npc_anachronos_the_ancientAI(Creature* creature) : ScriptedAI(creature) { }
npc_anachronos_the_ancientAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
AnimationTimer = 1500;
AnimationCount = 0;
AnachronosQuestTriggerGUID = 0;
MerithraGUID = 0;
ArygosGUID = 0;
CaelestraszGUID = 0;
FandralGUID = 0;
PlayerGUID = 0;
eventEnd = false;
}
uint32 AnimationTimer;
uint8 AnimationCount;
@@ -437,15 +453,7 @@ public:
void Reset() override
{
AnimationTimer = 1500;
AnimationCount = 0;
AnachronosQuestTriggerGUID = 0;
MerithraGUID = 0;
ArygosGUID = 0;
CaelestraszGUID = 0;
FandralGUID = 0;
PlayerGUID = 0;
eventEnd = false;
Initialize();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
@@ -750,7 +758,22 @@ public:
struct npc_qiraj_war_spawnAI : public ScriptedAI
{
npc_qiraj_war_spawnAI(Creature* creature) : ScriptedAI(creature) { }
npc_qiraj_war_spawnAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
SpellTimer1 = 0;
SpellTimer2 = 0;
SpellTimer3 = 0;
SpellTimer4 = 0;
}
void Initialize()
{
MobGUID = 0;
PlayerGUID = 0;
Timers = false;
hasTarget = false;
}
uint64 MobGUID;
uint64 PlayerGUID;
@@ -760,10 +783,7 @@ public:
void Reset() override
{
MobGUID = 0;
PlayerGUID = 0;
Timers = false;
hasTarget = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override { }
@@ -863,7 +883,24 @@ public:
struct npc_anachronos_quest_triggerAI : public ScriptedAI
{
npc_anachronos_quest_triggerAI(Creature* creature) : ScriptedAI(creature) { }
npc_anachronos_quest_triggerAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
PlayerGUID = 0;
WaveTimer = 2000;
AnnounceTimer = 1000;
LiveCount = 0;
WaveCount = 0;
EventStarted = false;
Announced = false;
Failed = false;
}
uint64 PlayerGUID;
@@ -879,16 +916,7 @@ public:
void Reset() override
{
PlayerGUID = 0;
WaveTimer = 2000;
AnnounceTimer = 1000;
LiveCount = 0;
WaveCount = 0;
EventStarted = false;
Announced = false;
Failed = false;
Initialize();
me->SetVisible(false);
}

View File

@@ -61,7 +61,21 @@ public:
struct npc_aquementasAI : public ScriptedAI
{
npc_aquementasAI(Creature* creature) : ScriptedAI(creature) { }
npc_aquementasAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
SendItemTimer = 0;
SwitchFactionTimer = 10000;
isFriendly = true;
AquaJetTimer = 5000;
FrostShockTimer = 1000;
}
uint32 SendItemTimer;
uint32 SwitchFactionTimer;
@@ -72,13 +86,8 @@ public:
void Reset() override
{
SendItemTimer = 0;
SwitchFactionTimer = 10000;
Initialize();
me->setFaction(35);
isFriendly = true;
AquaJetTimer = 5000;
FrostShockTimer = 1000;
}
void SendItem(Unit* receiver)
@@ -458,7 +467,19 @@ public:
struct npc_toogaAI : public FollowerAI
{
npc_toogaAI(Creature* creature) : FollowerAI(creature) { }
npc_toogaAI(Creature* creature) : FollowerAI(creature)
{
Initialize();
}
void Initialize()
{
CheckSpeechTimer = 2500;
PostEventTimer = 1000;
PhasePostEvent = 0;
TortaGUID = 0;
}
uint32 CheckSpeechTimer;
uint32 PostEventTimer;
@@ -468,11 +489,7 @@ public:
void Reset() override
{
CheckSpeechTimer = 2500;
PostEventTimer = 1000;
PhasePostEvent = 0;
TortaGUID = 0;
Initialize();
}
void MoveInLineOfSight(Unit* who)

View File

@@ -195,9 +195,17 @@ public:
{
npc_taskmaster_fizzuleAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
factionNorm = creature->getFaction();
}
void Initialize()
{
IsFriend = false;
ResetTimer = 120000;
FlareCount = 0;
}
uint32 factionNorm;
bool IsFriend;
uint32 ResetTimer;
@@ -205,9 +213,7 @@ public:
void Reset() override
{
IsFriend = false;
ResetTimer = 120000;
FlareCount = 0;
Initialize();
me->setFaction(factionNorm);
}
@@ -309,20 +315,12 @@ public:
struct npc_twiggy_flatheadAI : public ScriptedAI
{
npc_twiggy_flatheadAI(Creature* creature) : ScriptedAI(creature) { }
npc_twiggy_flatheadAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
bool EventInProgress;
bool EventGrate;
bool EventBigWill;
bool ChallengerDown[6];
uint8 Wave;
uint32 WaveTimer;
uint32 ChallengerChecker;
uint64 PlayerGUID;
uint64 AffrayChallenger[6];
uint64 BigWill;
void Reset() override
void Initialize()
{
EventInProgress = false;
EventGrate = false;
@@ -340,6 +338,22 @@ public:
BigWill = 0;
}
bool EventInProgress;
bool EventGrate;
bool EventBigWill;
bool ChallengerDown[6];
uint8 Wave;
uint32 WaveTimer;
uint32 ChallengerChecker;
uint64 PlayerGUID;
uint64 AffrayChallenger[6];
uint64 BigWill;
void Reset() override
{
Initialize();
}
void MoveInLineOfSight(Unit* who) override
{
if (!who || !who->IsAlive() || EventInProgress)

View File

@@ -55,7 +55,19 @@ public:
struct npc_cairne_bloodhoofAI : public ScriptedAI
{
npc_cairne_bloodhoofAI(Creature* creature) : ScriptedAI(creature) { }
npc_cairne_bloodhoofAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
BerserkerChargeTimer = 30000;
CleaveTimer = 5000;
MortalStrikeTimer = 10000;
ThunderclapTimer = 15000;
UppercutTimer = 10000;
}
uint32 BerserkerChargeTimer;
uint32 CleaveTimer;
@@ -65,11 +77,7 @@ public:
void Reset() override
{
BerserkerChargeTimer = 30000;
CleaveTimer = 5000;
MortalStrikeTimer = 10000;
ThunderclapTimer = 15000;
UppercutTimer = 10000;
Initialize();
}
void EnterCombat(Unit* /*who*/) override { }

View File

@@ -317,7 +317,17 @@ public:
npc_ranshallaAI(Creature* creature) : npc_escortAI(creature),
DialogueHelper(introDialogue)
{
Reset();
Initialize();
_firstPriestessGUID = 0;
_secondPriestessGUID = 0;
_guardEluneGUID = 0;
_voiceEluneGUID = 0;
_altarGUID = 0;
}
void Initialize()
{
_delayTimer = 0;
}
uint32 _delayTimer;
@@ -330,7 +340,7 @@ public:
void Reset() override
{
_delayTimer = 0;
Initialize();
}
// Called when the player activates the torch / altar

View File

@@ -61,13 +61,21 @@ class boss_elder_nadox : public CreatureScript
struct boss_elder_nadoxAI : public BossAI
{
boss_elder_nadoxAI(Creature* creature) : BossAI(creature, DATA_ELDER_NADOX) { }
boss_elder_nadoxAI(Creature* creature) : BossAI(creature, DATA_ELDER_NADOX)
{
Initialize();
}
void Initialize()
{
GuardianSummoned = false;
GuardianDied = false;
}
void Reset() override
{
_Reset();
GuardianSummoned = false;
GuardianDied = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override

View File

@@ -63,9 +63,19 @@ public:
{
boss_volazjAI(Creature* creature) : ScriptedAI(creature), Summons(me)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
uiMindFlayTimer = 8 * IN_MILLISECONDS;
uiShadowBoltVolleyTimer = 5 * IN_MILLISECONDS;
uiShiverTimer = 15 * IN_MILLISECONDS;
// Used for Insanity handling
insanityHandled = 0;
}
InstanceScript* instance;
uint32 uiMindFlayTimer;
@@ -152,9 +162,7 @@ public:
void Reset() override
{
uiMindFlayTimer = 8*IN_MILLISECONDS;
uiShadowBoltVolleyTimer = 5*IN_MILLISECONDS;
uiShiverTimer = 15*IN_MILLISECONDS;
Initialize();
instance->SetBossState(DATA_HERALD_VOLAZJ, NOT_STARTED);
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT);
@@ -164,9 +172,6 @@ public:
for (uint32 i = 173; i <= 177; ++i)
me->SetInPhase(i, true, true);
// Used for Insanity handling
insanityHandled = 0;
ResetPlayersPhase();
// Cleanup

View File

@@ -64,11 +64,27 @@ public:
{
boss_jedoga_shadowseekerAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
bFirstTime = true;
bPreDone = false;
}
void Initialize()
{
uiOpFerTimer = urand(15 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
uiCycloneTimer = 3 * IN_MILLISECONDS;
uiBoltTimer = 7 * IN_MILLISECONDS;
uiThunderTimer = 12 * IN_MILLISECONDS;
bOpFerok = false;
bOpFerokFail = false;
bOnGround = false;
bCanDown = false;
volunteerWork = true;
}
InstanceScript* instance;
uint32 uiOpFerTimer;
@@ -86,17 +102,7 @@ public:
void Reset() override
{
uiOpFerTimer = urand(15*IN_MILLISECONDS, 20*IN_MILLISECONDS);
uiCycloneTimer = 3*IN_MILLISECONDS;
uiBoltTimer = 7*IN_MILLISECONDS;
uiThunderTimer = 12*IN_MILLISECONDS;
bOpFerok = false;
bOpFerokFail = false;
bOnGround = false;
bCanDown = false;
volunteerWork = true;
Initialize();
if (!bFirstTime)
instance->SetBossState(DATA_JEDOGA_SHADOWSEEKER, FAIL);
@@ -331,9 +337,16 @@ public:
{
npc_jedoga_initiandAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
bWalking = false;
bCheckTimer = 2 * IN_MILLISECONDS;
}
InstanceScript* instance;
uint32 bCheckTimer;
@@ -342,8 +355,7 @@ public:
void Reset() override
{
bWalking = false;
bCheckTimer = 2*IN_MILLISECONDS;
Initialize();
if (instance->GetBossState(DATA_JEDOGA_SHADOWSEEKER) != IN_PROGRESS)
{

View File

@@ -87,7 +87,29 @@ public:
{
boss_anub_arakAI(Creature* creature) : ScriptedAI(creature), Summons(me)
{
Initialize();
instance = creature->GetInstanceScript();
GuardianSummoned = false;
VenomancerSummoned = false;
DatterSummoned = false;
UndergroundTimer = 0;
VenomancerTimer = 0;
DatterTimer = 0;
DelayTimer = 0;
ImpaleTarget = 0;
}
void Initialize()
{
CarrionBeetlesTimer = 8 * IN_MILLISECONDS;
LeechingSwarmTimer = 20 * IN_MILLISECONDS;
ImpaleTimer = 9 * IN_MILLISECONDS;
PoundTimer = 15 * IN_MILLISECONDS;
Phase = PHASE_MELEE;
UndergroundPhase = 0;
Channeling = false;
ImpalePhase = IMPALE_PHASE_TARGET;
}
InstanceScript* instance;
@@ -101,7 +123,6 @@ public:
uint32 CarrionBeetlesTimer;
uint32 LeechingSwarmTimer;
uint32 PoundTimer;
uint32 SubmergeTimer;
uint32 UndergroundTimer;
uint32 VenomancerTimer;
uint32 DatterTimer;
@@ -115,15 +136,7 @@ public:
void Reset() override
{
CarrionBeetlesTimer = 8*IN_MILLISECONDS;
LeechingSwarmTimer = 20*IN_MILLISECONDS;
ImpaleTimer = 9*IN_MILLISECONDS;
PoundTimer = 15*IN_MILLISECONDS;
Phase = PHASE_MELEE;
UndergroundPhase = 0;
Channeling = false;
ImpalePhase = IMPALE_PHASE_TARGET;
Initialize();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
me->RemoveAura(SPELL_SUBMERGE);

View File

@@ -54,11 +54,22 @@ public:
{
boss_hadronoxAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
instance = creature->GetInstanceScript();
fMaxDistance = 50.0f;
bFirstTime = true;
}
void Initialize()
{
uiAcidTimer = urand(10 * IN_MILLISECONDS, 14 * IN_MILLISECONDS);
uiLeechTimer = urand(3 * IN_MILLISECONDS, 9 * IN_MILLISECONDS);
uiPierceTimer = urand(1 * IN_MILLISECONDS, 3 * IN_MILLISECONDS);
uiGrabTimer = urand(15 * IN_MILLISECONDS, 19 * IN_MILLISECONDS);
uiDoorsTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS);
uiCheckDistanceTimer = 2 * IN_MILLISECONDS;
}
InstanceScript* instance;
uint32 uiAcidTimer;
@@ -77,12 +88,7 @@ public:
me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 9.0f);
me->SetFloatValue(UNIT_FIELD_COMBATREACH, 9.0f);
uiAcidTimer = urand(10*IN_MILLISECONDS, 14*IN_MILLISECONDS);
uiLeechTimer = urand(3*IN_MILLISECONDS, 9*IN_MILLISECONDS);
uiPierceTimer = urand(1*IN_MILLISECONDS, 3*IN_MILLISECONDS);
uiGrabTimer = urand(15*IN_MILLISECONDS, 19*IN_MILLISECONDS);
uiDoorsTimer = urand(20*IN_MILLISECONDS, 30*IN_MILLISECONDS);
uiCheckDistanceTimer = 2*IN_MILLISECONDS;
Initialize();
if (instance->GetBossState(DATA_HADRONOX) != DONE && !bFirstTime)
instance->SetBossState(DATA_HADRONOX, FAIL);

View File

@@ -130,14 +130,22 @@ public:
struct boss_sartharionAI : public BossAI
{
boss_sartharionAI(Creature* creature) : BossAI(creature, DATA_SARTHARION) { }
boss_sartharionAI(Creature* creature) : BossAI(creature, DATA_SARTHARION)
{
Initialize();
}
void Initialize()
{
_isBerserk = false;
_isSoftEnraged = false;
_isHardEnraged = false;
drakeCount = 0;
}
void Reset() override
{
_isBerserk = false;
_isSoftEnraged = false;
_isHardEnraged = false;
drakeCount = 0;
Initialize();
if (me->HasAura(SPELL_TWILIGHT_REVENGE))
me->RemoveAurasDueToSpell(SPELL_TWILIGHT_REVENGE);

View File

@@ -25,18 +25,26 @@ EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "mana_tombs.h"
enum Pandemonius
enum Texts
{
SAY_AGGRO = 0,
SAY_KILL = 1,
SAY_DEATH = 2,
EMOTE_DARK_SHELL = 3,
EMOTE_DARK_SHELL = 3
};
SPELL_VOID_BLAST = 32325,
H_SPELL_VOID_BLAST = 38760,
SPELL_DARK_SHELL = 32358,
H_SPELL_DARK_SHELL = 38759
enum Spells
{
SPELL_VOID_BLAST = 32325,
SPELL_DARK_SHELL = 32358
};
enum Events
{
EVENT_VOID_BLAST = 1,
EVENT_DARK_SHELL
};
class boss_pandemonius : public CreatureScript
@@ -44,26 +52,17 @@ class boss_pandemonius : public CreatureScript
public:
boss_pandemonius() : CreatureScript("boss_pandemonius") { }
CreatureAI* GetAI(Creature* creature) const override
struct boss_pandemoniusAI : public BossAI
{
return new boss_pandemoniusAI(creature);
}
struct boss_pandemoniusAI : public ScriptedAI
{
boss_pandemoniusAI(Creature* creature) : ScriptedAI(creature)
boss_pandemoniusAI(Creature* creature) : BossAI(creature, DATA_PANDEMONIUS)
{
VoidBlastCounter = 0;
}
uint32 VoidBlast_Timer;
uint32 DarkShell_Timer;
uint32 VoidBlast_Counter;
void Reset() override
{
VoidBlast_Timer = 8000 + rand32() % 15000;
DarkShell_Timer = 20000;
VoidBlast_Counter = 0;
_Reset();
VoidBlastCounter = 0;
}
void JustDied(Unit* /*killer*/) override
@@ -78,48 +77,54 @@ public:
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
Talk(SAY_AGGRO);
events.ScheduleEvent(EVENT_DARK_SHELL, 20000);
events.ScheduleEvent(EVENT_VOID_BLAST, urand(8000, 23000));
}
void UpdateAI(uint32 diff) override
void ExecuteEvent(uint32 eventId) override
{
if (!UpdateVictim())
return;
if (VoidBlast_Timer <= diff)
switch (eventId)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
DoCast(target, SPELL_VOID_BLAST);
VoidBlast_Timer = 500;
++VoidBlast_Counter;
}
case EVENT_VOID_BLAST:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
DoCast(target, SPELL_VOID_BLAST);
++VoidBlastCounter;
}
if (VoidBlast_Counter == 5)
{
VoidBlast_Timer = 15000 + rand32() % 10000;
VoidBlast_Counter = 0;
}
} else VoidBlast_Timer -= diff;
if (!VoidBlast_Counter)
{
if (DarkShell_Timer <= diff)
{
if (VoidBlastCounter == 5)
{
VoidBlastCounter = 0;
events.ScheduleEvent(EVENT_VOID_BLAST, urand(15000, 25000));
}
else
{
events.ScheduleEvent(EVENT_VOID_BLAST, 500);
events.DelayEvents(EVENT_DARK_SHELL, 500);
}
break;
case EVENT_DARK_SHELL:
if (me->IsNonMeleeSpellCast(false))
me->InterruptNonMeleeSpells(true);
Talk(EMOTE_DARK_SHELL);
DoCast(me, SPELL_DARK_SHELL);
DarkShell_Timer = 20000;
} else DarkShell_Timer -= diff;
events.ScheduleEvent(EVENT_DARK_SHELL, 20000);
break;
default:
break;
}
DoMeleeAttackIfReady();
}
private:
uint32 VoidBlastCounter;
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetManaTombsAI<boss_pandemoniusAI>(creature);
}
};
void AddSC_boss_pandemonius()