Merge branch 'master' into 4.x

Conflicts:
	src/server/authserver/Server/AuthSocket.cpp
	src/server/game/Entities/Object/Object.cpp
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Unit/Unit.cpp
	src/server/game/Handlers/AuctionHouseHandler.cpp
	src/server/game/Handlers/CharacterHandler.cpp
	src/server/game/Handlers/MovementHandler.cpp
	src/server/game/Miscellaneous/SharedDefines.h
	src/server/game/Spells/Spell.cpp
	src/server/game/Spells/SpellEffects.cpp
This commit is contained in:
Spp
2012-01-31 11:49:53 +01:00
491 changed files with 15328 additions and 4368 deletions
+1 -3
View File
@@ -61,12 +61,10 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/shared/Database
${CMAKE_SOURCE_DIR}/src/server/shared/DataStores
${CMAKE_SOURCE_DIR}/src/server/shared/Debugging
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/CountedReference
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic
${CMAKE_SOURCE_DIR}/src/server/shared/Logging
${CMAKE_SOURCE_DIR}/src/server/shared/Packets
${CMAKE_SOURCE_DIR}/src/server/shared/Policies
${CMAKE_SOURCE_DIR}/src/server/shared/Threading
${CMAKE_SOURCE_DIR}/src/server/shared/Utilities
${CMAKE_SOURCE_DIR}/src/server/collision
@@ -112,6 +110,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/game/Grids/Notifiers
${CMAKE_SOURCE_DIR}/src/server/game/Groups
${CMAKE_SOURCE_DIR}/src/server/game/Guilds
${CMAKE_SOURCE_DIR}/src/server/game/Handlers
${CMAKE_SOURCE_DIR}/src/server/game/Instances
${CMAKE_SOURCE_DIR}/src/server/game/LookingForGroup
${CMAKE_SOURCE_DIR}/src/server/game/Loot
@@ -130,7 +129,6 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/game/Scripting
${CMAKE_SOURCE_DIR}/src/server/game/Server
${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol
${CMAKE_SOURCE_DIR}/src/server/game/Server/Protocol/Handlers
${CMAKE_SOURCE_DIR}/src/server/game/Skills
${CMAKE_SOURCE_DIR}/src/server/game/Spells
${CMAKE_SOURCE_DIR}/src/server/game/Spells/Auras
+3 -2
View File
@@ -109,7 +109,8 @@ public:
{
case AOR_OK:
handler->PSendSysMessage(LANG_ACCOUNT_CREATED, accountName);
sLog->outChar("Account: %d (IP: %s) Character:[%s] (GUID: %u) Change Password.", handler->GetSession()->GetAccountId(),handler->GetSession()->GetRemoteAddress().c_str(), handler->GetSession()->GetPlayer()->GetName(), handler->GetSession()->GetPlayer()->GetGUIDLow());
if (handler->GetSession())
sLog->outChar("Account: %d (IP: %s) Character:[%s] (GUID: %u) Change Password.", handler->GetSession()->GetAccountId(),handler->GetSession()->GetRemoteAddress().c_str(), handler->GetSession()->GetPlayer()->GetName(), handler->GetSession()->GetPlayer()->GetGUIDLow());
break;
case AOR_NAME_TOO_LONG:
handler->SendSysMessage(LANG_ACCOUNT_TOO_LONG);
@@ -509,7 +510,7 @@ public:
stmt->setUInt32(0, targetAccountId);
stmt->setUInt8(1, uint8(gm));
stmt->setUInt32(2, gmRealmID);
stmt->setInt32(2, gmRealmID);
LoginDatabase.Execute(stmt);
}
+2 -1
View File
@@ -26,6 +26,7 @@ EndScriptData */
#include "ObjectMgr.h"
#include "Chat.h"
#include "AccountMgr.h"
#include "World.h"
class gm_commandscript : public CommandScript
{
@@ -152,7 +153,7 @@ public:
static bool HandleGMListFullCommand(ChatHandler* handler, char const* /*args*/)
{
///- Get the accounts with GM Level >0
QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= %u", SEC_MODERATOR);
QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= %u AND (aa.realmid = -1 OR aa.realmid = %u)", SEC_MODERATOR, realmID);
if (result)
{
handler->SendSysMessage(LANG_GMLIST);
+1 -1
View File
@@ -97,7 +97,7 @@ public:
// Activate
object->SetLootState(GO_READY);
object->UseDoorOrButton(10000);
object->UseDoorOrButton(10000, false, handler->GetSession()->GetPlayer());
handler->PSendSysMessage("Object activated!");
+4 -5
View File
@@ -130,7 +130,7 @@ public:
{
uint32 tguid = chr->GetTransport()->AddNPCPassenger(0, id, chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO());
if (tguid > 0)
WorldDatabase.PQuery("INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (%u, %u, %f, %f, %f, %f, %u)", tguid, id, chr->GetTransport()->GetEntry(), chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO());
WorldDatabase.PExecute("INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (%u, %u, %f, %f, %f, %f, %u)", tguid, id, chr->GetTransport()->GetEntry(), chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO());
return true;
}
@@ -679,7 +679,7 @@ public:
if (target->GetTransport())
if (target->GetGUIDTransport())
WorldDatabase.PQuery("UPDATE creature_transport SET emote=%u WHERE transport_entry=%u AND guid=%u", emote, target->GetTransport()->GetEntry(), target->GetGUIDTransport());
WorldDatabase.PExecute("UPDATE creature_transport SET emote=%u WHERE transport_entry=%u AND guid=%u", emote, target->GetTransport()->GetEntry(), target->GetGUIDTransport());
target->SetUInt32Value(UNIT_NPC_EMOTESTATE, emote);
@@ -1036,15 +1036,14 @@ public:
}
if (/*creature->GetMotionMaster()->empty() ||*/
creature->GetMotionMaster()->GetCurrentMovementGeneratorType () != TARGETED_MOTION_TYPE)
creature->GetMotionMaster()->GetCurrentMovementGeneratorType () != FOLLOW_MOTION_TYPE)
{
handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName());
handler->SetSentErrorMessage(true);
return false;
}
TargetedMovementGenerator<Creature> const* mgen
= static_cast<TargetedMovementGenerator<Creature> const*>((creature->GetMotionMaster()->top()));
FollowMovementGenerator<Creature> const* mgen = static_cast<FollowMovementGenerator<Creature> const*>((creature->GetMotionMaster()->top()));
if (mgen->GetTarget() != player)
{
+108 -105
View File
@@ -404,113 +404,116 @@ public:
if (!*args)
return false;
uint32 entry = (uint32) atoi((char*)args);
QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = %u", entry);
if (!result)
Tokens entries(std::string(args), ' ');
for (Tokens::const_iterator itr = entries.begin(); itr != entries.end(); ++itr)
{
handler->PSendSysMessage(LANG_COMMAND_CREATURETEMPLATE_NOTFOUND, entry);
handler->SetSentErrorMessage(true);
return false;
uint32 entry = uint32(atoi(*itr));
QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = %u", entry);
if (!result)
{
handler->PSendSysMessage(LANG_COMMAND_CREATURETEMPLATE_NOTFOUND, entry);
continue;
}
CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(entry);
if (!cInfo)
{
handler->PSendSysMessage(LANG_COMMAND_CREATURESTORAGE_NOTFOUND, entry);
continue;
}
sLog->outString("Reloading creature template entry %u", entry);
Field* fields = result->Fetch();
const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[0] = fields[0].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[1] = fields[1].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[2] = fields[2].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->KillCredit[0] = fields[3].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->KillCredit[1] = fields[4].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->Modelid1 = fields[5].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->Modelid2 = fields[6].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->Modelid3 = fields[7].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->Modelid4 = fields[8].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->Name = fields[9].GetString();
const_cast<CreatureTemplate*>(cInfo)->SubName = fields[10].GetString();
const_cast<CreatureTemplate*>(cInfo)->IconName = fields[11].GetString();
const_cast<CreatureTemplate*>(cInfo)->GossipMenuId = fields[12].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->minlevel = fields[13].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->maxlevel = fields[14].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->expansion = fields[15].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->faction_A = fields[16].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->faction_H = fields[17].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->npcflag = fields[18].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->speed_walk = fields[19].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->speed_run = fields[20].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->scale = fields[21].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->rank = fields[22].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->mindmg = fields[23].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->maxdmg = fields[24].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->dmgschool = fields[25].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->attackpower = fields[26].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->dmg_multiplier = fields[27].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->baseattacktime = fields[28].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->rangeattacktime = fields[29].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->unit_class = fields[30].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->unit_flags = fields[31].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->dynamicflags = fields[32].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->family = fields[33].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->trainer_type = fields[34].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->trainer_spell = fields[35].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->trainer_class = fields[36].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->trainer_race = fields[37].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->minrangedmg = fields[38].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->maxrangedmg = fields[39].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->rangedattackpower = fields[40].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->type = fields[41].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->type_flags = fields[42].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->lootid = fields[43].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->pickpocketLootId = fields[44].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->SkinLootId = fields[45].GetUInt32();
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
{
const_cast<CreatureTemplate*>(cInfo)->resistance[i] = fields[46 + i -1].GetUInt32();
}
const_cast<CreatureTemplate*>(cInfo)->spells[0] = fields[52].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->spells[1] = fields[53].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->spells[2] = fields[54].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->spells[3] = fields[55].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->spells[4] = fields[56].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->spells[5] = fields[57].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->spells[6] = fields[58].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->spells[7] = fields[59].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->PetSpellDataId = fields[60].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->VehicleId = fields[61].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->mingold = fields[62].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->maxgold = fields[63].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->AIName = fields[64].GetString();
const_cast<CreatureTemplate*>(cInfo)->MovementType = fields[65].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->InhabitType = fields[66].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->ModHealth = fields[67].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->ModMana = fields[68].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->ModArmor = fields[69].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->RacialLeader = fields[70].GetBool();
const_cast<CreatureTemplate*>(cInfo)->questItems[0] = fields[71].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->questItems[1] = fields[72].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->questItems[2] = fields[73].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->questItems[3] = fields[74].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->questItems[4] = fields[75].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->questItems[5] = fields[76].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->movementId = fields[77].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->RegenHealth = fields[78].GetBool();
const_cast<CreatureTemplate*>(cInfo)->equipmentId = fields[79].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->MechanicImmuneMask = fields[80].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->flags_extra = fields[81].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[82].GetCString());
sObjectMgr->CheckCreatureTemplate(cInfo);
}
CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(entry);
if (!cInfo)
{
handler->PSendSysMessage(LANG_COMMAND_CREATURESTORAGE_NOTFOUND, entry);
handler->SetSentErrorMessage(true);
return false;
}
sLog->outString("Reloading creature template entry %u", entry);
Field* fields = result->Fetch();
const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[0] = fields[0].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[1] = fields[1].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->DifficultyEntry[2] = fields[2].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->KillCredit[0] = fields[3].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->KillCredit[1] = fields[4].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->Modelid1 = fields[5].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->Modelid2 = fields[6].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->Modelid3 = fields[7].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->Modelid4 = fields[8].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->Name = fields[9].GetString();
const_cast<CreatureTemplate*>(cInfo)->SubName = fields[10].GetString();
const_cast<CreatureTemplate*>(cInfo)->IconName = fields[11].GetString();
const_cast<CreatureTemplate*>(cInfo)->GossipMenuId = fields[12].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->minlevel = fields[13].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->maxlevel = fields[14].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->expansion = fields[15].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->faction_A = fields[16].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->faction_H = fields[17].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->npcflag = fields[18].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->speed_walk = fields[19].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->speed_run = fields[20].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->scale = fields[21].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->rank = fields[22].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->mindmg = fields[23].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->maxdmg = fields[24].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->dmgschool = fields[25].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->attackpower = fields[26].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->dmg_multiplier = fields[27].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->baseattacktime = fields[28].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->rangeattacktime = fields[29].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->unit_class = fields[30].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->unit_flags = fields[31].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->dynamicflags = fields[32].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->family = fields[33].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->trainer_type = fields[34].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->trainer_spell = fields[35].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->trainer_class = fields[36].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->trainer_race = fields[37].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->minrangedmg = fields[38].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->maxrangedmg = fields[39].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->rangedattackpower = fields[40].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->type = fields[41].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->type_flags = fields[42].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->lootid = fields[43].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->pickpocketLootId = fields[44].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->SkinLootId = fields[45].GetUInt32();
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
{
const_cast<CreatureTemplate*>(cInfo)->resistance[i] = fields[46 + i -1].GetUInt32();
}
const_cast<CreatureTemplate*>(cInfo)->spells[0] = fields[52].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->spells[1] = fields[53].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->spells[2] = fields[54].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->spells[3] = fields[55].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->spells[4] = fields[56].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->spells[5] = fields[57].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->spells[6] = fields[58].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->spells[7] = fields[59].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->PetSpellDataId = fields[60].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->VehicleId = fields[61].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->mingold = fields[62].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->maxgold = fields[63].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->AIName = fields[64].GetString();
const_cast<CreatureTemplate*>(cInfo)->MovementType = fields[65].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->InhabitType = fields[66].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->ModHealth = fields[67].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->ModMana = fields[68].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->ModArmor = fields[69].GetFloat();
const_cast<CreatureTemplate*>(cInfo)->RacialLeader = fields[70].GetBool();
const_cast<CreatureTemplate*>(cInfo)->questItems[0] = fields[71].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->questItems[1] = fields[72].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->questItems[2] = fields[73].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->questItems[3] = fields[74].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->questItems[4] = fields[75].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->questItems[5] = fields[76].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->movementId = fields[77].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->RegenHealth = fields[78].GetBool();
const_cast<CreatureTemplate*>(cInfo)->equipmentId = fields[79].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->MechanicImmuneMask = fields[80].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->flags_extra = fields[81].GetUInt32();
const_cast<CreatureTemplate*>(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[82].GetCString());
sObjectMgr->CheckCreatureTemplate(cInfo);
handler->SendGlobalGMSysMessage("Creature template reloaded.");
return true;
}
@@ -989,7 +992,7 @@ public:
return true;
}
static bool HandleReloadWpCommand(ChatHandler* handler, const char* args)
static bool HandleReloadWpCommand(ChatHandler* /*handler*/, const char* args)
{
if (*args != 'a')
sLog->outString("Re-Loading Waypoints data from 'waypoints_data'");
@@ -27,8 +27,9 @@ enum Spells
enum Yells
{
YELL_AGGRO = -1810023,
YELL_EVADE = -1810024
YELL_AGGRO = 0,
YELL_EVADE = 1,
YELL_SALVATION = 2,
};
enum Creatures
@@ -122,7 +123,7 @@ public:
void EnterCombat(Unit* /*who*/)
{
DoScriptText(YELL_AGGRO, me);
Talk(YELL_AGGRO);
}
void JustRespawned()
@@ -185,7 +186,7 @@ public:
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
DoScriptText(YELL_EVADE, me);
Talk(YELL_EVADE);
}
resetTimer = 5 * IN_MILLISECONDS;
} else resetTimer -= diff;
@@ -31,14 +31,10 @@ enum Spells
enum Yells
{
YELL_AGGRO = -1810000,
YELL_EVADE = -1810001,
YELL_RESPAWN = -1810002,
YELL_RANDOM1 = -1810003,
YELL_RANDOM2 = -1810004,
YELL_RANDOM3 = -1810005,
YELL_RANDOM4 = -1810006,
YELL_RANDOM5 = -1810007
YELL_AGGRO = 0,
YELL_EVADE = 1,
YELL_RESPAWN = 2,
YELL_RANDOM = 3
};
class boss_drekthar : public CreatureScript
@@ -69,13 +65,13 @@ public:
void EnterCombat(Unit* /*who*/)
{
DoScriptText(YELL_AGGRO, me);
Talk(YELL_AGGRO);
}
void JustRespawned()
{
Reset();
DoScriptText(YELL_RESPAWN, me);
Talk(YELL_RESPAWN);
}
void UpdateAI(const uint32 diff)
@@ -109,7 +105,7 @@ public:
if (YellTimer <= diff)
{
DoScriptText(RAND(YELL_RANDOM1, YELL_RANDOM2, YELL_RANDOM3, YELL_RANDOM4, YELL_RANDOM5), me);
Talk(YELL_RANDOM);
YellTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS); //20 to 30 seconds
} else YellTimer -= diff;
@@ -119,7 +115,7 @@ public:
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
DoScriptText(YELL_EVADE, me);
Talk(YELL_EVADE);
}
ResetTimer = 5 * IN_MILLISECONDS;
} else ResetTimer -= diff;
@@ -28,8 +28,8 @@ enum Spells
enum Yells
{
YELL_AGGRO = -1810021,
YELL_EVADE = -1810022
YELL_AGGRO = 0,
YELL_EVADE = 1
};
class boss_galvangar : public CreatureScript
@@ -60,7 +60,7 @@ public:
void EnterCombat(Unit* /*who*/)
{
DoScriptText(YELL_AGGRO, me);
Talk(YELL_AGGRO);
}
void JustRespawned()
@@ -109,7 +109,7 @@ public:
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
DoScriptText(YELL_EVADE, me);
Talk(YELL_EVADE);
}
ResetTimer = 5 * IN_MILLISECONDS;
} else ResetTimer -= diff;
@@ -19,17 +19,12 @@
enum Yells
{
YELL_AGGRO = -1810008,
YELL_EVADE = -1810009,
YELL_RESPAWN1 = -1810010,
YELL_RESPAWN2 = -1810011,
YELL_RANDOM1 = -1810012,
YELL_RANDOM2 = -1810013,
YELL_RANDOM3 = -1810014,
YELL_RANDOM4 = -1810015,
YELL_RANDOM5 = -1810016,
YELL_RANDOM6 = -1810017,
YELL_RANDOM7 = -1810018
YELL_AGGRO = 0,
YELL_EVADE = 1,
YELL_RESPAWN1 = -1810010, // no creature_text
YELL_RESPAWN2 = -1810011, // no creature_text
YELL_RANDOM = 2,
YELL_SPELL = 3,
};
enum Spells
@@ -65,7 +60,7 @@ public:
void EnterCombat(Unit* /*who*/)
{
DoScriptText(YELL_AGGRO, me);
Talk(YELL_AGGRO);
}
void JustRespawned()
@@ -99,7 +94,7 @@ public:
if (YellTimer <= diff)
{
DoScriptText(RAND(YELL_RANDOM1, YELL_RANDOM2, YELL_RANDOM3, YELL_RANDOM4, YELL_RANDOM5, YELL_RANDOM6, YELL_RANDOM7), me);
Talk(YELL_RANDOM);
YellTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS); //20 to 30 seconds
} else YellTimer -= diff;
@@ -109,7 +104,7 @@ public:
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
DoScriptText(YELL_EVADE, me);
Talk(YELL_EVADE);
}
ResetTimer = 5 * IN_MILLISECONDS;
} else ResetTimer -= diff;
@@ -24,14 +24,19 @@ SDCategory: Blackwing Lair
EndScriptData */
#include "ScriptPCH.h"
enum Say
{
SAY_AGGRO = -1469000,
SAY_LEASH = -1469001
};
#define SAY_AGGRO -1469000
#define SAY_LEASH -1469001
#define SPELL_CLEAVE 26350
#define SPELL_BLASTWAVE 23331
#define SPELL_MORTALSTRIKE 24573
#define SPELL_KNOCKBACK 25778
enum Spells
{
SPELL_CLEAVE = 26350,
SPELL_BLASTWAVE = 23331,
SPELL_MORTALSTRIKE = 24573,
SPELL_KNOCKBACK = 25778
};
class boss_broodlord : public CreatureScript
{
@@ -45,7 +50,7 @@ public:
struct boss_broodlordAI : public ScriptedAI
{
boss_broodlordAI(Creature* c) : ScriptedAI(c) {}
boss_broodlordAI(Creature* creature) : ScriptedAI(creature) {}
uint32 Cleave_Timer;
uint32 BlastWave_Timer;
@@ -54,10 +59,10 @@ public:
void Reset()
{
Cleave_Timer = 8000; //These times are probably wrong
BlastWave_Timer = 12000;
MortalStrike_Timer = 20000;
KnockBack_Timer = 30000;
Cleave_Timer = 8000; // These times are probably wrong
BlastWave_Timer = 12000;
MortalStrike_Timer = 20000;
KnockBack_Timer = 30000;
}
void EnterCombat(Unit* /*who*/)
@@ -108,7 +113,6 @@ public:
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_broodlord()
@@ -71,7 +71,7 @@ public:
struct boss_chromaggusAI : public ScriptedAI
{
boss_chromaggusAI(Creature* c) : ScriptedAI(c)
boss_chromaggusAI(Creature* creature) : ScriptedAI(creature)
{
//Select the 2 breaths that we are going to use until despawned
//5 possiblities for the first breath, 4 for the second, 20 total possiblites
@@ -197,9 +197,7 @@ public:
Enraged = false;
}
void EnterCombat(Unit* /*who*/)
{
}
void EnterCombat(Unit* /*who*/) {}
void UpdateAI(const uint32 diff)
{
@@ -297,7 +295,6 @@ public:
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_chromaggus()
@@ -42,7 +42,7 @@ public:
struct boss_ebonrocAI : public ScriptedAI
{
boss_ebonrocAI(Creature* c) : ScriptedAI(c) {}
boss_ebonrocAI(Creature* creature) : ScriptedAI(creature) {}
uint32 ShadowFlame_Timer;
uint32 WingBuffet_Timer;
@@ -100,7 +100,6 @@ public:
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_ebonroc()
@@ -41,7 +41,7 @@ public:
struct boss_firemawAI : public ScriptedAI
{
boss_firemawAI(Creature* c) : ScriptedAI(c) {}
boss_firemawAI(Creature* creature) : ScriptedAI(creature) {}
uint32 ShadowFlame_Timer;
uint32 WingBuffet_Timer;
@@ -91,7 +91,6 @@ public:
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_firemaw()
@@ -25,11 +25,17 @@ EndScriptData */
#include "ScriptPCH.h"
#define EMOTE_FRENZY -1469031
enum Emotes
{
EMOTE_FRENZY = -1469031
};
#define SPELL_SHADOWFLAME 22539
#define SPELL_WINGBUFFET 23339
#define SPELL_FRENZY 23342 //This spell periodically triggers fire nova
enum Spells
{
SPELL_SHADOWFLAME = 22539,
SPELL_WINGBUFFET = 23339,
SPELL_FRENZY = 23342 //This spell periodically triggers fire nova
};
class boss_flamegor : public CreatureScript
{
@@ -43,7 +49,7 @@ public:
struct boss_flamegorAI : public ScriptedAI
{
boss_flamegorAI(Creature* c) : ScriptedAI(c) {}
boss_flamegorAI(Creature* creature) : ScriptedAI(creature) {}
uint32 ShadowFlame_Timer;
uint32 WingBuffet_Timer;
@@ -94,7 +100,6 @@ public:
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_flamegor()
@@ -25,40 +25,46 @@ EndScriptData */
#include "ScriptPCH.h"
#define SAY_AGGRO -1469007
#define SAY_XHEALTH -1469008
#define SAY_SHADOWFLAME -1469009
#define SAY_RAISE_SKELETONS -1469010
#define SAY_SLAY -1469011
#define SAY_DEATH -1469012
enum Say
{
SAY_AGGRO = -1469007,
SAY_XHEALTH = -1469008,
SAY_SHADOWFLAME = -1469009,
SAY_RAISE_SKELETONS = -1469010,
SAY_SLAY = -1469011,
SAY_DEATH = -1469012,
#define SAY_MAGE -1469013
#define SAY_WARRIOR -1469014
#define SAY_DRUID -1469015
#define SAY_PRIEST -1469016
#define SAY_PALADIN -1469017
#define SAY_SHAMAN -1469018
#define SAY_WARLOCK -1469019
#define SAY_HUNTER -1469020
#define SAY_ROGUE -1469021
SAY_MAGE = -1469013,
SAY_WARRIOR = -1469014,
SAY_DRUID = -1469015,
SAY_PRIEST = -1469016,
SAY_PALADIN = -1469017,
SAY_SHAMAN = -1469018,
SAY_WARLOCK = -1469019,
SAY_HUNTER = -1469020,
SAY_ROGUE = -1469021
};
#define SPELL_SHADOWFLAME_INITIAL 22972
#define SPELL_SHADOWFLAME 22539
#define SPELL_BELLOWINGROAR 22686
#define SPELL_VEILOFSHADOW 7068
#define SPELL_CLEAVE 20691
#define SPELL_TAILLASH 23364
#define SPELL_BONECONTRUST 23363 //23362, 23361
enum Spells
{
SPELL_SHADOWFLAME_INITIAL = 22972,
SPELL_SHADOWFLAME = 22539,
SPELL_BELLOWINGROAR = 22686,
SPELL_VEILOFSHADOW = 7068,
SPELL_CLEAVE = 20691,
SPELL_TAILLASH = 23364,
SPELL_BONECONTRUST = 23363, //23362, 23361
#define SPELL_MAGE 23410 //wild magic
#define SPELL_WARRIOR 23397 //beserk
#define SPELL_DRUID 23398 // cat form
#define SPELL_PRIEST 23401 // corrupted healing
#define SPELL_PALADIN 23418 //syphon blessing
#define SPELL_SHAMAN 23425 //totems
#define SPELL_WARLOCK 23427 //infernals
#define SPELL_HUNTER 23436 //bow broke
#define SPELL_ROGUE 23414 //Paralise
SPELL_MAGE = 23410, //wild magic
SPELL_WARRIOR = 23397, //beserk
SPELL_DRUID = 23398, // cat form
SPELL_PRIEST = 23401, // corrupted healing
SPELL_PALADIN = 23418, //syphon blessing
SPELL_SHAMAN = 23425, //totems
SPELL_WARLOCK = 23427, //infernals
SPELL_HUNTER = 23436, //bow broke
SPELL_ROGUE = 23414 //Paralise
};
class boss_nefarian : public CreatureScript
{
@@ -72,7 +78,7 @@ public:
struct boss_nefarianAI : public ScriptedAI
{
boss_nefarianAI(Creature* c) : ScriptedAI(c) {}
boss_nefarianAI(Creature* creature) : ScriptedAI(creature) {}
uint32 ShadowFlame_Timer;
uint32 BellowingRoar_Timer;
@@ -86,15 +92,15 @@ public:
void Reset()
{
ShadowFlame_Timer = 12000; //These times are probably wrong
BellowingRoar_Timer = 30000;
VeilOfShadow_Timer = 15000;
Cleave_Timer = 7000;
TailLash_Timer = 10000;
ClassCall_Timer = 35000; //35-40 seconds
ShadowFlame_Timer = 12000; // These times are probably wrong
BellowingRoar_Timer = 30000;
VeilOfShadow_Timer = 15000;
Cleave_Timer = 7000;
TailLash_Timer = 10000;
ClassCall_Timer = 35000; // 35-40 seconds
Phase3 = false;
DespawnTimer = 5000;
DespawnTimer = 5000;
}
void KilledUnit(Unit* Victim)
@@ -227,7 +233,6 @@ public:
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_nefarian()
@@ -27,15 +27,21 @@ EndScriptData */
//Razorgore Phase 2 Script
#define SAY_EGGS_BROKEN1 -1469022
#define SAY_EGGS_BROKEN2 -1469023
#define SAY_EGGS_BROKEN3 -1469024
#define SAY_DEATH -1469025
enum Say
{
SAY_EGGS_BROKEN1 = -1469022,
SAY_EGGS_BROKEN2 = -1469023,
SAY_EGGS_BROKEN3 = -1469024,
SAY_DEATH = -1469025
};
#define SPELL_CLEAVE 22540
#define SPELL_WARSTOMP 24375
#define SPELL_FIREBALLVOLLEY 22425
#define SPELL_CONFLAGRATION 23023
enum Spells
{
SPELL_CLEAVE = 22540,
SPELL_WARSTOMP = 24375,
SPELL_FIREBALLVOLLEY = 22425,
SPELL_CONFLAGRATION = 23023
};
class boss_razorgore : public CreatureScript
{
@@ -49,7 +55,7 @@ public:
struct boss_razorgoreAI : public ScriptedAI
{
boss_razorgoreAI(Creature* c) : ScriptedAI(c) {}
boss_razorgoreAI(Creature* creature) : ScriptedAI(creature) {}
uint32 Cleave_Timer;
uint32 WarStomp_Timer;
@@ -120,7 +126,6 @@ public:
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_razorgore()
@@ -25,40 +25,46 @@ EndScriptData */
#include "ScriptPCH.h"
#define SAY_LINE1 -1469026
#define SAY_LINE2 -1469027
#define SAY_LINE3 -1469028
#define SAY_HALFLIFE -1469029
#define SAY_KILLTARGET -1469030
enum Says
{
SAY_LINE1 = -1469026,
SAY_LINE2 = -1469027,
SAY_LINE3 = -1469028,
SAY_HALFLIFE = -1469029,
SAY_KILLTARGET = -1469030
};
#define GOSSIP_ITEM "Start Event <Needs Gossip Text>"
#define SPELL_ESSENCEOFTHERED 23513
#define SPELL_FLAMEBREATH 23461
#define SPELL_FIRENOVA 23462
#define SPELL_TAILSWIPE 15847
#define SPELL_BURNINGADRENALINE 23620
#define SPELL_CLEAVE 20684 //Chain cleave is most likely named something different and contains a dummy effect
enum Spells
{
SPELL_ESSENCEOFTHERED = 23513,
SPELL_FLAMEBREATH = 23461,
SPELL_FIRENOVA = 23462,
SPELL_TAILSWIPE = 15847,
SPELL_BURNINGADRENALINE = 23620,
SPELL_CLEAVE = 20684 //Chain cleave is most likely named something different and contains a dummy effect
};
class boss_vaelastrasz : public CreatureScript
{
public:
boss_vaelastrasz() : CreatureScript("boss_vaelastrasz") { }
void SendDefaultMenu(Player* player, Creature* creature, uint32 uiAction)
void SendDefaultMenu(Player* player, Creature* creature, uint32 Action)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
if (Action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
{
player->CLOSE_GOSSIP_MENU();
CAST_AI(boss_vaelastrasz::boss_vaelAI, creature->AI())->BeginSpeech(player);
}
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction)
bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 Action)
{
player->PlayerTalkClass->ClearMenus();
if (uiSender == GOSSIP_SENDER_MAIN)
SendDefaultMenu(player, creature, uiAction);
if (Sender == GOSSIP_SENDER_MAIN)
SendDefaultMenu(player, creature, Action);
return true;
}
@@ -81,11 +87,11 @@ public:
struct boss_vaelAI : public ScriptedAI
{
boss_vaelAI(Creature* c) : ScriptedAI(c)
boss_vaelAI(Creature* creature) : ScriptedAI(creature)
{
c->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
c->setFaction(35);
c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
creature->setFaction(35);
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
uint64 PlayerGUID;
@@ -102,17 +108,17 @@ public:
void Reset()
{
PlayerGUID = 0;
SpeechTimer = 0;
SpeechNum = 0;
Cleave_Timer = 8000; //These times are probably wrong
FlameBreath_Timer = 11000;
BurningAdrenalineCaster_Timer = 15000;
BurningAdrenalineTank_Timer = 45000;
FireNova_Timer = 5000;
TailSwipe_Timer = 20000;
HasYelled = false;
DoingSpeech = false;
PlayerGUID = 0;
SpeechTimer = 0;
SpeechNum = 0;
Cleave_Timer = 8000; //These times are probably wrong
FlameBreath_Timer = 11000;
BurningAdrenalineCaster_Timer = 15000;
BurningAdrenalineTank_Timer = 45000;
FireNova_Timer = 5000;
TailSwipe_Timer = 20000;
HasYelled = false;
DoingSpeech = false;
}
void BeginSpeech(Unit* target)
@@ -213,7 +219,7 @@ public:
Unit* target = NULL;
uint8 i = 0;
while (i < 3) // max 3 tries to get a random target with power_mana
while (i < 3) // max 3 tries to get a random target with power_mana
{
++i;
target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); //not aggro leader
@@ -258,7 +264,6 @@ public:
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_vael()
@@ -25,40 +25,49 @@ EndScriptData */
#include "ScriptPCH.h"
#define SAY_GAMESBEGIN_1 -1469004
#define SAY_GAMESBEGIN_2 -1469005
#define SAY_VAEL_INTRO -1469006 //when he corrupts Vaelastrasz
enum Says
{
SAY_GAMESBEGIN_1 = -1469004,
SAY_GAMESBEGIN_2 = -1469005,
SAY_VAEL_INTRO = -1469006 //when he corrupts Vaelastrasz
};
#define GOSSIP_ITEM_1 "I've made no mistakes."
#define GOSSIP_ITEM_2 "You have lost your mind, Nefarius. You speak in riddles."
#define GOSSIP_ITEM_3 "Please do."
#define CREATURE_BRONZE_DRAKANOID 14263
#define CREATURE_BLUE_DRAKANOID 14261
#define CREATURE_RED_DRAKANOID 14264
#define CREATURE_GREEN_DRAKANOID 14262
#define CREATURE_BLACK_DRAKANOID 14265
enum Creatures
{
CREATURE_BRONZE_DRAKANOID = 14263,
CREATURE_BLUE_DRAKANOID = 14261,
CREATURE_RED_DRAKANOID = 14264,
CREATURE_GREEN_DRAKANOID = 14262,
CREATURE_BLACK_DRAKANOID = 14265,
#define CREATURE_CHROMATIC_DRAKANOID 14302
#define CREATURE_NEFARIAN 11583
CREATURE_CHROMATIC_DRAKANOID = 14302,
CREATURE_NEFARIAN = 11583
};
#define ADD_X1 -7591.151855f
#define ADD_X2 -7514.598633f
#define ADD_Y1 -1204.051880f
#define ADD_Y2 -1150.448853f
#define ADD_Z1 476.800476f
#define ADD_Z2 476.796570f
#define ADD_X1 -7591.151855f
#define ADD_X2 -7514.598633f
#define ADD_Y1 -1204.051880f
#define ADD_Y2 -1150.448853f
#define ADD_Z1 476.800476f
#define ADD_Z2 476.796570f
#define NEF_X -7445
#define NEF_Y -1332
#define NEF_Z 536
#define NEF_X -7445
#define NEF_Y -1332
#define NEF_Z 536
#define HIDE_X -7592
#define HIDE_Y -1264
#define HIDE_Z 481
#define HIDE_X -7592
#define HIDE_Y -1264
#define HIDE_Z 481
#define SPELL_SHADOWBOLT 21077
#define SPELL_FEAR 26070
enum Spells
{
SPELL_SHADOWBOLT = 21077,
SPELL_FEAR = 26070
};
//This script is complicated
//Instead of morphing Victor Nefarius we will have him control phase 1
@@ -74,10 +83,10 @@ class boss_victor_nefarius : public CreatureScript
public:
boss_victor_nefarius() : CreatureScript("boss_victor_nefarius") { }
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 Action)
{
player->PlayerTalkClass->ClearMenus();
switch (uiAction)
switch (Action)
{
case GOSSIP_ACTION_INFO_DEF+1:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
@@ -110,7 +119,7 @@ public:
struct boss_victor_nefariusAI : public ScriptedAI
{
boss_victor_nefariusAI(Creature* c) : ScriptedAI(c)
boss_victor_nefariusAI(Creature* creature) : ScriptedAI(creature)
{
NefarianGUID = 0;
switch (urand(0, 19))
@@ -211,13 +220,13 @@ public:
void Reset()
{
SpawnedAdds = 0;
AddSpawnTimer = 10000;
ShadowBoltTimer = 5000;
FearTimer = 8000;
ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier
NefarianGUID = 0;
NefCheckTime = 2000;
SpawnedAdds = 0;
AddSpawnTimer = 10000;
ShadowBoltTimer = 5000;
FearTimer = 8000;
ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier
NefarianGUID = 0;
NefCheckTime = 2000;
me->SetUInt32Value(UNIT_NPC_FLAGS, 1);
me->setFaction(35);
@@ -378,7 +387,6 @@ public:
}
}
};
};
void AddSC_boss_victor_nefarius()
@@ -24,4 +24,3 @@ SDCategory: Blackwing Lair
EndScriptData */
#include "ScriptPCH.h"
@@ -186,7 +186,7 @@ public:
void MovementInform(uint32 type, uint32 id)
{
if (type != POINT_MOTION_TYPE)
return;
return;
if (Intro)
{
@@ -30,16 +30,19 @@ EndContentData */
#include "ScriptPCH.h"
#include "ScriptedSimpleAI.h"
#define SPELL_CONE_OF_FIRE 19630
#define SPELL_BITE 19771
enum Spells
{
SPELL_CONE_OF_FIRE = 19630,
SPELL_BITE = 19771,
//Random Debuff (each hound has only one of these)
#define SPELL_GROUND_STOMP 19364
#define SPELL_ANCIENT_DREAD 19365
#define SPELL_CAUTERIZING_FLAMES 19366
#define SPELL_WITHERING_HEAT 19367
#define SPELL_ANCIENT_DESPAIR 19369
#define SPELL_ANCIENT_HYSTERIA 19372
//Random Debuff (each hound has only one of these)
SPELL_GROUND_STOMP = 19364,
SPELL_ANCIENT_DREAD = 19365,
SPELL_CAUTERIZING_FLAMES = 19366,
SPELL_WITHERING_HEAT = 19367,
SPELL_ANCIENT_DESPAIR = 19369,
SPELL_ANCIENT_HYSTERIA = 19372
};
class mob_ancient_core_hound : public CreatureScript
{
@@ -75,7 +78,6 @@ public:
return ai;
}
};
void AddSC_molten_core()
@@ -1009,7 +1009,7 @@ public:
me->SetInFront(car);
me->SendMovementFlagUpdate();
car->Relocate(car->GetPositionX(), car->GetPositionY(), me->GetPositionZ() + 1);
car->SendMonsterStop();
car->StopMoving();
car->RemoveAura(SPELL_CART_DRAG);
}
me->MonsterSay(SAY_SCARLET_MINER2, LANG_UNIVERSAL, 0);
@@ -49,7 +49,7 @@ public:
struct boss_arcanist_doanAI : public ScriptedAI
{
boss_arcanist_doanAI(Creature* c) : ScriptedAI(c) {}
boss_arcanist_doanAI(Creature* creature) : ScriptedAI(creature) {}
uint32 Polymorph_Timer;
uint32 AoESilence_Timer;
@@ -105,26 +105,28 @@ public:
DoCast(target, SPELL_POLYMORPH);
Polymorph_Timer = 20000;
} else Polymorph_Timer -= diff;
}
else Polymorph_Timer -= diff;
//AoESilence_Timer
if (AoESilence_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_AOESILENCE);
AoESilence_Timer = urand(15000, 20000);
} else AoESilence_Timer -= diff;
}
else AoESilence_Timer -= diff;
//ArcaneExplosion_Timer
if (ArcaneExplosion_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION);
ArcaneExplosion_Timer = 8000;
} else ArcaneExplosion_Timer -= diff;
}
else ArcaneExplosion_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_arcanist_doan()
@@ -25,9 +25,12 @@ EndScriptData */
#include "ScriptPCH.h"
#define SPELL_CALLOFTHEGRAVE 17831
#define SPELL_TERRIFY 7399
#define SPELL_SOULSIPHON 7290
enum Spells
{
SPELL_CALLOFTHEGRAVE = 17831,
SPELL_TERRIFY = 7399,
SPELL_SOULSIPHON = 7290
};
class boss_azshir_the_sleepless : public CreatureScript
{
@@ -41,7 +44,7 @@ public:
struct boss_azshir_the_sleeplessAI : public ScriptedAI
{
boss_azshir_the_sleeplessAI(Creature* c) : ScriptedAI(c) {}
boss_azshir_the_sleeplessAI(Creature* creature) : ScriptedAI(creature) {}
uint32 SoulSiphon_Timer;
uint32 CallOftheGrave_Timer;
@@ -54,9 +57,7 @@ public:
Terrify_Timer = 20000;
}
void EnterCombat(Unit* /*who*/)
{
}
void EnterCombat(Unit* /*who*/) {}
void UpdateAI(const uint32 diff)
{
@@ -73,7 +74,8 @@ public:
return;
//SoulSiphon_Timer = 20000;
} else SoulSiphon_Timer -= diff;
}
else SoulSiphon_Timer -= diff;
}
//CallOfTheGrave_Timer
@@ -81,19 +83,20 @@ public:
{
DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE);
CallOftheGrave_Timer = 30000;
} else CallOftheGrave_Timer -= diff;
}
else CallOftheGrave_Timer -= diff;
//Terrify_Timer
if (Terrify_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_TERRIFY);
Terrify_Timer = 20000;
} else Terrify_Timer -= diff;
}
else Terrify_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_azshir_the_sleepless()
@@ -49,7 +49,7 @@ public:
struct boss_bloodmage_thalnosAI : public ScriptedAI
{
boss_bloodmage_thalnosAI(Creature* c) : ScriptedAI(c) {}
boss_bloodmage_thalnosAI(Creature* creature) : ScriptedAI(creature) {}
bool HpYell;
uint32 FlameShock_Timer;
@@ -93,33 +93,36 @@ public:
{
DoCast(me->getVictim(), SPELL_FLAMESHOCK);
FlameShock_Timer = urand(10000, 15000);
} else FlameShock_Timer -= diff;
}
else FlameShock_Timer -= diff;
//FlameSpike_Timer
if (FlameSpike_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_FLAMESPIKE);
FlameSpike_Timer = 30000;
} else FlameSpike_Timer -= diff;
}
else FlameSpike_Timer -= diff;
//FireNova_Timer
if (FireNova_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_FIRENOVA);
FireNova_Timer = 40000;
} else FireNova_Timer -= diff;
}
else FireNova_Timer -= diff;
//ShadowBolt_Timer
if (ShadowBolt_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SHADOWBOLT);
ShadowBolt_Timer = 2000;
} else ShadowBolt_Timer -= diff;
}
else ShadowBolt_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_bloodmage_thalnos()
@@ -28,59 +28,66 @@ EndScriptData */
#include "scarlet_monastery.h"
//this texts are already used by 3975 and 3976
#define SAY_ENTRANCE -1189001
#define SAY_REJOINED -1189002
#define SAY_LOST_HEAD -1189003
#define SAY_CONFLAGRATION -1189004
#define SAY_SPROUTING_PUMPKINS -1189005
#define SAY_PLAYER_DEATH -1189006
#define SAY_DEATH -1189007
enum Says
{
SAY_ENTRANCE = -1189001,
SAY_REJOINED = -1189002,
SAY_LOST_HEAD = -1189003,
SAY_CONFLAGRATION = -1189004,
SAY_SPROUTING_PUMPKINS = -1189005,
SAY_PLAYER_DEATH = -1189006,
SAY_DEATH = -1189007
};
uint32 RandomLaugh[] = {11965, 11975, 11976};
// Entryes
#define HH_MOUNTED 23682
#define HH_UNHORSED 23800
#define HEAD 23775
#define PULSING_PUMPKIN 23694
#define PUMPKIN_FIEND 23545
#define HELPER 23686
#define WISP_INVIS 24034
enum Entry
{
HH_MOUNTED = 23682,
HH_DISMOUNTED = 23800, // unhorsed?? wtf type of engrish was that?
HEAD = 23775,
PULSING_PUMPKIN = 23694,
PUMPKIN_FIEND = 23545,
HELPER = 23686,
WISP_INVIS = 24034
};
//Spells
#define SPELL_CLEAVE 42587
#define SPELL_CONFLAGRATION 42380 //Phase 2, can't find real spell(Dim Fire?)
//#define SPELL_CONFL_SPEED 22587 //8% increase speed, value 22587 from SPELL_CONFLAGRATION mains that spell?
#define SPELL_SUMMON_PUMPKIN 42394
enum Spells
{
SPELL_CLEAVE = 42587,
SPELL_CONFLAGRATION = 42380, //Phase 2, can't find real spell(Dim Fire?)
// SPELL_CONFL_SPEED = 22587, //8% increase speed, value 22587 from SPELL_CONFLAGRATION mains that spell?
SPELL_SUMMON_PUMPKIN = 42394,
#define SPELL_WHIRLWIND 43116
#define SPELL_IMMUNE 42556
#define SPELL_BODY_REGEN 42403
#define SPELL_CONFUSE 43105
SPELL_WHIRLWIND = 43116,
SPELL_IMMUNE = 42556,
SPELL_BODY_REGEN = 42403,
SPELL_CONFUSE = 43105,
#define SPELL_FLYING_HEAD 42399 //visual flying head
#define SPELL_HEAD 42413 //visual buff, "head"
#define SPELL_HEAD_IS_DEAD 42428 //at killing head, Phase 3
SPELL_FLYING_HEAD = 42399, //visual flying head
SPELL_HEAD = 42413, //visual buff, "head"
SPELL_HEAD_IS_DEAD = 42428, //at killing head, Phase 3
#define SPELL_PUMPKIN_AURA 42280
#define SPELL_PUMPKIN_AURA_GREEN 42294
#define SPELL_SQUASH_SOUL 42514
#define SPELL_SPROUTING 42281
#define SPELL_SPROUT_BODY 42285
SPELL_PUMPKIN_AURA = 42280,
SPELL_PUMPKIN_AURA_GREEN = 42294,
SPELL_SQUASH_SOUL = 42514,
SPELL_SPROUTING = 42281,
SPELL_SPROUT_BODY = 42285,
//Effects
#define SPELL_RHYME_BIG 42909
//#define SPELL_RHYME_SMALL 42910
#define SPELL_HEAD_SPEAKS 43129
#define SPELL_HEAD_LANDS 42400
#define SPELL_BODY_FLAME 42074
#define SPELL_HEAD_FLAME 42971
//#define SPELL_ENRAGE_VISUAL 42438 // he uses this spell?
#define SPELL_WISP_BLUE 42821
#define SPELL_WISP_FLIGHT_PORT 42818
//#define SPELL_WISP_INVIS 42823
#define SPELL_SMOKE 42355
#define SPELL_DEATH 42566 //not correct spell
SPELL_RHYME_BIG = 42909,
// SPELL_RHYME_SMALL = 42910,
SPELL_HEAD_SPEAKS = 43129,
SPELL_HEAD_LANDS = 42400,
SPELL_BODY_FLAME = 42074,
SPELL_HEAD_FLAME = 42971,
// SPELL_ENRAGE_VISUAL = 42438, // he uses this spell?
SPELL_WISP_BLUE = 42821,
SPELL_WISP_FLIGHT_PORT = 42818,
// SPELL_WISP_INVIS = 42823,
SPELL_SMOKE = 42355,
SPELL_DEATH = 42566 //not correct spell
};
struct Locations
{
@@ -114,7 +121,7 @@ static Locations FlightPoint[]=
static Locations Spawn[]=
{
{1776.27f, 1348.74f, 19.20f}, //spawn point for pumpkin shrine mob
{1776.27f, 1348.74f, 19.20f}, //spawn point for pumpkin shrine mob
{1765.28f, 1347.46f, 17.55f} //spawn point for smoke
};
@@ -126,7 +133,7 @@ static const char* Text[]=
"Now, know demise!"
};
#define EMOTE_LAUGHS "Headless Horseman laughs"
#define EMOTE_LAUGHS "Headless Horseman laughs" // needs assigned to db.
class mob_wisp_invis : public CreatureScript
{
@@ -140,7 +147,7 @@ public:
struct mob_wisp_invisAI : public ScriptedAI
{
mob_wisp_invisAI(Creature* c) : ScriptedAI(c)
mob_wisp_invisAI(Creature* creature) : ScriptedAI(creature)
{
Creaturetype = delay = spell = spell2 = 0;
}
@@ -149,8 +156,8 @@ public:
uint32 delay;
uint32 spell;
uint32 spell2;
void Reset(){}
void EnterCombat(Unit* /*who*/){}
void Reset() {}
void EnterCombat(Unit* /*who*/) {}
void SetType(uint32 _type)
{
switch (Creaturetype = _type)
@@ -205,7 +212,6 @@ public:
}
}
};
};
class mob_head : public CreatureScript
@@ -220,7 +226,7 @@ public:
struct mob_headAI : public ScriptedAI
{
mob_headAI(Creature* c) : ScriptedAI(c) {}
mob_headAI(Creature* creature) : ScriptedAI(creature) {}
uint64 bodyGUID;
@@ -316,7 +322,8 @@ public:
if (!me->getVictim()) return;
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveFleeing(me->getVictim());
} else wait -= diff;
}
else wait -= diff;
if (laugh <= diff)
{
@@ -327,7 +334,8 @@ public:
if (speaker)
speaker->CastSpell(speaker, SPELL_HEAD_SPEAKS, false);
me->MonsterTextEmote(EMOTE_LAUGHS, 0);
} else laugh -= diff;
}
else laugh -= diff;
}
else
{
@@ -339,12 +347,12 @@ public:
if (Unit* body = Unit::GetUnit((*me), bodyGUID))
body->Kill(body);
me->Kill(me);
} else wait -= diff;
}
else wait -= diff;
}
}
}
};
};
class boss_headless_horseman : public CreatureScript
@@ -359,9 +367,9 @@ public:
struct boss_headless_horsemanAI : public ScriptedAI
{
boss_headless_horsemanAI(Creature* c) : ScriptedAI(c)
boss_headless_horsemanAI(Creature* creature) : ScriptedAI(creature)
{
instance = c->GetInstanceScript();
instance = creature->GetInstanceScript();
}
InstanceScript* instance;
@@ -636,7 +644,8 @@ public:
break;
}
++count;
} else say_timer -= diff;
}
else say_timer -= diff;
}
else
{
@@ -657,7 +666,8 @@ public:
if (Creature* flame = me->SummonCreature(HELPER, Spawn[0].x, Spawn[0].y, Spawn[0].z, 0, TEMPSUMMON_TIMED_DESPAWN, 17000))
CAST_AI(mob_wisp_invis::mob_wisp_invisAI, flame->AI())->SetType(2);
burned = true;
} else burn -= diff;
}
else burn -= diff;
break;
case 2:
if (conflagrate <= diff)
@@ -665,7 +675,8 @@ public:
if (Unit* player = SelectRandomPlayer(30.0f))
DoCast(player, SPELL_CONFLAGRATION, false);
conflagrate = urand(10000, 16000);
} else conflagrate -= diff;
}
else conflagrate -= diff;
break;
case 3:
if (summonadds <= diff)
@@ -674,7 +685,8 @@ public:
DoCast(me, SPELL_SUMMON_PUMPKIN);
SaySound(SAY_SPROUTING_PUMPKINS);
summonadds = urand(25000, 35000);
} else summonadds -= diff;
}
else summonadds -= diff;
break;
}
@@ -683,7 +695,8 @@ public:
laugh = urand(11000, 22000);
me->MonsterTextEmote(EMOTE_LAUGHS, 0);
DoPlaySoundToSet(me, RandomLaugh[rand()%3]);
} else laugh -= diff;
}
else laugh -= diff;
if (UpdateVictim())
{
@@ -692,7 +705,8 @@ public:
{
DoCast(me->getVictim(), SPELL_CLEAVE);
cleave = urand(2000, 6000); //1 cleave per 2.0f-6.0fsec
} else cleave -= diff;
}
else cleave -= diff;
}
}
else
@@ -725,13 +739,14 @@ public:
me->RemoveAurasDueToSpell(SPELL_CONFUSE);
DoCast(me, SPELL_WHIRLWIND, true);
DoCast(me, SPELL_CONFUSE);
} else
}
else
me->RemoveAurasDueToSpell(SPELL_WHIRLWIND);
} else whirlwind -= diff;
}
else whirlwind -= diff;
}
}
};
};
class mob_pulsing_pumpkin : public CreatureScript
@@ -746,7 +761,7 @@ public:
struct mob_pulsing_pumpkinAI : public ScriptedAI
{
mob_pulsing_pumpkinAI(Creature* c) : ScriptedAI(c) {}
mob_pulsing_pumpkinAI(Creature* creature) : ScriptedAI(creature) {}
bool sprouted;
uint64 debuffGUID;
@@ -771,7 +786,7 @@ public:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
}
void EnterCombat(Unit* /*who*/){}
void EnterCombat(Unit* /*who*/) {}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
{
@@ -813,7 +828,6 @@ public:
DoMeleeAttackIfReady();
}
};
};
class go_loosely_turned_soil : public GameObjectScript
@@ -846,13 +860,13 @@ public:
//}
return true;
}
};
void mob_head::mob_headAI::Disappear()
{
if (withbody)
return;
if (bodyGUID)
{
Creature* body = Unit::GetCreature((*me), bodyGUID);
@@ -26,19 +26,32 @@ EndScriptData */
#include "ScriptPCH.h"
#include "ScriptedEscortAI.h"
#define SAY_AGGRO -1189000
#define SAY_WHIRLWIND -1189001
#define SAY_ENRAGE -1189002
#define SAY_KILL -1189003
#define EMOTE_ENRAGE -1189004
enum Says
{
SAY_AGGRO = -1189000,
SAY_WHIRLWIND = -1189001,
SAY_ENRAGE = -1189002,
SAY_KILL = -1189003
};
#define SPELL_RUSHINGCHARGE 8260
#define SPELL_CLEAVE 15496
#define SPELL_WHIRLWIND 8989
#define SPELL_FRENZY 8269
enum Emotes
{
EMOTE_ENRAGE = -1189004
};
#define ENTRY_SCARLET_TRAINEE 6575
#define ENTRY_SCARLET_MYRMIDON 4295
enum Spells
{
SPELL_RUSHINGCHARGE = 8260,
SPELL_CLEAVE = 15496,
SPELL_WHIRLWIND = 8989,
SPELL_FRENZY = 8269
};
enum Entry
{
ENTRY_SCARLET_TRAINEE = 6575,
ENTRY_SCARLET_MYRMIDON = 4295
};
class boss_herod : public CreatureScript
{
@@ -52,7 +65,7 @@ public:
struct boss_herodAI : public ScriptedAI
{
boss_herodAI(Creature* c) : ScriptedAI(c) {}
boss_herodAI(Creature* creature) : ScriptedAI(creature) {}
bool Enrage;
@@ -102,7 +115,8 @@ public:
{
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 12000;
} else Cleave_Timer -= diff;
}
else Cleave_Timer -= diff;
// Whirlwind_Timer
if (Whirlwind_Timer <= diff)
@@ -110,12 +124,12 @@ public:
DoScriptText(SAY_WHIRLWIND, me);
DoCast(me->getVictim(), SPELL_WHIRLWIND);
Whirlwind_Timer = 30000;
} else Whirlwind_Timer -= diff;
}
else Whirlwind_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
class mob_scarlet_trainee : public CreatureScript
@@ -130,7 +144,7 @@ public:
struct mob_scarlet_traineeAI : public npc_escortAI
{
mob_scarlet_traineeAI(Creature* c) : npc_escortAI(c)
mob_scarlet_traineeAI(Creature* creature) : npc_escortAI(creature)
{
Start_Timer = urand(1000, 6000);
}
@@ -138,7 +152,7 @@ public:
uint32 Start_Timer;
void Reset() {}
void WaypointReached(uint32 /*uiPoint*/) {}
void WaypointReached(uint32 /*point*/) {}
void EnterCombat(Unit* /*who*/) {}
void UpdateAI(const uint32 diff)
@@ -155,7 +169,6 @@ public:
npc_escortAI::UpdateAI(diff);
}
};
};
void AddSC_boss_herod()
@@ -47,7 +47,7 @@ public:
struct boss_high_inquisitor_fairbanksAI : public ScriptedAI
{
boss_high_inquisitor_fairbanksAI(Creature* c) : ScriptedAI(c) {}
boss_high_inquisitor_fairbanksAI(Creature* creature) : ScriptedAI(creature) {}
uint32 CurseOfBlood_Timer;
uint32 DispelMagic_Timer;
@@ -68,9 +68,7 @@ public:
PowerWordShield = false;
}
void EnterCombat(Unit* /*who*/)
{
}
void EnterCombat(Unit* /*who*/) {}
void UpdateAI(const uint32 diff)
{
@@ -82,7 +80,8 @@ public:
{
DoCast(me, SPELL_HEAL);
Heal_Timer = 30000;
} else Heal_Timer -= diff;
}
else Heal_Timer -= diff;
//Fear_Timer
if (Fear_Timer <= diff)
@@ -91,7 +90,8 @@ public:
DoCast(target, SPELL_FEAR);
Fear_Timer = 40000;
} else Fear_Timer -= diff;
}
else Fear_Timer -= diff;
//Sleep_Timer
if (Sleep_Timer <= diff)
@@ -100,7 +100,8 @@ public:
DoCast(target, SPELL_SLEEP);
Sleep_Timer = 30000;
} else Sleep_Timer -= diff;
}
else Sleep_Timer -= diff;
//PowerWordShield_Timer
if (!PowerWordShield && !HealthAbovePct(25))
@@ -116,19 +117,20 @@ public:
DoCast(target, SPELL_DISPELMAGIC);
DispelMagic_Timer = 30000;
} else DispelMagic_Timer -= diff;
}
else DispelMagic_Timer -= diff;
//CurseOfBlood_Timer
if (CurseOfBlood_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_CURSEOFBLOOD);
CurseOfBlood_Timer = 25000;
} else CurseOfBlood_Timer -= diff;
}
else CurseOfBlood_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_high_inquisitor_fairbanks()
@@ -44,7 +44,7 @@ public:
struct boss_houndmaster_lokseyAI : public ScriptedAI
{
boss_houndmaster_lokseyAI(Creature* c) : ScriptedAI(c) {}
boss_houndmaster_lokseyAI(Creature* creature) : ScriptedAI(creature) {}
uint32 BloodLust_Timer;
@@ -67,12 +67,12 @@ public:
{
DoCast(me, SPELL_BLOODLUST);
BloodLust_Timer = 20000;
} else BloodLust_Timer -= diff;
}
else BloodLust_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_houndmaster_loksey()
@@ -26,15 +26,18 @@ EndScriptData */
#include "ScriptPCH.h"
#include "scarlet_monastery.h"
enum eEnums
enum Says
{
SAY_AGGRO = -1189011,
SAY_HEALTH1 = -1189012,
SAY_HEALTH2 = -1189013,
SAY_KILL = -1189014,
SAY_TRIGGER_VORREL = -1189015,
SAY_TRIGGER_VORREL = -1189015
};
SPELL_SHADOWWORDPAIN = 2767,
enum Spells
{
SPELL_SHADOWWORDPAIN = 2767
};
class boss_interrogator_vishas : public CreatureScript
@@ -49,7 +52,7 @@ public:
struct boss_interrogator_vishasAI : public ScriptedAI
{
boss_interrogator_vishasAI(Creature* c) : ScriptedAI(c)
boss_interrogator_vishasAI(Creature* creature) : ScriptedAI(creature)
{
instance = me->GetInstanceScript();
}
@@ -108,12 +111,12 @@ public:
{
DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN);
ShadowWordPain_Timer = urand(5000, 15000);
} else ShadowWordPain_Timer -= diff;
}
else ShadowWordPain_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_interrogator_vishas()
@@ -26,7 +26,7 @@ EndScriptData */
#include "ScriptPCH.h"
#include "scarlet_monastery.h"
enum eEnums
enum Says
{
//Mograine says
SAY_MO_AGGRO = -1189005,
@@ -37,7 +37,10 @@ enum eEnums
SAY_WH_INTRO = -1189008,
SAY_WH_KILL = -1189009,
SAY_WH_RESSURECT = -1189010,
};
enum Spells
{
//Mograine Spells
SPELL_CRUSADERSTRIKE = 14518,
SPELL_HAMMEROFJUSTICE = 5589,
@@ -67,43 +70,43 @@ public:
{
boss_scarlet_commander_mograineAI(Creature* creature) : ScriptedAI(creature)
{
m_instance = creature->GetInstanceScript();
instance = creature->GetInstanceScript();
}
InstanceScript* m_instance;
InstanceScript* instance;
uint32 m_uiCrusaderStrike_Timer;
uint32 m_uiHammerOfJustice_Timer;
uint32 CrusaderStrike_Timer;
uint32 HammerOfJustice_Timer;
bool m_bHasDied;
bool m_bHeal;
bool m_bFakeDeath;
bool _bHasDied;
bool _bHeal;
bool _bFakeDeath;
void Reset()
{
m_uiCrusaderStrike_Timer = 10000;
m_uiHammerOfJustice_Timer = 10000;
CrusaderStrike_Timer = 10000;
HammerOfJustice_Timer = 10000;
//Incase wipe during phase that mograine fake death
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetStandState(UNIT_STAND_STATE_STAND);
if (m_instance)
if (instance)
if (me->isAlive())
m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
m_bHasDied = false;
m_bHeal = false;
m_bFakeDeath = false;
_bHasDied = false;
_bHeal = false;
_bFakeDeath = false;
}
void JustReachedHome()
{
if (m_instance)
if (instance)
{
if (m_instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != NOT_STARTED)
m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL);
if (instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) != NOT_STARTED)
instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL);
}
}
@@ -120,18 +123,18 @@ public:
DoScriptText(SAY_MO_KILL, me);
}
void DamageTaken(Unit* /*pDoneBy*/, uint32 &uiDamage)
void DamageTaken(Unit* /*doneBy*/, uint32 &damage)
{
if (uiDamage < me->GetHealth() || m_bHasDied || m_bFakeDeath)
if (damage < me->GetHealth() || _bHasDied || _bFakeDeath)
return;
if (!m_instance)
if (!instance)
return;
//On first death, fake death and open door, as well as initiate whitemane if exist
if (Unit* Whitemane = Unit::GetUnit((*me), m_instance->GetData64(DATA_WHITEMANE)))
if (Unit* Whitemane = Unit::GetUnit((*me), instance->GetData64(DATA_WHITEMANE)))
{
m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS);
instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS);
Whitemane->GetMotionMaster()->MovePoint(1, 1163.113370f, 1398.856812f, 32.527786f);
@@ -150,72 +153,73 @@ public:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetStandState(UNIT_STAND_STATE_DEAD);
m_bHasDied = true;
m_bFakeDeath = true;
_bHasDied = true;
_bFakeDeath = true;
uiDamage = 0;
damage = 0;
}
}
void SpellHit(Unit* /*who*/, const SpellInfo* pSpell)
void SpellHit(Unit* /*who*/, const SpellInfo* spell)
{
//When hit with ressurection say text
if (pSpell->Id == SPELL_SCARLETRESURRECTION)
if (spell->Id == SPELL_SCARLETRESURRECTION)
{
DoScriptText(SAY_MO_RESSURECTED, me);
m_bFakeDeath = false;
_bFakeDeath = false;
if (m_instance)
m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL);
if (instance)
instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL);
}
}
void UpdateAI(const uint32 uiDiff)
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (m_bHasDied && !m_bHeal && m_instance && m_instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL)
if (_bHasDied && !_bHeal && instance && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL)
{
//On ressurection, stop fake death and heal whitemane and resume fight
if (Unit* Whitemane = Unit::GetUnit((*me), m_instance->GetData64(DATA_WHITEMANE)))
if (Unit* Whitemane = Unit::GetUnit((*me), instance->GetData64(DATA_WHITEMANE)))
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetStandState(UNIT_STAND_STATE_STAND);
DoCast(Whitemane, SPELL_LAYONHANDS);
m_uiCrusaderStrike_Timer = 10000;
m_uiHammerOfJustice_Timer = 10000;
CrusaderStrike_Timer = 10000;
HammerOfJustice_Timer = 10000;
if (me->getVictim())
me->GetMotionMaster()->MoveChase(me->getVictim());
m_bHeal = true;
_bHeal = true;
}
}
//This if-check to make sure mograine does not attack while fake death
if (m_bFakeDeath)
if (_bFakeDeath)
return;
//m_uiCrusaderStrike_Timer
if (m_uiCrusaderStrike_Timer <= uiDiff)
//CrusaderStrike_Timer
if (CrusaderStrike_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_CRUSADERSTRIKE);
m_uiCrusaderStrike_Timer = 10000;
} else m_uiCrusaderStrike_Timer -= uiDiff;
CrusaderStrike_Timer = 10000;
}
else CrusaderStrike_Timer -= diff;
//m_uiHammerOfJustice_Timer
if (m_uiHammerOfJustice_Timer <= uiDiff)
//HammerOfJustice_Timer
if (HammerOfJustice_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_HAMMEROFJUSTICE);
m_uiHammerOfJustice_Timer = 60000;
} else m_uiHammerOfJustice_Timer -= uiDiff;
HammerOfJustice_Timer = 60000;
}
else HammerOfJustice_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
class boss_high_inquisitor_whitemane : public CreatureScript
@@ -232,37 +236,37 @@ public:
{
boss_high_inquisitor_whitemaneAI(Creature* creature) : ScriptedAI(creature)
{
m_instance = creature->GetInstanceScript();
instance = creature->GetInstanceScript();
}
InstanceScript* m_instance;
InstanceScript* instance;
uint32 m_uiHeal_Timer;
uint32 m_uiPowerWordShield_Timer;
uint32 m_uiHolySmite_Timer;
uint32 m_uiWait_Timer;
uint32 Heal_Timer;
uint32 PowerWordShield_Timer;
uint32 HolySmite_Timer;
uint32 Wait_Timer;
bool m_bCanResurrectCheck;
bool m_bCanResurrect;
bool _bCanResurrectCheck;
bool _bCanResurrect;
void Reset()
{
m_uiWait_Timer = 7000;
m_uiHeal_Timer = 10000;
m_uiPowerWordShield_Timer = 15000;
m_uiHolySmite_Timer = 6000;
Wait_Timer = 7000;
Heal_Timer = 10000;
PowerWordShield_Timer = 15000;
HolySmite_Timer = 6000;
m_bCanResurrectCheck = false;
m_bCanResurrect = false;
_bCanResurrectCheck = false;
_bCanResurrect = false;
if (m_instance)
if (instance)
if (me->isAlive())
m_instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
}
void AttackStart(Unit* who)
{
if (m_instance && m_instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED)
if (instance && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED)
return;
ScriptedAI::AttackStart(who);
@@ -278,84 +282,86 @@ public:
DoScriptText(SAY_WH_KILL, me);
}
void UpdateAI(const uint32 uiDiff)
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (m_bCanResurrect)
if (_bCanResurrect)
{
//When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out
if (m_instance && m_uiWait_Timer <= uiDiff)
if (instance && Wait_Timer <= diff)
{
if (Unit* Mograine = Unit::GetUnit((*me), m_instance->GetData64(DATA_MOGRAINE)))
if (Unit* Mograine = Unit::GetUnit((*me), instance->GetData64(DATA_MOGRAINE)))
{
DoCast(Mograine, SPELL_SCARLETRESURRECTION);
DoScriptText(SAY_WH_RESSURECT, me);
m_bCanResurrect = false;
_bCanResurrect = false;
}
}
else m_uiWait_Timer -= uiDiff;
else Wait_Timer -= diff;
}
//Cast Deep sleep when health is less than 50%
if (!m_bCanResurrectCheck && !HealthAbovePct(50))
if (!_bCanResurrectCheck && !HealthAbovePct(50))
{
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
DoCast(me->getVictim(), SPELL_DEEPSLEEP);
m_bCanResurrectCheck = true;
m_bCanResurrect = true;
_bCanResurrectCheck = true;
_bCanResurrect = true;
return;
}
//while in "resurrect-mode", don't do anything
if (m_bCanResurrect)
if (_bCanResurrect)
return;
//If we are <75% hp cast healing spells at self or Mograine
if (m_uiHeal_Timer <= uiDiff)
if (Heal_Timer <= diff)
{
Creature* target = NULL;
if (!HealthAbovePct(75))
target = me;
if (m_instance)
if (instance)
{
if (Creature* pMograine = Unit::GetCreature((*me), m_instance->GetData64(DATA_MOGRAINE)))
if (Creature* mograine = Unit::GetCreature((*me), instance->GetData64(DATA_MOGRAINE)))
{
// checking m_bCanResurrectCheck prevents her healing Mograine while he is "faking death"
if (m_bCanResurrectCheck && pMograine->isAlive() && !pMograine->HealthAbovePct(75))
target = pMograine;
// checking _bCanResurrectCheck prevents her healing Mograine while he is "faking death"
if (_bCanResurrectCheck && mograine->isAlive() && !mograine->HealthAbovePct(75))
target = mograine;
}
}
if (target)
DoCast(target, SPELL_HEAL);
m_uiHeal_Timer = 13000;
} else m_uiHeal_Timer -= uiDiff;
Heal_Timer = 13000;
}
else Heal_Timer -= diff;
//m_uiPowerWordShield_Timer
if (m_uiPowerWordShield_Timer <= uiDiff)
//PowerWordShield_Timer
if (PowerWordShield_Timer <= diff)
{
DoCast(me, SPELL_POWERWORDSHIELD);
m_uiPowerWordShield_Timer = 15000;
} else m_uiPowerWordShield_Timer -= uiDiff;
PowerWordShield_Timer = 15000;
}
else PowerWordShield_Timer -= diff;
//m_uiHolySmite_Timer
if (m_uiHolySmite_Timer <= uiDiff)
//HolySmite_Timer
if (HolySmite_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_HOLYSMITE);
m_uiHolySmite_Timer = 6000;
} else m_uiHolySmite_Timer -= uiDiff;
HolySmite_Timer = 6000;
}
else HolySmite_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_mograine_and_whitemane()
@@ -25,10 +25,13 @@ EndScriptData */
#include "ScriptPCH.h"
#define SPELL_LICHSLAP 28873
#define SPELL_FROSTBOLTVOLLEY 8398
#define SPELL_MINDFLAY 17313
#define SPELL_FROSTNOVA 15531
enum Spells
{
SPELL_LICHSLAP = 28873,
SPELL_FROSTBOLTVOLLEY = 8398,
SPELL_MINDFLAY = 17313,
SPELL_FROSTNOVA = 15531
};
class boss_scorn : public CreatureScript
{
@@ -42,7 +45,7 @@ public:
struct boss_scornAI : public ScriptedAI
{
boss_scornAI(Creature* c) : ScriptedAI(c) {}
boss_scornAI(Creature* creature) : ScriptedAI(creature) {}
uint32 LichSlap_Timer;
uint32 FrostboltVolley_Timer;
@@ -57,9 +60,7 @@ public:
FrostNova_Timer = 30000;
}
void EnterCombat(Unit* /*who*/)
{
}
void EnterCombat(Unit* /*who*/) {}
void UpdateAI(const uint32 diff)
{
@@ -71,33 +72,36 @@ public:
{
DoCast(me->getVictim(), SPELL_LICHSLAP);
LichSlap_Timer = 45000;
} else LichSlap_Timer -= diff;
}
else LichSlap_Timer -= diff;
//FrostboltVolley_Timer
if (FrostboltVolley_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_FROSTBOLTVOLLEY);
FrostboltVolley_Timer = 20000;
} else FrostboltVolley_Timer -= diff;
}
else FrostboltVolley_Timer -= diff;
//MindFlay_Timer
if (MindFlay_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_MINDFLAY);
MindFlay_Timer = 20000;
} else MindFlay_Timer -= diff;
}
else MindFlay_Timer -= diff;
//FrostNova_Timer
if (FrostNova_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_FROSTNOVA);
FrostNova_Timer = 15000;
} else FrostNova_Timer -= diff;
}
else FrostNova_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_scorn()
@@ -26,10 +26,13 @@ EndScriptData */
#include "ScriptPCH.h"
#include "scarlet_monastery.h"
#define ENTRY_PUMPKIN_SHRINE 186267
#define ENTRY_HORSEMAN 23682
#define ENTRY_HEAD 23775
#define ENTRY_PUMPKIN 23694
enum Entry
{
ENTRY_PUMPKIN_SHRINE = 186267,
ENTRY_HORSEMAN = 23682,
ENTRY_HEAD = 23775,
ENTRY_PUMPKIN = 23694
};
#define MAX_ENCOUNTER 2
@@ -57,11 +60,11 @@ public:
uint64 VorrelGUID;
uint64 DoorHighInquisitorGUID;
uint32 m_auiEncounter[MAX_ENCOUNTER];
uint32 encounter[MAX_ENCOUNTER];
void Initialize()
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
memset(&encounter, 0, sizeof(encounter));
PumpkinShrineGUID = 0;
HorsemanGUID = 0;
@@ -106,13 +109,13 @@ public:
if (data == FAIL)
DoUseDoorOrButton(DoorHighInquisitorGUID);
m_auiEncounter[0] = data;
encounter[0] = data;
break;
case GAMEOBJECT_PUMPKIN_SHRINE:
HandleGameObject(PumpkinShrineGUID, false);
break;
case DATA_HORSEMAN_EVENT:
m_auiEncounter[1] = data;
encounter[1] = data;
if (data == DONE)
{
for (std::set<uint64>::const_iterator itr = HorsemanAdds.begin(); itr != HorsemanAdds.end(); ++itr)
@@ -146,13 +149,12 @@ public:
uint32 GetData(uint32 type)
{
if (type == TYPE_MOGRAINE_AND_WHITE_EVENT)
return m_auiEncounter[0];
return encounter[0];
if (type == DATA_HORSEMAN_EVENT)
return m_auiEncounter[1];
return encounter[1];
return 0;
}
};
};
void AddSC_instance_scarlet_monastery()
@@ -19,14 +19,17 @@
#ifndef DEF_SCARLET_M
#define DEF_SCARLET_M
#define TYPE_MOGRAINE_AND_WHITE_EVENT 1
#define DATA_MOGRAINE 2
#define DATA_WHITEMANE 3
#define DATA_DOOR_WHITEMANE 4
enum eEnums
{
TYPE_MOGRAINE_AND_WHITE_EVENT = 1,
#define DATA_HORSEMAN_EVENT 5
#define GAMEOBJECT_PUMPKIN_SHRINE 6
DATA_MOGRAINE = 2,
DATA_WHITEMANE = 3,
DATA_DOOR_WHITEMANE = 4,
#define DATA_VORREL 7
DATA_HORSEMAN_EVENT = 5,
GAMEOBJECT_PUMPKIN_SHRINE = 6,
DATA_VORREL = 7
};
#endif
@@ -325,7 +325,7 @@ class boss_akilzon : public CreatureScript
if (target)
{
target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
target->SendMonsterMove(x, y, me->GetPositionZ()+15, 0);
target->MonsterMoveWithSpeed(x, y, me->GetPositionZ()+15, 0);
}
Unit* Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000);
if (Cloud)
@@ -36,16 +36,16 @@ EndContentData */
enum eEnums
{
SAY_PROGRESS_1 = -1000264,
SAY_PROGRESS_2 = -1000265,
SAY_PROGRESS_3 = -1000266,
EMOTE_PROGRESS_4 = -1000267,
SAY_AGGRO = -1000268,
SAY_PROGRESS_5 = -1000269,
SAY_PROGRESS_6 = -1000270,
SAY_PROGRESS_7 = -1000271,
EMOTE_PROGRESS_8 = -1000272,
SAY_PROGRESS_9 = -1000273,
SAY_PROGRESS_1 = 0,
SAY_PROGRESS_2 = 1,
SAY_PROGRESS_3 = 2,
EMOTE_PROGRESS_4 = 3,
SAY_AGGRO = 4,
SAY_PROGRESS_5 = 5,
SAY_PROGRESS_6 = 6,
SAY_PROGRESS_7 = 7,
EMOTE_PROGRESS_8 = 8,
SAY_PROGRESS_9 = 9,
QUEST_SUNKEN_TREASURE = 665,
MOB_VENGEFUL_SURGE = 2776
@@ -73,24 +73,24 @@ class npc_professor_phizzlethorpe : public CreatureScript
switch (uiPointId)
{
case 4:DoScriptText(SAY_PROGRESS_2, me, player);break;
case 5:DoScriptText(SAY_PROGRESS_3, me, player);break;
case 8:DoScriptText(EMOTE_PROGRESS_4, me);break;
case 4:Talk(SAY_PROGRESS_2, player->GetGUID());break;
case 5:Talk(SAY_PROGRESS_3, player->GetGUID());break;
case 8:Talk(EMOTE_PROGRESS_4);break;
case 9:
{
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
break;
}
case 10:DoScriptText(SAY_PROGRESS_5, me, player);break;
case 10:Talk(SAY_PROGRESS_5, player->GetGUID());break;
case 11:
DoScriptText(SAY_PROGRESS_6, me, player);
Talk(SAY_PROGRESS_6, player->GetGUID());
SetRun();
break;
case 19:DoScriptText(SAY_PROGRESS_7, me, player); break;
case 19:Talk(SAY_PROGRESS_7, player->GetGUID()); break;
case 20:
DoScriptText(EMOTE_PROGRESS_8, me);
DoScriptText(SAY_PROGRESS_9, me, player);
Talk(EMOTE_PROGRESS_8);
Talk(SAY_PROGRESS_9, player->GetGUID());
if (player)
CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
break;
@@ -104,7 +104,7 @@ class npc_professor_phizzlethorpe : public CreatureScript
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
Talk(SAY_AGGRO);
}
void UpdateAI(const uint32 diff)
@@ -122,7 +122,7 @@ class npc_professor_phizzlethorpe : public CreatureScript
{
if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
{
DoScriptText(SAY_PROGRESS_1, creature, player);
creature->AI()->Talk(SAY_PROGRESS_1, player->GetGUID());
if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (creature->AI())))
pEscortAI->Start(false, false, player->GetGUID(), quest);
@@ -25,6 +25,14 @@ EndScriptData */
#include "ScriptPCH.h"
enum Yells
{
YELL_TWILIGHTCORRUPTOR_RESPAWN = 0,
YELL_TWILIGHTCORRUPTOR_AGGRO = 1,
YELL_TWILIGHTCORRUPTOR_KILL = 2,
};
/*######
# at_twilight_grove
######*/
@@ -43,11 +51,11 @@ public:
TCorrupter->setFaction(14);
TCorrupter->SetMaxHealth(832750);
}
if (Unit* CorrupterSpeaker = player->SummonCreature(1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()-1, 0, TEMPSUMMON_TIMED_DESPAWN, 15000))
if (Creature* CorrupterSpeaker = player->SummonCreature(1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()-1, 0, TEMPSUMMON_TIMED_DESPAWN, 15000))
{
CorrupterSpeaker->SetName("Twilight Corrupter");
CorrupterSpeaker->SetVisible(true);
CorrupterSpeaker->MonsterYell("Come, $N. See what the Nightmare brings...", 0, player->GetGUID());
CorrupterSpeaker->AI()->Talk(YELL_TWILIGHTCORRUPTOR_RESPAWN, player->GetGUID());
}
}
return false;
@@ -89,7 +97,7 @@ public:
}
void EnterCombat(Unit* /*who*/)
{
me->MonsterYell("The Nightmare cannot be stopped!", 0, me->GetGUID());
Talk(YELL_TWILIGHTCORRUPTOR_AGGRO);
}
void KilledUnit(Unit* victim)
@@ -97,7 +105,7 @@ public:
if (victim->GetTypeId() == TYPEID_PLAYER)
{
++KillCount;
me->MonsterTextEmote("Twilight Corrupter squeezes the last bit of life out of $N and swallows their soul.", victim->GetGUID(), true);
Talk(YELL_TWILIGHTCORRUPTOR_KILL, victim->GetGUID());
if (KillCount == 3)
{
@@ -69,10 +69,10 @@ enum eFaction
enum eSays
{
TEXT_SECOND_TRIAL_1 = -1000637,
TEXT_SECOND_TRIAL_2 = -1000638,
TEXT_SECOND_TRIAL_3 = -1000639,
TEXT_SECOND_TRIAL_4 = -1000640,
TEXT_SECOND_TRIAL_1 = 0,
TEXT_SECOND_TRIAL_2 = 1,
TEXT_SECOND_TRIAL_3 = 2,
TEXT_SECOND_TRIAL_4 = 3,
};
struct Locations
@@ -335,16 +335,16 @@ public:
switch (paladinPhase)
{
case 0:
DoScriptText(TEXT_SECOND_TRIAL_1, me);
Talk(TEXT_SECOND_TRIAL_1);
break;
case 1:
DoScriptText(TEXT_SECOND_TRIAL_2, me);
Talk(TEXT_SECOND_TRIAL_2);
break;
case 2:
DoScriptText(TEXT_SECOND_TRIAL_3, me);
Talk(TEXT_SECOND_TRIAL_3);
break;
case 3:
DoScriptText(TEXT_SECOND_TRIAL_4, me);
Talk(TEXT_SECOND_TRIAL_4);
break;
}
}
@@ -33,45 +33,6 @@ EndContentData */
#include "ScriptPCH.h"
#include "ScriptedEscortAI.h"
/*######
## npc_blood_knight_dawnstar
######*/
#define GOSSIP_H_BKD "Take Blood Knight Insignia"
class npc_blood_knight_dawnstar : public CreatureScript
{
public:
npc_blood_knight_dawnstar() : CreatureScript("npc_blood_knight_dawnstar") { }
bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction)
{
player->PlayerTalkClass->ClearMenus();
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
{
ItemPosCountVec dest;
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 24226, 1, NULL);
if (msg == EQUIP_ERR_OK)
{
player->StoreNewItem(dest, 24226, 1, true);
player->PlayerTalkClass->ClearMenus();
}
}
return true;
}
bool OnGossipHello(Player* player, Creature* creature)
{
if (player->GetQuestStatus(9692) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(24226, 1, true))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_BKD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
};
/*######
## npc_budd_nedreck
######*/
@@ -255,7 +216,6 @@ public:
void AddSC_ghostlands()
{
new npc_blood_knight_dawnstar();
new npc_budd_nedreck();
new npc_rathis_tomber();
new npc_ranger_lilatha();
@@ -19,12 +19,11 @@
/* ScriptData
SDName: Silverpine_Forest
SD%Complete: 100
SDComment: Quest support: 1886, 435, 452
SDComment: Quest support: 435, 452
SDCategory: Silverpine Forest
EndScriptData */
/* ContentData
npc_astor_hadren
npc_deathstalker_erland
pyrewood_ambush
EndContentData */
@@ -32,73 +31,6 @@ EndContentData */
#include "ScriptPCH.h"
#include "ScriptedEscortAI.h"
/*######
## npc_astor_hadren
######*/
#define GOSSIP_HAH "You're Astor Hadren, right?"
#define GOSSIP_SAH "You've got something I need, Astor. And I'll be taking it now."
class npc_astor_hadren : public CreatureScript
{
public:
npc_astor_hadren() : CreatureScript("npc_astor_hadren") { }
CreatureAI* GetAI(Creature* creature) const
{
return new npc_astor_hadrenAI(creature);
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
{
player->PlayerTalkClass->ClearMenus();
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF + 1:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SAH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
player->SEND_GOSSIP_MENU(624, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2:
player->CLOSE_GOSSIP_MENU();
creature->setFaction(21);
if (player)
CAST_AI(npc_astor_hadren::npc_astor_hadrenAI, creature->AI())->AttackStart(player);
break;
}
return true;
}
bool OnGossipHello(Player* player, Creature* creature)
{
if (player->GetQuestStatus(1886) == QUEST_STATUS_INCOMPLETE)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HAH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->SEND_GOSSIP_MENU(623, creature->GetGUID());
return true;
}
struct npc_astor_hadrenAI : public ScriptedAI
{
npc_astor_hadrenAI(Creature* c) : ScriptedAI(c) {}
void Reset()
{
me->setFaction(68);
}
void EnterCombat(Unit* /*who*/)
{
}
void JustDied(Unit* /*who*/)
{
me->setFaction(68);
}
};
};
/*######
## npc_deathstalker_erland
######*/
@@ -386,7 +318,6 @@ public:
void AddSC_silverpine_forest()
{
new npc_astor_hadren();
new npc_deathstalker_erland();
new pyrewood_ambush();
}
@@ -26,7 +26,6 @@ EndScriptData */
/* ContentData
npc_archmage_malin
npc_bartleby
npc_dashel_stonefist
npc_lady_katrana_prestor
npc_tyrion
npc_tyrion_spybot
@@ -147,78 +146,6 @@ public:
};
/*######
## npc_dashel_stonefist
######*/
enum eDashel
{
QUEST_MISSING_DIPLO_PT8 = 1447,
FACTION_HOSTILE = 168
};
class npc_dashel_stonefist : public CreatureScript
{
public:
npc_dashel_stonefist() : CreatureScript("npc_dashel_stonefist") { }
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT8)
{
creature->setFaction(FACTION_HOSTILE);
CAST_AI(npc_dashel_stonefist::npc_dashel_stonefistAI, creature->AI())->AttackStart(player);
}
return true;
}
CreatureAI* GetAI(Creature* creature) const
{
return new npc_dashel_stonefistAI(creature);
}
struct npc_dashel_stonefistAI : public ScriptedAI
{
npc_dashel_stonefistAI(Creature* c) : ScriptedAI(c)
{
m_uiNormalFaction = c->getFaction();
}
uint32 m_uiNormalFaction;
void Reset()
{
if (me->getFaction() != m_uiNormalFaction)
me->setFaction(m_uiNormalFaction);
}
void AttackedBy(Unit* pAttacker)
{
if (me->getVictim())
return;
if (me->IsFriendlyTo(pAttacker))
return;
AttackStart(pAttacker);
}
void DamageTaken(Unit* pDoneBy, uint32 &uiDamage)
{
if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(15, uiDamage))
{
uiDamage = 0;
if (pDoneBy->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(pDoneBy)->AreaExploredOrEventHappens(QUEST_MISSING_DIPLO_PT8);
EnterEvadeMode();
}
}
};
};
/*######
## npc_lady_katrana_prestor
######*/
@@ -716,7 +643,6 @@ void AddSC_stormwind_city()
{
new npc_archmage_malin();
new npc_bartleby();
new npc_dashel_stonefist();
new npc_lady_katrana_prestor();
new npc_tyrion();
new npc_tyrion_spybot();
@@ -109,7 +109,7 @@ public:
{
if (Creature* target = Unit::GetCreature(*summoned, targetGUID))
{
target->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0);
target->MonsterMoveWithSpeed(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0);
target->SetPosition(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0.0f);
summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false);
}
@@ -186,7 +186,7 @@ public:
if (EventMove_Timer <= diff)
{
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->SendMonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, 5000);
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetDistance(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW) / (5000 * 0.001f));
me->SetPosition(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation());
EventMove = false;
} else EventMove_Timer -= diff;
@@ -43,7 +43,6 @@ public:
player->AddAura(SPELL_BLESSING_OF_BLACKFATHOM, player);
return true;
}
};
class go_blackfathom_fire : public GameObjectScript
@@ -64,7 +63,6 @@ public:
}
return false;
}
};
class npc_blackfathom_deeps_event : public CreatureScript
@@ -92,9 +90,9 @@ public:
InstanceScript* instance;
uint32 uiRavageTimer;
uint32 uiFrostNovaTimer;
uint32 uiFrostBoltVolleyTimer;
uint32 ravageTimer;
uint32 frostNovaTimer;
uint32 frostBoltVolleyTimer;
bool bFlee;
@@ -102,9 +100,9 @@ public:
{
bFlee = false;
uiRavageTimer = urand(5000, 8000);
uiFrostNovaTimer = urand(9000, 12000);
uiFrostBoltVolleyTimer = urand(2000, 4000);
ravageTimer = urand(5000, 8000);
frostNovaTimer = urand(9000, 12000);
frostBoltVolleyTimer = urand(2000, 4000);
}
void AttackPlayer()
@@ -131,7 +129,7 @@ public:
}
}
void UpdateAI(const uint32 uiDiff)
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
@@ -140,11 +138,11 @@ public:
{
case NPC_AKU_MAI_SNAPJAW:
{
if (uiRavageTimer <= uiDiff)
if (ravageTimer <= diff)
{
DoCast(me->getVictim(), SPELL_RAVAGE);
uiRavageTimer = urand(9000, 14000);
} else uiRavageTimer -= uiDiff;
ravageTimer = urand(9000, 14000);
} else ravageTimer -= diff;
break;
}
case NPC_MURKSHALLOW_SOFTSHELL:
@@ -159,20 +157,23 @@ public:
}
case NPC_AKU_MAI_SERVANT:
{
if (uiFrostBoltVolleyTimer <= uiDiff)
if (frostBoltVolleyTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
if (target)
DoCast(target, SPELL_FROST_BOLT_VOLLEY);
}
uiFrostBoltVolleyTimer = urand(5000, 8000);
} else uiFrostBoltVolleyTimer -= uiDiff;
if (uiFrostNovaTimer <= uiDiff)
frostBoltVolleyTimer = urand(5000, 8000);
}
else frostBoltVolleyTimer -= diff;
if (frostNovaTimer <= diff)
{
DoCastAOE(SPELL_FROST_NOVA, false);
uiFrostNovaTimer = urand(25000, 30000);
} else uiFrostNovaTimer -= uiDiff;
frostNovaTimer = urand(25000, 30000);
}
else frostNovaTimer -= diff;
break;
}
}
@@ -187,7 +188,6 @@ public:
instance->SetData(DATA_EVENT, instance->GetData(DATA_EVENT) + 1);
}
};
};
enum eMorridune
@@ -201,12 +201,12 @@ class npc_morridune : public CreatureScript
public:
npc_morridune() : CreatureScript("npc_morridune") { }
bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction)
bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*Sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
switch (uiAction)
switch (action)
{
case GOSSIP_ACTION_INFO_DEF+1:
case GOSSIP_ACTION_INFO_DEF + 1:
player->TeleportTo(1, 9952.239f, 2284.277f, 1341.394f, 1.595f);
player->CLOSE_GOSSIP_MENU();
break;
@@ -216,7 +216,7 @@ public:
bool OnGossipHello(Player* player, Creature* creature)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MORRIDUNE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MORRIDUNE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
@@ -250,7 +250,6 @@ public:
}
}
};
};
void AddSC_blackfathom_deeps()
@@ -36,19 +36,19 @@ public:
struct boss_aku_maiAI : public ScriptedAI
{
boss_aku_maiAI(Creature* c) : ScriptedAI(c)
boss_aku_maiAI(Creature* creature) : ScriptedAI(creature)
{
instance = c->GetInstanceScript();
instance = creature->GetInstanceScript();
}
uint32 uiPoisonCloudTimer;
uint32 poisonCloudTimer;
bool bIsEnraged;
InstanceScript* instance;
void Reset()
{
uiPoisonCloudTimer = urand(5000, 9000);
poisonCloudTimer = urand(5000, 9000);
bIsEnraged = false;
if (instance)
instance->SetData(TYPE_AKU_MAI, NOT_STARTED);
@@ -71,11 +71,11 @@ public:
if (!UpdateVictim())
return;
if (uiPoisonCloudTimer < diff)
if (poisonCloudTimer < diff)
{
DoCastVictim(SPELL_POISON_CLOUD);
uiPoisonCloudTimer = urand(25000, 50000);
} else uiPoisonCloudTimer -= diff;
poisonCloudTimer = urand(25000, 50000);
} else poisonCloudTimer -= diff;
if (!bIsEnraged && HealthBelowPct(30))
{
@@ -86,7 +86,6 @@ public:
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_aku_mai()
@@ -35,18 +35,18 @@ public:
struct boss_gelihastAI : public ScriptedAI
{
boss_gelihastAI(Creature* c) : ScriptedAI(c)
boss_gelihastAI(Creature* creature) : ScriptedAI(creature)
{
instance = c->GetInstanceScript();
instance = creature->GetInstanceScript();
}
uint32 uiNetTimer;
uint32 netTimer;
InstanceScript* instance;
void Reset()
{
uiNetTimer = urand(2000, 4000);
netTimer = urand(2000, 4000);
if (instance)
instance->SetData(TYPE_GELIHAST, NOT_STARTED);
}
@@ -68,16 +68,15 @@ public:
if (!UpdateVictim())
return;
if (uiNetTimer < diff)
if (netTimer < diff)
{
DoCastVictim(SPELL_NET);
uiNetTimer = urand(4000, 7000);
} else uiNetTimer -= diff;
netTimer = urand(4000, 7000);
} else netTimer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_gelihast()
@@ -44,20 +44,20 @@ public:
struct boss_kelrisAI : public ScriptedAI
{
boss_kelrisAI(Creature* c) : ScriptedAI(c)
boss_kelrisAI(Creature* creature) : ScriptedAI(creature)
{
instance = c->GetInstanceScript();
instance = creature->GetInstanceScript();
}
uint32 uiMindBlastTimer;
uint32 uiSleepTimer;
uint32 mindBlastTimer;
uint32 sleepTimer;
InstanceScript* instance;
void Reset()
{
uiMindBlastTimer = urand(2000, 5000);
uiSleepTimer = urand(9000, 12000);
mindBlastTimer = urand(2000, 5000);
sleepTimer = urand(9000, 12000);
if (instance)
instance->SetData(TYPE_KELRIS, NOT_STARTED);
}
@@ -81,26 +81,25 @@ public:
if (!UpdateVictim())
return;
if (uiMindBlastTimer < diff)
if (mindBlastTimer < diff)
{
DoCastVictim(SPELL_MIND_BLAST);
uiMindBlastTimer = urand(7000, 9000);
} else uiMindBlastTimer -= diff;
mindBlastTimer = urand(7000, 9000);
} else mindBlastTimer -= diff;
if (uiSleepTimer < diff)
if (sleepTimer < diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoScriptText(SAY_SLEEP, me);
DoCast(target, SPELL_SLEEP);
}
uiSleepTimer = urand(15000, 20000);
} else uiSleepTimer -= diff;
sleepTimer = urand(15000, 20000);
} else sleepTimer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_kelris()
@@ -65,33 +65,33 @@ public:
{
instance_blackfathom_deeps_InstanceMapScript(Map* map) : InstanceScript(map) {}
uint64 m_uiTwilightLordKelrisGUID;
uint64 m_uiShrine1GUID;
uint64 m_uiShrine2GUID;
uint64 m_uiShrine3GUID;
uint64 m_uiShrine4GUID;
uint64 m_uiShrineOfGelihastGUID;
uint64 m_uiAltarOfTheDeepsGUID;
uint64 m_uiMainDoorGUID;
uint64 twilightLordKelrisGUID;
uint64 shrine1GUID;
uint64 shrine2GUID;
uint64 shrine3GUID;
uint64 shrine4GUID;
uint64 shrineOfGelihastGUID;
uint64 altarOfTheDeepsGUID;
uint64 mainDoorGUID;
uint8 m_auiEncounter[MAX_ENCOUNTER];
uint8 m_uiCountFires;
uint8 uiDeathTimes;
uint8 encounter[MAX_ENCOUNTER];
uint8 countFires;
uint8 deathTimes;
void Initialize()
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
memset(&encounter, 0, sizeof(encounter));
m_uiTwilightLordKelrisGUID = 0;
m_uiShrine1GUID = 0;
m_uiShrine2GUID = 0;
m_uiShrine3GUID = 0;
m_uiShrine4GUID = 0;
m_uiShrineOfGelihastGUID = 0;
m_uiAltarOfTheDeepsGUID = 0;
m_uiMainDoorGUID = 0;
m_uiCountFires = 0;
uiDeathTimes = 0;
twilightLordKelrisGUID = 0;
shrine1GUID = 0;
shrine2GUID = 0;
shrine3GUID = 0;
shrine4GUID = 0;
shrineOfGelihastGUID = 0;
altarOfTheDeepsGUID = 0;
mainDoorGUID = 0;
countFires = 0;
deathTimes = 0;
}
void OnCreatureCreate(Creature* creature)
@@ -99,7 +99,7 @@ public:
switch (creature->GetEntry())
{
case NPC_TWILIGHT_LORD_KELRIS:
m_uiTwilightLordKelrisGUID = creature->GetGUID();
twilightLordKelrisGUID = creature->GetGUID();
break;
case NPC_LORGUS_JETT:
creature->SetHomePosition(LorgusPosition[urand(0, 3)]);
@@ -112,150 +112,149 @@ public:
switch (go->GetEntry())
{
case GO_FIRE_OF_AKU_MAI_1:
m_uiShrine1GUID = go->GetGUID();
shrine1GUID = go->GetGUID();
break;
case GO_FIRE_OF_AKU_MAI_2:
m_uiShrine2GUID = go->GetGUID();
shrine2GUID = go->GetGUID();
break;
case GO_FIRE_OF_AKU_MAI_3:
m_uiShrine3GUID = go->GetGUID();
shrine3GUID = go->GetGUID();
break;
case GO_FIRE_OF_AKU_MAI_4:
m_uiShrine4GUID = go->GetGUID();
shrine4GUID = go->GetGUID();
break;
case GO_SHRINE_OF_GELIHAST:
m_uiShrineOfGelihastGUID = go->GetGUID();
if (m_auiEncounter[0] != DONE)
shrineOfGelihastGUID = go->GetGUID();
if (encounter[0] != DONE)
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
break;
case GO_ALTAR_OF_THE_DEEPS:
m_uiAltarOfTheDeepsGUID = go->GetGUID();
if (m_auiEncounter[3] != DONE)
altarOfTheDeepsGUID = go->GetGUID();
if (encounter[3] != DONE)
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
break;
case GO_AKU_MAI_DOOR:
if (m_auiEncounter[2] == DONE)
if (encounter[2] == DONE)
HandleGameObject(0, true, go);
m_uiMainDoorGUID = go->GetGUID();
mainDoorGUID = go->GetGUID();
break;
}
}
void SetData(uint32 uiType, uint32 uiData)
void SetData(uint32 type, uint32 data)
{
switch (uiType)
switch (type)
{
case TYPE_GELIHAST:
m_auiEncounter[0] = uiData;
if (uiData == DONE)
if (GameObject* go = instance->GetGameObject(m_uiShrineOfGelihastGUID))
encounter[0] = data;
if (data == DONE)
if (GameObject* go = instance->GetGameObject(shrineOfGelihastGUID))
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
break;
case TYPE_AKU_MAI:
m_auiEncounter[3] = uiData;
if (uiData == DONE)
if (GameObject* go = instance->GetGameObject(m_uiAltarOfTheDeepsGUID))
encounter[3] = data;
if (data == DONE)
if (GameObject* go = instance->GetGameObject(altarOfTheDeepsGUID))
{
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
go->SummonCreature(NPC_MORRIDUNE, SpawnsLocation[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
case DATA_FIRE:
m_uiCountFires = uiData;
switch (m_uiCountFires)
countFires = data;
switch (countFires)
{
case 1:
if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID))
if (GameObject* go = instance->GetGameObject(shrine1GUID))
{
pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_AKU_MAI_SNAPJAW, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
case 2:
if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID))
if (GameObject* go = instance->GetGameObject(shrine1GUID))
{
for (uint8 i = 0; i < 2; ++i)
{
pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_MURKSHALLOW_SOFTSHELL, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
}
break;
case 3:
if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID))
if (GameObject* go = instance->GetGameObject(shrine1GUID))
{
pGO->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_AKU_MAI_SERVANT, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
case 4:
if (GameObject* pGO = instance->GetGameObject(m_uiShrine1GUID))
if (GameObject* go = instance->GetGameObject(shrine1GUID))
{
pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
pGO->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
go->SummonCreature(NPC_BARBED_CRUSTACEAN, SpawnsLocation[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
}
break;
}
break;
case DATA_EVENT:
uiDeathTimes = uiData;
if (uiDeathTimes == 18)
HandleGameObject(m_uiMainDoorGUID, true);
deathTimes = data;
if (deathTimes == 18)
HandleGameObject(mainDoorGUID, true);
break;
}
}
uint32 GetData(uint32 uiType)
uint32 GetData(uint32 type)
{
switch (uiType)
switch (type)
{
case TYPE_GELIHAST:
return m_auiEncounter[0];
return encounter[0];
case TYPE_KELRIS:
return m_auiEncounter[1];
return encounter[1];
case TYPE_SHRINE:
return m_auiEncounter[2];
return encounter[2];
case TYPE_AKU_MAI:
return m_auiEncounter[3];
return encounter[3];
case DATA_FIRE:
return m_uiCountFires;
return countFires;
case DATA_EVENT:
return uiDeathTimes;
return deathTimes;
}
return 0;
}
uint64 GetData64(uint32 uiData)
uint64 GetData64(uint32 data)
{
switch (uiData)
switch (data)
{
case DATA_TWILIGHT_LORD_KELRIS:
return m_uiTwilightLordKelrisGUID;
return twilightLordKelrisGUID;
case DATA_SHRINE1:
return m_uiShrine1GUID;
return shrine1GUID;
case DATA_SHRINE2:
return m_uiShrine2GUID;
return shrine2GUID;
case DATA_SHRINE3:
return m_uiShrine3GUID;
return shrine3GUID;
case DATA_SHRINE4:
return m_uiShrine4GUID;
return shrine4GUID;
case DATA_SHRINE_OF_GELIHAST:
return m_uiShrineOfGelihastGUID;
return shrineOfGelihastGUID;
case DATA_MAINDOOR:
return m_uiMainDoorGUID;
return mainDoorGUID;
}
return 0;
}
};
};
void AddSC_instance_blackfathom_deeps()
@@ -234,53 +234,53 @@ public:
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
npc_arthasAI* pAI = CAST_AI(npc_arthas::npc_arthasAI, creature->AI());
npc_arthasAI* ai = CAST_AI(npc_arthas::npc_arthasAI, creature->AI());
if (!pAI)
if (!ai)
return false;
switch (action)
{
case GOSSIP_ACTION_INFO_DEF:
pAI->Start(true, true, player->GetGUID(), 0, false, false);
pAI->SetDespawnAtEnd(false);
pAI->bStepping = false;
pAI->uiStep = 1;
ai->Start(true, true, player->GetGUID(), 0, false, false);
ai->SetDespawnAtEnd(false);
ai->bStepping = false;
ai->uiStep = 1;
break;
case GOSSIP_ACTION_INFO_DEF+1:
pAI->bStepping = true;
pAI->uiStep = 24;
ai->bStepping = true;
ai->uiStep = 24;
break;
case GOSSIP_ACTION_INFO_DEF+2:
pAI->SetHoldState(false);
pAI->bStepping = false;
pAI->uiStep = 61;
ai->SetHoldState(false);
ai->bStepping = false;
ai->uiStep = 61;
break;
case GOSSIP_ACTION_INFO_DEF+3:
pAI->SetHoldState(false);
ai->SetHoldState(false);
break;
case GOSSIP_ACTION_INFO_DEF+4:
pAI->bStepping = true;
pAI->uiStep = 84;
ai->bStepping = true;
ai->uiStep = 84;
break;
case GOSSIP_ACTION_INFO_DEF+5:
pAI->bStepping = true;
pAI->uiStep = 85;
ai->bStepping = true;
ai->uiStep = 85;
break;
}
player->CLOSE_GOSSIP_MENU();
pAI->SetDespawnAtFar(true);
ai->SetDespawnAtFar(true);
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
return true;
}
bool OnGossipHello(Player* player, Creature* creature)
{
npc_arthasAI* pAI = CAST_AI(npc_arthas::npc_arthasAI, creature->AI());
npc_arthasAI* ai = CAST_AI(npc_arthas::npc_arthasAI, creature->AI());
if (pAI && pAI->bStepping == false)
if (ai && ai->bStepping == false)
{
switch (pAI->uiGossipStep)
switch (ai->uiGossipStep)
{
case 0: //This one is a workaround since the very beggining of the script is wrong.
{
@@ -25,9 +25,12 @@ EndScriptData */
#include "ScriptPCH.h"
#define SPELL_WRATH 21807
#define SPELL_ENTANGLINGROOTS 12747
#define SPELL_CORRUPT_FORCES 21968
enum Spells
{
SPELL_WRATH = 21807,
SPELL_ENTANGLINGROOTS = 12747,
SPELL_CORRUPT_FORCES = 21968
};
class celebras_the_cursed : public CreatureScript
{
@@ -41,7 +44,7 @@ public:
struct celebras_the_cursedAI : public ScriptedAI
{
celebras_the_cursedAI(Creature* c) : ScriptedAI(c) {}
celebras_the_cursedAI(Creature* creature) : ScriptedAI(creature) {}
uint32 Wrath_Timer;
uint32 EntanglingRoots_Timer;
@@ -74,14 +77,16 @@ public:
if (target)
DoCast(target, SPELL_WRATH);
Wrath_Timer = 8000;
} else Wrath_Timer -= diff;
}
else Wrath_Timer -= diff;
//EntanglingRoots
if (EntanglingRoots_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_ENTANGLINGROOTS);
EntanglingRoots_Timer = 20000;
} else EntanglingRoots_Timer -= diff;
}
else EntanglingRoots_Timer -= diff;
//CorruptForces
if (CorruptForces_Timer <= diff)
@@ -89,12 +94,12 @@ public:
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_CORRUPT_FORCES);
CorruptForces_Timer = 20000;
} else CorruptForces_Timer -= diff;
}
else CorruptForces_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_celebras_the_cursed()
@@ -25,9 +25,12 @@ EndScriptData */
#include "ScriptPCH.h"
#define SPELL_KNOCKAWAY 18670
#define SPELL_TRAMPLE 5568
#define SPELL_LANDSLIDE 21808
enum Spells
{
SPELL_KNOCKAWAY = 18670,
SPELL_TRAMPLE = 5568,
SPELL_LANDSLIDE = 21808
};
class boss_landslide : public CreatureScript
{
@@ -41,7 +44,7 @@ public:
struct boss_landslideAI : public ScriptedAI
{
boss_landslideAI(Creature* c) : ScriptedAI(c) {}
boss_landslideAI(Creature* creature) : ScriptedAI(creature) {}
uint32 KnockAway_Timer;
uint32 Trample_Timer;
@@ -68,14 +71,16 @@ public:
{
DoCast(me->getVictim(), SPELL_KNOCKAWAY);
KnockAway_Timer = 15000;
} else KnockAway_Timer -= diff;
}
else KnockAway_Timer -= diff;
//Trample_Timer
if (Trample_Timer <= diff)
{
DoCast(me, SPELL_TRAMPLE);
Trample_Timer = 8000;
} else Trample_Timer -= diff;
}
else Trample_Timer -= diff;
//Landslide
if (HealthBelowPct(50))
@@ -85,13 +90,13 @@ public:
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_LANDSLIDE);
Landslide_Timer = 60000;
} else Landslide_Timer -= diff;
}
else Landslide_Timer -= diff;
}
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_landslide()
@@ -24,9 +24,11 @@ SDCategory: Maraudon
EndScriptData */
#include "ScriptPCH.h"
#define SPELL_TOXICVOLLEY 21687
#define SPELL_UPPERCUT 22916
enum Spells
{
SPELL_TOXICVOLLEY = 21687,
SPELL_UPPERCUT = 22916
};
class boss_noxxion : public CreatureScript
{
@@ -40,7 +42,7 @@ public:
struct boss_noxxionAI : public ScriptedAI
{
boss_noxxionAI(Creature* c) : ScriptedAI(c) {}
boss_noxxionAI(Creature* creature) : ScriptedAI(creature) {}
uint32 ToxicVolley_Timer;
uint32 Uppercut_Timer;
@@ -78,7 +80,8 @@ public:
me->SetDisplayId(11172);
Invisible = false;
//me->m_canMove = true;
} else if (Invisible)
}
else if (Invisible)
{
Invisible_Timer -= diff;
//Do nothing while invisible
@@ -94,14 +97,16 @@ public:
{
DoCast(me->getVictim(), SPELL_TOXICVOLLEY);
ToxicVolley_Timer = 9000;
} else ToxicVolley_Timer -= diff;
}
else ToxicVolley_Timer -= diff;
//Uppercut_Timer
if (Uppercut_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_UPPERCUT);
Uppercut_Timer = 12000;
} else Uppercut_Timer -= diff;
}
else Uppercut_Timer -= diff;
//Adds_Timer
if (!Invisible && Adds_Timer <= diff)
@@ -122,12 +127,12 @@ public:
Invisible_Timer = 15000;
Adds_Timer = 40000;
} else Adds_Timer -= diff;
}
else Adds_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_noxxion()
@@ -25,10 +25,13 @@ EndScriptData */
#include "ScriptPCH.h"
#define SPELL_DUSTFIELD 21909
#define SPELL_BOULDER 21832
#define SPELL_THRASH 3391
#define SPELL_REPULSIVEGAZE 21869
enum Spells
{
SPELL_DUSTFIELD = 21909,
SPELL_BOULDER = 21832,
SPELL_THRASH = 3391,
SPELL_REPULSIVEGAZE = 21869
};
class boss_princess_theradras : public CreatureScript
{
@@ -42,7 +45,7 @@ public:
struct boss_ptheradrasAI : public ScriptedAI
{
boss_ptheradrasAI(Creature* c) : ScriptedAI(c) {}
boss_ptheradrasAI(Creature* creature) : ScriptedAI(creature) {}
uint32 Dustfield_Timer;
uint32 Boulder_Timer;
@@ -57,9 +60,7 @@ public:
RepulsiveGaze_Timer = 23000;
}
void EnterCombat(Unit* /*who*/)
{
}
void EnterCombat(Unit* /*who*/) {}
void JustDied(Unit* /*killer*/)
{
@@ -76,7 +77,8 @@ public:
{
DoCast(me, SPELL_DUSTFIELD);
Dustfield_Timer = 14000;
} else Dustfield_Timer -= diff;
}
else Dustfield_Timer -= diff;
//Boulder_Timer
if (Boulder_Timer <= diff)
@@ -86,26 +88,28 @@ public:
if (target)
DoCast(target, SPELL_BOULDER);
Boulder_Timer = 10000;
} else Boulder_Timer -= diff;
}
else Boulder_Timer -= diff;
//RepulsiveGaze_Timer
if (RepulsiveGaze_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_REPULSIVEGAZE);
RepulsiveGaze_Timer = 20000;
} else RepulsiveGaze_Timer -= diff;
}
else RepulsiveGaze_Timer -= diff;
//Thrash_Timer
if (Thrash_Timer <= diff)
{
DoCast(me, SPELL_THRASH);
Thrash_Timer = 18000;
} else Thrash_Timer -= diff;
}
else Thrash_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_ptheradras()
+27 -19
View File
@@ -35,34 +35,42 @@ EndContentData */
# npc_torek
####*/
#define SAY_READY -1000106
#define SAY_MOVE -1000107
#define SAY_PREPARE -1000108
#define SAY_WIN -1000109
#define SAY_END -1000110
enum TorekSays
{
SAY_READY = 0,
SAY_MOVE = 1,
SAY_PREPARE = 2,
SAY_WIN = 3,
SAY_END = 4,
};
#define SPELL_REND 11977
#define SPELL_THUNDERCLAP 8078
enum TorekSpells
{
SPELL_REND = 11977,
SPELL_THUNDERCLAP = 8078,
};
#define QUEST_TOREK_ASSULT 6544
enum TorekMisc
{
QUEST_TOREK_ASSULT = 6544,
#define ENTRY_SPLINTERTREE_RAIDER 12859
#define ENTRY_DURIEL 12860
#define ENTRY_SILVERWING_SENTINEL 12896
#define ENTRY_SILVERWING_WARRIOR 12897
ENTRY_SPLINTERTREE_RAIDER = 12859,
ENTRY_DURIEL = 12860,
ENTRY_SILVERWING_SENTINEL = 12896,
ENTRY_SILVERWING_WARRIOR = 12897,
};
class npc_torek : public CreatureScript
{
public:
npc_torek()
: CreatureScript("npc_torek")
npc_torek() : CreatureScript("npc_torek")
{
}
struct npc_torekAI : public npc_escortAI
{
npc_torekAI(Creature* c) : npc_escortAI(c) {}
npc_torekAI(Creature* creature) : npc_escortAI(creature) {}
uint32 Rend_Timer;
uint32 Thunderclap_Timer;
@@ -78,10 +86,10 @@ class npc_torek : public CreatureScript
switch (i)
{
case 1:
DoScriptText(SAY_MOVE, me, player);
Talk(SAY_MOVE, player->GetGUID());
break;
case 8:
DoScriptText(SAY_PREPARE, me, player);
Talk(SAY_PREPARE, player->GetGUID());
break;
case 19:
//TODO: verify location and creatures amount.
@@ -96,7 +104,7 @@ class npc_torek : public CreatureScript
player->GroupEventHappens(QUEST_TOREK_ASSULT, me);
break;
case 21:
DoScriptText(SAY_END, me, player);
Talk(SAY_END, player->GetGUID());
break;
}
}
@@ -148,7 +156,7 @@ class npc_torek : public CreatureScript
if (quest->GetQuestId() == QUEST_TOREK_ASSULT)
{
//TODO: find companions, make them follow Torek, at any time (possibly done by core/database in future?)
DoScriptText(SAY_READY, creature, player);
creature->AI()->Talk(SAY_READY, player->GetGUID());
creature->setFaction(113);
if (npc_escortAI* pEscortAI = CAST_AI(npc_torekAI, creature->AI()))
+145 -1
View File
@@ -573,9 +573,151 @@ public:
};
/*####
#
# npc_omen
####*/
enum Omen
{
NPC_OMEN = 15467,
SPELL_OMEN_CLEAVE = 15284,
SPELL_OMEN_STARFALL = 26540,
SPELL_OMEN_SUMMON_SPOTLIGHT = 26392,
SPELL_ELUNE_CANDLE = 26374,
GO_ELUNE_TRAP_1 = 180876,
GO_ELUNE_TRAP_2 = 180877,
EVENT_CAST_CLEAVE = 1,
EVENT_CAST_STARFALL = 2,
EVENT_DESPAWN = 3,
};
class npc_omen : public CreatureScript
{
public:
npc_omen() : CreatureScript("npc_omen") { }
struct npc_omenAI : public ScriptedAI
{
npc_omenAI(Creature* creature) : ScriptedAI(creature)
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->GetMotionMaster()->MovePoint(1, 7549.977f, -2855.137f, 456.9678f);
}
EventMap events;
void MovementInform(uint32 type, uint32 pointId)
{
if (type != POINT_MOTION_TYPE)
return;
if (pointId == 1)
{
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
if (Player* player = me->SelectNearestPlayer(40.0f))
AttackStart(player);
}
}
void EnterCombat(Unit* /*attacker*/)
{
events.Reset();
events.ScheduleEvent(EVENT_CAST_CLEAVE, urand(3000, 5000));
events.ScheduleEvent(EVENT_CAST_STARFALL, urand(8000, 10000));
}
void JustDied(Unit* /*killer*/)
{
DoCast(SPELL_OMEN_SUMMON_SPOTLIGHT);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
{
if (spell->Id == SPELL_ELUNE_CANDLE)
{
if (me->HasAura(SPELL_OMEN_STARFALL))
me->RemoveAurasDueToSpell(SPELL_OMEN_STARFALL);
events.RescheduleEvent(EVENT_CAST_STARFALL, urand(14000, 16000));
}
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
switch (events.ExecuteEvent())
{
case EVENT_CAST_CLEAVE:
DoCastVictim(SPELL_OMEN_CLEAVE);
events.ScheduleEvent(EVENT_CAST_CLEAVE, urand(8000, 10000));
break;
case EVENT_CAST_STARFALL:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_OMEN_STARFALL);
events.ScheduleEvent(EVENT_CAST_STARFALL, urand(14000, 16000));
break;
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_omenAI(creature);
}
};
class npc_giant_spotlight : public CreatureScript
{
public:
npc_giant_spotlight() : CreatureScript("npc_giant_spotlight") { }
struct npc_giant_spotlightAI : public ScriptedAI
{
npc_giant_spotlightAI(Creature* creature) : ScriptedAI(creature) {}
EventMap events;
void Reset()
{
events.Reset();
events.ScheduleEvent(EVENT_DESPAWN, 5*MINUTE*IN_MILLISECONDS);
}
void UpdateAI(const uint32 diff)
{
events.Update(diff);
if (events.ExecuteEvent() == EVENT_DESPAWN)
{
if (GameObject* trap = me->FindNearestGameObject(GO_ELUNE_TRAP_1, 5.0f))
trap->RemoveFromWorld();
if (GameObject* trap = me->FindNearestGameObject(GO_ELUNE_TRAP_2, 5.0f))
trap->RemoveFromWorld();
if (Creature* omen = me->FindNearestCreature(NPC_OMEN, 5.0f, false))
omen->DespawnOrUnsummon();
me->DespawnOrUnsummon();
}
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_giant_spotlightAI(creature);
}
};
void AddSC_moonglade()
{
new npc_bunthen_plainswind();
@@ -583,4 +725,6 @@ void AddSC_moonglade()
new npc_silva_filnaveth();
new npc_clintar_dreamwalker();
new npc_clintar_spirit();
new npc_omen();
new npc_giant_spotlight();
}
@@ -122,6 +122,11 @@ const Position SphereSpawn[6] =
{ 706.6383f, 161.5266f, 155.6701f, 0 },
};
enum MovementPoints
{
POINT_FALL_GROUND = 1
};
class boss_anubarak_trial : public CreatureScript
{
public:
@@ -553,82 +558,68 @@ public:
class mob_frost_sphere : public CreatureScript
{
public:
mob_frost_sphere() : CreatureScript("mob_frost_sphere") { }
public:
mob_frost_sphere() : CreatureScript("mob_frost_sphere") { }
CreatureAI* GetAI(Creature* creature) const
{
return new mob_frost_sphereAI(creature);
};
struct mob_frost_sphereAI : public ScriptedAI
{
mob_frost_sphereAI(Creature* creature) : ScriptedAI(creature)
struct mob_frost_sphereAI : public ScriptedAI
{
}
bool m_bFall;
uint32 m_uiPermafrostTimer;
void Reset()
{
m_bFall = false;
m_uiPermafrostTimer = 0;
me->SetReactState(REACT_PASSIVE);
me->SetFlying(true);
me->SetDisplayId(25144);
me->SetSpeed(MOVE_RUN, 0.5f, false);
me->GetMotionMaster()->MoveRandom(20.0f);
DoCast(SPELL_FROST_SPHERE);
}
void DamageTaken(Unit* /*who*/, uint32& uiDamage)
{
if (me->GetHealth() < uiDamage)
mob_frost_sphereAI(Creature* creature) : ScriptedAI(creature)
{
uiDamage = 0;
if (!m_bFall)
}
void Reset()
{
_isFalling = false;
me->SetReactState(REACT_PASSIVE);
me->SetFlying(true);
me->SetDisplayId(me->GetCreatureInfo()->Modelid2);
me->SetSpeed(MOVE_RUN, 0.5f, false);
me->GetMotionMaster()->MoveRandom(20.0f);
DoCast(SPELL_FROST_SPHERE);
}
void DamageTaken(Unit* /*who*/, uint32& damage)
{
if (me->GetHealth() <= damage)
{
m_bFall = true;
me->SetFlying(false);
me->GetMotionMaster()->MoveIdle();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
//At hit the ground
me->GetMotionMaster()->MoveFall(142.2f, 0);
//me->FallGround(); //need correct vmap use (i believe it isn't working properly right now)
damage = 0;
if (!_isFalling)
{
_isFalling = true;
me->GetMotionMaster()->MoveIdle();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
//At hit the ground
me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH);
me->GetMotionMaster()->MoveFall(POINT_FALL_GROUND);
}
}
}
}
void MovementInform(uint32 uiType, uint32 uiId)
{
if (uiType != POINT_MOTION_TYPE) return;
switch (uiId)
void MovementInform(uint32 type, uint32 pointId)
{
case 0:
m_uiPermafrostTimer = IN_MILLISECONDS;
break;
}
}
if (type != EFFECT_MOTION_TYPE)
return;
void UpdateAI(const uint32 uiDiff)
{
if (m_uiPermafrostTimer)
{
if (m_uiPermafrostTimer <= uiDiff)
switch (pointId)
{
m_uiPermafrostTimer = 0;
me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE);
me->SetDisplayId(11686);
me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f);
DoCast(SPELL_PERMAFROST_VISUAL);
DoCast(SPELL_PERMAFROST);
} else m_uiPermafrostTimer -= uiDiff;
case POINT_FALL_GROUND:
me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE);
me->SetDisplayId(me->GetCreatureInfo()->Modelid1);
DoCast(SPELL_PERMAFROST_VISUAL);
DoCast(SPELL_PERMAFROST);
me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f);
break;
}
}
}
};
private:
bool _isFalling;
};
CreatureAI* GetAI(Creature* creature) const
{
return new mob_frost_sphereAI(creature);
};
};
class mob_anubarak_spike : public CreatureScript
@@ -67,6 +67,7 @@ class boss_bronjahm : public CreatureScript
{
boss_bronjahmAI(Creature* creature) : BossAI(creature, DATA_BRONJAHM)
{
DoCast(me, SPELL_SOULSTORM_CHANNEL, true);
}
void InitializeAI()
@@ -82,14 +83,17 @@ class boss_bronjahm : public CreatureScript
events.Reset();
events.SetPhase(PHASE_1);
events.ScheduleEvent(EVENT_SHADOW_BOLT, 2000);
events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 15000));
events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 20000));
events.ScheduleEvent(EVENT_CORRUPT_SOUL, urand(25000, 35000), 0, PHASE_1);
me->CastSpell(me, SPELL_SOULSTORM_CHANNEL, true);
instance->SetBossState(DATA_BRONJAHM, NOT_STARTED);
}
void JustReachedHome()
{
DoCast(me, SPELL_SOULSTORM_CHANNEL, true);
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
@@ -118,7 +122,7 @@ class boss_bronjahm : public CreatureScript
events.SetPhase(PHASE_2);
DoCast(me, SPELL_TELEPORT);
events.ScheduleEvent(EVENT_FEAR, urand(12000, 16000), 0, PHASE_2);
events.ScheduleEvent(EVENT_SOULSTORM, 700, 0, PHASE_2);
events.ScheduleEvent(EVENT_SOULSTORM, 100, 0, PHASE_2);
}
}
@@ -147,7 +151,7 @@ class boss_bronjahm : public CreatureScript
{
case EVENT_MAGIC_BANE:
DoCastVictim(SPELL_MAGIC_S_BANE);
events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 15000));
events.ScheduleEvent(EVENT_MAGIC_BANE, urand(8000, 20000));
break;
case EVENT_SHADOW_BOLT:
if (!me->IsWithinMeleeRange(me->getVictim()))
@@ -201,7 +205,7 @@ class mob_corrupted_soul_fragment : public CreatureScript
void MovementInform(uint32 type, uint32 id)
{
if (type != TARGETED_MOTION_TYPE)
if (type != CHASE_MOTION_TYPE)
return;
if (instance)
@@ -306,6 +306,7 @@ class boss_devourer_of_souls : public CreatureScript
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
me->SetOrientation(me->GetAngle(target));
me->SendMovementFlagUpdate();
DoCast(me, SPELL_WAILING_SOULS_BEAM);
}
@@ -332,6 +333,7 @@ class boss_devourer_of_souls : public CreatureScript
case EVENT_WAILING_SOULS_TICK:
beamAngle += beamAngleDiff;
me->SetOrientation(beamAngle);
me->SendMovementFlagUpdate();
me->StopMoving();
DoCast(me, SPELL_WAILING_SOULS);
@@ -1159,7 +1159,7 @@ class npc_ball_of_flame : public CreatureScript
void MovementInform(uint32 type, uint32 id)
{
if (type == TARGETED_MOTION_TYPE && id == GUID_LOPART(_chaseGUID) && _chaseGUID)
if (type == CHASE_MOTION_TYPE && id == GUID_LOPART(_chaseGUID) && _chaseGUID)
{
me->RemoveAurasDueToSpell(SPELL_BALL_OF_FLAMES_PERIODIC);
DoCast(me, SPELL_FLAMES);
@@ -608,7 +608,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->SendMovementFlagUpdate();
me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f);
me->SendMonsterMove(me->GetPositionX(), me->GetPositionY(), 539.2917f, SPLINEFLAG_FALLING, 0, 0.0f);
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f);
for (std::list<Creature*>::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr)
(*itr)->AI()->DoAction(ACTION_DESPAWN);
break;
@@ -815,7 +815,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->SendMovementFlagUpdate();
me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f);
me->SendMonsterMove(me->GetPositionX(), me->GetPositionY(), 539.2917f, SPLINEFLAG_FALLING, 0, 0.0f);
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f);
for (std::list<Creature*>::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr)
(*itr)->AI()->DoAction(ACTION_DESPAWN);
break;
@@ -75,6 +75,7 @@ enum Spells
SPELL_PLAGUE_SICKNESS = 70953,
SPELL_UNBOUND_PLAGUE_PROTECTION = 70955,
SPELL_MUTATED_PLAGUE = 72451,
SPELL_MUTATED_PLAGUE_CLEAR = 72618,
// Slime Puddle
SPELL_GROW_STACKER = 70345,
@@ -244,6 +245,7 @@ class boss_professor_putricide : public CreatureScript
{
_JustDied();
Talk(SAY_DEATH);
DoCast(SPELL_MUTATED_PLAGUE_CLEAR);
}
void JustSummoned(Creature* summon)
@@ -1427,6 +1429,34 @@ class spell_putricide_regurgitated_ooze : public SpellScriptLoader
}
};
class spell_putricide_clear_mutated_plague : public SpellScriptLoader
{
public:
spell_putricide_clear_mutated_plague() : SpellScriptLoader("spell_putricide_clear_mutated_plague") { }
class spell_putricide_clear_mutated_plague_SpellScript : public SpellScript
{
PrepareSpellScript(spell_putricide_clear_mutated_plague_SpellScript);
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
uint32 auraId = sSpellMgr->GetSpellIdForDifficulty(uint32(GetEffectValue()), GetCaster());
GetHitUnit()->RemoveAurasDueToSpell(auraId);
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_putricide_clear_mutated_plague_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_putricide_clear_mutated_plague_SpellScript();
}
};
// Stinky and Precious spell, it's here because its used for both (Festergut and Rotface "pets")
class spell_stinky_precious_decimate : public SpellScriptLoader
{
@@ -1478,5 +1508,6 @@ void AddSC_boss_professor_putricide()
new spell_putricide_mutated_transformation();
new spell_putricide_mutated_transformation_dmg();
new spell_putricide_regurgitated_ooze();
new spell_putricide_clear_mutated_plague();
new spell_stinky_precious_decimate();
}
@@ -268,7 +268,7 @@ class boss_sindragosa : public CreatureScript
void MovementInform(uint32 type, uint32 point)
{
if (type != POINT_MOTION_TYPE)
if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE)
return;
switch (point)
@@ -638,7 +638,7 @@ class npc_spinestalker : public CreatureScript
float moveTime = me->GetExactDist(&SpinestalkerFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f);
me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, SpinestalkerLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250));
me->SetDefaultMovementType(IDLE_MOTION_TYPE);
me->GetMotionMaster()->MoveIdle(MOTION_SLOT_IDLE);
me->GetMotionMaster()->MoveIdle();
me->StopMoving();
me->GetMotionMaster()->MovePoint(POINT_FROSTWYRM_FLY_IN, SpinestalkerFlyPos);
}
@@ -646,7 +646,7 @@ class npc_spinestalker : public CreatureScript
void MovementInform(uint32 type, uint32 point)
{
if (type != POINT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND)
if (type != EFFECT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND)
return;
me->setActive(false);
@@ -753,7 +753,7 @@ class npc_rimefang : public CreatureScript
float moveTime = me->GetExactDist(&RimefangFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f);
me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, RimefangLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250));
me->SetDefaultMovementType(IDLE_MOTION_TYPE);
me->GetMotionMaster()->MoveIdle(MOTION_SLOT_IDLE);
me->GetMotionMaster()->MoveIdle();
me->StopMoving();
me->GetMotionMaster()->MovePoint(POINT_FROSTWYRM_FLY_IN, RimefangFlyPos);
}
@@ -761,7 +761,7 @@ class npc_rimefang : public CreatureScript
void MovementInform(uint32 type, uint32 point)
{
if (type != POINT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND)
if (type != EFFECT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND)
return;
me->setActive(false);
@@ -508,7 +508,7 @@ class boss_the_lich_king : public CreatureScript
if (fabs(ground_Z - z) < 0.1f)
return;
me->GetMotionMaster()->MoveFall(ground_Z);
me->GetMotionMaster()->MoveFall();
}
void EnterCombat(Unit* target)
@@ -801,7 +801,7 @@ class boss_the_lich_king : public CreatureScript
events.ScheduleEvent(EVENT_INTRO_TALK_1, 9000, 0, PHASE_INTRO);
break;
case POINT_CENTER_1:
me->SetFacing(0.0f);
me->SetFacingTo(0.0f);
Talk(SAY_LK_REMORSELESS_WINTER);
SendMusicToPlayers(MUSIC_SPECIAL);
me->SetReactState(REACT_PASSIVE);
@@ -818,7 +818,7 @@ class boss_the_lich_king : public CreatureScript
events.ScheduleEvent(EVENT_SOUL_REAPER, 94000, 0, PHASE_TWO);
break;
case POINT_CENTER_2:
me->SetFacing(0.0f);
me->SetFacingTo(0.0f);
Talk(SAY_LK_REMORSELESS_WINTER);
SendMusicToPlayers(MUSIC_SPECIAL);
me->SetReactState(REACT_PASSIVE);
@@ -1047,14 +1047,14 @@ class boss_the_lich_king : public CreatureScript
break;
case EVENT_OUTRO_TALK_3:
if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING)))
me->SetFacing(0.0f, tirion);
me->SetFacingToObject(tirion);
Talk(SAY_LK_OUTRO_3);
break;
case EVENT_OUTRO_MOVE_CENTER:
me->GetMotionMaster()->MovePoint(POINT_LK_OUTRO_1, CenterPosition);
break;
case EVENT_OUTRO_TALK_4:
me->SetFacing(0.01745329f);
me->SetFacingTo(0.01745329f);
Talk(SAY_LK_OUTRO_4);
break;
case EVENT_OUTRO_RAISE_DEAD:
@@ -1070,7 +1070,7 @@ class boss_the_lich_king : public CreatureScript
case EVENT_OUTRO_TALK_6:
Talk(SAY_LK_OUTRO_6);
if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING)))
tirion->SetFacing(0.0f, me);
tirion->SetFacingToObject(me);
me->ClearUnitState(UNIT_STAT_CASTING);
DoCastAOE(SPELL_SUMMON_BROKEN_FROSTMOURNE_3);
SetEquipmentSlots(false, EQUIP_UNEQUIP);
@@ -1222,7 +1222,7 @@ class npc_tirion_fordring_tft : public CreatureScript
void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
{
if (spell->Id == SPELL_ICE_LOCK)
me->SetFacing(3.085098f);
me->SetFacingTo(3.085098f);
else if (spell->Id == SPELL_BROKEN_FROSTMOURNE_KNOCK)
SetEquipmentSlots(true); // remove glow on ashbringer
}
@@ -1285,7 +1285,7 @@ class npc_tirion_fordring_tft : public CreatureScript
SetEquipmentSlots(false, EQUIP_ASHBRINGER_GLOWING);
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_THE_LICH_KING)))
{
me->SetFacing(0.0f, lichKing);
me->SetFacingToObject(lichKing);
lichKing->AI()->DoAction(ACTION_PLAY_MUSIC);
}
break;
@@ -1621,7 +1621,7 @@ class npc_strangulate_vehicle : public CreatureScript
void IsSummonedBy(Unit* summoner)
{
me->SetFacing(0.0f, summoner);
me->SetFacingToObject(summoner);
DoCast(summoner, SPELL_HARVEST_SOUL_VEHICLE);
_events.Reset();
_events.ScheduleEvent(EVENT_MOVE_TO_LICH_KING, 2000);
@@ -1656,7 +1656,8 @@ class npc_strangulate_vehicle : public CreatureScript
switch (eventId)
{
case EVENT_TELEPORT:
me->GetMotionMaster()->MoveIdle(MOTION_SLOT_ACTIVE);
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveIdle();
if (TempSummon* summ = me->ToTempSummon())
{
if (Unit* summoner = summ->GetSummoner())
@@ -1788,7 +1789,7 @@ class npc_terenas_menethil : public CreatureScript
_events.Reset();
_events.SetPhase(PHASE_OUTRO);
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_THE_LICH_KING)))
me->SetFacing(0.0f, lichKing);
me->SetFacingToObject(lichKing);
_events.ScheduleEvent(EVENT_OUTRO_TERENAS_TALK_1, 2000, 0, PHASE_OUTRO);
_events.ScheduleEvent(EVENT_OUTRO_TERENAS_TALK_2, 14000, 0, PHASE_OUTRO);
@@ -1264,7 +1264,7 @@ struct npc_argent_captainAI : public ScriptedAI
void EnterEvadeMode()
{
// not yet following
if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_IDLE) != TARGETED_MOTION_TYPE || IsUndead)
if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_IDLE) != CHASE_MOTION_TYPE || IsUndead)
{
ScriptedAI::EnterEvadeMode();
return;
@@ -20,79 +20,185 @@
enum Spells
{
SPELL_NECROTIC_AURA = 55593,
SPELL_SUMMON_SPORE = 29234,
SPELL_DEATHBLOOM = 29865,
H_SPELL_DEATHBLOOM = 55053,
SPELL_INEVITABLE_DOOM = 29204,
H_SPELL_INEVITABLE_DOOM = 55052
SPELL_NECROTIC_AURA = 55593,
SPELL_WARN_NECROTIC_AURA = 59481,
SPELL_SUMMON_SPORE = 29234,
SPELL_DEATHBLOOM = 29865,
H_SPELL_DEATHBLOOM = 55053,
SPELL_INEVITABLE_DOOM = 29204,
H_SPELL_INEVITABLE_DOOM = 55052
};
enum Texts
{
SAY_NECROTIC_AURA_APPLIED = 0,
SAY_NECROTIC_AURA_REMOVED = 1,
SAY_NECROTIC_AURA_FADING = 2,
};
enum Events
{
EVENT_NONE,
EVENT_AURA,
EVENT_BLOOM,
EVENT_DOOM,
EVENT_NECROTIC_AURA = 1,
EVENT_DEATHBLOOM = 2,
EVENT_INEVITABLE_DOOM = 3,
EVENT_SPORE = 4,
EVENT_NECROTIC_AURA_FADING = 5,
};
enum Achievement
{
DATA_ACHIEVEMENT_SPORE_LOSER = 21822183,
};
class boss_loatheb : public CreatureScript
{
public:
boss_loatheb() : CreatureScript("boss_loatheb") { }
public:
boss_loatheb() : CreatureScript("boss_loatheb") { }
CreatureAI* GetAI(Creature* creature) const
{
return new boss_loathebAI (creature);
}
struct boss_loathebAI : public BossAI
{
boss_loathebAI(Creature* c) : BossAI(c, BOSS_LOATHEB) {}
void EnterCombat(Unit* /*who*/)
struct boss_loathebAI : public BossAI
{
_EnterCombat();
events.ScheduleEvent(EVENT_AURA, 10000);
events.ScheduleEvent(EVENT_BLOOM, 5000);
events.ScheduleEvent(EVENT_DOOM, 120000);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
boss_loathebAI(Creature* creature) : BossAI(creature, BOSS_LOATHEB)
{
switch (eventId)
{
case EVENT_AURA:
DoCastAOE(SPELL_NECROTIC_AURA);
events.ScheduleEvent(EVENT_AURA, 20000);
break;
case EVENT_BLOOM:
// TODO : Add missing text
DoCastAOE(SPELL_SUMMON_SPORE, true);
DoCastAOE(RAID_MODE(SPELL_DEATHBLOOM, H_SPELL_DEATHBLOOM));
events.ScheduleEvent(EVENT_BLOOM, 30000);
break;
case EVENT_DOOM:
DoCastAOE(RAID_MODE(SPELL_INEVITABLE_DOOM, H_SPELL_INEVITABLE_DOOM));
events.ScheduleEvent(EVENT_DOOM, events.GetTimer() < 5*60000 ? 30000 : 15000);
break;
}
}
DoMeleeAttackIfReady();
}
};
void Reset()
{
_Reset();
_doomCounter = 0;
_sporeLoserData = true;
}
void EnterCombat(Unit* /*who*/)
{
_EnterCombat();
events.ScheduleEvent(EVENT_NECROTIC_AURA, 17000);
events.ScheduleEvent(EVENT_DEATHBLOOM, 5000);
events.ScheduleEvent(EVENT_SPORE, IsHeroic() ? 18000 : 36000);
events.ScheduleEvent(EVENT_INEVITABLE_DOOM, 120000);
}
void SummonedCreatureDies(Creature* /*summon*/, Unit* /*killer*/)
{
_sporeLoserData = false;
}
uint32 GetData(uint32 id)
{
if (id != DATA_ACHIEVEMENT_SPORE_LOSER)
return 0;
return uint32(_sporeLoserData);
}
void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_NECROTIC_AURA:
DoCastAOE(SPELL_NECROTIC_AURA);
DoCast(me, SPELL_WARN_NECROTIC_AURA);
events.ScheduleEvent(EVENT_NECROTIC_AURA, 20000);
events.ScheduleEvent(EVENT_NECROTIC_AURA_FADING, 14000);
break;
case EVENT_DEATHBLOOM:
DoCastAOE(RAID_MODE(SPELL_DEATHBLOOM, H_SPELL_DEATHBLOOM));
events.ScheduleEvent(EVENT_DEATHBLOOM, 30000);
break;
case EVENT_INEVITABLE_DOOM:
_doomCounter++;
DoCastAOE(RAID_MODE(SPELL_INEVITABLE_DOOM, H_SPELL_INEVITABLE_DOOM));
events.ScheduleEvent(EVENT_INEVITABLE_DOOM, std::max(120000 - _doomCounter * 15000, 15000)); // needs to be confirmed
break;
case EVENT_SPORE:
DoCast(me, SPELL_SUMMON_SPORE, false);
events.ScheduleEvent(EVENT_SPORE, IsHeroic() ? 18000 : 36000);
break;
case EVENT_NECROTIC_AURA_FADING:
Talk(SAY_NECROTIC_AURA_FADING);
break;
default:
break;
}
}
DoMeleeAttackIfReady();
}
private:
bool _sporeLoserData;
uint8 _doomCounter;
};
CreatureAI* GetAI(Creature* creature) const
{
return new boss_loathebAI(creature);
}
};
class achievement_spore_loser : public AchievementCriteriaScript
{
public:
achievement_spore_loser() : AchievementCriteriaScript("achievement_spore_loser") { }
bool OnCheck(Player* /*source*/, Unit* target)
{
return target && target->GetAI()->GetData(DATA_ACHIEVEMENT_SPORE_LOSER);
}
};
typedef boss_loatheb::boss_loathebAI LoathebAI;
class spell_loatheb_necrotic_aura_warning : public SpellScriptLoader
{
public:
spell_loatheb_necrotic_aura_warning() : SpellScriptLoader("spell_loatheb_necrotic_aura_warning") { }
class spell_loatheb_necrotic_aura_warning_AuraScript : public AuraScript
{
PrepareAuraScript(spell_loatheb_necrotic_aura_warning_AuraScript);
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellStore.LookupEntry(SPELL_WARN_NECROTIC_AURA))
return false;
return true;
}
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTarget()->IsAIEnabled)
CAST_AI(LoathebAI, GetTarget()->GetAI())->Talk(SAY_NECROTIC_AURA_APPLIED);
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTarget()->IsAIEnabled)
CAST_AI(LoathebAI, GetTarget()->GetAI())->Talk(SAY_NECROTIC_AURA_REMOVED);
}
void Register()
{
AfterEffectApply += AuraEffectApplyFn(spell_loatheb_necrotic_aura_warning_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_loatheb_necrotic_aura_warning_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_loatheb_necrotic_aura_warning_AuraScript();
}
};
void AddSC_boss_loatheb()
{
new boss_loatheb();
new achievement_spore_loser();
new spell_loatheb_necrotic_aura_warning();
}
@@ -83,7 +83,11 @@ enum ThaddiusSpells
SPELL_BALL_LIGHTNING = 28299,
SPELL_CHAIN_LIGHTNING = 28167,
H_SPELL_CHAIN_LIGHTNING = 54531,
SPELL_BERSERK = 27680
SPELL_BERSERK = 27680,
SPELL_POSITIVE_CHARGE = 28062,
SPELL_POSITIVE_CHARGE_STACK = 29659,
SPELL_NEGATIVE_CHARGE = 28085,
SPELL_NEGATIVE_CHARGE_STACK = 29660
};
enum Events
@@ -94,6 +98,11 @@ enum Events
EVENT_BERSERK,
};
enum Achievement
{
DATA_POLARITY_SWITCH = 76047605,
};
class boss_thaddius : public CreatureScript
{
public:
@@ -135,6 +144,7 @@ public:
bool checkStalaggAlive;
bool checkFeugenAlive;
bool polaritySwitch;
uint32 uiAddsTimer;
void KilledUnit(Unit* /*victim*/)
@@ -194,6 +204,20 @@ public:
me->SetReactState(REACT_AGGRESSIVE);
}
void SetData(uint32 id, uint32 data)
{
if (id == DATA_POLARITY_SWITCH)
polaritySwitch = data ? true : false;
}
uint32 GetData(uint32 id)
{
if (id != DATA_POLARITY_SWITCH)
return 0;
return uint32(polaritySwitch);
}
void UpdateAI(const uint32 diff)
{
if (checkFeugenAlive && checkStalaggAlive)
@@ -400,9 +424,101 @@ public:
};
class spell_thaddius_pos_neg_charge : public SpellScriptLoader
{
public:
spell_thaddius_pos_neg_charge() : SpellScriptLoader("spell_thaddius_pos_neg_charge") { }
class spell_thaddius_pos_neg_charge_SpellScript : public SpellScript
{
PrepareSpellScript(spell_thaddius_pos_neg_charge_SpellScript);
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_CHARGE))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_CHARGE_STACK))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_CHARGE))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_CHARGE_STACK))
return false;
return true;
}
bool Load()
{
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
void HandleTargets(std::list<Unit*>& targetList)
{
uint8 count = 0;
for (std::list<Unit*>::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit)
if ((*ihit)->GetGUID() != GetCaster()->GetGUID())
if (Player* target = (*ihit)->ToPlayer())
if (target->HasAura(GetTriggeringSpell()->Id))
++count;
if (count)
{
uint32 spellId = 0;
if (GetSpellInfo()->Id == SPELL_POSITIVE_CHARGE)
spellId = SPELL_POSITIVE_CHARGE_STACK;
else // if (GetSpellInfo()->Id == SPELL_NEGATIVE_CHARGE)
spellId = SPELL_NEGATIVE_CHARGE_STACK;
GetCaster()->SetAuraStack(spellId, GetCaster(), count);
}
}
void HandleDamage(SpellEffIndex /*effIndex*/)
{
if (!GetTriggeringSpell())
return;
Unit* target = GetHitUnit();
Unit* caster = GetCaster();
if (target->HasAura(GetTriggeringSpell()->Id))
SetHitDamage(0);
else
{
if (target->GetTypeId() == TYPEID_PLAYER && caster->IsAIEnabled)
caster->ToCreature()->AI()->SetData(DATA_POLARITY_SWITCH, 1);
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_thaddius_pos_neg_charge_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
OnUnitTargetSelect += SpellUnitTargetFn(spell_thaddius_pos_neg_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_thaddius_pos_neg_charge_SpellScript();
}
};
class achievement_polarity_switch : public AchievementCriteriaScript
{
public:
achievement_polarity_switch() : AchievementCriteriaScript("achievement_polarity_switch") { }
bool OnCheck(Player* /*source*/, Unit* target)
{
return target && target->GetAI()->GetData(DATA_POLARITY_SWITCH);
}
};
void AddSC_boss_thaddius()
{
new boss_thaddius();
new mob_stalagg();
new mob_feugen();
new spell_thaddius_pos_neg_charge();
new achievement_polarity_switch();
}
@@ -166,8 +166,8 @@ public:
kelthuzadGUID = 0;
kelthuzadTriggerGUID = 0;
playerDied = 0;
gothikDoorState = GO_STATE_ACTIVE;
playerDied = 0;
gothikDoorState = GO_STATE_ACTIVE;
memset(portalsGUID, 0, sizeof(portalsGUID));
}
@@ -838,7 +838,7 @@ public:
return;
}
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE)
me->GetMotionMaster()->MoveFollow(malygos, 0.0f, 0.0f);
}
}
@@ -61,7 +61,7 @@ enum eEnums
//OTHER SPELLS
//SPELL_CHARGE_UP = 52098, // only used when starting walk from one platform to the other
//SPELL_TEMPORARY_ELECTRICAL_CHARGE = 52092, // triggered part of above
SPELL_TEMPORARY_ELECTRICAL_CHARGE = 52092, // triggered part of above
NPC_STORMFORGED_LIEUTENANT = 29240,
SPELL_ARC_WELD = 59085,
@@ -98,11 +98,13 @@ public:
m_instance = creature->GetInstanceScript();
m_uiStance = STANCE_DEFENSIVE;
memset(&m_auiStormforgedLieutenantGUID, 0, sizeof(m_auiStormforgedLieutenantGUID));
canBuff = true;
}
InstanceScript* m_instance;
bool m_bIsChangingStance;
bool canBuff;
uint8 m_uiChargingStatus;
uint8 m_uiStance;
@@ -126,6 +128,10 @@ public:
void Reset()
{
if (canBuff)
if (!me->HasAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE))
me->AddAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE, me);
m_bIsChangingStance = false;
m_uiChargingStatus = 0;
@@ -167,6 +173,16 @@ public:
m_instance->SetData(TYPE_BJARNGRIM, NOT_STARTED);
}
void EnterEvadeMode()
{
if (me->HasAura(SPELL_TEMPORARY_ELECTRICAL_CHARGE))
canBuff = true;
else
canBuff = false;
ScriptedAI::EnterEvadeMode();
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
@@ -211,7 +227,7 @@ public:
void UpdateAI(const uint32 uiDiff)
{
//Return since we have no target
if (!UpdateVictim())
if (!UpdateVictim())
return;
// Change stance
@@ -243,7 +243,7 @@ public:
{
if (m_uiPause_Timer <= uiDiff)
{
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE)
if (me->getVictim())
me->GetMotionMaster()->MoveChase(me->getVictim());
@@ -421,7 +421,7 @@ public:
// me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //Set in DB
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
me->GetMotionMaster()->MovementExpired();
m_bIsFrozen = true;
}
@@ -174,7 +174,7 @@ public:
bIsSlam = false;
//and correct movement, if not already
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE)
{
if (me->getVictim())
me->GetMotionMaster()->MoveChase(me->getVictim());
@@ -634,7 +634,7 @@ class boss_stormcaller_brundir : public CreatureScript
// Prevent to have Brundir somewhere in the air when he die in Air phase
if (me->GetPositionZ() > FLOOR_Z)
me->GetMotionMaster()->MoveFall(FLOOR_Z);
me->GetMotionMaster()->MoveFall();
}
void KilledUnit(Unit* /*who*/)
@@ -18,7 +18,7 @@
/* ScriptData
SDName: Boss_Ingvar_The_Plunderer
SD%Complete: 95
SDComment: Some Problems with Annhylde Movement, Blizzlike Timers
SDComment: Some Problems with Annhylde Movement, Blizzlike Timers (just shadow axe summon needs a new timer)
SDCategory: Udgarde Keep
EndScriptData */
@@ -45,16 +45,32 @@ enum Creatures
MOB_INGVAR_UNDEAD = 23980,
};
enum Events
{
EVENT_CLEAVE = 1,
EVENT_SMASH,
EVENT_STAGGERING_ROAR,
EVENT_ENRAGE,
EVENT_DARK_SMASH,
EVENT_DREADFUL_ROAR,
EVENT_WOE_STRIKE,
EVENT_SHADOW_AXE
};
enum Phases
{
PHASE_HUMAN = 1,
PHASE_UNDEAD,
};
enum Spells
{
//Ingvar Spells human form
SPELL_CLEAVE = 42724,
SPELL_SMASH = 42669,
H_SPELL_SMASH = 59706,
SPELL_STAGGERING_ROAR = 42708,
H_SPELL_STAGGERING_ROAR = 59708,
SPELL_ENRAGE = 42705,
H_SPELL_ENRAGE = 59707,
SPELL_INGVAR_FEIGN_DEATH = 42795,
SPELL_SUMMON_BANSHEE = 42912,
@@ -63,9 +79,7 @@ enum Spells
//Ingvar Spells undead form
SPELL_DARK_SMASH = 42723,
SPELL_DREADFUL_ROAR = 42729,
H_SPELL_DREADFUL_ROAR = 59734,
SPELL_WOE_STRIKE = 42730,
H_SPELL_WOE_STRIKE = 59735,
ENTRY_THROW_TARGET = 23996,
SPELL_SHADOW_AXE_SUMMON = 42749
@@ -83,9 +97,9 @@ public:
struct boss_ingvar_the_plundererAI : public ScriptedAI
{
boss_ingvar_the_plundererAI(Creature* c) : ScriptedAI(c)
boss_ingvar_the_plundererAI(Creature* creature) : ScriptedAI(creature)
{
instance = c->GetInstanceScript();
instance = creature->GetInstanceScript();
}
InstanceScript* instance;
@@ -93,10 +107,6 @@ public:
bool bIsUndead;
bool bEventInProgress;
uint32 uiCleaveTimer;
uint32 uiSmashTimer;
uint32 uiEnrageTimer;
uint32 uiRoarTimer;
uint32 uiSpawnResTimer;
void Reset()
@@ -110,10 +120,18 @@ public:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->SetStandState(UNIT_STAND_STATE_STAND);
uiCleaveTimer = 2000;
uiSmashTimer = 5000;
uiEnrageTimer = 10000;
uiRoarTimer = 15000;
events.Reset();
events.SetPhase(PHASE_HUMAN);
events.ScheduleEvent(EVENT_CLEAVE, urand(6,12)*IN_MILLISECONDS, 0, PHASE_HUMAN);
events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_HUMAN);
events.ScheduleEvent(EVENT_ENRAGE, urand(7,14)*IN_MILLISECONDS, 0, PHASE_HUMAN);
events.ScheduleEvent(EVENT_SMASH, urand(12,17)*IN_MILLISECONDS, 0, PHASE_HUMAN);
events.ScheduleEvent(EVENT_DARK_SMASH, urand(14,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10,14)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD);
uiSpawnResTimer = 3000;
@@ -138,6 +156,7 @@ public:
bEventInProgress = true;
bIsUndead = true;
events.SetPhase(PHASE_UNDEAD);
DoScriptText(YELL_DEAD_1, me);
}
@@ -208,70 +227,60 @@ public:
return;
}
if (uiCleaveTimer <= diff)
{
if (!me->HasUnitState(UNIT_STAT_CASTING))
{
if (bIsUndead)
DoCast(me->getVictim(), SPELL_WOE_STRIKE);
else
DoCast(me->getVictim(), SPELL_CLEAVE);
uiCleaveTimer = rand()%5000 + 2000;
}
} else uiCleaveTimer -= diff;
events.Update(diff);
if (uiSmashTimer <= diff)
{
if (!me->HasUnitState(UNIT_STAT_CASTING))
{
if (bIsUndead)
DoCast(me->getVictim(), SPELL_DARK_SMASH);
else
DoCast(me->getVictim(), SPELL_SMASH);
uiSmashTimer = 10000;
}
} else uiSmashTimer -= diff;
if (me->HasUnitState(UNIT_STAT_CASTING))
return;
if (!bIsUndead)
while (uint32 eventId = events.ExecuteEvent())
{
if (uiEnrageTimer <= diff)
switch (eventId)
{
DoCast(me, SPELL_ENRAGE);
uiEnrageTimer = 10000;
} else uiEnrageTimer -= diff;
} else // In Undead form used to summon weapon
{
if (uiEnrageTimer <= diff)
{
if (!me->HasUnitState(UNIT_STAT_CASTING))
{
// Spawn target for Axe
Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
if (target)
// PHASE ONE
case EVENT_CLEAVE:
DoCastVictim(SPELL_CLEAVE);
events.ScheduleEvent(EVENT_CLEAVE, urand(6,12)*IN_MILLISECONDS, 0, PHASE_HUMAN);
break;
case EVENT_STAGGERING_ROAR:
DoCast(me, SPELL_STAGGERING_ROAR);
events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_HUMAN);
break;
case EVENT_ENRAGE:
DoCast(me, SPELL_ENRAGE);
events.ScheduleEvent(EVENT_ENRAGE, urand(7,14)*IN_MILLISECONDS, 0, PHASE_HUMAN);
break;
case EVENT_SMASH:
DoCastVictim(SPELL_SMASH);
events.ScheduleEvent(EVENT_SMASH, urand(12,17)*IN_MILLISECONDS, 0, PHASE_HUMAN);
break;
// PHASE TWO
case EVENT_DARK_SMASH:
DoCastVictim(SPELL_DARK_SMASH);
events.ScheduleEvent(EVENT_DARK_SMASH, urand(14,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
break;
case EVENT_DREADFUL_ROAR:
DoCast(me, SPELL_DREADFUL_ROAR);
events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
break;
case EVENT_WOE_STRIKE:
DoCastVictim(SPELL_WOE_STRIKE);
events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10,14)*IN_MILLISECONDS, 0, PHASE_UNDEAD);
break;
case EVENT_SHADOW_AXE:
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1))
{
me->SummonCreature(ENTRY_THROW_TARGET, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 2000);
DoCast(me, SPELL_SHADOW_AXE_SUMMON);
}
uiEnrageTimer = 30000;
}
} else uiEnrageTimer -= diff;
}
if (uiRoarTimer <= diff)
{
if (!me->HasUnitState(UNIT_STAT_CASTING))
{
if (bIsUndead)
DoCast(me, SPELL_DREADFUL_ROAR);
else
DoCast(me, SPELL_STAGGERING_ROAR);
uiRoarTimer = 10000;
events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD);
break;
}
} else uiRoarTimer -= diff;
}
DoMeleeAttackIfReady();
}
private:
EventMap events;
};
};
@@ -381,8 +390,9 @@ public:
{
ingvar->RemoveAurasDueToSpell(SPELL_SCOURG_RESURRECTION_DUMMY);
if (boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI* pAI = CAST_AI(boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI, ingvar->AI()))
pAI->StartZombiePhase();
if (ingvar->getVictim())
if (boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI* ai = CAST_AI(boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI, ingvar->AI()))
ai->StartZombiePhase();
me->GetMotionMaster()->MovePoint(2, x+1, y, z+30);
++uiResurectPhase;
@@ -17,185 +17,232 @@
/* ScriptData
SDName: Boss_Prince_Keleseth
SD%Complete: 90
SDComment: Needs Prince Movements, Needs adjustments to blizzlike timers, Needs Shadowbolt castbar, Needs right Ressurect Visual, Needs Some Heroic Spells
SD%Complete: 100
SDComment:
SDCategory: Utgarde Keep
EndScriptData */
#include "ScriptPCH.h"
#include "utgarde_keep.h"
enum eEnums
enum KelsethEncounter
{
ACHIEVEMENT_ON_THE_ROCKS = 1919,
SPELL_SHADOWBOLT = 43667,
SPELL_SHADOWBOLT_HEROIC = 59389,
SPELL_FROST_TOMB = 48400,
SPELL_FROST_TOMB_STUN = 42672,
SPELL_FROST_TOMB_SUMMON = 42714,
SPELL_DECREPIFY = 42702,
SPELL_SCOURGE_RESSURRECTION = 42704,
CREATURE_FROSTTOMB = 23965,
CREATURE_SKELETON = 23970,
SAY_AGGRO = -1574000,
SAY_FROST_TOMB = -1574001,
SAY_SKELETONS = -1574002,
SAY_KILL = -1574003,
SAY_DEATH = -1574004
SPELL_SHADOW_FISSURE = 50657,
SPELL_FULL_HEAL = 17683,
SPELL_DECREPIFY = 42702,
SPELL_BONE_ARMOR = 59386,
NPC_FROSTTOMB = 23965,
NPC_SKELETON = 23970,
SAY_START_COMBAT = 1,
SAY_SUMMON_SKELETONS,
SAY_FROST_TOMB,
SAY_FROST_TOMB_EMOTE,
SAY_DEATH,
EVENT_SHADOWBOLT = 1,
EVENT_FROST_TOMB,
EVENT_SUMMON_SKELETONS,
EVENT_DECREPIFY,
EVENT_FULL_HEAL,
EVENT_SHADOW_FISSURE,
EVENT_RESURRECT,
DATA_ON_THE_ROCKS
};
#define SKELETONSPAWN_Z 42.8668f
float SkeletonSpawnPoint[5][5]=
float const SkeletonSpawnPoint[1][2] =
{
{156.2559f, 259.2093f},
{156.2559f, 259.2093f},
{156.2559f, 259.2093f},
{156.2559f, 259.2093f},
{156.2559f, 259.2093f},
};
float AttackLoc[3]={197.636f, 194.046f, 40.8164f};
float AttackLoc[3]= {197.636f, 194.046f, 40.8164f};
bool ShatterFrostTomb; // needed for achievement: On The Rocks(1919)
class mob_frost_tomb : public CreatureScript
class npc_frost_tomb : public CreatureScript
{
public:
mob_frost_tomb() : CreatureScript("mob_frost_tomb") { }
npc_frost_tomb() : CreatureScript("npc_frost_tomb") {}
CreatureAI* GetAI(Creature* creature) const
{
return new mob_frost_tombAI(creature);
return new npc_frost_tombAI(creature);
}
struct mob_frost_tombAI : public ScriptedAI
struct npc_frost_tombAI : public ScriptedAI
{
mob_frost_tombAI(Creature* c) : ScriptedAI(c)
npc_frost_tombAI(Creature* creature) : ScriptedAI(creature)
{
FrostTombGUID = 0;
if (me->isSummon())
if (Unit* summon = me->ToTempSummon()->GetSummoner())
DoCast(summon, SPELL_FROST_TOMB, true);
instance = creature->GetInstanceScript();
}
uint64 FrostTombGUID;
void UpdateAI(const uint32 /*diff*/) {}
void SetPrisoner(Unit* uPrisoner)
void JustDied(Unit* /*killer*/)
{
FrostTombGUID = uPrisoner->GetGUID();
if (instance)
if (Unit* boss = me->GetUnit(*me, instance->GetData64(DATA_PRINCEKELESETH)))
if (boss->ToCreature() && boss->ToCreature()->AI())
boss->ToCreature()->AI()->SetData(DATA_ON_THE_ROCKS, false);
}
void Reset(){ FrostTombGUID = 0; }
void EnterCombat(Unit* /*who*/) {}
void AttackStart(Unit* /*who*/) {}
void MoveInLineOfSight(Unit* /*who*/) {}
void JustDied(Unit* killer)
{
if (killer->GetGUID() != me->GetGUID())
ShatterFrostTomb = true;
if (FrostTombGUID)
{
Unit* FrostTomb = Unit::GetUnit((*me), FrostTombGUID);
if (FrostTomb)
FrostTomb->RemoveAurasDueToSpell(SPELL_FROST_TOMB);
}
}
void UpdateAI(const uint32 /*diff*/)
{
Unit* temp = Unit::GetUnit((*me), FrostTombGUID);
if ((temp && temp->isAlive() && !temp->HasAura(SPELL_FROST_TOMB)) || !temp)
me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
private:
InstanceScript* instance;
};
};
class boss_keleseth : public CreatureScript
{
public:
boss_keleseth() : CreatureScript("boss_keleseth") { }
boss_keleseth() : CreatureScript("boss_keleseth") {}
CreatureAI* GetAI(Creature* creature) const
{
return new boss_kelesethAI (creature);
}
struct boss_kelesethAI : public ScriptedAI
struct boss_kelesethAI : public BossAI
{
boss_kelesethAI(Creature* c) : ScriptedAI(c)
boss_kelesethAI(Creature* creature) : BossAI(creature, DATA_PRINCEKELESETH_EVENT)
{
instance = c->GetInstanceScript();
creature->SetReactState(REACT_DEFENSIVE);
}
InstanceScript* instance;
uint32 FrostTombTimer;
uint32 SummonSkeletonsTimer;
uint32 RespawnSkeletonsTimer;
uint32 ShadowboltTimer;
uint64 SkeletonGUID[5];
bool Skeletons;
bool RespawnSkeletons;
void Reset()
{
ShadowboltTimer = 0;
Skeletons = false;
instance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED);
ShatterFrostTomb = false;
events.Reset();
events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2,3)*IN_MILLISECONDS);
events.ScheduleEvent(EVENT_FROST_TOMB, urand(14,19)*IN_MILLISECONDS);
events.ScheduleEvent(EVENT_SUMMON_SKELETONS, 6*IN_MILLISECONDS);
ResetTimer();
summons.DespawnAll();
if (instance)
instance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED);
}
void KilledUnit(Unit* victim)
{
if (victim == me)
return;
DoScriptText(SAY_KILL, me);
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
if (IsHeroic() && !ShatterFrostTomb)
{
AchievementEntry const* AchievOnTheRocks = GetAchievementStore()->LookupEntry(ACHIEVEMENT_ON_THE_ROCKS);
if (AchievOnTheRocks)
{
Map* map = me->GetMap();
if (map && map->IsDungeon())
{
Map::PlayerList const &players = map->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
itr->getSource()->CompletedAchievement(AchievOnTheRocks);
}
}
}
if (instance)
instance->SetData(DATA_PRINCEKELESETH_EVENT, DONE);
onTheRocks = true;
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
if (instance)
instance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS);
me->SetInCombatWithZone();
instance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS);
Talk(SAY_START_COMBAT);
}
void ResetTimer(uint32 inc = 0)
void JustDied(Unit* /*killer*/)
{
SummonSkeletonsTimer = 5000 + inc;
FrostTombTimer = 28000 + inc;
instance->SetData(DATA_PRINCEKELESETH_EVENT, DONE);
summons.DespawnAll();
Talk(SAY_DEATH);
}
void SetData(uint32 data, uint32 value)
{
if (data == DATA_ON_THE_ROCKS)
onTheRocks = value;
}
uint32 GetData(uint32 data)
{
if (data == DATA_ON_THE_ROCKS)
return onTheRocks;
return 0;
}
void ExecuteEvent(uint32 const eventId)
{
switch (eventId)
{
case EVENT_SUMMON_SKELETONS:
Talk(SAY_SUMMON_SKELETONS);
SummonSkeletons();
break;
case EVENT_SHADOWBOLT:
DoCastVictim(SPELL_SHADOWBOLT);
events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2,3)*IN_MILLISECONDS);
break;
case EVENT_FROST_TOMB:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true, -SPELL_FROST_TOMB))
{
Talk(SAY_FROST_TOMB);
Talk(SAY_FROST_TOMB_EMOTE, target->GetGUID());
DoCast(target, SPELL_FROST_TOMB_STUN, true);
// checked from sniffs - the player casts the spell
target->CastSpell(target, SPELL_FROST_TOMB_SUMMON, true);
}
events.ScheduleEvent(EVENT_FROST_TOMB, urand(14,19)*IN_MILLISECONDS);
break;
}
}
void SummonSkeletons()
{
// I could not found any spell casted for this
for (uint8 i = 0; i < 4; ++i)
me->SummonCreature(NPC_SKELETON, SkeletonSpawnPoint[0][0], SkeletonSpawnPoint[0][1], SKELETONSPAWN_Z, 0);
}
private:
bool onTheRocks;
};
};
class npc_vrykul_skeleton : public CreatureScript
{
public:
npc_vrykul_skeleton() : CreatureScript("npc_vrykul_skeleton") {}
CreatureAI* GetAI(Creature* creature) const
{
return new npc_vrykul_skeletonAI (creature);
}
struct npc_vrykul_skeletonAI : public ScriptedAI
{
npc_vrykul_skeletonAI(Creature* creature) : ScriptedAI(creature) {}
void Reset()
{
events.Reset();
events.ScheduleEvent(EVENT_DECREPIFY, urand(4,6)*IN_MILLISECONDS);
DoCast(SPELL_BONE_ARMOR);
}
void DamageTaken(Unit* /*done_by*/, uint32 &damage)
{
if (damage >= me->GetHealth())
{
damage = 0;
// There are some issues with pets
// they will still attack. I would say it is a PetAI bug
if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
{
// from sniffs
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
events.Reset();
events.ScheduleEvent(EVENT_RESURRECT, urand(18,22)*IN_MILLISECONDS);
me->GetMotionMaster()->MovementExpired(false);
me->GetMotionMaster()->MoveIdle();
}
}
}
void UpdateAI(const uint32 diff)
@@ -203,168 +250,90 @@ public:
if (!UpdateVictim())
return;
if (ShadowboltTimer <= diff)
{
Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0);
if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
me->CastSpell(target, DUNGEON_MODE(SPELL_SHADOWBOLT, SPELL_SHADOWBOLT_HEROIC), true);
ShadowboltTimer = 10000;
} else ShadowboltTimer -= diff;
events.Update(diff);
if (!Skeletons)
{
if ((SummonSkeletonsTimer <= diff))
{
Creature* Skeleton;
DoScriptText(SAY_SKELETONS, me);
for (uint8 i = 0; i < 5; ++i)
{
Skeleton = me->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1], SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
if (Skeleton)
{
Skeleton->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
Skeleton->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
Skeleton->AddThreat(me->getVictim(), 0.0f);
DoZoneInCombat(Skeleton);
}
}
Skeletons = true;
} else SummonSkeletonsTimer -= diff;
}
if (FrostTombTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (target->isAlive())
{
//DoCast(target, SPELL_FROST_TOMB_SUMMON, true);
if (Creature* pChains = me->SummonCreature(CREATURE_FROSTTOMB, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000))
{
CAST_AI(mob_frost_tomb::mob_frost_tombAI, pChains->AI())->SetPrisoner(target);
pChains->CastSpell(target, SPELL_FROST_TOMB, true);
DoScriptText(SAY_FROST_TOMB, me);
}
}
FrostTombTimer = 15000;
} else FrostTombTimer -= diff;
DoMeleeAttackIfReady();
}
};
};
class mob_vrykul_skeleton : public CreatureScript
{
public:
mob_vrykul_skeleton() : CreatureScript("mob_vrykul_skeleton") { }
CreatureAI* GetAI(Creature* creature) const
{
return new mob_vrykul_skeletonAI (creature);
}
struct mob_vrykul_skeletonAI : public ScriptedAI
{
mob_vrykul_skeletonAI(Creature* c) : ScriptedAI(c)
{
instance = c->GetInstanceScript();
}
InstanceScript* instance;
uint32 Respawn_Time;
uint64 Target_Guid;
uint32 Decrepify_Timer;
bool isDead;
void Reset()
{
Respawn_Time = 12000;
Decrepify_Timer = urand(10000, 20000);
isDead = false;
}
void EnterCombat(Unit* /*who*/){}
void DamageTaken(Unit* done_by, uint32 &damage)
{
if (done_by->GetGUID() == me->GetGUID())
if (me->HasUnitState(UNIT_STAT_CASTING))
return;
if (damage >= me->GetHealth())
while (uint32 eventId = events.ExecuteEvent())
{
PretendToDie();
damage = 0;
switch (eventId)
{
case EVENT_DECREPIFY:
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_DECREPIFY), SPELL_DECREPIFY);
events.ScheduleEvent(EVENT_DECREPIFY, urand(1,5)*IN_MILLISECONDS);
break;
case EVENT_RESURRECT:
events.ScheduleEvent(EVENT_FULL_HEAL, 1*IN_MILLISECONDS);
events.ScheduleEvent(EVENT_SHADOW_FISSURE, 1*IN_MILLISECONDS);
break;
case EVENT_FULL_HEAL:
DoCast(me, SPELL_FULL_HEAL, true);
break;
case EVENT_SHADOW_FISSURE:
DoCast(me, SPELL_SHADOW_FISSURE, true);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->RemoveFlag(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
me->GetMotionMaster()->MoveChase(me->getVictim());
events.ScheduleEvent(EVENT_DECREPIFY, urand(4,6)*IN_MILLISECONDS);
break;
}
}
if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
DoMeleeAttackIfReady();
}
void PretendToDie()
{
isDead = true;
me->InterruptNonMeleeSpells(true);
me->RemoveAllAuras();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->GetMotionMaster()->MovementExpired(false);
me->GetMotionMaster()->MoveIdle();
me->SetStandState(UNIT_STAND_STATE_DEAD);
};
void Resurrect()
{
isDead = false;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetStandState(UNIT_STAND_STATE_STAND);
DoCast(me, SPELL_SCOURGE_RESSURRECTION, true);
if (me->getVictim())
{
me->GetMotionMaster()->MoveChase(me->getVictim());
me->AI()->AttackStart(me->getVictim());
}
else
me->GetMotionMaster()->Initialize();
};
void UpdateAI(const uint32 diff)
{
if (instance && instance->GetData(DATA_PRINCEKELESETH_EVENT) == IN_PROGRESS)
{
if (isDead)
{
if (Respawn_Time <= diff)
{
Resurrect();
Respawn_Time = 12000;
} else Respawn_Time -= diff;
}
else
{
if (!UpdateVictim())
return;
if (Decrepify_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_DECREPIFY);
Decrepify_Timer = 30000;
} else Decrepify_Timer -= diff;
DoMeleeAttackIfReady();
}
}else
{
if (me->isAlive())
me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
private:
EventMap events;
};
};
class spell_frost_tomb : public SpellScriptLoader
{
public:
spell_frost_tomb() : SpellScriptLoader("spell_frost_tomb") {}
class spell_frost_tomb_AuraScript : public AuraScript
{
PrepareAuraScript(spell_frost_tomb_AuraScript);
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
if (Unit* caster = GetCaster())
if (caster->ToCreature() && caster->isAlive())
caster->ToCreature()->DespawnOrUnsummon(1000);
}
void Register()
{
AfterEffectRemove += AuraEffectRemoveFn(spell_frost_tomb_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_frost_tomb_AuraScript();
}
};
class achievement_on_the_rocks : public AchievementCriteriaScript
{
public:
achievement_on_the_rocks() : AchievementCriteriaScript("achievement_on_the_rocks") {}
bool OnCheck(Player* /*source*/, Unit* target)
{
return target && target->IsAIEnabled && target->GetAI()->GetData(DATA_ON_THE_ROCKS);
}
};
void AddSC_boss_keleseth()
{
new boss_keleseth();
new mob_frost_tomb();
new mob_vrykul_skeleton();
new npc_frost_tomb();
new npc_vrykul_skeleton();
new spell_frost_tomb();
new achievement_on_the_rocks();
}
@@ -288,7 +288,7 @@ public:
me->Dismount();
if (Creature* pGrauf = me->SummonCreature(CREATURE_GRAUF, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3*IN_MILLISECONDS))
{
pGrauf->GetMotionMaster()->MoveFall(0);
pGrauf->GetMotionMaster()->MoveFall();
pGrauf->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH);
}
me->GetMotionMaster()->MoveJump(Location[4].GetPositionX(), Location[4].GetPositionY(), Location[4].GetPositionZ(), 5.0f, 10.0f);
@@ -20,69 +20,94 @@
enum Spells
{
SPELL_CALL_FLAMES = 48258,
SPELL_RITUAL_OF_THE_SWORD = 48276, //Effect #1 Teleport, Effect #2 Dummy
SPELL_SVALA_TRANSFORMING1 = 54140,
SPELL_SVALA_TRANSFORMING2 = 54205,
SPELL_TRANSFORMING_CHANNEL = 54142,
SPELL_CALL_FLAMES = 48258, // caster effect only, triggers event 17841
SPELL_SINSTER_STRIKE = 15667,
H_SPELL_SINSTER_STRIKE = 59409,
SPELL_SVALA_TRANSFORMING1 = 54140,
SPELL_SVALA_TRANSFORMING2 = 54205
SPELL_RITUAL_PREPARATION = 48267,
SPELL_RITUAL_OF_THE_SWORD = 48276,
SPELL_RITUAL_STRIKE_TRIGGER = 48331, // triggers 48277 & 59930, needs NPC_RITUAL_TARGET as spell_script_target
SPELL_RITUAL_DISARM = 54159,
SPELL_RITUAL_STRIKE_EFF_1 = 48277,
SPELL_RITUAL_STRIKE_EFF_2 = 59930,
SPELL_SUMMONED_VIS = 64446,
SPELL_RITUAL_CHANNELER_1 = 48271,
SPELL_RITUAL_CHANNELER_2 = 48274,
SPELL_RITUAL_CHANNELER_3 = 48275,
// Ritual Channeler spells
SPELL_PARALYZE = 48278,
SPELL_SHADOWS_IN_THE_DARK = 59407,
// Scourge Hulk spells
SPELL_MIGHTY_BLOW = 48697,
SPELL_VOLATILE_INFECTION = 56785,
H_SPELL_VOLATILE_INFECTION = 59228
};
//not in db
enum Yells
{
SAY_DIALOG_WITH_ARTHAS_1 = -1575015,
SAY_DIALOG_WITH_ARTHAS_2 = -1575016,
SAY_DIALOG_WITH_ARTHAS_3 = -1575017,
SAY_AGGRO = -1575018,
SAY_SLAY_1 = -1575019,
SAY_SLAY_2 = -1575020,
SAY_SLAY_3 = -1575021,
SAY_DEATH = -1575022,
SAY_SACRIFICE_PLAYER_1 = -1575023,
SAY_SACRIFICE_PLAYER_2 = -1575024,
SAY_SACRIFICE_PLAYER_3 = -1575025,
SAY_SACRIFICE_PLAYER_4 = -1575026,
SAY_SACRIFICE_PLAYER_5 = -1575027,
SAY_DIALOG_OF_ARTHAS_1 = -1575028,
SAY_DIALOG_OF_ARTHAS_2 = -1575029
// Svala
SAY_SVALA_INTRO_0 = 0,
// Svala Sorrowgrave
SAY_SVALA_INTRO_1 = 0,
SAY_SVALA_INTRO_2 = 1,
SAY_AGGRO = 2,
SAY_SLAY = 3,
SAY_DEATH = 4,
SAY_SACRIFICE_PLAYER = 5,
// Image of Arthas
SAY_DIALOG_OF_ARTHAS_1 = 0,
SAY_DIALOG_OF_ARTHAS_2 = 1
};
enum Creatures
{
CREATURE_ARTHAS = 29280, // Image of Arthas
CREATURE_SVALA_SORROWGRAVE = 26668, // Svala after transformation
CREATURE_SVALA = 29281, // Svala before transformation
CREATURE_RITUAL_CHANNELER = 27281
CREATURE_RITUAL_CHANNELER = 27281,
CREATURE_SPECTATOR = 26667,
CREATURE_RITUAL_TARGET = 27327,
CREATURE_FLAME_BRAZIER = 27273,
CREATURE_SCOURGE_HULK = 26555
};
enum ChannelerSpells
enum Objects
{
//ritual channeler's spells
SPELL_PARALYZE = 48278,
SPELL_SHADOWS_IN_THE_DARK = 59407
OBJECT_UTGARDE_MIRROR = 191745
};
enum Misc
{
DATA_SVALA_DISPLAY_ID = 25944
};
enum IntroPhase
enum SvalaPhase
{
IDLE,
INTRO,
FINISHED
};
enum CombatPhase
{
NORMAL,
SACRIFICING
SACRIFICING,
SVALADEAD
};
static Position RitualChannelerPos[]=
enum SvalaPoint
{
{296.42f, -355.01f, 90.94f, 0.0f},
{302.36f, -352.01f, 90.54f, 0.0f},
{291.39f, -350.89f, 90.54f, 0.0f}
POINT_FALL_GROUND = 1,
};
#define DATA_INCREDIBLE_HULK 2043
static const float spectatorWP[2][3] =
{
{296.95f,-312.76f,86.36f},
{297.69f,-275.81f,86.36f}
};
static Position ArthasPos = { 295.81f, -366.16f, 92.57f, 1.58f };
static Position SvalaPos = { 296.632f, -346.075f, 90.6307f, 1.58f };
class boss_svala : public CreatureScript
{
@@ -96,31 +121,96 @@ public:
struct boss_svalaAI : public ScriptedAI
{
boss_svalaAI(Creature* c) : ScriptedAI(c)
boss_svalaAI(Creature* creature) : ScriptedAI(creature), summons(creature)
{
instance = c->GetInstanceScript();
instance = creature->GetInstanceScript();
Phase = IDLE;
me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_RITUAL_STRIKE_EFF_1, true);
me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_RITUAL_STRIKE_EFF_2, true);
}
uint32 uiIntroTimer;
uint8 uiIntroPhase;
IntroPhase Phase;
TempSummon* pArthas;
uint64 uiArthasGUID;
InstanceScript* instance;
SummonList summons;
SvalaPhase Phase;
Position pos;
float x, y, z;
uint32 introTimer;
uint8 introPhase;
uint8 sacrePhase;
TempSummon* arthas;
uint64 arthasGUID;
uint32 sinsterStrikeTimer;
uint32 callFlamesTimer;
uint32 sacrificeTimer;
bool sacrificed;
void Reset()
{
Phase = IDLE;
uiIntroTimer = 1 * IN_MILLISECONDS;
uiIntroPhase = 0;
uiArthasGUID = 0;
sacrificed = false;
SetCombatMovement(true);
summons.DespawnAll();
me->RemoveAllAuras();
if (Phase > INTRO)
{
me->SetFlying(true);
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
}
if (Phase > NORMAL)
Phase = NORMAL;
introTimer = 1 * IN_MILLISECONDS;
introPhase = 0;
arthasGUID = 0;
if (instance)
{
instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, NOT_STARTED);
instance->SetData64(DATA_SACRIFICED_PLAYER, 0);
}
}
void JustReachedHome()
{
if (Phase > INTRO)
{
me->SetFlying(false);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->SetOrientation(1.58f);
me->SendMovementFlagUpdate();
}
}
void EnterCombat(Unit* /*who*/)
{
Talk(SAY_AGGRO);
sinsterStrikeTimer = 7 * IN_MILLISECONDS;
callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
if (instance)
instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, IN_PROGRESS);
}
void JustSummoned(Creature* summon)
{
if (summon->GetEntry() == CREATURE_RITUAL_CHANNELER)
summon->CastSpell(summon, SPELL_SUMMONED_VIS, true);
summons.Summon(summon);
}
void SummonedCreatureDespawn(Creature* summon)
{
summons.Despawn(summon);
}
void MoveInLineOfSight(Unit* who)
@@ -132,287 +222,492 @@ public:
{
Phase = INTRO;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (GameObject* mirror = GetClosestGameObjectWithEntry(me, OBJECT_UTGARDE_MIRROR, 100.0f))
mirror->SetGoState(GO_STATE_READY);
if (Creature* pArthas = me->SummonCreature(CREATURE_ARTHAS, ArthasPos, TEMPSUMMON_MANUAL_DESPAWN))
if (Creature* arthas = me->SummonCreature(CREATURE_ARTHAS, ArthasPos, TEMPSUMMON_MANUAL_DESPAWN))
{
pArthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
uiArthasGUID = pArthas->GetGUID();
arthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
arthasGUID = arthas->GetGUID();
}
}
}
void AttackStart(Unit* /*who*/) {}
void UpdateAI(const uint32 diff)
void KilledUnit(Unit* victim)
{
if (Phase != INTRO)
if (victim != me)
Talk(SAY_SLAY);
}
void DamageTaken(Unit* attacker, uint32 &damage)
{
if (Phase == SVALADEAD)
{
if (attacker != me)
damage = 0;
return;
}
if (damage >= me->GetHealth())
{
if (Phase == SACRIFICING)
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
damage = 0;
Phase = SVALADEAD;
me->InterruptNonMeleeSpells(true);
me->RemoveAllAuras();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetHealth(1);
SetCombatMovement(false);
me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH);
me->GetMotionMaster()->MoveFall(POINT_FALL_GROUND);
}
}
void MovementInform(uint32 motionType, uint32 pointId)
{
if (motionType != EFFECT_MOTION_TYPE)
return;
if (uiIntroTimer <= diff)
{
Creature* pArthas = Unit::GetCreature(*me, uiArthasGUID);
if (!pArthas)
return;
switch (uiIntroPhase)
{
case 0:
DoScriptText(SAY_DIALOG_WITH_ARTHAS_1, me);
++uiIntroPhase;
uiIntroTimer = 3500;
break;
case 1:
DoScriptText(SAY_DIALOG_OF_ARTHAS_1, pArthas);
++uiIntroPhase;
uiIntroTimer = 3500;
break;
case 2:
DoScriptText(SAY_DIALOG_WITH_ARTHAS_2, me);
++uiIntroPhase;
uiIntroTimer = 3500;
break;
case 3:
DoScriptText(SAY_DIALOG_OF_ARTHAS_2, pArthas);
++uiIntroPhase;
uiIntroTimer = 3500;
break;
case 4:
DoScriptText(SAY_DIALOG_WITH_ARTHAS_3, me);
DoCast(me, SPELL_SVALA_TRANSFORMING1);
++uiIntroPhase;
uiIntroTimer = 2800;
break;
case 5:
DoCast(me, SPELL_SVALA_TRANSFORMING2);
++uiIntroPhase;
uiIntroTimer = 200;
break;
case 6:
if (me->SummonCreature(CREATURE_SVALA_SORROWGRAVE, SvalaPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60*IN_MILLISECONDS))
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetDisplayId(DATA_SVALA_DISPLAY_ID);
pArthas->DespawnOrUnsummon();
uiArthasGUID = 0;
Phase = FINISHED;
}
else
Reset();
break;
}
} else uiIntroTimer -= diff;
}
};
};
class mob_ritual_channeler : public CreatureScript
{
public:
mob_ritual_channeler() : CreatureScript("mob_ritual_channeler") { }
CreatureAI* GetAI(Creature* creature) const
{
return new mob_ritual_channelerAI(creature);
}
struct mob_ritual_channelerAI : public Scripted_NoMovementAI
{
mob_ritual_channelerAI(Creature* c) :Scripted_NoMovementAI(c)
{
instance = c->GetInstanceScript();
if (pointId == POINT_FALL_GROUND)
me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
InstanceScript* instance;
void Reset()
void JustDied(Unit* /*killer*/)
{
DoCast(me, SPELL_SHADOWS_IN_THE_DARK);
}
// called by svala sorrowgrave to set guid of victim
void DoAction(const int32 /*action*/)
{
if (instance)
if (Unit* victim = me->GetUnit(*me, instance->GetData64(DATA_SACRIFICED_PLAYER)))
DoCast(victim, SPELL_PARALYZE);
}
void EnterCombat(Unit* /*who*/)
{
}
};
};
class boss_svala_sorrowgrave : public CreatureScript
{
public:
boss_svala_sorrowgrave() : CreatureScript("boss_svala_sorrowgrave") { }
CreatureAI* GetAI(Creature* creature) const
{
return new boss_svala_sorrowgraveAI(creature);
}
struct boss_svala_sorrowgraveAI : public ScriptedAI
{
boss_svala_sorrowgraveAI(Creature* c) : ScriptedAI(c), summons(c)
{
instance = c->GetInstanceScript();
}
uint32 uiSinsterStrikeTimer;
uint32 uiCallFlamesTimer;
uint32 uiRitualOfSwordTimer;
uint32 uiSacrificeTimer;
CombatPhase Phase;
SummonList summons;
bool bSacrificed;
InstanceScript* instance;
void Reset()
{
uiSinsterStrikeTimer = 7 * IN_MILLISECONDS;
uiCallFlamesTimer = 10 * IN_MILLISECONDS;
uiRitualOfSwordTimer = 20 * IN_MILLISECONDS;
uiSacrificeTimer = 8 * IN_MILLISECONDS;
bSacrificed = false;
Phase = NORMAL;
DoTeleportTo(296.632f, -346.075f, 90.6307f);
me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
summons.DespawnAll();
if (instance)
instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, DONE);
Talk(SAY_DEATH);
}
void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell)
{
if (spell->Id == SPELL_RITUAL_STRIKE_EFF_1 && Phase != NORMAL && Phase != SVALADEAD)
{
instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, NOT_STARTED);
instance->SetData64(DATA_SACRIFICED_PLAYER, 0);
Phase = NORMAL;
SetCombatMovement(true);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 300.0f, true))
me->GetMotionMaster()->MoveChase(target);
}
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (instance)
instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, IN_PROGRESS);
}
void JustSummoned(Creature* summon)
{
summons.Summon(summon);
}
void SummonedCreatureDespawn(Creature* summon)
{
summons.Despawn(summon);
}
void UpdateAI(const uint32 diff)
{
if (Phase == IDLE)
return;
if (Phase == INTRO)
{
if (introTimer <= diff)
{
Creature* arthas = Unit::GetCreature(*me, arthasGUID);
if (!arthas)
return;
switch (introPhase)
{
case 0:
Talk(SAY_SVALA_INTRO_0);
++introPhase;
introTimer = 8100;
break;
case 1:
arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_1);
++introPhase;
introTimer = 10000;
break;
case 2:
arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, false);
me->SetFlying(true);
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
pos.Relocate(me);
pos.m_positionZ += 8.0f;
me->GetMotionMaster()->MoveTakeoff(0, pos, 3.30078125f);
// spectators flee event
if (instance)
{
std::list<Creature*> lspectatorList;
GetCreatureListWithEntryInGrid(lspectatorList, me, CREATURE_SPECTATOR, 100.0f);
for (std::list<Creature*>::iterator itr = lspectatorList.begin(); itr != lspectatorList.end(); ++itr)
{
if ((*itr)->isAlive())
{
(*itr)->SetStandState(UNIT_STAND_STATE_STAND);
(*itr)->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
(*itr)->GetMotionMaster()->MovePoint(1, spectatorWP[0][0], spectatorWP[0][1], spectatorWP[0][2]);
}
}
}
++introPhase;
introTimer = 4200;
break;
case 3:
me->CastSpell(me, SPELL_SVALA_TRANSFORMING1, false);
++introPhase;
introTimer = 6200;
break;
case 4:
me->CastSpell(me, SPELL_SVALA_TRANSFORMING2, false);
arthas->InterruptNonMeleeSpells(true);
me->RemoveAllAuras();
me->UpdateEntry(CREATURE_SVALA_SORROWGRAVE);
me->SetFacingToObject(arthas);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
++introPhase;
introTimer = 3200;
break;
case 5:
Talk(SAY_SVALA_INTRO_1);
++introPhase;
introTimer = 10000;
break;
case 6:
arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_2);
++introPhase;
introTimer = 7200;
break;
case 7:
Talk(SAY_SVALA_INTRO_2);
me->SetOrientation(1.58f);
me->SendMovementFlagUpdate();
arthas->SetVisible(false);
++introPhase;
introTimer = 13800;
break;
case 8:
me->SetFlying(false);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->SendMovementFlagUpdate();
pos.Relocate(me);
pos.m_positionX = me->GetHomePosition().GetPositionX();
pos.m_positionY = me->GetHomePosition().GetPositionY();
pos.m_positionZ = 90.6065f;
me->GetMotionMaster()->MoveLand(0, pos, 6.247422f);
++introPhase;
introTimer = 3000;
break;
case 9:
if (GameObject* mirror = GetClosestGameObjectWithEntry(me, OBJECT_UTGARDE_MIRROR, 100.0f))
mirror->SetGoState(GO_STATE_ACTIVE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
arthas->DespawnOrUnsummon();
arthasGUID = 0;
Phase = NORMAL;
break;
}
}
else introTimer -= diff;
return;
}
if (Phase == NORMAL)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (uiSinsterStrikeTimer <= diff)
if (me->IsWithinMeleeRange(me->getVictim()) && me->HasUnitMovementFlag(MOVEMENTFLAG_LEVITATING))
{
me->SetFlying(false);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->SendMovementFlagUpdate();
}
if (sinsterStrikeTimer <= diff)
{
DoCast(me->getVictim(), SPELL_SINSTER_STRIKE);
uiSinsterStrikeTimer = urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS);
} else uiSinsterStrikeTimer -= diff;
sinsterStrikeTimer = urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS);
} else sinsterStrikeTimer -= diff;
if (uiCallFlamesTimer <= diff)
if (callFlamesTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoCast(target, SPELL_CALL_FLAMES);
uiCallFlamesTimer = urand(8 * IN_MILLISECONDS, 12 * IN_MILLISECONDS);
callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
}
} else uiCallFlamesTimer -= diff;
} else callFlamesTimer -= diff;
if (!bSacrificed)
if (!sacrificed)
{
if (uiRitualOfSwordTimer <= diff)
if (HealthBelowPct(50))
{
if (Unit* pSacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* sacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true))
{
DoScriptText(RAND(SAY_SACRIFICE_PLAYER_1, SAY_SACRIFICE_PLAYER_2, SAY_SACRIFICE_PLAYER_3, SAY_SACRIFICE_PLAYER_4, SAY_SACRIFICE_PLAYER_5), me);
DoCast(pSacrificeTarget, SPELL_RITUAL_OF_THE_SWORD);
//Spell doesn't teleport
DoTeleportPlayer(pSacrificeTarget, 296.632f, -346.075f, 90.63f, 4.6f);
me->SetUnitMovementFlags(MOVEMENTFLAG_CAN_FLY);
DoTeleportTo(296.632f, -346.075f, 120.85f);
Phase = SACRIFICING;
if (instance)
{
instance->SetData64(DATA_SACRIFICED_PLAYER, pSacrificeTarget->GetGUID());
instance->SetData64(DATA_SACRIFICED_PLAYER, sacrificeTarget->GetGUID());
for (uint8 i = 0; i < 3; ++i)
if (Creature* summon = me->SummonCreature(CREATURE_RITUAL_CHANNELER, RitualChannelerPos[i], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
summon->AI()->DoAction(0);
}
Talk(SAY_SACRIFICE_PLAYER);
bSacrificed = true;
DoCast(sacrificeTarget, SPELL_RITUAL_PREPARATION);
SetCombatMovement(false);
me->SetFlying(true);
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
Phase = SACRIFICING;
sacrePhase = 0;
sacrificeTimer = 1 * IN_MILLISECONDS;
DoCast(me, SPELL_RITUAL_OF_THE_SWORD);
sacrificed = true;
}
} else uiRitualOfSwordTimer -= diff;
}
}
DoMeleeAttackIfReady();
}
else //SACRIFICING
{
if (uiSacrificeTimer <= diff)
if (sacrificeTimer <= diff)
{
Unit* pSacrificeTarget = instance ? Unit::GetUnit(*me, instance->GetData64(DATA_SACRIFICED_PLAYER)) : NULL;
if (instance && !summons.empty() && pSacrificeTarget && pSacrificeTarget->isAlive())
me->Kill(pSacrificeTarget, false); // durability damage?
//go down
Phase = NORMAL;
pSacrificeTarget = NULL;
me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
me->GetMotionMaster()->MoveChase(target);
uiSacrificeTimer = 8 * IN_MILLISECONDS;
switch (sacrePhase)
{
case 0:
// spawn ritual channelers
if (instance)
{
DoCast(me, SPELL_RITUAL_CHANNELER_1, true);
DoCast(me, SPELL_RITUAL_CHANNELER_2, true);
DoCast(me, SPELL_RITUAL_CHANNELER_3, true);
}
++sacrePhase;
sacrificeTimer = 2 * IN_MILLISECONDS;
break;
case 1:
me->StopMoving();
me->GetMotionMaster()->MoveIdle();
me->InterruptNonMeleeSpells(true);
DoCast(me, SPELL_RITUAL_STRIKE_TRIGGER, true);
++sacrePhase;
sacrificeTimer = 200;
break;
case 2:
DoCast(me, SPELL_RITUAL_DISARM);
++sacrePhase;
break;
case 3:
break;
}
}
else uiSacrificeTimer -= diff;
else sacrificeTimer -= diff;
}
}
void KilledUnit(Unit* /*victim*/)
{
DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me);
}
void JustDied(Unit* killer)
{
if (instance)
{
Creature* pSvala = Unit::GetCreature((*me), instance->GetData64(DATA_SVALA));
if (pSvala && pSvala->isAlive())
killer->Kill(pSvala);
instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, DONE);
}
DoScriptText(SAY_DEATH, me);
}
};
};
class npc_ritual_channeler : public CreatureScript
{
public:
npc_ritual_channeler() : CreatureScript("npc_ritual_channeler") { }
CreatureAI* GetAI(Creature* creature) const
{
return new npc_ritual_channelerAI(creature);
}
struct npc_ritual_channelerAI : public Scripted_NoMovementAI
{
npc_ritual_channelerAI(Creature* creature) :Scripted_NoMovementAI(creature)
{
instance = creature->GetInstanceScript();
}
InstanceScript* instance;
uint32 paralyzeTimer;
void Reset()
{
paralyzeTimer = 1600;
if (instance)
if (IsHeroic())
DoCast(me, SPELL_SHADOWS_IN_THE_DARK);
}
void UpdateAI(const uint32 diff)
{
if (me->HasUnitState(UNIT_STAT_CASTING))
return;
if (paralyzeTimer <= diff)
{
if (instance)
if (Unit* victim = me->GetUnit(*me, instance->GetData64(DATA_SACRIFICED_PLAYER)))
DoCast(victim, SPELL_PARALYZE, false);
paralyzeTimer = 200;
}
else
paralyzeTimer -= diff;
}
};
};
class npc_spectator : public CreatureScript
{
public:
npc_spectator() : CreatureScript("npc_spectator") { }
CreatureAI* GetAI(Creature* creature) const
{
return new npc_spectatorAI(creature);
}
struct npc_spectatorAI : public ScriptedAI
{
npc_spectatorAI(Creature* creature) : ScriptedAI(creature) { }
void Reset() { }
void MovementInform(uint32 motionType, uint32 pointId)
{
if (motionType == POINT_MOTION_TYPE)
{
if (pointId == 1)
me->GetMotionMaster()->MovePoint(2,spectatorWP[1][0],spectatorWP[1][1],spectatorWP[1][2]);
else if (pointId == 2)
me->DespawnOrUnsummon(1000);
}
}
};
};
class checkRitualTarget
{
public:
explicit checkRitualTarget(Unit* _caster) : caster(_caster) { }
bool operator() (Unit* unit)
{
if (InstanceScript* instance = caster->GetInstanceScript())
if (instance->GetData64(DATA_SACRIFICED_PLAYER) == unit->GetGUID())
return false;
return true;
}
private:
Unit* caster;
};
class spell_paralyze_pinnacle : public SpellScriptLoader
{
public:
spell_paralyze_pinnacle() : SpellScriptLoader("spell_paralyze_pinnacle") { }
class spell_paralyze_pinnacle_SpellScript : public SpellScript
{
PrepareSpellScript(spell_paralyze_pinnacle_SpellScript);
void FilterTargets(std::list<Unit*>& unitList)
{
unitList.remove_if(checkRitualTarget(GetCaster()));
}
void Register()
{
OnUnitTargetSelect += SpellUnitTargetFn(spell_paralyze_pinnacle_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_paralyze_pinnacle_SpellScript();
}
};
class npc_scourge_hulk : public CreatureScript
{
public:
npc_scourge_hulk() : CreatureScript("npc_scourge_hulk") { }
struct npc_scourge_hulkAI : public ScriptedAI
{
npc_scourge_hulkAI(Creature* creature) : ScriptedAI(creature) { }
uint32 mightyBlow;
uint32 volatileInfection;
void Reset()
{
mightyBlow = urand(4000, 9000);
volatileInfection = urand(10000, 14000);
killedByRitualStrike = false;
}
uint32 GetData(uint32 type)
{
return type == DATA_INCREDIBLE_HULK ? killedByRitualStrike : 0;
}
void DamageTaken(Unit* attacker, uint32 &damage)
{
if (damage >= me->GetHealth() && attacker->GetEntry() == CREATURE_SVALA_SORROWGRAVE)
killedByRitualStrike = true;
}
void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
if (mightyBlow <= diff)
{
if (Unit* victim = me->getVictim())
if (!victim->HasUnitState(UNIT_STAT_STUNNED)) // Prevent knocking back a ritual player
DoCast(victim, SPELL_MIGHTY_BLOW);
mightyBlow = urand(12000, 17000);
}
else
mightyBlow -= diff;
if (volatileInfection <= diff)
{
DoCastVictim(SPELL_VOLATILE_INFECTION);
volatileInfection = urand(13000, 17000);
}
else
volatileInfection -= diff;
DoMeleeAttackIfReady();
}
private:
bool killedByRitualStrike;
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_scourge_hulkAI(creature);
}
};
class achievement_incredible_hulk : public AchievementCriteriaScript
{
public:
achievement_incredible_hulk() : AchievementCriteriaScript("achievement_incredible_hulk") { }
bool OnCheck(Player* /*player*/, Unit* target)
{
return target && target->IsAIEnabled && target->GetAI()->GetData(DATA_INCREDIBLE_HULK);
}
};
void AddSC_boss_svala()
{
new boss_svala();
new mob_ritual_channeler();
new boss_svala_sorrowgrave();
new npc_ritual_channeler();
new npc_spectator();
new spell_paralyze_pinnacle();
new npc_scourge_hulk();
new achievement_incredible_hulk();
}
@@ -170,8 +170,12 @@ public:
void SetData64(uint32 type, uint64 data)
{
if (type == DATA_SACRIFICED_PLAYER)
uiSacrificedPlayer = data;
switch (type)
{
case DATA_SACRIFICED_PLAYER:
uiSacrificedPlayer = data;
break;
}
}
uint32 GetData(uint32 type)
@@ -201,6 +205,7 @@ public:
case DATA_MOB_ORB: return uiPalehoofOrb;
case DATA_SVALA: return uiSvala;
case DATA_GORTOK_PALEHOOF_SPHERE: return uiGortokPalehoofSphere;
case DATA_SACRIFICED_PLAYER: return uiSacrificedPlayer;
}
return 0;
@@ -53,7 +53,7 @@ enum eCreatures
MOB_MASSIVE_JORMUNGAR = 26685,
MOB_FEROCIOUS_RHINO = 26686,
MOB_SVALA = 29281,
MOB_PALEHOOF_ORB = 26688,
MOB_PALEHOOF_ORB = 26688
};
#endif
+10 -3
View File
@@ -32,7 +32,12 @@ Script Data End */
enum Spells
{
SPELL_TRESPASSER_A = 54028,
SPELL_TRESPASSER_H = 54029
SPELL_TRESPASSER_H = 54029,
SPELL_SUNREAVER_DISGUISE_FEMALE = 70973,
SPELL_SUNREAVER_DISGUISE_MALE = 70974,
SPELL_SILVER_COVENANT_DISGUISE_FEMALE = 70971,
SPELL_SILVER_COVENANT_DISGUISE_MALE = 70972,
};
enum NPCs // All outdoor guards are within 35.0f of these NPCs
@@ -71,8 +76,10 @@ public:
Player* player = who->GetCharmerOrOwnerPlayerOrPlayerItself();
// If player has Disguise aura for quest A Meeting With The Magister or An Audience With The Arcanist, do not teleport it away but let it pass
if (!player || player->isGameMaster() || player->IsBeingTeleported() || player->HasAura(70973) || player->HasAura(70971))
if (!player || player->isGameMaster() || player->IsBeingTeleported() ||
// If player has Disguise aura for quest A Meeting With The Magister or An Audience With The Arcanist, do not teleport it away but let it pass
player->HasAura(SPELL_SUNREAVER_DISGUISE_FEMALE) || player->HasAura(SPELL_SUNREAVER_DISGUISE_MALE) ||
player->HasAura(SPELL_SILVER_COVENANT_DISGUISE_FEMALE) || player->HasAura(SPELL_SILVER_COVENANT_DISGUISE_MALE))
return;
switch (me->GetEntry())
@@ -16,115 +16,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Grizzly_Hills
SD%Complete: 80
SDComment: Quest support: 12231, 12247
SDCategory: Grizzly Hills
EndScriptData */
/* ContentData
npc_orsonn_and_kodian
EndContentData */
#include "ScriptPCH.h"
#include "ScriptedEscortAI.h"
#define GOSSIP_ITEM1 "You're free to go Orsonn, but first tell me what's wrong with the furbolg."
#define GOSSIP_ITEM2 "What happened then?"
#define GOSSIP_ITEM3 "Thank you, Son of Ursoc. I'll see what can be done."
#define GOSSIP_ITEM4 "Who was this stranger?"
#define GOSSIP_ITEM5 "Thank you, Kodian. I'll do what I can."
enum eEnums
{
GOSSIP_TEXTID_ORSONN1 = 12793,
GOSSIP_TEXTID_ORSONN2 = 12794,
GOSSIP_TEXTID_ORSONN3 = 12796,
GOSSIP_TEXTID_KODIAN1 = 12797,
GOSSIP_TEXTID_KODIAN2 = 12798,
NPC_ORSONN = 27274,
NPC_KODIAN = 27275,
//trigger creatures
NPC_ORSONN_CREDIT = 27322,
NPC_KODIAN_CREDIT = 27321,
QUEST_CHILDREN_OF_URSOC = 12247,
QUEST_THE_BEAR_GODS_OFFSPRING = 12231
};
class npc_orsonn_and_kodian : public CreatureScript
{
public:
npc_orsonn_and_kodian() : CreatureScript("npc_orsonn_and_kodian") { }
bool OnGossipHello(Player* player, Creature* creature)
{
if (creature->isQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if (player->GetQuestStatus(QUEST_CHILDREN_OF_URSOC) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_THE_BEAR_GODS_OFFSPRING) == QUEST_STATUS_INCOMPLETE)
{
switch (creature->GetEntry())
{
case NPC_ORSONN:
if (!player->GetReqKillOrCastCurrentCount(QUEST_CHILDREN_OF_URSOC, NPC_ORSONN_CREDIT) || !player->GetReqKillOrCastCurrentCount(QUEST_THE_BEAR_GODS_OFFSPRING, NPC_ORSONN_CREDIT))
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ORSONN1, creature->GetGUID());
return true;
}
break;
case NPC_KODIAN:
if (!player->GetReqKillOrCastCurrentCount(QUEST_CHILDREN_OF_URSOC, NPC_KODIAN_CREDIT) || !player->GetReqKillOrCastCurrentCount(QUEST_THE_BEAR_GODS_OFFSPRING, NPC_KODIAN_CREDIT))
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_KODIAN1, creature->GetGUID());
return true;
}
break;
}
}
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
{
player->PlayerTalkClass->ClearMenus();
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ORSONN2, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ORSONN3, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
player->CLOSE_GOSSIP_MENU();
player->TalkedToCreature(NPC_ORSONN_CREDIT, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+4:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_KODIAN2, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+5:
player->CLOSE_GOSSIP_MENU();
player->TalkedToCreature(NPC_KODIAN_CREDIT, creature->GetGUID());
break;
}
return true;
}
};
/*######
## Quest 12027: Mr. Floppy's Perilous Adventure
######*/
@@ -801,7 +695,6 @@ public:
void AddSC_grizzly_hills()
{
new npc_orsonn_and_kodian;
new npc_emily;
new npc_mrfloppy;
new npc_outhouse_bunny;
-93
View File
@@ -114,38 +114,6 @@ public:
}
};
/*######
## npc_dame_evniki_kapsalis
######*/
enum eDameEnvikiKapsalis
{
TITLE_CRUSADER = 123
};
class npc_dame_evniki_kapsalis : public CreatureScript
{
public:
npc_dame_evniki_kapsalis() : CreatureScript("npc_dame_evniki_kapsalis") { }
bool OnGossipHello(Player* player, Creature* creature)
{
if (player->HasTitle(TITLE_CRUSADER))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
{
player->PlayerTalkClass->ClearMenus();
if (uiAction == GOSSIP_ACTION_TRADE)
player->GetSession()->SendListInventory(creature->GetGUID());
return true;
}
};
/*######
## npc_squire_david
######*/
@@ -275,65 +243,6 @@ public:
}
};
/*######
## npc_alorah_and_grimmin
######*/
enum ealorah_and_grimmin
{
SPELL_CHAIN = 68341,
NPC_FJOLA_LIGHTBANE = 36065,
NPC_EYDIS_DARKBANE = 36066,
NPC_PRIESTESS_ALORAH = 36101,
NPC_PRIEST_GRIMMIN = 36102
};
class npc_alorah_and_grimmin : public CreatureScript
{
public:
npc_alorah_and_grimmin() : CreatureScript("npc_alorah_and_grimmin") { }
struct npc_alorah_and_grimminAI : public ScriptedAI
{
npc_alorah_and_grimminAI(Creature* creature) : ScriptedAI(creature) {}
bool uiCast;
void Reset()
{
uiCast = false;
}
void UpdateAI(const uint32 /*uiDiff*/)
{
if (uiCast)
return;
uiCast = true;
Creature* target = NULL;
switch (me->GetEntry())
{
case NPC_PRIESTESS_ALORAH:
target = me->FindNearestCreature(NPC_EYDIS_DARKBANE, 10.0f);
break;
case NPC_PRIEST_GRIMMIN:
target = me->FindNearestCreature(NPC_FJOLA_LIGHTBANE, 10.0f);
break;
}
if (target)
DoCast(target, SPELL_CHAIN);
if (!UpdateVictim())
return;
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_alorah_and_grimminAI(creature);
}
};
/*######
## npc_guardian_pavilion
######*/
@@ -429,10 +338,8 @@ public:
void AddSC_icecrown()
{
new npc_arete;
new npc_dame_evniki_kapsalis;
new npc_squire_david;
new npc_argent_valiant;
new npc_alorah_and_grimmin;
new npc_guardian_pavilion;
new npc_vereth_the_cunning;
}
@@ -187,7 +187,7 @@ public:
//expire movement, will prevent from running right back to victim after cast
//(but should MoveChase be used again at a certain time or should he not move?)
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
me->GetMotionMaster()->MovementExpired();
DoCast(me, SPELL_BLINK);
@@ -1982,7 +1982,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::HandleTalkSequence()
Akama->GetMotionMaster()->Clear(false);
// Akama->GetMotionMaster()->MoveIdle();
Akama->SetPosition(x, y, z, 0.0f);
Akama->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_NONE, 0); // Illidan must not die until Akama arrives.
Akama->MonsterMoveWithSpeed(x, y, z, 0); // Illidan must not die until Akama arrives.
Akama->GetMotionMaster()->MoveChase(me);
}
@@ -45,6 +45,7 @@ set(scripts_STAT_SRCS
Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp
Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp
Outland/shattrath_city.cpp
Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp
Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp
Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
Outland/TempestKeep/Mechanar/mechanar.h
@@ -151,7 +151,7 @@ public:
m_bPerformingGroundSlam = false;
//and correct movement, if not already
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE)
{
if (me->getVictim())
me->GetMotionMaster()->MoveChase(me->getVictim());
@@ -820,7 +820,7 @@ class boss_kaelthas : public CreatureScript
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->SetPosition(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0);
me->MonsterMoveWithSpeed(afGravityPos[0], afGravityPos[1], afGravityPos[2], 1);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_FULLPOWER);
@@ -887,7 +887,7 @@ class boss_kaelthas : public CreatureScript
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->SetPosition(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, MOVEMENTFLAG_NONE, 0);
me->MonsterMoveWithSpeed(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
// 1) Kael'thas will portal the whole raid right into his body
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
@@ -0,0 +1,102 @@
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//! TODO - Boss not scripted, just ported required spellscript from core
#include "ScriptMgr.h"
#include "SpellScript.h"
enum Spells
{
SPELL_POSITIVE_CHARGE = 39090,
SPELL_POSITIVE_CHARGE_STACK = 39089,
SPELL_NEGATIVE_CHARGE = 39093,
SPELL_NEGATIVE_CHARGE_STACK = 39092
};
class spell_capacitus_polarity_shift : public SpellScriptLoader
{
public:
spell_capacitus_polarity_shift() : SpellScriptLoader("spell_capacitus_polarity_shift") { }
class spell_capacitus_polarity_shift_SpellScript : public SpellScript
{
PrepareSpellScript(spell_capacitus_polarity_shift_SpellScript);
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_CHARGE))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_POSITIVE_CHARGE_STACK))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_CHARGE))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_NEGATIVE_CHARGE_STACK))
return false;
return true;
}
void HandleTargets(std::list<Unit*>& targetList)
{
uint8 count = 0;
for (std::list<Unit*>::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit)
if ((*ihit)->GetGUID() != GetCaster()->GetGUID())
if (Player* target = (*ihit)->ToPlayer())
if (target->HasAura(GetTriggeringSpell()->Id))
++count;
if (count)
{
uint32 spellId = 0;
if (GetSpellInfo()->Id == SPELL_POSITIVE_CHARGE)
spellId = SPELL_POSITIVE_CHARGE_STACK;
else // if (GetSpellInfo()->Id == SPELL_NEGATIVE_CHARGE)
spellId = SPELL_NEGATIVE_CHARGE_STACK;
GetCaster()->SetAuraStack(spellId, GetCaster(), count);
}
}
void HandleDamage(SpellEffIndex /*effIndex*/)
{
if (!GetTriggeringSpell())
return;
Unit* target = GetHitUnit();
if (target->HasAura(GetTriggeringSpell()->Id))
SetHitDamage(0);
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_shift_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
OnUnitTargetSelect += SpellUnitTargetFn(spell_capacitus_polarity_shift_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_capacitus_polarity_shift_SpellScript();
}
};
void AddSC_boss_mechano_lord_capacitus()
{
new spell_capacitus_polarity_shift();
}
@@ -38,19 +38,18 @@ EndContentData */
enum eMillhouseSays
{
SAY_INTRO_1 = -1552010,
SAY_INTRO_2 = -1552011,
SAY_WATER = -1552012,
SAY_BUFFS = -1552013,
SAY_DRINK = -1552014,
SAY_READY = -1552015,
SAY_KILL_1 = -1552016,
SAY_KILL_2 = -1552017,
SAY_PYRO = -1552018,
SAY_ICEBLOCK = -1552019,
SAY_LOWHP = -1552020,
SAY_DEATH = -1552021,
SAY_COMPLETE = -1552022,
SAY_INTRO_1 = 0,
SAY_INTRO_2 = 1,
SAY_WATER = 2,
SAY_BUFFS = 3,
SAY_DRINK = 4,
SAY_READY = 5,
SAY_KILL = 6,
SAY_PYRO = 7,
SAY_ICEBLOCK = 8,
SAY_LOWHP = 9,
SAY_DEATH = 10,
SAY_COMPLETE = 11,
};
enum eMillhouseSpells
@@ -107,7 +106,7 @@ class npc_millhouse_manastorm : public CreatureScript
Init = true;
if (instance->GetData(TYPE_HARBINGERSKYRISS) == DONE)
DoScriptText(SAY_COMPLETE, me);
Talk(SAY_COMPLETE);
}
}
@@ -126,12 +125,12 @@ class npc_millhouse_manastorm : public CreatureScript
void KilledUnit(Unit* /*victim*/)
{
DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2), me);
Talk(SAY_KILL);
}
void JustDied(Unit* /*victim*/)
{
DoScriptText(SAY_DEATH, me);
Talk(SAY_DEATH);
/*for questId 10886 (heroic mode only)
if (instance && instance->GetData(TYPE_HARBINGERSKYRISS) != DONE)
@@ -149,30 +148,30 @@ class npc_millhouse_manastorm : public CreatureScript
switch (Phase)
{
case 1:
DoScriptText(SAY_INTRO_1, me);
Talk(SAY_INTRO_1);
EventProgress_Timer = 18000;
break;
case 2:
DoScriptText(SAY_INTRO_2, me);
Talk(SAY_INTRO_2);
EventProgress_Timer = 18000;
break;
case 3:
DoScriptText(SAY_WATER, me);
Talk(SAY_WATER);
DoCast(me, SPELL_CONJURE_WATER);
EventProgress_Timer = 7000;
break;
case 4:
DoScriptText(SAY_BUFFS, me);
Talk(SAY_BUFFS);
DoCast(me, SPELL_ICE_ARMOR);
EventProgress_Timer = 7000;
break;
case 5:
DoScriptText(SAY_DRINK, me);
Talk(SAY_DRINK);
DoCast(me, SPELL_ARCANE_INTELLECT);
EventProgress_Timer = 7000;
break;
case 6:
DoScriptText(SAY_READY, me);
Talk(SAY_READY);
EventProgress_Timer = 6000;
break;
case 7:
@@ -192,7 +191,7 @@ class npc_millhouse_manastorm : public CreatureScript
return;
if (!LowHp && HealthBelowPct(20))
{
DoScriptText(SAY_LOWHP, me);
Talk(SAY_LOWHP);
LowHp = true;
}
@@ -201,7 +200,7 @@ class npc_millhouse_manastorm : public CreatureScript
if (me->IsNonMeleeSpellCasted(false))
return;
DoScriptText(SAY_PYRO, me);
Talk(SAY_PYRO);
DoCast(me->getVictim(), SPELL_PYROBLAST);
Pyroblast_Timer = 40000;
@@ -232,14 +231,14 @@ class npc_millhouse_manastorm : public CreatureScript
enum eWardenSays
{
YELL_INTRO1 = -1552023,
YELL_INTRO2 = -1552024,
YELL_RELEASE1 = -1552025,
YELL_RELEASE2A = -1552026,
YELL_RELEASE2B = -1552027,
YELL_RELEASE3 = -1552028,
YELL_RELEASE4 = -1552029,
YELL_WELCOME = -1552030,
YELL_INTRO1 = 0,
YELL_INTRO2 = 1,
YELL_RELEASE1 = 2,
YELL_RELEASE2A = 3,
YELL_RELEASE2B = 4,
YELL_RELEASE3 = 5,
YELL_RELEASE4 = 6,
YELL_WELCOME = 7,
};
enum eWardenUnits
@@ -274,10 +273,10 @@ class npc_warden_mellichar : public CreatureScript
{
public:
npc_warden_mellichar()
: CreatureScript("npc_warden_mellichar")
npc_warden_mellichar() : CreatureScript("npc_warden_mellichar")
{
}
struct npc_warden_mellicharAI : public ScriptedAI
{
npc_warden_mellicharAI(Creature* creature) : ScriptedAI(creature)
@@ -330,7 +329,7 @@ class npc_warden_mellichar : public CreatureScript
void EnterCombat(Unit* /*who*/)
{
DoScriptText(YELL_INTRO1, me);
Talk(YELL_INTRO1);
DoCast(me, SPELL_BUBBLE_VISUAL);
if (instance)
@@ -437,7 +436,7 @@ class npc_warden_mellichar : public CreatureScript
me->SummonCreature(ENTRY_MILLHOUSE, 413.292f, -148.378f, 42.56f, 6.27f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
break;
case 4:
DoScriptText(YELL_RELEASE2B, me);
Talk(YELL_RELEASE2B);
break;
case 5:
switch (urand(0, 1))
@@ -463,7 +462,7 @@ class npc_warden_mellichar : public CreatureScript
break;
case 7:
me->SummonCreature(ENTRY_SKYRISS, 445.763f, -191.639f, 44.64f, 1.60f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
DoScriptText(YELL_WELCOME, me);
Talk(YELL_WELCOME);
break;
}
CanSpawn = false;
@@ -474,17 +473,17 @@ class npc_warden_mellichar : public CreatureScript
switch (Phase)
{
case 1:
DoScriptText(YELL_INTRO2, me);
Talk(YELL_INTRO2);
EventProgress_Timer = 10000;
++Phase;
break;
case 2:
DoScriptText(YELL_RELEASE1, me);
Talk(YELL_RELEASE1);
DoPrepareForPhase();
EventProgress_Timer = 7000;
break;
case 3:
DoScriptText(YELL_RELEASE2A, me);
Talk(YELL_RELEASE2A);
DoPrepareForPhase();
EventProgress_Timer = 10000;
break;
@@ -493,12 +492,12 @@ class npc_warden_mellichar : public CreatureScript
EventProgress_Timer = 15000;
break;
case 5:
DoScriptText(YELL_RELEASE3, me);
Talk(YELL_RELEASE3);
DoPrepareForPhase();
EventProgress_Timer = 15000;
break;
case 6:
DoScriptText(YELL_RELEASE4, me);
Talk(YELL_RELEASE4);
DoPrepareForPhase();
EventProgress_Timer = 15000;
break;
@@ -524,14 +523,16 @@ class npc_warden_mellichar : public CreatureScript
# mob_zerekethvoidzone (this script probably not needed in future -> `creature_template_addon`.`auras`='36120 0')
#####*/
#define SPELL_VOID_ZONE_DAMAGE 36120
enum ZerekethSpell
{
SPELL_VOID_ZONE_DAMAGE = 36120,
};
class mob_zerekethvoidzone : public CreatureScript
{
public:
mob_zerekethvoidzone()
: CreatureScript("mob_zerekethvoidzone")
mob_zerekethvoidzone() : CreatureScript("mob_zerekethvoidzone")
{
}
struct mob_zerekethvoidzoneAI : public ScriptedAI
@@ -555,10 +556,10 @@ class mob_zerekethvoidzone : public CreatureScript
return new mob_zerekethvoidzoneAI(creature);
}
};
void AddSC_arcatraz()
{
new npc_millhouse_manastorm();
new npc_warden_mellichar();
new mob_zerekethvoidzone();
}
+908 -1
View File
@@ -412,6 +412,75 @@ class spell_gen_leeching_swarm : public SpellScriptLoader
}
};
enum EluneCandle
{
NPC_OMEN = 15467,
SPELL_ELUNE_CANDLE_OMEN_HEAD = 26622,
SPELL_ELUNE_CANDLE_OMEN_CHEST = 26624,
SPELL_ELUNE_CANDLE_OMEN_HAND_R = 26625,
SPELL_ELUNE_CANDLE_OMEN_HAND_L = 26649,
SPELL_ELUNE_CANDLE_NORMAL = 26636,
};
class spell_gen_elune_candle : public SpellScriptLoader
{
public:
spell_gen_elune_candle() : SpellScriptLoader("spell_gen_elune_candle") {}
class spell_gen_elune_candle_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_elune_candle_SpellScript);
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HEAD))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_CHEST))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_R))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_OMEN_HAND_L))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_ELUNE_CANDLE_NORMAL))
return false;
return true;
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
{
uint32 spellId = 0;
if (target->GetEntry() == NPC_OMEN)
{
switch (urand(0, 3))
{
case 0: spellId = SPELL_ELUNE_CANDLE_OMEN_HEAD; break;
case 1: spellId = SPELL_ELUNE_CANDLE_OMEN_CHEST; break;
case 2: spellId = SPELL_ELUNE_CANDLE_OMEN_HAND_R; break;
case 3: spellId = SPELL_ELUNE_CANDLE_OMEN_HAND_L; break;
}
}
else
spellId = SPELL_ELUNE_CANDLE_NORMAL;
GetCaster()->CastSpell(target, spellId, true, NULL);
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_gen_elune_candle_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_gen_elune_candle_SpellScript();
}
};
// 24750 Trick
enum eTrickSpells
{
@@ -1445,7 +1514,17 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader
if (GetUnitOwner()->GetTypeId() != TYPEID_PLAYER)
return;
LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*(sLFGMgr->GetSelectedDungeons(GetUnitOwner()->GetGUID()).begin()));
const LfgDungeonSet dungeons = sLFGMgr->GetSelectedDungeons(GetUnitOwner()->GetGUID());
LfgDungeonSet::const_iterator itr = dungeons.begin();
if (itr == dungeons.end())
{
Remove(AURA_REMOVE_BY_DEFAULT);
return;
}
LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*itr);
Group* group = GetUnitOwner()->ToPlayer()->GetGroup();
Map const* map = GetUnitOwner()->GetMap();
if (group && group->isLFGGroup())
@@ -1471,6 +1550,824 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader
}
};
enum DalaranDisguiseSpells
{
SPELL_SUNREAVER_DISGUISE_TRIGGER = 69672,
SPELL_SUNREAVER_DISGUISE_FEMALE = 70973,
SPELL_SUNREAVER_DISGUISE_MALE = 70974,
SPELL_SILVER_COVENANT_DISGUISE_TRIGGER = 69673,
SPELL_SILVER_COVENANT_DISGUISE_FEMALE = 70971,
SPELL_SILVER_COVENANT_DISGUISE_MALE = 70972,
};
class spell_gen_dalaran_disguise : public SpellScriptLoader
{
public:
spell_gen_dalaran_disguise(const char* name) : SpellScriptLoader(name) {}
class spell_gen_dalaran_disguise_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_dalaran_disguise_SpellScript);
bool Validate(SpellInfo const* spellEntry)
{
switch (spellEntry->Id)
{
case SPELL_SUNREAVER_DISGUISE_TRIGGER:
if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_FEMALE))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_SUNREAVER_DISGUISE_MALE))
return false;
break;
case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER:
if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_FEMALE))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_SILVER_COVENANT_DISGUISE_MALE))
return false;
break;
}
return true;
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Player* player = GetHitPlayer())
{
uint8 gender = player->getGender();
uint32 spellId = GetSpellInfo()->Id;
switch (spellId)
{
case SPELL_SUNREAVER_DISGUISE_TRIGGER:
spellId = gender ? SPELL_SUNREAVER_DISGUISE_FEMALE : SPELL_SUNREAVER_DISGUISE_MALE;
break;
case SPELL_SILVER_COVENANT_DISGUISE_TRIGGER:
spellId = gender ? SPELL_SILVER_COVENANT_DISGUISE_FEMALE : SPELL_SILVER_COVENANT_DISGUISE_MALE;
break;
default:
break;
}
GetCaster()->CastSpell(player, spellId, true);
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_gen_dalaran_disguise_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_gen_dalaran_disguise_SpellScript();
}
};
/* DOCUMENTATION: Break-Shield spells
Break-Shield spells can be classified in three groups:
- Spells on vehicle bar used by players:
+ EFFECT_0: SCRIPT_EFFECT
+ EFFECT_1: NONE
+ EFFECT_2: NONE
- Spells casted by players triggered by script:
+ EFFECT_0: SCHOOL_DAMAGE
+ EFFECT_1: SCRIPT_EFFECT
+ EFFECT_2: FORCE_CAST
- Spells casted by NPCs on players:
+ EFFECT_0: SCHOOL_DAMAGE
+ EFFECT_1: SCRIPT_EFFECT
+ EFFECT_2: NONE
In the following script we handle the SCRIPT_EFFECT for effIndex EFFECT_0 and EFFECT_1.
- When handling EFFECT_0 we're in the "Spells on vehicle bar used by players" case
and we'll trigger "Spells casted by players triggered by script"
- When handling EFFECT_1 we're in the "Spells casted by players triggered by script"
or "Spells casted by NPCs on players" so we'll search for the first defend layer and drop it.
*/
enum BreakShieldSpells
{
SPELL_BREAK_SHIELD_DAMAGE_2K = 62626,
SPELL_BREAK_SHIELD_DAMAGE_10K = 64590,
SPELL_BREAK_SHIELD_TRIGGER_FACTION_MOUNTS = 62575, // Also on ToC5 mounts
SPELL_BREAK_SHIELD_TRIGGER_CAMPAING_WARHORSE = 64595,
SPELL_BREAK_SHIELD_TRIGGER_UNK = 66480,
};
class spell_gen_break_shield: public SpellScriptLoader
{
public:
spell_gen_break_shield() : SpellScriptLoader("spell_gen_break_shield") { }
class spell_gen_break_shield_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_break_shield_SpellScript)
void HandleScriptEffect(SpellEffIndex effIndex)
{
Unit* caster = GetCaster();
Unit* target = GetTargetUnit();
if (!caster || !target)
return;
switch (effIndex)
{
case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual)
uint32 spellId;
switch (GetSpellInfo()->Id)
{
case SPELL_BREAK_SHIELD_TRIGGER_UNK:
case SPELL_BREAK_SHIELD_TRIGGER_CAMPAING_WARHORSE:
spellId = SPELL_BREAK_SHIELD_DAMAGE_10K;
break;
case SPELL_BREAK_SHIELD_TRIGGER_FACTION_MOUNTS:
spellId = SPELL_BREAK_SHIELD_DAMAGE_2K;
break;
default:
return;
}
if (Unit* rider = caster->GetCharmer())
rider->CastSpell(target, spellId, false);
else
caster->CastSpell(target, spellId, false);
break;
case EFFECT_1: // On damaging spells, for removing the a defend layer
Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
Aura* aura = itr->second->GetBase();
SpellInfo const* auraInfo = aura->GetSpellInfo();
if (aura && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
}
break;
}
}
void Register()
{
OnEffectHit += SpellEffectFn(spell_gen_break_shield_SpellScript::HandleScriptEffect, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_gen_break_shield_SpellScript();
}
};
/* DOCUMENTATION: Charge spells
Charge spells can be classified in four groups:
- Spells on vehicle bar used by players:
+ EFFECT_0: SCRIPT_EFFECT
+ EFFECT_1: TRIGGER_SPELL
+ EFFECT_2: NONE
- Spells casted by player's mounts triggered by script:
+ EFFECT_0: CHARGE
+ EFFECT_1: TRIGGER_SPELL
+ EFFECT_2: APPLY_AURA
- Spells casted by players on the target triggered by script:
+ EFFECT_0: SCHOOL_DAMAGE
+ EFFECT_1: SCRIPT_EFFECT
+ EFFECT_2: NONE
- Spells casted by NPCs on players:
+ EFFECT_0: SCHOOL_DAMAGE
+ EFFECT_1: CHARGE
+ EFFECT_2: SCRIPT_EFFECT
In the following script we handle the SCRIPT_EFFECT and CHARGE
- When handling SCRIPT_EFFECT:
+ EFFECT_0: Corresponds to "Spells on vehicle bar used by players" and we make player's mount cast
the charge effect on the current target ("Spells casted by player's mounts triggered by script").
+ EFFECT_1 and EFFECT_2: Triggered when "Spells casted by player's mounts triggered by script" hits target,
corresponding to "Spells casted by players on the target triggered by script" and "Spells casted by
NPCs on players" and we check Defend layers and drop a charge of the first found.
- When handling CHARGE:
+ Only launched for "Spells casted by player's mounts triggered by script", makes the player cast the
damaging spell on target with a small chance of failing it.
*/
enum ChargeSpells
{
SPELL_CHARGE_DAMAGE_8K5 = 62874,
SPELL_CHARGE_DAMAGE_20K = 68498,
SPELL_CHARGE_DAMAGE_45K = 64591,
SPELL_CHARGE_CHARGING_EFFECT_8K5 = 63661,
SPELL_CHARGE_CHARGING_EFFECT_20K_1 = 68284,
SPELL_CHARGE_CHARGING_EFFECT_20K_2 = 68501,
SPELL_CHARGE_CHARGING_EFFECT_45K_1 = 62563,
SPELL_CHARGE_CHARGING_EFFECT_45K_2 = 66481,
SPELL_CHARGE_TRIGGER_FACTION_MOUNTS = 62960,
SPELL_CHARGE_TRIGGER_TRIAL_CHAMPION = 68282,
SPELL_CHARGE_MISS_EFFECT = 62977,
};
class spell_gen_mounted_charge: public SpellScriptLoader
{
public:
spell_gen_mounted_charge() : SpellScriptLoader("spell_gen_mounted_charge") { }
class spell_gen_mounted_charge_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_mounted_charge_SpellScript)
void HandleScriptEffect(SpellEffIndex effIndex)
{
Unit* caster = GetCaster();
Unit* target = GetTargetUnit();
if (!caster || !target)
return;
switch (effIndex)
{
case EFFECT_0: // On spells wich trigger the damaging spell (and also the visual)
uint32 spellId;
switch (GetSpellInfo()->Id)
{
case SPELL_CHARGE_TRIGGER_TRIAL_CHAMPION:
spellId = SPELL_CHARGE_CHARGING_EFFECT_20K_1;
case SPELL_CHARGE_TRIGGER_FACTION_MOUNTS:
spellId = SPELL_CHARGE_CHARGING_EFFECT_8K5;
break;
default:
return;
}
if (Unit* vehicle = caster->GetVehicleBase())
vehicle->CastSpell(target, spellId, false);
else
caster->CastSpell(target, spellId, false);
break;
case EFFECT_1: // On damaging spells, for removing the a defend layer
case EFFECT_2:
Unit::AuraApplicationMap const& auras = target->GetAppliedAuras();
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
Aura* aura = itr->second->GetBase();
SpellInfo const* auraInfo = aura->GetSpellInfo();
if (aura && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
}
break;
}
}
void HandleChargeEffect(SpellEffIndex effIndex)
{
Unit* caster = GetCaster();
Unit* target = GetTargetUnit();
if (!caster || !target)
return;
uint32 spellId;
switch (GetSpellInfo()->Id)
{
case SPELL_CHARGE_CHARGING_EFFECT_8K5:
spellId = SPELL_CHARGE_DAMAGE_8K5;
break;
case SPELL_CHARGE_CHARGING_EFFECT_20K_1:
case SPELL_CHARGE_CHARGING_EFFECT_20K_2:
spellId = SPELL_CHARGE_DAMAGE_20K;
break;
case SPELL_CHARGE_CHARGING_EFFECT_45K_1:
case SPELL_CHARGE_CHARGING_EFFECT_45K_2:
spellId = SPELL_CHARGE_DAMAGE_45K;
break;
default:
return;
}
// If target isn't a training dummy there's a chance of failing the charge
if (!target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE) && urand(0,7) == 0)
spellId = SPELL_CHARGE_MISS_EFFECT;
if (Unit* rider = caster->GetCharmer())
rider->CastSpell(target, spellId, false);
else
caster->CastSpell(target, spellId, false);
}
void Register()
{
SpellInfo const* spell = sSpellMgr->GetSpellInfo(m_scriptSpellId);
if (spell->HasEffect(SPELL_EFFECT_SCRIPT_EFFECT))
OnEffectHit += SpellEffectFn(spell_gen_mounted_charge_SpellScript::HandleScriptEffect, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT);
if (spell->Effects[EFFECT_0].Effect == SPELL_EFFECT_CHARGE)
OnEffectHit += SpellEffectFn(spell_gen_mounted_charge_SpellScript::HandleChargeEffect, EFFECT_0, SPELL_EFFECT_CHARGE);
}
};
SpellScript* GetSpellScript() const
{
return new spell_gen_mounted_charge_SpellScript();
}
};
enum DefendVisuals
{
SPELL_VISUAL_SHIELD_1 = 63130,
SPELL_VISUAL_SHIELD_2 = 63131,
SPELL_VISUAL_SHIELD_3 = 63132,
};
class spell_gen_defend : public SpellScriptLoader
{
public:
spell_gen_defend() : SpellScriptLoader("spell_gen_defend") { }
class spell_gen_defendAuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_defendAuraScript);
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_1))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_2))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_3))
return false;
return true;
}
void RefreshVisualShields(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
Unit* target = GetTarget();
if(!target)
return;
if (!caster)
{
target->RemoveAurasDueToSpell(GetId());
return;
}
for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
target->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i);
target->CastSpell(target, SPELL_VISUAL_SHIELD_1 + GetAura()->GetStackAmount() - 1);
}
void RemoveVisualShields(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
if(!target)
return;
for (uint8 i = 0; i < GetSpellInfo()->StackAmount; ++i)
target->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i);
}
void RemoveDummyFromDriver(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (caster && caster->ToTempSummon())
if (Unit* rider = caster->ToTempSummon()->GetSummoner())
rider->RemoveAurasDueToSpell(GetId());
}
void Register()
{
SpellInfo const* spell = sSpellMgr->GetSpellInfo(m_scriptSpellId);
// Defend spells casted by NPCs (add visuals)
if (spell->Effects[EFFECT_0].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)
{
AfterEffectApply += AuraEffectApplyFn(spell_gen_defendAuraScript::RefreshVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
OnEffectRemove += AuraEffectRemoveFn(spell_gen_defendAuraScript::RemoveVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL);
}
// Remove Defend spell from player when he dismounts
if (spell->Effects[EFFECT_2].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN)
OnEffectRemove += AuraEffectRemoveFn(spell_gen_defendAuraScript::RemoveDummyFromDriver, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL);
// Defend spells casted by players (add/remove visuals)
if (spell->Effects[EFFECT_1].ApplyAuraName == SPELL_AURA_DUMMY)
{
AfterEffectApply += AuraEffectApplyFn(spell_gen_defendAuraScript::RefreshVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
OnEffectRemove += AuraEffectRemoveFn(spell_gen_defendAuraScript::RemoveVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
}
};
AuraScript* GetAuraScript() const
{
return new spell_gen_defendAuraScript();
}
};
enum MountedDuelSpells
{
SPELL_ON_TOURNAMENT_MOUNT = 63034,
SPELL_MOUNTED_DUEL = 62875,
};
class spell_gen_tournament_duel : public SpellScriptLoader
{
public:
spell_gen_tournament_duel() : SpellScriptLoader("spell_gen_tournament_duel") { }
class spell_gen_tournament_duel_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_tournament_duel_SpellScript);
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_ON_TOURNAMENT_MOUNT))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_MOUNTED_DUEL))
return false;
return true;
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
Unit* caster = GetCaster();
Unit* target = GetTargetUnit();
Unit* player = GetCaster()->GetCharmer();
if (!caster || !target || !player)
return;
if (target->GetTypeId() == TYPEID_PLAYER)
{
if (!target->HasAura(SPELL_ON_TOURNAMENT_MOUNT) || !target->GetVehicleBase())
return;
player->CastSpell(target, SPELL_MOUNTED_DUEL, true);
}
else if (target->GetTypeId() == TYPEID_UNIT)
{
if (!target->GetCharmer() || target->GetCharmer()->GetTypeId() != TYPEID_PLAYER || !target->GetCharmer()->HasAura(SPELL_ON_TOURNAMENT_MOUNT))
return;
player->CastSpell(target->GetCharmer(), SPELL_MOUNTED_DUEL, true);
}
}
void Register()
{
OnEffectHit += SpellEffectFn(spell_gen_tournament_duel_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_gen_tournament_duel_SpellScript();
}
};
enum TournamentMountsSpells
{
SPELL_LANCE_EQUIPPED = 62853,
};
class spell_gen_summon_tournament_mount : public SpellScriptLoader
{
public:
spell_gen_summon_tournament_mount() : SpellScriptLoader("spell_gen_summon_tournament_mount") { }
class spell_gen_summon_tournament_mount_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_summon_tournament_mount_SpellScript);
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_LANCE_EQUIPPED))
return false;
return true;
}
SpellCastResult CheckIfLanceEquiped()
{
Unit* caster = GetCaster();
if (!caster->HasAura(SPELL_LANCE_EQUIPPED))
{
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_LANCE_EQUIPPED);
return SPELL_FAILED_CUSTOM_ERROR;
}
return SPELL_CAST_OK;
}
void Register()
{
OnCheckCast += SpellCheckCastFn(spell_gen_summon_tournament_mount_SpellScript::CheckIfLanceEquiped);
}
};
SpellScript* GetSpellScript() const
{
return new spell_gen_summon_tournament_mount_SpellScript();
}
};
enum TournamentPennantSpells
{
SPELL_PENNANT_STORMWIND_ASPIRANT = 62595,
SPELL_PENNANT_STORMWIND_VALIANT = 62596,
SPELL_PENNANT_STORMWIND_CHAMPION = 62594,
SPELL_PENNANT_GNOMEREGAN_ASPIRANT = 63394,
SPELL_PENNANT_GNOMEREGAN_VALIANT = 63395,
SPELL_PENNANT_GNOMEREGAN_CHAMPION = 63396,
SPELL_PENNANT_SEN_JIN_ASPIRANT = 63397,
SPELL_PENNANT_SEN_JIN_VALIANT = 63398,
SPELL_PENNANT_SEN_JIN_CHAMPION = 63399,
SPELL_PENNANT_SILVERMOON_ASPIRANT = 63401,
SPELL_PENNANT_SILVERMOON_VALIANT = 63402,
SPELL_PENNANT_SILVERMOON_CHAMPION = 63403,
SPELL_PENNANT_DARNASSUS_ASPIRANT = 63404,
SPELL_PENNANT_DARNASSUS_VALIANT = 63405,
SPELL_PENNANT_DARNASSUS_CHAMPION = 63406,
SPELL_PENNANT_EXODAR_ASPIRANT = 63421,
SPELL_PENNANT_EXODAR_VALIANT = 63422,
SPELL_PENNANT_EXODAR_CHAMPION = 63423,
SPELL_PENNANT_IRONFORGE_ASPIRANT = 63425,
SPELL_PENNANT_IRONFORGE_VALIANT = 63426,
SPELL_PENNANT_IRONFORGE_CHAMPION = 63427,
SPELL_PENNANT_UNDERCITY_ASPIRANT = 63428,
SPELL_PENNANT_UNDERCITY_VALIANT = 63429,
SPELL_PENNANT_UNDERCITY_CHAMPION = 63430,
SPELL_PENNANT_ORGRIMMAR_ASPIRANT = 63431,
SPELL_PENNANT_ORGRIMMAR_VALIANT = 63432,
SPELL_PENNANT_ORGRIMMAR_CHAMPION = 63433,
SPELL_PENNANT_THUNDER_BLUFF_ASPIRANT = 63434,
SPELL_PENNANT_THUNDER_BLUFF_VALIANT = 63435,
SPELL_PENNANT_THUNDER_BLUFF_CHAMPION = 63436,
SPELL_PENNANT_ARGENT_CRUSADE_ASPIRANT = 63606,
SPELL_PENNANT_ARGENT_CRUSADE_VALIANT = 63500,
SPELL_PENNANT_ARGENT_CRUSADE_CHAMPION = 63501,
SPELL_PENNANT_EBON_BLADE_ASPIRANT = 63607,
SPELL_PENNANT_EBON_BLADE_VALIANT = 63608,
SPELL_PENNANT_EBON_BLADE_CHAMPION = 63609,
};
enum TournamentMounts
{
NPC_STORMWIND_STEED = 33217,
NPC_IRONFORGE_RAM = 33316,
NPC_GNOMEREGAN_MECHANOSTRIDER = 33317,
NPC_EXODAR_ELEKK = 33318,
NPC_DARNASSIAN_NIGHTSABER = 33319,
NPC_ORGRIMMAR_WOLF = 33320,
NPC_DARK_SPEAR_RAPTOR = 33321,
NPC_THUNDER_BLUFF_KODO = 33322,
NPC_SILVERMOON_HAWKSTRIDER = 33323,
NPC_FORSAKEN_WARHORSE = 33324,
NPC_ARGENT_WARHORSE = 33782,
NPC_ARGENT_STEED_ASPIRANT = 33845,
NPC_ARGENT_HAWKSTRIDER_ASPIRANT = 33844,
};
enum TournamentQuestsAchievements
{
ACHIEVEMENT_CHAMPION_STORMWIND = 2781,
ACHIEVEMENT_CHAMPION_DARNASSUS = 2777,
ACHIEVEMENT_CHAMPION_IRONFORGE = 2780,
ACHIEVEMENT_CHAMPION_GNOMEREGAN = 2779,
ACHIEVEMENT_CHAMPION_THE_EXODAR = 2778,
ACHIEVEMENT_CHAMPION_ORGRIMMAR = 2783,
ACHIEVEMENT_CHAMPION_SEN_JIN = 2784,
ACHIEVEMENT_CHAMPION_THUNDER_BLUFF = 2786,
ACHIEVEMENT_CHAMPION_UNDERCITY = 2787,
ACHIEVEMENT_CHAMPION_SILVERMOON = 2785,
ACHIEVEMENT_ARGENT_VALOR = 2758,
ACHIEVEMENT_CHAMPION_ALLIANCE = 2782,
ACHIEVEMENT_CHAMPION_HORDE = 2788,
QUEST_VALIANT_OF_STORMWIND = 13593,
QUEST_A_VALIANT_OF_STORMWIND = 13684,
QUEST_VALIANT_OF_DARNASSUS = 13706,
QUEST_A_VALIANT_OF_DARNASSUS = 13689,
QUEST_VALIANT_OF_IRONFORGE = 13703,
QUEST_A_VALIANT_OF_IRONFORGE = 13685,
QUEST_VALIANT_OF_GNOMEREGAN = 13704,
QUEST_A_VALIANT_OF_GNOMEREGAN = 13688,
QUEST_VALIANT_OF_THE_EXODAR = 13705,
QUEST_A_VALIANT_OF_THE_EXODAR = 13690,
QUEST_VALIANT_OF_ORGRIMMAR = 13707,
QUEST_A_VALIANT_OF_ORGRIMMAR = 13691,
QUEST_VALIANT_OF_SEN_JIN = 13708,
QUEST_A_VALIANT_OF_SEN_JIN = 13693,
QUEST_VALIANT_OF_THUNDER_BLUFF = 13709,
QUEST_A_VALIANT_OF_THUNDER_BLUFF = 13694,
QUEST_VALIANT_OF_UNDERCITY = 13710,
QUEST_A_VALIANT_OF_UNDERCITY = 13695,
QUEST_VALIANT_OF_SILVERMOON = 13711,
QUEST_A_VALIANT_OF_SILVERMOON = 13696,
};
class spell_gen_on_tournament_mount : public SpellScriptLoader
{
public:
spell_gen_on_tournament_mount() : SpellScriptLoader("spell_gen_on_tournament_mount") { }
class spell_gen_on_tournament_mountAuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_on_tournament_mountAuraScript);
uint32 _pennantSpellId;
bool Load()
{
_pennantSpellId = 0;
return (GetCaster()->GetTypeId() == TYPEID_PLAYER);
}
void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (caster && caster->GetVehicleBase())
{
_pennantSpellId = GetPennatSpellId(caster->ToPlayer(), caster->GetVehicleBase());
caster->CastSpell(caster, _pennantSpellId,true);
}
}
void HandleRemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (caster)
caster->RemoveAurasDueToSpell(_pennantSpellId);
}
uint32 GetPennatSpellId(Player* player, Unit* mount)
{
switch (mount->GetEntry())
{
case NPC_ARGENT_STEED_ASPIRANT:
case NPC_STORMWIND_STEED:
{
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_STORMWIND))
return SPELL_PENNANT_STORMWIND_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_STORMWIND) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_STORMWIND))
return SPELL_PENNANT_STORMWIND_VALIANT;
else
return SPELL_PENNANT_STORMWIND_ASPIRANT;
}
case NPC_GNOMEREGAN_MECHANOSTRIDER:
{
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_GNOMEREGAN))
return SPELL_PENNANT_GNOMEREGAN_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_GNOMEREGAN) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_GNOMEREGAN))
return SPELL_PENNANT_GNOMEREGAN_VALIANT;
else
return SPELL_PENNANT_GNOMEREGAN_ASPIRANT;
}
case NPC_DARK_SPEAR_RAPTOR:
{
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_SEN_JIN))
return SPELL_PENNANT_SEN_JIN_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_SEN_JIN) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_SEN_JIN))
return SPELL_PENNANT_SEN_JIN_VALIANT;
else
return SPELL_PENNANT_SEN_JIN_ASPIRANT;
}
case NPC_ARGENT_HAWKSTRIDER_ASPIRANT:
case NPC_SILVERMOON_HAWKSTRIDER:
{
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_SILVERMOON))
return SPELL_PENNANT_SILVERMOON_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_SILVERMOON) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_SILVERMOON))
return SPELL_PENNANT_SILVERMOON_VALIANT;
else
return SPELL_PENNANT_SILVERMOON_ASPIRANT;
}
case NPC_DARNASSIAN_NIGHTSABER:
{
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_DARNASSUS))
return SPELL_PENNANT_DARNASSUS_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_DARNASSUS) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_DARNASSUS))
return SPELL_PENNANT_DARNASSUS_VALIANT;
else
return SPELL_PENNANT_DARNASSUS_ASPIRANT;
}
case NPC_EXODAR_ELEKK:
{
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_THE_EXODAR))
return SPELL_PENNANT_EXODAR_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_THE_EXODAR) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_THE_EXODAR))
return SPELL_PENNANT_EXODAR_VALIANT;
else
return SPELL_PENNANT_EXODAR_ASPIRANT;
}
case NPC_IRONFORGE_RAM:
{
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_IRONFORGE))
return SPELL_PENNANT_IRONFORGE_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_IRONFORGE) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_IRONFORGE))
return SPELL_PENNANT_IRONFORGE_VALIANT;
else
return SPELL_PENNANT_IRONFORGE_ASPIRANT;
}
case NPC_FORSAKEN_WARHORSE:
{
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_UNDERCITY))
return SPELL_PENNANT_UNDERCITY_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_UNDERCITY) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_UNDERCITY))
return SPELL_PENNANT_UNDERCITY_VALIANT;
else
return SPELL_PENNANT_UNDERCITY_ASPIRANT;
}
case NPC_ORGRIMMAR_WOLF:
{
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_ORGRIMMAR))
return SPELL_PENNANT_ORGRIMMAR_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_ORGRIMMAR) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_ORGRIMMAR))
return SPELL_PENNANT_ORGRIMMAR_VALIANT;
else
return SPELL_PENNANT_ORGRIMMAR_ASPIRANT;
}
case NPC_THUNDER_BLUFF_KODO:
{
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_THUNDER_BLUFF))
return SPELL_PENNANT_THUNDER_BLUFF_CHAMPION;
else if (player->GetQuestRewardStatus(QUEST_VALIANT_OF_THUNDER_BLUFF) || player->GetQuestRewardStatus(QUEST_A_VALIANT_OF_THUNDER_BLUFF))
return SPELL_PENNANT_THUNDER_BLUFF_VALIANT;
else
return SPELL_PENNANT_THUNDER_BLUFF_ASPIRANT;
}
case NPC_ARGENT_WARHORSE:
{
if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_ALLIANCE) || player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_CHAMPION_HORDE))
return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_CHAMPION : SPELL_PENNANT_ARGENT_CRUSADE_CHAMPION;
else if (player->GetAchievementMgr().HasAchieved(ACHIEVEMENT_ARGENT_VALOR))
return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_VALIANT : SPELL_PENNANT_ARGENT_CRUSADE_VALIANT;
else
return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_ASPIRANT : SPELL_PENNANT_ARGENT_CRUSADE_ASPIRANT;
}
default:
return 0;
}
}
void Register()
{
AfterEffectApply += AuraEffectApplyFn(spell_gen_on_tournament_mountAuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
OnEffectRemove += AuraEffectRemoveFn(spell_gen_on_tournament_mountAuraScript::HandleRemoveEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
AuraScript* GetAuraScript() const
{
return new spell_gen_on_tournament_mountAuraScript();
}
};
class spell_gen_tournament_pennant : public SpellScriptLoader
{
public:
spell_gen_tournament_pennant() : SpellScriptLoader("spell_gen_tournament_pennant") { }
class spell_gen_tournament_pennantAuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_tournament_pennantAuraScript);
void HandleApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (caster && caster->GetTypeId() == TYPEID_PLAYER && !caster->GetVehicleBase())
caster->RemoveAurasDueToSpell(GetId());
}
void Register()
{
OnEffectApply += AuraEffectApplyFn(spell_gen_tournament_pennantAuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
AuraScript* GetAuraScript() const
{
return new spell_gen_tournament_pennantAuraScript();
}
};
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -1504,4 +2401,14 @@ void AddSC_generic_spell_scripts()
new spell_gen_oracle_wolvar_reputation();
new spell_gen_damage_reduction_aura();
new spell_gen_luck_of_the_draw();
new spell_gen_dalaran_disguise("spell_gen_sunreaver_disguise");
new spell_gen_dalaran_disguise("spell_gen_silver_covenant_disguise");
new spell_gen_elune_candle();
new spell_gen_break_shield();
new spell_gen_mounted_charge();
new spell_gen_defend();
new spell_gen_tournament_duel();
new spell_gen_summon_tournament_mount();
new spell_gen_on_tournament_mount();
new spell_gen_tournament_pennant();
}
+46
View File
@@ -1128,6 +1128,51 @@ class spell_magic_eater_food : public SpellScriptLoader
}
};
enum Refocus
{
SPELL_AIMED_SHOT = 19434,
SPELL_MULTISHOT = 2643,
SPELL_VOLLEY = 42243,
};
class spell_item_refocus : public SpellScriptLoader
{
public:
spell_item_refocus() : SpellScriptLoader("spell_item_refocus") { }
class spell_item_refocus_SpellScript : public SpellScript
{
PrepareSpellScript(spell_item_refocus_SpellScript);
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
if (!caster || caster->getClass() != CLASS_HUNTER)
return;
if (caster->HasSpellCooldown(SPELL_AIMED_SHOT))
caster->RemoveSpellCooldown(SPELL_AIMED_SHOT, true);
if (caster->HasSpellCooldown(SPELL_MULTISHOT))
caster->RemoveSpellCooldown(SPELL_MULTISHOT, true);
if (caster->HasSpellCooldown(SPELL_VOLLEY))
caster->RemoveSpellCooldown(SPELL_VOLLEY, true);
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_item_refocus_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_item_refocus_SpellScript();
}
};
void AddSC_item_spell_scripts()
{
// 23074 Arcanite Dragonling
@@ -1160,4 +1205,5 @@ void AddSC_item_spell_scripts()
new spell_item_ashbringer();
new spell_magic_eater_food();
new spell_item_refocus();
}
@@ -285,6 +285,17 @@ class achievement_bg_sa_defense_of_ancients : public AchievementCriteriaScript
}
};
class achievement_tilted : public AchievementCriteriaScript
{
public:
achievement_tilted() : AchievementCriteriaScript("achievement_tilted") {}
bool OnCheck(Player* player, Unit* /*target*/)
{
return player && player->duel && player->duel->isMounted;
}
};
void AddSC_achievement_scripts()
{
new achievement_resilient_victory();
@@ -302,4 +313,5 @@ void AddSC_achievement_scripts()
new achievement_arena_kills("achievement_arena_3v3_kills", ARENA_TYPE_3v3);
new achievement_arena_kills("achievement_arena_5v5_kills", ARENA_TYPE_5v5);
new achievement_bg_sa_defense_of_ancients();
new achievement_tilted();
}
+1 -1
View File
@@ -179,7 +179,7 @@ public:
globalCooldown = GENERIC_CREATURE_COOLDOWN;
} //If no spells available and we arn't moving run to target
else if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
else if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE)
{
//Cancel our current spell and then mutate new movement generator
me->InterruptNonMeleeSpells(false);
+281
View File
@@ -40,6 +40,7 @@ npc_sayge 100% Darkmoon event fortune teller, buff player based
npc_snake_trap_serpents 80% AI for snakes that summoned by Snake Trap
npc_shadowfiend 100% restore 5% of owner's mana when shadowfiend die from damage
npc_locksmith 75% list of keys needs to be confirmed
npc_firework 100% NPC's summoned by rockets and rocket clusters, for making them cast visual
EndContentData */
#include "ScriptPCH.h"
@@ -2764,6 +2765,285 @@ public:
}
};
enum Fireworks
{
NPC_OMEN = 15467,
NPC_MINION_OF_OMEN = 15466,
NPC_FIREWORK_BLUE = 15879,
NPC_FIREWORK_GREEN = 15880,
NPC_FIREWORK_PURPLE = 15881,
NPC_FIREWORK_RED = 15882,
NPC_FIREWORK_YELLOW = 15883,
NPC_FIREWORK_WHITE = 15884,
NPC_FIREWORK_BIG_BLUE = 15885,
NPC_FIREWORK_BIG_GREEN = 15886,
NPC_FIREWORK_BIG_PURPLE = 15887,
NPC_FIREWORK_BIG_RED = 15888,
NPC_FIREWORK_BIG_YELLOW = 15889,
NPC_FIREWORK_BIG_WHITE = 15890,
NPC_CLUSTER_BLUE = 15872,
NPC_CLUSTER_RED = 15873,
NPC_CLUSTER_GREEN = 15874,
NPC_CLUSTER_PURPLE = 15875,
NPC_CLUSTER_WHITE = 15876,
NPC_CLUSTER_YELLOW = 15877,
NPC_CLUSTER_BIG_BLUE = 15911,
NPC_CLUSTER_BIG_GREEN = 15912,
NPC_CLUSTER_BIG_PURPLE = 15913,
NPC_CLUSTER_BIG_RED = 15914,
NPC_CLUSTER_BIG_WHITE = 15915,
NPC_CLUSTER_BIG_YELLOW = 15916,
NPC_CLUSTER_ELUNE = 15918,
GO_FIREWORK_LAUNCHER_1 = 180771,
GO_FIREWORK_LAUNCHER_2 = 180868,
GO_FIREWORK_LAUNCHER_3 = 180850,
GO_CLUSTER_LAUNCHER_1 = 180772,
GO_CLUSTER_LAUNCHER_2 = 180859,
GO_CLUSTER_LAUNCHER_3 = 180869,
GO_CLUSTER_LAUNCHER_4 = 180874,
SPELL_ROCKET_BLUE = 26344,
SPELL_ROCKET_GREEN = 26345,
SPELL_ROCKET_PURPLE = 26346,
SPELL_ROCKET_RED = 26347,
SPELL_ROCKET_WHITE = 26348,
SPELL_ROCKET_YELLOW = 26349,
SPELL_ROCKET_BIG_BLUE = 26351,
SPELL_ROCKET_BIG_GREEN = 26352,
SPELL_ROCKET_BIG_PURPLE = 26353,
SPELL_ROCKET_BIG_RED = 26354,
SPELL_ROCKET_BIG_WHITE = 26355,
SPELL_ROCKET_BIG_YELLOW = 26356,
SPELL_LUNAR_FORTUNE = 26522,
ANIM_GO_LAUNCH_FIREWORK = 3,
ZONE_MOONGLADE = 493,
};
Position omenSummonPos = {7558.993f, -2839.999f, 450.0214f, 4.46f};
class npc_firework : public CreatureScript
{
public:
npc_firework() : CreatureScript("npc_firework") { }
struct npc_fireworkAI : public ScriptedAI
{
npc_fireworkAI(Creature* creature) : ScriptedAI(creature) {}
bool isCluster()
{
switch (me->GetEntry())
{
case NPC_FIREWORK_BLUE:
case NPC_FIREWORK_GREEN:
case NPC_FIREWORK_PURPLE:
case NPC_FIREWORK_RED:
case NPC_FIREWORK_YELLOW:
case NPC_FIREWORK_WHITE:
case NPC_FIREWORK_BIG_BLUE:
case NPC_FIREWORK_BIG_GREEN:
case NPC_FIREWORK_BIG_PURPLE:
case NPC_FIREWORK_BIG_RED:
case NPC_FIREWORK_BIG_YELLOW:
case NPC_FIREWORK_BIG_WHITE:
return false;
case NPC_CLUSTER_BLUE:
case NPC_CLUSTER_GREEN:
case NPC_CLUSTER_PURPLE:
case NPC_CLUSTER_RED:
case NPC_CLUSTER_YELLOW:
case NPC_CLUSTER_WHITE:
case NPC_CLUSTER_BIG_BLUE:
case NPC_CLUSTER_BIG_GREEN:
case NPC_CLUSTER_BIG_PURPLE:
case NPC_CLUSTER_BIG_RED:
case NPC_CLUSTER_BIG_YELLOW:
case NPC_CLUSTER_BIG_WHITE:
case NPC_CLUSTER_ELUNE:
default:
return true;
}
}
GameObject* FindNearestLauncher()
{
GameObject* launcher = NULL;
if (isCluster())
{
GameObject* launcher1 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_1, 0.5f);
GameObject* launcher2 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_2, 0.5f);
GameObject* launcher3 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_3, 0.5f);
GameObject* launcher4 = GetClosestGameObjectWithEntry(me, GO_CLUSTER_LAUNCHER_4, 0.5f);
if (launcher1)
launcher = launcher1;
else if (launcher2)
launcher = launcher2;
else if (launcher3)
launcher = launcher3;
else if (launcher4)
launcher = launcher4;
}
else
{
GameObject* launcher1 = GetClosestGameObjectWithEntry(me, GO_FIREWORK_LAUNCHER_1, 0.5f);
GameObject* launcher2 = GetClosestGameObjectWithEntry(me, GO_FIREWORK_LAUNCHER_2, 0.5f);
GameObject* launcher3 = GetClosestGameObjectWithEntry(me, GO_FIREWORK_LAUNCHER_3, 0.5f);
if (launcher1)
launcher = launcher1;
else if (launcher2)
launcher = launcher2;
else if (launcher3)
launcher = launcher3;
}
return launcher;
}
uint32 GetFireworkSpell(uint32 entry)
{
switch (entry)
{
case NPC_FIREWORK_BLUE:
return SPELL_ROCKET_BLUE;
case NPC_FIREWORK_GREEN:
return SPELL_ROCKET_GREEN;
case NPC_FIREWORK_PURPLE:
return SPELL_ROCKET_PURPLE;
case NPC_FIREWORK_RED:
return SPELL_ROCKET_RED;
case NPC_FIREWORK_YELLOW:
return SPELL_ROCKET_YELLOW;
case NPC_FIREWORK_WHITE:
return SPELL_ROCKET_WHITE;
case NPC_FIREWORK_BIG_BLUE:
return SPELL_ROCKET_BIG_BLUE;
case NPC_FIREWORK_BIG_GREEN:
return SPELL_ROCKET_BIG_GREEN;
case NPC_FIREWORK_BIG_PURPLE:
return SPELL_ROCKET_BIG_PURPLE;
case NPC_FIREWORK_BIG_RED:
return SPELL_ROCKET_BIG_RED;
case NPC_FIREWORK_BIG_YELLOW:
return SPELL_ROCKET_BIG_YELLOW;
case NPC_FIREWORK_BIG_WHITE:
return SPELL_ROCKET_BIG_WHITE;
default:
return 0;
}
}
uint32 GetFireworkGameObjectId()
{
uint32 spellId = 0;
switch (me->GetEntry())
{
case NPC_CLUSTER_BLUE:
spellId = GetFireworkSpell(NPC_FIREWORK_BLUE);
break;
case NPC_CLUSTER_GREEN:
spellId = GetFireworkSpell(NPC_FIREWORK_GREEN);
break;
case NPC_CLUSTER_PURPLE:
spellId = GetFireworkSpell(NPC_FIREWORK_PURPLE);
break;
case NPC_CLUSTER_RED:
spellId = GetFireworkSpell(NPC_FIREWORK_RED);
break;
case NPC_CLUSTER_YELLOW:
spellId = GetFireworkSpell(NPC_FIREWORK_YELLOW);
break;
case NPC_CLUSTER_WHITE:
spellId = GetFireworkSpell(NPC_FIREWORK_WHITE);
break;
case NPC_CLUSTER_BIG_BLUE:
spellId = GetFireworkSpell(NPC_FIREWORK_BIG_BLUE);
break;
case NPC_CLUSTER_BIG_GREEN:
spellId = GetFireworkSpell(NPC_FIREWORK_BIG_GREEN);
break;
case NPC_CLUSTER_BIG_PURPLE:
spellId = GetFireworkSpell(NPC_FIREWORK_BIG_PURPLE);
break;
case NPC_CLUSTER_BIG_RED:
spellId = GetFireworkSpell(NPC_FIREWORK_BIG_RED);
break;
case NPC_CLUSTER_BIG_YELLOW:
spellId = GetFireworkSpell(NPC_FIREWORK_BIG_YELLOW);
break;
case NPC_CLUSTER_BIG_WHITE:
spellId = GetFireworkSpell(NPC_FIREWORK_BIG_WHITE);
break;
case NPC_CLUSTER_ELUNE:
spellId = GetFireworkSpell(urand(NPC_FIREWORK_BLUE, NPC_FIREWORK_WHITE));
break;
}
const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (spellInfo && spellInfo->Effects[0].Effect == SPELL_EFFECT_SUMMON_OBJECT_WILD)
return spellInfo->Effects[0].MiscValue;
return 0;
}
void Reset()
{
if (GameObject* launcher = FindNearestLauncher())
{
launcher->SendCustomAnim(ANIM_GO_LAUNCH_FIREWORK);
me->SetOrientation(launcher->GetOrientation() + M_PI/2);
}
else
return;
if (isCluster())
{
// Check if we are near Elune'ara lake south, if so try to summon Omen or a minion
if (me->GetZoneId() == ZONE_MOONGLADE)
{
if (!me->FindNearestCreature(NPC_OMEN, 100.0f, false) && me->GetDistance2d(omenSummonPos.GetPositionX(), omenSummonPos.GetPositionY()) <= 100.0f)
{
switch (urand(0,9))
{
case 0:
case 1:
case 2:
case 3:
if (Creature* minion = me->SummonCreature(NPC_MINION_OF_OMEN, me->GetPositionX()+frand(-5.0f, 5.0f), me->GetPositionY()+frand(-5.0f, 5.0f), me->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
minion->AI()->AttackStart(me->SelectNearestPlayer(20.0f));
break;
case 9:
me->SummonCreature(NPC_OMEN, omenSummonPos);
break;
}
}
}
if (me->GetEntry() == NPC_CLUSTER_ELUNE)
DoCast(SPELL_LUNAR_FORTUNE);
float displacement = 0.7f;
for (uint8 i = 0; i < 4; i++)
me->SummonGameObject(GetFireworkGameObjectId(), me->GetPositionX() + (i%2 == 0 ? displacement : -displacement), me->GetPositionY() + (i > 1 ? displacement : -displacement), me->GetPositionZ() + 4.0f, me->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 1);
}
else
//me->CastSpell(me, GetFireworkSpell(me->GetEntry()), true);
me->CastSpell(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), GetFireworkSpell(me->GetEntry()), true);
}
};
CreatureAI *GetAI(Creature* creature) const
{
return new npc_fireworkAI(creature);
}
};
void AddSC_npcs_special()
{
new npc_air_force_bots;
@@ -2796,5 +3076,6 @@ void AddSC_npcs_special()
new npc_experience;
new npc_fire_elemental;
new npc_earth_elemental;
new npc_firework;
}