aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/CMakeLists.txt1
-rw-r--r--src/server/scripts/Commands/cs_achievement.cpp2
-rw-r--r--src/server/scripts/Commands/cs_character.cpp4
-rw-r--r--src/server/scripts/Commands/cs_cheat.cpp4
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp37
-rw-r--r--src/server/scripts/Commands/cs_disable.cpp2
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp9
-rw-r--r--src/server/scripts/Commands/cs_go.cpp2
-rw-r--r--src/server/scripts/Commands/cs_gobject.cpp4
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp25
-rw-r--r--src/server/scripts/Commands/cs_list.cpp2
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp459
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp21
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp57
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp14
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp96
-rw-r--r--src/server/scripts/Commands/cs_reset.cpp7
-rw-r--r--src/server/scripts/Commands/cs_titles.cpp6
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp18
-rw-r--r--src/server/scripts/EasternKingdoms/CMakeLists.txt19
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp293
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp99
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp74
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp259
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp87
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp306
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp283
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp91
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp92
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp325
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp275
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp134
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp588
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp205
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp72
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp91
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp239
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h51
-rw-r--r--src/server/scripts/EasternKingdoms/arathi_highlands.cpp63
-rw-r--r--src/server/scripts/EasternKingdoms/boss_kruul.cpp160
-rw-r--r--src/server/scripts/EasternKingdoms/burning_steppes.cpp128
-rw-r--r--src/server/scripts/EasternKingdoms/ghostlands.cpp40
-rw-r--r--src/server/scripts/EasternKingdoms/hinterlands.cpp201
-rw-r--r--src/server/scripts/EasternKingdoms/ironforge.cpp67
-rw-r--r--src/server/scripts/EasternKingdoms/loch_modan.cpp74
-rw-r--r--src/server/scripts/EasternKingdoms/redridge_mountains.cpp146
-rw-r--r--src/server/scripts/EasternKingdoms/silverpine_forest.cpp187
-rw-r--r--src/server/scripts/EasternKingdoms/stormwind_city.cpp613
-rw-r--r--src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp130
-rw-r--r--src/server/scripts/EasternKingdoms/tirisfal_glades.cpp185
-rw-r--r--src/server/scripts/Kalimdor/CMakeLists.txt1
-rw-r--r--src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp2
-rw-r--r--src/server/scripts/Kalimdor/azshara.cpp493
-rw-r--r--src/server/scripts/Kalimdor/azuremyst_isle.cpp164
-rw-r--r--src/server/scripts/Kalimdor/boss_azuregos.cpp167
-rw-r--r--src/server/scripts/Kalimdor/darkshore.cpp370
-rw-r--r--src/server/scripts/Kalimdor/desolace.cpp104
-rw-r--r--src/server/scripts/Kalimdor/durotar.cpp451
-rw-r--r--src/server/scripts/Kalimdor/dustwallow_marsh.cpp452
-rw-r--r--src/server/scripts/Kalimdor/felwood.cpp72
-rw-r--r--src/server/scripts/Kalimdor/feralas.cpp220
-rw-r--r--src/server/scripts/Kalimdor/moonglade.cpp548
-rw-r--r--src/server/scripts/Kalimdor/mulgore.cpp122
-rw-r--r--src/server/scripts/Kalimdor/orgrimmar.cpp222
-rw-r--r--src/server/scripts/Kalimdor/silithus.cpp931
-rw-r--r--src/server/scripts/Kalimdor/stonetalon_mountains.cpp146
-rw-r--r--src/server/scripts/Kalimdor/tanaris.cpp375
-rw-r--r--src/server/scripts/Kalimdor/the_barrens.cpp497
-rw-r--r--src/server/scripts/Kalimdor/thousand_needles.cpp428
-rw-r--r--src/server/scripts/Kalimdor/thunder_bluff.cpp24
-rw-r--r--src/server/scripts/Kalimdor/ungoro_crater.cpp321
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp3
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp16
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp2
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp1
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp2
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp1
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp3
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp1
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp2
-rw-r--r--src/server/scripts/OutdoorPvP/CMakeLists.txt2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp785
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPEP.h331
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp6
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp127
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp13
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp8
-rw-r--r--src/server/scripts/Spells/spell_pet.cpp20
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp44
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp3
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp330
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp113
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp231
-rw-r--r--src/server/scripts/World/item_scripts.cpp12
-rw-r--r--src/server/scripts/World/npc_professions.cpp8
-rw-r--r--src/server/scripts/World/npcs_special.cpp8
104 files changed, 1398 insertions, 13157 deletions
diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt
index f148ae2b3ee..3dfb5b39c24 100644
--- a/src/server/scripts/CMakeLists.txt
+++ b/src/server/scripts/CMakeLists.txt
@@ -76,7 +76,6 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/game/Addons
${CMAKE_SOURCE_DIR}/src/server/game/AI
${CMAKE_SOURCE_DIR}/src/server/game/AI/CoreAI
- ${CMAKE_SOURCE_DIR}/src/server/game/AI/EventAI
${CMAKE_SOURCE_DIR}/src/server/game/AI/ScriptedAI
${CMAKE_SOURCE_DIR}/src/server/game/AI/SmartScripts
${CMAKE_SOURCE_DIR}/src/server/game/AuctionHouse
diff --git a/src/server/scripts/Commands/cs_achievement.cpp b/src/server/scripts/Commands/cs_achievement.cpp
index 7667e79ece7..a5dacc7bb00 100644
--- a/src/server/scripts/Commands/cs_achievement.cpp
+++ b/src/server/scripts/Commands/cs_achievement.cpp
@@ -67,7 +67,7 @@ public:
return false;
}
- if (AchievementEntry const* achievementEntry = sAchievementStore.LookupEntry(achievementId))
+ if (AchievementEntry const* achievementEntry = sAchievementMgr->GetAchievement(achievementId))
target->CompletedAchievement(achievementEntry);
return true;
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp
index 1f32368adfd..d6c4ef54d15 100644
--- a/src/server/scripts/Commands/cs_character.cpp
+++ b/src/server/scripts/Commands/cs_character.cpp
@@ -275,7 +275,7 @@ public:
if (titleInfo && target->HasTitle(titleInfo))
{
- std::string name = titleInfo->name[loc];
+ std::string name = titleInfo->name;
if (name.empty())
continue;
@@ -471,7 +471,7 @@ public:
{
FactionState const& faction = itr->second;
FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID);
- char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#";
+ char const* factionName = factionEntry ? factionEntry->name : "#Not found#";
ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
std::string rankName = handler->GetTrinityString(ReputationRankStrIndex[rank]);
std::ostringstream ss;
diff --git a/src/server/scripts/Commands/cs_cheat.cpp b/src/server/scripts/Commands/cs_cheat.cpp
index 4f503fdbb76..57293ef5e84 100644
--- a/src/server/scripts/Commands/cs_cheat.cpp
+++ b/src/server/scripts/Commands/cs_cheat.cpp
@@ -195,14 +195,14 @@ public:
if (argstr == "off")
{
handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_WATERWALK);
- handler->GetSession()->GetPlayer()->SetMovement(MOVE_LAND_WALK); // OFF
+ handler->GetSession()->GetPlayer()->SendMovementSetWaterWalking(false); // OFF
handler->SendSysMessage("Waterwalking is OFF. You can't walk on water.");
return true;
}
else if (argstr == "on")
{
handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_WATERWALK);
- handler->GetSession()->GetPlayer()->SetMovement(MOVE_WATER_WALK); // ON
+ handler->GetSession()->GetPlayer()->SendMovementSetWaterWalking(true); // ON
handler->SendSysMessage("Waterwalking is ON. You can walk on water.");
return true;
}
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 7f25a11bcdd..6c5abfe60e6 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -90,6 +90,7 @@ public:
{ "areatriggers", SEC_ADMINISTRATOR, false, &HandleDebugAreaTriggersCommand, "", NULL },
{ "los", SEC_MODERATOR, false, &HandleDebugLoSCommand, "", NULL },
{ "moveflags", SEC_ADMINISTRATOR, false, &HandleDebugMoveflagsCommand, "", NULL },
+ { "phase", SEC_MODERATOR, false, &HandleDebugPhaseCommand, "", NULL },
{ NULL, SEC_PLAYER, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
@@ -236,7 +237,7 @@ public:
return false;
SellResult msg = SellResult(atoi(args));
- handler->GetSession()->GetPlayer()->SendSellError(msg, 0, 0, 0);
+ handler->GetSession()->GetPlayer()->SendSellError(msg, 0, 0);
return true;
}
@@ -310,7 +311,7 @@ public:
uint32 opcode;
parsedStream >> opcode;
- WorldPacket data(opcode, 0);
+ WorldPacket data(Opcodes(opcode), 0);
while (!parsedStream.eof())
{
@@ -416,7 +417,7 @@ public:
}
sLog->outDebug(LOG_FILTER_NETWORKIO, "Sending opcode %u", data.GetOpcode());
data.hexlike();
- player->GetSession()->SendPacket(&data);
+ player->GetSession()->SendPacket(&data, true);
handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName());
return true;
}
@@ -948,8 +949,21 @@ public:
if (!*args)
return false;
- uint32 PhaseShift = atoi(args);
- handler->GetSession()->SendSetPhaseShift(PhaseShift);
+ char* t = strtok((char*)args, " ");
+ char* p = strtok(NULL, " ");
+
+ if (!t)
+ return false;
+
+ std::set<uint32> terrainswap;
+ std::set<uint32> phaseId;
+
+ terrainswap.insert((uint32)atoi(t));
+
+ if (p)
+ phaseId.insert((uint32)atoi(p));
+
+ handler->GetSession()->SendSetPhaseShift(phaseId, terrainswap);
return true;
}
@@ -1325,11 +1339,22 @@ public:
{
Player* player = handler->GetSession()->GetPlayer();
- sLog->outInfo(LOG_FILTER_SQL_DEV, "(@PATH, XX, %.3f, %.3f, %.5f, 0,0, 0,100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
+ sLog->outInfo(LOG_FILTER_SQL_DEV, "(@PATH, XX, %.3f, %.3f, %.5f, 0, 0, 0, 100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
handler->PSendSysMessage("Waypoint SQL written to SQL Developer log");
return true;
}
+
+ static bool HandleDebugPhaseCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Unit* unit = handler->getSelectedUnit();
+ Player* player = handler->GetSession()->GetPlayer();
+ if(unit && unit->GetTypeId() == TYPEID_PLAYER)
+ player = unit->ToPlayer();
+
+ player->GetPhaseMgr().SendDebugReportToPlayer(handler->GetSession()->GetPlayer());
+ return true;
+ }
};
void AddSC_debug_commandscript()
diff --git a/src/server/scripts/Commands/cs_disable.cpp b/src/server/scripts/Commands/cs_disable.cpp
index 0bb376b08dd..00214ed4b0f 100644
--- a/src/server/scripts/Commands/cs_disable.cpp
+++ b/src/server/scripts/Commands/cs_disable.cpp
@@ -137,7 +137,7 @@ public:
}
case DISABLE_TYPE_ACHIEVEMENT_CRITERIA:
{
- if (!sAchievementCriteriaStore.LookupEntry(entry))
+ if (!sAchievementMgr->GetAchievementCriteria(entry))
{
handler->PSendSysMessage(LANG_COMMAND_NO_ACHIEVEMENT_CRITERIA_FOUND);
handler->SetSentErrorMessage(true);
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index 3dfc6f9c7e8..0230ebcd1e7 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -96,19 +96,16 @@ public:
if (!target)
target = handler->GetSession()->GetPlayer();
- WorldPacket data(12);
+ WorldPacket data;
if (strncmp(args, "on", 3) == 0)
- data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
+ target->SendMovementSetCanFly(true);
else if (strncmp(args, "off", 4) == 0)
- data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
+ target->SendMovementSetCanFly(false);
else
{
handler->SendSysMessage(LANG_USE_BOL);
return false;
}
- data.append(target->GetPackGUID());
- data << uint32(0); // unknown
- target->SendMessageToSet(&data, true);
handler->PSendSysMessage(LANG_COMMAND_FLYMODE_STATUS, handler->GetNameLink(target).c_str(), args);
return true;
}
diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp
index f7371884da2..b0f1eed5d5c 100644
--- a/src/server/scripts/Commands/cs_go.cpp
+++ b/src/server/scripts/Commands/cs_go.cpp
@@ -444,7 +444,7 @@ public:
if (map->Instanceable())
{
- handler->PSendSysMessage(LANG_INVALID_ZONE_MAP, areaEntry->ID, areaEntry->area_name[handler->GetSessionDbcLocale()], map->GetId(), map->GetMapName());
+ handler->PSendSysMessage(LANG_INVALID_ZONE_MAP, areaEntry->ID, areaEntry->area_name, map->GetId(), map->GetMapName());
handler->SetSentErrorMessage(true);
return false;
}
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index 6803354d29b..fd24e618ef0 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -149,7 +149,7 @@ public:
GameObject* object = new GameObject;
uint32 guidLow = sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT);
- if (!object->Create(guidLow, objectInfo->entry, map, player->GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
+ if (!object->Create(guidLow, objectInfo->entry, map, player->GetPhaseMgr().GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
{
delete object;
return false;
@@ -162,7 +162,7 @@ public:
}
// fill the gameobject data and save to the db
- object->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), player->GetPhaseMaskForSpawn());
+ object->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), player->GetPhaseMgr().GetPhaseMaskForSpawn());
// this will generate a new guid if the object is in an instance
if (!object->LoadGameObjectFromDB(guidLow, map))
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp
index cfdfc66f991..dcfa6b6b04c 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -394,33 +394,14 @@ public:
!skillInfo->canLink) // only prof with recipes have set
continue;
- int locale = handler->GetSessionDbcLocale();
- name = skillInfo->name[locale];
+ name = skillInfo->name;
if (name.empty())
continue;
if (!Utf8FitTo(name, namePart))
- {
- locale = 0;
- for (; locale < TOTAL_LOCALES; ++locale)
- {
- if (locale == handler->GetSessionDbcLocale())
- continue;
-
- name = skillInfo->name[locale];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, namePart))
- break;
- }
- }
+ continue;
- if (locale < TOTAL_LOCALES)
- {
- targetSkillInfo = skillInfo;
- break;
- }
+ targetSkillInfo = skillInfo;
}
if (!targetSkillInfo)
diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp
index 5c16a0963d3..5a0fd28e81a 100644
--- a/src/server/scripts/Commands/cs_list.cpp
+++ b/src/server/scripts/Commands/cs_list.cpp
@@ -435,7 +435,7 @@ public:
AuraApplication const* aurApp = itr->second;
Aura const* aura = aurApp->GetBase();
- char const* name = aura->GetSpellInfo()->SpellName[handler->GetSessionDbcLocale()];
+ char const* name = aura->GetSpellInfo()->SpellName;
std::ostringstream ss_name;
ss_name << "|cffffffff|Hspell:" << aura->GetId() << "|h[" << name << "]|h|r";
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp
index 951ebc7714b..3a2ef366ace 100644
--- a/src/server/scripts/Commands/cs_lookup.cpp
+++ b/src/server/scripts/Commands/cs_lookup.cpp
@@ -94,48 +94,30 @@ public:
AreaTableEntry const* areaEntry = sAreaStore.LookupEntry(areaflag);
if (areaEntry)
{
- int locale = handler->GetSessionDbcLocale();
- std::string name = areaEntry->area_name[locale];
+ std::string name = areaEntry->area_name;
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- {
- locale = 0;
- for (; locale < TOTAL_LOCALES; ++locale)
- {
- if (locale == handler->GetSessionDbcLocale())
- continue;
-
- name = areaEntry->area_name[locale];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wNamePart))
- break;
- }
- }
+ continue;
- if (locale < TOTAL_LOCALES)
+ if (maxResults && count++ == maxResults)
{
- if (maxResults && count++ == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- // send area in "id - [name]" format
- std::ostringstream ss;
- if (handler->GetSession())
- ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << ' ' << localeNames[locale]<< "]|h|r";
- else
- ss << areaEntry->ID << " - " << name << ' ' << localeNames[locale];
+ // send area in "id - [name]" format
+ std::ostringstream ss;
+ if (handler->GetSession())
+ ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name<< "]|h|r";
+ else
+ ss << areaEntry->ID << " - " << name;
- handler->SendSysMessage(ss.str().c_str());
+ handler->SendSysMessage(ss.str().c_str());
- if (!found)
- found = true;
- }
+ if (!found)
+ found = true;
}
}
@@ -301,77 +283,58 @@ public:
for (uint32 id = 0; id < sFactionStore.GetNumRows(); ++id)
{
- FactionEntry const* factionEntry = sFactionStore.LookupEntry(id);
- if (factionEntry)
+ if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(id))
{
FactionState const* factionState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL;
- int locale = handler->GetSessionDbcLocale();
- std::string name = factionEntry->name[locale];
+ std::string name = factionEntry->name;
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- {
- locale = 0;
- for (; locale < TOTAL_LOCALES; ++locale)
- {
- if (locale == handler->GetSessionDbcLocale())
- continue;
-
- name = factionEntry->name[locale];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wNamePart))
- break;
- }
- }
+ continue;
- if (locale < TOTAL_LOCALES)
+ if (maxResults && count++ == maxResults)
{
- if (maxResults && count++ == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- // send faction in "id - [faction] rank reputation [visible] [at war] [own team] [unknown] [invisible] [inactive]" format
- // or "id - [faction] [no reputation]" format
- std::ostringstream ss;
- if (handler->GetSession())
- ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << ' ' << localeNames[locale] << "]|h|r";
- else
- ss << id << " - " << name << ' ' << localeNames[locale];
+ // send faction in "id - [faction] rank reputation [visible] [at war] [own team] [unknown] [invisible] [inactive]" format
+ // or "id - [faction] [no reputation]" format
+ std::ostringstream ss;
+ if (handler->GetSession())
+ ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << "]|h|r";
+ else
+ ss << id << " - " << name;
- if (factionState) // and then target != NULL also
- {
- uint32 index = target->GetReputationMgr().GetReputationRankStrIndex(factionEntry);
- std::string rankName = handler->GetTrinityString(index);
-
- ss << ' ' << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ')';
-
- if (factionState->Flags & FACTION_FLAG_VISIBLE)
- ss << handler->GetTrinityString(LANG_FACTION_VISIBLE);
- if (factionState->Flags & FACTION_FLAG_AT_WAR)
- ss << handler->GetTrinityString(LANG_FACTION_ATWAR);
- if (factionState->Flags & FACTION_FLAG_PEACE_FORCED)
- ss << handler->GetTrinityString(LANG_FACTION_PEACE_FORCED);
- if (factionState->Flags & FACTION_FLAG_HIDDEN)
- ss << handler->GetTrinityString(LANG_FACTION_HIDDEN);
- if (factionState->Flags & FACTION_FLAG_INVISIBLE_FORCED)
- ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
- if (factionState->Flags & FACTION_FLAG_INACTIVE)
- ss << handler->GetTrinityString(LANG_FACTION_INACTIVE);
- }
- else
- ss << handler->GetTrinityString(LANG_FACTION_NOREPUTATION);
+ if (factionState) // and then target != NULL also
+ {
+ uint32 index = target->GetReputationMgr().GetReputationRankStrIndex(factionEntry);
+ std::string rankName = handler->GetTrinityString(index);
+
+ ss << ' ' << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ')';
+
+ if (factionState->Flags & FACTION_FLAG_VISIBLE)
+ ss << handler->GetTrinityString(LANG_FACTION_VISIBLE);
+ if (factionState->Flags & FACTION_FLAG_AT_WAR)
+ ss << handler->GetTrinityString(LANG_FACTION_ATWAR);
+ if (factionState->Flags & FACTION_FLAG_PEACE_FORCED)
+ ss << handler->GetTrinityString(LANG_FACTION_PEACE_FORCED);
+ if (factionState->Flags & FACTION_FLAG_HIDDEN)
+ ss << handler->GetTrinityString(LANG_FACTION_HIDDEN);
+ if (factionState->Flags & FACTION_FLAG_INVISIBLE_FORCED)
+ ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
+ if (factionState->Flags & FACTION_FLAG_INACTIVE)
+ ss << handler->GetTrinityString(LANG_FACTION_INACTIVE);
+ }
+ else
+ ss << handler->GetTrinityString(LANG_FACTION_NOREPUTATION);
- handler->SendSysMessage(ss.str().c_str());
+ handler->SendSysMessage(ss.str().c_str());
- if (!found)
- found = true;
- }
+ if (!found)
+ found = true;
}
}
@@ -486,45 +449,27 @@ public:
ItemSetEntry const* set = sItemSetStore.LookupEntry(id);
if (set)
{
- int locale = handler->GetSessionDbcLocale();
- std::string name = set->name[locale];
+ std::string name = set->name;
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- {
- locale = 0;
- for (; locale < TOTAL_LOCALES; ++locale)
- {
- if (locale == handler->GetSessionDbcLocale())
- continue;
-
- name = set->name[locale];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wNamePart))
- break;
- }
- }
+ continue;
- if (locale < TOTAL_LOCALES)
+ if (maxResults && count++ == maxResults)
{
- if (maxResults && count++ == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- // send item set in "id - [namedlink locale]" format
- if (handler->GetSession())
- handler->PSendSysMessage(LANG_ITEMSET_LIST_CHAT, id, id, name.c_str(), localeNames[locale]);
- else
- handler->PSendSysMessage(LANG_ITEMSET_LIST_CONSOLE, id, name.c_str(), localeNames[locale]);
+ // send item set in "id - [namedlink locale]" format
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_ITEMSET_LIST_CHAT, id, id, name.c_str(), "");
+ else
+ handler->PSendSysMessage(LANG_ITEMSET_LIST_CONSOLE, id, name.c_str(), "");
- if (!found)
- found = true;
- }
+ if (!found)
+ found = true;
}
}
if (!found)
@@ -767,59 +712,41 @@ public:
SkillLineEntry const* skillInfo = sSkillLineStore.LookupEntry(id);
if (skillInfo)
{
- int locale = handler->GetSessionDbcLocale();
- std::string name = skillInfo->name[locale];
+ std::string name = skillInfo->name;
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- {
- locale = 0;
- for (; locale < TOTAL_LOCALES; ++locale)
- {
- if (locale == handler->GetSessionDbcLocale())
- continue;
-
- name = skillInfo->name[locale];
- if (name.empty())
- continue;
+ continue;
- if (Utf8FitTo(name, wNamePart))
- break;
- }
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
}
- if (locale < TOTAL_LOCALES)
+ char valStr[50] = "";
+ char const* knownStr = "";
+ if (target && target->HasSkill(id))
{
- if (maxResults && count++ == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- char valStr[50] = "";
- char const* knownStr = "";
- if (target && target->HasSkill(id))
- {
- knownStr = handler->GetTrinityString(LANG_KNOWN);
- uint32 curValue = target->GetPureSkillValue(id);
- uint32 maxValue = target->GetPureMaxSkillValue(id);
- uint32 permValue = target->GetSkillPermBonusValue(id);
- uint32 tempValue = target->GetSkillTempBonusValue(id);
-
- char const* valFormat = handler->GetTrinityString(LANG_SKILL_VALUES);
- snprintf(valStr, 50, valFormat, curValue, maxValue, permValue, tempValue);
- }
+ knownStr = handler->GetTrinityString(LANG_KNOWN);
+ uint32 curValue = target->GetPureSkillValue(id);
+ uint32 maxValue = target->GetPureMaxSkillValue(id);
+ uint32 permValue = target->GetSkillPermBonusValue(id);
+ uint32 tempValue = target->GetSkillTempBonusValue(id);
+
+ char const* valFormat = handler->GetTrinityString(LANG_SKILL_VALUES);
+ snprintf(valStr, 50, valFormat, curValue, maxValue, permValue, tempValue);
+ }
- // send skill in "id - [namedlink locale]" format
- if (handler->GetSession())
- handler->PSendSysMessage(LANG_SKILL_LIST_CHAT, id, id, name.c_str(), localeNames[locale], knownStr, valStr);
- else
- handler->PSendSysMessage(LANG_SKILL_LIST_CONSOLE, id, name.c_str(), localeNames[locale], knownStr, valStr);
+ // send skill in "id - [namedlink locale]" format
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_SKILL_LIST_CHAT, id, id, name.c_str(), "", knownStr, valStr);
+ else
+ handler->PSendSysMessage(LANG_SKILL_LIST_CONSOLE, id, name.c_str(), "", knownStr, valStr);
- if (!found)
- found = true;
- }
+ if (!found)
+ found = true;
}
}
if (!found)
@@ -855,83 +782,63 @@ public:
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id);
if (spellInfo)
{
- int locale = handler->GetSessionDbcLocale();
- std::string name = spellInfo->SpellName[locale];
+ std::string name = spellInfo->SpellName;
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- {
- locale = 0;
- for (; locale < TOTAL_LOCALES; ++locale)
- {
- if (locale == handler->GetSessionDbcLocale())
- continue;
-
- name = spellInfo->SpellName[locale];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wNamePart))
- break;
- }
- }
+ continue;
- if (locale < TOTAL_LOCALES)
+ if (maxResults && count++ == maxResults)
{
- if (maxResults && count++ == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- bool known = target && target->HasSpell(id);
- bool learn = (spellInfo->Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL);
+ bool known = target && target->HasSpell(id);
+ bool learn = (spellInfo->Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL);
- SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell);
+ SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell);
- uint32 talentCost = GetTalentSpellCost(id);
+ uint32 talentCost = GetTalentSpellCost(id);
- bool talent = (talentCost > 0);
- bool passive = spellInfo->IsPassive();
- bool active = target && target->HasAura(id);
+ bool talent = (talentCost > 0);
+ bool passive = spellInfo->IsPassive();
+ bool active = target && target->HasAura(id);
- // unit32 used to prevent interpreting uint8 as char at output
- // find rank of learned spell for learning spell, or talent rank
- uint32 rank = talentCost ? talentCost : learn && learnSpellInfo ? learnSpellInfo->GetRank() : spellInfo->GetRank();
+ // unit32 used to prevent interpreting uint8 as char at output
+ // find rank of learned spell for learning spell, or talent rank
+ uint32 rank = talentCost ? talentCost : learn && learnSpellInfo ? learnSpellInfo->GetRank() : spellInfo->GetRank();
- // send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format
- std::ostringstream ss;
- if (handler->GetSession())
- ss << id << " - |cffffffff|Hspell:" << id << "|h[" << name;
- else
- ss << id << " - " << name;
+ // send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format
+ std::ostringstream ss;
+ if (handler->GetSession())
+ ss << id << " - |cffffffff|Hspell:" << id << "|h[" << name;
+ else
+ ss << id << " - " << name;
- // include rank in link name
- if (rank)
- ss << handler->GetTrinityString(LANG_SPELL_RANK) << rank;
+ // include rank in link name
+ if (rank)
+ ss << handler->GetTrinityString(LANG_SPELL_RANK) << rank;
- if (handler->GetSession())
- ss << ' ' << localeNames[locale] << "]|h|r";
- else
- ss << ' ' << localeNames[locale];
+ if (handler->GetSession())
+ ss << "]|h|r";
- if (talent)
- ss << handler->GetTrinityString(LANG_TALENT);
- if (passive)
- ss << handler->GetTrinityString(LANG_PASSIVE);
- if (learn)
- ss << handler->GetTrinityString(LANG_LEARN);
- if (known)
- ss << handler->GetTrinityString(LANG_KNOWN);
- if (active)
- ss << handler->GetTrinityString(LANG_ACTIVE);
+ if (talent)
+ ss << handler->GetTrinityString(LANG_TALENT);
+ if (passive)
+ ss << handler->GetTrinityString(LANG_PASSIVE);
+ if (learn)
+ ss << handler->GetTrinityString(LANG_LEARN);
+ if (known)
+ ss << handler->GetTrinityString(LANG_KNOWN);
+ if (active)
+ ss << handler->GetTrinityString(LANG_ACTIVE);
- handler->SendSysMessage(ss.str().c_str());
+ handler->SendSysMessage(ss.str().c_str());
- if (!found)
- found = true;
- }
+ if (!found)
+ found = true;
}
}
if (!found)
@@ -964,47 +871,29 @@ public:
TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(id);
if (nodeEntry)
{
- int locale = handler->GetSessionDbcLocale();
- std::string name = nodeEntry->name[locale];
+ std::string name = nodeEntry->name;
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- {
- locale = 0;
- for (; locale < TOTAL_LOCALES; ++locale)
- {
- if (locale == handler->GetSessionDbcLocale())
- continue;
-
- name = nodeEntry->name[locale];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wNamePart))
- break;
- }
- }
+ continue;
- if (locale < TOTAL_LOCALES)
+ if (maxResults && count++ == maxResults)
{
- if (maxResults && count++ == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- // send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format
- if (handler->GetSession())
- handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), localeNames[locale],
- nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
- else
- handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), localeNames[locale],
- nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
+ // send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), "",
+ nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
+ else
+ handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), "",
+ nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
- if (!found)
- found = true;
- }
+ if (!found)
+ found = true;
}
}
if (!found)
@@ -1101,53 +990,35 @@ public:
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
if (titleInfo)
{
- int locale = handler->GetSessionDbcLocale();
- std::string name = titleInfo->name[locale];
+ std::string name = titleInfo->name;
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- {
- locale = 0;
- for (; locale < TOTAL_LOCALES; ++locale)
- {
- if (locale == handler->GetSessionDbcLocale())
- continue;
-
- name = titleInfo->name[locale];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wNamePart))
- break;
- }
- }
+ continue;
- if (locale < TOTAL_LOCALES)
+ if (maxResults && counter == maxResults)
{
- if (maxResults && counter == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- char const* knownStr = target && target->HasTitle(titleInfo) ? handler->GetTrinityString(LANG_KNOWN) : "";
+ char const* knownStr = target && target->HasTitle(titleInfo) ? handler->GetTrinityString(LANG_KNOWN) : "";
- char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
- ? handler->GetTrinityString(LANG_ACTIVE)
- : "";
+ char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
+ ? handler->GetTrinityString(LANG_ACTIVE)
+ : "";
- char titleNameStr[80];
- snprintf(titleNameStr, 80, name.c_str(), targetName);
+ char titleNameStr[80];
+ snprintf(titleNameStr, 80, name.c_str(), targetName);
- // send title in "id (idx:idx) - [namedlink locale]" format
- if (handler->GetSession())
- handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[locale], knownStr, activeStr);
- else
- handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, localeNames[locale], knownStr, activeStr);
+ // send title in "id (idx:idx) - [namedlink locale]" format
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, "", knownStr, activeStr);
+ else
+ handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, "", knownStr, activeStr);
- ++counter;
- }
+ ++counter;
}
}
if (counter == 0) // if counter == 0 then we found nth
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index f7280cf906e..7c7adafdfeb 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -217,9 +217,9 @@ public:
handler->PSendSysMessage("no VMAP available for area info");
handler->PSendSysMessage(LANG_MAP_POSITION,
- object->GetMapId(), (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : "<unknown>"),
- zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
- areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
+ object->GetMapId(), (mapEntry ? mapEntry->name : "<unknown>"),
+ zoneId, (zoneEntry ? zoneEntry->area_name : "<unknown>"),
+ areaId, (areaEntry ? areaEntry->area_name : "<unknown>"),
object->GetPhaseMask(),
object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(),
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(),
@@ -1453,7 +1453,7 @@ public:
if (!target->GetSkillValue(skill))
{
- handler->PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, skillLine->name[handler->GetSessionDbcLocale()]);
+ handler->PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, skillLine->name);
handler->SetSentErrorMessage(true);
return false;
}
@@ -1464,7 +1464,7 @@ public:
return false;
target->SetSkill(skill, target->GetSkillStep(skill), level, max);
- handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name[handler->GetSessionDbcLocale()], tNameLink.c_str(), level, max);
+ handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name, tNameLink.c_str(), level, max);
return true;
}
@@ -1702,7 +1702,6 @@ public:
handler->PSendSysMessage(LANG_PINFO_LEVEL, raceStr.c_str(), ClassStr.c_str(), timeStr.c_str(), level, gold, silv, copp);
// Add map, zone, subzone and phase to output
- int locale = handler->GetSessionDbcLocale();
std::string areaName = "<unknown>";
std::string zoneName = "";
@@ -1711,22 +1710,22 @@ public:
AreaTableEntry const* area = GetAreaEntryByAreaID(areaId);
if (area)
{
- areaName = area->area_name[locale];
+ areaName = area->area_name;
AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone);
if (zone)
- zoneName = zone->area_name[locale];
+ zoneName = zone->area_name;
}
if (target)
{
if (!zoneName.empty())
- handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], zoneName.c_str(), areaName.c_str(), phase);
+ handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name, zoneName.c_str(), areaName.c_str(), phase);
else
- handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], areaName.c_str(), "<unknown>", phase);
+ handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name, areaName.c_str(), "<unknown>", phase);
}
else
- handler->PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name[locale], areaName.c_str());
+ handler->PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name, areaName.c_str());
return true;
}
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index ff74ae83c20..5c9280e5956 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -25,6 +25,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "Chat.h"
+#include <stdlib.h>
class modify_commandscript : public CommandScript
{
@@ -968,14 +969,14 @@ public:
target->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP);
target->Mount(mId);
- WorldPacket data(SMSG_FORCE_RUN_SPEED_CHANGE, (8+4+1+4));
+ WorldPacket data(SMSG_MOVE_SET_RUN_SPEED, (8+4+1+4));
data.append(target->GetPackGUID());
data << (uint32)0;
data << (uint8)0; //new 2.1.0
data << float(speed);
target->SendMessageToSet(&data, true);
- data.Initialize(SMSG_FORCE_SWIM_SPEED_CHANGE, (8+4+4));
+ data.Initialize(SMSG_MOVE_SET_SWIM_SPEED, (8+4+4));
data.append(target->GetPackGUID());
data << (uint32)0;
data << float(speed);
@@ -1002,19 +1003,19 @@ public:
if (handler->HasLowerSecurity(target, 0))
return false;
- int32 moneyToAdd = 0;
+ int64 moneyToAdd = 0;
if (strchr(args, 'g') || strchr(args, 's') || strchr(args, 'c'))
moneyToAdd = MoneyStringToMoney(std::string(args));
else
- moneyToAdd = atoi(args);
+ moneyToAdd = atol(args);
- uint32 targetMoney = target->GetMoney();
+ uint64 targetMoney = target->GetMoney();
if (moneyToAdd < 0)
{
- int32 newmoney = int32(targetMoney) + moneyToAdd;
+ int64 newmoney = int64(targetMoney) + moneyToAdd;
- sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_CURRENT_MONEY), targetMoney, moneyToAdd, newmoney);
+ sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_CURRENT_MONEY), uint32(targetMoney), int32(moneyToAdd), uint32(newmoney));
if (newmoney <= 0)
{
handler->PSendSysMessage(LANG_YOU_TAKE_ALL_MONEY, handler->GetNameLink(target).c_str());
@@ -1025,20 +1026,21 @@ public:
}
else
{
+ uint32 moneyToAddMsg = moneyToAdd * -1;
if (newmoney > MAX_MONEY_AMOUNT)
newmoney = MAX_MONEY_AMOUNT;
- handler->PSendSysMessage(LANG_YOU_TAKE_MONEY, abs(moneyToAdd), handler->GetNameLink(target).c_str());
+ handler->PSendSysMessage(LANG_YOU_TAKE_MONEY, moneyToAddMsg, handler->GetNameLink(target).c_str());
if (handler->needReportToTarget(target))
- (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, handler->GetNameLink().c_str(), abs(moneyToAdd));
+ (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, handler->GetNameLink().c_str(), moneyToAddMsg);
target->SetMoney(newmoney);
}
}
else
{
- handler->PSendSysMessage(LANG_YOU_GIVE_MONEY, moneyToAdd, handler->GetNameLink(target).c_str());
+ handler->PSendSysMessage(LANG_YOU_GIVE_MONEY, uint32(moneyToAdd), handler->GetNameLink(target).c_str());
if (handler->needReportToTarget(target))
- (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, handler->GetNameLink().c_str(), moneyToAdd);
+ (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, handler->GetNameLink().c_str(), uint32(moneyToAdd));
if (moneyToAdd >= MAX_MONEY_AMOUNT)
target->SetMoney(MAX_MONEY_AMOUNT);
@@ -1046,7 +1048,7 @@ public:
target->ModifyMoney(moneyToAdd);
}
- sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_NEW_MONEY), targetMoney, moneyToAdd, target->GetMoney());
+ sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_NEW_MONEY), uint32(targetMoney), int32(moneyToAdd), uint32(target->GetMoney()));
return true;
}
@@ -1106,7 +1108,7 @@ public:
return true;
}
- static bool HandleModifyHonorCommand (ChatHandler* handler, const char* args)
+ static bool HandleModifyHonorCommand(ChatHandler* handler, const char* args)
{
if (!*args)
return false;
@@ -1125,9 +1127,9 @@ public:
int32 amount = (uint32)atoi(args);
- target->ModifyHonorPoints(amount);
+ target->ModifyCurrency(CURRENCY_TYPE_HONOR_POINTS, amount, true, true);
- handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target).c_str(), target->GetHonorPoints());
+ handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_HONOR_POINTS));
return true;
}
@@ -1235,13 +1237,13 @@ public:
if (factionEntry->reputationListID < 0)
{
- handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->name[handler->GetSessionDbcLocale()], factionId);
+ handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->name, factionId);
handler->SetSentErrorMessage(true);
return false;
}
target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false);
- handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[handler->GetSessionDbcLocale()], factionId,
+ handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name, factionId,
handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
return true;
}
@@ -1276,14 +1278,15 @@ public:
uint32 phasemask = (uint32)atoi((char*)args);
Unit* target = handler->getSelectedUnit();
- if (!target)
- target = handler->GetSession()->GetPlayer();
-
- // check online security
- else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), 0))
- return false;
-
- target->SetPhaseMask(phasemask, true);
+ if (target)
+ {
+ if (target->GetTypeId() == TYPEID_PLAYER)
+ target->ToPlayer()->GetPhaseMgr().SetCustomPhase(phasemask);
+ else
+ target->SetPhaseMask(phasemask, true);
+ }
+ else
+ handler->GetSession()->GetPlayer()->GetPhaseMgr().SetCustomPhase(phasemask);
return true;
}
@@ -1315,9 +1318,9 @@ public:
int32 amount = (uint32)atoi(args);
- target->ModifyArenaPoints(amount);
+ target->ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, amount, true, true);
- handler->PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, handler->GetNameLink(target).c_str(), target->GetArenaPoints());
+ handler->PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS));
return true;
}
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index 77fc2918e0b..30713728cf6 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -151,13 +151,13 @@ public:
}
Creature* creature = new Creature();
- if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, (uint32)teamval, x, y, z, o))
+ if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), id, 0, (uint32)teamval, x, y, z, o))
{
delete creature;
return false;
}
- creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
+ creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr().GetPhaseMaskForSpawn());
uint32 db_guid = creature->GetDBTableGUIDLow();
@@ -178,6 +178,8 @@ public:
if (!*args)
return false;
+ const uint8 type = 1; // FIXME: make type (1 item, 2 currency) an argument
+
char* pitem = handler->extractKeyFromLink((char*)args, "Hitem");
if (!pitem)
{
@@ -214,13 +216,13 @@ public:
uint32 vendor_entry = vendor ? vendor->GetEntry() : 0;
- if (!sObjectMgr->IsVendorItemValid(vendor_entry, itemId, maxcount, incrtime, extendedcost, handler->GetSession()->GetPlayer()))
+ if (!sObjectMgr->IsVendorItemValid(vendor_entry, itemId, maxcount, incrtime, extendedcost, type, handler->GetSession()->GetPlayer()))
{
handler->SetSentErrorMessage(true);
return false;
}
- sObjectMgr->AddVendorItem(vendor_entry, itemId, maxcount, incrtime, extendedcost);
+ sObjectMgr->AddVendorItem(vendor_entry, itemId, maxcount, incrtime, type, extendedcost);
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId);
@@ -435,7 +437,9 @@ public:
}
uint32 itemId = atol(pitem);
- if (!sObjectMgr->RemoveVendorItem(vendor->GetEntry(), itemId))
+ const uint8 type = 1; // FIXME: make type (1 item, 2 currency) an argument
+
+ if (!sObjectMgr->RemoveVendorItem(vendor->GetEntry(), itemId, type))
{
handler->PSendSysMessage(LANG_ITEM_NOT_IN_LIST, itemId);
handler->SetSentErrorMessage(true);
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index 25f4c176bfc..14481884ec8 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -27,7 +27,6 @@ EndScriptData */
#include "SpellMgr.h"
#include "TicketMgr.h"
#include "MapManager.h"
-#include "CreatureEventAIMgr.h"
#include "DisableMgr.h"
#include "LFGMgr.h"
#include "AuctionHouseMgr.h"
@@ -50,7 +49,6 @@ public:
{
{ "achievement", SEC_ADMINISTRATOR, true, &HandleReloadAllAchievementCommand, "", NULL },
{ "area", SEC_ADMINISTRATOR, true, &HandleReloadAllAreaCommand, "", NULL },
- { "eventai", SEC_ADMINISTRATOR, true, &HandleReloadAllEventAICommand, "", NULL },
{ "gossips", SEC_ADMINISTRATOR, true, &HandleReloadAllGossipsCommand, "", NULL },
{ "item", SEC_ADMINISTRATOR, true, &HandleReloadAllItemCommand, "", NULL },
{ "locales", SEC_ADMINISTRATOR, true, &HandleReloadAllLocalesCommand, "", NULL },
@@ -77,9 +75,6 @@ public:
{ "conditions", SEC_ADMINISTRATOR, true, &HandleReloadConditions, "", NULL },
{ "config", SEC_ADMINISTRATOR, true, &HandleReloadConfigCommand, "", NULL },
{ "creature_text", SEC_ADMINISTRATOR, true, &HandleReloadCreatureText, "", NULL },
- { "creature_ai_scripts", SEC_ADMINISTRATOR, true, &HandleReloadEventAIScriptsCommand, "", NULL },
- { "creature_ai_summons", SEC_ADMINISTRATOR, true, &HandleReloadEventAISummonsCommand, "", NULL },
- { "creature_ai_texts", SEC_ADMINISTRATOR, true, &HandleReloadEventAITextsCommand, "", NULL },
{ "creature_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestInvRelationsCommand, "", NULL },
{ "creature_linked_respawn", SEC_GAMEMASTER, true, &HandleReloadLinkedRespawnCommand, "", NULL },
{ "creature_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesCreatureCommand, "", NULL },
@@ -102,7 +97,6 @@ public:
{ "gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuOptionCommand, "", NULL },
{ "item_enchantment_template", SEC_ADMINISTRATOR, true, &HandleReloadItemEnchantementsCommand, "", NULL },
{ "item_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesItemCommand, "", NULL },
- { "item_set_names", SEC_ADMINISTRATOR, true, &HandleReloadItemSetNamesCommand, "", NULL },
{ "lfg_dungeon_rewards", SEC_ADMINISTRATOR, true, &HandleReloadLfgRewardsCommand, "", NULL },
{ "locales_achievement_reward", SEC_ADMINISTRATOR, true, &HandleReloadLocalesAchievementRewardCommand, "", NULL },
{ "locales_creature", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureCommand, "", NULL },
@@ -110,7 +104,6 @@ public:
{ "locales_gameobject", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGameobjectCommand, "", NULL },
{ "locales_gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGossipMenuOptionCommand, "", NULL },
{ "locales_item", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemCommand, "", NULL },
- { "locales_item_set_name", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemSetNameCommand, "", NULL },
{ "locales_npc_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesNpcTextCommand, "", NULL },
{ "locales_page_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPageTextCommand, "", NULL },
{ "locales_points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPointsOfInterestCommand, "", NULL },
@@ -122,6 +115,7 @@ public:
{ "npc_trainer", SEC_ADMINISTRATOR, true, &HandleReloadNpcTrainerCommand, "", NULL },
{ "npc_vendor", SEC_ADMINISTRATOR, true, &HandleReloadNpcVendorCommand, "", NULL },
{ "page_text", SEC_ADMINISTRATOR, true, &HandleReloadPageTextsCommand, "", NULL },
+ { "phasedefinitions", SEC_ADMINISTRATOR, true, &HandleReloadPhaseDefinitionsCommand, "", NULL },
{ "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesPickpocketingCommand, "", NULL},
{ "points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadPointsOfInterestCommand, "", NULL },
{ "prospecting_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesProspectingCommand, "", NULL },
@@ -181,7 +175,6 @@ public:
HandleReloadAllAchievementCommand(handler, "");
HandleReloadAllAreaCommand(handler, "");
- HandleReloadAllEventAICommand(handler, "");
HandleReloadAllLootCommand(handler, "");
HandleReloadAllNpcCommand(handler, "");
HandleReloadAllQuestCommand(handler, "");
@@ -273,14 +266,6 @@ public:
return true;
}
- static bool HandleReloadAllEventAICommand(ChatHandler* handler, const char* /*args*/)
- {
- HandleReloadEventAITextsCommand(handler, "a");
- HandleReloadEventAISummonsCommand(handler, "a");
- HandleReloadEventAIScriptsCommand(handler, "a");
- return true;
- }
-
static bool HandleReloadAllSpellCommand(ChatHandler* handler, const char* /*args*/)
{
HandleReloadSkillDiscoveryTemplateCommand(handler, "a");
@@ -504,20 +489,21 @@ public:
cInfo->HoverHeight = fields[68].GetFloat();
cInfo->ModHealth = fields[69].GetFloat();
cInfo->ModMana = fields[70].GetFloat();
- cInfo->ModArmor = fields[71].GetFloat();
- cInfo->RacialLeader = fields[72].GetBool();
- cInfo->questItems[0] = fields[73].GetUInt32();
- cInfo->questItems[1] = fields[74].GetUInt32();
- cInfo->questItems[2] = fields[75].GetUInt32();
- cInfo->questItems[3] = fields[76].GetUInt32();
- cInfo->questItems[4] = fields[77].GetUInt32();
- cInfo->questItems[5] = fields[78].GetUInt32();
- cInfo->movementId = fields[79].GetUInt32();
- cInfo->RegenHealth = fields[80].GetBool();
- cInfo->equipmentId = fields[81].GetUInt32();
- cInfo->MechanicImmuneMask = fields[82].GetUInt32();
- cInfo->flags_extra = fields[83].GetUInt32();
- cInfo->ScriptID = sObjectMgr->GetScriptId(fields[84].GetCString());
+ cInfo->ModManaExtra = fields[71].GetFloat();
+ cInfo->ModArmor = fields[72].GetFloat();
+ cInfo->RacialLeader = fields[73].GetBool();
+ cInfo->questItems[0] = fields[74].GetUInt32();
+ cInfo->questItems[1] = fields[75].GetUInt32();
+ cInfo->questItems[2] = fields[76].GetUInt32();
+ cInfo->questItems[3] = fields[77].GetUInt32();
+ cInfo->questItems[4] = fields[78].GetUInt32();
+ cInfo->questItems[5] = fields[79].GetUInt32();
+ cInfo->movementId = fields[80].GetUInt32();
+ cInfo->RegenHealth = fields[81].GetBool();
+ cInfo->equipmentId = fields[82].GetUInt32();
+ cInfo->MechanicImmuneMask = fields[83].GetUInt32();
+ cInfo->flags_extra = fields[84].GetUInt32();
+ cInfo->ScriptID = sObjectMgr->GetScriptId(fields[85].GetCString());
sObjectMgr->CheckCreatureTemplate(cInfo);
}
@@ -947,14 +933,6 @@ public:
return true;
}
- static bool HandleReloadItemSetNamesCommand(ChatHandler* handler, const char* /*args*/)
- {
- sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Item set names...");
- sObjectMgr->LoadItemSetNames();
- handler->SendGlobalGMSysMessage("DB table `item_set_names` reloaded.");
- return true;
- }
-
static bool HandleReloadGameObjectScriptsCommand(ChatHandler* handler, const char* args)
{
if (sScriptMgr->IsScriptScheduled())
@@ -1028,31 +1006,6 @@ public:
return true;
}
- static bool HandleReloadEventAITextsCommand(ChatHandler* handler, const char* /*args*/)
- {
-
- sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Texts from `creature_ai_texts`...");
- sEventAIMgr->LoadCreatureEventAI_Texts();
- handler->SendGlobalGMSysMessage("DB table `creature_ai_texts` reloaded.");
- return true;
- }
-
- static bool HandleReloadEventAISummonsCommand(ChatHandler* handler, const char* /*args*/)
- {
- sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Summons from `creature_ai_summons`...");
- sEventAIMgr->LoadCreatureEventAI_Summons();
- handler->SendGlobalGMSysMessage("DB table `creature_ai_summons` reloaded.");
- return true;
- }
-
- static bool HandleReloadEventAIScriptsCommand(ChatHandler* handler, const char* /*args*/)
- {
- sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `creature_ai_scripts`...");
- sEventAIMgr->LoadCreatureEventAI_Scripts();
- handler->SendGlobalGMSysMessage("DB table `creature_ai_scripts` reloaded.");
- return true;
- }
-
static bool HandleReloadQuestEndScriptsCommand(ChatHandler* handler, const char* args)
{
if (sScriptMgr->IsScriptScheduled())
@@ -1209,14 +1162,6 @@ public:
return true;
}
- static bool HandleReloadLocalesItemSetNameCommand(ChatHandler* handler, const char* /*args*/)
- {
- sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales Item set name... ");
- sObjectMgr->LoadItemSetNameLocales();
- handler->SendGlobalGMSysMessage("DB table `locales_item_set_name` reloaded.");
- return true;
- }
-
static bool HandleReloadLocalesNpcTextCommand(ChatHandler* handler, const char* /*args*/)
{
sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales NPC Text ... ");
@@ -1306,6 +1251,15 @@ public:
handler->SendGlobalGMSysMessage("Vehicle template accessories reloaded.");
return true;
}
+
+ static bool HandleReloadPhaseDefinitionsCommand(ChatHandler* handler, const char* /*args*/)
+ {
+ sLog->outInfo(LOG_FILTER_GENERAL, "Reloading phase_definitions table...");
+ sObjectMgr->LoadPhaseDefinitions();
+ sWorld->UpdatePhaseDefinitions();
+ handler->SendGlobalGMSysMessage("Phase Definitions reloaded.");
+ return true;
+ }
};
void AddSC_reload_commandscript()
diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp
index 76a4eb5d943..b147543bb1a 100644
--- a/src/server/scripts/Commands/cs_reset.cpp
+++ b/src/server/scripts/Commands/cs_reset.cpp
@@ -62,7 +62,7 @@ public:
if (target)
target->ResetAchievements();
else
- AchievementMgr::DeleteFromDB(GUID_LOPART(targetGuid));
+ AchievementMgr<Player>::DeleteFromDB(GUID_LOPART(targetGuid));
return true;
}
@@ -73,11 +73,8 @@ public:
if (!handler->extractPlayerTarget((char*)args, &target))
return false;
- target->SetHonorPoints(0);
target->SetUInt32Value(PLAYER_FIELD_KILLS, 0);
target->SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 0);
- target->SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, 0);
- target->SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0);
target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL);
return true;
@@ -234,7 +231,7 @@ public:
if (target)
{
- target->resetTalents(true);
+ target->ResetTalents(true);
target->SendTalentsInfoData(false);
ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS);
if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target)
diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp
index f35f6baca98..cb52844c626 100644
--- a/src/server/scripts/Commands/cs_titles.cpp
+++ b/src/server/scripts/Commands/cs_titles.cpp
@@ -94,7 +94,7 @@ public:
target->SetTitle(titleInfo); // to be sure that title now known
target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->bit_index);
- handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, titleInfo->name[handler->GetSessionDbcLocale()], tNameLink.c_str());
+ handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, titleInfo->name, tNameLink.c_str());
return true;
}
@@ -138,7 +138,7 @@ public:
char const* targetName = target->GetName();
char titleNameStr[80];
- snprintf(titleNameStr, 80, titleInfo->name[handler->GetSessionDbcLocale()], targetName);
+ snprintf(titleNameStr, 80, titleInfo->name, targetName);
target->SetTitle(titleInfo);
handler->PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr, tNameLink.c_str());
@@ -187,7 +187,7 @@ public:
char const* targetName = target->GetName();
char titleNameStr[80];
- snprintf(titleNameStr, 80, titleInfo->name[handler->GetSessionDbcLocale()], targetName);
+ snprintf(titleNameStr, 80, titleInfo->name, targetName);
handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, id, titleNameStr, tNameLink.c_str());
diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp
index e3cd185e4a3..5bc84bed28a 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -688,7 +688,7 @@ public:
}
// re-create
Creature* wpCreature2 = new Creature;
- if (!wpCreature2->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
+ if (!wpCreature2->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
delete wpCreature2;
@@ -696,7 +696,7 @@ public:
return false;
}
- wpCreature2->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
+ wpCreature2->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr().GetPhaseMaskForSpawn());
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
//TODO: Should we first use "Create" then use "LoadFromDB"?
if (!wpCreature2->LoadCreatureFromDB(wpCreature2->GetDBTableGUIDLow(), map))
@@ -912,7 +912,7 @@ public:
float o = chr->GetOrientation();
Creature* wpCreature = new Creature;
- if (!wpCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
+ if (!wpCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete wpCreature;
@@ -928,7 +928,7 @@ public:
WorldDatabase.Execute(stmt);
- wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
+ wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr().GetPhaseMaskForSpawn());
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
if (!wpCreature->LoadCreatureFromDB(wpCreature->GetDBTableGUIDLow(), map))
{
@@ -941,7 +941,7 @@ public:
{
wpCreature->SetDisplayId(target->GetDisplayId());
wpCreature->SetObjectScale(0.5f);
- wpCreature->SetLevel(point > STRONG_MAX_LEVEL ? STRONG_MAX_LEVEL : point);
+ wpCreature->SetLevel(std::min<uint32>(point, STRONG_MAX_LEVEL));
}
}
while (result->NextRow());
@@ -976,14 +976,14 @@ public:
Map* map = chr->GetMap();
Creature* creature = new Creature;
- if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
+ if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete creature;
return false;
}
- creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
+ creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr().GetPhaseMaskForSpawn());
if (!creature->LoadCreatureFromDB(creature->GetDBTableGUIDLow(), map))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
@@ -1025,14 +1025,14 @@ public:
Map* map = chr->GetMap();
Creature* creature = new Creature;
- if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
+ if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id);
delete creature;
return false;
}
- creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
+ creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr().GetPhaseMaskForSpawn());
if (!creature->LoadCreatureFromDB(creature->GetDBTableGUIDLow(), map))
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id);
diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt
index 5dc3b52dec1..3db2545e2c1 100644
--- a/src/server/scripts/EasternKingdoms/CMakeLists.txt
+++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt
@@ -32,22 +32,17 @@ set(scripts_STAT_SRCS
EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp
EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp
EasternKingdoms/isle_of_queldanas.cpp
- EasternKingdoms/boss_kruul.cpp
- EasternKingdoms/ZulGurub/boss_hakkar.cpp
- EasternKingdoms/ZulGurub/boss_mandokir.cpp
- EasternKingdoms/ZulGurub/boss_marli.cpp
- EasternKingdoms/ZulGurub/boss_hazzarah.cpp
- EasternKingdoms/ZulGurub/boss_jeklik.cpp
EasternKingdoms/ZulGurub/boss_grilek.cpp
- EasternKingdoms/ZulGurub/zulgurub.h
+ EasternKingdoms/ZulGurub/boss_hazzarah.cpp
+ EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp
+ EasternKingdoms/ZulGurub/boss_kilnara.cpp
+ EasternKingdoms/ZulGurub/boss_mandokir.cpp
EasternKingdoms/ZulGurub/boss_renataki.cpp
- EasternKingdoms/ZulGurub/boss_arlokk.cpp
- EasternKingdoms/ZulGurub/boss_gahzranka.cpp
EasternKingdoms/ZulGurub/boss_venoxis.cpp
- EasternKingdoms/ZulGurub/instance_zulgurub.cpp
- EasternKingdoms/ZulGurub/boss_jindo.cpp
EasternKingdoms/ZulGurub/boss_wushoolay.cpp
- EasternKingdoms/ZulGurub/boss_thekal.cpp
+ EasternKingdoms/ZulGurub/boss_zanzil.cpp
+ EasternKingdoms/ZulGurub/instance_zulgurub.cpp
+ EasternKingdoms/ZulGurub/zulgurub.h
EasternKingdoms/wetlands.cpp
EasternKingdoms/arathi_highlands.cpp
EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
index 8e0fb9ff411..c2dab8d6c9e 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
@@ -237,7 +237,7 @@ class instance_deadmines : public InstanceMapScript
void DoPlaySound(GameObject* unit, uint32 sound)
{
- WorldPacket data(4);
+ WorldPacket data;
data.SetOpcode(SMSG_PLAY_SOUND);
data << uint32(sound);
unit->SendMessageToSet(&data, false);
@@ -245,7 +245,7 @@ class instance_deadmines : public InstanceMapScript
void DoPlaySoundCreature(Unit* unit, uint32 sound)
{
- WorldPacket data(4);
+ WorldPacket data;
data.SetOpcode(SMSG_PLAY_SOUND);
data << uint32(sound);
unit->SendMessageToSet(&data, false);
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
index bd79cbba628..d1b0e076d9c 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
@@ -246,8 +246,7 @@ public:
// Also needs an exception in spell system.
unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, me->GetGUID());
// Use packet hack
- WorldPacket data(12);
- data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
+ WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12);
data.append(unit->GetPackGUID());
data << uint32(0);
unit->SendMessageToSet(&data, true);
@@ -266,8 +265,7 @@ public:
unit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);
unit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT);
- WorldPacket data(12);
- data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
+ WorldPacket data(SMSG_MOVE_UNSET_CAN_FLY, 12);
data.append(unit->GetPackGUID());
data << uint32(0);
unit->SendMessageToSet(&data, true);
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
index ca91fb920b1..8cf964808d3 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
@@ -435,7 +435,7 @@ public:
{
me->SetVisible(false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
me->SetSpeed(MOVE_WALK, 5.0f, true);
wp_reached = false;
count = 0;
@@ -468,7 +468,7 @@ public:
instance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject
break;
case 19:
- me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
break;
case 20:
{
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
index e368124abaf..9085bf239a6 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
@@ -265,7 +265,7 @@ public:
{
OrbsEmpowered = 0;
EmpowerCount = 0;
- me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->setActive(true);
@@ -453,7 +453,7 @@ public:
summoned->CastSpell(summoned, SPELL_SHADOW_CHANNELING, false);
break;
case CREATURE_ANVEENA:
- summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY);
+ summoned->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
summoned->CastSpell(summoned, SPELL_ANVEENA_PRISON, true);
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
break;
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
deleted file mode 100644
index 17c3f5e8ff4..00000000000
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* ScriptData
-SDName: Boss_Arlokk
-SD%Complete: 95
-SDComment: Wrong cleave and red aura is missing.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-#include "zulgurub.h"
-
-enum eYells
-{
- SAY_AGGRO = -1309011,
- SAY_FEAST_PANTHER = -1309012,
- SAY_DEATH = -1309013,
-};
-
-enum eSpells
-{
- SPELL_SHADOWWORDPAIN = 23952,
- SPELL_GOUGE = 24698,
- SPELL_MARK = 24210,
- SPELL_CLEAVE = 26350, //Perhaps not right. Not a red aura...
- SPELL_PANTHER_TRANSFORM = 24190,
-
- MODEL_ID_NORMAL = 15218,
- MODEL_ID_PANTHER = 15215,
- MODEL_ID_BLANK = 11686,
-
- NPC_ZULIAN_PROWLER = 15101
-};
-
-class boss_arlokk : public CreatureScript
-{
- public:
-
- boss_arlokk()
- : CreatureScript("boss_arlokk")
- {
- }
-
- struct boss_arlokkAI : public ScriptedAI
- {
- boss_arlokkAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- }
-
- InstanceScript* instance;
-
- uint32 m_uiShadowWordPain_Timer;
- uint32 m_uiGouge_Timer;
- uint32 m_uiMark_Timer;
- uint32 m_uiCleave_Timer;
- uint32 m_uiVanish_Timer;
- uint32 m_uiVisible_Timer;
-
- uint32 m_uiSummon_Timer;
- uint32 m_uiSummonCount;
-
- Unit* m_pMarkedTarget;
- uint64 MarkedTargetGUID;
-
- bool m_bIsPhaseTwo;
- bool m_bIsVanished;
-
- void Reset()
- {
- m_uiShadowWordPain_Timer = 8000;
- m_uiGouge_Timer = 14000;
- m_uiMark_Timer = 35000;
- m_uiCleave_Timer = 4000;
- m_uiVanish_Timer = 60000;
- m_uiVisible_Timer = 6000;
-
- m_uiSummon_Timer = 5000;
- m_uiSummonCount = 0;
-
- m_bIsPhaseTwo = false;
- m_bIsVanished = false;
-
- MarkedTargetGUID = 0;
-
- me->SetDisplayId(MODEL_ID_NORMAL);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void EnterCombat(Unit* /*who*/)
- {
- DoScriptText(SAY_AGGRO, me);
- }
-
- void JustReachedHome()
- {
- if (instance)
- instance->SetData(DATA_ARLOKK, NOT_STARTED);
-
- //we should be summoned, so despawn
- me->DespawnOrUnsummon();
- }
-
- void JustDied(Unit* /*killer*/)
- {
- DoScriptText(SAY_DEATH, me);
-
- me->SetDisplayId(MODEL_ID_NORMAL);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-
- if (instance)
- instance->SetData(DATA_ARLOKK, DONE);
- }
-
- void DoSummonPhanters()
- {
- if (Unit* pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID))
- DoScriptText(SAY_FEAST_PANTHER, me, pMarkedTarget);
-
- me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998f, -1649.6734f, 41.4800f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970f, -1606.4840f, 41.2979f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- }
-
- void JustSummoned(Creature* summoned)
- {
- if (Unit* pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID))
- summoned->AI()->AttackStart(pMarkedTarget);
-
- ++m_uiSummonCount;
- }
-
- void UpdateAI(const uint32 uiDiff)
- {
- if (!UpdateVictim())
- return;
-
- if (!m_bIsPhaseTwo)
- {
- if (m_uiShadowWordPain_Timer <= uiDiff)
- {
- DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN);
- m_uiShadowWordPain_Timer = 15000;
- }
- else
- m_uiShadowWordPain_Timer -= uiDiff;
-
- if (m_uiMark_Timer <= uiDiff)
- {
- Unit* pMarkedTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
-
- if (pMarkedTarget)
- {
- DoCast(pMarkedTarget, SPELL_MARK);
- MarkedTargetGUID = pMarkedTarget->GetGUID();
- }
- else
- sLog->outError(LOG_FILTER_TSCR, "boss_arlokk could not accuire pMarkedTarget.");
-
- m_uiMark_Timer = 15000;
- }
- else
- m_uiMark_Timer -= uiDiff;
- }
- else
- {
- //Cleave_Timer
- if (m_uiCleave_Timer <= uiDiff)
- {
- DoCast(me->getVictim(), SPELL_CLEAVE);
- m_uiCleave_Timer = 16000;
- }
- else
- m_uiCleave_Timer -= uiDiff;
-
- //Gouge_Timer
- if (m_uiGouge_Timer <= uiDiff)
- {
- DoCast(me->getVictim(), SPELL_GOUGE);
-
- DoModifyThreatPercent(me->getVictim(), -80);
-
- m_uiGouge_Timer = 17000+rand()%10000;
- }
- else
- m_uiGouge_Timer -= uiDiff;
- }
-
- if (m_uiSummonCount <= 30)
- {
- if (m_uiSummon_Timer <= uiDiff)
- {
- DoSummonPhanters();
- m_uiSummon_Timer = 5000;
- }
- else
- m_uiSummon_Timer -= uiDiff;
- }
-
- if (m_uiVanish_Timer <= uiDiff)
- {
- //Invisble Model
- me->SetDisplayId(MODEL_ID_BLANK);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-
- me->AttackStop();
- DoResetThreat();
-
- m_bIsVanished = true;
-
- m_uiVanish_Timer = 45000;
- m_uiVisible_Timer = 6000;
- }
- else
- m_uiVanish_Timer -= uiDiff;
-
- if (m_bIsVanished)
- {
- if (m_uiVisible_Timer <= uiDiff)
- {
- //The Panther Model
- me->SetDisplayId(MODEL_ID_PANTHER);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-
- const CreatureTemplate* cinfo = me->GetCreatureTemplate();
- me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
- me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
- me->UpdateDamagePhysical(BASE_ATTACK);
-
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- AttackStart(target);
-
- m_bIsPhaseTwo = true;
- m_bIsVanished = false;
- }
- else
- m_uiVisible_Timer -= uiDiff;
- }
- else
- DoMeleeAttackIfReady();
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new boss_arlokkAI(creature);
- }
-};
-
-class go_gong_of_bethekk : public GameObjectScript
-{
- public:
- go_gong_of_bethekk() : GameObjectScript("go_gong_of_bethekk")
- {
- }
-
- bool OnGossipHello(Player* /*player*/, GameObject* go)
- {
- if (InstanceScript* instance = go->GetInstanceScript())
- {
- if (instance->GetData(DATA_ARLOKK) == DONE || instance->GetData(DATA_ARLOKK) == IN_PROGRESS)
- return true;
-
- instance->SetData(DATA_ARLOKK, IN_PROGRESS);
- return true;
- }
-
- return true;
- }
-};
-
-void AddSC_boss_arlokk()
-{
- new boss_arlokk();
- new go_gong_of_bethekk();
-}
-
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp
deleted file mode 100644
index 5e553c7396f..00000000000
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* ScriptData
-SDName: Boss_Gahz'ranka
-SD%Complete: 85
-SDComment: Massive Geyser with knockback not working. Spell buggy.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-
-#define SPELL_FROSTBREATH 16099
-#define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon...
-#define SPELL_SLAM 24326
-
-class boss_gahzranka : public CreatureScript
-{
- public:
- boss_gahzranka() : CreatureScript("boss_gahzranka") { }
-
- struct boss_gahzrankaAI : public ScriptedAI
- {
- boss_gahzrankaAI(Creature* creature) : ScriptedAI(creature) { }
- uint32 Frostbreath_Timer;
- uint32 MassiveGeyser_Timer;
- uint32 Slam_Timer;
-
- void Reset()
- {
- Frostbreath_Timer = 8000;
- MassiveGeyser_Timer = 25000;
- Slam_Timer = 17000;
- }
-
- void EnterCombat(Unit* /*who*/)
- {
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- //Frostbreath_Timer
- if (Frostbreath_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_FROSTBREATH);
- Frostbreath_Timer = urand(7000, 11000);
- } else Frostbreath_Timer -= diff;
-
- //MassiveGeyser_Timer
- if (MassiveGeyser_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_MASSIVEGEYSER);
- DoResetThreat();
-
- MassiveGeyser_Timer = urand(22000, 32000);
- } else MassiveGeyser_Timer -= diff;
-
- //Slam_Timer
- if (Slam_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SLAM);
- Slam_Timer = urand(12000, 20000);
- } else Slam_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new boss_gahzrankaAI(creature);
- }
-};
-
-void AddSC_boss_gahzranka()
-{
- new boss_gahzranka();
-}
-
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp
index 8c71ea6d48d..f015f08f082 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -16,71 +15,65 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Boss_Grilek
-SD%Complete: 100
-SDComment:
-SDCategory: Zul'Gurub
-EndScriptData */
-
+#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "zulgurub.h"
-#define SPELL_AVARTAR 24646 //The Enrage Spell
-#define SPELL_GROUNDTREMOR 6524
+enum Yells
+{
+};
+
+enum Spells
+{
+};
+
+enum Events
+{
+};
class boss_grilek : public CreatureScript
{
public:
boss_grilek() : CreatureScript("boss_grilek") { }
- struct boss_grilekAI : public ScriptedAI
+ struct boss_grilekAI : public BossAI
{
- boss_grilekAI(Creature* creature) : ScriptedAI(creature) { }
-
- uint32 Avartar_Timer;
- uint32 GroundTremor_Timer;
+ boss_grilekAI(Creature* creature) : BossAI(creature, DATA_GRILEK)
+ {
+ }
void Reset()
{
- Avartar_Timer = urand(15000, 25000);
- GroundTremor_Timer = urand(8000, 16000);
}
void EnterCombat(Unit* /*who*/)
{
}
- void UpdateAI(const uint32 diff)
+ void JustDied(Unit* /*killer*/)
+ {
+ }
+
+ void UpdateAI(uint32 const diff)
{
- //Return since we have no target
if (!UpdateVictim())
return;
- //Avartar_Timer
- if (Avartar_Timer <= diff)
- {
-
- DoCast(me, SPELL_AVARTAR);
- Unit* target = NULL;
+ events.Update(diff);
- target = SelectTarget(SELECT_TARGET_RANDOM, 1);
-
- if (DoGetThreat(me->getVictim()))
- DoModifyThreatPercent(me->getVictim(), -50);
- if (target)
- AttackStart(target);
-
- Avartar_Timer = urand(25000, 35000);
- } else Avartar_Timer -= diff;
-
- //GroundTremor_Timer
- if (GroundTremor_Timer <= diff)
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+ /*
+ while (uint32 eventId = events.ExecuteEvent())
{
- DoCast(me->getVictim(), SPELL_GROUNDTREMOR);
- GroundTremor_Timer = urand(12000, 16000);
- } else GroundTremor_Timer -= diff;
+ switch (eventId)
+ {
+ default:
+ break;
+ }
+ }
+ */
DoMeleeAttackIfReady();
}
@@ -96,4 +89,3 @@ void AddSC_boss_grilek()
{
new boss_grilek();
}
-
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp
deleted file mode 100644
index 6cb657f4cff..00000000000
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* ScriptData
-SDName: Boss_Hakkar
-SD%Complete: 95
-SDComment: Blood siphon spell buggy cause of Core Issue.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-#include "zulgurub.h"
-
-#define SAY_AGGRO -1309020
-#define SAY_FLEEING -1309021
-#define SAY_MINION_DESTROY -1309022 //where does it belong?
-#define SAY_PROTECT_ALTAR -1309023 //where does it belong?
-
-#define SPELL_BLOODSIPHON 24322
-#define SPELL_CORRUPTEDBLOOD 24328
-#define SPELL_CAUSEINSANITY 24327 //Not working disabled.
-#define SPELL_WILLOFHAKKAR 24178
-#define SPELL_ENRAGE 24318
-
-// The Aspects of all High Priests
-#define SPELL_ASPECT_OF_JEKLIK 24687
-#define SPELL_ASPECT_OF_VENOXIS 24688
-#define SPELL_ASPECT_OF_MARLI 24686
-#define SPELL_ASPECT_OF_THEKAL 24689
-#define SPELL_ASPECT_OF_ARLOKK 24690
-
-class boss_hakkar : public CreatureScript
-{
- public:
-
- boss_hakkar()
- : CreatureScript("boss_hakkar")
- {
- }
-
- struct boss_hakkarAI : public ScriptedAI
- {
- boss_hakkarAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- }
-
- InstanceScript* instance;
-
- uint32 BloodSiphon_Timer;
- uint32 CorruptedBlood_Timer;
- uint32 CauseInsanity_Timer;
- uint32 WillOfHakkar_Timer;
- uint32 Enrage_Timer;
-
- uint32 CheckJeklik_Timer;
- uint32 CheckVenoxis_Timer;
- uint32 CheckMarli_Timer;
- uint32 CheckThekal_Timer;
- uint32 CheckArlokk_Timer;
-
- uint32 AspectOfJeklik_Timer;
- uint32 AspectOfVenoxis_Timer;
- uint32 AspectOfMarli_Timer;
- uint32 AspectOfThekal_Timer;
- uint32 AspectOfArlokk_Timer;
-
- bool Enraged;
-
- void Reset()
- {
- BloodSiphon_Timer = 90000;
- CorruptedBlood_Timer = 25000;
- CauseInsanity_Timer = 17000;
- WillOfHakkar_Timer = 17000;
- Enrage_Timer = 600000;
-
- CheckJeklik_Timer = 1000;
- CheckVenoxis_Timer = 2000;
- CheckMarli_Timer = 3000;
- CheckThekal_Timer = 4000;
- CheckArlokk_Timer = 5000;
-
- AspectOfJeklik_Timer = 4000;
- AspectOfVenoxis_Timer = 7000;
- AspectOfMarli_Timer = 12000;
- AspectOfThekal_Timer = 8000;
- AspectOfArlokk_Timer = 18000;
-
- Enraged = false;
- }
-
- void EnterCombat(Unit* /*who*/)
- {
- DoScriptText(SAY_AGGRO, me);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
-
- //BloodSiphon_Timer
- if (BloodSiphon_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_BLOODSIPHON);
- BloodSiphon_Timer = 90000;
- } else BloodSiphon_Timer -= diff;
-
- //CorruptedBlood_Timer
- if (CorruptedBlood_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_CORRUPTEDBLOOD);
- CorruptedBlood_Timer = urand(30000, 45000);
- } else CorruptedBlood_Timer -= diff;
-
- //CauseInsanity_Timer
- /*if (CauseInsanity_Timer <= diff)
- {
- if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- DoCast(target, SPELL_CAUSEINSANITY);
-
- CauseInsanity_Timer = urand(35000, 43000);
- } else CauseInsanity_Timer -= diff;*/
-
- //WillOfHakkar_Timer
- if (WillOfHakkar_Timer <= diff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- DoCast(target, SPELL_WILLOFHAKKAR);
-
- WillOfHakkar_Timer = urand(25000, 35000);
- } else WillOfHakkar_Timer -= diff;
-
- if (!Enraged && Enrage_Timer <= diff)
- {
- DoCast(me, SPELL_ENRAGE);
- Enraged = true;
- } else Enrage_Timer -= diff;
-
- //Checking if Jeklik is dead. If not we cast her Aspect
- if (CheckJeklik_Timer <= diff)
- {
- if (instance)
- {
- if (instance->GetData(DATA_JEKLIK) != DONE)
- {
- if (AspectOfJeklik_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_ASPECT_OF_JEKLIK);
- AspectOfJeklik_Timer = urand(10000, 14000);
- } else AspectOfJeklik_Timer -= diff;
- }
- }
- CheckJeklik_Timer = 1000;
- } else CheckJeklik_Timer -= diff;
-
- //Checking if Venoxis is dead. If not we cast his Aspect
- if (CheckVenoxis_Timer <= diff)
- {
- if (instance)
- {
- if (instance->GetData(DATA_VENOXIS) != DONE)
- {
- if (AspectOfVenoxis_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_ASPECT_OF_VENOXIS);
- AspectOfVenoxis_Timer = 8000;
- } else AspectOfVenoxis_Timer -= diff;
- }
- }
- CheckVenoxis_Timer = 1000;
- } else CheckVenoxis_Timer -= diff;
-
- //Checking if Marli is dead. If not we cast her Aspect
- if (CheckMarli_Timer <= diff)
- {
- if (instance)
- {
- if (instance->GetData(DATA_MARLI) != DONE)
- {
- if (AspectOfMarli_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI);
- AspectOfMarli_Timer = 10000;
- } else AspectOfMarli_Timer -= diff;
-
- }
- }
- CheckMarli_Timer = 1000;
- } else CheckMarli_Timer -= diff;
-
- //Checking if Thekal is dead. If not we cast his Aspect
- if (CheckThekal_Timer <= diff)
- {
- if (instance)
- {
- if (instance->GetData(DATA_THEKAL) != DONE)
- {
- if (AspectOfThekal_Timer <= diff)
- {
- DoCast(me, SPELL_ASPECT_OF_THEKAL);
- AspectOfThekal_Timer = 15000;
- } else AspectOfThekal_Timer -= diff;
- }
- }
- CheckThekal_Timer = 1000;
- } else CheckThekal_Timer -= diff;
-
- //Checking if Arlokk is dead. If yes we cast her Aspect
- if (CheckArlokk_Timer <= diff)
- {
- if (instance)
- {
- if (instance->GetData(DATA_ARLOKK) != DONE)
- {
- if (AspectOfArlokk_Timer <= diff)
- {
- DoCast(me, SPELL_ASPECT_OF_ARLOKK);
- DoResetThreat();
-
- AspectOfArlokk_Timer = urand(10000, 15000);
- } else AspectOfArlokk_Timer -= diff;
- }
- }
- CheckArlokk_Timer = 1000;
- } else CheckArlokk_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new boss_hakkarAI(creature);
- }
-};
-
-void AddSC_boss_hakkar()
-{
- new boss_hakkar();
-}
-
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp
index bb3e0b14e0e..12bc4289a7d 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -16,86 +15,65 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Boss_Hazzarah
-SD%Complete: 100
-SDComment:
-SDCategory: Zul'Gurub
-EndScriptData */
-
+#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "zulgurub.h"
-#define SPELL_MANABURN 26046
-#define SPELL_SLEEP 24664
+enum Yells
+{
+};
+
+enum Spells
+{
+};
+
+enum Events
+{
+};
class boss_hazzarah : public CreatureScript
{
public:
+ boss_hazzarah() : CreatureScript("boss_hazzarah") { }
- boss_hazzarah()
- : CreatureScript("boss_hazzarah")
- {
- }
-
- struct boss_hazzarahAI : public ScriptedAI
+ struct boss_hazzarahAI : public BossAI
{
- boss_hazzarahAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 ManaBurn_Timer;
- uint32 Sleep_Timer;
- uint32 Illusions_Timer;
+ boss_hazzarahAI(Creature* creature) : BossAI(creature, DATA_HAZZARAH)
+ {
+ }
void Reset()
{
- ManaBurn_Timer = urand(4000, 10000);
- Sleep_Timer = urand(10000, 18000);
- Illusions_Timer = urand(10000, 18000);
}
void EnterCombat(Unit* /*who*/)
{
}
- void UpdateAI(const uint32 diff)
+ void JustDied(Unit* /*killer*/)
+ {
+ }
+
+ void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
- //ManaBurn_Timer
- if (ManaBurn_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_MANABURN);
- ManaBurn_Timer = urand(8000, 16000);
- } else ManaBurn_Timer -= diff;
-
- //Sleep_Timer
- if (Sleep_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SLEEP);
- Sleep_Timer = urand(12000, 20000);
- } else Sleep_Timer -= diff;
+ events.Update(diff);
- //Illusions_Timer
- if (Illusions_Timer <= diff)
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+ /*
+ while (uint32 eventId = events.ExecuteEvent())
{
- //We will summon 3 illusions that will spawn on a random gamer and attack this gamer
- //We will just use one model for the beginning
- Unit* target = NULL;
- for (uint8 i = 0; i < 3; ++i)
+ switch (eventId)
{
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (!target)
- return;
-
- Creature* Illusion = me->SummonCreature(15163, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
- if (Illusion)
- Illusion->AI()->AttackStart(target);
+ default:
+ break;
}
-
- Illusions_Timer = urand(15000, 25000);
- } else Illusions_Timer -= diff;
+ }
+ */
DoMeleeAttackIfReady();
}
@@ -111,4 +89,3 @@ void AddSC_boss_hazzarah()
{
new boss_hazzarah();
}
-
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp
deleted file mode 100644
index 156ccab5eae..00000000000
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* ScriptData
-SDName: Boss_Jeklik
-SD%Complete: 85
-SDComment: Problem in finding the right flying batriders for spawning and making them fly.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-#include "zulgurub.h"
-
-#define SAY_AGGRO -1309002
-#define SAY_RAIN_FIRE -1309003
-#define SAY_DEATH -1309004
-
-#define SPELL_CHARGE 22911
-#define SPELL_SONICBURST 23918
-#define SPELL_SCREECH 6605
-#define SPELL_SHADOW_WORD_PAIN 23952
-#define SPELL_MIND_FLAY 23953
-#define SPELL_CHAIN_MIND_FLAY 26044 //Right ID unknown. So disabled
-#define SPELL_GREATERHEAL 23954
-#define SPELL_BAT_FORM 23966
-
-// Batriders Spell
-
-#define SPELL_BOMB 40332 //Wrong ID but Magmadars bomb is not working...
-
-class boss_jeklik : public CreatureScript
-{
- public:
-
- boss_jeklik()
- : CreatureScript("boss_jeklik")
- {
- }
-
- struct boss_jeklikAI : public ScriptedAI
- {
- boss_jeklikAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- }
-
- InstanceScript* instance;
-
- uint32 Charge_Timer;
- uint32 SonicBurst_Timer;
- uint32 Screech_Timer;
- uint32 SpawnBats_Timer;
- uint32 ShadowWordPain_Timer;
- uint32 MindFlay_Timer;
- uint32 ChainMindFlay_Timer;
- uint32 GreaterHeal_Timer;
- uint32 SpawnFlyingBats_Timer;
-
- bool PhaseTwo;
-
- void Reset()
- {
- Charge_Timer = 20000;
- SonicBurst_Timer = 8000;
- Screech_Timer = 13000;
- SpawnBats_Timer = 60000;
- ShadowWordPain_Timer = 6000;
- MindFlay_Timer = 11000;
- ChainMindFlay_Timer = 26000;
- GreaterHeal_Timer = 50000;
- SpawnFlyingBats_Timer = 10000;
-
- PhaseTwo = false;
- }
-
- void EnterCombat(Unit* /*who*/)
- {
- DoScriptText(SAY_AGGRO, me);
- DoCast(me, SPELL_BAT_FORM);
- }
-
- void JustDied(Unit* /*killer*/)
- {
- DoScriptText(SAY_DEATH, me);
-
- if (instance)
- instance->SetData(DATA_JEKLIK, DONE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
-
- if (me->getVictim() && me->isAlive())
- {
- if (HealthAbovePct(50))
- {
- if (Charge_Timer <= diff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(target, SPELL_CHARGE);
- AttackStart(target);
- }
-
- Charge_Timer = urand(15000, 30000);
- } else Charge_Timer -= diff;
-
- if (SonicBurst_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SONICBURST);
- SonicBurst_Timer = urand(8000, 13000);
- } else SonicBurst_Timer -= diff;
-
- if (Screech_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SCREECH);
- Screech_Timer = urand(18000, 26000);
- } else Screech_Timer -= diff;
-
- if (SpawnBats_Timer <= diff)
- {
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
-
- Creature* Bat = NULL;
- Bat = me->SummonCreature(11368, -12291.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (target && Bat) Bat ->AI()->AttackStart(target);
-
- Bat = me->SummonCreature(11368, -12289.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (target && Bat) Bat ->AI()->AttackStart(target);
-
- Bat = me->SummonCreature(11368, -12293.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (target && Bat) Bat ->AI()->AttackStart(target);
-
- Bat = me->SummonCreature(11368, -12291.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (target && Bat) Bat ->AI()->AttackStart(target);
-
- Bat = me->SummonCreature(11368, -12289.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (target && Bat) Bat ->AI()->AttackStart(target);
- Bat = me->SummonCreature(11368, -12293.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (target && Bat) Bat ->AI()->AttackStart(target);
-
- SpawnBats_Timer = 60000;
- } else SpawnBats_Timer -= diff;
- }
- else
- {
- if (PhaseTwo)
- {
- if (PhaseTwo && ShadowWordPain_Timer <= diff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(target, SPELL_SHADOW_WORD_PAIN);
- ShadowWordPain_Timer = urand(12000, 18000);
- }
- }ShadowWordPain_Timer -=diff;
-
- if (MindFlay_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_MIND_FLAY);
- MindFlay_Timer = 16000;
- }MindFlay_Timer -=diff;
-
- if (ChainMindFlay_Timer <= diff)
- {
- me->InterruptNonMeleeSpells(false);
- DoCast(me->getVictim(), SPELL_CHAIN_MIND_FLAY);
- ChainMindFlay_Timer = urand(15000, 30000);
- }ChainMindFlay_Timer -=diff;
-
- if (GreaterHeal_Timer <= diff)
- {
- me->InterruptNonMeleeSpells(false);
- DoCast(me, SPELL_GREATERHEAL);
- GreaterHeal_Timer = urand(25000, 35000);
- }GreaterHeal_Timer -=diff;
-
- if (SpawnFlyingBats_Timer <= diff)
- {
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (!target)
- return;
-
- Creature* FlyingBat = me->SummonCreature(14965, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (FlyingBat)
- FlyingBat->AI()->AttackStart(target);
-
- SpawnFlyingBats_Timer = urand(10000, 15000);
- } else SpawnFlyingBats_Timer -=diff;
- }
- else
- {
- me->SetDisplayId(15219);
- DoResetThreat();
- PhaseTwo = true;
- }
- }
-
- DoMeleeAttackIfReady();
- }
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new boss_jeklikAI(creature);
- }
-};
-
-//Flying Bat
-class mob_batrider : public CreatureScript
-{
- public:
-
- mob_batrider()
- : CreatureScript("mob_batrider")
- {
- }
-
- struct mob_batriderAI : public ScriptedAI
- {
- mob_batriderAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- }
-
- InstanceScript* instance;
-
- uint32 Bomb_Timer;
- uint32 Check_Timer;
-
- void Reset()
- {
- Bomb_Timer = 2000;
- Check_Timer = 1000;
-
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void EnterCombat(Unit* /*who*/) {}
-
- void UpdateAI (const uint32 diff)
- {
- if (!UpdateVictim())
- return;
-
- //Bomb_Timer
- if (Bomb_Timer <= diff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(target, SPELL_BOMB);
- Bomb_Timer = 5000;
- }
- } else Bomb_Timer -= diff;
-
- //Check_Timer
- if (Check_Timer <= diff)
- {
- if (instance)
- {
- if (instance->GetData(DATA_JEKLIK) == DONE)
- {
- me->setDeathState(JUST_DIED);
- me->RemoveCorpse();
- return;
- }
- }
-
- Check_Timer = 1000;
- } else Check_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_batriderAI(creature);
- }
-};
-
-void AddSC_boss_jeklik()
-{
- new boss_jeklik();
- new mob_batrider();
-}
-
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp
deleted file mode 100644
index f8d23947e9c..00000000000
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* ScriptData
-SDName: Boss_Jin'do the Hexxer
-SD%Complete: 85
-SDComment: Mind Control not working because of core bug. Shades visible for all.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-#include "zulgurub.h"
-
-#define SAY_AGGRO -1309014
-
-#define SPELL_BRAINWASHTOTEM 24262
-#define SPELL_POWERFULLHEALINGWARD 24309 //We will not use this spell. We will summon a totem by script cause the spell totems will not cast.
-#define SPELL_HEX 24053
-#define SPELL_DELUSIONSOFJINDO 24306
-#define SPELL_SHADEOFJINDO 24308 //We will not use this spell. We will summon a shade by script.
-
-//Healing Ward Spell
-#define SPELL_HEAL 38588 //Totems are not working right. Right heal spell ID is 24311 but this spell is not casting...
-
-//Shade of Jindo Spell
-#define SPELL_SHADOWSHOCK 19460
-#define SPELL_INVISIBLE 24699
-
-class boss_jindo : public CreatureScript
-{
- public:
-
- boss_jindo()
- : CreatureScript("boss_jindo")
- {
- }
-
- struct boss_jindoAI : public ScriptedAI
- {
- boss_jindoAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 BrainWashTotem_Timer;
- uint32 HealingWard_Timer;
- uint32 Hex_Timer;
- uint32 Delusions_Timer;
- uint32 Teleport_Timer;
-
- void Reset()
- {
- BrainWashTotem_Timer = 20000;
- HealingWard_Timer = 16000;
- Hex_Timer = 8000;
- Delusions_Timer = 10000;
- Teleport_Timer = 5000;
- }
-
- void EnterCombat(Unit* /*who*/)
- {
- DoScriptText(SAY_AGGRO, me);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
-
- //BrainWashTotem_Timer
- if (BrainWashTotem_Timer <= diff)
- {
- DoCast(me, SPELL_BRAINWASHTOTEM);
- BrainWashTotem_Timer = urand(18000, 26000);
- } else BrainWashTotem_Timer -= diff;
-
- //HealingWard_Timer
- if (HealingWard_Timer <= diff)
- {
- //DoCast(me, SPELL_POWERFULLHEALINGWARD);
- me->SummonCreature(14987, me->GetPositionX()+3, me->GetPositionY()-2, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000);
- HealingWard_Timer = urand(14000, 20000);
- } else HealingWard_Timer -= diff;
-
- //Hex_Timer
- if (Hex_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_HEX);
-
- if (DoGetThreat(me->getVictim()))
- DoModifyThreatPercent(me->getVictim(), -80);
-
- Hex_Timer = urand(12000, 20000);
- } else Hex_Timer -= diff;
-
- //Casting the delusion curse with a shade. So shade will attack the same target with the curse.
- if (Delusions_Timer <= diff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(target, SPELL_DELUSIONSOFJINDO);
-
- Creature* Shade = me->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (Shade)
- Shade->AI()->AttackStart(target);
- }
-
- Delusions_Timer = urand(4000, 12000);
- } else Delusions_Timer -= diff;
-
- //Teleporting a random gamer and spawning 9 skeletons that will attack this gamer
- if (Teleport_Timer <= diff)
- {
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (target && target->GetTypeId() == TYPEID_PLAYER)
- {
- DoTeleportPlayer(target, -11583.7783f, -1249.4278f, 77.5471f, 4.745f);
-
- if (DoGetThreat(me->getVictim()))
- DoModifyThreatPercent(target, -100);
-
- Creature* Skeletons;
- Skeletons = me->SummonCreature(14826, target->GetPositionX()+2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (Skeletons)
- Skeletons->AI()->AttackStart(target);
- Skeletons = me->SummonCreature(14826, target->GetPositionX()-2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (Skeletons)
- Skeletons->AI()->AttackStart(target);
- Skeletons = me->SummonCreature(14826, target->GetPositionX()+4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (Skeletons)
- Skeletons->AI()->AttackStart(target);
- Skeletons = me->SummonCreature(14826, target->GetPositionX()-4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (Skeletons)
- Skeletons->AI()->AttackStart(target);
- Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (Skeletons)
- Skeletons->AI()->AttackStart(target);
- Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (Skeletons)
- Skeletons->AI()->AttackStart(target);
- Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (Skeletons)
- Skeletons->AI()->AttackStart(target);
- Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (Skeletons)
- Skeletons->AI()->AttackStart(target);
- Skeletons = me->SummonCreature(14826, target->GetPositionX()+3, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (Skeletons)
- Skeletons->AI()->AttackStart(target);
- }
-
- Teleport_Timer = urand(15000, 23000);
- } else Teleport_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new boss_jindoAI(creature);
- }
-};
-
-//Healing Ward
-class mob_healing_ward : public CreatureScript
-{
- public:
-
- mob_healing_ward()
- : CreatureScript("mob_healing_ward")
- {
- }
-
- struct mob_healing_wardAI : public ScriptedAI
- {
- mob_healing_wardAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- }
-
- uint32 Heal_Timer;
-
- InstanceScript* instance;
-
- void Reset()
- {
- Heal_Timer = 2000;
- }
-
- void EnterCombat(Unit* /*who*/)
- {
- }
-
- void UpdateAI (const uint32 diff)
- {
- //Heal_Timer
- if (Heal_Timer <= diff)
- {
- if (instance)
- {
- Unit* pJindo = Unit::GetUnit(*me, instance->GetData64(DATA_JINDO));
- if (pJindo)
- DoCast(pJindo, SPELL_HEAL);
- }
- Heal_Timer = 3000;
- } else Heal_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_healing_wardAI(creature);
- }
-};
-
-//Shade of Jindo
-class mob_shade_of_jindo : public CreatureScript
-{
- public:
-
- mob_shade_of_jindo()
- : CreatureScript("mob_shade_of_jindo")
- {
- }
-
- struct mob_shade_of_jindoAI : public ScriptedAI
- {
- mob_shade_of_jindoAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 ShadowShock_Timer;
-
- void Reset()
- {
- ShadowShock_Timer = 1000;
- DoCast(me, SPELL_INVISIBLE, true);
- }
-
- void EnterCombat(Unit* /*who*/){}
-
- void UpdateAI (const uint32 diff)
- {
-
- //ShadowShock_Timer
- if (ShadowShock_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SHADOWSHOCK);
- ShadowShock_Timer = 2000;
- } else ShadowShock_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_shade_of_jindoAI(creature);
- }
-};
-
-void AddSC_boss_jindo()
-{
- new boss_jindo();
- new mob_healing_ward();
- new mob_shade_of_jindo();
-}
-
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp
new file mode 100644
index 00000000000..204db428bf0
--- /dev/null
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp
@@ -0,0 +1,91 @@
+/*
+ * 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/>.
+ */
+
+#include "ObjectMgr.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "zulgurub.h"
+
+enum Yells
+{
+};
+
+enum Spells
+{
+};
+
+enum Events
+{
+};
+
+class boss_jindo_the_godbreaker : public CreatureScript
+{
+ public:
+ boss_jindo_the_godbreaker() : CreatureScript("boss_jindo_the_godbreaker") { }
+
+ struct boss_jindo_the_godbreakerAI : public BossAI
+ {
+ boss_jindo_the_godbreakerAI(Creature* creature) : BossAI(creature, DATA_JINDO)
+ {
+ }
+
+ void Reset()
+ {
+ }
+
+ void EnterCombat(Unit* /*who*/)
+ {
+ }
+
+ void JustDied(Unit* /*killer*/)
+ {
+ }
+
+ void UpdateAI(uint32 const diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+ /*
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ default:
+ break;
+ }
+ }
+ */
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new boss_jindo_the_godbreakerAI(creature);
+ }
+};
+
+void AddSC_boss_jindo_the_godbreaker()
+{
+ new boss_jindo_the_godbreaker();
+}
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp
new file mode 100644
index 00000000000..17c73ae96bd
--- /dev/null
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp
@@ -0,0 +1,92 @@
+/*
+ * 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/>.
+ */
+
+#include "ObjectMgr.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "Spell.h"
+#include "zulgurub.h"
+
+enum Yells
+{
+};
+
+enum Spells
+{
+};
+
+enum Events
+{
+};
+
+class boss_kilnara : public CreatureScript
+{
+ public:
+ boss_kilnara() : CreatureScript("boss_kilnara") { }
+
+ struct boss_kilnaraAI : public BossAI
+ {
+ boss_kilnaraAI(Creature* creature) : BossAI(creature, DATA_KILNARA)
+ {
+ }
+
+ void Reset()
+ {
+ }
+
+ void EnterCombat(Unit* /*who*/)
+ {
+ }
+
+ void JustDied(Unit* /*killer*/)
+ {
+ }
+
+ void UpdateAI(uint32 const diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+ /*
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ default:
+ break;
+ }
+ }
+ */
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new boss_kilnaraAI(creature);
+ }
+};
+
+void AddSC_boss_kilnara()
+{
+ new boss_kilnara();
+}
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
index 32831eb047b..55f257e5ecc 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
@@ -16,334 +16,67 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Boss_Mandokir
-SD%Complete: 90
-SDComment: Ohgan function needs improvements.
-SDCategory: Zul'Gurub
-EndScriptData */
-
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "zulgurub.h"
-#define SAY_AGGRO -1309015
-#define SAY_DING_KILL -1309016
-#define SAY_GRATS_JINDO -1309017
-#define SAY_WATCH -1309018
-#define SAY_WATCH_WHISPER -1309019 //is this text for real? easter egg?
-
-#define SPELL_CHARGE 24408
-#define SPELL_CLEAVE 7160
-#define SPELL_FEAR 29321
-#define SPELL_WHIRLWIND 15589
-#define SPELL_MORTAL_STRIKE 16856
-#define SPELL_ENRAGE 24318
-#define SPELL_WATCH 24314
-#define SPELL_LEVEL_UP 24312
+enum Yells
+{
+};
-//Ohgans Spells
-#define SPELL_SUNDERARMOR 24317
+enum Spells
+{
+};
-#define NPC_SPEAKER 11391
+enum Events
+{
+};
class boss_mandokir : public CreatureScript
{
public:
- boss_mandokir()
- : CreatureScript("boss_mandokir")
- {
- }
+ boss_mandokir() : CreatureScript("boss_mandokir") { }
- struct boss_mandokirAI : public ScriptedAI
+ struct boss_mandokirAI : public BossAI
{
- boss_mandokirAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- }
-
- uint32 KillCount;
- uint32 Watch_Timer;
- uint32 TargetInRange;
- uint32 Cleave_Timer;
- uint32 Whirlwind_Timer;
- uint32 Fear_Timer;
- uint32 MortalStrike_Timer;
- uint32 Check_Timer;
- float targetX;
- float targetY;
- float targetZ;
-
- InstanceScript* instance;
-
- bool endWatch;
- bool someWatched;
- bool RaptorDead;
- bool CombatStart;
- bool SpeakerDead;
-
- uint64 WatchTarget;
+ boss_mandokirAI(Creature* creature) : BossAI(creature, DATA_MANDOKIR) { }
void Reset()
{
- KillCount = 0;
- Watch_Timer = 33000;
- Cleave_Timer = 7000;
- Whirlwind_Timer = 20000;
- Fear_Timer = 1000;
- MortalStrike_Timer = 1000;
- Check_Timer = 1000;
-
- targetX = 0.0f;
- targetY = 0.0f;
- targetZ = 0.0f;
- TargetInRange = 0;
-
- WatchTarget = 0;
-
- someWatched = false;
- endWatch = false;
- RaptorDead = false;
- CombatStart = false;
- SpeakerDead = false;
-
- DoCast(me, 23243);
}
- void KilledUnit(Unit* victim)
+ void KilledUnit(Unit* /*victim*/)
{
- if (victim->GetTypeId() == TYPEID_PLAYER)
- {
- ++KillCount;
-
- if (KillCount == 3)
- {
- DoScriptText(SAY_DING_KILL, me);
-
- if (instance)
- {
- uint64 JindoGUID = instance->GetData64(DATA_JINDO);
- if (JindoGUID)
- {
- if (Unit* jTemp = Unit::GetUnit(*me, JindoGUID))
- {
- if (jTemp->isAlive())
- DoScriptText(SAY_GRATS_JINDO, jTemp);
- }
- }
- }
- DoCast(me, SPELL_LEVEL_UP, true);
- KillCount = 0;
- }
- }
}
void EnterCombat(Unit* /*who*/)
{
- DoScriptText(SAY_AGGRO, me);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!SpeakerDead)
- {
- if (!me->FindNearestCreature(NPC_SPEAKER, 100.0f, true))
- {
- me->GetMotionMaster()->MovePoint(0, -12196.3f, -1948.37f, 130.36f);
- SpeakerDead = true;
- }
- }
-
- if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && SpeakerDead)
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
-
- if (!UpdateVictim())
- return;
-
- if (me->getVictim() && me->isAlive())
- {
- if (!CombatStart)
- {
- //At combat Start Mandokir is mounted so we must unmount it first
- me->Dismount();
-
- //And summon his raptor
- me->SummonCreature(14988, me->getVictim()->GetPositionX(), me->getVictim()->GetPositionY(), me->getVictim()->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 35000);
- CombatStart = true;
- }
-
- if (Watch_Timer <= diff) //Every 20 Sec Mandokir will check this
- {
- if (WatchTarget) //If someone is watched and If the Position of the watched target is different from the one stored, or are attacking, mandokir will charge him
- {
- Unit* unit = Unit::GetUnit(*me, WatchTarget);
-
- if (unit && (
- targetX != unit->GetPositionX() ||
- targetY != unit->GetPositionY() ||
- targetZ != unit->GetPositionZ() ||
- unit->isInCombat()))
- {
- if (me->IsWithinMeleeRange(unit))
- {
- DoCast(unit, 24316);
- }
- else
- {
- DoCast(unit, SPELL_CHARGE);
- //me->SendMonsterMove(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), 0, true, 1);
- AttackStart(unit);
- }
- }
- }
- someWatched = false;
- Watch_Timer = 20000;
- } else Watch_Timer -= diff;
-
- if ((Watch_Timer < 8000) && !someWatched) //8 sec(cast time + expire time) before the check for the watch effect mandokir will cast watch debuff on a random target
- {
- if (Unit* p = SelectTarget(SELECT_TARGET_RANDOM, 0))
- {
- DoScriptText(SAY_WATCH, me, p);
- DoCast(p, SPELL_WATCH);
- WatchTarget = p->GetGUID();
- someWatched = true;
- endWatch = true;
- }
- }
-
- if ((Watch_Timer < 1000) && endWatch) //1 sec before the debuf expire, store the target position
- {
- Unit* unit = Unit::GetUnit(*me, WatchTarget);
- if (unit)
- {
- targetX = unit->GetPositionX();
- targetY = unit->GetPositionY();
- targetZ = unit->GetPositionZ();
- }
- endWatch = false;
- }
-
- if (!someWatched)
- {
- //Cleave
- if (Cleave_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_CLEAVE);
- Cleave_Timer = 7000;
- } else Cleave_Timer -= diff;
-
- //Whirlwind
- if (Whirlwind_Timer <= diff)
- {
- DoCast(me, SPELL_WHIRLWIND);
- Whirlwind_Timer = 18000;
- } else Whirlwind_Timer -= diff;
-
- //If more then 3 targets in melee range mandokir will cast fear
- if (Fear_Timer <= diff)
- {
- TargetInRange = 0;
-
- std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
- for (; i != me->getThreatManager().getThreatList().end(); ++i)
- {
- Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
- if (unit && me->IsWithinMeleeRange(unit))
- ++TargetInRange;
- }
-
- if (TargetInRange > 3)
- DoCast(me->getVictim(), SPELL_FEAR);
-
- Fear_Timer = 4000;
- } else Fear_Timer -=diff;
-
- //Mortal Strike if target below 50% hp
- if (me->getVictim() && me->getVictim()->HealthBelowPct(50))
- {
- if (MortalStrike_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
- MortalStrike_Timer = 15000;
- } else MortalStrike_Timer -= diff;
- }
- }
- //Checking if Ohgan is dead. If yes Mandokir will enrage.
- if (Check_Timer <= diff)
- {
- if (instance)
- {
- if (instance->GetData(DATA_OHGAN) == DONE)
- {
- if (!RaptorDead)
- {
- DoCast(me, SPELL_ENRAGE);
- RaptorDead = true;
- }
- }
- }
-
- Check_Timer = 1000;
- } else Check_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new boss_mandokirAI(creature);
- }
-};
-
-//Ohgan
-class mob_ohgan : public CreatureScript
-{
- public:
-
- mob_ohgan()
- : CreatureScript("mob_ohgan")
- {
- }
-
- struct mob_ohganAI : public ScriptedAI
- {
- mob_ohganAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
}
- uint32 SunderArmor_Timer;
- InstanceScript* instance;
-
- void Reset()
- {
- SunderArmor_Timer = 5000;
- }
-
- void EnterCombat(Unit* /*who*/) {}
-
void JustDied(Unit* /*killer*/)
{
- if (instance)
- instance->SetData(DATA_OHGAN, DONE);
}
- void UpdateAI (const uint32 diff)
+ void UpdateAI(uint32 const diff)
{
- //Return since we have no target
if (!UpdateVictim())
return;
- //SunderArmor_Timer
- if (SunderArmor_Timer <= diff)
+ events.Update(diff);
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+ /*
+ while (uint32 eventId = events.ExecuteEvent())
{
- DoCast(me->getVictim(), SPELL_SUNDERARMOR);
- SunderArmor_Timer = urand(10000, 15000);
- } else SunderArmor_Timer -= diff;
+ switch (eventId)
+ {
+ default:
+ break;
+ }
+ }
+ */
DoMeleeAttackIfReady();
}
@@ -351,13 +84,11 @@ class mob_ohgan : public CreatureScript
CreatureAI* GetAI(Creature* creature) const
{
- return new mob_ohganAI(creature);
+ return new boss_mandokirAI(creature);
}
};
void AddSC_boss_mandokir()
{
new boss_mandokir();
- new mob_ohgan();
}
-
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp
deleted file mode 100644
index 8e0deda1d0b..00000000000
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* ScriptData
-SDName: Boss_Marli
-SD%Complete: 80
-SDComment: Charging healers and casters not working. Perhaps wrong Spell Timers.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-#include "zulgurub.h"
-
-#define SAY_AGGRO -1309005
-#define SAY_TRANSFORM -1309006
-#define SAY_SPIDER_SPAWN -1309007
-#define SAY_DEATH -1309008
-
-#define SPELL_CHARGE 22911
-#define SPELL_ASPECT_OF_MARLI 24686 // A stun spell
-#define SPELL_ENVOLWINGWEB 24110
-#define SPELL_POISONVOLLEY 24099
-#define SPELL_SPIDER_FORM 24084
-
-//The Spider Spells
-#define SPELL_LEVELUP 24312 //Not right Spell.
-
-class boss_marli : public CreatureScript
-{
- public:
-
- boss_marli()
- : CreatureScript("boss_marli")
- {
- }
-
- struct boss_marliAI : public ScriptedAI
- {
- boss_marliAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- }
-
- InstanceScript* instance;
-
- uint32 SpawnStartSpiders_Timer;
- uint32 PoisonVolley_Timer;
- uint32 SpawnSpider_Timer;
- uint32 Charge_Timer;
- uint32 Aspect_Timer;
- uint32 Transform_Timer;
- uint32 TransformBack_Timer;
-
- bool Spawned;
- bool PhaseTwo;
-
- void Reset()
- {
- SpawnStartSpiders_Timer = 1000;
- PoisonVolley_Timer = 15000;
- SpawnSpider_Timer = 30000;
- Charge_Timer = 1500;
- Aspect_Timer = 12000;
- Transform_Timer = 45000;
- TransformBack_Timer = 25000;
-
- Spawned = false;
- PhaseTwo = false;
- }
-
- void EnterCombat(Unit* /*who*/)
- {
- DoScriptText(SAY_AGGRO, me);
- }
-
- void JustDied(Unit* /*killer*/)
- {
- DoScriptText(SAY_DEATH, me);
- if (instance)
- instance->SetData(DATA_MARLI, DONE);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
-
- if (me->getVictim() && me->isAlive())
- {
- if (PoisonVolley_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_POISONVOLLEY);
- PoisonVolley_Timer = urand(10000, 20000);
- } else PoisonVolley_Timer -= diff;
-
- if (!PhaseTwo && Aspect_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI);
- Aspect_Timer = urand(13000, 18000);
- } else Aspect_Timer -= diff;
-
- if (!Spawned && SpawnStartSpiders_Timer <= diff)
- {
- DoScriptText(SAY_SPIDER_SPAWN, me);
-
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (!target)
- return;
-
- Creature* Spider = NULL;
-
- Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (Spider)
- Spider->AI()->AttackStart(target);
- Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (Spider)
- Spider->AI()->AttackStart(target);
- Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (Spider)
- Spider->AI()->AttackStart(target);
- Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (Spider)
- Spider->AI()->AttackStart(target);
-
- Spawned = true;
- } else SpawnStartSpiders_Timer -= diff;
-
- if (SpawnSpider_Timer <= diff)
- {
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (!target)
- return;
-
- Creature* Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- if (Spider)
- Spider->AI()->AttackStart(target);
- SpawnSpider_Timer = urand(12000, 17000);
- } else SpawnSpider_Timer -= diff;
-
- if (!PhaseTwo && Transform_Timer <= diff)
- {
- DoScriptText(SAY_TRANSFORM, me);
- DoCast(me, SPELL_SPIDER_FORM);
- const CreatureTemplate* cinfo = me->GetCreatureTemplate();
- me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
- me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
- me->UpdateDamagePhysical(BASE_ATTACK);
- DoCast(me->getVictim(), SPELL_ENVOLWINGWEB);
-
- if (DoGetThreat(me->getVictim()))
- DoModifyThreatPercent(me->getVictim(), -100);
-
- PhaseTwo = true;
- Transform_Timer = urand(35000, 60000);
- } else Transform_Timer -= diff;
-
- if (PhaseTwo)
- {
- if (Charge_Timer <= diff)
- {
- Unit* target = NULL;
- int i = 0;
- 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
- if (target && target->getPowerType() == POWER_MANA)
- i = 3;
- }
- if (target)
- {
- DoCast(target, SPELL_CHARGE);
- //me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
- //me->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true, 1);
- AttackStart(target);
- }
-
- Charge_Timer = 8000;
- } else Charge_Timer -= diff;
-
- if (TransformBack_Timer <= diff)
- {
- me->SetDisplayId(15220);
- const CreatureTemplate* cinfo = me->GetCreatureTemplate();
- me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1)));
- me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1)));
- me->UpdateDamagePhysical(BASE_ATTACK);
-
- PhaseTwo = false;
- TransformBack_Timer = urand(25000, 40000);
- } else TransformBack_Timer -= diff;
-
- }
-
- DoMeleeAttackIfReady();
- }
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new boss_marliAI(creature);
- }
-};
-
-//Spawn of Marli
-class mob_spawn_of_marli : public CreatureScript
-{
- public:
-
- mob_spawn_of_marli()
- : CreatureScript("mob_spawn_of_marli")
- {
- }
-
- struct mob_spawn_of_marliAI : public ScriptedAI
- {
- mob_spawn_of_marliAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 LevelUp_Timer;
-
- void Reset()
- {
- LevelUp_Timer = 3000;
- }
-
- void EnterCombat(Unit* /*who*/)
- {
- }
-
- void UpdateAI (const uint32 diff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- //LevelUp_Timer
- if (LevelUp_Timer <= diff)
- {
- DoCast(me, SPELL_LEVELUP);
- LevelUp_Timer = 3000;
- } else LevelUp_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_spawn_of_marliAI(creature);
- }
-};
-
-void AddSC_boss_marli()
-{
- new boss_marli();
- new mob_spawn_of_marli();
-}
-
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
index 32a8f209917..4b4cfa1bd45 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -16,135 +15,65 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Boss_Renataki
-SD%Complete: 100
-SDComment:
-SDCategory: Zul'Gurub
-EndScriptData */
-
+#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "zulgurub.h"
-#define SPELL_AMBUSH 24337
-#define SPELL_THOUSANDBLADES 24649
+enum Yells
+{
+};
-#define EQUIP_ID_MAIN_HAND 0 //was item display id 31818, but this id does not exist
+enum Spells
+{
+};
+
+enum Events
+{
+};
class boss_renataki : public CreatureScript
{
public:
+ boss_renataki() : CreatureScript("boss_renataki") { }
- boss_renataki()
- : CreatureScript("boss_renataki")
- {
- }
-
- struct boss_renatakiAI : public ScriptedAI
+ struct boss_renatakiAI : public BossAI
{
- boss_renatakiAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 Invisible_Timer;
- uint32 Ambush_Timer;
- uint32 Visible_Timer;
- uint32 Aggro_Timer;
- uint32 ThousandBlades_Timer;
-
- bool Invisible;
- bool Ambushed;
+ boss_renatakiAI(Creature* creature) : BossAI(creature, DATA_RENATAKI)
+ {
+ }
void Reset()
{
- Invisible_Timer = urand(8000, 18000);
- Ambush_Timer = 3000;
- Visible_Timer = 4000;
- Aggro_Timer = urand(15000, 25000);
- ThousandBlades_Timer = urand(4000, 8000);
-
- Invisible = false;
- Ambushed = false;
}
void EnterCombat(Unit* /*who*/)
{
}
- void UpdateAI(const uint32 diff)
+ void JustDied(Unit* /*killer*/)
+ {
+ }
+
+ void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
- //Invisible_Timer
- if (Invisible_Timer <= diff)
- {
- me->InterruptSpell(CURRENT_GENERIC_SPELL);
-
- SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
- me->SetDisplayId(11686);
+ events.Update(diff);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Invisible = true;
-
- Invisible_Timer = urand(15000, 30000);
- } else Invisible_Timer -= diff;
-
- if (Invisible)
- {
- if (Ambush_Timer <= diff)
- {
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (target)
- {
- DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
- DoCast(target, SPELL_AMBUSH);
- }
-
- Ambushed = true;
- Ambush_Timer = 3000;
- } else Ambush_Timer -= diff;
- }
-
- if (Ambushed)
- {
- if (Visible_Timer <= diff)
- {
- me->InterruptSpell(CURRENT_GENERIC_SPELL);
-
- me->SetDisplayId(15268);
- SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
-
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- Invisible = false;
-
- Visible_Timer = 4000;
- } else Visible_Timer -= diff;
- }
-
- //Resetting some aggro so he attacks other gamers
- if (!Invisible)
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+ /*
+ while (uint32 eventId = events.ExecuteEvent())
{
- if (Aggro_Timer <= diff)
- {
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 1);
-
- if (DoGetThreat(me->getVictim()))
- DoModifyThreatPercent(me->getVictim(), -50);
-
- if (target)
- AttackStart(target);
-
- Aggro_Timer = urand(7000, 20000);
- } else Aggro_Timer -= diff;
-
- if (ThousandBlades_Timer <= diff)
+ switch (eventId)
{
- DoCast(me->getVictim(), SPELL_THOUSANDBLADES);
- ThousandBlades_Timer = urand(7000, 12000);
- } else ThousandBlades_Timer -= diff;
+ default:
+ break;
+ }
}
+ */
DoMeleeAttackIfReady();
}
@@ -160,4 +89,3 @@ void AddSC_boss_renataki()
{
new boss_renataki();
}
-
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
deleted file mode 100644
index 29495f77f2a..00000000000
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
+++ /dev/null
@@ -1,588 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* ScriptData
-SDName: Boss_Thekal
-SD%Complete: 95
-SDComment: Almost finished.
-SDCategory: Zul'Gurub
-EndScriptData */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-#include "zulgurub.h"
-
-#define SAY_AGGRO -1309009
-#define SAY_DEATH -1309010
-
-enum eSpells
-{
- SPELL_MORTALCLEAVE = 22859,
- SPELL_SILENCE = 22666,
- SPELL_FRENZY = 8269,
- SPELL_FORCEPUNCH = 24189,
- SPELL_CHARGE = 24193,
- SPELL_ENRAGE = 8269,
- SPELL_SUMMONTIGERS = 24183,
- SPELL_TIGER_FORM = 24169,
- SPELL_RESURRECT = 24173, //We will not use this spell.
-
-//Zealot Lor'Khan Spells
- SPELL_SHIELD = 20545,
- SPELL_BLOODLUST = 24185,
- SPELL_GREATERHEAL = 24208,
- SPELL_DISARM = 6713,
-
-//Zealot Zath Spells
- SPELL_SWEEPINGSTRIKES = 18765,
- SPELL_SINISTERSTRIKE = 15581,
- SPELL_GOUGE = 12540,
- SPELL_KICK = 15614,
- SPELL_BLIND = 21060,
-};
-
-class boss_thekal : public CreatureScript
-{
- public:
-
- boss_thekal()
- : CreatureScript("boss_thekal")
- {
- }
-
- struct boss_thekalAI : public ScriptedAI
- {
- boss_thekalAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- }
-
- uint32 MortalCleave_Timer;
- uint32 Silence_Timer;
- uint32 Frenzy_Timer;
- uint32 ForcePunch_Timer;
- uint32 Charge_Timer;
- uint32 Enrage_Timer;
- uint32 SummonTigers_Timer;
- uint32 Check_Timer;
- uint32 Resurrect_Timer;
-
- InstanceScript* instance;
- bool Enraged;
- bool PhaseTwo;
- bool WasDead;
-
- void Reset()
- {
- MortalCleave_Timer = 4000;
- Silence_Timer = 9000;
- Frenzy_Timer = 30000;
- ForcePunch_Timer = 4000;
- Charge_Timer = 12000;
- Enrage_Timer = 32000;
- SummonTigers_Timer = 25000;
- Check_Timer = 10000;
- Resurrect_Timer = 10000;
-
- Enraged = false;
- PhaseTwo = false;
- WasDead = false;
- }
-
- void EnterCombat(Unit* /*who*/)
- {
- DoScriptText(SAY_AGGRO, me);
- }
-
- void JustDied(Unit* /*killer*/)
- {
- DoScriptText(SAY_DEATH, me);
- if (instance)
- instance->SetData(DATA_THEKAL, DONE);
- }
-
- void JustReachedHome()
- {
- if (instance)
- instance->SetData(DATA_THEKAL, NOT_STARTED);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
-
- //Check_Timer for the death of LorKhan and Zath.
- if (!WasDead && Check_Timer <= diff)
- {
- if (instance)
- {
- if (instance->GetData(DATA_LORKHAN) == SPECIAL)
- {
- //Resurrect LorKhan
- if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN)))
- {
- pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pLorKhan->setFaction(14);
- pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pLorKhan->SetFullHealth();
-
- instance->SetData(DATA_LORKHAN, DONE);
- }
- }
-
- if (instance->GetData(DATA_ZATH) == SPECIAL)
- {
- //Resurrect Zath
- Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH));
- if (pZath)
- {
- pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pZath->setFaction(14);
- pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pZath->SetFullHealth();
-
- instance->SetData(DATA_ZATH, DONE);
- }
- }
- }
-
- Check_Timer = 5000;
- } else Check_Timer -= diff;
-
- if (!PhaseTwo && MortalCleave_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_MORTALCLEAVE);
- MortalCleave_Timer = urand(15000, 20000);
- } else MortalCleave_Timer -= diff;
-
- if (!PhaseTwo && Silence_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SILENCE);
- Silence_Timer = urand(20000, 25000);
- } else Silence_Timer -= diff;
-
- if (!PhaseTwo && !WasDead && !HealthAbovePct(5))
- {
- me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT);
- me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
- me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetStandState(UNIT_STAND_STATE_SLEEP);
- me->AttackStop();
-
- if (instance)
- instance->SetData(DATA_THEKAL, SPECIAL);
-
- WasDead=true;
- }
-
- //Thekal will transform to Tiger if he died and was not resurrected after 10 seconds.
- if (!PhaseTwo && WasDead)
- {
- if (Resurrect_Timer <= diff)
- {
- DoCast(me, SPELL_TIGER_FORM);
- me->SetObjectScale(2.00f);
- me->SetStandState(UNIT_STAND_STATE_STAND);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFullHealth();
- const CreatureTemplate* cinfo = me->GetCreatureTemplate();
- me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40)));
- me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40)));
- me->UpdateDamagePhysical(BASE_ATTACK);
- DoResetThreat();
- PhaseTwo = true;
- } else Resurrect_Timer -= diff;
- }
-
- if (me->IsFullHealth() && WasDead)
- {
- WasDead = false;
- }
-
- if (PhaseTwo)
- {
- if (Charge_Timer <= diff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- {
- DoCast(target, SPELL_CHARGE);
- DoResetThreat();
- AttackStart(target);
- }
-
- Charge_Timer = urand(15000, 22000);
- } else Charge_Timer -= diff;
-
- if (Frenzy_Timer <= diff)
- {
- DoCast(me, SPELL_FRENZY);
- Frenzy_Timer = 30000;
- } else Frenzy_Timer -= diff;
-
- if (ForcePunch_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SILENCE);
- ForcePunch_Timer = urand(16000, 21000);
- } else ForcePunch_Timer -= diff;
-
- if (SummonTigers_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SUMMONTIGERS);
- SummonTigers_Timer = urand(10000, 14000);
- } else SummonTigers_Timer -= diff;
-
- if (HealthBelowPct(11) && !Enraged)
- {
- DoCast(me, SPELL_ENRAGE);
- Enraged = true;
- }
- }
-
- DoMeleeAttackIfReady();
-
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new boss_thekalAI(creature);
- }
-};
-
-//Zealot Lor'Khan
-class mob_zealot_lorkhan : public CreatureScript
-{
- public:
-
- mob_zealot_lorkhan()
- : CreatureScript("mob_zealot_lorkhan")
- {
- }
-
- struct mob_zealot_lorkhanAI : public ScriptedAI
- {
- mob_zealot_lorkhanAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- }
-
- uint32 Shield_Timer;
- uint32 BloodLust_Timer;
- uint32 GreaterHeal_Timer;
- uint32 Disarm_Timer;
- uint32 Check_Timer;
-
- bool FakeDeath;
-
- InstanceScript* instance;
-
- void Reset()
- {
- Shield_Timer = 1000;
- BloodLust_Timer = 16000;
- GreaterHeal_Timer = 32000;
- Disarm_Timer = 6000;
- Check_Timer = 10000;
-
- FakeDeath = false;
-
- if (instance)
- instance->SetData(DATA_LORKHAN, NOT_STARTED);
-
- me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void EnterCombat(Unit* /*who*/)
- {
- }
-
- void UpdateAI (const uint32 diff)
- {
- if (!UpdateVictim())
- return;
-
- //Shield_Timer
- if (Shield_Timer <= diff)
- {
- DoCast(me, SPELL_SHIELD);
- Shield_Timer = 61000;
- } else Shield_Timer -= diff;
-
- //BloodLust_Timer
- if (BloodLust_Timer <= diff)
- {
- DoCast(me, SPELL_BLOODLUST);
- BloodLust_Timer = 20000+rand()%8000;
- } else BloodLust_Timer -= diff;
-
- //Casting Greaterheal to Thekal or Zath if they are in meele range.
- if (GreaterHeal_Timer <= diff)
- {
- if (instance)
- {
- Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL));
- Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH));
-
- if (!pThekal || !pZath)
- return;
-
- switch (urand(0, 1))
- {
- case 0:
- if (me->IsWithinMeleeRange(pThekal))
- DoCast(pThekal, SPELL_GREATERHEAL);
- break;
- case 1:
- if (me->IsWithinMeleeRange(pZath))
- DoCast(pZath, SPELL_GREATERHEAL);
- break;
- }
- }
-
- GreaterHeal_Timer = 15000+rand()%5000;
- } else GreaterHeal_Timer -= diff;
-
- //Disarm_Timer
- if (Disarm_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_DISARM);
- Disarm_Timer = 15000+rand()%10000;
- } else Disarm_Timer -= diff;
-
- //Check_Timer for the death of LorKhan and Zath.
- if (!FakeDeath && Check_Timer <= diff)
- {
- if (instance)
- {
- if (instance->GetData(DATA_THEKAL) == SPECIAL)
- {
- //Resurrect Thekal
- if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL)))
- {
- pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pThekal->setFaction(14);
- pThekal->SetFullHealth();
- }
- }
-
- if (instance->GetData(DATA_ZATH) == SPECIAL)
- {
- //Resurrect Zath
- if (Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH)))
- {
- pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pZath->setFaction(14);
- pZath->SetFullHealth();
- }
- }
- }
-
- Check_Timer = 5000;
- } else Check_Timer -= diff;
-
- if (!HealthAbovePct(5))
- {
- me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT);
- me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
- me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetStandState(UNIT_STAND_STATE_SLEEP);
- me->setFaction(35);
- me->AttackStop();
-
- if (instance)
- instance->SetData(DATA_LORKHAN, SPECIAL);
-
- FakeDeath = true;
- }
-
- DoMeleeAttackIfReady();
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_zealot_lorkhanAI(creature);
- }
-};
-
-//Zealot Zath
-class mob_zealot_zath : public CreatureScript
-{
- public:
-
- mob_zealot_zath()
- : CreatureScript("mob_zealot_zath")
- {
- }
-
- struct mob_zealot_zathAI : public ScriptedAI
- {
- mob_zealot_zathAI(Creature* creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- }
-
- uint32 SweepingStrikes_Timer;
- uint32 SinisterStrike_Timer;
- uint32 Gouge_Timer;
- uint32 Kick_Timer;
- uint32 Blind_Timer;
- uint32 Check_Timer;
-
- bool FakeDeath;
-
- InstanceScript* instance;
-
- void Reset()
- {
- SweepingStrikes_Timer = 13000;
- SinisterStrike_Timer = 8000;
- Gouge_Timer = 25000;
- Kick_Timer = 18000;
- Blind_Timer = 5000;
- Check_Timer = 10000;
-
- FakeDeath = false;
-
- if (instance)
- instance->SetData(DATA_ZATH, NOT_STARTED);
-
- me->SetStandState(UNIT_STAND_STATE_STAND);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void EnterCombat(Unit* /*who*/)
- {
- }
-
- void UpdateAI (const uint32 diff)
- {
- if (!UpdateVictim())
- return;
-
- //SweepingStrikes_Timer
- if (SweepingStrikes_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SWEEPINGSTRIKES);
- SweepingStrikes_Timer = 22000+rand()%4000;
- } else SweepingStrikes_Timer -= diff;
-
- //SinisterStrike_Timer
- if (SinisterStrike_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SINISTERSTRIKE);
- SinisterStrike_Timer = 8000+rand()%8000;
- } else SinisterStrike_Timer -= diff;
-
- //Gouge_Timer
- if (Gouge_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_GOUGE);
-
- if (DoGetThreat(me->getVictim()))
- DoModifyThreatPercent(me->getVictim(), -100);
-
- Gouge_Timer = 17000+rand()%10000;
- } else Gouge_Timer -= diff;
-
- //Kick_Timer
- if (Kick_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_KICK);
- Kick_Timer = 15000+rand()%10000;
- } else Kick_Timer -= diff;
-
- //Blind_Timer
- if (Blind_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_BLIND);
- Blind_Timer = 10000+rand()%10000;
- } else Blind_Timer -= diff;
-
- //Check_Timer for the death of LorKhan and Zath.
- if (!FakeDeath && Check_Timer <= diff)
- {
- if (instance)
- {
- if (instance->GetData(DATA_LORKHAN) == SPECIAL)
- {
- //Resurrect LorKhan
- if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN)))
- {
- pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pLorKhan->setFaction(14);
- pLorKhan->SetFullHealth();
- }
- }
-
- if (instance->GetData(DATA_THEKAL) == SPECIAL)
- {
- //Resurrect Thekal
- if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL)))
- {
- pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- pThekal->setFaction(14);
- pThekal->SetFullHealth();
- }
- }
- }
-
- Check_Timer = 5000;
- } else Check_Timer -= diff;
-
- if (!HealthAbovePct(5))
- {
- me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT);
- me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
- me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetStandState(UNIT_STAND_STATE_SLEEP);
- me->setFaction(35);
- me->AttackStop();
-
- if (instance)
- instance->SetData(DATA_ZATH, SPECIAL);
-
- FakeDeath = true;
- }
-
- DoMeleeAttackIfReady();
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_zealot_zathAI(creature);
- }
-};
-
-void AddSC_boss_thekal()
-{
- new boss_thekal();
- new mob_zealot_lorkhan();
- new mob_zealot_zath();
-}
-
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp
index 06448032dff..83815d17d2e 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp
@@ -22,75 +22,22 @@
#include "Spell.h"
#include "zulgurub.h"
-/*
- * TODO:
- * - Fix timers (research some more)
- */
-
-enum Texts
+enum Yells
{
- SAY_VENOXIS_TRANSFORM = 1, // Let the coils of hate unfurl!
- SAY_VENOXIS_DEATH = 2, // Ssserenity.. at lassst!
};
enum Spells
{
- // troll form
- SPELL_THRASH = 3391,
- SPELL_DISPEL_MAGIC = 23859,
- SPELL_RENEW = 23895,
- SPELL_HOLY_NOVA = 23858,
- SPELL_HOLY_FIRE = 23860,
- SPELL_HOLY_WRATH = 23979,
-
- // snake form
- SPELL_POISON_CLOUD = 23861,
- SPELL_VENOM_SPIT = 23862,
-
- SPELL_PARASITIC_SERPENT = 23865,
- SPELL_SUMMON_PARASITIC_SERPENT = 23866,
- SPELL_PARASITIC_SERPENT_TRIGGER = 23867,
-
- // used when swapping event-stages
- SPELL_VENOXIS_TRANSFORM = 23849, // 50% health - shapechange to cobra
- SPELL_FRENZY = 8269, // 20% health - frenzy
-};
-
-enum NPCs
-{
- NPC_PARASITIC_SERPENT = 14884,
};
enum Events
{
- // troll form
- EVENT_THRASH = 1,
- EVENT_DISPEL_MAGIC = 2,
- EVENT_RENEW = 3,
- EVENT_HOLY_NOVA = 4,
- EVENT_HOLY_FIRE = 5,
- EVENT_HOLY_WRATH = 6,
-
- // phase-changing
- EVENT_TRANSFORM = 7,
-
- // snake form events
- EVENT_POISON_CLOUD = 8,
- EVENT_VENOM_SPIT = 9,
- EVENT_PARASITIC_SERPENT = 10,
- EVENT_FRENZY = 11,
-};
-
-enum Phases
-{
- PHASE_ONE = 1, // troll form
- PHASE_TWO = 2, // snake form
};
class boss_venoxis : public CreatureScript
{
public:
- boss_venoxis() : CreatureScript("boss_venoxis") {}
+ boss_venoxis() : CreatureScript("boss_venoxis") { }
struct boss_venoxisAI : public BossAI
{
@@ -100,184 +47,42 @@ class boss_venoxis : public CreatureScript
void Reset()
{
- events.Reset();
- summons.DespawnAll();
-
- // make sure this boss is properly reset
- instance->SetBossState(DATA_VENOXIS, NOT_STARTED);
-
- // remove all spells and auras from previous attempts
- me->RemoveAllAuras();
- me->SetReactState(REACT_PASSIVE);
-
- // set some internally used variables to their defaults
- _inMeleeRange = 0;
- _transformed = false;
- _frenzied = false;
-
- events.SetPhase(PHASE_ONE);
}
void EnterCombat(Unit* /*who*/)
{
- me->SetReactState(REACT_AGGRESSIVE);
-
- instance->SetBossState(DATA_VENOXIS, IN_PROGRESS);
-
- // Always running events
- events.ScheduleEvent(EVENT_THRASH, 5000);
-
- // Phase one events (regular form)
- events.ScheduleEvent(EVENT_HOLY_NOVA, 5000, 0, PHASE_ONE);
- events.ScheduleEvent(EVENT_DISPEL_MAGIC, 35000, 0, PHASE_ONE);
- events.ScheduleEvent(EVENT_HOLY_FIRE, 10000, 0, PHASE_ONE);
- events.ScheduleEvent(EVENT_RENEW, 30000, 0, PHASE_ONE);
- events.ScheduleEvent(EVENT_HOLY_WRATH, 60000, 0, PHASE_ONE);
-
- events.SetPhase(PHASE_ONE);
-
- // Set zone in combat
- DoZoneInCombat();
}
void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/)
{
- // check if venoxis is ready to transform
- if (!_transformed && !HealthAbovePct(50))
- {
- _transformed = true;
- // schedule the event that changes our phase
- events.ScheduleEvent(EVENT_TRANSFORM, 100);
- }
- // we're losing health, bad, go frenzy
- else if (!_frenzied && !HealthAbovePct(20))
- {
- _frenzied = true;
- events.ScheduleEvent(EVENT_FRENZY, 100);
- }
}
void JustDied(Unit* /*killer*/)
{
- Talk(SAY_VENOXIS_DEATH);
- // venoxis is dead, mark him as such for the instance
- instance->SetBossState(DATA_VENOXIS, DONE);
- me->RemoveAllAuras();
}
- void UpdateAI(const uint32 diff)
+ void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
- // return back to main code if we're still casting
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
-
+ /*
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
- // thrash is available in all phases
- case EVENT_THRASH:
- DoCast(me, SPELL_THRASH, true);
- events.ScheduleEvent(EVENT_THRASH, urand(10000, 20000));
- break;
-
- // troll form spells and Actions (first part)
- case EVENT_DISPEL_MAGIC:
- DoCast(me, SPELL_DISPEL_MAGIC);
- events.ScheduleEvent(EVENT_DISPEL_MAGIC, urand(15000, 20000), 0, PHASE_ONE);
- break;
- case EVENT_RENEW:
- DoCast(me, SPELL_RENEW);
- events.ScheduleEvent(EVENT_RENEW, urand(25000, 30000), 0, PHASE_ONE);
- break;
- case EVENT_HOLY_NOVA:
- _inMeleeRange = 0;
-
- for (uint8 i = 0; i < 10; ++i)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, i))
- // check if target is within melee-distance
- if (me->IsWithinMeleeRange(target))
- ++_inMeleeRange;
- }
-
- // trigger spellcast only if we have 3 or more targets to affect
- if (_inMeleeRange >= 3)
- DoCast(me->getVictim(), SPELL_HOLY_NOVA);
-
- events.ScheduleEvent(EVENT_HOLY_NOVA, urand(45000, 75000), 0, PHASE_ONE);
- break;
- case EVENT_HOLY_FIRE:
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
- DoCast(target, SPELL_HOLY_FIRE);
- events.ScheduleEvent(EVENT_HOLY_FIRE, urand(45000, 60000), 0, PHASE_ONE);
- break;
- case EVENT_HOLY_WRATH:
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
- DoCast(target, SPELL_HOLY_WRATH);
- events.ScheduleEvent(EVENT_HOLY_WRATH, urand(45000, 60000), 0, PHASE_ONE);
- break;
-
- //
- // snake form spells and Actions
- //
-
- case EVENT_VENOM_SPIT:
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
- DoCast(target, SPELL_VENOM_SPIT);
- events.ScheduleEvent(EVENT_VENOM_SPIT, urand(5000, 15000), 0, PHASE_TWO);
- break;
- case EVENT_POISON_CLOUD:
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
- DoCast(target, SPELL_POISON_CLOUD);
- events.ScheduleEvent(EVENT_POISON_CLOUD, urand(15000, 20000), 0, PHASE_TWO);
- break;
- case EVENT_PARASITIC_SERPENT:
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
- DoCast(target, SPELL_SUMMON_PARASITIC_SERPENT);
- events.ScheduleEvent(EVENT_PARASITIC_SERPENT, 15000, 0, PHASE_TWO);
- break;
- case EVENT_FRENZY:
- // frenzy at 20% health
- DoCast(me, SPELL_FRENZY, true);
- break;
-
- //
- // shape and phase-changing
- //
-
- case EVENT_TRANSFORM:
- // shapeshift at 50% health
- DoCast(me, SPELL_VENOXIS_TRANSFORM);
- Talk(SAY_VENOXIS_TRANSFORM);
- DoResetThreat();
-
- // phase two events (snakeform)
- events.ScheduleEvent(EVENT_VENOM_SPIT, 5000, 0, PHASE_TWO);
- events.ScheduleEvent(EVENT_POISON_CLOUD, 10000, 0, PHASE_TWO);
- events.ScheduleEvent(EVENT_PARASITIC_SERPENT, 30000, 0, PHASE_TWO);
-
- // transformed, start phase two
- events.SetPhase(PHASE_TWO);
-
- break;
default:
break;
}
}
+ */
DoMeleeAttackIfReady();
}
-
- private:
- uint8 _inMeleeRange;
- bool _transformed;
- bool _frenzied;
};
CreatureAI* GetAI(Creature* creature) const
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp
index 6cdb00236df..be6dd137b67 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -16,67 +15,65 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Boss_Wushoolay
-SD%Complete: 100
-SDComment:
-SDCategory: Zul'Gurub
-EndScriptData */
-
+#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "zulgurub.h"
-#define SPELL_LIGHTNINGCLOUD 25033
-#define SPELL_LIGHTNINGWAVE 24819
+enum Yells
+{
+};
+
+enum Spells
+{
+};
+
+enum Events
+{
+};
class boss_wushoolay : public CreatureScript
{
public:
+ boss_wushoolay() : CreatureScript("boss_wushoolay") { }
- boss_wushoolay()
- : CreatureScript("boss_wushoolay")
- {
- }
-
- struct boss_wushoolayAI : public ScriptedAI
+ struct boss_wushoolayAI : public BossAI
{
- boss_wushoolayAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 LightningCloud_Timer;
- uint32 LightningWave_Timer;
+ boss_wushoolayAI(Creature* creature) : BossAI(creature, DATA_HAZZARAH)
+ {
+ }
void Reset()
{
- LightningCloud_Timer = urand(5000, 10000);
- LightningWave_Timer = urand(8000, 16000);
}
void EnterCombat(Unit* /*who*/)
{
}
- void UpdateAI(const uint32 diff)
+ void JustDied(Unit* /*killer*/)
+ {
+ }
+
+ void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
- //LightningCloud_Timer
- if (LightningCloud_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_LIGHTNINGCLOUD);
- LightningCloud_Timer = urand(15000, 20000);
- } else LightningCloud_Timer -= diff;
+ events.Update(diff);
- //LightningWave_Timer
- if (LightningWave_Timer <= diff)
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+ /*
+ while (uint32 eventId = events.ExecuteEvent())
{
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (target) DoCast(target, SPELL_LIGHTNINGWAVE);
-
- LightningWave_Timer = urand(12000, 16000);
- } else LightningWave_Timer -= diff;
+ switch (eventId)
+ {
+ default:
+ break;
+ }
+ }
+ */
DoMeleeAttackIfReady();
}
@@ -92,4 +89,3 @@ void AddSC_boss_wushoolay()
{
new boss_wushoolay();
}
-
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp
new file mode 100644
index 00000000000..2d5fae00550
--- /dev/null
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp
@@ -0,0 +1,91 @@
+/*
+ * 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/>.
+ */
+
+#include "ObjectMgr.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "zulgurub.h"
+
+enum Yells
+{
+};
+
+enum Spells
+{
+};
+
+enum Events
+{
+};
+
+class boss_zanzil : public CreatureScript
+{
+ public:
+ boss_zanzil() : CreatureScript("boss_zanzil") { }
+
+ struct boss_zanzilAI : public BossAI
+ {
+ boss_zanzilAI(Creature* creature) : BossAI(creature, DATA_ZANZIL)
+ {
+ }
+
+ void Reset()
+ {
+ }
+
+ void EnterCombat(Unit* /*who*/)
+ {
+ }
+
+ void JustDied(Unit* /*killer*/)
+ {
+ }
+
+ void UpdateAI(uint32 const diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+ /*
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ default:
+ break;
+ }
+ }
+ */
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new boss_zanzilAI(creature);
+ }
+};
+
+void AddSC_boss_zanzil()
+{
+ new boss_zanzil();
+}
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
index 104d479383b..d6a0b4e3761 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
@@ -16,13 +16,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Instance_ZulGurub
-SD%Complete: 80
-SDComment: Missing reset function after killing a boss for Ohgan, Thekal.
-SDCategory: Zul'Gurub
-EndScriptData */
-
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "zulgurub.h"
@@ -30,128 +23,186 @@ EndScriptData */
class instance_zulgurub : public InstanceMapScript
{
public:
- instance_zulgurub()
- : InstanceMapScript("instance_zulgurub", 309)
- {
- }
+ instance_zulgurub() : InstanceMapScript(ZGScriptName, 859) { }
struct instance_zulgurub_InstanceMapScript : public InstanceScript
{
- instance_zulgurub_InstanceMapScript(Map* map) : InstanceScript(map) {}
-
- //If all High Priest bosses were killed. Lorkhan, Zath and Ohgan are added too.
- uint32 m_auiEncounter[MAX_ENCOUNTERS];
-
- //Storing Lorkhan, Zath and Thekal because we need to cast on them later. Jindo is needed for healfunction too.
- uint64 m_uiLorKhanGUID;
- uint64 m_uiZathGUID;
- uint64 m_uiThekalGUID;
- uint64 m_uiJindoGUID;
-
- void Initialize()
+ instance_zulgurub_InstanceMapScript(Map* map) : InstanceScript(map)
{
- memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
+ SetBossNumber(EncounterCount);
+ venoxisGUID = 0;
+ mandokirGUID = 0;
+ kilnaraGUID = 0;
+ zanzilGUID = 0;
+ jindoGUID = 0;
+ hazzarahGUID = 0;
+ renatakiGUID = 0;
+ wushoolayGUID = 0;
+ grilekGUID = 0;
+ }
- m_uiLorKhanGUID = 0;
- m_uiZathGUID = 0;
- m_uiThekalGUID = 0;
- m_uiJindoGUID = 0;
+ void OnCreatureCreate(Creature* creature)
+ {
+ switch (creature->GetEntry())
+ {
+ case NPC_VENOXIS:
+ venoxisGUID = creature->GetGUID();
+ break;
+ case NPC_MANDOKIR:
+ mandokirGUID = creature->GetGUID();
+ break;
+ case NPC_KILNARA:
+ kilnaraGUID = creature->GetGUID();
+ break;
+ case NPC_ZANZIL:
+ zanzilGUID = creature->GetGUID();
+ break;
+ case NPC_JINDO:
+ jindoGUID = creature->GetGUID();
+ break;
+ case NPC_HAZZARAH:
+ hazzarahGUID = creature->GetGUID();
+ break;
+ case NPC_RENATAKI:
+ renatakiGUID = creature->GetGUID();
+ break;
+ case NPC_WUSHOOLAY:
+ wushoolayGUID = creature->GetGUID();
+ break;
+ case NPC_GRILEK:
+ grilekGUID = creature->GetGUID();
+ break;
+ default:
+ break;
+ }
}
- bool IsEncounterInProgress() const
+ bool SetBossState(uint32 type, EncounterState state)
{
- //not active in Zul'Gurub
- return false;
+ if (!InstanceScript::SetBossState(type, state))
+ return false;
+
+ switch (type)
+ {
+ case DATA_VENOXIS:
+ case DATA_MANDOKIR:
+ case DATA_KILNARA:
+ case DATA_ZANZIL:
+ case DATA_JINDO:
+ case DATA_HAZZARAH:
+ case DATA_RENATAKI:
+ case DATA_WUSHOOLAY:
+ case DATA_GRILEK:
+ break;
+ default:
+ break;
+ }
+
+ return true;
}
- void OnCreatureCreate(Creature* creature)
+ /*
+ void SetData(uint32 type, uint32 data)
{
- switch (creature->GetEntry())
+ switch (type)
{
- case 11347: m_uiLorKhanGUID = creature->GetGUID(); break;
- case 11348: m_uiZathGUID = creature->GetGUID(); break;
- case 14509: m_uiThekalGUID = creature->GetGUID(); break;
- case 11380: m_uiJindoGUID = creature->GetGUID(); break;
}
}
- void SetData(uint32 uiType, uint32 uiData)
+ uint32 GetData(uint32 type)
{
- switch (uiType)
+ switch (type)
{
- case DATA_ARLOKK:
- m_auiEncounter[0] = uiData;
- break;
+ }
- case DATA_JEKLIK:
- m_auiEncounter[1] = uiData;
- break;
+ return 0;
+ }
+ */
+ uint64 GetData64(uint32 type)
+ {
+ switch (type)
+ {
case DATA_VENOXIS:
- m_auiEncounter[2] = uiData;
+ return venoxisGUID;
+ case DATA_MANDOKIR:
+ return mandokirGUID;
+ case DATA_KILNARA:
+ return kilnaraGUID;
+ case DATA_ZANZIL:
+ return zanzilGUID;
+ case DATA_JINDO:
+ return jindoGUID;
+ case DATA_HAZZARAH:
+ return hazzarahGUID;
+ case DATA_RENATAKI:
+ return renatakiGUID;
+ case DATA_WUSHOOLAY:
+ return wushoolayGUID;
+ case DATA_GRILEK:
+ return grilekGUID;
+ default:
break;
- case DATA_MARLI:
- m_auiEncounter[3] = uiData;
- break;
+ }
- case DATA_THEKAL:
- m_auiEncounter[4] = uiData;
- break;
+ return 0;
+ }
- case DATA_LORKHAN:
- m_auiEncounter[5] = uiData;
- break;
+ std::string GetSaveData()
+ {
+ OUT_SAVE_INST_DATA;
- case DATA_ZATH:
- m_auiEncounter[6] = uiData;
- break;
+ std::ostringstream saveStream;
+ saveStream << "Z G " << GetBossSaveData();
- case DATA_OHGAN:
- m_auiEncounter[7] = uiData;
- break;
- }
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return saveStream.str();
}
- uint32 GetData(uint32 uiType)
+ void Load(char const* str)
{
- switch (uiType)
+ if (!str)
{
- case DATA_ARLOKK:
- return m_auiEncounter[0];
- case DATA_JEKLIK:
- return m_auiEncounter[1];
- case DATA_VENOXIS:
- return m_auiEncounter[2];
- case DATA_MARLI:
- return m_auiEncounter[3];
- case DATA_THEKAL:
- return m_auiEncounter[4];
- case DATA_LORKHAN:
- return m_auiEncounter[5];
- case DATA_ZATH:
- return m_auiEncounter[6];
- case DATA_OHGAN:
- return m_auiEncounter[7];
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
}
- return 0;
- }
- uint64 GetData64(uint32 uiData)
- {
- switch (uiData)
+ OUT_LOAD_INST_DATA(str);
+
+ char dataHead1, dataHead2;
+
+ std::istringstream loadStream(str);
+ loadStream >> dataHead1 >> dataHead2;
+
+ if (dataHead1 == 'Z' && dataHead2 == 'G')
{
- case DATA_LORKHAN:
- return m_uiLorKhanGUID;
- case DATA_ZATH:
- return m_uiZathGUID;
- case DATA_THEKAL:
- return m_uiThekalGUID;
- case DATA_JINDO:
- return m_uiJindoGUID;
+ for (uint8 i = 0; i < EncounterCount; ++i)
+ {
+ uint32 tmpState;
+ loadStream >> tmpState;
+ if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
+ tmpState = NOT_STARTED;
+
+ SetBossState(i, EncounterState(tmpState));
+ }
}
- return 0;
+ else
+ OUT_LOAD_INST_DATA_FAIL;
+
+ OUT_LOAD_INST_DATA_COMPLETE;
}
+
+ protected:
+ uint64 venoxisGUID;
+ uint64 mandokirGUID;
+ uint64 kilnaraGUID;
+ uint64 zanzilGUID;
+ uint64 jindoGUID;
+ uint64 hazzarahGUID;
+ uint64 renatakiGUID;
+ uint64 wushoolayGUID;
+ uint64 grilekGUID;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
index d127680cec5..0deeb1c974d 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
@@ -19,20 +19,49 @@
#ifndef DEF_ZULGURUB_H
#define DEF_ZULGURUB_H
+#define ZGScriptName "instance_zulgurub"
+
+uint32 const EncounterCount = 5;
+
enum DataTypes
{
- MAX_ENCOUNTERS = 8,
-
- DATA_ARLOKK = 1,
- DATA_JEKLIK = 2,
- DATA_VENOXIS = 3,
- DATA_MARLI = 4,
- DATA_OHGAN = 5,
- DATA_THEKAL = 6,
- DATA_ZATH = 7,
- DATA_LORKHAN = 8,
- DATA_JINDO = 10,
+ DATA_VENOXIS = 0,
+ DATA_MANDOKIR = 1,
+ DATA_KILNARA = 2,
+ DATA_ZANZIL = 3,
+ DATA_JINDO = 4,
+
+ // Cache of Madness
+ DATA_HAZZARAH = 5,
+ DATA_RENATAKI = 6,
+ DATA_WUSHOOLAY = 7,
+ DATA_GRILEK = 8,
};
+enum CreatureIds
+{
+ NPC_VENOXIS = 52155,
+ NPC_MANDOKIR = 52151,
+ NPC_KILNARA = 52059,
+ NPC_ZANZIL = 52053,
+ NPC_JINDO = 52148,
+
+ // Cache of Madness
+ NPC_HAZZARAH = 52271,
+ NPC_RENATAKI = 52269,
+ NPC_WUSHOOLAY = 52286,
+ NPC_GRILEK = 52258,
+};
+
+template<class AI>
+CreatureAI* GetZulGurubCitadelAI(Creature* creature)
+{
+ if (InstanceMap* instance = creature->GetMap()->ToInstanceMap())
+ if (instance->GetInstanceScript())
+ if (instance->GetScriptId() == sObjectMgr->GetScriptId(ZGScriptName))
+ return new AI(creature);
+ return NULL;
+}
+
#endif
diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp
index b0d59fe8b5a..1847de91d14 100644
--- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp
+++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp
@@ -48,7 +48,11 @@ enum eEnums
EMOTE_PROGRESS_8 = 8,
SAY_PROGRESS_9 = 9,
- QUEST_SUNKEN_TREASURE = 665,
+ EVENT_SAY_3 = 1,
+ EVENT_SAY_6 = 2,
+ EVENT_SAY_8 = 3,
+
+ QUEST_GOGGLE_BOGGLE = 26050,
MOB_VENGEFUL_SURGE = 2776
};
@@ -73,33 +77,22 @@ class npc_professor_phizzlethorpe : public CreatureScript
switch (waypointId)
{
- case 4:
+ case 6:
Talk(SAY_PROGRESS_2, player->GetGUID());
- break;
- case 5:
- Talk(SAY_PROGRESS_3, player->GetGUID());
+ events.ScheduleEvent(EVENT_SAY_3, 3000);
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:
- Talk(SAY_PROGRESS_5, player->GetGUID());
+ me->SummonCreature(MOB_VENGEFUL_SURGE, -2065.505f, -2136.88f, 22.20362f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ me->SummonCreature(MOB_VENGEFUL_SURGE, -2059.249f, -2134.88f, 21.51582f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
break;
case 11:
- Talk(SAY_PROGRESS_6, player->GetGUID());
- SetRun();
+ Talk(SAY_PROGRESS_5, player->GetGUID());
+ events.ScheduleEvent(EVENT_SAY_6, 11000);
break;
- case 19:
+ case 17:
Talk(SAY_PROGRESS_7, player->GetGUID());
- break;
- case 20:
- Talk(EMOTE_PROGRESS_8);
- Talk(SAY_PROGRESS_9, player->GetGUID());
- player->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
+ events.ScheduleEvent(EVENT_SAY_8, 6000);
break;
}
}
@@ -116,8 +109,34 @@ class npc_professor_phizzlethorpe : public CreatureScript
void UpdateAI(const uint32 diff)
{
+ Player* player = GetPlayerForEscort();
+ if (!player)
+ return;
+
+ events.Update(diff);
+
+ while (uint32 event = events.ExecuteEvent())
+ {
+ switch (event)
+ {
+ case EVENT_SAY_3:
+ Talk(SAY_PROGRESS_3, player->GetGUID());
+ break;
+ case EVENT_SAY_6:
+ Talk(SAY_PROGRESS_6, player->GetGUID());
+ SetRun();
+ break;
+ case EVENT_SAY_8:
+ Talk(EMOTE_PROGRESS_8);
+ Talk(SAY_PROGRESS_9, player->GetGUID());
+ player->GroupEventHappens(QUEST_GOGGLE_BOGGLE, me);
+ break;
+ }
+ }
npc_escortAI::UpdateAI(diff);
}
+
+ EventMap events;
};
CreatureAI* GetAI(Creature* creature) const
@@ -127,13 +146,13 @@ class npc_professor_phizzlethorpe : public CreatureScript
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
{
- if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
+ if (quest->GetQuestId() == QUEST_GOGGLE_BOGGLE)
{
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);
- creature->setFaction(113);
+ creature->setFaction(42);
}
return true;
}
diff --git a/src/server/scripts/EasternKingdoms/boss_kruul.cpp b/src/server/scripts/EasternKingdoms/boss_kruul.cpp
deleted file mode 100644
index 6a1ba633660..00000000000
--- a/src/server/scripts/EasternKingdoms/boss_kruul.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* ScriptData
-SDName: Boss_Kruul
-SD%Complete: 100
-SDComment: Highlord Kruul are presumably no longer in-game on regular bases, however future events could bring him back.
-SDCategory: Bosses
-EndScriptData */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-
-#define SPELL_SHADOWVOLLEY 21341
-#define SPELL_CLEAVE 20677
-#define SPELL_THUNDERCLAP 23931
-#define SPELL_TWISTEDREFLECTION 21063
-#define SPELL_VOIDBOLT 21066
-#define SPELL_RAGE 21340
-#define SPELL_CAPTURESOUL 21054
-
-class boss_kruul : public CreatureScript
-{
-public:
- boss_kruul() : CreatureScript("boss_kruul") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new boss_kruulAI (creature);
- }
-
- struct boss_kruulAI : public ScriptedAI
- {
- boss_kruulAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 ShadowVolley_Timer;
- uint32 Cleave_Timer;
- uint32 ThunderClap_Timer;
- uint32 TwistedReflection_Timer;
- uint32 VoidBolt_Timer;
- uint32 Rage_Timer;
- uint32 Hound_Timer;
-
- void Reset()
- {
- ShadowVolley_Timer = 10000;
- Cleave_Timer = 14000;
- ThunderClap_Timer = 20000;
- TwistedReflection_Timer = 25000;
- VoidBolt_Timer = 30000;
- Rage_Timer = 60000; //Cast rage after 1 minute
- Hound_Timer = 8000;
- }
-
- void EnterCombat(Unit* /*who*/)
- {
- }
-
- void KilledUnit(Unit* /*victim*/)
- {
- // When a player, pet or totem gets killed, Lord Kazzak casts this spell to instantly regenerate 70, 000 health.
- DoCast(me, SPELL_CAPTURESOUL);
- }
-
- void SummonHounds(Unit* victim)
- {
- if (Creature* Hound = DoSpawnCreature(19207, float(irand(-9, 9)), float(irand(-9, 9)), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000))
- Hound->AI()->AttackStart(victim);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- //ShadowVolley_Timer
- if (ShadowVolley_Timer <= diff)
- {
- if (urand(0, 99) < 45)
- DoCast(me->getVictim(), SPELL_SHADOWVOLLEY);
-
- ShadowVolley_Timer = 5000;
- } else ShadowVolley_Timer -= diff;
-
- //Cleave_Timer
- if (Cleave_Timer <= diff)
- {
- if (urand(0, 1))
- DoCast(me->getVictim(), SPELL_CLEAVE);
-
- Cleave_Timer = 10000;
- } else Cleave_Timer -= diff;
-
- //ThunderClap_Timer
- if (ThunderClap_Timer <= diff)
- {
- if (urand(0, 9) < 2)
- DoCast(me->getVictim(), SPELL_THUNDERCLAP);
-
- ThunderClap_Timer = 12000;
- } else ThunderClap_Timer -= diff;
-
- //TwistedReflection_Timer
- if (TwistedReflection_Timer <= diff)
- {
- DoCast(me->getVictim(), SPELL_TWISTEDREFLECTION);
- TwistedReflection_Timer = 30000;
- } else TwistedReflection_Timer -= diff;
-
- //VoidBolt_Timer
- if (VoidBolt_Timer <= diff)
- {
- if (urand(0, 9) < 4)
- DoCast(me->getVictim(), SPELL_VOIDBOLT);
-
- VoidBolt_Timer = 18000;
- } else VoidBolt_Timer -= diff;
-
- //Rage_Timer
- if (Rage_Timer <= diff)
- {
- DoCast(me, SPELL_RAGE);
- Rage_Timer = 70000;
- } else Rage_Timer -= diff;
-
- //Hound_Timer
- if (Hound_Timer <= diff)
- {
- SummonHounds(me->getVictim());
- SummonHounds(me->getVictim());
- SummonHounds(me->getVictim());
-
- Hound_Timer = 45000;
- } else Hound_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- };
-};
-
-void AddSC_boss_kruul()
-{
- new boss_kruul();
-}
diff --git a/src/server/scripts/EasternKingdoms/burning_steppes.cpp b/src/server/scripts/EasternKingdoms/burning_steppes.cpp
index eec747d6d73..2ef43ee67ed 100644
--- a/src/server/scripts/EasternKingdoms/burning_steppes.cpp
+++ b/src/server/scripts/EasternKingdoms/burning_steppes.cpp
@@ -18,140 +18,18 @@
/* ScriptData
SDName: Burning_Steppes
-SD%Complete: 100
-SDComment: Quest support: 4224, 4866
+SD%Complete: 0
+SDComment:
SDCategory: Burning Steppes
EndScriptData */
-/* ContentData
-npc_ragged_john
-EndContentData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
-/*######
-## npc_ragged_john
-######*/
-
-#define GOSSIP_HELLO "Official buisness, John. I need some information about Marsha Windsor. Tell me about the last time you saw him."
-#define GOSSIP_SELECT1 "So what did you do?"
-#define GOSSIP_SELECT2 "Start making sense, dwarf. I don't want to have anything to do with your cracker, your pappy, or any sort of 'discreditin'."
-#define GOSSIP_SELECT3 "Ironfoe?"
-#define GOSSIP_SELECT4 "Interesting... continue John."
-#define GOSSIP_SELECT5 "So that's how Windsor died..."
-#define GOSSIP_SELECT6 "So how did he die?"
-#define GOSSIP_SELECT7 "Ok so where the hell is he? Wait a minute! Are you drunk?"
-#define GOSSIP_SELECT8 "WHY is he in Blackrock Depths?"
-#define GOSSIP_SELECT9 "300? So the Dark Irons killed him and dragged him into the Depths?"
-#define GOSSIP_SELECT10 "Ahh... Ironfoe"
-#define GOSSIP_SELECT11 "Thanks, Ragged John. Your story was very uplifting and informative"
-
-class npc_ragged_john : public CreatureScript
-{
-public:
- npc_ragged_john() : CreatureScript("npc_ragged_john") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(2714, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(2715, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(2716, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(2717, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(2718, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(2719, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(2720, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
- player->SEND_GOSSIP_MENU(2721, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+8:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
- player->SEND_GOSSIP_MENU(2722, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+9:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
- player->SEND_GOSSIP_MENU(2723, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+10:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
- player->SEND_GOSSIP_MENU(2725, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+11:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(4224);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(4224) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(2713, creature->GetGUID());
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_ragged_johnAI (creature);
- }
-
- struct npc_ragged_johnAI : public ScriptedAI
- {
- npc_ragged_johnAI(Creature* creature) : ScriptedAI(creature) {}
-
- void Reset() {}
-
- void MoveInLineOfSight(Unit* who)
- {
- if (who->HasAura(16468))
- {
- if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(me))
- {
- DoCast(who, 16472);
- CAST_PLR(who)->AreaExploredOrEventHappens(4866);
- }
- }
-
- ScriptedAI::MoveInLineOfSight(who);
- }
-
- void EnterCombat(Unit* /*who*/) {}
- };
-};
void AddSC_burning_steppes()
{
- new npc_ragged_john();
+
}
diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp
index 9793c6fd31c..93141f2d82c 100644
--- a/src/server/scripts/EasternKingdoms/ghostlands.cpp
+++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp
@@ -19,13 +19,11 @@
/* ScriptData
SDName: Ghostlands
SD%Complete: 100
-SDComment: Quest support: 9692, 9212. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber
+SDComment:
SDCategory: Ghostlands
EndScriptData */
/* ContentData
-npc_blood_knight_dawnstar
-npc_budd_nedreck
npc_rathis_tomber
npc_ranger_lilatha
EndContentData */
@@ -36,41 +34,6 @@ EndContentData */
#include "ScriptedEscortAI.h"
/*######
-## npc_budd_nedreck
-######*/
-
-#define GOSSIP_HBN "You gave the crew disguises?"
-
-class npc_budd_nedreck : public CreatureScript
-{
-public:
- npc_budd_nedreck() : CreatureScript("npc_budd_nedreck") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF)
- {
- player->CLOSE_GOSSIP_MENU();
- creature->CastSpell(player, 42540, false);
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(11166) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
-};
-
-/*######
## npc_rathis_tomber
######*/
@@ -218,7 +181,6 @@ public:
void AddSC_ghostlands()
{
- new npc_budd_nedreck();
new npc_rathis_tomber();
new npc_ranger_lilatha();
}
diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp
index a6d01f0ca93..096c0f2e2a6 100644
--- a/src/server/scripts/EasternKingdoms/hinterlands.cpp
+++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp
@@ -19,13 +19,12 @@
/* ScriptData
SDName: Hinterlands
SD%Complete: 100
-SDComment: Quest support: 863, 2742
+SDComment: Quest support: 836
SDCategory: The Hinterlands
EndScriptData */
/* ContentData
npc_00x09hl
-npc_rinji
EndContentData */
#include "ScriptMgr.h"
@@ -149,205 +148,7 @@ public:
};
};
-/*######
-## npc_rinji
-######*/
-
-enum eRinji
-{
- SAY_RIN_FREE = -1000403, //from here
- SAY_RIN_BY_OUTRUNNER = -1000404,
- SAY_RIN_HELP_1 = -1000405,
- SAY_RIN_HELP_2 = -1000406, //to here, are used also by 6182 but this is wrong...
- SAY_RIN_COMPLETE = -1000407,
- SAY_RIN_PROGRESS_1 = -1000408,
- SAY_RIN_PROGRESS_2 = -1000409,
-
- QUEST_RINJI_TRAPPED = 2742,
- NPC_RANGER = 2694,
- NPC_OUTRUNNER = 2691,
- GO_RINJI_CAGE = 142036
-};
-
-struct Location
-{
- float m_fX, m_fY, m_fZ;
-};
-
-Location m_afAmbushSpawn[] =
-{
- {191.296204f, -2839.329346f, 107.388f},
- {70.972466f, -2848.674805f, 109.459f}
-};
-
-Location m_afAmbushMoveTo[] =
-{
- {166.630386f, -2824.780273f, 108.153f},
- {70.886589f, -2874.335449f, 116.675f}
-};
-
-class npc_rinji : public CreatureScript
-{
-public:
- npc_rinji() : CreatureScript("npc_rinji") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
- {
- if (quest->GetQuestId() == QUEST_RINJI_TRAPPED)
- {
- if (GameObject* go = creature->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE))
- go->UseDoorOrButton();
-
- if (npc_rinjiAI* pEscortAI = CAST_AI(npc_rinji::npc_rinjiAI, creature->AI()))
- pEscortAI->Start(false, false, player->GetGUID(), quest);
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_rinjiAI(creature);
- }
-
- struct npc_rinjiAI : public npc_escortAI
- {
- npc_rinjiAI(Creature* creature) : npc_escortAI(creature)
- {
- m_bIsByOutrunner = false;
- m_iSpawnId = 0;
- }
-
- bool m_bIsByOutrunner;
- uint32 m_uiPostEventCount;
- uint32 m_uiPostEventTimer;
- int m_iSpawnId;
-
- void Reset()
- {
- m_uiPostEventCount = 0;
- m_uiPostEventTimer = 3000;
- }
-
- void JustRespawned()
- {
- m_bIsByOutrunner = false;
- m_iSpawnId = 0;
-
- npc_escortAI::JustRespawned();
- }
-
- void EnterCombat(Unit* who)
- {
- if (HasEscortState(STATE_ESCORT_ESCORTING))
- {
- if (who->GetEntry() == NPC_OUTRUNNER && !m_bIsByOutrunner)
- {
- DoScriptText(SAY_RIN_BY_OUTRUNNER, who);
- m_bIsByOutrunner = true;
- }
-
- if (rand()%4)
- return;
-
- //only if attacked and escorter is not in combat?
- DoScriptText(RAND(SAY_RIN_HELP_1, SAY_RIN_HELP_2), me);
- }
- }
-
- void DoSpawnAmbush(bool bFirst)
- {
- if (!bFirst)
- m_iSpawnId = 1;
-
- me->SummonCreature(NPC_RANGER,
- m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f,
- TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
-
- for (int i = 0; i < 2; ++i)
- {
- me->SummonCreature(NPC_OUTRUNNER,
- m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f,
- TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
- }
- }
-
- void JustSummoned(Creature* summoned)
- {
- summoned->SetWalk(false);
- summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ);
- }
-
- void WaypointReached(uint32 waypointId)
- {
- Player* player = GetPlayerForEscort();
- if (!player)
- return;
-
- switch (waypointId)
- {
- case 1:
- DoScriptText(SAY_RIN_FREE, me, player);
- break;
- case 7:
- DoSpawnAmbush(true);
- break;
- case 13:
- DoSpawnAmbush(false);
- break;
- case 17:
- DoScriptText(SAY_RIN_COMPLETE, me, player);
- player->GroupEventHappens(QUEST_RINJI_TRAPPED, me);
- SetRun();
- m_uiPostEventCount = 1;
- break;
- }
- }
-
- void UpdateEscortAI(const uint32 uiDiff)
- {
- //Check if we have a current target
- if (!UpdateVictim())
- {
- if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPostEventCount)
- {
- if (m_uiPostEventTimer <= uiDiff)
- {
- m_uiPostEventTimer = 3000;
-
- if (Player* player = GetPlayerForEscort())
- {
- switch (m_uiPostEventCount)
- {
- case 1:
- DoScriptText(SAY_RIN_PROGRESS_1, me, player);
- ++m_uiPostEventCount;
- break;
- case 2:
- DoScriptText(SAY_RIN_PROGRESS_2, me, player);
- m_uiPostEventCount = 0;
- break;
- }
- }
- else
- {
- me->DespawnOrUnsummon();
- return;
- }
- }
- else
- m_uiPostEventTimer -= uiDiff;
- }
-
- return;
- }
-
- DoMeleeAttackIfReady();
- }
- };
-};
-
void AddSC_hinterlands()
{
new npc_00x09hl();
- new npc_rinji();
}
diff --git a/src/server/scripts/EasternKingdoms/ironforge.cpp b/src/server/scripts/EasternKingdoms/ironforge.cpp
index 2915ee1f3cb..9cb9ef63693 100644
--- a/src/server/scripts/EasternKingdoms/ironforge.cpp
+++ b/src/server/scripts/EasternKingdoms/ironforge.cpp
@@ -18,81 +18,18 @@
/* ScriptData
SDName: Ironforge
-SD%Complete: 100
-SDComment: Quest support: 3702
+SD%Complete: 0
+SDComment:
SDCategory: Ironforge
EndScriptData */
/* ContentData
-npc_royal_historian_archesonus
EndContentData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
-/*######
-## npc_royal_historian_archesonus
-######*/
-
-#define GOSSIP_ITEM_ROYAL "I am ready to listen"
-#define GOSSIP_ITEM_ROYAL_1 "That is tragic. How did this happen?"
-#define GOSSIP_ITEM_ROYAL_2 "Interesting, continue please."
-#define GOSSIP_ITEM_ROYAL_3 "Unbelievable! How dare they??"
-#define GOSSIP_ITEM_ROYAL_4 "Of course I will help!"
-
-class npc_royal_historian_archesonus : public CreatureScript
-{
-public:
- npc_royal_historian_archesonus() : CreatureScript("npc_royal_historian_archesonus") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(2236, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(2237, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(2238, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(2239, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(3702);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(3702) == QUEST_STATUS_INCOMPLETE)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(2235, creature->GetGUID());
- }
- else
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-};
-
void AddSC_ironforge()
{
- new npc_royal_historian_archesonus();
}
diff --git a/src/server/scripts/EasternKingdoms/loch_modan.cpp b/src/server/scripts/EasternKingdoms/loch_modan.cpp
index 4e3aaae71a1..c5571560b54 100644
--- a/src/server/scripts/EasternKingdoms/loch_modan.cpp
+++ b/src/server/scripts/EasternKingdoms/loch_modan.cpp
@@ -18,88 +18,18 @@
/* ScriptData
SDName: Loch_Modan
-SD%Complete: 100
-SDComment: Quest support: 3181
+SD%Complete: 0
+SDComment:
SDCategory: Loch Modan
EndScriptData */
/* ContentData
-npc_mountaineer_pebblebitty
EndContentData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
-/*######
-## npc_mountaineer_pebblebitty
-######*/
-
-#define GOSSIP_MP "Open the gate please, i need to get to Searing Gorge"
-
-#define GOSSIP_MP1 "But i need to get there, now open the gate!"
-#define GOSSIP_MP2 "Ok, so what is this other way?"
-#define GOSSIP_MP3 "Doesn't matter, i'm invulnerable."
-#define GOSSIP_MP4 "Yes..."
-#define GOSSIP_MP5 "Ok, i'll try to remember that."
-#define GOSSIP_MP6 "A key? Ok!"
-
-class npc_mountaineer_pebblebitty : public CreatureScript
-{
-public:
- npc_mountaineer_pebblebitty() : CreatureScript("npc_mountaineer_pebblebitty") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(1833, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(1834, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
- player->SEND_GOSSIP_MENU(1835, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
- player->SEND_GOSSIP_MENU(1836, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
- player->SEND_GOSSIP_MENU(1837, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
- player->SEND_GOSSIP_MENU(1838, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->CLOSE_GOSSIP_MENU();
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (!player->GetQuestRewardStatus(3181) == 1)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-};
-
void AddSC_loch_modan()
{
- new npc_mountaineer_pebblebitty();
}
diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp
index 2473fec899a..3d47a8e8ed6 100644
--- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp
+++ b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp
@@ -17,156 +17,14 @@
/* Script Data Start
SDName: Redridge Mountains
-SD%Complete: 100%
-SDComment: Support for quest 219.
+SD%Complete: 0
+SDComment:
Script Data End */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
-enum eCorporalKeeshan
-{
- QUEST_MISSING_IN_ACTION = 219,
-
- SAY_CORPORAL_1 = -1000464,
- SAY_CORPORAL_2 = -1000465,
- SAY_CORPORAL_3 = -1000466,
- SAY_CORPORAL_4 = -1000467,
- SAY_CORPORAL_5 = -1000468,
-
- SPELL_MOCKING_BLOW = 21008,
- SPELL_SHIELD_BASH = 11972,
-};
-
-class npc_corporal_keeshan : public CreatureScript
-{
-public:
- npc_corporal_keeshan() : CreatureScript("npc_corporal_keeshan") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
- {
- if (quest->GetQuestId() == QUEST_MISSING_IN_ACTION)
- {
- CAST_AI(npc_corporal_keeshan::npc_corporal_keeshanAI, creature->AI())->Start(true, false, player->GetGUID(), quest);
- DoScriptText(SAY_CORPORAL_1, creature);
- }
-
- return false;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_corporal_keeshanAI(creature);
- }
-
- struct npc_corporal_keeshanAI : public npc_escortAI
- {
- npc_corporal_keeshanAI(Creature* creature) : npc_escortAI(creature) {}
-
- uint32 uiPhase;
- uint32 uiTimer;
- uint32 uiMockingBlowTimer;
- uint32 uiShieldBashTimer;
-
- void Reset()
- {
- uiTimer = 0;
- uiPhase = 0;
- uiMockingBlowTimer = 5000;
- uiShieldBashTimer = 8000;
- }
-
- void WaypointReached(uint32 waypointId)
- {
- Player* player = GetPlayerForEscort();
- if (!player)
- return;
-
- if (waypointId >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING)
- me->SetWalk(false);
-
- switch (waypointId)
- {
- case 39:
- SetEscortPaused(true);
- uiTimer = 2000;
- uiPhase = 1;
- break;
- case 65:
- me->SetWalk(false);
- break;
- case 115:
- player->AreaExploredOrEventHappens(QUEST_MISSING_IN_ACTION);
- uiTimer = 2000;
- uiPhase = 4;
- break;
- }
- }
-
- void UpdateAI(const uint32 uiDiff)
- {
- if (HasEscortState(STATE_ESCORT_NONE))
- return;
-
- npc_escortAI::UpdateAI(uiDiff);
-
- if (uiPhase)
- {
- if (uiTimer <= uiDiff)
- {
- switch (uiPhase)
- {
- case 1:
- me->SetStandState(UNIT_STAND_STATE_SIT);
- uiTimer = 1000;
- uiPhase = 2;
- break;
- case 2:
- DoScriptText(SAY_CORPORAL_2, me);
- uiTimer = 15000;
- uiPhase = 3;
- break;
- case 3:
- DoScriptText(SAY_CORPORAL_3, me);
- me->SetStandState(UNIT_STAND_STATE_STAND);
- SetEscortPaused(false);
- uiTimer = 0;
- uiPhase = 0;
- break;
- case 4:
- DoScriptText(SAY_CORPORAL_4, me);
- uiTimer = 2500;
- uiPhase = 5;
- case 5:
- DoScriptText(SAY_CORPORAL_5, me);
- uiTimer = 0;
- uiPhase = 0;
- }
- } else uiTimer -= uiDiff;
- }
-
- if (!UpdateVictim())
- return;
-
- if (uiMockingBlowTimer <= uiDiff)
- {
- DoCast(me->getVictim(), SPELL_MOCKING_BLOW);
- uiMockingBlowTimer = 5000;
- } else uiMockingBlowTimer -= uiDiff;
-
- if (uiShieldBashTimer <= uiDiff)
- {
- DoCast(me->getVictim(), SPELL_MOCKING_BLOW);
- uiShieldBashTimer = 8000;
- } else uiShieldBashTimer -= uiDiff;
-
- DoMeleeAttackIfReady();
- }
- };
-};
-
void AddSC_redridge_mountains()
{
- new npc_corporal_keeshan();
}
diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp
index c52e69787d4..8f5925405ec 100644
--- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp
+++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp
@@ -19,13 +19,12 @@
/* ScriptData
SDName: Silverpine_Forest
SD%Complete: 100
-SDComment: Quest support: 435, 452
+SDComment: Quest support: 435
SDCategory: Silverpine Forest
EndScriptData */
/* ContentData
npc_deathstalker_erland
-pyrewood_ambush
EndContentData */
#include "ScriptMgr.h"
@@ -136,194 +135,10 @@ public:
};
/*######
-## pyrewood_ambush
-#######*/
-
-#define QUEST_PYREWOOD_AMBUSH 452
-
-#define NPCSAY_INIT "Get ready, they'll be arriving any minute..." //not blizzlike
-#define NPCSAY_END "Thanks for your help!" //not blizzlike
-
-static float PyrewoodSpawnPoints[3][4] =
-{
- //pos_x pos_y pos_z orien
- //outside
- /*
- {-400.85f, 1513.64f, 18.67f, 0},
- {-397.32f, 1514.12f, 18.67f, 0},
- {-397.44f, 1511.09f, 18.67f, 0},
- */
- //door
- {-396.17f, 1505.86f, 19.77f, 0},
- {-396.91f, 1505.77f, 19.77f, 0},
- {-397.94f, 1504.74f, 19.77f, 0},
-};
-
-#define WAIT_SECS 6000
-
-class pyrewood_ambush : public CreatureScript
-{
-public:
- pyrewood_ambush() : CreatureScript("pyrewood_ambush") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, const Quest *quest)
- {
- if (quest->GetQuestId() == QUEST_PYREWOOD_AMBUSH && !CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->QuestInProgress)
- {
- CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->QuestInProgress = true;
- CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->Phase = 0;
- CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->KillCount = 0;
- CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->PlayerGUID = player->GetGUID();
- }
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new pyrewood_ambushAI (creature);
- }
-
- struct pyrewood_ambushAI : public ScriptedAI
- {
- pyrewood_ambushAI(Creature* creature) : ScriptedAI(creature), Summons(me)
- {
- QuestInProgress = false;
- }
-
- uint32 Phase;
- int8 KillCount;
- uint32 WaitTimer;
- uint64 PlayerGUID;
- SummonList Summons;
-
- bool QuestInProgress;
-
- void Reset()
- {
- WaitTimer = WAIT_SECS;
-
- if (!QuestInProgress) //fix reset values (see UpdateVictim)
- {
- Phase = 0;
- KillCount = 0;
- PlayerGUID = 0;
- Summons.DespawnAll();
- }
- }
-
- void EnterCombat(Unit* /*who*/){}
-
- void JustSummoned(Creature* summoned)
- {
- Summons.Summon(summoned);
- ++KillCount;
- }
-
- void SummonedCreatureDespawn(Creature* summoned)
- {
- Summons.Despawn(summoned);
- --KillCount;
- }
-
- void SummonCreatureWithRandomTarget(uint32 creatureId, int position)
- {
- if (Creature* summoned = me->SummonCreature(creatureId, PyrewoodSpawnPoints[position][0], PyrewoodSpawnPoints[position][1], PyrewoodSpawnPoints[position][2], PyrewoodSpawnPoints[position][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000))
- {
- Unit* target = NULL;
- if (PlayerGUID)
- {
- if (Unit* player = Unit::GetPlayer(*me, PlayerGUID)->ToUnit())
- target = RAND((Unit*)me, player);
- } else
- target = me;
-
- if (target)
- {
- summoned->setFaction(168);
- summoned->AddThreat(target, 32.0f);
- summoned->AI()->AttackStart(target);
- }
- }
- }
-
- void JustDied(Unit* /*killer*/)
- {
- if (PlayerGUID)
- if (Player* player = Unit::GetPlayer(*me, PlayerGUID))
- if (player->GetQuestStatus(QUEST_PYREWOOD_AMBUSH) == QUEST_STATUS_INCOMPLETE)
- player->FailQuest(QUEST_PYREWOOD_AMBUSH);
- }
-
- void UpdateAI(const uint32 diff)
- {
- //sLog->outInfo(LOG_FILTER_TSCR, "DEBUG: p(%i) k(%i) d(%u) W(%i)", Phase, KillCount, diff, WaitTimer);
-
- if (!QuestInProgress)
- return;
-
- if (KillCount && Phase < 6)
- {
- if (!UpdateVictim()) //reset() on target Despawn...
- return;
-
- DoMeleeAttackIfReady();
- return;
- }
-
- switch (Phase)
- {
- case 0:
- if (WaitTimer == WAIT_SECS)
- me->MonsterSay(NPCSAY_INIT, LANG_UNIVERSAL, 0); //no blizzlike
-
- if (WaitTimer <= diff)
- {
- WaitTimer -= diff;
- return;
- }
- break;
- case 1:
- SummonCreatureWithRandomTarget(2060, 1);
- break;
- case 2:
- SummonCreatureWithRandomTarget(2061, 2);
- SummonCreatureWithRandomTarget(2062, 0);
- break;
- case 3:
- SummonCreatureWithRandomTarget(2063, 1);
- SummonCreatureWithRandomTarget(2064, 2);
- SummonCreatureWithRandomTarget(2065, 0);
- break;
- case 4:
- SummonCreatureWithRandomTarget(2066, 1);
- SummonCreatureWithRandomTarget(2067, 0);
- SummonCreatureWithRandomTarget(2068, 2);
- break;
- case 5: //end
- if (PlayerGUID)
- {
- if (Player* player = Unit::GetPlayer(*me, PlayerGUID))
- {
- me->MonsterSay(NPCSAY_END, LANG_UNIVERSAL, 0); //not blizzlike
- player->GroupEventHappens(QUEST_PYREWOOD_AMBUSH, me);
- }
- }
- QuestInProgress = false;
- Reset();
- break;
- }
- ++Phase; //prepare next phase
- }
- };
-};
-
-/*######
## AddSC
######*/
void AddSC_silverpine_forest()
{
new npc_deathstalker_erland();
- new pyrewood_ambush();
}
diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp
index 560214d4085..f6afed67dff 100644
--- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp
+++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp
@@ -18,19 +18,12 @@
/* ScriptData
SDName: Stormwind_City
-SD%Complete: 100
-SDComment: Quest support: 1640, 1447, 4185, 11223, 434.
+SD%Complete: 0
+SDComment:
SDCategory: Stormwind City
EndScriptData */
/* ContentData
-npc_archmage_malin
-npc_bartleby
-npc_lady_katrana_prestor
-npc_tyrion
-npc_tyrion_spybot
-npc_marzon_silent_blade
-npc_lord_gregor_lescovar
EndContentData */
#include "ScriptMgr.h"
@@ -38,609 +31,7 @@ EndContentData */
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
-/*######
-## npc_archmage_malin
-######*/
-
-#define GOSSIP_ITEM_MALIN "Can you send me to Theramore? I have an urgent message for Lady Jaina from Highlord Bolvar."
-
-class npc_archmage_malin : public CreatureScript
-{
-public:
- npc_archmage_malin() : CreatureScript("npc_archmage_malin") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF)
- {
- player->CLOSE_GOSSIP_MENU();
- creature->CastSpell(player, 42711, true);
- }
-
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(11223) == QUEST_STATUS_COMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MALIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-};
-
-/*######
-## npc_bartleby
-######*/
-
-enum eBartleby
-{
- FACTION_ENEMY = 168,
- QUEST_BEAT = 1640
-};
-
-class npc_bartleby : public CreatureScript
-{
-public:
- npc_bartleby() : CreatureScript("npc_bartleby") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
- {
- if (quest->GetQuestId() == QUEST_BEAT)
- {
- creature->setFaction(FACTION_ENEMY);
- creature->AI()->AttackStart(player);
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_bartlebyAI(creature);
- }
-
- struct npc_bartlebyAI : public ScriptedAI
- {
- npc_bartlebyAI(Creature* creature) : ScriptedAI(creature)
- {
- m_uiNormalFaction = creature->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))
- {
- //Take 0 damage
- uiDamage = 0;
-
- if (pDoneBy->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(pDoneBy)->AreaExploredOrEventHappens(QUEST_BEAT);
- EnterEvadeMode();
- }
- }
- };
-};
-
-/*######
-## npc_lady_katrana_prestor
-######*/
-
-#define GOSSIP_ITEM_KAT_1 "Pardon the intrusion, Lady Prestor, but Highlord Bolvar suggested that I seek your advice."
-#define GOSSIP_ITEM_KAT_2 "My apologies, Lady Prestor."
-#define GOSSIP_ITEM_KAT_3 "Begging your pardon, Lady Prestor. That was not my intent."
-#define GOSSIP_ITEM_KAT_4 "Thank you for your time, Lady Prestor."
-
-class npc_lady_katrana_prestor : public CreatureScript
-{
-public:
- npc_lady_katrana_prestor() : CreatureScript("npc_lady_katrana_prestor") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(2694, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(2695, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(2696, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(4185);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(4185) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(2693, creature->GetGUID());
-
- return true;
- }
-};
-
-/*######
-## npc_lord_gregor_lescovar
-######*/
-
-enum eLordGregorLescovar
-{
- SAY_LESCOVAR_2 = -1000457,
- SAY_GUARD_2 = -1000458,
- SAY_LESCOVAR_3 = -1000459,
- SAY_MARZON_1 = -1000460,
- SAY_LESCOVAR_4 = -1000461,
- SAY_TYRION_2 = -1000462,
- SAY_MARZON_2 = -1000463,
-
- NPC_STORMWIND_ROYAL = 1756,
- NPC_MARZON_BLADE = 1755,
- NPC_TYRION = 7766,
-
- QUEST_THE_ATTACK = 434
-};
-
-class npc_lord_gregor_lescovar : public CreatureScript
-{
-public:
- npc_lord_gregor_lescovar() : CreatureScript("npc_lord_gregor_lescovar") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_lord_gregor_lescovarAI(creature);
- }
-
- struct npc_lord_gregor_lescovarAI : public npc_escortAI
- {
- npc_lord_gregor_lescovarAI(Creature* creature) : npc_escortAI(creature)
- {
- creature->RestoreFaction();
- }
-
- uint32 uiTimer;
- uint32 uiPhase;
-
- uint64 MarzonGUID;
-
- void Reset()
- {
- uiTimer = 0;
- uiPhase = 0;
-
- MarzonGUID = 0;
- }
-
- void EnterEvadeMode()
- {
- me->DisappearAndDie();
-
- if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID))
- {
- if (pMarzon->isAlive())
- pMarzon->DisappearAndDie();
- }
- }
-
- void EnterCombat(Unit* who)
- {
- if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID))
- {
- if (pMarzon->isAlive() && !pMarzon->isInCombat())
- pMarzon->AI()->AttackStart(who);
- }
- }
-
- void WaypointReached(uint32 waypointId)
- {
- switch (waypointId)
- {
- case 14:
- SetEscortPaused(true);
- DoScriptText(SAY_LESCOVAR_2, me);
- uiTimer = 3000;
- uiPhase = 1;
- break;
- case 16:
- SetEscortPaused(true);
- if (Creature* pMarzon = me->SummonCreature(NPC_MARZON_BLADE, -8411.360352f, 480.069733f, 123.760895f, 4.941504f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000))
- {
- pMarzon->GetMotionMaster()->MovePoint(0, -8408.000977f, 468.611450f, 123.759903f);
- MarzonGUID = pMarzon->GetGUID();
- }
- uiTimer = 2000;
- uiPhase = 4;
- break;
- }
- }
- //TO-DO: We don't have movemaps, also we can't make 2 npcs walks to one point propperly (and we can not use escort ai, because they are 2 different spawns and with same entry), because of it we make them, disappear.
- void DoGuardsDisappearAndDie()
- {
- std::list<Creature*> GuardList;
- me->GetCreatureListWithEntryInGrid(GuardList, NPC_STORMWIND_ROYAL, 8.0f);
- if (!GuardList.empty())
- {
- for (std::list<Creature*>::const_iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr)
- {
- if (Creature* pGuard = *itr)
- pGuard->DisappearAndDie();
- }
- }
- }
-
- void UpdateAI(const uint32 uiDiff)
- {
- if (uiPhase)
- {
- if (uiTimer <= uiDiff)
- {
- switch (uiPhase)
- {
- case 1:
- if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 8.0f, true))
- DoScriptText(SAY_GUARD_2, pGuard);
- uiTimer = 3000;
- uiPhase = 2;
- break;
- case 2:
- DoGuardsDisappearAndDie();
- uiTimer = 2000;
- uiPhase = 3;
- break;
- case 3:
- SetEscortPaused(false);
- uiTimer = 0;
- uiPhase = 0;
- break;
- case 4:
- DoScriptText(SAY_LESCOVAR_3, me);
- uiTimer = 0;
- uiPhase = 0;
- break;
- case 5:
- if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID))
- DoScriptText(SAY_MARZON_1, pMarzon);
- uiTimer = 3000;
- uiPhase = 6;
- break;
- case 6:
- DoScriptText(SAY_LESCOVAR_4, me);
- if (Player* player = GetPlayerForEscort())
- player->AreaExploredOrEventHappens(QUEST_THE_ATTACK);
- uiTimer = 2000;
- uiPhase = 7;
- break;
- case 7:
- if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 20.0f, true))
- DoScriptText(SAY_TYRION_2, pTyrion);
- if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID))
- pMarzon->setFaction(14);
- me->setFaction(14);
- uiTimer = 0;
- uiPhase = 0;
- break;
- }
- } else uiTimer -= uiDiff;
- }
- npc_escortAI::UpdateAI(uiDiff);
-
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
- };
-};
-
-/*######
-## npc_marzon_silent_blade
-######*/
-
-class npc_marzon_silent_blade : public CreatureScript
-{
-public:
- npc_marzon_silent_blade() : CreatureScript("npc_marzon_silent_blade") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_marzon_silent_bladeAI(creature);
- }
-
- struct npc_marzon_silent_bladeAI : public ScriptedAI
- {
- npc_marzon_silent_bladeAI(Creature* creature) : ScriptedAI(creature)
- {
- me->SetWalk(true);
- }
-
- void Reset()
- {
- me->RestoreFaction();
- }
-
- void EnterCombat(Unit* who)
- {
- DoScriptText(SAY_MARZON_2, me);
-
- if (me->isSummon())
- {
- if (Unit* summoner = me->ToTempSummon()->GetSummoner())
- {
- if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive() && !summoner->isInCombat())
- summoner->ToCreature()->AI()->AttackStart(who);
- }
- }
- }
-
- void EnterEvadeMode()
- {
- me->DisappearAndDie();
-
- if (me->isSummon())
- {
- if (Unit* summoner = me->ToTempSummon()->GetSummoner())
- {
- if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive())
- summoner->ToCreature()->DisappearAndDie();
- }
- }
- }
-
- void MovementInform(uint32 uiType, uint32 /*uiId*/)
- {
- if (uiType != POINT_MOTION_TYPE)
- return;
-
- if (me->isSummon())
- {
- Unit* summoner = me->ToTempSummon()->GetSummoner();
- if (summoner && summoner->GetTypeId() == TYPEID_UNIT && summoner->IsAIEnabled)
- {
- npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI* ai =
- CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, summoner->GetAI());
- if (ai)
- {
- ai->uiTimer = 2000;
- ai->uiPhase = 5;
- }
- //me->ChangeOrient(0.0f, summoner);
- }
- }
- }
-
- void UpdateAI(const uint32 /*diff*/)
- {
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
- };
-};
-
-/*######
-## npc_tyrion_spybot
-######*/
-
-enum eTyrionSpybot
-{
- SAY_QUEST_ACCEPT_ATTACK = -1000499,
- SAY_TYRION_1 = -1000450,
- SAY_SPYBOT_1 = -1000451,
- SAY_GUARD_1 = -1000452,
- SAY_SPYBOT_2 = -1000453,
- SAY_SPYBOT_3 = -1000454,
- SAY_LESCOVAR_1 = -1000455,
- SAY_SPYBOT_4 = -1000456,
-
- NPC_PRIESTESS_TYRIONA = 7779,
- NPC_LORD_GREGOR_LESCOVAR = 1754,
-};
-
-class npc_tyrion_spybot : public CreatureScript
-{
-public:
- npc_tyrion_spybot() : CreatureScript("npc_tyrion_spybot") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_tyrion_spybotAI(creature);
- }
-
- struct npc_tyrion_spybotAI : public npc_escortAI
- {
- npc_tyrion_spybotAI(Creature* creature) : npc_escortAI(creature) {}
-
- uint32 uiTimer;
- uint32 uiPhase;
-
- void Reset()
- {
- uiTimer = 0;
- uiPhase = 0;
- }
-
- void WaypointReached(uint32 waypointId)
- {
- switch (waypointId)
- {
- case 1:
- SetEscortPaused(true);
- uiTimer = 2000;
- uiPhase = 1;
- break;
- case 5:
- SetEscortPaused(true);
- DoScriptText(SAY_SPYBOT_1, me);
- uiTimer = 2000;
- uiPhase = 5;
- break;
- case 17:
- SetEscortPaused(true);
- DoScriptText(SAY_SPYBOT_3, me);
- uiTimer = 3000;
- uiPhase = 8;
- break;
- }
- }
-
- void UpdateAI(const uint32 uiDiff)
- {
- if (uiPhase)
- {
- if (uiTimer <= uiDiff)
- {
- switch (uiPhase)
- {
- case 1:
- DoScriptText(SAY_QUEST_ACCEPT_ATTACK, me);
- uiTimer = 3000;
- uiPhase = 2;
- break;
- case 2:
- if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 10.0f))
- DoScriptText(SAY_TYRION_1, pTyrion);
- uiTimer = 3000;
- uiPhase = 3;
- break;
- case 3:
- me->UpdateEntry(NPC_PRIESTESS_TYRIONA, ALLIANCE);
- uiTimer = 2000;
- uiPhase = 4;
- break;
- case 4:
- SetEscortPaused(false);
- uiPhase = 0;
- uiTimer = 0;
- break;
- case 5:
- if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 10.0f, true))
- DoScriptText(SAY_GUARD_1, pGuard);
- uiTimer = 3000;
- uiPhase = 6;
- break;
- case 6:
- DoScriptText(SAY_SPYBOT_2, me);
- uiTimer = 3000;
- uiPhase = 7;
- break;
- case 7:
- SetEscortPaused(false);
- uiTimer = 0;
- uiPhase = 0;
- break;
- case 8:
- if (Creature* pLescovar = me->FindNearestCreature(NPC_LORD_GREGOR_LESCOVAR, 10.0f))
- DoScriptText(SAY_LESCOVAR_1, pLescovar);
- uiTimer = 3000;
- uiPhase = 9;
- break;
- case 9:
- DoScriptText(SAY_SPYBOT_4, me);
- uiTimer = 3000;
- uiPhase = 10;
- break;
- case 10:
- if (Creature* pLescovar = me->FindNearestCreature(NPC_LORD_GREGOR_LESCOVAR, 10.0f))
- {
- if (Player* player = GetPlayerForEscort())
- {
- CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->Start(false, false, player->GetGUID());
- CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->SetMaxPlayerDistance(200.0f);
- }
- }
- me->DisappearAndDie();
- uiTimer = 0;
- uiPhase = 0;
- break;
- }
- } else uiTimer -= uiDiff;
- }
- npc_escortAI::UpdateAI(uiDiff);
-
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
- };
-};
-
-/*######
-## npc_tyrion
-######*/
-
-enum eTyrion
-{
- NPC_TYRION_SPYBOT = 8856
-};
-
-class npc_tyrion : public CreatureScript
-{
-public:
- npc_tyrion() : CreatureScript("npc_tyrion") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
- {
- if (quest->GetQuestId() == QUEST_THE_ATTACK)
- {
- if (Creature* pSpybot = creature->FindNearestCreature(NPC_TYRION_SPYBOT, 5.0f, true))
- {
- CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->Start(false, false, player->GetGUID());
- CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->SetMaxPlayerDistance(200.0f);
- }
- return true;
- }
- return false;
- }
-};
void AddSC_stormwind_city()
{
- new npc_archmage_malin();
- new npc_bartleby();
- new npc_lady_katrana_prestor();
- new npc_tyrion();
- new npc_tyrion_spybot();
- new npc_lord_gregor_lescovar();
- new npc_marzon_silent_blade();
}
diff --git a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp
index 4c81380fb60..9724588039f 100644
--- a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp
+++ b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp
@@ -20,136 +20,6 @@
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
-/*######
-## npc_galen_goodward
-######*/
-
-enum Galen
-{
- QUEST_GALENS_ESCAPE = 1393,
-
- GO_GALENS_CAGE = 37118,
-
- SAY_PERIODIC = -1000500,
- SAY_QUEST_ACCEPTED = -1000501,
- SAY_ATTACKED_1 = -1000502,
- SAY_ATTACKED_2 = -1000503,
- SAY_QUEST_COMPLETE = -1000504,
- EMOTE_WHISPER = -1000505,
- EMOTE_DISAPPEAR = -1000506
-};
-
-class npc_galen_goodward : public CreatureScript
-{
-public:
-
- npc_galen_goodward() : CreatureScript("npc_galen_goodward") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
- {
- if (quest->GetQuestId() == QUEST_GALENS_ESCAPE)
- {
- CAST_AI(npc_galen_goodward::npc_galen_goodwardAI, creature->AI())->Start(false, false, player->GetGUID());
- creature->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE);
- DoScriptText(SAY_QUEST_ACCEPTED, creature);
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_galen_goodwardAI(creature);
- }
-
- struct npc_galen_goodwardAI : public npc_escortAI
- {
- npc_galen_goodwardAI(Creature* creature) : npc_escortAI(creature)
- {
- m_uiGalensCageGUID = 0;
- Reset();
- }
-
- uint64 m_uiGalensCageGUID;
- uint32 m_uiPeriodicSay;
-
- void Reset()
- {
- m_uiPeriodicSay = 6000;
- }
-
- void EnterCombat(Unit* who)
- {
- if (HasEscortState(STATE_ESCORT_ESCORTING))
- DoScriptText(RAND(SAY_ATTACKED_1, SAY_ATTACKED_2), me, who);
- }
-
- void WaypointStart(uint32 uiPointId)
- {
- switch (uiPointId)
- {
- case 0:
- {
- GameObject* pCage = NULL;
- if (m_uiGalensCageGUID)
- pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID);
- else
- pCage = GetClosestGameObjectWithEntry(me, GO_GALENS_CAGE, INTERACTION_DISTANCE);
- if (pCage)
- {
- pCage->UseDoorOrButton();
- m_uiGalensCageGUID = pCage->GetGUID();
- }
- break;
- }
- case 21:
- DoScriptText(EMOTE_DISAPPEAR, me);
- break;
- }
- }
-
- void WaypointReached(uint32 waypointId)
- {
- switch (waypointId)
- {
- case 0:
- if (GameObject* pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID))
- pCage->ResetDoorOrButton();
- break;
- case 20:
- if (Player* player = GetPlayerForEscort())
- {
- me->SetFacingToObject(player);
- DoScriptText(SAY_QUEST_COMPLETE, me, player);
- DoScriptText(EMOTE_WHISPER, me, player);
- player->GroupEventHappens(QUEST_GALENS_ESCAPE, me);
- }
- SetRun(true);
- break;
- }
- }
-
- void UpdateAI(const uint32 uiDiff)
- {
- npc_escortAI::UpdateAI(uiDiff);
-
- if (HasEscortState(STATE_ESCORT_NONE))
- return;
-
- if (m_uiPeriodicSay < uiDiff)
- {
- if (!HasEscortState(STATE_ESCORT_ESCORTING))
- DoScriptText(SAY_PERIODIC, me);
- m_uiPeriodicSay = 15000;
- }
- else
- m_uiPeriodicSay -= uiDiff;
-
- DoMeleeAttackIfReady();
- }
- };
-};
-
void AddSC_swamp_of_sorrows()
{
- new npc_galen_goodward();
}
diff --git a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp
index 70f9f93c7a7..cbefd115739 100644
--- a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp
+++ b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp
@@ -18,199 +18,18 @@
/* ScriptData
SDName: Tirisfal_Glades
-SD%Complete: 100
-SDComment: Quest support: 590, 1819
+SD%Complete: 0
+SDComment:
SDCategory: Tirisfal Glades
EndScriptData */
/* ContentData
-npc_calvin_montague
-go_mausoleum_door
-go_mausoleum_trigger
EndContentData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
-/*######
-## npc_calvin_montague
-######*/
-
-enum eCalvin
-{
- SAY_COMPLETE = -1000431,
- SPELL_DRINK = 2639, // possibly not correct spell (but iconId is correct)
- QUEST_590 = 590,
- FACTION_HOSTILE = 168
-};
-
-class npc_calvin_montague : public CreatureScript
-{
-public:
- npc_calvin_montague() : CreatureScript("npc_calvin_montague") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
- {
- if (quest->GetQuestId() == QUEST_590)
- {
- creature->setFaction(FACTION_HOSTILE);
- creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
- CAST_AI(npc_calvin_montague::npc_calvin_montagueAI, creature->AI())->AttackStart(player);
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_calvin_montagueAI (creature);
- }
-
- struct npc_calvin_montagueAI : public ScriptedAI
- {
- npc_calvin_montagueAI(Creature* creature) : ScriptedAI(creature) { }
-
- uint32 m_uiPhase;
- uint32 m_uiPhaseTimer;
- uint64 m_uiPlayerGUID;
-
- void Reset()
- {
- m_uiPhase = 0;
- m_uiPhaseTimer = 5000;
- m_uiPlayerGUID = 0;
-
- me->RestoreFaction();
-
- if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
- }
-
- void EnterCombat(Unit* /*who*/) {}
-
- void AttackedBy(Unit* pAttacker)
- {
- if (me->getVictim() || me->IsFriendlyTo(pAttacker))
- return;
-
- AttackStart(pAttacker);
- }
-
- void DamageTaken(Unit* pDoneBy, uint32 &uiDamage)
- {
- if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(15, uiDamage))
- {
- uiDamage = 0;
-
- me->RestoreFaction();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
- me->CombatStop(true);
-
- m_uiPhase = 1;
-
- if (pDoneBy->GetTypeId() == TYPEID_PLAYER)
- m_uiPlayerGUID = pDoneBy->GetGUID();
- }
- }
-
- void UpdateAI(const uint32 uiDiff)
- {
- if (m_uiPhase)
- {
- if (m_uiPhaseTimer <= uiDiff)
- m_uiPhaseTimer = 7500;
- else
- {
- m_uiPhaseTimer -= uiDiff;
- return;
- }
-
- switch (m_uiPhase)
- {
- case 1:
- DoScriptText(SAY_COMPLETE, me);
- ++m_uiPhase;
- break;
- case 2:
- if (Player* player = Unit::GetPlayer(*me, m_uiPlayerGUID))
- player->AreaExploredOrEventHappens(QUEST_590);
-
- DoCast(me, SPELL_DRINK, true);
- ++m_uiPhase;
- break;
- case 3:
- EnterEvadeMode();
- break;
- }
-
- return;
- }
-
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
- };
-};
-
-/*######
-## go_mausoleum_door
-## go_mausoleum_trigger
-######*/
-
-enum eMausoleum
-{
- QUEST_ULAG = 1819,
- NPC_ULAG = 6390,
- GO_TRIGGER = 104593,
- GO_DOOR = 176594
-};
-
-class go_mausoleum_door : public GameObjectScript
-{
-public:
- go_mausoleum_door() : GameObjectScript("go_mausoleum_door") { }
-
- bool OnGossipHello(Player* player, GameObject* /*go*/)
- {
- if (player->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE)
- return false;
-
- if (GameObject* pTrigger = player->FindNearestGameObject(GO_TRIGGER, 30.0f))
- {
- pTrigger->SetGoState(GO_STATE_READY);
- player->SummonCreature(NPC_ULAG, 2390.26f, 336.47f, 40.01f, 2.26f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);
- return false;
- }
-
- return false;
- }
-};
-
-class go_mausoleum_trigger : public GameObjectScript
-{
-public:
- go_mausoleum_trigger() : GameObjectScript("go_mausoleum_trigger") { }
-
- bool OnGossipHello(Player* player, GameObject* go)
- {
- if (player->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE)
- return false;
-
- if (GameObject* pDoor = player->FindNearestGameObject(GO_DOOR, 30.0f))
- {
- go->SetGoState(GO_STATE_ACTIVE);
- pDoor->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
- return true;
- }
-
- return false;
- }
-};
void AddSC_tirisfal_glades()
{
- new npc_calvin_montague();
- new go_mausoleum_door();
- new go_mausoleum_trigger();
}
diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt
index 7f63c521594..f54c23afb3c 100644
--- a/src/server/scripts/Kalimdor/CMakeLists.txt
+++ b/src/server/scripts/Kalimdor/CMakeLists.txt
@@ -101,7 +101,6 @@ set(scripts_STAT_SRCS
Kalimdor/WailingCaverns/wailing_caverns.cpp
Kalimdor/durotar.cpp
Kalimdor/felwood.cpp
- Kalimdor/boss_azuregos.cpp
Kalimdor/tanaris.cpp
Kalimdor/dustwallow_marsh.cpp
Kalimdor/winterspring.cpp
diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
index 0d4efac4321..aa7dfb4a864 100644
--- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
+++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
@@ -317,7 +317,7 @@ public:
eventTimer = 3000;
if (Creature* naralex = instance->instance->GetCreature(instance->GetData64(DATA_NARALEX)))
{
- AchievementEntry const* AchievWC = sAchievementStore.LookupEntry(ACHIEVEMENT_WAILING_CAVERNS);
+ AchievementEntry const* AchievWC = sAchievementMgr->GetAchievement(ACHIEVEMENT_WAILING_CAVERNS);
if (AchievWC)
{
Map* map = me->GetMap();
diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp
index 8d08c26f0a7..fdc00e04a09 100644
--- a/src/server/scripts/Kalimdor/azshara.cpp
+++ b/src/server/scripts/Kalimdor/azshara.cpp
@@ -18,507 +18,18 @@
/* ScriptData
SDName: Azshara
-SD%Complete: 90
-SDComment: Quest support: 2744, 3141, 9364, 10994
+SD%Complete: 0
+SDComment: Quest support:
SDCategory: Azshara
EndScriptData */
/* ContentData
-mobs_spitelashes
-npc_loramus_thalipedes
-mob_rizzle_sprysprocket
-mob_depth_charge
EndContentData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
-/*######
-## mobs_spitelashes
-######*/
-
-class mobs_spitelashes : public CreatureScript
-{
-public:
- mobs_spitelashes() : CreatureScript("mobs_spitelashes") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mobs_spitelashesAI (creature);
- }
-
- struct mobs_spitelashesAI : public ScriptedAI
- {
- mobs_spitelashesAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 morphtimer;
- bool spellhit;
-
- void Reset()
- {
- morphtimer = 0;
- spellhit = false;
- }
-
- void EnterCombat(Unit* /*who*/) { }
-
- void SpellHit(Unit* Hitter, const SpellInfo* Spellkind)
- {
- if (!spellhit &&
- Hitter->GetTypeId() == TYPEID_PLAYER &&
- CAST_PLR(Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE &&
- (Spellkind->Id == 118 || Spellkind->Id == 12824 || Spellkind->Id == 12825 || Spellkind->Id == 12826))
- {
- spellhit=true;
- DoCast(me, 29124); //become a sheep
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- // we mustn't remove the Creature in the same round in which we cast the summon spell, otherwise there will be no summons
- if (spellhit && morphtimer >= 5000)
- {
- me->DespawnOrUnsummon();
- return;
- }
- // walk 5 seconds before summoning
- if (spellhit && morphtimer<5000)
- {
- morphtimer+=diff;
- if (morphtimer >= 5000)
- {
- DoCast(me, 28406); //summon copies
- DoCast(me, 6924); //visual explosion
- }
- }
- if (!UpdateVictim())
- return;
-
- //TODO: add abilities for the different creatures
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
-/*######
-## npc_loramus_thalipedes
-######*/
-
-#define GOSSIP_HELLO_LT1 "Can you help me?"
-#define GOSSIP_HELLO_LT2 "Tell me your story"
-#define GOSSIP_SELECT_LT1 "Please continue"
-#define GOSSIP_SELECT_LT2 "I do not understand"
-#define GOSSIP_SELECT_LT3 "Indeed"
-#define GOSSIP_SELECT_LT4 "I will do this with or your help, Loramus"
-#define GOSSIP_SELECT_LT5 "Yes"
-
-class npc_loramus_thalipedes : public CreatureScript
-{
-public:
- npc_loramus_thalipedes() : CreatureScript("npc_loramus_thalipedes") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(2744);
- break;
-
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
- player->SEND_GOSSIP_MENU(1813, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+21:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
- player->SEND_GOSSIP_MENU(1814, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+22:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23);
- player->SEND_GOSSIP_MENU(1815, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+23:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24);
- player->SEND_GOSSIP_MENU(1816, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+24:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25);
- player->SEND_GOSSIP_MENU(1817, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+25:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(3141);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(2744) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_LT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- if (player->GetQuestStatus(3141) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_LT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-};
-
-/*####
-# mob_rizzle_sprysprocket
-####*/
-
-enum RizzleSprysprocketData
-{
- QUEST_CHASING_THE_MOONSTONE = 10994,
-
- MOB_DEPTH_CHARGE = 23025,
-
- SPELL_RIZZLE_BLACKJACK = 39865,
- SPELL_RIZZLE_ESCAPE = 39871,
- SPELL_RIZZLE_FROST_GRENADE = 40525,
- SPELL_DEPTH_CHARGE_TRAP = 38576,
- SPELL_PERIODIC_DEPTH_CHARGE = 39912,
- SPELL_GIVE_SOUTHFURY_MOONSTONE = 39886,
-
- SAY_RIZZLE_START = -1000351,
- MSG_ESCAPE_NOTICE = -1000352,
- SAY_RIZZLE_GRENADE = -1000353,
- SAY_RIZZLE_GRENADE_BACKFIRE = -1000354, // Not used
- SAY_RIZZLE_FINAL = -1000355,
- SAY_RIZZLE_FINAL2 = -1000356, // Not used
-};
-
-#define GOSSIP_GET_MOONSTONE "Hand over the Southfury moonstone and I'll let you go."
-
-Position const WPs[58] =
-{
- {3691.97f, -3962.41f, 35.9118f, 3.67f},
- {3675.02f, -3960.49f, 35.9118f, 3.67f},
- {3653.19f, -3958.33f, 33.9118f, 3.59f},
- {3621.12f, -3958.51f, 29.9118f, 3.48f},
- {3604.86f, -3963, 29.9118f, 3.48f},
- {3569.94f, -3970.25f, 29.9118f, 3.44f},
- {3541.03f, -3975.64f, 29.9118f, 3.41f},
- {3510.84f, -3978.71f, 29.9118f, 3.41f},
- {3472.7f, -3997.07f, 29.9118f, 3.35f},
- {3439.15f, -4014.55f, 29.9118f, 3.29f},
- {3412.8f, -4025.87f, 29.9118f, 3.25f},
- {3384.95f, -4038.04f, 29.9118f, 3.24f},
- {3346.77f, -4052.93f, 29.9118f, 3.22f},
- {3299.56f, -4071.59f, 29.9118f, 3.20f},
- {3261.22f, -4080.38f, 30.9118f, 3.19f},
- {3220.68f, -4083.09f, 31.9118f, 3.18f},
- {3187.11f, -4070.45f, 33.9118f, 3.16f},
- {3162.78f, -4062.75f, 33.9118f, 3.15f},
- {3136.09f, -4050.32f, 33.9118f, 3.07f},
- {3119.47f, -4044.51f, 36.0363f, 3.07f},
- {3098.95f, -4019.8f, 33.9118f, 3.07f},
- {3073.07f, -4011.42f, 33.9118f, 3.07f},
- {3051.71f, -3993.37f, 33.9118f, 3.02f},
- {3027.52f, -3978.6f, 33.9118f, 3.00f},
- {3003.78f, -3960.14f, 33.9118f, 2.98f},
- {2977.99f, -3941.98f, 31.9118f, 2.96f},
- {2964.57f, -3932.07f, 30.9118f, 2.96f},
- {2947.9f, -3921.31f, 29.9118f, 2.96f},
- {2924.91f, -3910.8f, 29.9118f, 2.94f},
- {2903.04f, -3896.42f, 29.9118f, 2.93f},
- {2884.75f, -3874.03f, 29.9118f, 2.90f},
- {2868.19f, -3851.48f, 29.9118f, 2.82f},
- {2854.62f, -3819.72f, 29.9118f, 2.80f},
- {2825.53f, -3790.4f, 29.9118f, 2.744f},
- {2804.31f, -3773.05f, 29.9118f, 2.71f},
- {2769.78f, -3763.57f, 29.9118f, 2.70f},
- {2727.23f, -3745.92f, 30.9118f, 2.69f},
- {2680.12f, -3737.49f, 30.9118f, 2.67f},
- {2647.62f, -3739.94f, 30.9118f, 2.66f},
- {2616.6f, -3745.75f, 30.9118f, 2.64f},
- {2589.38f, -3731.97f, 30.9118f, 2.61f},
- {2562.94f, -3722.35f, 31.9118f, 2.56f},
- {2521.05f, -3716.6f, 31.9118f, 2.55f},
- {2485.26f, -3706.67f, 31.9118f, 2.51f},
- {2458.93f, -3696.67f, 31.9118f, 2.51f},
- {2432, -3692.03f, 31.9118f, 2.46f},
- {2399.59f, -3681.97f, 31.9118f, 2.45f},
- {2357.75f, -3666.6f, 31.9118f, 2.44f},
- {2311.99f, -3656.88f, 31.9118f, 2.94f},
- {2263.41f, -3649.55f, 31.9118f, 3.02f},
- {2209.05f, -3641.76f, 31.9118f, 2.99f},
- {2164.83f, -3637.64f, 31.9118f, 3.15f},
- {2122.42f, -3639, 31.9118f, 3.21f},
- {2075.73f, -3643.59f, 31.9118f, 3.22f},
- {2033.59f, -3649.52f, 31.9118f, 3.42f},
- {1985.22f, -3662.99f, 31.9118f, 3.42f},
- {1927.09f, -3679.56f, 33.9118f, 3.42f},
- {1873.57f, -3695.32f, 33.9118f, 3.44f}
-};
-
-class mob_rizzle_sprysprocket : public CreatureScript
-{
-public:
- mob_rizzle_sprysprocket() : CreatureScript("mob_rizzle_sprysprocket") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF + 1 && player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE)
- {
- player->CLOSE_GOSSIP_MENU();
- creature->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true);
- CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDieTimer = 3000;
- CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDie = true;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) != QUEST_STATUS_INCOMPLETE)
- return true;
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(10811, creature->GetGUID());
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_rizzle_sprysprocketAI (creature);
- }
-
- struct mob_rizzle_sprysprocketAI : public ScriptedAI
- {
- mob_rizzle_sprysprocketAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 SpellEscapeTimer;
- uint32 TeleportTimer;
- uint32 CheckTimer;
- uint32 GrenadeTimer;
- uint32 MustDieTimer;
- uint32 CurrWP;
-
- uint64 PlayerGUID;
-
- bool MustDie;
- bool Escape;
- bool ContinueWP;
- bool Reached;
-
- void Reset()
- {
- SpellEscapeTimer = 1300;
- TeleportTimer = 3500;
- CheckTimer = 10000;
- GrenadeTimer = 30000;
- MustDieTimer = 3000;
- CurrWP = 0;
-
- PlayerGUID = 0;
-
- MustDie = false;
- Escape = false;
- ContinueWP = false;
- Reached = false;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (MustDie)
- {
- if (MustDieTimer <= diff)
- {
- me->DespawnOrUnsummon();
- return;
- } else MustDieTimer -= diff;
- }
-
- if (!Escape)
- {
- if (!PlayerGUID)
- return;
-
- if (SpellEscapeTimer <= diff)
- {
- DoCast(me, SPELL_RIZZLE_ESCAPE, false);
- SpellEscapeTimer = 10000;
- } else SpellEscapeTimer -= diff;
-
- if (TeleportTimer <= diff)
- {
- //temp solution - unit can't be teleported by core using spelleffect 5, only players
- if (me->GetMap())
- {
- me->SetPosition(3706.39f, -3969.15f, 35.9118f, 0);
- me->AI_SendMoveToPacket(3706.39f, -3969.15f, 35.9118f, 0, 0, 0);
- }
- //begin swimming and summon depth charges
- Player* player = Unit::GetPlayer(*me, PlayerGUID);
- SendText(MSG_ESCAPE_NOTICE, player);
- DoCast(me, SPELL_PERIODIC_DEPTH_CHARGE);
- me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
- me->SetSpeed(MOVE_RUN, 0.85f, true);
- me->GetMotionMaster()->MovementExpired();
- me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]);
- Escape = true;
- } else TeleportTimer -= diff;
-
- return;
- }
-
- if (ContinueWP)
- {
- me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]);
- ContinueWP = false;
- }
-
- if (GrenadeTimer <= diff)
- {
- Player* player = Unit::GetPlayer(*me, PlayerGUID);
- if (player)
- {
- DoScriptText(SAY_RIZZLE_GRENADE, me, player);
- DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true);
- }
- GrenadeTimer = 30000;
- } else GrenadeTimer -= diff;
-
- if (CheckTimer <= diff)
- {
- Player* player = Unit::GetPlayer(*me, PlayerGUID);
- if (!player)
- {
- me->DespawnOrUnsummon();
- return;
- }
-
- if (me->IsWithinDist(player, 10) && me->GetPositionX() > player->GetPositionX() && !Reached)
- {
- DoScriptText(SAY_RIZZLE_FINAL, me);
- me->SetUInt32Value(UNIT_NPC_FLAGS, 1);
- me->setFaction(35);
- me->GetMotionMaster()->MoveIdle();
- me->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE);
- Reached = true;
- }
-
- CheckTimer = 1000;
- } else CheckTimer -= diff;
-
- }
-
- void SendText(int32 iTextEntry, Player* player)
- {
- LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex();
- const char* text = sObjectMgr->GetTrinityString(iTextEntry, loc_idx);
- sWorld->SendServerMessage(SERVER_MSG_STRING, text, player);
- }
-
- void AttackStart(Unit* who)
- {
- if (!who || PlayerGUID)
- return;
-
- if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE)
- {
- PlayerGUID = who->GetGUID();
- DoScriptText(SAY_RIZZLE_START, me);
- DoCast(who, SPELL_RIZZLE_BLACKJACK, false);
- return;
- }
- }
-
- void EnterCombat(Unit* /*who*/) {}
-
- void MovementInform(uint32 type, uint32 id)
- {
- if (type != POINT_MOTION_TYPE)
- return;
-
- if (id == 57)
- {
- me->DespawnOrUnsummon();
- return;
- }
-
- ++CurrWP;
- ContinueWP = true;
- }
- };
-};
-
-/*####
-# mob_depth_charge
-####*/
-class mob_depth_charge : public CreatureScript
-{
-public:
- mob_depth_charge() : CreatureScript("mob_depth_charge") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_depth_chargeAI (creature);
- }
-
- struct mob_depth_chargeAI : public ScriptedAI
- {
- mob_depth_chargeAI(Creature* creature) : ScriptedAI(creature) {}
-
- bool WeMustDie;
- uint32 WeMustDieTimer;
-
- void Reset()
- {
- me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- WeMustDie = false;
- WeMustDieTimer = 1000;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (WeMustDie)
- {
- if (WeMustDieTimer <= diff)
- me->DespawnOrUnsummon();
- else
- WeMustDieTimer -= diff;
- }
- return;
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- if (!who)
- return;
-
- if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 5))
- {
- DoCast(who, SPELL_DEPTH_CHARGE_TRAP);
- WeMustDie = true;
- return;
- }
- }
-
- void AttackStart(Unit* /*who*/) {}
-
- void EnterCombat(Unit* /*who*/) {}
- };
-};
-
void AddSC_azshara()
{
- new mobs_spitelashes();
- new npc_loramus_thalipedes();
- new mob_rizzle_sprysprocket();
- new mob_depth_charge();
}
diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp
index 96e67c8de47..6a109cded3b 100644
--- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp
+++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp
@@ -19,7 +19,7 @@
/* ScriptData
SDName: Azuremyst_Isle
SD%Complete: 75
-SDComment: Quest support: 9283, 9537, 9582, 9554, 9531, ? (special flight path, proper model for mount missing). Injured Draenei cosmetic only, 9582.
+SDComment: Quest support: 9283, 9537, 9582, 9554, ? (special flight path, proper model for mount missing). Injured Draenei cosmetic only, 9582.
SDCategory: Azuremyst Isle
EndScriptData */
@@ -28,7 +28,6 @@ npc_draenei_survivor
npc_engineer_spark_overgrind
npc_injured_draenei
npc_magwin
-npc_geezle
go_ravager_cage
npc_death_ravager
EndContentData */
@@ -407,166 +406,6 @@ public:
};
-/*######
-## npc_geezle
-######*/
-
-enum Geezle
-{
- QUEST_TREES_COMPANY = 9531,
-
- SPELL_TREE_DISGUISE = 30298,
-
- GEEZLE_SAY_1 = -1000629,
- SPARK_SAY_2 = -1000630,
- SPARK_SAY_3 = -1000631,
- GEEZLE_SAY_4 = -1000632,
- SPARK_SAY_5 = -1000633,
- SPARK_SAY_6 = -1000634,
- GEEZLE_SAY_7 = -1000635,
-
- EMOTE_SPARK = -1000636,
-
- MOB_SPARK = 17243,
- GO_NAGA_FLAG = 181694
-};
-
-Position const SparkPos = {-5029.91f, -11291.79f, 8.096f, 0.0f};
-
-class npc_geezle : public CreatureScript
-{
-public:
- npc_geezle() : CreatureScript("npc_geezle") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_geezleAI(creature);
- }
-
- struct npc_geezleAI : public ScriptedAI
- {
- npc_geezleAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint64 SparkGUID;
-
- uint8 Step;
- uint32 SayTimer;
-
- bool EventStarted;
-
- void Reset()
- {
- SparkGUID = 0;
- Step = 0;
- StartEvent();
- }
-
- void EnterCombat(Unit* /*who*/){}
-
- void StartEvent()
- {
- Step = 0;
- EventStarted = true;
- if (Creature* Spark = me->SummonCreature(MOB_SPARK, SparkPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000))
- {
- SparkGUID = Spark->GetGUID();
- Spark->setActive(true);
- Spark->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- }
- SayTimer = 8000;
- }
-
- uint32 NextStep(uint8 Step)
- {
- Creature* Spark = Unit::GetCreature(*me, SparkGUID);
-
- switch (Step)
- {
- case 0:
- if (Spark)
- Spark->GetMotionMaster()->MovePoint(0, -5080.70f, -11253.61f, 0.56f);
- me->GetMotionMaster()->MovePoint(0, -5092.26f, -11252, 0.71f);
- return 9000; // NPCs are walking up to fire
- case 1:
- DespawnNagaFlag(true);
- DoScriptText(EMOTE_SPARK, Spark);
- return 1000;
- case 2:
- DoScriptText(GEEZLE_SAY_1, me, Spark);
- if (Spark)
- {
- Spark->SetInFront(me);
- me->SetInFront(Spark);
- }
- return 5000;
- case 3: DoScriptText(SPARK_SAY_2, Spark); return 7000;
- case 4: DoScriptText(SPARK_SAY_3, Spark); return 8000;
- case 5: DoScriptText(GEEZLE_SAY_4, me, Spark); return 8000;
- case 6: DoScriptText(SPARK_SAY_5, Spark); return 9000;
- case 7: DoScriptText(SPARK_SAY_6, Spark); return 8000;
- case 8: DoScriptText(GEEZLE_SAY_7, me, Spark); return 2000;
- case 9:
- me->GetMotionMaster()->MoveTargetedHome();
- if (Spark)
- Spark->GetMotionMaster()->MovePoint(0, SparkPos);
- CompleteQuest();
- return 9000;
- case 10:
- if (Spark)
- Spark->DisappearAndDie();
- DespawnNagaFlag(false);
- me->DisappearAndDie();
- default: return 99999999;
- }
- }
-
- // will complete Tree's company quest for all nearby players that are disguised as trees
- void CompleteQuest()
- {
- float radius = 50.0f;
- std::list<Player*> players;
- Trinity::AnyPlayerInObjectRangeCheck checker(me, radius);
- Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(me, players, checker);
- me->VisitNearbyWorldObject(radius, searcher);
-
- for (std::list<Player*>::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- if ((*itr)->GetQuestStatus(QUEST_TREES_COMPANY) == QUEST_STATUS_INCOMPLETE && (*itr)->HasAura(SPELL_TREE_DISGUISE))
- (*itr)->KilledMonsterCredit(MOB_SPARK, 0);
- }
-
- void DespawnNagaFlag(bool despawn)
- {
- std::list<GameObject*> FlagList;
- me->GetGameObjectListWithEntryInGrid(FlagList, GO_NAGA_FLAG, 100.0f);
-
- if (!FlagList.empty())
- {
- for (std::list<GameObject*>::const_iterator itr = FlagList.begin(); itr != FlagList.end(); ++itr)
- {
- if (despawn)
- (*itr)->SetLootState(GO_JUST_DEACTIVATED);
- else
- (*itr)->Respawn();
- }
- }
- else
- sLog->outError(LOG_FILTER_TSCR, "SD2 ERROR: FlagList is empty!");
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (SayTimer <= diff)
- {
- if (EventStarted)
- SayTimer = NextStep(Step++);
- }
- else
- SayTimer -= diff;
- }
- };
-
-};
-
enum RavegerCage
{
NPC_DEATH_RAVAGER = 17556,
@@ -762,7 +601,6 @@ void AddSC_azuremyst_isle()
new npc_engineer_spark_overgrind();
new npc_injured_draenei();
new npc_magwin();
- new npc_geezle();
new npc_death_ravager();
new go_ravager_cage();
new npc_stillpine_capitive();
diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp
deleted file mode 100644
index ec098951c03..00000000000
--- a/src/server/scripts/Kalimdor/boss_azuregos.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* ScriptData
-SDName: Boss_Azuregos
-SD%Complete: 90
-SDComment: Teleport not included, spell reflect not effecting dots (Core problem)
-SDCategory: Azshara
-EndScriptData */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-
-enum Say
-{
- SAY_TELEPORT = -1000100
-};
-
-enum Spells
-{
- SPELL_MARKOFFROST = 23182,
- SPELL_MANASTORM = 21097,
- SPELL_CHILL = 21098,
- SPELL_FROSTBREATH = 21099,
- SPELL_REFLECT = 22067,
- SPELL_CLEAVE = 8255, //Perhaps not right ID
- SPELL_ENRAGE = 23537
-};
-
-class boss_azuregos : public CreatureScript
-{
-public:
- boss_azuregos() : CreatureScript("boss_azuregos") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new boss_azuregosAI (creature);
- }
-
- struct boss_azuregosAI : public ScriptedAI
- {
- boss_azuregosAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 MarkOfFrostTimer;
- uint32 ManaStormTimer;
- uint32 ChillTimer;
- uint32 BreathTimer;
- uint32 TeleportTimer;
- uint32 ReflectTimer;
- uint32 CleaveTimer;
- uint32 EnrageTimer;
- bool Enraged;
-
- void Reset()
- {
- MarkOfFrostTimer = 35000;
- ManaStormTimer = urand(5000, 17000);
- ChillTimer = urand(10000, 30000);
- BreathTimer = urand(2000, 8000);
- TeleportTimer = 30000;
- ReflectTimer = urand(15000, 30000);
- CleaveTimer = 7000;
- EnrageTimer = 0;
- Enraged = false;
- }
-
- void EnterCombat(Unit* /*who*/) {}
-
- void UpdateAI(const uint32 diff)
- {
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- if (TeleportTimer <= diff)
- {
- DoScriptText(SAY_TELEPORT, me);
- std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
- std::list<HostileReference*>::const_iterator i = threatlist.begin();
- for (i = threatlist.begin(); i!= threatlist.end(); ++i)
- {
- Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
- if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
- {
- DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+3, unit->GetOrientation());
- }
- }
-
- DoResetThreat();
- TeleportTimer = 30000;
- } else TeleportTimer -= diff;
-
- // //MarkOfFrostTimer
- // if (MarkOfFrostTimer <= diff)
- // {
- // DoCast(me->getVictim(), SPELL_MARKOFFROST);
- // MarkOfFrostTimer = 25000;
- // } else MarkOfFrostTimer -= diff;
-
- //ChillTimer
- if (ChillTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_CHILL);
- ChillTimer = urand(13000, 25000);
- } else ChillTimer -= diff;
-
- //BreathTimer
- if (BreathTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_FROSTBREATH);
- BreathTimer = urand(10000, 15000);
- } else BreathTimer -= diff;
-
- //ManaStormTimer
- if (ManaStormTimer <= diff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- DoCast(target, SPELL_MANASTORM);
- ManaStormTimer = urand(7500, 12500);
- } else ManaStormTimer -= diff;
-
- //ReflectTimer
- if (ReflectTimer <= diff)
- {
- DoCast(me, SPELL_REFLECT);
- ReflectTimer = urand(20000, 35000);
- } else ReflectTimer -= diff;
-
- //CleaveTimer
- if (CleaveTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_CLEAVE);
- CleaveTimer = 7000;
- } else CleaveTimer -= diff;
-
- //EnrageTimer
- if (HealthBelowPct(26) && !Enraged)
- {
- DoCast(me, SPELL_ENRAGE);
- Enraged = true;
- }
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
-void AddSC_boss_azuregos()
-{
- new boss_azuregos();
-}
diff --git a/src/server/scripts/Kalimdor/darkshore.cpp b/src/server/scripts/Kalimdor/darkshore.cpp
index 0e02a77169e..3330898ebe4 100644
--- a/src/server/scripts/Kalimdor/darkshore.cpp
+++ b/src/server/scripts/Kalimdor/darkshore.cpp
@@ -18,15 +18,12 @@
/* ScriptData
SDName: Darkshore
-SD%Complete: 100
-SDComment: Quest support: 731, 2078, 5321
+SD%Complete: 0
+SDComment: Quest support:
SDCategory: Darkshore
EndScriptData */
/* ContentData
-npc_kerlonian
-npc_prospector_remtravel
-npc_threshwackonator
EndContentData */
#include "ScriptMgr.h"
@@ -35,369 +32,6 @@ EndContentData */
#include "ScriptedEscortAI.h"
#include "ScriptedFollowerAI.h"
-/*####
-# npc_kerlonian
-####*/
-
-enum Kerlonian
-{
- SAY_KER_START = -1000434,
-
- EMOTE_KER_SLEEP_1 = -1000435,
- EMOTE_KER_SLEEP_2 = -1000436,
- EMOTE_KER_SLEEP_3 = -1000437,
-
- SAY_KER_SLEEP_1 = -1000438,
- SAY_KER_SLEEP_2 = -1000439,
- SAY_KER_SLEEP_3 = -1000440,
- SAY_KER_SLEEP_4 = -1000441,
-
- EMOTE_KER_AWAKEN = -1000445,
-
- SAY_KER_ALERT_1 = -1000442,
- SAY_KER_ALERT_2 = -1000443,
-
- SAY_KER_END = -1000444,
-
- SPELL_SLEEP_VISUAL = 25148,
- SPELL_AWAKEN = 17536,
- QUEST_SLEEPER_AWAKENED = 5321,
- NPC_LILADRIS = 11219, //attackers entries unknown
- FACTION_KER_ESCORTEE = 113
-};
-
-//TODO: make concept similar as "ringo" -escort. Find a way to run the scripted attacks, _if_ player are choosing road.
-class npc_kerlonian : public CreatureScript
-{
-public:
- npc_kerlonian() : CreatureScript("npc_kerlonian") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
- {
- if (quest->GetQuestId() == QUEST_SLEEPER_AWAKENED)
- {
- if (npc_kerlonianAI* pKerlonianAI = CAST_AI(npc_kerlonian::npc_kerlonianAI, creature->AI()))
- {
- creature->SetStandState(UNIT_STAND_STATE_STAND);
- DoScriptText(SAY_KER_START, creature, player);
- pKerlonianAI->StartFollow(player, FACTION_KER_ESCORTEE, quest);
- }
- }
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_kerlonianAI(creature);
- }
-
- struct npc_kerlonianAI : public FollowerAI
- {
- npc_kerlonianAI(Creature* creature) : FollowerAI(creature) { }
-
- uint32 FallAsleepTimer;
-
- void Reset()
- {
- FallAsleepTimer = urand(10000, 45000);
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- FollowerAI::MoveInLineOfSight(who);
-
- if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_LILADRIS)
- {
- if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE*5))
- {
- if (Player* player = GetLeaderForFollower())
- {
- if (player->GetQuestStatus(QUEST_SLEEPER_AWAKENED) == QUEST_STATUS_INCOMPLETE)
- player->GroupEventHappens(QUEST_SLEEPER_AWAKENED, me);
-
- DoScriptText(SAY_KER_END, me);
- }
-
- SetFollowComplete();
- }
- }
- }
-
- void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell)
- {
- if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_AWAKEN)
- ClearSleeping();
- }
-
- void SetSleeping()
- {
- SetFollowPaused(true);
-
- DoScriptText(RAND(EMOTE_KER_SLEEP_1, EMOTE_KER_SLEEP_2, EMOTE_KER_SLEEP_3), me);
-
- DoScriptText(RAND(SAY_KER_SLEEP_1, SAY_KER_SLEEP_2, SAY_KER_SLEEP_3, SAY_KER_SLEEP_4), me);
-
- me->SetStandState(UNIT_STAND_STATE_SLEEP);
- DoCast(me, SPELL_SLEEP_VISUAL, false);
- }
-
- void ClearSleeping()
- {
- me->RemoveAurasDueToSpell(SPELL_SLEEP_VISUAL);
- me->SetStandState(UNIT_STAND_STATE_STAND);
-
- DoScriptText(EMOTE_KER_AWAKEN, me);
-
- SetFollowPaused(false);
- }
-
- void UpdateFollowerAI(const uint32 Diff)
- {
- if (!UpdateVictim())
- {
- if (!HasFollowState(STATE_FOLLOW_INPROGRESS))
- return;
-
- if (!HasFollowState(STATE_FOLLOW_PAUSED))
- {
- if (FallAsleepTimer <= Diff)
- {
- SetSleeping();
- FallAsleepTimer = urand(25000, 90000);
- }
- else
- FallAsleepTimer -= Diff;
- }
-
- return;
- }
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
-/*####
-# npc_prospector_remtravel
-####*/
-
-enum Remtravel
-{
- SAY_REM_START = -1000327,
- SAY_REM_AGGRO = -1000328,
- SAY_REM_RAMP1_1 = -1000329,
- SAY_REM_RAMP1_2 = -1000330,
- SAY_REM_BOOK = -1000331,
- SAY_REM_TENT1_1 = -1000332,
- SAY_REM_TENT1_2 = -1000333,
- SAY_REM_MOSS = -1000334,
- EMOTE_REM_MOSS = -1000335,
- SAY_REM_MOSS_PROGRESS = -1000336,
- SAY_REM_PROGRESS = -1000337,
- SAY_REM_REMEMBER = -1000338,
- EMOTE_REM_END = -1000339,
-
- FACTION_ESCORTEE = 10,
- QUEST_ABSENT_MINDED_PT2 = 731,
- NPC_GRAVEL_SCOUT = 2158,
- NPC_GRAVEL_BONE = 2159,
- NPC_GRAVEL_GEO = 2160
-};
-
-class npc_prospector_remtravel : public CreatureScript
-{
-public:
- npc_prospector_remtravel() : CreatureScript("npc_prospector_remtravel") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
- {
- if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2)
- {
- if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI()))
- pEscortAI->Start(false, false, player->GetGUID());
-
- creature->setFaction(FACTION_ESCORTEE);
- }
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_prospector_remtravelAI(creature);
- }
-
- struct npc_prospector_remtravelAI : public npc_escortAI
- {
- npc_prospector_remtravelAI(Creature* creature) : npc_escortAI(creature) {}
-
- void WaypointReached(uint32 waypointId)
- {
- if (Player* player = GetPlayerForEscort())
- {
- switch (waypointId)
- {
- case 0:
- DoScriptText(SAY_REM_START, me, player);
- break;
- case 5:
- DoScriptText(SAY_REM_RAMP1_1, me, player);
- break;
- case 6:
- DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- break;
- case 9:
- DoScriptText(SAY_REM_RAMP1_2, me, player);
- break;
- case 14:
- //depend quest rewarded?
- DoScriptText(SAY_REM_BOOK, me, player);
- break;
- case 15:
- DoScriptText(SAY_REM_TENT1_1, me, player);
- break;
- case 16:
- DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- break;
- case 17:
- DoScriptText(SAY_REM_TENT1_2, me, player);
- break;
- case 26:
- DoScriptText(SAY_REM_MOSS, me, player);
- break;
- case 27:
- DoScriptText(EMOTE_REM_MOSS, me, player);
- break;
- case 28:
- DoScriptText(SAY_REM_MOSS_PROGRESS, me, player);
- break;
- case 29:
- DoSpawnCreature(NPC_GRAVEL_SCOUT, -15.0f, 3.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- DoSpawnCreature(NPC_GRAVEL_BONE, -15.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- DoSpawnCreature(NPC_GRAVEL_GEO, -15.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- break;
- case 31:
- DoScriptText(SAY_REM_PROGRESS, me, player);
- break;
- case 41:
- DoScriptText(SAY_REM_REMEMBER, me, player);
- break;
- case 42:
- DoScriptText(EMOTE_REM_END, me, player);
- player->GroupEventHappens(QUEST_ABSENT_MINDED_PT2, me);
- break;
- }
- }
- }
-
- void Reset() {}
-
- void EnterCombat(Unit* who)
- {
- if (urand(0, 1))
- DoScriptText(SAY_REM_AGGRO, me, who);
- }
-
- void JustSummoned(Creature* /*pSummoned*/)
- {
- //unsure if it should be any
- //pSummoned->AI()->AttackStart(me);
- }
- };
-
-};
-
-/*####
-# npc_threshwackonator
-####*/
-
-enum Threshwackonator
-{
- EMOTE_START = -1000325, //signed for 4966
- SAY_AT_CLOSE = -1000326, //signed for 4966
- QUEST_GYROMAST_REV = 2078,
- NPC_GELKAK = 6667,
- FACTION_HOSTILE = 14
-};
-
-#define GOSSIP_ITEM_INSERT_KEY "[PH] Insert key"
-
-class npc_threshwackonator : public CreatureScript
-{
-public:
- npc_threshwackonator() : CreatureScript("npc_threshwackonator") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
-
- if (npc_threshwackonatorAI* pThreshAI = CAST_AI(npc_threshwackonator::npc_threshwackonatorAI, creature->AI()))
- {
- DoScriptText(EMOTE_START, creature);
- pThreshAI->StartFollow(player);
- }
- }
-
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->GetQuestStatus(QUEST_GYROMAST_REV) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INSERT_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_threshwackonatorAI(creature);
- }
-
- struct npc_threshwackonatorAI : public FollowerAI
- {
- npc_threshwackonatorAI(Creature* creature) : FollowerAI(creature) { }
-
- void Reset() { }
-
- void MoveInLineOfSight(Unit* who)
- {
- FollowerAI::MoveInLineOfSight(who);
-
- if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_GELKAK)
- {
- if (me->IsWithinDistInMap(who, 10.0f))
- {
- DoScriptText(SAY_AT_CLOSE, who);
- DoAtEnd();
- }
- }
- }
-
- void DoAtEnd()
- {
- me->setFaction(FACTION_HOSTILE);
-
- if (Player* pHolder = GetLeaderForFollower())
- me->AI()->AttackStart(pHolder);
-
- SetFollowComplete();
- }
- };
-
-};
-
void AddSC_darkshore()
{
- new npc_kerlonian();
- new npc_prospector_remtravel();
- new npc_threshwackonator();
}
diff --git a/src/server/scripts/Kalimdor/desolace.cpp b/src/server/scripts/Kalimdor/desolace.cpp
index e196c71f681..a3da0019a8b 100644
--- a/src/server/scripts/Kalimdor/desolace.cpp
+++ b/src/server/scripts/Kalimdor/desolace.cpp
@@ -19,14 +19,12 @@
/* ScriptData
SDName: Desolace
SD%Complete: 100
-SDComment: Quest support: 5561
+SDComment: Quest support: 5561, 5581
SDCategory: Desolace
EndScriptData */
/* ContentData
npc_aged_dying_ancient_kodo
-go_iruxos
-npc_dalinda_malem
go_demon_portal
EndContentData */
@@ -173,104 +171,6 @@ public:
};
/*######
-## go_iruxos
-## Hand of Iruxos
-######*/
-
-enum Iruxos
-{
- QUEST_HAND_IRUXOS = 5381,
- NPC_DEMON_SPIRIT = 11876,
-};
-
-class go_iruxos : public GameObjectScript
-{
- public:
- go_iruxos() : GameObjectScript("go_iruxos") { }
-
- bool OnGossipHello(Player* player, GameObject* go)
- {
- if (player->GetQuestStatus(QUEST_HAND_IRUXOS) == QUEST_STATUS_INCOMPLETE && !go->FindNearestCreature(NPC_DEMON_SPIRIT, 25.0f, true))
- player->SummonCreature(NPC_DEMON_SPIRIT, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
-
- return true;
- }
-};
-
-/*######
-## npc_dalinda_malem. Quest 1440
-######*/
-
-enum Dalinda
-{
- QUEST_RETURN_TO_VAHLARRIEL = 1440
-};
-
-class npc_dalinda : public CreatureScript
-{
-public:
- npc_dalinda() : CreatureScript("npc_dalinda") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
- {
- if (quest->GetQuestId() == QUEST_RETURN_TO_VAHLARRIEL)
- {
- if (npc_escortAI* pEscortAI = CAST_AI(npc_dalinda::npc_dalindaAI, creature->AI()))
- {
- pEscortAI->Start(true, false, player->GetGUID());
- creature->setFaction(113);
- }
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_dalindaAI(creature);
- }
-
- struct npc_dalindaAI : public npc_escortAI
- {
- npc_dalindaAI(Creature* creature) : npc_escortAI(creature) { }
-
- void WaypointReached(uint32 waypointId)
- {
- Player* player = GetPlayerForEscort();
-
- switch (waypointId)
- {
- case 1:
- me->IsStandState();
- break;
- case 15:
- if (player)
- player->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me);
- break;
- }
- }
-
- void EnterCombat(Unit* /*who*/) { }
-
- void Reset() {}
-
- void JustDied(Unit* /*killer*/)
- {
- if (Player* player = GetPlayerForEscort())
- player->FailQuest(QUEST_RETURN_TO_VAHLARRIEL);
- return;
- }
-
- void UpdateAI(const uint32 Diff)
- {
- npc_escortAI::UpdateAI(Diff);
- if (!UpdateVictim())
- return;
- DoMeleeAttackIfReady();
- }
- };
-};
-
-/*######
## go_demon_portal
######*/
@@ -301,7 +201,5 @@ class go_demon_portal : public GameObjectScript
void AddSC_desolace()
{
new npc_aged_dying_ancient_kodo();
- new go_iruxos();
- new npc_dalinda();
new go_demon_portal();
}
diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp
index ec06a542b6f..3c66da1917e 100644
--- a/src/server/scripts/Kalimdor/durotar.cpp
+++ b/src/server/scripts/Kalimdor/durotar.cpp
@@ -17,25 +17,24 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
-#include "Vehicle.h"
#include "SpellScript.h"
/*######
-##Quest 5441: Lazy Peons
-##npc_lazy_peon
+## Quest 25134: Lazy Peons
+## npc_lazy_peon
######*/
enum LazyPeonYells
{
- SAY_SPELL_HIT = -1000600 //Ow! OK, I''ll get back to work, $N!'
+ SAY_SPELL_HIT = -1000600 // Ow! OK, I''ll get back to work, $N!'
};
enum LazyPeon
{
- QUEST_LAZY_PEONS = 5441,
- GO_LUMBERPILE = 175784,
- SPELL_BUFF_SLEEP = 17743,
- SPELL_AWAKEN_PEON = 19938
+ QUEST_LAZY_PEONS = 25134,
+ GO_LUMBERPILE = 175784,
+ SPELL_BUFF_SLEEP = 17743,
+ SPELL_AWAKEN_PEON = 19938
};
class npc_lazy_peon : public CreatureScript
@@ -90,7 +89,7 @@ public:
if (RebuffTimer <= Diff)
{
DoCast(me, SPELL_BUFF_SLEEP);
- RebuffTimer = 300000; //Rebuff agian in 5 minutes
+ RebuffTimer = 300000; //Rebuff agian in 5 minutes
}
else
RebuffTimer -= Diff;
@@ -101,431 +100,6 @@ public:
};
};
-enum Texts
-{
- // Tiger Matriarch Credit
- SAY_MATRIARCH_AGGRO = 0,
-
- // Troll Volunteer
- SAY_VOLUNTEER_START = 0,
- SAY_VOLUNTEER_END = 1,
-};
-
-enum Spells
-{
- // Tiger Matriarch Credit
- SPELL_SUMMON_MATRIARCH = 75187,
- SPELL_NO_SUMMON_AURA = 75213,
- SPELL_DETECT_INVIS = 75180,
- SPELL_SUMMON_ZENTABRA_TRIGGER = 75212,
-
- // Tiger Matriarch
- SPELL_POUNCE = 61184,
- SPELL_FURIOUS_BITE = 75164,
- SPELL_SUMMON_ZENTABRA = 75181,
- SPELL_SPIRIT_OF_THE_TIGER_RIDER = 75166,
- SPELL_EJECT_PASSENGERS = 50630,
-
- // Troll Volunteer
- SPELL_VOLUNTEER_AURA = 75076,
- SPELL_PETACT_AURA = 74071,
- SPELL_QUEST_CREDIT = 75106,
- SPELL_MOUNTING_CHECK = 75420,
- SPELL_TURNIN = 73953,
- SPELL_AOE_TURNIN = 75107,
-
- // Vol'jin War Drums
- SPELL_MOTIVATE_1 = 75088,
- SPELL_MOTIVATE_2 = 75086,
-};
-
-enum Creatures
-{
- // Tiger Matriarch Credit
- NPC_TIGER_VEHICLE = 40305,
-
- // Troll Volunteer
- NPC_URUZIN = 40253,
- NPC_VOLUNTEER_1 = 40264,
- NPC_VOLUNTEER_2 = 40260,
-
- // Vol'jin War Drums
- NPC_CITIZEN_1 = 40256,
- NPC_CITIZEN_2 = 40257,
-};
-
-enum Events
-{
- // Tiger Matriarch Credit
- EVENT_CHECK_SUMMON_AURA = 1,
-
- // Tiger Matriarch
- EVENT_POUNCE = 2,
- EVENT_NOSUMMON = 3,
-};
-
-enum Points
-{
- POINT_URUZIN = 4026400,
-};
-
-class npc_tiger_matriarch_credit : public CreatureScript
-{
- public:
- npc_tiger_matriarch_credit() : CreatureScript("npc_tiger_matriarch_credit") { }
-
- struct npc_tiger_matriarch_creditAI : public Scripted_NoMovementAI
- {
- npc_tiger_matriarch_creditAI(Creature* creature) : Scripted_NoMovementAI(creature)
- {
- events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 2000);
- }
-
- void UpdateAI(uint32 const diff)
- {
- events.Update(diff);
-
- if (events.ExecuteEvent() == EVENT_CHECK_SUMMON_AURA)
- {
- std::list<Creature*> tigers;
- GetCreatureListWithEntryInGrid(tigers, me, NPC_TIGER_VEHICLE, 15.0f);
- if (!tigers.empty())
- {
- for (std::list<Creature*>::iterator itr = tigers.begin(); itr != tigers.end(); ++itr)
- {
- if (!(*itr)->isSummon())
- continue;
-
- if (Unit* summoner = (*itr)->ToTempSummon()->GetSummoner())
- if (!summoner->HasAura(SPELL_NO_SUMMON_AURA) && !summoner->HasAura(SPELL_SUMMON_ZENTABRA_TRIGGER)
- && !summoner->isInCombat())
- {
- me->AddAura(SPELL_NO_SUMMON_AURA, summoner);
- me->AddAura(SPELL_DETECT_INVIS, summoner);
- summoner->CastSpell(summoner, SPELL_SUMMON_MATRIARCH, true);
- Talk(SAY_MATRIARCH_AGGRO, summoner->GetGUID());
- }
- }
- }
-
- events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 5000);
- }
- }
-
- private:
- EventMap events;
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_tiger_matriarch_creditAI(creature);
- }
-};
-
-class npc_tiger_matriarch : public CreatureScript
-{
- public:
- npc_tiger_matriarch() : CreatureScript("npc_tiger_matriarch") {}
-
- struct npc_tiger_matriarchAI : public ScriptedAI
- {
- npc_tiger_matriarchAI(Creature* creature) : ScriptedAI(creature),
- _tigerGuid(0)
- {
- }
-
- void EnterCombat(Unit* /*target*/)
- {
- _events.Reset();
- _events.ScheduleEvent(EVENT_POUNCE, 100);
- _events.ScheduleEvent(EVENT_NOSUMMON, 50000);
- }
-
- void IsSummonedBy(Unit* summoner)
- {
- if (summoner->GetTypeId() != TYPEID_PLAYER || !summoner->GetVehicle())
- return;
-
- _tigerGuid = summoner->GetVehicle()->GetBase()->GetGUID();
- if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid))
- {
- me->AddThreat(tiger, 500000.0f);
- DoCast(me, SPELL_FURIOUS_BITE);
- }
- }
-
- void KilledUnit(Unit* victim)
- {
- if (victim->GetTypeId() != TYPEID_UNIT || !victim->isSummon())
- return;
-
- if (Unit* vehSummoner = victim->ToTempSummon()->GetSummoner())
- {
- vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA);
- vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS);
- vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER);
- vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER);
- }
- me->DespawnOrUnsummon();
- }
-
- void DamageTaken(Unit* attacker, uint32& damage)
- {
- if (!attacker->isSummon())
- return;
-
- if (HealthBelowPct(20))
- {
- damage = 0;
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if (Unit* vehSummoner = attacker->ToTempSummon()->GetSummoner())
- {
- vehSummoner->AddAura(SPELL_SUMMON_ZENTABRA_TRIGGER, vehSummoner);
- vehSummoner->CastSpell(vehSummoner, SPELL_SUMMON_ZENTABRA, true);
- attacker->CastSpell(attacker, SPELL_EJECT_PASSENGERS, true);
- vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA);
- vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS);
- vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER);
- vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER);
- }
-
- me->DespawnOrUnsummon();
- }
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
-
- if (!_tigerGuid)
- return;
-
- _events.Update(diff);
-
- while (uint32 eventId = _events.ExecuteEvent())
- {
- switch (eventId)
- {
- case EVENT_POUNCE:
- DoCastVictim(SPELL_POUNCE);
- _events.ScheduleEvent(EVENT_POUNCE, 30000);
- break;
- case EVENT_NOSUMMON: // Reapply SPELL_NO_SUMMON_AURA
- if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid))
- {
- if (tiger->isSummon())
- if (Unit* vehSummoner = tiger->ToTempSummon()->GetSummoner())
- me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner);
- }
- _events.ScheduleEvent(EVENT_NOSUMMON, 50000);
- break;
- default:
- break;
- }
- }
-
- DoMeleeAttackIfReady();
- }
-
- private:
- EventMap _events;
- uint64 _tigerGuid;
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_tiger_matriarchAI(creature);
- }
-};
-
-// These models was found in sniff.
-// TODO: generalize these models with race from dbc
-uint32 const trollmodel[] =
-{11665, 11734, 11750, 12037, 12038, 12042, 12049, 12849, 13529, 14759, 15570, 15701,
-15702, 1882, 1897, 1976, 2025, 27286, 2734, 2735, 4084, 4085, 4087, 4089, 4231, 4357,
-4358, 4360, 4361, 4362, 4363, 4370, 4532, 4537, 4540, 4610, 6839, 7037, 9767, 9768};
-
-class npc_troll_volunteer : public CreatureScript
-{
- public:
- npc_troll_volunteer() : CreatureScript("npc_troll_volunteer") { }
-
- struct npc_troll_volunteerAI : public ScriptedAI
- {
- npc_troll_volunteerAI(Creature* creature) : ScriptedAI(creature)
- {
- }
-
- void InitializeAI()
- {
- if (me->isDead() || !me->GetOwner())
- return;
-
- Reset();
-
- switch (urand(0, 3))
- {
- case 0:
- _mountModel = 6471;
- break;
- case 1:
- _mountModel = 6473;
- break;
- case 2:
- _mountModel = 6469;
- break;
- default:
- _mountModel = 6472;
- break;
- }
- me->SetDisplayId(trollmodel[urand(0, 39)]);
- if (Player* player = me->GetOwner()->ToPlayer())
- me->GetMotionMaster()->MoveFollow(player, 5.0f, float(rand_norm() + 1.0f) * M_PI / 3.0f * 4.0f);
- }
-
- void Reset()
- {
- _complete = false;
- me->AddAura(SPELL_VOLUNTEER_AURA, me);
- me->AddAura(SPELL_MOUNTING_CHECK, me);
- DoCast(me, SPELL_PETACT_AURA);
- me->SetReactState(REACT_PASSIVE);
- Talk(SAY_VOLUNTEER_START);
- }
-
- // This is needed for mount check aura to know what mountmodel the npc got stored
- uint32 GetMountId()
- {
- return _mountModel;
- }
-
- void MovementInform(uint32 type, uint32 id)
- {
- if (type != POINT_MOTION_TYPE)
- return;
- if (id == POINT_URUZIN)
- me->DespawnOrUnsummon();
- }
-
- void SpellHit(Unit* caster, SpellInfo const* spell)
- {
- if (spell->Id == SPELL_AOE_TURNIN && caster->GetEntry() == NPC_URUZIN && !_complete)
- {
- _complete = true; // Preventing from giving credit twice
- DoCast(me, SPELL_TURNIN);
- DoCast(me, SPELL_QUEST_CREDIT);
- me->RemoveAurasDueToSpell(SPELL_MOUNTING_CHECK);
- me->Dismount();
- Talk(SAY_VOLUNTEER_END);
- me->GetMotionMaster()->MovePoint(POINT_URUZIN, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ());
- }
- }
-
- private:
- uint32 _mountModel;
- bool _complete;
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_troll_volunteerAI(creature);
- }
-};
-
-typedef npc_troll_volunteer::npc_troll_volunteerAI VolunteerAI;
-
-class spell_mount_check : public SpellScriptLoader
-{
- public:
- spell_mount_check() : SpellScriptLoader("spell_mount_check") {}
-
- class spell_mount_check_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_mount_check_AuraScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_MOUNTING_CHECK))
- return false;
- return true;
- }
-
- void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
- {
- Unit* target = GetTarget();
- Unit* owner = target->GetOwner();
-
- if (!owner)
- return;
-
- if (owner->IsMounted() && !target->IsMounted())
- {
- if (VolunteerAI* volunteerAI = CAST_AI(VolunteerAI, target->GetAI()))
- target->Mount(volunteerAI->GetMountId());
- }
- else if (!owner->IsMounted() && target->IsMounted())
- target->Dismount();
-
- target->SetSpeed(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
- target->SetSpeed(MOVE_WALK, owner->GetSpeedRate(MOVE_WALK));
- }
-
- void Register()
- {
- OnEffectPeriodic += AuraEffectPeriodicFn(spell_mount_check_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
- }
- };
-
- AuraScript* GetAuraScript() const
- {
- return new spell_mount_check_AuraScript();
- }
-};
-
-class spell_voljin_war_drums : public SpellScriptLoader
-{
- public:
- spell_voljin_war_drums() : SpellScriptLoader("spell_voljin_war_drums") {}
-
- class spell_voljin_war_drums_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_voljin_war_drums_SpellScript)
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_1))
- return false;
- if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_2))
- return false;
- return true;
- }
-
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- Unit* caster = GetCaster();
- if (Unit* target = GetHitUnit())
- {
- uint32 motivate = 0;
- if (target->GetEntry() == NPC_CITIZEN_1)
- motivate = SPELL_MOTIVATE_1;
- else if (target->GetEntry() == NPC_CITIZEN_2)
- motivate = SPELL_MOTIVATE_2;
- if (motivate)
- caster->CastSpell(target, motivate, false);
- }
- }
-
- void Register()
- {
- OnEffectHitTarget += SpellEffectFn(spell_voljin_war_drums_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_voljin_war_drums_SpellScript();
- }
-};
-
enum VoodooSpells
{
SPELL_BREW = 16712, // Special Brew
@@ -545,9 +119,9 @@ class spell_voodoo : public SpellScriptLoader
class spell_voodoo_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_voodoo_SpellScript)
+ PrepareSpellScript(spell_voodoo_SpellScript);
- bool Validate(SpellInfo const* /*spellEntry*/)
+ bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_BREW) || !sSpellMgr->GetSpellInfo(SPELL_GHOSTLY) ||
!sSpellMgr->GetSpellInfo(SPELL_HEX1) || !sSpellMgr->GetSpellInfo(SPELL_HEX2) ||
@@ -579,10 +153,5 @@ class spell_voodoo : public SpellScriptLoader
void AddSC_durotar()
{
new npc_lazy_peon();
- new npc_tiger_matriarch_credit();
- new npc_tiger_matriarch();
- new npc_troll_volunteer();
- new spell_mount_check();
- new spell_voljin_war_drums();
new spell_voodoo();
}
diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp
index 5800a6a58a0..c2953ba38ef 100644
--- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp
+++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp
@@ -19,16 +19,13 @@
/* ScriptData
SDName: Dustwallow_Marsh
SD%Complete: 95
-SDComment: Quest support: 11180, 558, 11126, 11142, 11174, Vendor Nat Pagle
+SDComment: Quest support: 1270, 1222, 27245
SDCategory: Dustwallow Marsh
EndScriptData */
/* ContentData
-mobs_risen_husk_spirit
-npc_lady_jaina_proudmoore
-npc_nat_pagle
-npc_private_hendel
-npc_cassa_crimsonwing - handled by npc_taxi
+npc_stinky
+go_blackhoof_cage
EndContentData */
#include "ScriptMgr.h"
@@ -38,443 +35,6 @@ EndContentData */
#include "SpellScript.h"
/*######
-## mobs_risen_husk_spirit
-######*/
-
-enum HauntingWitchHill
-{
- // Quest
- QUEST_WHATS_HAUNTING_WITCH_HILL = 11180,
-
- // General spells
- SPELL_SUMMON_RESTLESS_APPARITION = 42511,
- SPELL_WITCH_HILL_INFORMATION_CREDIT = 42512,
-
- // Risen Husk specific
- SPELL_CONSUME_FLESH = 37933,
- NPC_RISEN_HUSK = 23555,
-
- // Risen Spirit specific
- SPELL_INTANGIBLE_PRESENCE = 43127,
- NPC_RISEN_SPIRIT = 23554,
-
- // Events
- EVENT_CONSUME_FLESH = 0,
- EVENT_INTANGIBLE_PRESENCE = 1,
-};
-
-class mobs_risen_husk_spirit : public CreatureScript
-{
- public:
- mobs_risen_husk_spirit() : CreatureScript("mobs_risen_husk_spirit") { }
-
- struct mobs_risen_husk_spiritAI : public ScriptedAI
- {
- mobs_risen_husk_spiritAI(Creature* creature) : ScriptedAI(creature) { }
-
- void Reset()
- {
- events.Reset();
- if (me->GetEntry() == NPC_RISEN_HUSK)
- events.ScheduleEvent(EVENT_CONSUME_FLESH, 5000);
- else if (me->GetEntry() == NPC_RISEN_SPIRIT)
- events.ScheduleEvent(EVENT_INTANGIBLE_PRESENCE, 5000);
- }
-
- void JustDied(Unit* killer)
- {
- if (killer->GetTypeId() == TYPEID_PLAYER)
- {
- if (killer->ToPlayer()->GetQuestStatus(QUEST_WHATS_HAUNTING_WITCH_HILL) == QUEST_STATUS_INCOMPLETE)
- {
- DoCast(me, SPELL_SUMMON_RESTLESS_APPARITION, true);
- DoCast(killer, SPELL_WITCH_HILL_INFORMATION_CREDIT, true);
- }
- }
- }
-
- void UpdateAI(uint32 const diff)
- {
- if (!UpdateVictim())
- return;
-
- events.Update(diff);
-
- while (uint32 eventId = events.ExecuteEvent())
- {
- switch (eventId)
- {
- case EVENT_CONSUME_FLESH:
- DoCastVictim(SPELL_CONSUME_FLESH);
- events.ScheduleEvent(EVENT_CONSUME_FLESH, 15000);
- break;
- case EVENT_INTANGIBLE_PRESENCE:
- DoCastVictim(SPELL_INTANGIBLE_PRESENCE);
- events.ScheduleEvent(EVENT_INTANGIBLE_PRESENCE, 15000);
- break;
- default:
- break;
- }
- }
-
- DoMeleeAttackIfReady();
- }
-
- private:
- EventMap events;
- };
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mobs_risen_husk_spiritAI (creature);
- }
-};
-
-/*######
-## npc_theramor_guard
-######*/
-
-enum TheramoreGuard
-{
- SAY_QUEST1 = -1000641,
- SAY_QUEST2 = -1000642,
- SAY_QUEST3 = -1000643,
- SAY_QUEST4 = -1000644,
- SAY_QUEST5 = -1000645,
- SAY_QUEST6 = -1000646,
- SAY_QUEST7 = -1000647,
- SAY_QUEST8 = -1000648,
- SAY_QUEST9 = -1000649,
-
- QUEST_DISCREDITING_THE_DESERTERS = 11133,
-
- NPC_THERAMORE_GUARD = 4979,
-
- SPELL_DOCTORED_LEAFLET = 42725,
- SPELL_PROPAGANDIZED = 42246,
-};
-
-#define GOSSIP_ITEM_THERAMORE_GUARD "You look like an intelligent person. Why don't you read one of these leaflets and give it some thought?"
-
-class npc_theramore_guard : public CreatureScript
-{
-public:
- npc_theramore_guard() : CreatureScript("npc_theramore_guard") { }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->GetQuestStatus(QUEST_DISCREDITING_THE_DESERTERS) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THERAMORE_GUARD, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
-
- if (action == GOSSIP_SENDER_INFO)
- {
- player->CLOSE_GOSSIP_MENU();
- player->KilledMonsterCredit(NPC_THERAMORE_GUARD, 0);
- DoScriptText(SAY_QUEST1, creature);
- creature->CastSpell(creature, SPELL_DOCTORED_LEAFLET, false);
- creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->YellTimer = 4000;
- CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->bYellTimer = true;
- }
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_theramore_guardAI(creature);
- }
-
- struct npc_theramore_guardAI : public ScriptedAI
- {
- npc_theramore_guardAI(Creature* creature) : ScriptedAI(creature) { }
-
- uint32 YellTimer;
- uint32 Step;
- bool bYellTimer;
-
- void Reset()
- {
- bYellTimer = false;
- Step = 0;
- }
-
- void UpdateAI(const uint32 Diff)
- {
- if (!me->HasAura(SPELL_PROPAGANDIZED))
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- if (bYellTimer && YellTimer <= Diff)
- {
- switch (Step)
- {
- case 0:
- DoScriptText(RAND(SAY_QUEST2, SAY_QUEST3, SAY_QUEST4, SAY_QUEST5, SAY_QUEST6), me);
- YellTimer = 3000;
- ++Step;
- break;
- case 1:
- DoScriptText(RAND(SAY_QUEST7, SAY_QUEST8, SAY_QUEST9), me);
- me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
- Step = 0;
- bYellTimer = false;
- break;
- }
- }
- else
- YellTimer -= Diff;
- }
- };
-};
-
-/*######
-## npc_lady_jaina_proudmoore
-######*/
-
-enum LadyJaina
-{
- QUEST_JAINAS_AUTOGRAPH = 558,
- SPELL_JAINAS_AUTOGRAPH = 23122
-};
-
-#define GOSSIP_ITEM_JAINA "I know this is rather silly but i have a young ward who is a bit shy and would like your autograph."
-
-class npc_lady_jaina_proudmoore : public CreatureScript
-{
-public:
- npc_lady_jaina_proudmoore() : CreatureScript("npc_lady_jaina_proudmoore") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_SENDER_INFO)
- {
- player->SEND_GOSSIP_MENU(7012, creature->GetGUID());
- player->CastSpell(player, SPELL_JAINAS_AUTOGRAPH, false);
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(QUEST_JAINAS_AUTOGRAPH) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_JAINA, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-
-};
-
-/*######
-## npc_nat_pagle
-######*/
-
-enum NatPagle
-{
- QUEST_NATS_MEASURING_TAPE = 8227
-};
-
-class npc_nat_pagle : public CreatureScript
-{
-public:
- npc_nat_pagle() : CreatureScript("npc_nat_pagle") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_TRADE)
- player->GetSession()->SendListInventory(creature->GetGUID());
-
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (creature->isVendor() && player->GetQuestRewardStatus(QUEST_NATS_MEASURING_TAPE))
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU(7640, creature->GetGUID());
- }
- else
- player->SEND_GOSSIP_MENU(7638, creature->GetGUID());
-
- return true;
- }
-
-};
-
-/*######
-## npc_private_hendel
-######*/
-
-enum Hendel
-{
- // looks like all this text ids are wrong.
- SAY_PROGRESS_1_TER = -1000411, // signed for 3568
- SAY_PROGRESS_2_HEN = -1000412, // signed for 3568
- SAY_PROGRESS_3_TER = -1000413,
- SAY_PROGRESS_4_TER = -1000414,
- EMOTE_SURRENDER = -1000415,
-
- QUEST_MISSING_DIPLO_PT16 = 1324,
- FACTION_HOSTILE = 168, //guessed, may be different
-
- NPC_SENTRY = 5184, //helps hendel
- NPC_JAINA = 4968, //appears once hendel gives up
- NPC_TERVOSH = 4967
-};
-
-//TODO: develop this further, end event not created
-class npc_private_hendel : public CreatureScript
-{
-public:
- npc_private_hendel() : CreatureScript("npc_private_hendel") { }
-
- bool OnQuestAccept(Player* /*player*/, Creature* creature, const Quest* quest)
- {
- if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT16)
- creature->setFaction(FACTION_HOSTILE);
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_private_hendelAI(creature);
- }
-
- struct npc_private_hendelAI : public ScriptedAI
- {
- npc_private_hendelAI(Creature* creature) : ScriptedAI(creature) { }
-
- void Reset()
- {
- me->RestoreFaction();
- }
-
- void AttackedBy(Unit* pAttacker)
- {
- if (me->getVictim())
- return;
-
- if (me->IsFriendlyTo(pAttacker))
- return;
-
- AttackStart(pAttacker);
- }
-
- void DamageTaken(Unit* pDoneBy, uint32 &Damage)
- {
- if (Damage > me->GetHealth() || me->HealthBelowPctDamaged(20, Damage))
- {
- Damage = 0;
-
- if (Player* player = pDoneBy->GetCharmerOrOwnerPlayerOrPlayerItself())
- player->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, me);
-
- DoScriptText(EMOTE_SURRENDER, me);
- EnterEvadeMode();
- }
- }
- };
-
-};
-
-/*######
-## npc_zelfrax
-######*/
-
-Position const MovePosition = {-2967.030f, -3872.1799f, 35.620f, 0.0f};
-
-enum Zelfrax
-{
- SAY_ZELFRAX = -1000472,
- SAY_ZELFRAX_2 = -1000473
-};
-
-class npc_zelfrax : public CreatureScript
-{
-public:
- npc_zelfrax() : CreatureScript("npc_zelfrax") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_zelfraxAI(creature);
- }
-
- struct npc_zelfraxAI : public ScriptedAI
- {
- npc_zelfraxAI(Creature* creature) : ScriptedAI(creature)
- {
- MoveToDock();
- }
-
- void AttackStart(Unit* who)
- {
- if (!who)
- return;
-
- if (me->Attack(who, true))
- {
- me->SetInCombatWith(who);
- who->SetInCombatWith(me);
-
- if (IsCombatMovementAllowed())
- me->GetMotionMaster()->MoveChase(who);
- }
- }
-
- void MovementInform(uint32 Type, uint32 /*Id*/)
- {
- if (Type != POINT_MOTION_TYPE)
- return;
-
- me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
- SetCombatMovement(true);
-
- if (me->isInCombat())
- if (Unit* unit = me->getVictim())
- me->GetMotionMaster()->MoveChase(unit);
- }
-
- void MoveToDock()
- {
- SetCombatMovement(false);
- me->GetMotionMaster()->MovePoint(0, MovePosition);
- DoScriptText(SAY_ZELFRAX, me);
- DoScriptText(SAY_ZELFRAX_2, me);
- }
-
- void UpdateAI(uint32 const /*Diff*/)
- {
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
-/*######
## npc_stinky
######*/
@@ -771,13 +331,7 @@ public:
void AddSC_dustwallow_marsh()
{
- new mobs_risen_husk_spirit();
- new npc_lady_jaina_proudmoore();
- new npc_nat_pagle();
- new npc_private_hendel();
- new npc_zelfrax();
new npc_stinky();
- new npc_theramore_guard();
new spell_ooze_zap();
new spell_ooze_zap_channel_end();
new spell_energize_aoe();
diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/felwood.cpp
index 1a0aa7b21c0..1d504c02149 100644
--- a/src/server/scripts/Kalimdor/felwood.cpp
+++ b/src/server/scripts/Kalimdor/felwood.cpp
@@ -19,87 +19,17 @@
/* ScriptData
SDName: Felwood
SD%Complete: 95
-SDComment: Quest support: 4101, 4102
+SDComment: Quest support:
SDCategory: Felwood
EndScriptData */
/* ContentData
-npcs_riverbreeze_and_silversky
EndContentData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
-/*######
-## npcs_riverbreeze_and_silversky
-######*/
-
-#define GOSSIP_ITEM_BEACON "Please make me a Cenarion Beacon"
-
-enum RiverbreezeAndSilversky
-{
- SPELL_CENARION_BEACON = 15120,
-
- NPC_ARATHANDRIS_SILVERSKY = 9528,
- NPC_MAYBESS_RIVERBREEZE = 9529,
-
- QUEST_CLEASING_FELWOOD_A = 4101,
- QUEST_CLEASING_FELWOOD_H = 4102
-};
-
-class npcs_riverbreeze_and_silversky : public CreatureScript
-{
-public:
- npcs_riverbreeze_and_silversky() : CreatureScript("npcs_riverbreeze_and_silversky") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
- creature->CastSpell(player, SPELL_CENARION_BEACON, false);
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- uint32 creatureId = creature->GetEntry();
-
- if (creatureId == NPC_ARATHANDRIS_SILVERSKY)
- {
- if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_A))
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(2848, creature->GetGUID());
- } else if (player->GetTeam() == HORDE)
- player->SEND_GOSSIP_MENU(2845, creature->GetGUID());
- else
- player->SEND_GOSSIP_MENU(2844, creature->GetGUID());
- }
-
- if (creatureId == NPC_MAYBESS_RIVERBREEZE)
- {
- if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_H))
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(2849, creature->GetGUID());
- } else if (player->GetTeam() == ALLIANCE)
- player->SEND_GOSSIP_MENU(2843, creature->GetGUID());
- else
- player->SEND_GOSSIP_MENU(2842, creature->GetGUID());
- }
-
- return true;
- }
-};
-
void AddSC_felwood()
{
- new npcs_riverbreeze_and_silversky();
}
diff --git a/src/server/scripts/Kalimdor/feralas.cpp b/src/server/scripts/Kalimdor/feralas.cpp
index c1e247044f7..a3b153f5ebb 100644
--- a/src/server/scripts/Kalimdor/feralas.cpp
+++ b/src/server/scripts/Kalimdor/feralas.cpp
@@ -18,8 +18,8 @@
/* ScriptData
SDName: Feralas
-SD%Complete: 100
-SDComment: Quest support: 3520, 2767, Special vendor Gregan Brewspewer
+SD%Complete: 0
+SDComment: Quest support:
SDCategory: Feralas
EndScriptData */
@@ -29,221 +29,7 @@ EndScriptData */
#include "ScriptedGossip.h"
#include "SpellScript.h"
-/*######
-## npc_gregan_brewspewer
-######*/
-
-#define GOSSIP_HELLO "Buy somethin', will ya?"
-
-class npc_gregan_brewspewer : public CreatureScript
-{
-public:
- npc_gregan_brewspewer() : CreatureScript("npc_gregan_brewspewer") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
- player->SEND_GOSSIP_MENU(2434, creature->GetGUID());
- }
- if (action == GOSSIP_ACTION_TRADE)
- player->GetSession()->SendListInventory(creature->GetGUID());
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (creature->isVendor() && player->GetQuestStatus(3909) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(2433, creature->GetGUID());
- return true;
- }
-
-};
-
-/*######
-## npc_oox22fe
-######*/
-
-enum OOX
-{
- //signed for 7806
- SAY_OOX_START = -1000287,
- SAY_OOX_AGGRO1 = -1000288,
- SAY_OOX_AGGRO2 = -1000289,
- SAY_OOX_AMBUSH = -1000290,
- SAY_OOX_END = -1000292,
-
- NPC_YETI = 7848,
- NPC_GORILLA = 5260,
- NPC_WOODPAW_REAVER = 5255,
- NPC_WOODPAW_BRUTE = 5253,
- NPC_WOODPAW_ALPHA = 5258,
- NPC_WOODPAW_MYSTIC = 5254,
-
- QUEST_RESCUE_OOX22FE = 2767,
- FACTION_ESCORTEE_A = 774,
- FACTION_ESCORTEE_H = 775
-};
-
-class npc_oox22fe : public CreatureScript
-{
-public:
- npc_oox22fe() : CreatureScript("npc_oox22fe") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
- {
- if (quest->GetQuestId() == QUEST_RESCUE_OOX22FE)
- {
- DoScriptText(SAY_OOX_START, creature);
- //change that the npc is not lying dead on the ground
- creature->SetStandState(UNIT_STAND_STATE_STAND);
-
- if (player->GetTeam() == ALLIANCE)
- creature->setFaction(FACTION_ESCORTEE_A);
-
- if (player->GetTeam() == HORDE)
- creature->setFaction(FACTION_ESCORTEE_H);
-
- if (npc_escortAI* pEscortAI = CAST_AI(npc_oox22fe::npc_oox22feAI, creature->AI()))
- pEscortAI->Start(true, false, player->GetGUID());
-
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_oox22feAI(creature);
- }
-
- struct npc_oox22feAI : public npc_escortAI
- {
- npc_oox22feAI(Creature* creature) : npc_escortAI(creature) { }
-
- void WaypointReached(uint32 waypointId)
- {
- switch (waypointId)
- {
- // First Ambush(3 Yetis)
- case 11:
- DoScriptText(SAY_OOX_AMBUSH, me);
- me->SummonCreature(NPC_YETI, -4841.01f, 1593.91f, 73.42f, 3.98f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
- me->SummonCreature(NPC_YETI, -4837.61f, 1568.58f, 78.21f, 3.13f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
- me->SummonCreature(NPC_YETI, -4841.89f, 1569.95f, 76.53f, 0.68f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
- break;
- //Second Ambush(3 Gorillas)
- case 21:
- DoScriptText(SAY_OOX_AMBUSH, me);
- me->SummonCreature(NPC_GORILLA, -4595.81f, 2005.99f, 53.08f, 3.74f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
- me->SummonCreature(NPC_GORILLA, -4597.53f, 2008.31f, 52.70f, 3.78f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
- me->SummonCreature(NPC_GORILLA, -4599.37f, 2010.59f, 52.77f, 3.84f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
- break;
- //Third Ambush(4 Gnolls)
- case 30:
- DoScriptText(SAY_OOX_AMBUSH, me);
- me->SummonCreature(NPC_WOODPAW_REAVER, -4425.14f, 2075.87f, 47.77f, 3.77f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
- me->SummonCreature(NPC_WOODPAW_BRUTE, -4426.68f, 2077.98f, 47.57f, 3.77f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
- me->SummonCreature(NPC_WOODPAW_MYSTIC, -4428.33f, 2080.24f, 47.43f, 3.87f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
- me->SummonCreature(NPC_WOODPAW_ALPHA, -4430.04f, 2075.54f, 46.83f, 3.81f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
- break;
- case 37:
- DoScriptText(SAY_OOX_END, me);
- // Award quest credit
- if (Player* player = GetPlayerForEscort())
- player->GroupEventHappens(QUEST_RESCUE_OOX22FE, me);
- break;
- }
- }
-
- void Reset()
- {
- if (!HasEscortState(STATE_ESCORT_ESCORTING))
- me->SetStandState(UNIT_STAND_STATE_DEAD);
- }
-
- void EnterCombat(Unit* /*who*/)
- {
- //For an small probability the npc says something when he get aggro
- if (urand(0, 9) > 7)
- DoScriptText(RAND(SAY_OOX_AGGRO1, SAY_OOX_AGGRO2), me);
- }
-
- void JustSummoned(Creature* summoned)
- {
- summoned->AI()->AttackStart(me);
- }
- };
-
-};
-
-/*######
-## npc_screecher_spirit
-######*/
-
-class npc_screecher_spirit : public CreatureScript
-{
-public:
- npc_screecher_spirit() : CreatureScript("npc_screecher_spirit") { }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- player->SEND_GOSSIP_MENU(2039, creature->GetGUID());
- player->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
-
- return true;
- }
-
-};
-
-enum GordunniTrap
-{
- GO_GORDUNNI_DIRT_MOUND = 144064,
-};
-
-class spell_gordunni_trap : public SpellScriptLoader
-{
- public:
- spell_gordunni_trap() : SpellScriptLoader("spell_gordunni_trap") { }
-
- class spell_gordunni_trap_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_gordunni_trap_SpellScript);
-
- void HandleDummy()
- {
- if (Unit* caster = GetCaster())
- if (GameObject* chest = caster->SummonGameObject(GO_GORDUNNI_DIRT_MOUND, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0))
- chest->SetSpellId(GetSpellInfo()->Id);
- }
-
- void Register()
- {
- OnCast += SpellCastFn(spell_gordunni_trap_SpellScript::HandleDummy);
- }
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_gordunni_trap_SpellScript();
- }
-};
-
-/*######
-## AddSC
-######*/
-
void AddSC_feralas()
{
- new npc_gregan_brewspewer();
- new npc_oox22fe();
- new npc_screecher_spirit();
- new spell_gordunni_trap();
+
}
diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp
index 3c8d2267903..3afed715c09 100644
--- a/src/server/scripts/Kalimdor/moonglade.cpp
+++ b/src/server/scripts/Kalimdor/moonglade.cpp
@@ -18,17 +18,13 @@
/* ScriptData
SDName: Moonglade
-SD%Complete: 100
-SDComment: Quest support: 30, 272, 5929, 5930, 10965. Special Flight Paths for Druid class.
+SD%Complete: 0
+SDComment: Quest support:
SDCategory: Moonglade
EndScriptData */
/* ContentData
-npc_bunthen_plainswind
-npc_great_bear_spirit
-npc_silva_filnaveth
-npc_clintar_spirit
-npc_clintar_dreamwalker
+npc_omen
EndContentData */
#include "ScriptMgr.h"
@@ -36,539 +32,6 @@ EndContentData */
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
-/*######
-## npc_bunthen_plainswind
-######*/
-
-enum Bunthen
-{
- QUEST_SEA_LION_HORDE = 30,
- QUEST_SEA_LION_ALLY = 272,
- TAXI_PATH_ID_ALLY = 315,
- TAXI_PATH_ID_HORDE = 316
-};
-
-#define GOSSIP_ITEM_THUNDER "I'd like to fly to Thunder Bluff."
-#define GOSSIP_ITEM_AQ_END "Do you know where I can find Half Pendant of Aquatic Endurance?"
-
-class npc_bunthen_plainswind : public CreatureScript
-{
-public:
- npc_bunthen_plainswind() : CreatureScript("npc_bunthen_plainswind") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->CLOSE_GOSSIP_MENU();
- if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE)
- player->ActivateTaxiPathTo(TAXI_PATH_ID_HORDE);
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->SEND_GOSSIP_MENU(5373, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_GOSSIP_MENU(5376, creature->GetGUID());
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->getClass() != CLASS_DRUID)
- player->SEND_GOSSIP_MENU(4916, creature->GetGUID());
- else if (player->GetTeam() != HORDE)
- {
- if (player->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
-
- player->SEND_GOSSIP_MENU(4917, creature->GetGUID());
- }
- else if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THUNDER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- if (player->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
-
- player->SEND_GOSSIP_MENU(4918, creature->GetGUID());
- }
- return true;
- }
-
-};
-
-/*######
-## npc_great_bear_spirit
-######*/
-
-#define GOSSIP_BEAR1 "What do you represent, spirit?"
-#define GOSSIP_BEAR2 "I seek to understand the importance of strength of the body."
-#define GOSSIP_BEAR3 "I seek to understand the importance of strength of the heart."
-#define GOSSIP_BEAR4 "I have heard your words, Great Bear Spirit, and I understand. I now seek your blessings to fully learn the way of the Claw."
-
-class npc_great_bear_spirit : public CreatureScript
-{
-public:
- npc_great_bear_spirit() : CreatureScript("npc_great_bear_spirit") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(4721, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->SEND_GOSSIP_MENU(4733, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(4734, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_GOSSIP_MENU(4735, creature->GetGUID());
- if (player->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(5929);
- if (player->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE)
- player->AreaExploredOrEventHappens(5930);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- //ally or horde quest
- if (player->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
- player->SEND_GOSSIP_MENU(4719, creature->GetGUID());
- }
- else
- player->SEND_GOSSIP_MENU(4718, creature->GetGUID());
-
- return true;
- }
-
-};
-
-/*######
-## npc_silva_filnaveth
-######*/
-
-#define GOSSIP_ITEM_RUTHERAN "I'd like to fly to Rut'theran Village."
-#define GOSSIP_ITEM_AQ_AGI "Do you know where I can find Half Pendant of Aquatic Agility?"
-
-class npc_silva_filnaveth : public CreatureScript
-{
-public:
- npc_silva_filnaveth() : CreatureScript("npc_silva_filnaveth") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- player->CLOSE_GOSSIP_MENU();
- if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE)
- player->ActivateTaxiPathTo(TAXI_PATH_ID_ALLY);
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- player->SEND_GOSSIP_MENU(5374, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_GOSSIP_MENU(5375, creature->GetGUID());
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->getClass() != CLASS_DRUID)
- player->SEND_GOSSIP_MENU(4913, creature->GetGUID());
- else if (player->GetTeam() != ALLIANCE)
- {
- if (player->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
-
- player->SEND_GOSSIP_MENU(4915, creature->GetGUID());
- }
- else if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RUTHERAN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- if (player->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
-
- player->SEND_GOSSIP_MENU(4914, creature->GetGUID());
- }
- return true;
- }
-
-};
-
-/*######
-## npc_clintar_spirit
-######*/
-
-float const Clintar_spirit_WP[41][5] =
-{
- //pos_x pos_y pos_z orien waitTime
- {7465.28f, -3115.46f, 439.327f, 0.83f, 4000},
- {7476.49f, -3101, 443.457f, 0.89f, 0},
- {7486.57f, -3085.59f, 439.478f, 1.07f, 0},
- {7472.19f, -3085.06f, 443.142f, 3.07f, 0},
- {7456.92f, -3085.91f, 438.862f, 3.24f, 0},
- {7446.68f, -3083.43f, 438.245f, 2.40f, 0},
- {7446.17f, -3080.21f, 439.826f, 1.10f, 6000},
- {7452.41f, -3085.8f, 438.984f, 5.78f, 0},
- {7469.11f, -3084.94f, 443.048f, 6.25f, 0},
- {7483.79f, -3085.44f, 439.607f, 6.25f, 0},
- {7491.14f, -3090.96f, 439.983f, 5.44f, 0},
- {7497.62f, -3098.22f, 436.854f, 5.44f, 0},
- {7498.72f, -3113.41f, 434.596f, 4.84f, 0},
- {7500.06f, -3122.51f, 434.749f, 5.17f, 0},
- {7504.96f, -3131.53f, 434.475f, 4.74f, 0},
- {7504.31f, -3133.53f, 435.693f, 3.84f, 6000},
- {7504.55f, -3133.27f, 435.476f, 0.68f, 15000},
- {7501.99f, -3126.01f, 434.93f, 1.83f, 0},
- {7490.76f, -3114.97f, 434.431f, 2.51f, 0},
- {7479.64f, -3105.51f, 431.123f, 1.83f, 0},
- {7474.63f, -3086.59f, 428.994f, 1.83f, 2000},
- {7472.96f, -3074.18f, 427.566f, 1.57f, 0},
- {7472.25f, -3063, 428.268f, 1.55f, 0},
- {7473.46f, -3054.22f, 427.588f, 0.36f, 0},
- {7475.08f, -3053.6f, 428.653f, 0.36f, 6000},
- {7474.66f, -3053.56f, 428.433f, 3.19f, 4000},
- {7471.81f, -3058.84f, 427.073f, 4.29f, 0},
- {7472.16f, -3064.91f, 427.772f, 4.95f, 0},
- {7471.56f, -3085.36f, 428.924f, 4.72f, 0},
- {7473.56f, -3093.48f, 429.294f, 5.04f, 0},
- {7478.94f, -3104.29f, 430.638f, 5.23f, 0},
- {7484.46f, -3109.61f, 432.769f, 5.79f, 0},
- {7490.23f, -3111.08f, 434.431f, 0.02f, 0},
- {7496.29f, -3108, 434.783f, 1.15f, 0},
- {7497.46f, -3100.66f, 436.191f, 1.50f, 0},
- {7495.64f, -3093.39f, 438.349f, 2.10f, 0},
- {7492.44f, -3086.01f, 440.267f, 1.38f, 0},
- {7498.26f, -3076.44f, 440.808f, 0.71f, 0},
- {7506.4f, -3067.35f, 443.64f, 0.77f, 0},
- {7518.37f, -3057.42f, 445.584f, 0.74f, 0},
- {7517.51f, -3056.3f, 444.568f, 2.49f, 4500}
-};
-
-Position const AspectRavenSummon = {7472.96f, -3074.18f, 427.566f, 0.0f};
-Position const ClintarSpiritSummon = {7459.2275f, -3122.5632f, 438.9842f, 0.8594f};
-
-enum ClintarSpirit
-{
- ASPECT_RAVEN = 22915,
-
- //from -1000292 to -1000287 are signed for 7806. but all this texts ids wrong.
- CLINTAR_SPIRIT_SAY_START = -1000286,
- CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1 = -1000287,
- CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2 = -1000288,
- CLINTAR_SPIRIT_SAY_GET_ONE = -1000289,
- CLINTAR_SPIRIT_SAY_GET_TWO = -1000290,
- CLINTAR_SPIRIT_SAY_GET_THREE = -1000291,
- CLINTAR_SPIRIT_SAY_GET_FINAL = -1000292
-};
-
-class npc_clintar_spirit : public CreatureScript
-{
-public:
- npc_clintar_spirit() : CreatureScript("npc_clintar_spirit") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_clintar_spiritAI (creature);
- }
-
- struct npc_clintar_spiritAI : public npc_escortAI
- {
- public:
- npc_clintar_spiritAI(Creature* creature) : npc_escortAI(creature)
- {
- PlayerGUID = 0;
- }
-
- uint8 Step;
- uint32 CurrWP;
- uint32 EventTimer;
- uint32 checkPlayerTimer;
-
- uint64 PlayerGUID;
-
- bool EventOnWait;
-
- void Reset()
- {
- if (!PlayerGUID)
- {
- Step = 0;
- CurrWP = 0;
- EventTimer = 0;
- PlayerGUID = 0;
- checkPlayerTimer = 1000;
- EventOnWait = false;
- }
- }
-
- void JustDied(Unit* /*killer*/)
- {
- if (!PlayerGUID)
- return;
-
- Player* player = Unit::GetPlayer(*me, PlayerGUID);
- if (player && player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE)
- {
- player->FailQuest(10965);
- PlayerGUID = 0;
- Reset();
- }
- }
-
- void EnterEvadeMode()
- {
- Player* player = Unit::GetPlayer(*me, PlayerGUID);
- if (player && player->isInCombat() && player->getAttackerForHelper())
- {
- AttackStart(player->getAttackerForHelper());
- return;
- }
- npc_escortAI::EnterEvadeMode();
- }
-
- void EnterCombat(Unit* who)
- {
- switch (urand(0, 1))
- {
- case 0: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1, me, who); break;
- case 1: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2, me, who); break;
- }
- }
-
- void StartEvent(Player* player)
- {
- if (player && player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE)
- {
- for (uint8 i = 0; i < 41; ++i)
- {
- AddWaypoint(i, Clintar_spirit_WP[i][0], Clintar_spirit_WP[i][1], Clintar_spirit_WP[i][2], (uint32)Clintar_spirit_WP[i][4]);
- }
- PlayerGUID = player->GetGUID();
- Start(true, false, PlayerGUID);
- }
- return;
- }
-
- void UpdateAI(const uint32 diff)
- {
- npc_escortAI::UpdateAI(diff);
-
- if (!PlayerGUID)
- {
- me->setDeathState(JUST_DIED);
- return;
- }
-
- if (!me->isInCombat() && !EventOnWait)
- {
- if (checkPlayerTimer <= diff)
- {
- Player* player = Unit::GetPlayer(*me, PlayerGUID);
- if (player && player->isInCombat() && player->getAttackerForHelper())
- AttackStart(player->getAttackerForHelper());
- checkPlayerTimer = 1000;
- } else checkPlayerTimer -= diff;
- }
-
- if (EventOnWait && EventTimer <= diff)
- {
-
- Player* player = Unit::GetPlayer(*me, PlayerGUID);
- if (!player || (player && player->GetQuestStatus(10965) == QUEST_STATUS_NONE))
- {
- me->setDeathState(JUST_DIED);
- return;
- }
-
- switch (CurrWP)
- {
- case 0:
- switch (Step)
- {
- case 0:
- me->Say(CLINTAR_SPIRIT_SAY_START, 0, PlayerGUID);
- EventTimer = 8000;
- Step = 1;
- break;
- case 1:
- EventOnWait = false;
- break;
- }
- break;
- case 6:
- switch (Step)
- {
- case 0:
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
- EventTimer = 5000;
- Step = 1;
- break;
- case 1:
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
- DoScriptText(CLINTAR_SPIRIT_SAY_GET_ONE, me, player);
- EventOnWait = false;
- break;
- }
- break;
- case 15:
- switch (Step)
- {
- case 0:
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
- EventTimer = 5000;
- Step = 1;
- break;
- case 1:
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
- EventOnWait = false;
- break;
- }
- break;
- case 16:
- switch (Step)
- {
- case 0:
- DoScriptText(CLINTAR_SPIRIT_SAY_GET_TWO, me, player);
- EventTimer = 15000;
- Step = 1;
- break;
- case 1:
- EventOnWait = false;
- break;
- }
- break;
- case 20:
- switch (Step)
- {
- case 0:
- if (Creature* mob = me->SummonCreature(ASPECT_RAVEN, AspectRavenSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
- {
- mob->AddThreat(me, 10000.0f);
- mob->AI()->AttackStart(me);
- }
- EventTimer = 2000;
- Step = 1;
- break;
- case 1:
- EventOnWait = false;
- break;
- }
- break;
- case 24:
- switch (Step)
- {
- case 0:
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
- EventTimer = 5000;
- Step = 1;
- break;
- case 1:
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
- EventOnWait = false;
- break;
- }
- break;
- case 25:
- switch (Step)
- {
- case 0:
- DoScriptText(CLINTAR_SPIRIT_SAY_GET_THREE, me, player);
- EventTimer = 4000;
- Step = 1;
- break;
- case 1:
- EventOnWait = false;
- break;
- }
- break;
- case 40:
- switch (Step)
- {
- case 0:
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2);
- DoScriptText(CLINTAR_SPIRIT_SAY_GET_FINAL, me, player);
- player->CompleteQuest(10965);
- EventTimer = 1500;
- Step = 1;
- break;
- case 1:
- me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
- EventTimer = 3000;
- Step = 2;
- break;
- case 2:
- player->TalkedToCreature(me->GetEntry(), me->GetGUID());
- PlayerGUID = 0;
- Reset();
- me->setDeathState(JUST_DIED);
- break;
- }
- break;
- default:
- EventOnWait = false;
- break;
- }
-
- } else if (EventOnWait) EventTimer -= diff;
- }
-
- void WaypointReached(uint32 waypointId)
- {
- CurrWP = waypointId;
- EventTimer = 0;
- Step = 0;
- EventOnWait = true;
- }
- };
-
-};
-
-/*####
-# npc_clintar_dreamwalker
-####*/
-
-enum Clintar
-{
- CLINTAR_SPIRIT = 22916
-};
-
-class npc_clintar_dreamwalker : public CreatureScript
-{
-public:
- npc_clintar_dreamwalker() : CreatureScript("npc_clintar_dreamwalker") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
- {
- if (quest->GetQuestId() == 10965)
- if (Creature* clintar_spirit = creature->SummonCreature(CLINTAR_SPIRIT, ClintarSpiritSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100000))
- CAST_AI(npc_clintar_spirit::npc_clintar_spiritAI, clintar_spirit->AI())->StartEvent(player);
- return true;
- }
-
-};
-
/*####
# npc_omen
####*/
@@ -717,11 +180,6 @@ public:
void AddSC_moonglade()
{
- new npc_bunthen_plainswind();
- new npc_great_bear_spirit();
- new npc_silva_filnaveth();
- new npc_clintar_dreamwalker();
- new npc_clintar_spirit();
new npc_omen();
new npc_giant_spotlight();
}
diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/mulgore.cpp
index 5b35688c2b8..9aea03de09d 100644
--- a/src/server/scripts/Kalimdor/mulgore.cpp
+++ b/src/server/scripts/Kalimdor/mulgore.cpp
@@ -19,14 +19,13 @@
/* ScriptData
SDName: Mulgore
SD%Complete: 100
-SDComment: Support for quest: 11129, 772
+SDComment: Support for quest: 11129, 861
SDCategory: Mulgore
EndScriptData */
/* ContentData
npc_skorn_whitecloud
npc_kyle_frenzied
-npc_plains_vision
EndContentData */
#include "ScriptMgr.h"
@@ -200,127 +199,8 @@ public:
};
-/*#####
-# npc_plains_vision
-######*/
-
-Position const wpPlainVision[50] =
-{
- {-2226.32f, -408.095f, -9.36235f, 0.0f},
- {-2203.04f, -437.212f, -5.72498f, 0.0f},
- {-2163.91f, -457.851f, -7.09049f, 0.0f},
- {-2123.87f, -448.137f, -9.29591f, 0.0f},
- {-2104.66f, -427.166f, -6.49513f, 0.0f},
- {-2101.48f, -422.826f, -5.3567f, 0.0f},
- {-2097.56f, -417.083f, -7.16716f, 0.0f},
- {-2084.87f, -398.626f, -9.88973f, 0.0f},
- {-2072.71f, -382.324f, -10.2488f, 0.0f},
- {-2054.05f, -356.728f, -6.22468f, 0.0f},
- {-2051.8f, -353.645f, -5.35791f, 0.0f},
- {-2049.08f, -349.912f, -6.15723f, 0.0f},
- {-2030.6f, -310.724f, -9.59302f, 0.0f},
- {-2002.15f, -249.308f, -10.8124f, 0.0f},
- {-1972.85f, -195.811f, -10.6316f, 0.0f},
- {-1940.93f, -147.652f, -11.7055f, 0.0f},
- {-1888.06f, -81.943f, -11.4404f, 0.0f},
- {-1837.05f, -34.0109f, -12.258f, 0.0f},
- {-1796.12f, -14.6462f, -10.3581f, 0.0f},
- {-1732.61f, -4.27746f, -10.0213f, 0.0f},
- {-1688.94f, -0.829945f, -11.7103f, 0.0f},
- {-1681.32f, 13.0313f, -9.48056f, 0.0f},
- {-1677.04f, 36.8349f, -7.10318f, 0.0f},
- {-1675.2f, 68.559f, -8.95384f, 0.0f},
- {-1676.57f, 89.023f, -9.65104f, 0.0f},
- {-1678.16f, 110.939f, -10.1782f, 0.0f},
- {-1677.86f, 128.681f, -5.73869f, 0.0f},
- {-1675.27f, 144.324f, -3.47916f, 0.0f},
- {-1671.7f, 163.169f, -1.23098f, 0.0f},
- {-1666.61f, 181.584f, 5.26145f, 0.0f},
- {-1661.51f, 196.154f, 8.95252f, 0.0f},
- {-1655.47f, 210.811f, 8.38727f, 0.0f},
- {-1647.07f, 226.947f, 5.27755f, 0.0f},
- {-1621.65f, 232.91f, 2.69579f, 0.0f},
- {-1600.23f, 237.641f, 2.98539f, 0.0f},
- {-1576.07f, 242.546f, 4.66541f, 0.0f},
- {-1554.57f, 248.494f, 6.60377f, 0.0f},
- {-1547.53f, 259.302f, 10.6741f, 0.0f},
- {-1541.7f, 269.847f, 16.4418f, 0.0f},
- {-1539.83f, 278.989f, 21.0597f, 0.0f},
- {-1540.16f, 290.219f, 27.8247f, 0.0f},
- {-1538.99f, 298.983f, 34.0032f, 0.0f},
- {-1540.38f, 307.337f, 41.3557f, 0.0f},
- {-1536.61f, 314.884f, 48.0179f, 0.0f},
- {-1532.42f, 323.277f, 55.6667f, 0.0f},
- {-1528.77f, 329.774f, 61.1525f, 0.0f},
- {-1525.65f, 333.18f, 63.2161f, 0.0f},
- {-1517.01f, 350.713f, 62.4286f, 0.0f},
- {-1511.39f, 362.537f, 62.4539f, 0.0f},
- {-1508.68f, 366.822f, 62.733f, 0.0f}
-};
-
-class npc_plains_vision : public CreatureScript
-{
-public:
- npc_plains_vision() : CreatureScript("npc_plains_vision") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_plains_visionAI (creature);
- }
-
- struct npc_plains_visionAI : public ScriptedAI
- {
- npc_plains_visionAI(Creature* creature) : ScriptedAI(creature) {}
-
- bool newWaypoint;
- uint8 WayPointId;
- uint8 amountWP;
-
- void Reset()
- {
- WayPointId = 0;
- newWaypoint = true;
- amountWP = 49;
- }
-
- void EnterCombat(Unit* /*who*/){}
-
- void MovementInform(uint32 type, uint32 id)
- {
- if (type != POINT_MOTION_TYPE)
- return;
-
- if (id < amountWP)
- {
- ++WayPointId;
- newWaypoint = true;
- }
- else
- {
- me->setDeathState(JUST_DIED);
- me->RemoveCorpse();
- }
- }
-
- void UpdateAI(const uint32 /*diff*/)
- {
- if (newWaypoint)
- {
- me->GetMotionMaster()->MovePoint(WayPointId, wpPlainVision[WayPointId]);
- newWaypoint = false;
- }
- }
- };
-
-};
-
-/*#####
-#
-######*/
-
void AddSC_mulgore()
{
new npc_skorn_whitecloud();
new npc_kyle_frenzied();
- new npc_plains_vision();
}
diff --git a/src/server/scripts/Kalimdor/orgrimmar.cpp b/src/server/scripts/Kalimdor/orgrimmar.cpp
index fca8d0f5fc5..48f0396c5fb 100644
--- a/src/server/scripts/Kalimdor/orgrimmar.cpp
+++ b/src/server/scripts/Kalimdor/orgrimmar.cpp
@@ -18,236 +18,18 @@
/* ScriptData
SDName: Orgrimmar
-SD%Complete: 100
-SDComment: Quest support: 2460, 6566
+SD%Complete: 0
+SDComment: Quest support:
SDCategory: Orgrimmar
EndScriptData */
/* ContentData
-npc_shenthul
-npc_thrall_warchief
EndContentData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
-/*######
-## npc_shenthul
-######*/
-
-enum Shenthul
-{
- QUEST_SHATTERED_SALUTE = 2460
-};
-
-class npc_shenthul : public CreatureScript
-{
-public:
- npc_shenthul() : CreatureScript("npc_shenthul") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
- {
- if (quest->GetQuestId() == QUEST_SHATTERED_SALUTE)
- {
- CAST_AI(npc_shenthul::npc_shenthulAI, creature->AI())->CanTalk = true;
- CAST_AI(npc_shenthul::npc_shenthulAI, creature->AI())->PlayerGUID = player->GetGUID();
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_shenthulAI (creature);
- }
-
- struct npc_shenthulAI : public ScriptedAI
- {
- npc_shenthulAI(Creature* creature) : ScriptedAI(creature) {}
-
- bool CanTalk;
- bool CanEmote;
- uint32 SaluteTimer;
- uint32 ResetTimer;
- uint64 PlayerGUID;
-
- void Reset()
- {
- CanTalk = false;
- CanEmote = false;
- SaluteTimer = 6000;
- ResetTimer = 0;
- PlayerGUID = 0;
- }
-
- void EnterCombat(Unit* /*who*/) {}
-
- void UpdateAI(const uint32 diff)
- {
- if (CanEmote)
- {
- if (ResetTimer <= diff)
- {
- if (Player* player = Unit::GetPlayer(*me, PlayerGUID))
- {
- if (player->GetTypeId() == TYPEID_PLAYER && player->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE)
- player->FailQuest(QUEST_SHATTERED_SALUTE);
- }
- Reset();
- } else ResetTimer -= diff;
- }
-
- if (CanTalk && !CanEmote)
- {
- if (SaluteTimer <= diff)
- {
- me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
- CanEmote = true;
- ResetTimer = 60000;
- } else SaluteTimer -= diff;
- }
-
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
-
- void ReceiveEmote(Player* player, uint32 emote)
- {
- if (emote == TEXT_EMOTE_SALUTE && player->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE)
- {
- if (CanEmote)
- {
- player->AreaExploredOrEventHappens(QUEST_SHATTERED_SALUTE);
- Reset();
- }
- }
- }
- };
-
-};
-
-/*######
-## npc_thrall_warchief
-######*/
-
-enum ThrallWarchief
-{
- QUEST_6566 = 6566,
-
- SPELL_CHAIN_LIGHTNING = 16033,
- SPELL_SHOCK = 16034
-};
-
-#define GOSSIP_HTW "Please share your wisdom with me, Warchief."
-#define GOSSIP_STW1 "What discoveries?"
-#define GOSSIP_STW2 "Usurper?"
-#define GOSSIP_STW3 "With all due respect, Warchief - why not allow them to be destroyed? Does this not strengthen our position?"
-#define GOSSIP_STW4 "I... I did not think of it that way, Warchief."
-#define GOSSIP_STW5 "I live only to serve, Warchief! My life is empty and meaningless without your guidance."
-#define GOSSIP_STW6 "Of course, Warchief!"
-
-//TODO: verify abilities/timers
-class npc_thrall_warchief : public CreatureScript
-{
-public:
- npc_thrall_warchief() : CreatureScript("npc_thrall_warchief") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(5733, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(5734, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(5735, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(5736, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
- player->SEND_GOSSIP_MENU(5737, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+6:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
- player->SEND_GOSSIP_MENU(5738, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+7:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(QUEST_6566);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(QUEST_6566) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HTW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_thrall_warchiefAI (creature);
- }
-
- struct npc_thrall_warchiefAI : public ScriptedAI
- {
- npc_thrall_warchiefAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 ChainLightningTimer;
- uint32 ShockTimer;
-
- void Reset()
- {
- ChainLightningTimer = 2000;
- ShockTimer = 8000;
- }
-
- void EnterCombat(Unit* /*who*/) {}
-
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
-
- if (ChainLightningTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING);
- ChainLightningTimer = 9000;
- } else ChainLightningTimer -= diff;
-
- if (ShockTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_SHOCK);
- ShockTimer = 15000;
- } else ShockTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
void AddSC_orgrimmar()
{
- new npc_shenthul();
- new npc_thrall_warchief();
}
diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp
index bad278f51c7..1fe945b06d4 100644
--- a/src/server/scripts/Kalimdor/silithus.cpp
+++ b/src/server/scripts/Kalimdor/silithus.cpp
@@ -19,14 +19,14 @@
/* ScriptData
SDName: Silithus
SD%Complete: 100
-SDComment: Quest support: 7785, 8304, 8507.
+SDComment: Quest support: 7785, 8304.
SDCategory: Silithus
EndScriptData */
/* ContentData
npc_highlord_demitrian
npcs_rutgar_and_frankal
-quest_a_pawn_on_the_eternal_pawn
+go_wind_stone
EndContentData */
#include "ScriptMgr.h"
@@ -224,929 +224,6 @@ public:
};
-/*####
-# quest_a_pawn_on_the_eternal_board (Defines)
-####*/
-enum EternalBoard
-{
- QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519,
-
- FACTION_HOSTILE = 14,
- FACTION_FRIENDLY = 35,
-
- C_ANACHRONOS = 15381,
- C_FANDRAL_STAGHELM = 15382,
- C_ARYGOS = 15380,
- C_MERITHRA = 15378,
- C_CAELESTRASZ = 15379,
-
- ANACHRONOS_SAY_1 = -1350000,
- ANACHRONOS_SAY_2 = -1350001,
- ANACHRONOS_SAY_3 = -1350002,
- ANACHRONOS_SAY_4 = -1350003,
- ANACHRONOS_SAY_5 = -1350004,
- ANACHRONOS_SAY_6 = -1350005,
- ANACHRONOS_SAY_7 = -1350006,
- ANACHRONOS_SAY_8 = -1350007,
- ANACHRONOS_SAY_9 = -1350008,
- ANACHRONOS_SAY_10 = -1350009,
- ANACHRONOS_EMOTE_1 = -1350010,
- ANACHRONOS_EMOTE_2 = -1350011,
- ANACHRONOS_EMOTE_3 = -1350012,
-
- FANDRAL_SAY_1 = -1350013,
- FANDRAL_SAY_2 = -1350014,
- FANDRAL_SAY_3 = -1350015,
- FANDRAL_SAY_4 = -1350016,
- FANDRAL_SAY_5 = -1350017,
- FANDRAL_SAY_6 = -1350018,
- FANDRAL_EMOTE_1 = -1350019,
- FANDRAL_EMOTE_2 = -1350020,
-
- CAELESTRASZ_SAY_1 = -1350021,
- CAELESTRASZ_SAY_2 = -1350022,
- CAELESTRASZ_YELL_1 = -1350023,
-
- ARYGOS_SAY_1 = -1350024,
- ARYGOS_YELL_1 = -1350025,
- ARYGOS_EMOTE_1 = -1350026,
-
- MERITHRA_SAY_1 = -1350027,
- MERITHRA_SAY_2 = -1350028,
- MERITHRA_YELL_1 = -1350029,
- MERITHRA_EMOTE_1 = -1350030,
-
- GO_GATE_OF_AHN_QIRAJ = 176146,
- GO_GLYPH_OF_AHN_QIRAJ = 176148,
- GO_ROOTS_OF_AHN_QIRAJ = 176147
-};
-/*#####
-# Quest: A Pawn on the Eternal Board
-#####*/
-
-/* ContentData
-A Pawn on the Eternal Board - creatures, gameobjects and defines
-mob_qiraj_war_spawn : Adds that are summoned in the Qiraj gates battle.
-npc_anachronos_the_ancient : Creature that controls the event.
-npc_anachronos_quest_trigger: controls the spawning of the BG War mobs.
-go_crystalline_tear : GameObject that begins the event and hands out quest
-TO DO: get correct spell IDs and timings for spells cast upon dragon transformations
-TO DO: Dragons should use the HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF) after transformation, but for some unknown reason it doesnt work.
-EndContentData */
-
-#define EVENT_AREA_RADIUS 65 //65yds
-#define EVENT_COOLDOWN 500000 //in ms. appear after event completed or failed (should be = Adds despawn time)
-
-struct QuestCinematic
-{
- int32 TextId;
- uint32 Creature, Timer;
-};
-
-// Creature 0 - Anachronos, 1 - Fandral, 2 - Arygos, 3 - Merithra, 4 - Caelestrasz
-static QuestCinematic EventAnim[]=
-{
- {ANACHRONOS_SAY_1, 0, 2000},
- {FANDRAL_SAY_1, 1, 4000},
- {MERITHRA_EMOTE_1, 3, 500},
- {MERITHRA_SAY_1, 3, 500},
- {ARYGOS_EMOTE_1, 2, 2000},
- {CAELESTRASZ_SAY_1, 4, 8000},
- {MERITHRA_SAY_2, 3, 6000},
- {0, 3, 2000},
- {MERITHRA_YELL_1, 3, 2500},
- {0, 3, 3000}, //Morph
- {0, 3, 4000}, //EmoteLiftoff
- {0, 3, 4000}, // spell
- {0, 3, 1250}, //fly
- {0, 3, 250}, //remove flags
- {ARYGOS_SAY_1, 2, 3000},
- {0, 3, 2000},
- {ARYGOS_YELL_1, 2, 3000},
- {0, 3, 3000}, //Morph
- {0, 3, 4000}, //EmoteLiftoff
- {0, 3, 4000}, // spell
- {0, 3, 1000}, //fly
- {0, 3, 1000}, //remove flags
- {CAELESTRASZ_SAY_2, 4, 5000},
- {0, 3, 3000},
- {CAELESTRASZ_YELL_1, 4, 3000},
- {0, 3, 3000}, //Morph
- {0, 3, 4000}, //EmoteLiftoff
- {0, 3, 2500}, // spell
- {ANACHRONOS_SAY_2, 0, 2000},
- {0, 3, 250}, //fly
- {0, 3, 25}, //remove flags
- {FANDRAL_SAY_2, 1, 3000},
- {ANACHRONOS_SAY_3, 0, 10000}, //Both run through the armies
- {0, 3, 2000}, // Sands will stop
- {0, 3, 8000}, // Summon Gate
- {ANACHRONOS_SAY_4, 0, 4000},
- {0, 0, 2000}, //spell 1-> Arcane cosmetic (Mobs freeze)
- {0, 0, 5000}, //Spell 2-> Arcane long cosmetic (barrier appears) (Barrier -> Glyphs)
- {0, 0, 7000}, //BarrieR
- {0, 0, 4000}, //Glyphs
- {ANACHRONOS_SAY_5, 0, 2000},
- {0, 0, 4000}, // Roots
- {FANDRAL_SAY_3, 1, 3000}, //Root Text
- {FANDRAL_EMOTE_1, 1, 3000}, //falls knee
- {ANACHRONOS_SAY_6, 0, 3000},
- {ANACHRONOS_SAY_7, 0, 3000},
- {ANACHRONOS_SAY_8, 0, 8000},
- {ANACHRONOS_EMOTE_1, 0, 1000}, //Give Scepter
- {FANDRAL_SAY_4, 1, 3000},
- {FANDRAL_SAY_5, 1, 3000}, //->Equip hammer~Scepter, throw it at door
- {FANDRAL_EMOTE_2, 1, 3000}, //Throw hammer at door.
- {ANACHRONOS_SAY_9, 0, 3000},
- {FANDRAL_SAY_6, 1, 3000}, //fandral goes away
- {ANACHRONOS_EMOTE_2, 0, 3000},
- {ANACHRONOS_EMOTE_3, 0, 3000},
- {0, 0, 2000},
- {0, 0, 2000},
- {0, 0, 4000},
- {ANACHRONOS_SAY_10, 0, 3000},
- {0, 0, 2000},
- {0, 0, 3000},
- {0, 0, 15000},
- {0, 0, 5000},
- {0, 0, 3500},
- {0, 0, 5000},
- {0, 0, 3500},
- {0, 0, 5000},
- {0, 0, 0}
-};
-
-//Cordinates for Spawns
-Position const SpawnLocation[] =
-{
- {-8085.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8080.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8085.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8080.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8085.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
-
- {-8085.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8080.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8085.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8080.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8085.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
-
- {-8085.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8080.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8080.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8080.0f, 1424.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8085.0f, 1422.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- // 2 waves of warriors
- {-8082.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8078.0f, 1525.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8082.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8078.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8082.0f, 1527.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
-
- {-8082.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8078.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8078.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8082.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
-
- {-8082.0f, 1523.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8078.0f, 1521.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8082.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8078.0f, 1519.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8082.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
-
- {-8082.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8078.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8078.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
- {-8082.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
-
- {-8088.0f, 1510.0f, 2.61f, 0.0f}, //Anubisath Conqueror
- {-8084.0f, 1520.0f, 2.61f, 0.0f}, //Anubisath Conqueror
- {-8088.0f, 1530.0f, 2.61f, 0.0f}, //Anubisath Conqueror
-
- {-8080.0f, 1513.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8082.0f, 1523.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8085.0f, 1518.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8082.0f, 1516.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8085.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8080.0f, 1528.0f, 2.61f, 0.0f}, //Qiraj Wasp
-
- {-8082.0f, 1513.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8079.0f, 1523.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8080.0f, 1531.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8079.0f, 1516.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8082.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Wasp
- {-8080.0f, 1518.0f, 2.61f, 0.0f}, //Qiraj Wasp
-
- {-8081.0f, 1514.0f, 2.61f, 0.0f}, //Qiraj Tank
- {-8081.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Tank
- {-8081.0f, 1526.0f, 2.61f, 0.0f}, //Qiraj Tank
- {-8081.0f, 1512.0f, 2.61f, 0.0f}, //Qiraj Tank
- {-8082.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Tank
- {-8081.0f, 1528.0f, 2.61f, 0.0f}, //Qiraj Tank
-
- {-8082.0f, 1513.0f, 2.61f, 3.141592f}, //Anubisath Conqueror
- {-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Anubisath Conqueror
- {-8082.0f, 1527.0f, 2.61f, 3.141592f}, //Anubisath Conqueror
-};
-
-struct WaveData
-{
- uint8 SpawnCount, UsedSpawnPoint;
- uint32 CreatureId, SpawnTimer, YellTimer, DespTimer;
- int32 WaveTextId;
-};
-
-static WaveData WavesInfo[5] =
-{
- {30, 0, 15423, 0, 0, 24000, 0}, // Kaldorei Soldier
- { 3, 35, 15424, 0, 0, 24000, 0}, // Anubisath Conqueror
- {12, 38, 15414, 0, 0, 24000, 0}, // Qiraji Wasps
- { 6, 50, 15422, 0, 0, 24000, 0}, // Qiraji Tanks
- {15, 15, 15423, 0, 0, 24000, 0} // Kaldorei Soldier
-
-};
-
-struct SpawnSpells
-{
- uint32 Timer1, Timer2, SpellId;
-};
-
-static SpawnSpells SpawnCast[4] =
-{
- {100000, 2000, 33652}, // Stop Time
- {38500, 300000, 28528}, // Poison Cloud
- {58000, 300000, 35871}, // Frost Debuff (need correct spell)
- {80950, 300000, 42075}, // Fire Explosion (need correct spell however this one looks cool)
-};
-/*#####
-# npc_anachronos_the_ancient
-######*/
-class npc_anachronos_the_ancient : public CreatureScript
-{
-public:
- npc_anachronos_the_ancient() : CreatureScript("npc_anachronos_the_ancient") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_anachronos_the_ancientAI(creature);
- }
-
- struct npc_anachronos_the_ancientAI : public ScriptedAI
- {
- npc_anachronos_the_ancientAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 AnimationTimer;
- uint8 AnimationCount;
-
- uint64 AnachronosQuestTriggerGUID;
- uint64 MerithraGUID;
- uint64 ArygosGUID;
- uint64 CaelestraszGUID;
- uint64 FandralGUID;
- uint64 PlayerGUID;
- bool eventEnd;
-
- void Reset()
- {
- AnimationTimer = 1500;
- AnimationCount = 0;
- AnachronosQuestTriggerGUID = 0;
- MerithraGUID = 0;
- ArygosGUID = 0;
- CaelestraszGUID = 0;
- FandralGUID = 0;
- PlayerGUID = 0;
- eventEnd = false;
-
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
-
- void HandleAnimation()
- {
- Player* player = Unit::GetPlayer(*me, PlayerGUID);
- if (!player)
- return;
-
- Unit* Fandral = player->FindNearestCreature(C_FANDRAL_STAGHELM, 100.0f, me);
- Unit* Arygos = player->FindNearestCreature(C_ARYGOS, 100.0f, me);
- Unit* Caelestrasz = player->FindNearestCreature(C_CAELESTRASZ, 100.0f, me);
- Unit* Merithra = player->FindNearestCreature(C_MERITHRA, 100.0f, me);
-
- if (!Fandral || !Arygos || !Caelestrasz || !Merithra)
- return;
-
- AnimationTimer = EventAnim[AnimationCount].Timer;
- if (eventEnd == false)
- {
- switch (AnimationCount)
- {
- case 0:
- DoScriptText(ANACHRONOS_SAY_1, me, Fandral);
- break;
- case 1:
- Fandral->SetTarget(me->GetGUID());
- DoScriptText(FANDRAL_SAY_1, Fandral, me);
- break;
- case 2:
- Fandral->SetTarget(0);
- DoScriptText(MERITHRA_EMOTE_1, Merithra);
- break;
- case 3:
- DoScriptText(MERITHRA_SAY_1, Merithra);
- break;
- case 4:
- DoScriptText(ARYGOS_EMOTE_1, Arygos);
- break;
- case 5:
- Caelestrasz->SetTarget(Fandral->GetGUID());
- DoScriptText(CAELESTRASZ_SAY_1, Caelestrasz);
- break;
- case 6:
- DoScriptText(MERITHRA_SAY_2, Merithra);
- break;
- case 7:
- Caelestrasz->SetTarget(0);
- Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10);
- break;
- case 8:
- DoScriptText(MERITHRA_YELL_1, Merithra);
- break;
- case 9:
- Merithra->CastSpell(Merithra, 25105, true);
- break;
- case 10:
- Merithra->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- Merithra->SetDisableGravity(true);
- Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 3);
- break;
- case 11:
- Merithra->CastSpell(Merithra, 24818, false);
- break;
- case 12:
- Merithra->GetMotionMaster()->MoveCharge(-8100, 1530, 50, 42);
- break;
- case 13:
- break;
- case 14:
- DoScriptText(ARYGOS_SAY_1, Arygos);
- Merithra->SetVisible(false);
- break;
- case 15:
- Arygos->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10);
- Merithra->GetMotionMaster()->MoveCharge(-8034.535f, 1535.14f, 2.61f, 42);
- break;
- case 16:
- DoScriptText(ARYGOS_YELL_1, Arygos);
- break;
- case 17:
- Arygos->CastSpell(Arygos, 25107, true);
- break;
- case 18:
- Arygos->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- Arygos->SetDisableGravity(true);
- Arygos->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 42);
- break;
- case 19:
- Arygos->CastSpell(Arygos, 50505, false);
- break;
- case 20:
- Arygos->GetMotionMaster()->MoveCharge(-8095, 1530, 50, 42);
- break;
- case 21:
- break;
- case 22:
- DoScriptText(CAELESTRASZ_SAY_2, Caelestrasz, Fandral);
- break;
- case 23:
- Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10);
- Arygos->SetVisible(false);
- Arygos->GetMotionMaster()->MoveCharge(-8034.535f, 1535.14f, 2.61f, 10);
- break;
- case 24:
- DoScriptText(CAELESTRASZ_YELL_1, Caelestrasz);
- break;
- case 25:
- Caelestrasz->CastSpell(Caelestrasz, 25106, true);
- break;
- case 26:
- Caelestrasz->HandleEmoteCommand(254);
- Caelestrasz->SetDisableGravity(true);
- Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 7.61f, 4);
- break;
- case 27:
- Caelestrasz->CastSpell(Caelestrasz, 54293, false);
- break;
- case 28:
- DoScriptText(ANACHRONOS_SAY_2, me, Fandral);
- break;
- case 29:
- Caelestrasz->GetMotionMaster()->MoveCharge(-8095, 1530, 50, 42);
- DoScriptText(FANDRAL_SAY_2, Fandral, me);
- break;
- case 30:
- break;
- case 31:
- DoScriptText(ANACHRONOS_SAY_3, me, Fandral);
- break;
- case 32:
- Caelestrasz->SetVisible(false);
- Caelestrasz->GetMotionMaster()->MoveCharge(-8034.535f, 1535.14f, 2.61f, 42);
- Fandral->GetMotionMaster()->MoveCharge(-8108, 1529, 2.77f, 8);
- me->GetMotionMaster()->MoveCharge(-8113, 1525, 2.77f, 8);
- break;//both run to the gate
- case 33:
- DoScriptText(ANACHRONOS_SAY_4, me);
- Caelestrasz->GetMotionMaster()->MoveCharge(-8050, 1473, 65, 15);
- break; //Text: sands will stop
- case 34:
- DoCast(player, 23017, true);//Arcane Channeling
- break;
- case 35:
- me->CastSpell(-8088, 1520.43f, 2.67f, 25158, true);
- break;
- case 36:
- DoCast(player, 25159, true);
- break;
- case 37:
- me->SummonGameObject(GO_GATE_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0);
- break;
- case 38:
- DoCast(player, 25166, true);
- me->SummonGameObject(GO_GLYPH_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0);
- break;
- case 39:
- DoScriptText(ANACHRONOS_SAY_5, me, Fandral);
- break;
- case 40:
- Fandral->CastSpell(me, 25167, true);
- break;
- case 41:
- Fandral->SummonGameObject(GO_ROOTS_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0);
- DoScriptText(FANDRAL_SAY_3, Fandral);
- break;
- case 42:
- me->CastStop();
- DoScriptText(FANDRAL_EMOTE_1, Fandral);
- break;
- case 43:
- Fandral->CastStop();
- break;
- case 44:
- DoScriptText(ANACHRONOS_SAY_6, me);
- break;
- case 45:
- DoScriptText(ANACHRONOS_SAY_7, me);
- break;
- case 46:
- DoScriptText(ANACHRONOS_SAY_8, me);
- me->GetMotionMaster()->MoveCharge(-8110, 1527, 2.77f, 4);
- break;
- case 47:
- DoScriptText(ANACHRONOS_EMOTE_1, me);
- break;
- case 48:
- DoScriptText(FANDRAL_SAY_4, Fandral, me);
- break;
- case 49:
- DoScriptText(FANDRAL_SAY_5, Fandral, me);
- break;
- case 50:
- DoScriptText(FANDRAL_EMOTE_2, Fandral);
- Fandral->CastSpell(-8127, 1525, 17.5f, 33806, true);
- break;
- case 51:
- {
- uint32 entries[4] = { 15423, 15424, 15414, 15422 };
- Unit* mob = NULL;
- for (uint8 i = 0; i < 4; ++i)
- {
- mob = player->FindNearestCreature(entries[i], 50, me);
- while (mob)
- {
- mob->RemoveFromWorld();
- mob = player->FindNearestCreature(15423, 50, me);
- }
- }
- break;
- }
- case 52:
- Fandral->GetMotionMaster()->MoveCharge(-8028.75f, 1538.795f, 2.61f, 4);
- DoScriptText(ANACHRONOS_SAY_9, me, Fandral);
- break;
- case 53:
- DoScriptText(FANDRAL_SAY_6, Fandral);
- break;
- case 54:
- DoScriptText(ANACHRONOS_EMOTE_2, me);
- break;
- case 55:
- Fandral->SetVisible(false);
- break;
- case 56:
- DoScriptText(ANACHRONOS_EMOTE_3, me);
- me->GetMotionMaster()->MoveCharge(-8116, 1522, 3.65f, 4);
- break;
- case 57:
- me->GetMotionMaster()->MoveCharge(-8116.7f, 1527, 3.7f, 4);
- break;
- case 58:
- me->GetMotionMaster()->MoveCharge(-8112.67f, 1529.9f, 2.86f, 4);
- break;
- case 59:
- me->GetMotionMaster()->MoveCharge(-8117.99f, 1532.24f, 3.94f, 4);
- break;
- case 60:
- if (player)
- DoScriptText(ANACHRONOS_SAY_10, me, player);
- me->GetMotionMaster()->MoveCharge(-8113.46f, 1524.16f, 2.89f, 4);
- break;
- case 61:
- me->GetMotionMaster()->MoveCharge(-8057.1f, 1470.32f, 2.61f, 6);
- if (player->IsInRange(me, 0, 15))
- player->GroupEventHappens(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD, me);
- break;
- case 62:
- me->SetDisplayId(15500);
- break;
- case 63:
- me->HandleEmoteCommand(254);
- me->SetDisableGravity(true);
- break;
- case 64:
- me->GetMotionMaster()->MoveCharge(-8000, 1400, 150, 9);
- break;
- case 65:
- me->SetVisible(false);
- if (Creature* AnachronosQuestTrigger = (Unit::GetCreature(*me, AnachronosQuestTriggerGUID)))
- {
- DoScriptText(ARYGOS_YELL_1, me);
- AnachronosQuestTrigger->AI()->EnterEvadeMode();
- eventEnd=true;
- }
- break;
- }
- }
- ++AnimationCount;
- }
- void UpdateAI(const uint32 diff)
- {
- if (AnimationTimer)
- {
- if (AnimationTimer <= diff)
- HandleAnimation();
- else AnimationTimer -= diff;
- }
- if (AnimationCount < 65)
- me->CombatStop();
- if (AnimationCount == 65 || eventEnd)
- me->AI()->EnterEvadeMode();
- }
- };
-
-};
-
-/*######
-# mob_qiraj_war_spawn
-######*/
-
-class mob_qiraj_war_spawn : public CreatureScript
-{
-public:
- mob_qiraj_war_spawn() : CreatureScript("mob_qiraj_war_spawn") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_qiraj_war_spawnAI(creature);
- }
-
- struct mob_qiraj_war_spawnAI : public ScriptedAI
- {
- mob_qiraj_war_spawnAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint64 MobGUID;
- uint64 PlayerGUID;
- uint32 SpellTimer1, SpellTimer2, SpellTimer3, SpellTimer4;
- bool Timers;
- bool hasTarget;
-
- void Reset()
- {
- MobGUID = 0;
- PlayerGUID = 0;
- Timers = false;
- hasTarget = false;
- }
-
- void EnterCombat(Unit* /*who*/) {}
- void JustDied(Unit* /*slayer*/);
-
- void UpdateAI(const uint32 diff)
- {
- if (!Timers)
- {
- if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) //all but Kaldorei Soldiers
- {
- SpellTimer1 = SpawnCast[1].Timer1;
- SpellTimer2 = SpawnCast[2].Timer1;
- SpellTimer3 = SpawnCast[3].Timer1;
- }
- if (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
- SpellTimer4 = SpawnCast[0].Timer1;
- Timers = true;
- }
- if (me->GetEntry() == 15424 || me->GetEntry() == 15422|| me->GetEntry() == 15414)
- {
- if (SpellTimer1 <= diff)
- {
- DoCast(me, SpawnCast[1].SpellId);
- DoCast(me, 24319);
- SpellTimer1 = SpawnCast[1].Timer2;
- } else SpellTimer1 -= diff;
- if (SpellTimer2 <= diff)
- {
- DoCast(me, SpawnCast[2].SpellId);
- SpellTimer2 = SpawnCast[2].Timer2;
- } else SpellTimer2 -= diff;
- if (SpellTimer3 <= diff)
- {
- DoCast(me, SpawnCast[3].SpellId);
- SpellTimer3 = SpawnCast[3].Timer2;
- } else SpellTimer3 -= diff;
- }
- if (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
- {
- if (SpellTimer4 <= diff)
- {
- me->RemoveAllAttackers();
- me->AttackStop();
- DoCast(me, 15533);
- SpellTimer4 = SpawnCast[0].Timer2;
- } else SpellTimer4 -= diff;
- }
- if (!hasTarget)
- {
- Unit* target = NULL;
- if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
- target = me->FindNearestCreature(15423, 20, true);
- if (me->GetEntry() == 15423)
- {
- uint8 tar = urand(0, 2);
-
- if (tar == 0)
- target = me->FindNearestCreature(15422, 20, true);
- else if (tar == 1)
- target = me->FindNearestCreature(15424, 20, true);
- else if (tar == 2)
- target = me->FindNearestCreature(15414, 20, true);
- }
- hasTarget = true;
- if (target)
- me->AI()->AttackStart(target);
- }
- if (!(me->FindNearestCreature(15379, 60)))
- DoCast(me, 33652);
-
- if (!UpdateVictim())
- {
- hasTarget = false;
- return;
- }
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
-/*#####
-# npc_anachronos_quest_trigger
-#####*/
-
-class npc_anachronos_quest_trigger : public CreatureScript
-{
-public:
- npc_anachronos_quest_trigger() : CreatureScript("npc_anachronos_quest_trigger") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_anachronos_quest_triggerAI(creature);
- }
-
- struct npc_anachronos_quest_triggerAI : public ScriptedAI
- {
- npc_anachronos_quest_triggerAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint64 PlayerGUID;
-
- uint32 WaveTimer;
- uint32 AnnounceTimer;
-
- int8 LiveCount;
- uint8 WaveCount;
-
- bool EventStarted;
- bool Announced;
- bool Failed;
-
- void Reset()
- {
- PlayerGUID = 0;
-
- WaveTimer = 2000;
- AnnounceTimer = 1000;
- LiveCount = 0;
- WaveCount = 0;
-
- EventStarted = false;
- Announced = false;
- Failed = false;
-
- me->SetVisible(false);
- }
-
- void SummonNextWave()
- {
- uint8 locIndex = WavesInfo[WaveCount].UsedSpawnPoint;
- uint8 count = locIndex + WavesInfo[WaveCount].SpawnCount;
-
- for (uint8 i = locIndex; i <= count; ++i)
- {
- uint32 desptimer = WavesInfo[WaveCount].DespTimer;
-
- if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, SpawnLocation[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer))
- {
- if (spawn->GetEntry() == 15423)
- spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15427+rand()%4);
- if (i >= 30) WaveCount = 1;
- if (i >= 33) WaveCount = 2;
- if (i >= 45) WaveCount = 3;
- if (i >= 51) WaveCount = 4;
-
- if (WaveCount < 5) //1-4 Wave
- {
- if (mob_qiraj_war_spawn::mob_qiraj_war_spawnAI* spawnAI = CAST_AI(mob_qiraj_war_spawn::mob_qiraj_war_spawnAI, spawn->AI()))
- {
- spawnAI->MobGUID = me->GetGUID();
- spawnAI->PlayerGUID = PlayerGUID;
- }
- }
- }
- }
-
- WaveTimer = WavesInfo[WaveCount].SpawnTimer;
- AnnounceTimer = WavesInfo[WaveCount].YellTimer;
- }
-
- void CheckEventFail()
- {
- Player* player = Unit::GetPlayer(*me, PlayerGUID);
-
- if (!player)
- return;
-
- if (Group* EventGroup = player->GetGroup())
- {
- Player* groupMember;
-
- uint8 GroupMemberCount = 0;
- uint8 DeadMemberCount = 0;
- uint8 FailedMemberCount = 0;
-
- Group::MemberSlotList const members = EventGroup->GetMemberSlots();
-
- for (Group::member_citerator itr = members.begin(); itr!= members.end(); ++itr)
- {
- groupMember = (Unit::GetPlayer(*me, itr->guid));
- if (!groupMember)
- continue;
- if (!groupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && groupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE)
- {
- groupMember->FailQuest(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD);
- ++FailedMemberCount;
- }
- ++GroupMemberCount;
-
- if (groupMember->isDead())
- ++DeadMemberCount;
- }
-
- if (GroupMemberCount == FailedMemberCount || !player->IsWithinDistInMap(me, EVENT_AREA_RADIUS))
- Failed = true; //only so event can restart
- }
- }
-
- void LiveCounter()
- {
- --LiveCount;
- if (!LiveCount)
- Announced = false;
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (!PlayerGUID || !EventStarted)
- return;
-
- if (WaveCount < 4)
- {
- if (!Announced && AnnounceTimer <= diff)
- {
- DoScriptText(WavesInfo[WaveCount].WaveTextId, me);
- Announced = true;
- } else AnnounceTimer -= diff;
-
- if (WaveTimer <= diff)
- SummonNextWave();
- else WaveTimer -= diff;
- }
- CheckEventFail();
- if (WaveCount == 4 || Failed)
- EnterEvadeMode();
- };
- };
-
-};
-
-void mob_qiraj_war_spawn::mob_qiraj_war_spawnAI::JustDied(Unit* /*slayer*/)
-{
- me->RemoveCorpse();
-
- if (!MobGUID)
- return;
-
- if (Creature* mob = Unit::GetCreature(*me, MobGUID))
- if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, mob->AI()))
- triggerAI->LiveCounter();
-
-};
-
-/*#####
-# go_crystalline_tear
-######*/
-
-class go_crystalline_tear : public GameObjectScript
-{
-public:
- go_crystalline_tear() : GameObjectScript("go_crystalline_tear") { }
-
- bool OnQuestAccept(Player* player, GameObject* go, Quest const* quest)
- {
- if (quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD)
- {
- if (Creature* trigger = go->FindNearestCreature(15454, 100, player))
- {
- Unit* Merithra = trigger->SummonCreature(15378, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
- Unit* Caelestrasz = trigger->SummonCreature(15379, -8032.767f, 1533.148f, 2.61f, 1.5f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
- Unit* Arygos = trigger->SummonCreature(15380, -8034.52f, 1537.843f, 2.61f, 5.7f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
- /* Unit* Fandral = */ trigger->SummonCreature(15382, -8028.462f, 1535.843f, 2.61f, 3.141592f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
- Creature* Anachronos = trigger->SummonCreature(15381, -8028.75f, 1538.795f, 2.61f, 4, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000);
-
- if (Merithra)
- {
- Merithra->SetUInt32Value(UNIT_NPC_FLAGS, 0);
- Merithra->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- Merithra->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15420);
- Merithra->setFaction(35);
- }
-
- if (Caelestrasz)
- {
- Caelestrasz->SetUInt32Value(UNIT_NPC_FLAGS, 0);
- Caelestrasz->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- Caelestrasz->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15419);
- Caelestrasz->setFaction(35);
- }
-
- if (Arygos)
- {
- Arygos->SetUInt32Value(UNIT_NPC_FLAGS, 0);
- Arygos->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- Arygos->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15418);
- Arygos->setFaction(35);
- }
-
- if (Anachronos)
- {
- if (npc_anachronos_the_ancient::npc_anachronos_the_ancientAI* anachronosAI = CAST_AI(npc_anachronos_the_ancient::npc_anachronos_the_ancientAI, Anachronos->AI()))
- anachronosAI->PlayerGUID = player->GetGUID();
-
- if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, trigger->AI()))
- {
- triggerAI->Failed = false;
- triggerAI->PlayerGUID = player->GetGUID();
- triggerAI->EventStarted = true;
- triggerAI->Announced = true;
- }
- }
- }
- }
- return true;
- }
-
-};
-
/*###
## go_wind_stone
###*/
@@ -1504,10 +581,6 @@ class go_wind_stone : public GameObjectScript
void AddSC_silithus()
{
- new go_crystalline_tear();
- new npc_anachronos_quest_trigger();
- new npc_anachronos_the_ancient();
- new mob_qiraj_war_spawn();
new npc_highlord_demitrian();
new npcs_rutgar_and_frankal();
new go_wind_stone();
diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp
index d38395c7b37..2ac9903aa18 100644
--- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp
+++ b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp
@@ -18,14 +18,12 @@
/* ScriptData
SDName: Stonetalon_Mountains
-SD%Complete: 95
-SDComment: Quest support: 6627, 6523
+SD%Complete: 0
+SDComment: Quest support:
SDCategory: Stonetalon Mountains
EndScriptData */
/* ContentData
-npc_braug_dimspirit
-npc_kaya_flathoof
EndContentData */
#include "ScriptMgr.h"
@@ -33,146 +31,6 @@ EndContentData */
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
-/*######
-## npc_braug_dimspirit
-######*/
-
-#define GOSSIP_HBD1 "Ysera"
-#define GOSSIP_HBD2 "Neltharion"
-#define GOSSIP_HBD3 "Nozdormu"
-#define GOSSIP_HBD4 "Alexstrasza"
-#define GOSSIP_HBD5 "Malygos"
-
-class npc_braug_dimspirit : public CreatureScript
-{
-public:
- npc_braug_dimspirit() : CreatureScript("npc_braug_dimspirit") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- player->CLOSE_GOSSIP_MENU();
- creature->CastSpell(player, 6766, false);
-
- }
- if (action == GOSSIP_ACTION_INFO_DEF+2)
- {
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(6627);
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(6627) == QUEST_STATUS_INCOMPLETE)
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(5820, creature->GetGUID());
- }
- else
- player->SEND_GOSSIP_MENU(5819, creature->GetGUID());
-
- return true;
- }
-
-};
-
-/*######
-## npc_kaya_flathoof
-######*/
-
-enum Kaya
-{
- FACTION_ESCORTEE_H = 775,
-
- NPC_GRIMTOTEM_RUFFIAN = 11910,
- NPC_GRIMTOTEM_BRUTE = 11912,
- NPC_GRIMTOTEM_SORCERER = 11913,
-
- SAY_START = -1000357,
- SAY_AMBUSH = -1000358,
- SAY_END = -1000359,
-
- QUEST_PROTECT_KAYA = 6523
-};
-
-class npc_kaya_flathoof : public CreatureScript
-{
-public:
- npc_kaya_flathoof() : CreatureScript("npc_kaya_flathoof") { }
-
- struct npc_kaya_flathoofAI : public npc_escortAI
- {
- npc_kaya_flathoofAI(Creature* creature) : npc_escortAI(creature) {}
-
- void WaypointReached(uint32 waypointId)
- {
- Player* player = GetPlayerForEscort();
- if (!player)
- return;
-
- switch (waypointId)
- {
- case 16:
- DoScriptText(SAY_AMBUSH, me);
- me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53f, -503.34f, -46.31f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
- break;
- case 18:
- me->SetInFront(player);
- DoScriptText(SAY_END, me, player);
- player->GroupEventHappens(QUEST_PROTECT_KAYA, me);
- break;
- }
- }
-
- void JustSummoned(Creature* summoned)
- {
- summoned->AI()->AttackStart(me);
- }
-
- void Reset(){}
- };
-
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
- {
- if (quest->GetQuestId() == QUEST_PROTECT_KAYA)
- {
- if (npc_escortAI* pEscortAI = CAST_AI(npc_kaya_flathoof::npc_kaya_flathoofAI, creature->AI()))
- pEscortAI->Start(true, false, player->GetGUID());
-
- DoScriptText(SAY_START, creature);
- creature->setFaction(113);
- creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_kaya_flathoofAI(creature);
- }
-
-};
-
-/*######
-## AddSC
-######*/
-
void AddSC_stonetalon_mountains()
{
- new npc_braug_dimspirit();
- new npc_kaya_flathoof();
}
diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp
index 417c8b338c7..7053f48c851 100644
--- a/src/server/scripts/Kalimdor/tanaris.cpp
+++ b/src/server/scripts/Kalimdor/tanaris.cpp
@@ -19,18 +19,14 @@
/* ScriptData
SDName: Tanaris
SD%Complete: 80
-SDComment: Quest support: 648, 1560, 2954, 4005, 10277, 10279(Special flight path). Noggenfogger vendor
+SDComment: Quest support: 648, 10277, 10279(Special flight path).
SDCategory: Tanaris
EndScriptData */
/* ContentData
-mob_aquementas
npc_custodian_of_time
-npc_marin_noggenfogger
npc_steward_of_time
-npc_stone_watcher_of_norgannon
npc_OOX17
-npc_tooga
EndContentData */
#include "ScriptMgr.h"
@@ -40,111 +36,6 @@ EndContentData */
#include "ScriptedFollowerAI.h"
/*######
-## mob_aquementas
-######*/
-
-enum Aquementas
-{
- AGGRO_YELL_AQUE = -1000350,
-
- SPELL_AQUA_JET = 13586,
- SPELL_FROST_SHOCK = 15089
-};
-
-class mob_aquementas : public CreatureScript
-{
-public:
- mob_aquementas() : CreatureScript("mob_aquementas") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new mob_aquementasAI (creature);
- }
-
- struct mob_aquementasAI : public ScriptedAI
- {
- mob_aquementasAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 SendItemTimer;
- uint32 SwitchFactionTimer;
- bool isFriendly;
-
- uint32 FrostShockTimer;
- uint32 AquaJetTimer;
-
- void Reset()
- {
- SendItemTimer = 0;
- SwitchFactionTimer = 10000;
- me->setFaction(35);
- isFriendly = true;
-
- AquaJetTimer = 5000;
- FrostShockTimer = 1000;
- }
-
- void SendItem(Unit* receiver)
- {
- if (CAST_PLR(receiver)->HasItemCount(11169, 1, false) &&
- CAST_PLR(receiver)->HasItemCount(11172, 11, false) &&
- CAST_PLR(receiver)->HasItemCount(11173, 1, false) &&
- !CAST_PLR(receiver)->HasItemCount(11522, 1, true))
- {
- ItemPosCountVec dest;
- uint8 msg = CAST_PLR(receiver)->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 11522, 1, NULL);
- if (msg == EQUIP_ERR_OK)
- CAST_PLR(receiver)->StoreNewItem(dest, 11522, 1, true);
- }
- }
-
- void EnterCombat(Unit* who)
- {
- DoScriptText(AGGRO_YELL_AQUE, me, who);
- }
-
- void UpdateAI(const uint32 diff)
- {
- if (isFriendly)
- {
- if (SwitchFactionTimer <= diff)
- {
- me->setFaction(91);
- isFriendly = false;
- } else SwitchFactionTimer -= diff;
- }
-
- if (!UpdateVictim())
- return;
-
- if (!isFriendly)
- {
- if (SendItemTimer <= diff)
- {
- if (me->getVictim()->GetTypeId() == TYPEID_PLAYER)
- SendItem(me->getVictim());
- SendItemTimer = 5000;
- } else SendItemTimer -= diff;
- }
-
- if (FrostShockTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_FROST_SHOCK);
- FrostShockTimer = 15000;
- } else FrostShockTimer -= diff;
-
- if (AquaJetTimer <= diff)
- {
- DoCast(me, SPELL_AQUA_JET);
- AquaJetTimer = 15000;
- } else AquaJetTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
-/*######
## npc_custodian_of_time
######*/
@@ -277,39 +168,6 @@ public:
};
/*######
-## npc_marin_noggenfogger
-######*/
-
-class npc_marin_noggenfogger : public CreatureScript
-{
-public:
- npc_marin_noggenfogger() : CreatureScript("npc_marin_noggenfogger") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_TRADE)
- player->GetSession()->SendListInventory(creature->GetGUID());
-
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (creature->isVendor() && player->GetQuestRewardStatus(2662))
- 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;
- }
-
-};
-
-/*######
## npc_steward_of_time
######*/
@@ -356,70 +214,6 @@ public:
};
/*######
-## npc_stone_watcher_of_norgannon
-######*/
-
-#define GOSSIP_ITEM_NORGANNON_1 "What function do you serve?"
-#define GOSSIP_ITEM_NORGANNON_2 "What are the Plates of Uldum?"
-#define GOSSIP_ITEM_NORGANNON_3 "Where are the Plates of Uldum?"
-#define GOSSIP_ITEM_NORGANNON_4 "Excuse me? We've been \"reschedueled for visitations\"? What does that mean?!"
-#define GOSSIP_ITEM_NORGANNON_5 "So, what's inside Uldum?"
-#define GOSSIP_ITEM_NORGANNON_6 "I will return when i have the Plates of Uldum."
-
-class npc_stone_watcher_of_norgannon : public CreatureScript
-{
-public:
- npc_stone_watcher_of_norgannon() : CreatureScript("npc_stone_watcher_of_norgannon") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- player->SEND_GOSSIP_MENU(1675, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+1:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- player->SEND_GOSSIP_MENU(1676, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+2:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- player->SEND_GOSSIP_MENU(1677, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+3:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
- player->SEND_GOSSIP_MENU(1678, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+4:
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
- player->SEND_GOSSIP_MENU(1679, creature->GetGUID());
- break;
- case GOSSIP_ACTION_INFO_DEF+5:
- player->CLOSE_GOSSIP_MENU();
- player->AreaExploredOrEventHappens(2954);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(2954) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(1674, creature->GetGUID());
-
- return true;
- }
-
-};
-
-/*######
## npc_OOX17
######*/
@@ -511,176 +305,9 @@ public:
};
};
-/*####
-# npc_tooga
-####*/
-
-enum Tooga
-{
- SAY_TOOG_THIRST = -1000391,
- SAY_TOOG_WORRIED = -1000392,
- SAY_TOOG_POST_1 = -1000393,
- SAY_TORT_POST_2 = -1000394,
- SAY_TOOG_POST_3 = -1000395,
- SAY_TORT_POST_4 = -1000396,
- SAY_TOOG_POST_5 = -1000397,
- SAY_TORT_POST_6 = -1000398,
-
- QUEST_TOOGA = 1560,
- NPC_TORTA = 6015,
-
- POINT_ID_TO_WATER = 1,
- FACTION_TOOG_ESCORTEE = 113
-};
-
-Position const ToWaterLoc = {-7032.664551f, -4906.199219f, -1.606446f, 0.0f};
-
-class npc_tooga : public CreatureScript
-{
-public:
- npc_tooga() : CreatureScript("npc_tooga") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
- {
- if (quest->GetQuestId() == QUEST_TOOGA)
- {
- if (npc_toogaAI* pToogaAI = CAST_AI(npc_tooga::npc_toogaAI, creature->AI()))
- pToogaAI->StartFollow(player, FACTION_TOOG_ESCORTEE, quest);
- }
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_toogaAI(creature);
- }
-
- struct npc_toogaAI : public FollowerAI
- {
- npc_toogaAI(Creature* creature) : FollowerAI(creature) { }
-
- uint32 CheckSpeechTimer;
- uint32 PostEventTimer;
- uint32 PhasePostEvent;
-
- uint64 TortaGUID;
-
- void Reset()
- {
- CheckSpeechTimer = 2500;
- PostEventTimer = 1000;
- PhasePostEvent = 0;
-
- TortaGUID = 0;
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- FollowerAI::MoveInLineOfSight(who);
-
- if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE | STATE_FOLLOW_POSTEVENT) && who->GetEntry() == NPC_TORTA)
- {
- if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE))
- {
- Player* player = GetLeaderForFollower();
- if (player && player->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE)
- player->GroupEventHappens(QUEST_TOOGA, me);
-
- TortaGUID = who->GetGUID();
- SetFollowComplete(true);
- }
- }
- }
-
- void MovementInform(uint32 MotionType, uint32 PointId)
- {
- FollowerAI::MovementInform(MotionType, PointId);
-
- if (MotionType != POINT_MOTION_TYPE)
- return;
-
- if (PointId == POINT_ID_TO_WATER)
- SetFollowComplete();
- }
-
- void UpdateFollowerAI(const uint32 Diff)
- {
- if (!UpdateVictim())
- {
- //we are doing the post-event, or...
- if (HasFollowState(STATE_FOLLOW_POSTEVENT))
- {
- if (PostEventTimer <= Diff)
- {
- PostEventTimer = 5000;
-
- Unit* pTorta = Unit::GetUnit(*me, TortaGUID);
- if (!pTorta || !pTorta->isAlive())
- {
- //something happened, so just complete
- SetFollowComplete();
- return;
- }
-
- switch (PhasePostEvent)
- {
- case 1:
- DoScriptText(SAY_TOOG_POST_1, me);
- break;
- case 2:
- DoScriptText(SAY_TORT_POST_2, pTorta);
- break;
- case 3:
- DoScriptText(SAY_TOOG_POST_3, me);
- break;
- case 4:
- DoScriptText(SAY_TORT_POST_4, pTorta);
- break;
- case 5:
- DoScriptText(SAY_TOOG_POST_5, me);
- break;
- case 6:
- DoScriptText(SAY_TORT_POST_6, pTorta);
- me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, ToWaterLoc);
- break;
- }
-
- ++PhasePostEvent;
- }
- else
- PostEventTimer -= Diff;
- }
- //...we are doing regular speech check
- else if (HasFollowState(STATE_FOLLOW_INPROGRESS))
- {
- if (CheckSpeechTimer <= Diff)
- {
- CheckSpeechTimer = 5000;
-
- if (urand(0, 9) > 8)
- DoScriptText(RAND(SAY_TOOG_THIRST, SAY_TOOG_WORRIED), me);
- }
- else
- CheckSpeechTimer -= Diff;
- }
-
- return;
- }
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
void AddSC_tanaris()
{
- new mob_aquementas();
new npc_custodian_of_time();
- new npc_marin_noggenfogger();
new npc_steward_of_time();
- new npc_stone_watcher_of_norgannon();
new npc_OOX17();
- new npc_tooga();
}
diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp
index f4983558b67..5b13fe9591f 100644
--- a/src/server/scripts/Kalimdor/the_barrens.cpp
+++ b/src/server/scripts/Kalimdor/the_barrens.cpp
@@ -19,16 +19,11 @@
/* ScriptData
SDName: The_Barrens
SD%Complete: 90
-SDComment: Quest support: 863, 898, 1719, 2458, 4921, 6981,
+SDComment: Quest support: 863
SDCategory: Barrens
EndScriptData */
/* ContentData
-npc_beaten_corpse
-npc_gilthares
-npc_sputtervalve
-npc_taskmaster_fizzule
-npc_twiggy_flathead
npc_wizzlecrank_shredder
EndContentData */
@@ -37,491 +32,6 @@ EndContentData */
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
-/*######
-## npc_beaten_corpse
-######*/
-
-#define GOSSIP_CORPSE "Examine corpse in detail..."
-
-enum BeatenCorpse
-{
- QUEST_LOST_IN_BATTLE = 4921
-};
-
-class npc_beaten_corpse : public CreatureScript
-{
-public:
- npc_beaten_corpse() : CreatureScript("npc_beaten_corpse") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF +1)
- {
- player->SEND_GOSSIP_MENU(3558, creature->GetGUID());
- player->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_COMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CORPSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(3557, creature->GetGUID());
- return true;
- }
-
-};
-
-/*######
-# npc_gilthares
-######*/
-
-enum Gilthares
-{
- SAY_GIL_START = -1000370,
- SAY_GIL_AT_LAST = -1000371,
- SAY_GIL_PROCEED = -1000372,
- SAY_GIL_FREEBOOTERS = -1000373,
- SAY_GIL_AGGRO_1 = -1000374,
- SAY_GIL_AGGRO_2 = -1000375,
- SAY_GIL_AGGRO_3 = -1000376,
- SAY_GIL_AGGRO_4 = -1000377,
- SAY_GIL_ALMOST = -1000378,
- SAY_GIL_SWEET = -1000379,
- SAY_GIL_FREED = -1000380,
-
- QUEST_FREE_FROM_HOLD = 898,
- AREA_MERCHANT_COAST = 391,
- FACTION_ESCORTEE = 232 //guessed, possible not needed for this quest
-};
-
-class npc_gilthares : public CreatureScript
-{
-public:
- npc_gilthares() : CreatureScript("npc_gilthares") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
- {
- if (quest->GetQuestId() == QUEST_FREE_FROM_HOLD)
- {
- creature->setFaction(FACTION_ESCORTEE);
- creature->SetStandState(UNIT_STAND_STATE_STAND);
-
- DoScriptText(SAY_GIL_START, creature, player);
-
- if (npc_giltharesAI* pEscortAI = CAST_AI(npc_gilthares::npc_giltharesAI, creature->AI()))
- pEscortAI->Start(false, false, player->GetGUID(), quest);
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_giltharesAI(creature);
- }
-
- struct npc_giltharesAI : public npc_escortAI
- {
- npc_giltharesAI(Creature* creature) : npc_escortAI(creature) { }
-
- void Reset() { }
-
- void WaypointReached(uint32 waypointId)
- {
- Player* player = GetPlayerForEscort();
- if (!player)
- return;
-
- switch (waypointId)
- {
- case 16:
- DoScriptText(SAY_GIL_AT_LAST, me, player);
- break;
- case 17:
- DoScriptText(SAY_GIL_PROCEED, me, player);
- break;
- case 18:
- DoScriptText(SAY_GIL_FREEBOOTERS, me, player);
- break;
- case 37:
- DoScriptText(SAY_GIL_ALMOST, me, player);
- break;
- case 47:
- DoScriptText(SAY_GIL_SWEET, me, player);
- break;
- case 53:
- DoScriptText(SAY_GIL_FREED, me, player);
- player->GroupEventHappens(QUEST_FREE_FROM_HOLD, me);
- break;
- }
- }
-
- void EnterCombat(Unit* who)
- {
- //not always use
- if (rand()%4)
- return;
-
- //only aggro text if not player and only in this area
- if (who->GetTypeId() != TYPEID_PLAYER && me->GetAreaId() == AREA_MERCHANT_COAST)
- {
- //appears to be pretty much random (possible only if escorter not in combat with who yet?)
- DoScriptText(RAND(SAY_GIL_AGGRO_1, SAY_GIL_AGGRO_2, SAY_GIL_AGGRO_3, SAY_GIL_AGGRO_4), me, who);
- }
- }
- };
-
-};
-
-/*######
-## npc_sputtervalve
-######*/
-
-#define GOSSIP_SPUTTERVALVE "Can you tell me about this shard?"
-
-class npc_sputtervalve : public CreatureScript
-{
-public:
- npc_sputtervalve() : CreatureScript("npc_sputtervalve") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF)
- {
- player->SEND_GOSSIP_MENU(2013, creature->GetGUID());
- player->AreaExploredOrEventHappens(6981);
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(6981) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SPUTTERVALVE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
-
-};
-
-/*######
-## npc_taskmaster_fizzule
-######*/
-
-enum TaskmasterFizzule
-{
- FACTION_FRIENDLY_F = 35,
- SPELL_FLARE = 10113,
- SPELL_FOLLY = 10137,
-};
-
-class npc_taskmaster_fizzule : public CreatureScript
-{
-public:
- npc_taskmaster_fizzule() : CreatureScript("npc_taskmaster_fizzule") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_taskmaster_fizzuleAI(creature);
- }
-
- struct npc_taskmaster_fizzuleAI : public ScriptedAI
- {
- npc_taskmaster_fizzuleAI(Creature* creature) : ScriptedAI(creature)
- {
- factionNorm = creature->getFaction();
- }
-
- uint32 factionNorm;
- bool IsFriend;
- uint32 ResetTimer;
- uint8 FlareCount;
-
- void Reset()
- {
- IsFriend = false;
- ResetTimer = 120000;
- FlareCount = 0;
- me->setFaction(factionNorm);
- }
-
- void DoFriend()
- {
- me->RemoveAllAuras();
- me->DeleteThreatList();
- me->CombatStop(true);
-
- me->StopMoving();
- me->GetMotionMaster()->MoveIdle();
-
- me->setFaction(FACTION_FRIENDLY_F);
- me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
- }
-
- void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
- {
- if (spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY)
- {
- ++FlareCount;
-
- if (FlareCount >= 2)
- IsFriend = true;
- }
- }
-
- void EnterCombat(Unit* /*who*/) {}
-
- void UpdateAI(const uint32 diff)
- {
- if (IsFriend)
- {
- if (ResetTimer <= diff)
- {
- EnterEvadeMode();
- return;
- } else ResetTimer -= diff;
- }
-
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
-
- void ReceiveEmote(Player* /*player*/, uint32 emote)
- {
- if (emote == TEXT_EMOTE_SALUTE)
- {
- if (FlareCount >= 2)
- {
- if (me->getFaction() == FACTION_FRIENDLY_F)
- return;
-
- DoFriend();
- }
- }
- }
- };
-
-};
-
-/*#####
-## npc_twiggy_flathead
-#####*/
-
-enum TwiggyFlathead
-{
- NPC_BIG_WILL = 6238,
- NPC_AFFRAY_CHALLENGER = 6240,
-
- SAY_BIG_WILL_READY = -1000123,
- SAY_TWIGGY_FLATHEAD_BEGIN = -1000124,
- SAY_TWIGGY_FLATHEAD_FRAY = -1000125,
- SAY_TWIGGY_FLATHEAD_DOWN = -1000126,
- SAY_TWIGGY_FLATHEAD_OVER = -1000127,
-};
-
-Position const AffrayChallengerLoc[6] =
-{
- {-1683.0f, -4326.0f, 2.79f, 0.0f},
- {-1682.0f, -4329.0f, 2.79f, 0.0f},
- {-1683.0f, -4330.0f, 2.79f, 0.0f},
- {-1680.0f, -4334.0f, 2.79f, 1.49f},
- {-1674.0f, -4326.0f, 2.79f, 3.49f},
- {-1677.0f, -4334.0f, 2.79f, 1.66f}
-};
-
-class npc_twiggy_flathead : public CreatureScript
-{
-public:
- npc_twiggy_flathead() : CreatureScript("npc_twiggy_flathead") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_twiggy_flatheadAI (creature);
- }
-
- struct npc_twiggy_flatheadAI : public ScriptedAI
- {
- npc_twiggy_flatheadAI(Creature* creature) : ScriptedAI(creature) {}
-
- bool EventInProgress;
- bool EventGrate;
- bool EventBigWill;
- bool ChallengerDown[6];
- uint8 Wave;
- uint32 WaveTimer;
- uint32 ChallengerChecker;
- uint64 PlayerGUID;
- uint64 AffrayChallenger[6];
- uint64 BigWill;
-
- void Reset()
- {
- EventInProgress = false;
- EventGrate = false;
- EventBigWill = false;
- WaveTimer = 600000;
- ChallengerChecker = 0;
- Wave = 0;
- PlayerGUID = 0;
-
- for (uint8 i = 0; i < 6; ++i)
- {
- AffrayChallenger[i] = 0;
- ChallengerDown[i] = false;
- }
- BigWill = 0;
- }
-
- void EnterCombat(Unit* /*who*/) { }
-
- void MoveInLineOfSight(Unit* who)
- {
- if (!who || (!who->isAlive()))
- return;
-
- if (me->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress)
- {
- PlayerGUID = who->GetGUID();
- EventInProgress = true;
- }
- }
-
- void KilledUnit(Unit* /*victim*/) { }
-
- void UpdateAI(const uint32 diff)
- {
- if (EventInProgress) {
- Player* pWarrior = NULL;
-
- if (PlayerGUID)
- pWarrior = Unit::GetPlayer(*me, PlayerGUID);
-
- if (!pWarrior)
- return;
-
- if (!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) {
- DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me);
- pWarrior->FailQuest(1719);
-
- for (uint8 i = 0; i < 6; ++i) // unsummon challengers
- {
- if (AffrayChallenger[i])
- {
- Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]);
- if (creature && creature->isAlive())
- creature->DisappearAndDie();
- }
- }
-
- if (BigWill) // unsummon bigWill
- {
- Creature* creature = Unit::GetCreature((*me), BigWill);
- if (creature && creature->isAlive())
- creature->DisappearAndDie();
- }
- Reset();
- }
-
- if (!EventGrate && EventInProgress)
- {
- float x, y, z;
- pWarrior->GetPosition(x, y, z);
-
- if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) {
- pWarrior->AreaExploredOrEventHappens(1719);
- DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, me, pWarrior);
-
- for (uint8 i = 0; i < 6; ++i)
- {
- Creature* creature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
- if (!creature)
- continue;
- creature->setFaction(35);
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
- AffrayChallenger[i] = creature->GetGUID();
- }
- WaveTimer = 5000;
- ChallengerChecker = 1000;
- EventGrate = true;
- }
- }
- else if (EventInProgress)
- {
- if (ChallengerChecker <= diff)
- {
- for (uint8 i = 0; i < 6; ++i)
- {
- if (AffrayChallenger[i])
- {
- Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]);
- if ((!creature || (!creature->isAlive())) && !ChallengerDown[i])
- {
- DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me);
- ChallengerDown[i] = true;
- }
- }
- }
- ChallengerChecker = 1000;
- } else ChallengerChecker -= diff;
-
- if (WaveTimer <= diff)
- {
- if (Wave < 6 && AffrayChallenger[Wave] && !EventBigWill)
- {
- DoScriptText(SAY_TWIGGY_FLATHEAD_FRAY, me);
- Creature* creature = Unit::GetCreature((*me), AffrayChallenger[Wave]);
- if (creature && (creature->isAlive()))
- {
- creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
- creature->setFaction(14);
- creature->AI()->AttackStart(pWarrior);
- ++Wave;
- WaveTimer = 20000;
- }
- }
- else if (Wave >= 6 && !EventBigWill) {
- if (Creature* creature = me->SummonCreature(NPC_BIG_WILL, -1722, -4341, 6.12f, 6.26f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000))
- {
- BigWill = creature->GetGUID();
- //creature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32f);
- //creature->GetMotionMaster()->MovePoint(1, -1684, -4333, 2.78f);
- creature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79f);
- creature->HandleEmoteCommand(EMOTE_STATE_READY_UNARMED);
- EventBigWill = true;
- WaveTimer = 1000;
- }
- }
- else if (Wave >= 6 && EventBigWill && BigWill)
- {
- Creature* creature = Unit::GetCreature((*me), BigWill);
- if (!creature || !creature->isAlive())
- {
- DoScriptText(SAY_TWIGGY_FLATHEAD_OVER, me);
- Reset();
- }
- }
- } else WaveTimer -= diff;
- }
- }
- }
- };
-
-};
-
/*#####
## npc_wizzlecrank_shredder
#####*/
@@ -687,10 +197,5 @@ public:
void AddSC_the_barrens()
{
- new npc_beaten_corpse();
- new npc_gilthares();
- new npc_sputtervalve();
- new npc_taskmaster_fizzule();
- new npc_twiggy_flathead();
new npc_wizzlecrank_shredder();
}
diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/thousand_needles.cpp
index b9ae356ddf1..2abef548a94 100644
--- a/src/server/scripts/Kalimdor/thousand_needles.cpp
+++ b/src/server/scripts/Kalimdor/thousand_needles.cpp
@@ -18,18 +18,12 @@
/* ScriptData
SDName: Thousand Needles
-SD%Complete: 100
-SDComment: Support for Quest: 1950, 4770, 4904, 4966, 5151.
+SD%Complete: 0
+SDComment: Support for Quest:
SDCategory: Thousand Needles
EndScriptData */
/* ContentData
-npc_kanati
-npc_lakota_windsong
-npc_swiftmountain
-npc_plucky
-npc_enraged_panther
-go_panther_cage
EndContentData */
#include "ScriptMgr.h"
@@ -37,425 +31,7 @@ EndContentData */
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
-/*#####
-# npc_kanati
-######*/
-
-enum Kanati
-{
- SAY_KAN_START = -1000410,
-
- QUEST_PROTECT_KANATI = 4966,
- NPC_GALAK_ASS = 10720
-};
-
-Position const GalakLoc = {-4867.387695f, -1357.353760f, -48.226f, 0.0f};
-
-class npc_kanati : public CreatureScript
-{
-public:
- npc_kanati() : CreatureScript("npc_kanati") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
- {
- if (quest->GetQuestId() == QUEST_PROTECT_KANATI)
- if (npc_kanatiAI* pEscortAI = CAST_AI(npc_kanati::npc_kanatiAI, creature->AI()))
- pEscortAI->Start(false, false, player->GetGUID(), quest, true);
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_kanatiAI(creature);
- }
-
- struct npc_kanatiAI : public npc_escortAI
- {
- npc_kanatiAI(Creature* creature) : npc_escortAI(creature) { }
-
- void Reset() {}
-
- void WaypointReached(uint32 waypointId)
- {
- switch (waypointId)
- {
- case 0:
- DoScriptText(SAY_KAN_START, me);
- DoSpawnGalak();
- break;
- case 1:
- if (Player* player = GetPlayerForEscort())
- player->GroupEventHappens(QUEST_PROTECT_KANATI, me);
- break;
- }
- }
-
- void DoSpawnGalak()
- {
- for (int i = 0; i < 3; ++i)
- me->SummonCreature(NPC_GALAK_ASS, GalakLoc, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- }
-
- void JustSummoned(Creature* summoned)
- {
- summoned->AI()->AttackStart(me);
- }
- };
-
-};
-
-/*######
-# npc_lakota_windsong
-######*/
-
-enum Lakota
-{
- SAY_LAKO_START = -1000365,
- SAY_LAKO_LOOK_OUT = -1000366,
- SAY_LAKO_HERE_COME = -1000367,
- SAY_LAKO_MORE = -1000368,
- SAY_LAKO_END = -1000369,
-
- QUEST_FREE_AT_LAST = 4904,
- NPC_GRIM_BANDIT = 10758,
- FACTION_ESCORTEE_LAKO = 232, //guessed
-
- ID_AMBUSH_1 = 0,
- ID_AMBUSH_2 = 2,
- ID_AMBUSH_3 = 4
-};
-
-Position const BanditLoc[6] =
-{
- {-4905.479492f, -2062.732666f, 84.352f, 0.0f},
- {-4915.201172f, -2073.528320f, 84.733f, 0.0f},
- {-4878.883301f, -1986.947876f, 91.966f, 0.0f},
- {-4877.503906f, -1966.113403f, 91.859f, 0.0f},
- {-4767.985352f, -1873.169189f, 90.192f, 0.0f},
- {-4788.861328f, -1888.007813f, 89.888f, 0.0f}
-};
-
-class npc_lakota_windsong : public CreatureScript
-{
-public:
- npc_lakota_windsong() : CreatureScript("npc_lakota_windsong") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
- {
- if (quest->GetQuestId() == QUEST_FREE_AT_LAST)
- {
- DoScriptText(SAY_LAKO_START, creature, player);
- creature->setFaction(FACTION_ESCORTEE_LAKO);
-
- if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsong::npc_lakota_windsongAI, creature->AI()))
- pEscortAI->Start(false, false, player->GetGUID(), quest);
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_lakota_windsongAI(creature);
- }
-
- struct npc_lakota_windsongAI : public npc_escortAI
- {
- npc_lakota_windsongAI(Creature* creature) : npc_escortAI(creature) { }
-
- void Reset() {}
-
- void WaypointReached(uint32 waypointId)
- {
- switch (waypointId)
- {
- case 8:
- DoScriptText(SAY_LAKO_LOOK_OUT, me);
- DoSpawnBandits(ID_AMBUSH_1);
- break;
- case 14:
- DoScriptText(SAY_LAKO_HERE_COME, me);
- DoSpawnBandits(ID_AMBUSH_2);
- break;
- case 21:
- DoScriptText(SAY_LAKO_MORE, me);
- DoSpawnBandits(ID_AMBUSH_3);
- break;
- case 45:
- if (Player* player = GetPlayerForEscort())
- player->GroupEventHappens(QUEST_FREE_AT_LAST, me);
- break;
- }
- }
-
- void DoSpawnBandits(int AmbushId)
- {
- for (int i = 0; i < 2; ++i)
- me->SummonCreature(NPC_GRIM_BANDIT, BanditLoc[i+AmbushId], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
- }
- };
-
-};
-
-/*######
-# npc_paoka_swiftmountain
-######*/
-
-enum Packa
-{
- SAY_START = -1000362,
- SAY_WYVERN = -1000363,
- SAY_COMPLETE = -1000364,
-
- QUEST_HOMEWARD = 4770,
- NPC_WYVERN = 4107,
- FACTION_ESCORTEE = 232 //guessed
-};
-
-Position const WyvernLoc[3] =
-{
- {-4990.606f, -906.057f, -5.343f, 0.0f},
- {-4970.241f, -927.378f, -4.951f, 0.0f},
- {-4985.364f, -952.528f, -5.199f, 0.0f}
-};
-
-class npc_paoka_swiftmountain : public CreatureScript
-{
-public:
- npc_paoka_swiftmountain() : CreatureScript("npc_paoka_swiftmountain") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
- {
- if (quest->GetQuestId() == QUEST_HOMEWARD)
- {
- DoScriptText(SAY_START, creature, player);
- creature->setFaction(FACTION_ESCORTEE);
-
- if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountain::npc_paoka_swiftmountainAI, creature->AI()))
- pEscortAI->Start(false, false, player->GetGUID(), quest);
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_paoka_swiftmountainAI(creature);
- }
-
- struct npc_paoka_swiftmountainAI : public npc_escortAI
- {
- npc_paoka_swiftmountainAI(Creature* creature) : npc_escortAI(creature) { }
-
- void Reset() {}
-
- void WaypointReached(uint32 waypointId)
- {
- switch (waypointId)
- {
- case 15:
- DoScriptText(SAY_WYVERN, me);
- DoSpawnWyvern();
- break;
- case 26:
- DoScriptText(SAY_COMPLETE, me);
- break;
- case 27:
- if (Player* player = GetPlayerForEscort())
- player->GroupEventHappens(QUEST_HOMEWARD, me);
- break;
- }
- }
-
- void DoSpawnWyvern()
- {
- for (int i = 0; i < 3; ++i)
- me->SummonCreature(NPC_WYVERN, WyvernLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
- }
- };
-};
-
-/*#####
-# npc_plucky
-######*/
-
-#define GOSSIP_P "Please tell me the Phrase.."
-
-enum Plucky
-{
- FACTION_FRIENDLY = 35,
- QUEST_SCOOP = 1950,
- SPELL_PLUCKY_HUMAN = 9192,
- SPELL_PLUCKY_CHICKEN = 9220
-};
-
-class npc_plucky : public CreatureScript
-{
-public:
- npc_plucky() : CreatureScript("npc_plucky") { }
-
- bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- player->CLOSE_GOSSIP_MENU();
- player->CompleteQuest(QUEST_SCOOP);
- break;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_P, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(738, creature->GetGUID());
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_pluckyAI(creature);
- }
-
- struct npc_pluckyAI : public ScriptedAI
- {
- npc_pluckyAI(Creature* creature) : ScriptedAI(creature) { NormFaction = creature->getFaction(); }
-
- uint32 NormFaction;
- uint32 ResetTimer;
-
- void Reset()
- {
- ResetTimer = 120000;
-
- if (me->getFaction() != NormFaction)
- me->setFaction(NormFaction);
-
- if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- DoCast(me, SPELL_PLUCKY_CHICKEN, false);
- }
-
- void ReceiveEmote(Player* player, uint32 TextEmote)
- {
- if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE)
- {
- if (TextEmote == TEXT_EMOTE_BECKON)
- {
- me->setFaction(FACTION_FRIENDLY);
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- DoCast(me, SPELL_PLUCKY_HUMAN, false);
- }
- }
-
- if (TextEmote == TEXT_EMOTE_CHICKEN)
- {
- if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
- return;
- else
- {
- me->setFaction(FACTION_FRIENDLY);
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- DoCast(me, SPELL_PLUCKY_HUMAN, false);
- me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
- }
- }
- }
-
- void UpdateAI(const uint32 Diff)
- {
- if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
- {
- if (ResetTimer <= Diff)
- {
- if (!me->getVictim())
- EnterEvadeMode();
- else
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
-
- return;
- }
- else
- ResetTimer -= Diff;
- }
-
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
-
-enum PantherCage
-{
- ENRAGED_PANTHER = 10992
-};
-
-class go_panther_cage : public GameObjectScript
-{
-public:
- go_panther_cage() : GameObjectScript("go_panther_cage") { }
-
- bool OnGossipHello(Player* player, GameObject* go)
- {
- if (player->GetQuestStatus(5151) == QUEST_STATUS_INCOMPLETE)
- {
- if (Creature* panther = go->FindNearestCreature(ENRAGED_PANTHER, 5, true))
- {
- panther->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- panther->SetReactState(REACT_AGGRESSIVE);
- panther->AI()->AttackStart(player);
- }
- }
-
- return true;
- }
-};
-
-class npc_enraged_panther : public CreatureScript
-{
-public:
- npc_enraged_panther() : CreatureScript("npc_enraged_panther") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_enraged_pantherAI(creature);
- }
-
- struct npc_enraged_pantherAI : public ScriptedAI
- {
- npc_enraged_pantherAI(Creature* creature) : ScriptedAI(creature) {}
-
- void Reset()
- {
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->SetReactState(REACT_PASSIVE);
- }
-
- void UpdateAI(const uint32 /*diff*/)
- {
- if (!UpdateVictim())
- return;
-
- DoMeleeAttackIfReady();
- }
- };
-
-};
void AddSC_thousand_needles()
{
- new npc_kanati();
- new npc_lakota_windsong();
- new npc_paoka_swiftmountain();
- new npc_plucky();
- new npc_enraged_panther();
- new go_panther_cage();
}
diff --git a/src/server/scripts/Kalimdor/thunder_bluff.cpp b/src/server/scripts/Kalimdor/thunder_bluff.cpp
index b8b05b9692f..4feca5929b5 100644
--- a/src/server/scripts/Kalimdor/thunder_bluff.cpp
+++ b/src/server/scripts/Kalimdor/thunder_bluff.cpp
@@ -47,30 +47,6 @@ class npc_cairne_bloodhoof : public CreatureScript
public:
npc_cairne_bloodhoof() : CreatureScript("npc_cairne_bloodhoof") { }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_SENDER_INFO)
- {
- player->CastSpell(player, 23123, false);
- player->SEND_GOSSIP_MENU(7014, creature->GetGUID());
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (creature->isQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (player->GetQuestStatus(925) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HCB, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO);
-
- player->SEND_GOSSIP_MENU(7013, creature->GetGUID());
-
- return true;
- }
-
CreatureAI* GetAI(Creature* creature) const
{
return new npc_cairne_bloodhoofAI (creature);
diff --git a/src/server/scripts/Kalimdor/ungoro_crater.cpp b/src/server/scripts/Kalimdor/ungoro_crater.cpp
index 786d2fc0cd3..d8d6acf3605 100644
--- a/src/server/scripts/Kalimdor/ungoro_crater.cpp
+++ b/src/server/scripts/Kalimdor/ungoro_crater.cpp
@@ -18,14 +18,12 @@
/* ScriptData
SDName: Ungoro Crater
-SD%Complete: 100
-SDComment: Support for Quest: 4245, 4491
+SD%Complete: 0
+SDComment: Support for Quest:
SDCategory: Ungoro Crater
EndScriptData */
/* ContentData
-npc_a-me
-npc_ringo
EndContentData */
#include "ScriptMgr.h"
@@ -33,321 +31,6 @@ EndContentData */
#include "ScriptedEscortAI.h"
#include "ScriptedFollowerAI.h"
-enum AmeData
-{
- SAY_READY = -1000517,
- SAY_AGGRO1 = -1000518,
- SAY_SEARCH = -1000519,
- SAY_AGGRO2 = -1000520,
- SAY_AGGRO3 = -1000521,
- SAY_FINISH = -1000522,
-
- SPELL_DEMORALIZINGSHOUT = 13730,
-
- QUEST_CHASING_AME = 4245,
- ENTRY_TARLORD = 6519,
- ENTRY_TARLORD1 = 6519,
- ENTRY_STOMPER = 6513,
-};
-
-class npc_ame : public CreatureScript
-{
-public:
- npc_ame() : CreatureScript("npc_ame") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
- {
- if (quest->GetQuestId() == QUEST_CHASING_AME)
- {
- CAST_AI(npc_escortAI, (creature->AI()))->Start(false, false, player->GetGUID());
- DoScriptText(SAY_READY, creature, player);
- creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- // Change faction so mobs attack
- creature->setFaction(113);
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_ameAI(creature);
- }
-
- struct npc_ameAI : public npc_escortAI
- {
- npc_ameAI(Creature* creature) : npc_escortAI(creature) {}
-
- uint32 DemoralizingShoutTimer;
-
- void WaypointReached(uint32 waypointId)
- {
- if (Player* player = GetPlayerForEscort())
- {
- switch (waypointId)
- {
- case 19:
- me->SummonCreature(ENTRY_STOMPER, -6391.69f, -1730.49f, -272.83f, 4.96f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- DoScriptText(SAY_AGGRO1, me, player);
- break;
- case 28:
- DoScriptText(SAY_SEARCH, me, player);
- break;
- case 38:
- me->SummonCreature(ENTRY_TARLORD, -6370.75f, -1382.84f, -270.51f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- DoScriptText(SAY_AGGRO2, me, player);
- break;
- case 49:
- me->SummonCreature(ENTRY_TARLORD1, -6324.44f, -1181.05f, -270.17f, 4.34f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- DoScriptText(SAY_AGGRO3, me, player);
- break;
- case 55:
- DoScriptText(SAY_FINISH, me, player);
- player->GroupEventHappens(QUEST_CHASING_AME, me);
- break;
- }
- }
- }
-
- void Reset()
- {
- DemoralizingShoutTimer = 5000;
- }
-
- void JustSummoned(Creature* summoned)
- {
- summoned->AI()->AttackStart(me);
- }
-
- void JustDied(Unit* /*killer*/)
- {
- if (Player* player = GetPlayerForEscort())
- player->FailQuest(QUEST_CHASING_AME);
- }
-
- void UpdateAI(const uint32 diff)
- {
- npc_escortAI::UpdateAI(diff);
- if (!UpdateVictim())
- return;
-
- if (DemoralizingShoutTimer <= diff)
- {
- DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT);
- DemoralizingShoutTimer = 70000;
- } else DemoralizingShoutTimer -= diff;
- }
- };
-};
-
-/*####
-# npc_ringo
-####*/
-
-enum Ringo
-{
- SAY_RIN_START_1 = -1000416,
- SAY_RIN_START_2 = -1000417,
-
- SAY_FAINT_1 = -1000418,
- SAY_FAINT_2 = -1000419,
- SAY_FAINT_3 = -1000420,
- SAY_FAINT_4 = -1000421,
-
- SAY_WAKE_1 = -1000422,
- SAY_WAKE_2 = -1000423,
- SAY_WAKE_3 = -1000424,
- SAY_WAKE_4 = -1000425,
-
- SAY_RIN_END_1 = -1000426,
- SAY_SPR_END_2 = -1000427,
- SAY_RIN_END_3 = -1000428,
- EMOTE_RIN_END_4 = -1000429,
- EMOTE_RIN_END_5 = -1000430,
- SAY_RIN_END_6 = -1000431, // signed for 6784
- SAY_SPR_END_7 = -1000432,
- EMOTE_RIN_END_8 = -1000433,
-
- SPELL_REVIVE_RINGO = 15591,
- QUEST_A_LITTLE_HELP = 4491,
- NPC_SPRAGGLE = 9997,
- FACTION_ESCORTEE = 113
-};
-
-class npc_ringo : public CreatureScript
-{
-public:
- npc_ringo() : CreatureScript("npc_ringo") { }
-
- bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
- {
- if (quest->GetQuestId() == QUEST_A_LITTLE_HELP)
- {
- if (npc_ringoAI* pRingoAI = CAST_AI(npc_ringo::npc_ringoAI, creature->AI()))
- {
- creature->SetStandState(UNIT_STAND_STATE_STAND);
- pRingoAI->StartFollow(player, FACTION_ESCORTEE, quest);
- }
- }
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_ringoAI(creature);
- }
-
- struct npc_ringoAI : public FollowerAI
- {
- npc_ringoAI(Creature* creature) : FollowerAI(creature) { }
-
- uint32 FaintTimer;
- uint32 EndEventProgress;
- uint32 EndEventTimer;
-
- uint64 SpraggleGUID;
-
- void Reset()
- {
- FaintTimer = urand(30000, 60000);
- EndEventProgress = 0;
- EndEventTimer = 1000;
- SpraggleGUID = 0;
- }
-
- void MoveInLineOfSight(Unit* who)
- {
- FollowerAI::MoveInLineOfSight(who);
-
- if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_SPRAGGLE)
- {
- if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE))
- {
- if (Player* player = GetLeaderForFollower())
- {
- if (player->GetQuestStatus(QUEST_A_LITTLE_HELP) == QUEST_STATUS_INCOMPLETE)
- player->GroupEventHappens(QUEST_A_LITTLE_HELP, me);
- }
-
- SpraggleGUID = who->GetGUID();
- SetFollowComplete(true);
- }
- }
- }
-
- void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell)
- {
- if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_REVIVE_RINGO)
- ClearFaint();
- }
-
- void SetFaint()
- {
- if (!HasFollowState(STATE_FOLLOW_POSTEVENT))
- {
- SetFollowPaused(true);
-
- DoScriptText(RAND(SAY_FAINT_1, SAY_FAINT_2, SAY_FAINT_3, SAY_FAINT_4), me);
- }
-
- //what does actually happen here? Emote? Aura?
- me->SetStandState(UNIT_STAND_STATE_SLEEP);
- }
-
- void ClearFaint()
- {
- me->SetStandState(UNIT_STAND_STATE_STAND);
-
- if (HasFollowState(STATE_FOLLOW_POSTEVENT))
- return;
-
- DoScriptText(RAND(SAY_WAKE_1, SAY_WAKE_2, SAY_WAKE_3, SAY_WAKE_4), me);
-
- SetFollowPaused(false);
- }
-
- void UpdateFollowerAI(const uint32 Diff)
- {
- if (!UpdateVictim())
- {
- if (HasFollowState(STATE_FOLLOW_POSTEVENT))
- {
- if (EndEventTimer <= Diff)
- {
- Unit* pSpraggle = Unit::GetUnit(*me, SpraggleGUID);
- if (!pSpraggle || !pSpraggle->isAlive())
- {
- SetFollowComplete();
- return;
- }
-
- switch (EndEventProgress)
- {
- case 1:
- DoScriptText(SAY_RIN_END_1, me);
- EndEventTimer = 3000;
- break;
- case 2:
- DoScriptText(SAY_SPR_END_2, pSpraggle);
- EndEventTimer = 5000;
- break;
- case 3:
- DoScriptText(SAY_RIN_END_3, me);
- EndEventTimer = 1000;
- break;
- case 4:
- DoScriptText(EMOTE_RIN_END_4, me);
- SetFaint();
- EndEventTimer = 9000;
- break;
- case 5:
- DoScriptText(EMOTE_RIN_END_5, me);
- ClearFaint();
- EndEventTimer = 1000;
- break;
- case 6:
- DoScriptText(SAY_RIN_END_6, me);
- EndEventTimer = 3000;
- break;
- case 7:
- DoScriptText(SAY_SPR_END_7, pSpraggle);
- EndEventTimer = 10000;
- break;
- case 8:
- DoScriptText(EMOTE_RIN_END_8, me);
- EndEventTimer = 5000;
- break;
- case 9:
- SetFollowComplete();
- break;
- }
-
- ++EndEventProgress;
- }
- else
- EndEventTimer -= Diff;
- }
- else if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !HasFollowState(STATE_FOLLOW_PAUSED))
- {
- if (FaintTimer <= Diff)
- {
- SetFaint();
- FaintTimer = urand(60000, 120000);
- }
- else
- FaintTimer -= Diff;
- }
-
- return;
- }
-
- DoMeleeAttackIfReady();
- }
- };
-};
-
void AddSC_ungoro_crater()
{
- new npc_ame();
- new npc_ringo();
}
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
index 6ba13014585..2fe97f3fb50 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
@@ -20,7 +20,6 @@
#include "SpellAuraEffects.h"
#include "Spell.h"
#include "Vehicle.h"
-#include "MapManager.h"
#include "GameObjectAI.h"
#include "ScriptedCreature.h"
#include "ruby_sanctum.h"
@@ -1016,7 +1015,7 @@ class npc_meteor_strike_initial : public CreatureScript
_meteorList.clear();
for (uint8 i = 0; i < 4; i++)
{
- angle[i] = MapManager::NormalizeOrientation(angle[i]);
+ angle[i] = Position::NormalizeOrientation(angle[i]);
me->SetOrientation(angle[i]);
me->GetNearPosition(newPos, 10.0f, 0.0f); // Exact distance
if (Creature* meteor = me->SummonCreature(NPC_METEOR_STRIKE_NORTH + i, newPos, TEMPSUMMON_TIMED_DESPAWN, 30000))
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
index f3b6078d536..0e781c6ddc0 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
@@ -131,9 +131,9 @@ bool GrandChampionsOutVehicle(Creature* me)
if (pGrandChampion1 && pGrandChampion2 && pGrandChampion3)
{
- if (!pGrandChampion1->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) &&
- !pGrandChampion2->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) &&
- !pGrandChampion3->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!pGrandChampion1->m_movementInfo.t_guid &&
+ !pGrandChampion2->m_movementInfo.t_guid &&
+ !pGrandChampion3->m_movementInfo.t_guid)
return true;
}
@@ -385,7 +385,7 @@ public:
}
}else uiPhaseTimer -= uiDiff;
- if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!UpdateVictim() || me->m_movementInfo.t_guid)
return;
if (uiInterceptTimer <= uiDiff)
@@ -529,7 +529,7 @@ public:
uiFireBallTimer = 5000;
} else uiFireBallTimer -= uiDiff;
- if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!UpdateVictim() || me->m_movementInfo.t_guid)
return;
if (uiFireBallTimer <= uiDiff)
@@ -667,7 +667,7 @@ public:
}
}else uiPhaseTimer -= uiDiff;
- if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!UpdateVictim() || me->m_movementInfo.t_guid)
return;
if (uiChainLightningTimer <= uiDiff)
@@ -813,7 +813,7 @@ public:
}
}else uiPhaseTimer -= uiDiff;
- if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!UpdateVictim() || me->m_movementInfo.t_guid)
return;
if (uiLightningArrowsTimer <= uiDiff)
@@ -961,7 +961,7 @@ public:
}
} else uiPhaseTimer -= uiDiff;
- if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!UpdateVictim() || me->m_movementInfo.t_guid)
return;
if (uiEviscerateTimer <= uiDiff)
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
index 506467be8a5..88e0fe5ba66 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
@@ -139,7 +139,7 @@ public:
{
m_uiImpaleTimer = urand(8*IN_MILLISECONDS, 10*IN_MILLISECONDS);
m_uiStaggeringStompTimer = 15*IN_MILLISECONDS;
- m_uiSummonTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);;
+ m_uiSummonTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL ||
GetDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC)
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
index 5d3a6814eb2..9017509781f 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
@@ -1244,6 +1244,7 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_deathbringer_blood_nova_targeting_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST);
+ OnEffectHitTarget += SpellEffectFn(spell_deathbringer_blood_nova_targeting_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST);
}
WorldObject* target;
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
index e2f9faf6a97..0515ba83480 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
@@ -357,7 +357,7 @@ class boss_lady_deathwhisper : public CreatureScript
void DamageTaken(Unit* /*damageDealer*/, uint32& damage)
{
// phase transition
- if (events.GetPhaseMask() & PHASE_ONE_MASK && damage > me->GetPower(POWER_MANA))
+ if (events.GetPhaseMask() & PHASE_ONE_MASK && damage > (uint32)me->GetPower(POWER_MANA))
{
Talk(SAY_PHASE_2);
Talk(EMOTE_PHASE_2);
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
index 0c5cb0aba52..89a26bde6ff 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
@@ -303,7 +303,6 @@ class npc_coldflame : public CreatureScript
{
Position const* ownerPos = marrowgarAI->GetLastColdflamePosition();
float ang = me->GetAngle(ownerPos) - static_cast<float>(M_PI);
- MapManager::NormalizeOrientation(ang);
me->SetOrientation(ang);
owner->GetNearPosition(pos, 2.5f, 0.0f);
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
index a2acf8a64da..9822146984f 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
@@ -154,7 +154,7 @@ public:
CheckPlayersFrostResist();
if (CanTheHundredClub)
{
- AchievementEntry const* AchievTheHundredClub = sAchievementStore.LookupEntry(ACHIEVEMENT_THE_HUNDRED_CLUB);
+ AchievementEntry const* AchievTheHundredClub = sAchievementMgr->GetAchievement(ACHIEVEMENT_THE_HUNDRED_CLUB);
if (AchievTheHundredClub)
{
if (map && map->IsDungeon())
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
index 6d9450daf21..5ad7375f259 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
@@ -20,7 +20,6 @@
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "oculus.h"
-#include "MapManager.h"
enum Says
{
@@ -121,7 +120,7 @@ public:
coreEnergizeOrientation = me->GetOrientation();
firstCoreEnergize = true;
} else
- coreEnergizeOrientation = MapManager::NormalizeOrientation(coreEnergizeOrientation - 2.0f);
+ coreEnergizeOrientation = Position::NormalizeOrientation(coreEnergizeOrientation - 2.0f);
DoCast(me, SPELL_ENERGIZE_CORES_VISUAL);
events.ScheduleEvent(EVENT_ENERGIZE_CORES_VISUAL, 5000);
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
index fe41e7a12dc..707ea7f138d 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
@@ -153,7 +153,7 @@ public:
if (IsHeroic() && GolemsShattered < 5)
{
- AchievementEntry const* AchievShatterResistant = sAchievementStore.LookupEntry(ACHIEVEMENT_SHATTER_RESISTANT);
+ AchievementEntry const* AchievShatterResistant = sAchievementMgr->GetAchievement(ACHIEVEMENT_SHATTER_RESISTANT);
if (AchievShatterResistant)
{
Map* map = me->GetMap();
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
index 67122b2e859..a075b480d04 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
@@ -373,7 +373,7 @@ class boss_algalon_the_observer : public CreatureScript
case ACTION_INIT_ALGALON:
_firstPull = false;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
- break;;
+ break;
}
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
index 24a9171e29f..b414a3fcdcb 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp
@@ -488,7 +488,7 @@ class spell_ulduar_squeezed_lifeless : public SpellScriptLoader
pos.m_positionX = 1756.25f + irand(-3, 3);
pos.m_positionY = -8.3f + irand(-3, 3);
pos.m_positionZ = 448.8f;
- pos.m_orientation = M_PI;
+ pos.SetOrientation(M_PI);
GetHitPlayer()->DestroyForNearbyPlayers();
GetHitPlayer()->ExitVehicle(&pos);
GetHitPlayer()->UpdateObjectVisibility(false);
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
index 7ada42144a8..79e4684f3a6 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
@@ -965,6 +965,7 @@ class spell_xt002_tympanic_tantrum : public SpellScriptLoader
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
OnHit += SpellHitFn(spell_xt002_tympanic_tantrum_SpellScript::RecalculateDamage);
+ OnHit += SpellHitFn(spell_xt002_tympanic_tantrum_SpellScript::RecalculateDamage);
}
};
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
index f2f03ff602b..3a90b6901e3 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
@@ -339,6 +339,8 @@ public:
me->GetMotionMaster()->MoveLand(0, pos);
me->SetDisableGravity(false, true);
me->SetHover(true);
+ me->SetDisableGravity(false, true);
+ me->SetHover(true);
++introPhase;
introTimer = 3000;
break;
diff --git a/src/server/scripts/OutdoorPvP/CMakeLists.txt b/src/server/scripts/OutdoorPvP/CMakeLists.txt
index 237b974aa9d..15d7dbd7e8d 100644
--- a/src/server/scripts/OutdoorPvP/CMakeLists.txt
+++ b/src/server/scripts/OutdoorPvP/CMakeLists.txt
@@ -17,8 +17,6 @@ set(scripts_STAT_SRCS
OutdoorPvP/OutdoorPvPNA.cpp
OutdoorPvP/OutdoorPvPHP.cpp
OutdoorPvP/OutdoorPvPTF.h
- OutdoorPvP/OutdoorPvPEP.h
- OutdoorPvP/OutdoorPvPEP.cpp
OutdoorPvP/OutdoorPvPHP.h
OutdoorPvP/OutdoorPvPZM.h
OutdoorPvP/OutdoorPvPNA.h
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
deleted file mode 100755
index 2a94ddb3134..00000000000
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
+++ /dev/null
@@ -1,785 +0,0 @@
-/*
- * 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/>.
- */
-
-#include "ScriptMgr.h"
-#include "OutdoorPvPEP.h"
-#include "WorldPacket.h"
-#include "Player.h"
-#include "GameObject.h"
-#include "ObjectMgr.h"
-#include "ObjectAccessor.h"
-#include "OutdoorPvPMgr.h"
-#include "Creature.h"
-#include "Language.h"
-#include "World.h"
-#include "GossipDef.h"
-
-OPvPCapturePointEP_EWT::OPvPCapturePointEP_EWT(OutdoorPvP* pvp)
-: OPvPCapturePoint(pvp), m_TowerState(EP_TS_N), m_UnitsSummonedSide(0)
-{
- SetCapturePointData(EPCapturePoints[EP_EWT].entry, EPCapturePoints[EP_EWT].map, EPCapturePoints[EP_EWT].x, EPCapturePoints[EP_EWT].y, EPCapturePoints[EP_EWT].z, EPCapturePoints[EP_EWT].o, EPCapturePoints[EP_EWT].rot0, EPCapturePoints[EP_EWT].rot1, EPCapturePoints[EP_EWT].rot2, EPCapturePoints[EP_EWT].rot3);
- AddObject(EP_EWT_FLAGS, EPTowerFlags[EP_EWT].entry, EPTowerFlags[EP_EWT].map, EPTowerFlags[EP_EWT].x, EPTowerFlags[EP_EWT].y, EPTowerFlags[EP_EWT].z, EPTowerFlags[EP_EWT].o, EPTowerFlags[EP_EWT].rot0, EPTowerFlags[EP_EWT].rot1, EPTowerFlags[EP_EWT].rot2, EPTowerFlags[EP_EWT].rot3);
-}
-
-void OPvPCapturePointEP_EWT::ChangeState()
-{
- // if changing from controlling alliance to horde or vice versa
- if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
- {
- sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_A));
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, 0);
- }
- else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
- {
- sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_H));
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, 0);
- }
-
- uint32 artkit = 21;
-
- switch (m_State)
- {
- case OBJECTIVESTATE_ALLIANCE:
- m_TowerState = EP_TS_A;
- artkit = 2;
- SummonSupportUnitAtNorthpassTower(ALLIANCE);
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, ALLIANCE);
- if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_A));
- break;
- case OBJECTIVESTATE_HORDE:
- m_TowerState = EP_TS_H;
- artkit = 1;
- SummonSupportUnitAtNorthpassTower(HORDE);
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, HORDE);
- if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_H));
- break;
- case OBJECTIVESTATE_NEUTRAL:
- m_TowerState = EP_TS_N;
- break;
- case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
- case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
- m_TowerState = EP_TS_N_A;
- break;
- case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
- case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
- m_TowerState = EP_TS_N_H;
- break;
- }
-
- GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
- GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_EWT_FLAGS]);
- if (flag)
- {
- flag->SetGoArtKit(artkit);
- }
- if (flag2)
- {
- flag2->SetGoArtKit(artkit);
- }
-
- UpdateTowerState();
-
- // complete quest objective
- if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
- SendObjectiveComplete(EP_EWT_CM, 0);
-}
-
-void OPvPCapturePointEP_EWT::SendChangePhase()
-{
- // send this too, sometimes the slider disappears, dunno why :(
- SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
- // send these updates to only the ones in this objective
- uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
- SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
- // send this too, sometimes it resets :S
- SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
-}
-
-void OPvPCapturePointEP_EWT::FillInitialWorldStates(WorldPacket &data)
-{
- data << EP_EWT_A << uint32(bool(m_TowerState & EP_TS_A));
- data << EP_EWT_H << uint32(bool(m_TowerState & EP_TS_H));
- data << EP_EWT_N_A << uint32(bool(m_TowerState & EP_TS_N_A));
- data << EP_EWT_N_H << uint32(bool(m_TowerState & EP_TS_N_H));
- data << EP_EWT_N << uint32(bool(m_TowerState & EP_TS_N));
-}
-
-void OPvPCapturePointEP_EWT::UpdateTowerState()
-{
- m_PvP->SendUpdateWorldState(EP_EWT_A, bool(m_TowerState & EP_TS_A));
- m_PvP->SendUpdateWorldState(EP_EWT_H, bool(m_TowerState & EP_TS_H));
- m_PvP->SendUpdateWorldState(EP_EWT_N_A, bool(m_TowerState & EP_TS_N_A));
- m_PvP->SendUpdateWorldState(EP_EWT_N_H, bool(m_TowerState & EP_TS_N_H));
- m_PvP->SendUpdateWorldState(EP_EWT_N, bool(m_TowerState & EP_TS_N));
-}
-
-bool OPvPCapturePointEP_EWT::HandlePlayerEnter(Player* player)
-{
- if (OPvPCapturePoint::HandlePlayerEnter(player))
- {
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
- uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
- return true;
- }
- return false;
-}
-
-void OPvPCapturePointEP_EWT::HandlePlayerLeave(Player* player)
-{
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
- OPvPCapturePoint::HandlePlayerLeave(player);
-}
-
-void OPvPCapturePointEP_EWT::SummonSupportUnitAtNorthpassTower(uint32 team)
-{
- if (m_UnitsSummonedSide != team)
- {
- m_UnitsSummonedSide = team;
- const creature_type * ct = NULL;
- if (team == ALLIANCE)
- ct=EP_EWT_Summons_A;
- else
- ct=EP_EWT_Summons_H;
-
- for (uint8 i = 0; i < EP_EWT_NUM_CREATURES; ++i)
- {
- DelCreature(i);
- AddCreature(i, ct[i].entry, ct[i].teamval, ct[i].map, ct[i].x, ct[i].y, ct[i].z, ct[i].o, 1000000);
- }
- }
-}
-
-// NPT
-OPvPCapturePointEP_NPT::OPvPCapturePointEP_NPT(OutdoorPvP* pvp)
-: OPvPCapturePoint(pvp), m_TowerState(EP_TS_N), m_SummonedGOSide(0)
-{
- SetCapturePointData(EPCapturePoints[EP_NPT].entry, EPCapturePoints[EP_NPT].map, EPCapturePoints[EP_NPT].x, EPCapturePoints[EP_NPT].y, EPCapturePoints[EP_NPT].z, EPCapturePoints[EP_NPT].o, EPCapturePoints[EP_NPT].rot0, EPCapturePoints[EP_NPT].rot1, EPCapturePoints[EP_NPT].rot2, EPCapturePoints[EP_NPT].rot3);
- AddObject(EP_NPT_FLAGS, EPTowerFlags[EP_NPT].entry, EPTowerFlags[EP_NPT].map, EPTowerFlags[EP_NPT].x, EPTowerFlags[EP_NPT].y, EPTowerFlags[EP_NPT].z, EPTowerFlags[EP_NPT].o, EPTowerFlags[EP_NPT].rot0, EPTowerFlags[EP_NPT].rot1, EPTowerFlags[EP_NPT].rot2, EPTowerFlags[EP_NPT].rot3);
-}
-
-void OPvPCapturePointEP_NPT::ChangeState()
-{
- // if changing from controlling alliance to horde or vice versa
- if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
- {
- sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_A));
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, 0);
- }
- else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
- {
- sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_H));
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, 0);
- }
-
- uint32 artkit = 21;
-
- switch (m_State)
- {
- case OBJECTIVESTATE_ALLIANCE:
- m_TowerState = EP_TS_A;
- artkit = 2;
- SummonGO(ALLIANCE);
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, ALLIANCE);
- if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_A));
- break;
- case OBJECTIVESTATE_HORDE:
- m_TowerState = EP_TS_H;
- artkit = 1;
- SummonGO(HORDE);
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, HORDE);
- if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_H));
- break;
- case OBJECTIVESTATE_NEUTRAL:
- m_TowerState = EP_TS_N;
- m_SummonedGOSide = 0;
- DelObject(EP_NPT_BUFF);
- break;
- case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
- m_TowerState = EP_TS_N_A;
- break;
- case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
- m_TowerState = EP_TS_N_A;
- m_SummonedGOSide = 0;
- DelObject(EP_NPT_BUFF);
- break;
- case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
- m_TowerState = EP_TS_N_H;
- break;
- case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
- m_TowerState = EP_TS_N_H;
- m_SummonedGOSide = 0;
- DelObject(EP_NPT_BUFF);
- break;
- }
-
- GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
- GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_NPT_FLAGS]);
- if (flag)
- {
- flag->SetGoArtKit(artkit);
- }
- if (flag2)
- {
- flag2->SetGoArtKit(artkit);
- }
-
- UpdateTowerState();
-
- // complete quest objective
- if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
- SendObjectiveComplete(EP_NPT_CM, 0);
-}
-
-void OPvPCapturePointEP_NPT::SendChangePhase()
-{
- // send this too, sometimes the slider disappears, dunno why :(
- SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
- // send these updates to only the ones in this objective
- uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
- SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
- // send this too, sometimes it resets :S
- SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
-}
-
-void OPvPCapturePointEP_NPT::FillInitialWorldStates(WorldPacket &data)
-{
- data << EP_NPT_A << uint32(bool(m_TowerState & EP_TS_A));
- data << EP_NPT_H << uint32(bool(m_TowerState & EP_TS_H));
- data << EP_NPT_N_A << uint32(bool(m_TowerState & EP_TS_N_A));
- data << EP_NPT_N_H << uint32(bool(m_TowerState & EP_TS_N_H));
- data << EP_NPT_N << uint32(bool(m_TowerState & EP_TS_N));
-}
-
-void OPvPCapturePointEP_NPT::UpdateTowerState()
-{
- m_PvP->SendUpdateWorldState(EP_NPT_A, bool(m_TowerState & EP_TS_A));
- m_PvP->SendUpdateWorldState(EP_NPT_H, bool(m_TowerState & EP_TS_H));
- m_PvP->SendUpdateWorldState(EP_NPT_N_A, bool(m_TowerState & EP_TS_N_A));
- m_PvP->SendUpdateWorldState(EP_NPT_N_H, bool(m_TowerState & EP_TS_N_H));
- m_PvP->SendUpdateWorldState(EP_NPT_N, bool(m_TowerState & EP_TS_N));
-}
-
-bool OPvPCapturePointEP_NPT::HandlePlayerEnter(Player* player)
-{
- if (OPvPCapturePoint::HandlePlayerEnter(player))
- {
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
- uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
- return true;
- }
- return false;
-}
-
-void OPvPCapturePointEP_NPT::HandlePlayerLeave(Player* player)
-{
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
- OPvPCapturePoint::HandlePlayerLeave(player);
-}
-
-void OPvPCapturePointEP_NPT::SummonGO(uint32 team)
-{
- if (m_SummonedGOSide != team)
- {
- m_SummonedGOSide = team;
- DelObject(EP_NPT_BUFF);
- AddObject(EP_NPT_BUFF, EP_NPT_LordaeronShrine.entry, EP_NPT_LordaeronShrine.map, EP_NPT_LordaeronShrine.x, EP_NPT_LordaeronShrine.y, EP_NPT_LordaeronShrine.z, EP_NPT_LordaeronShrine.o, EP_NPT_LordaeronShrine.rot0, EP_NPT_LordaeronShrine.rot1, EP_NPT_LordaeronShrine.rot2, EP_NPT_LordaeronShrine.rot3);
- GameObject* go = HashMapHolder<GameObject>::Find(m_Objects[EP_NPT_BUFF]);
- if (go)
- go->SetUInt32Value(GAMEOBJECT_FACTION, (team == ALLIANCE ? 84 : 83));
- }
-}
-
-// CGT
-OPvPCapturePointEP_CGT::OPvPCapturePointEP_CGT(OutdoorPvP* pvp)
-: OPvPCapturePoint(pvp), m_TowerState(EP_TS_N), m_GraveyardSide(0)
-{
- SetCapturePointData(EPCapturePoints[EP_CGT].entry, EPCapturePoints[EP_CGT].map, EPCapturePoints[EP_CGT].x, EPCapturePoints[EP_CGT].y, EPCapturePoints[EP_CGT].z, EPCapturePoints[EP_CGT].o, EPCapturePoints[EP_CGT].rot0, EPCapturePoints[EP_CGT].rot1, EPCapturePoints[EP_CGT].rot2, EPCapturePoints[EP_CGT].rot3);
- AddObject(EP_CGT_FLAGS, EPTowerFlags[EP_CGT].entry, EPTowerFlags[EP_CGT].map, EPTowerFlags[EP_CGT].x, EPTowerFlags[EP_CGT].y, EPTowerFlags[EP_CGT].z, EPTowerFlags[EP_CGT].o, EPTowerFlags[EP_CGT].rot0, EPTowerFlags[EP_CGT].rot1, EPTowerFlags[EP_CGT].rot2, EPTowerFlags[EP_CGT].rot3);
-}
-
-void OPvPCapturePointEP_CGT::ChangeState()
-{
- // if changing from controlling alliance to horde or vice versa
- if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
- {
- sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_A));
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, 0);
- }
- else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
- {
- sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_H));
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, 0);
- }
-
- uint32 artkit = 21;
-
- switch (m_State)
- {
- case OBJECTIVESTATE_ALLIANCE:
- m_TowerState = EP_TS_A;
- artkit = 2;
- LinkGraveYard(ALLIANCE);
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, ALLIANCE);
- if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_A));
- break;
- case OBJECTIVESTATE_HORDE:
- m_TowerState = EP_TS_H;
- artkit = 1;
- LinkGraveYard(HORDE);
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, HORDE);
- if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_H));
- break;
- case OBJECTIVESTATE_NEUTRAL:
- m_TowerState = EP_TS_N;
- break;
- case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
- case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
- m_TowerState = EP_TS_N_A;
- break;
- case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
- case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
- m_TowerState = EP_TS_N_H;
- break;
- }
-
- GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
- GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_CGT_FLAGS]);
- if (flag)
- {
- flag->SetGoArtKit(artkit);
- }
- if (flag2)
- {
- flag2->SetGoArtKit(artkit);
- }
-
- UpdateTowerState();
-
- // complete quest objective
- if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
- SendObjectiveComplete(EP_CGT_CM, 0);
-}
-
-void OPvPCapturePointEP_CGT::SendChangePhase()
-{
- // send this too, sometimes the slider disappears, dunno why :(
- SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
- // send these updates to only the ones in this objective
- uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
- SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
- // send this too, sometimes it resets :S
- SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
-}
-
-void OPvPCapturePointEP_CGT::FillInitialWorldStates(WorldPacket &data)
-{
- data << EP_CGT_A << uint32(bool(m_TowerState & EP_TS_A));
- data << EP_CGT_H << uint32(bool(m_TowerState & EP_TS_H));
- data << EP_CGT_N_A << uint32(bool(m_TowerState & EP_TS_N_A));
- data << EP_CGT_N_H << uint32(bool(m_TowerState & EP_TS_N_H));
- data << EP_CGT_N << uint32(bool(m_TowerState & EP_TS_N));
-}
-
-void OPvPCapturePointEP_CGT::UpdateTowerState()
-{
- m_PvP->SendUpdateWorldState(EP_CGT_A, bool(m_TowerState & EP_TS_A));
- m_PvP->SendUpdateWorldState(EP_CGT_H, bool(m_TowerState & EP_TS_H));
- m_PvP->SendUpdateWorldState(EP_CGT_N_A, bool(m_TowerState & EP_TS_N_A));
- m_PvP->SendUpdateWorldState(EP_CGT_N_H, bool(m_TowerState & EP_TS_N_H));
- m_PvP->SendUpdateWorldState(EP_CGT_N, bool(m_TowerState & EP_TS_N));
-}
-
-bool OPvPCapturePointEP_CGT::HandlePlayerEnter(Player* player)
-{
- if (OPvPCapturePoint::HandlePlayerEnter(player))
- {
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
- uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
- return true;
- }
- return false;
-}
-
-void OPvPCapturePointEP_CGT::HandlePlayerLeave(Player* player)
-{
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
- OPvPCapturePoint::HandlePlayerLeave(player);
-}
-
-void OPvPCapturePointEP_CGT::LinkGraveYard(uint32 team)
-{
- if (m_GraveyardSide != team)
- {
- m_GraveyardSide = team;
- sObjectMgr->RemoveGraveYardLink(EP_GraveYardId, EP_GraveYardZone, team, false);
- sObjectMgr->AddGraveYardLink(EP_GraveYardId, EP_GraveYardZone, team, false);
- }
-}
-
-// PWT
-OPvPCapturePointEP_PWT::OPvPCapturePointEP_PWT(OutdoorPvP* pvp)
-: OPvPCapturePoint(pvp), m_FlightMasterSpawned(0), m_TowerState(EP_TS_N)
-{
- SetCapturePointData(EPCapturePoints[EP_PWT].entry, EPCapturePoints[EP_PWT].map, EPCapturePoints[EP_PWT].x, EPCapturePoints[EP_PWT].y, EPCapturePoints[EP_PWT].z, EPCapturePoints[EP_PWT].o, EPCapturePoints[EP_PWT].rot0, EPCapturePoints[EP_PWT].rot1, EPCapturePoints[EP_PWT].rot2, EPCapturePoints[EP_PWT].rot3);
- AddObject(EP_PWT_FLAGS, EPTowerFlags[EP_PWT].entry, EPTowerFlags[EP_PWT].map, EPTowerFlags[EP_PWT].x, EPTowerFlags[EP_PWT].y, EPTowerFlags[EP_PWT].z, EPTowerFlags[EP_PWT].o, EPTowerFlags[EP_PWT].rot0, EPTowerFlags[EP_PWT].rot1, EPTowerFlags[EP_PWT].rot2, EPTowerFlags[EP_PWT].rot3);
-}
-
-void OPvPCapturePointEP_PWT::ChangeState()
-{
- // if changing from controlling alliance to horde or vice versa
- if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
- {
- sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_A));
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, 0);
- }
- else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
- {
- sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_H));
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, 0);
- }
-
- uint32 artkit = 21;
-
- switch (m_State)
- {
- case OBJECTIVESTATE_ALLIANCE:
- m_TowerState = EP_TS_A;
- SummonFlightMaster(ALLIANCE);
- artkit = 2;
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, ALLIANCE);
- if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_A));
- break;
- case OBJECTIVESTATE_HORDE:
- m_TowerState = EP_TS_H;
- SummonFlightMaster(HORDE);
- artkit = 1;
- ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, HORDE);
- if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_H));
- break;
- case OBJECTIVESTATE_NEUTRAL:
- m_TowerState = EP_TS_N;
- DelCreature(EP_PWT_FLIGHTMASTER);
- m_FlightMasterSpawned = 0;
- break;
- case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
- m_TowerState = EP_TS_N_A;
- break;
- case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
- m_TowerState = EP_TS_N_A;
- DelCreature(EP_PWT_FLIGHTMASTER);
- m_FlightMasterSpawned = 0;
- break;
- case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
- m_TowerState = EP_TS_N_H;
- break;
- case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
- m_TowerState = EP_TS_N_H;
- DelCreature(EP_PWT_FLIGHTMASTER);
- m_FlightMasterSpawned = 0;
- break;
- }
-
- GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID);
- GameObject* flag2 = HashMapHolder<GameObject>::Find(m_Objects[EP_PWT_FLAGS]);
- if (flag)
- {
- flag->SetGoArtKit(artkit);
- }
- if (flag2)
- {
- flag2->SetGoArtKit(artkit);
- }
-
- UpdateTowerState();
-
- // complete quest objective
- if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H)
- SendObjectiveComplete(EP_PWT_CM, 0);
-}
-
-void OPvPCapturePointEP_PWT::SendChangePhase()
-{
- // send this too, sometimes the slider disappears, dunno why :(
- SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
- // send these updates to only the ones in this objective
- uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
- SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
- // send this too, sometimes it resets :S
- SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
-}
-
-void OPvPCapturePointEP_PWT::FillInitialWorldStates(WorldPacket &data)
-{
- data << EP_PWT_A << uint32(bool(m_TowerState & EP_TS_A));
- data << EP_PWT_H << uint32(bool(m_TowerState & EP_TS_H));
- data << EP_PWT_N_A << uint32(bool(m_TowerState & EP_TS_N_A));
- data << EP_PWT_N_H << uint32(bool(m_TowerState & EP_TS_N_H));
- data << EP_PWT_N << uint32(bool(m_TowerState & EP_TS_N));
-}
-
-void OPvPCapturePointEP_PWT::UpdateTowerState()
-{
- m_PvP->SendUpdateWorldState(EP_PWT_A, bool(m_TowerState & EP_TS_A));
- m_PvP->SendUpdateWorldState(EP_PWT_H, bool(m_TowerState & EP_TS_H));
- m_PvP->SendUpdateWorldState(EP_PWT_N_A, bool(m_TowerState & EP_TS_N_A));
- m_PvP->SendUpdateWorldState(EP_PWT_N_H, bool(m_TowerState & EP_TS_N_H));
- m_PvP->SendUpdateWorldState(EP_PWT_N, bool(m_TowerState & EP_TS_N));
-}
-
-bool OPvPCapturePointEP_PWT::HandlePlayerEnter(Player* player)
-{
- if (OPvPCapturePoint::HandlePlayerEnter(player))
- {
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1);
- uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase);
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct);
- return true;
- }
- return false;
-}
-
-void OPvPCapturePointEP_PWT::HandlePlayerLeave(Player* player)
-{
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
- OPvPCapturePoint::HandlePlayerLeave(player);
-}
-
-void OPvPCapturePointEP_PWT::SummonFlightMaster(uint32 team)
-{
- if (m_FlightMasterSpawned != team)
- {
- m_FlightMasterSpawned = team;
- DelCreature(EP_PWT_FLIGHTMASTER);
- AddCreature(EP_PWT_FLIGHTMASTER, EP_PWT_FlightMaster.entry, team, EP_PWT_FlightMaster.map, EP_PWT_FlightMaster.x, EP_PWT_FlightMaster.y, EP_PWT_FlightMaster.z, EP_PWT_FlightMaster.o);
- /*
- // sky - we need update gso code
-
- Creature* c = HashMapHolder<Creature>::Find(m_Creatures[EP_PWT_FLIGHTMASTER]);
- //Spawn flight master as friendly to capturing team
- c->SetUInt32Value(GAMEOBJECT_FACTION, (team == ALLIANCE ? 55 : 68));
- if (c)
- {
- GossipOption gso;
- gso.Action = GOSSIP_OPTION_OUTDOORPVP;
- gso.GossipId = 0;
- gso.OptionText.assign(sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_NPT));
- gso.Id = 50;
- gso.Icon = 0;
- gso.NpcFlag = 0;
- gso.BoxMoney = 0;
- gso.Coded = false;
- c->addGossipOption(gso);
-
- gso.Action = GOSSIP_OPTION_OUTDOORPVP;
- gso.GossipId = 0;
- gso.OptionText.assign(sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_EWT));
- gso.Id = 50;
- gso.Icon = 0;
- gso.NpcFlag = 0;
- gso.BoxMoney = 0;
- gso.Coded = false;
- c->addGossipOption(gso);
-
- gso.Action = GOSSIP_OPTION_OUTDOORPVP;
- gso.GossipId = 0;
- gso.OptionText.assign(sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_CGT));
- gso.Id = 50;
- gso.Icon = 0;
- gso.NpcFlag = 0;
- gso.BoxMoney = 0;
- gso.Coded = false;
- c->addGossipOption(gso);
- }
- */
- }
-}
-
-// ep
-OutdoorPvPEP::OutdoorPvPEP()
-{
- m_TypeId = OUTDOOR_PVP_EP;
- memset(EP_Controls, 0, sizeof(EP_Controls));
- m_AllianceTowersControlled = 0;
- m_HordeTowersControlled = 0;
-}
-
-bool OutdoorPvPEP::SetupOutdoorPvP()
-{
- for (uint8 i = 0; i < EPBuffZonesNum; ++i)
- RegisterZone(EPBuffZones[i]);
-
- AddCapturePoint(new OPvPCapturePointEP_EWT(this));
- AddCapturePoint(new OPvPCapturePointEP_PWT(this));
- AddCapturePoint(new OPvPCapturePointEP_CGT(this));
- AddCapturePoint(new OPvPCapturePointEP_NPT(this));
- return true;
-}
-
-bool OutdoorPvPEP::Update(uint32 diff)
-{
- if (OutdoorPvP::Update(diff))
- {
- m_AllianceTowersControlled = 0;
- m_HordeTowersControlled = 0;
- for (int i = 0; i < EP_TOWER_NUM; ++i)
- {
- if (EP_Controls[i] == ALLIANCE)
- ++m_AllianceTowersControlled;
- else if (EP_Controls[i] == HORDE)
- ++m_HordeTowersControlled;
- SendUpdateWorldState(EP_UI_TOWER_COUNT_A, m_AllianceTowersControlled);
- SendUpdateWorldState(EP_UI_TOWER_COUNT_H, m_HordeTowersControlled);
- BuffTeams();
- }
- return true;
- }
- return false;
-}
-
-void OutdoorPvPEP::HandlePlayerEnterZone(Player* player, uint32 zone)
-{
- // add buffs
- if (player->GetTeam() == ALLIANCE)
- {
- if (m_AllianceTowersControlled && m_AllianceTowersControlled < 5)
- player->CastSpell(player, EP_AllianceBuffs[m_AllianceTowersControlled-1], true);
- }
- else
- {
- if (m_HordeTowersControlled && m_HordeTowersControlled < 5)
- player->CastSpell(player, EP_HordeBuffs[m_HordeTowersControlled-1], true);
- }
- OutdoorPvP::HandlePlayerEnterZone(player, zone);
-}
-
-void OutdoorPvPEP::HandlePlayerLeaveZone(Player* player, uint32 zone)
-{
- // remove buffs
- if (player->GetTeam() == ALLIANCE)
- {
- for (int i = 0; i < 4; ++i)
- player->RemoveAurasDueToSpell(EP_AllianceBuffs[i]);
- }
- else
- {
- for (int i = 0; i < 4; ++i)
- player->RemoveAurasDueToSpell(EP_HordeBuffs[i]);
- }
- OutdoorPvP::HandlePlayerLeaveZone(player, zone);
-}
-
-void OutdoorPvPEP::BuffTeams()
-{
- for (PlayerSet::iterator itr = m_players[0].begin(); itr != m_players[0].end(); ++itr)
- {
- Player* player = *itr;
- {
- for (int i = 0; i < 4; ++i)
- player->RemoveAurasDueToSpell(EP_AllianceBuffs[i]);
- if (m_AllianceTowersControlled && m_AllianceTowersControlled < 5)
- player->CastSpell(player, EP_AllianceBuffs[m_AllianceTowersControlled-1], true);
- }
- }
- for (PlayerSet::iterator itr = m_players[1].begin(); itr != m_players[1].end(); ++itr)
- {
- Player* player = *itr;
- {
- for (int i = 0; i < 4; ++i)
- player->RemoveAurasDueToSpell(EP_HordeBuffs[i]);
- if (m_HordeTowersControlled && m_HordeTowersControlled < 5)
- player->CastSpell(player, EP_HordeBuffs[m_HordeTowersControlled-1], true);
- }
- }
-}
-
-void OutdoorPvPEP::SetControlledState(uint32 index, uint32 state)
-{
- EP_Controls[index] = state;
-}
-
-void OutdoorPvPEP::FillInitialWorldStates(WorldPacket & data)
-{
- data << EP_UI_TOWER_COUNT_A << m_AllianceTowersControlled;
- data << EP_UI_TOWER_COUNT_H << m_HordeTowersControlled;
- data << EP_UI_TOWER_SLIDER_DISPLAY << uint32(0);
- data << EP_UI_TOWER_SLIDER_POS << uint32(50);
- data << EP_UI_TOWER_SLIDER_N << uint32(100);
- for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
- {
- itr->second->FillInitialWorldStates(data);
- }
-}
-
-void OutdoorPvPEP::SendRemoveWorldStates(Player* player)
-{
- player->SendUpdateWorldState(EP_UI_TOWER_COUNT_A, 0);
- player->SendUpdateWorldState(EP_UI_TOWER_COUNT_H, 0);
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0);
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, 0);
- player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, 0);
-
- player->SendUpdateWorldState(EP_EWT_A, 0);
- player->SendUpdateWorldState(EP_EWT_H, 0);
- player->SendUpdateWorldState(EP_EWT_N, 0);
- player->SendUpdateWorldState(EP_EWT_N_A, 0);
- player->SendUpdateWorldState(EP_EWT_N_H, 0);
-
- player->SendUpdateWorldState(EP_PWT_A, 0);
- player->SendUpdateWorldState(EP_PWT_H, 0);
- player->SendUpdateWorldState(EP_PWT_N, 0);
- player->SendUpdateWorldState(EP_PWT_N_A, 0);
- player->SendUpdateWorldState(EP_PWT_N_H, 0);
-
- player->SendUpdateWorldState(EP_NPT_A, 0);
- player->SendUpdateWorldState(EP_NPT_H, 0);
- player->SendUpdateWorldState(EP_NPT_N, 0);
- player->SendUpdateWorldState(EP_NPT_N_A, 0);
- player->SendUpdateWorldState(EP_NPT_N_H, 0);
-
- player->SendUpdateWorldState(EP_CGT_A, 0);
- player->SendUpdateWorldState(EP_CGT_H, 0);
- player->SendUpdateWorldState(EP_CGT_N, 0);
- player->SendUpdateWorldState(EP_CGT_N_A, 0);
- player->SendUpdateWorldState(EP_CGT_N_H, 0);
-}
-
-class OutdoorPvP_eastern_plaguelands : public OutdoorPvPScript
-{
- public:
-
- OutdoorPvP_eastern_plaguelands()
- : OutdoorPvPScript("outdoorpvp_ep")
- {
- }
-
- OutdoorPvP* GetOutdoorPvP() const
- {
- return new OutdoorPvPEP();
- }
-};
-
-void AddSC_outdoorpvp_ep()
-{
- new OutdoorPvP_eastern_plaguelands();
-}
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h
deleted file mode 100755
index 14712e0150d..00000000000
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * 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/>.
- */
-
-#ifndef OUTDOOR_PVP_EP_
-#define OUTDOOR_PVP_EP_
-
-#include "DBCStructure.h"
-#include "OutdoorPvP.h"
-
-const uint32 EP_AllianceBuffs[4] = {11413, 11414, 11415, 1386};
-
-const uint32 EP_HordeBuffs[4] = {30880, 30683, 30682, 29520};
-
-const uint32 EP_GraveYardZone = 139;
-
-const uint32 EP_GraveYardId = 927;
-
-const uint8 EPBuffZonesNum = 3;
-
-const uint32 EP_EWT_CM = 17690;
-const uint32 EP_CGT_CM = 17689;
-const uint32 EP_NPT_CM = 17696;
-const uint32 EP_PWT_CM = 17698;
-
-const uint32 EPBuffZones[EPBuffZonesNum] = {139, 2017, 2057};
-
-enum EP_TaxiNodes
-{
- EP_CGT_Taxi = 87,
- EP_EWT_Taxi = 86,
- EP_NPT_Taxi = 85,
- EP_PWT_Taxi = 84
-};
-
-enum EP_EastwallTowerWorldStates
-{
- EP_EWT_A = 2354,
- EP_EWT_H = 2356,
- EP_EWT_N_A = 2359, // ally conquested
- EP_EWT_N_H = 2360,
- EP_EWT_N = 2361
-};
-
-enum EP_NorthpassTowerWorldStates
-{
- EP_NPT_N = 2352,
- EP_NPT_N_A = 2362,
- EP_NPT_N_H = 2363,
- EP_NPT_A = 2372,
- EP_NPT_H = 2373
-};
-
-enum EP_PlagewoodTowerWorldStates
-{
- EP_PWT_N_A = 2366,
- EP_PWT_N_H = 2353, //2367 not present! use neutral!
- EP_PWT_A = 2370,
- EP_PWT_H = 2371,
- EP_PWT_N = 2353
-};
-
-enum EP_CrownGuardTowerWorldStates
-{
- EP_CGT_N_A = 2374,
- EP_CGT_N_H = 2375,
- EP_CGT_A = 2378,
- EP_CGT_H = 2379,
- EP_CGT_N = 2355
-};
-
-enum EP_WorldStates
-{
- EP_UI_TOWER_SLIDER_DISPLAY = 2426,
- EP_UI_TOWER_SLIDER_POS = 2427,
- EP_UI_TOWER_SLIDER_N = 2428,
-
- EP_UI_TOWER_COUNT_A = 2327,
- EP_UI_TOWER_COUNT_H = 2328
-};
-
-enum EP_Summons
-{
- EP_EWT_COMMANDER = 0,
- EP_EWT_SOLDIER1,
- EP_EWT_SOLDIER2,
- EP_EWT_SOLDIER3,
- EP_EWT_SOLDIER4,
- EP_PWT_FLIGHTMASTER,
-};
-
-enum EP_GoSummons
-{
- EP_NPT_BUFF = 0,
- EP_NPT_FLAGS,
- EP_EWT_FLAGS,
- EP_CGT_FLAGS,
- EP_PWT_FLAGS
-};
-
-enum EP_Towers
-{
- EP_EWT = 0, // plaguelands 03
- EP_NPT, // plaguelands 01
- EP_PWT, // plaguelands 04
- EP_CGT, // plaguelands 02
- EP_TOWER_NUM
-};
-
-const go_type EPCapturePoints[EP_TOWER_NUM] =
-{
- {182097, 0, 2574.51f, -4794.89f, 144.704f, -1.45003f, -0.097056f, 0.095578f, -0.656229f, 0.742165f},
- {181899, 0, 3181.08f, -4379.36f, 174.123f, -2.03472f, -0.065392f, 0.119494f, -0.842275f, 0.521553f},
- {182098, 0, 2962.71f, -3042.31f, 154.789f, 2.08426f, -0.074807f, -0.113837f, 0.855928f, 0.49883f},
- {182096, 0, 1860.85f, -3731.23f, 196.716f, -2.53214f, 0.033967f, -0.131914f, 0.944741f, -0.298177f}
-};
-
-const go_type EPTowerFlags[EP_TOWER_NUM] =
-{
- {182106, 0, 2569.60f, -4772.93f, 115.399f, 2.72271f, 0.0f, 0.0f, 0.978148f, 0.207912f},
- {182106, 0, 3148.17f, -4365.51f, 145.029f, 1.53589f, 0.0f, 0.0f, 0.694658f, 0.71934f},
- {182106, 0, 2992.63f, -3022.95f, 125.593f, 3.03687f, 0.0f, 0.0f, 0.99863f, 0.052336f},
- {182106, 0, 1838.42f, -3703.56f, 167.713f, 0.890118f, 0.0f, 0.0f, 0.430511f, 0.902585f}
-};
-
-const uint32 EPTowerPlayerEnterEvents[EP_TOWER_NUM] = {10691, 10699, 10701, 10705};
-
-const uint32 EPTowerPlayerLeaveEvents[EP_TOWER_NUM] = {10692, 10698, 10700, 10704};
-
-const uint8 EP_NUM_CREATURES = 6;
-const uint8 EP_EWT_NUM_CREATURES = 5;
-
-// one lordaeron commander, 4 soldiers
-// should be spawned at EWT and follow a path, but trans-grid pathing isn't safe, so summon them directly at NPT
-const creature_type EP_EWT_Summons_A[EP_EWT_NUM_CREATURES] =
-{
- {17635, 469, 0, 3167.61f, -4352.09f, 138.20f, 4.5811f},
- {17647, 469, 0, 3172.74f, -4352.99f, 139.14f, 4.9873f},
- {17647, 469, 0, 3165.89f, -4354.46f, 138.67f, 3.7244f},
- {17647, 469, 0, 3164.65f, -4350.26f, 138.22f, 2.4794f},
- {17647, 469, 0, 3169.91f, -4349.68f, 138.37f, 0.7444f}
-};
-
-const creature_type EP_EWT_Summons_H[EP_EWT_NUM_CREATURES] =
-{
- {17995, 67, 0, 3167.61f, -4352.09f, 138.20f, 4.5811f},
- {17996, 67, 0, 3172.74f, -4352.99f, 139.14f, 4.9873f},
- {17996, 67, 0, 3165.89f, -4354.46f, 138.67f, 3.7244f},
- {17996, 67, 0, 3164.65f, -4350.26f, 138.22f, 2.4794f},
- {17996, 67, 0, 3169.91f, -4349.68f, 138.37f, 0.7444f}
-};
-
-enum EP_TowerStates
-{
- EP_TS_N = 1,
- EP_TS_N_A = 2,
- EP_TS_N_H = 4,
- EP_TS_A_P = 8,
- EP_TS_H_P = 16,
- EP_TS_A = 32,
- EP_TS_H = 64
-};
-
-// when spawning, pay attention at setting the faction manually!
-const creature_type EP_PWT_FlightMaster = {17209, 0, 0, 2987.5f, -3049.11f, 120.126f, 5.75959f};
-
-// after spawning, modify the faction so that only the controller will be able to use it with SetUInt32Value(GAMEOBJECT_FACTION, faction_id);
-const go_type EP_NPT_LordaeronShrine = {181682, 0, 3167.72f, -4355.91f, 138.785f, 1.69297f, 0.0f, 0.0f, 0.748956f, 0.66262f};
-
-class OutdoorPvPEP;
-
-class OPvPCapturePointEP_EWT : public OPvPCapturePoint
-{
- public:
-
- OPvPCapturePointEP_EWT(OutdoorPvP* pvp);
-
- void ChangeState();
-
- void SendChangePhase();
-
- void FillInitialWorldStates(WorldPacket & data);
-
- // used when player is activated/inactivated in the area
- bool HandlePlayerEnter(Player* player);
- void HandlePlayerLeave(Player* player);
-
- protected:
-
- void SummonSupportUnitAtNorthpassTower(uint32 team);
-
- void UpdateTowerState();
-
- protected:
-
- uint32 m_TowerState;
-
- uint32 m_UnitsSummonedSide;
-};
-
-class OPvPCapturePointEP_NPT : public OPvPCapturePoint
-{
- public:
-
- OPvPCapturePointEP_NPT(OutdoorPvP* pvp);
-
- void ChangeState();
-
- void SendChangePhase();
-
- void FillInitialWorldStates(WorldPacket & data);
-
- // used when player is activated/inactivated in the area
- bool HandlePlayerEnter(Player* player);
- void HandlePlayerLeave(Player* player);
-
- protected:
-
- void SummonGO(uint32 team);
-
- void UpdateTowerState();
-
- protected:
-
- uint32 m_TowerState;
-
- uint32 m_SummonedGOSide;
-};
-
-class OPvPCapturePointEP_CGT : public OPvPCapturePoint
-{
- public:
-
- OPvPCapturePointEP_CGT(OutdoorPvP* pvp);
-
- void ChangeState();
-
- void SendChangePhase();
-
- void FillInitialWorldStates(WorldPacket & data);
-
- // used when player is activated/inactivated in the area
- bool HandlePlayerEnter(Player* player);
- void HandlePlayerLeave(Player* player);
-
- protected:
-
- void LinkGraveYard(uint32 team);
-
- void UpdateTowerState();
-
- protected:
-
- uint32 m_TowerState;
-
- uint32 m_GraveyardSide;
-};
-
-class OPvPCapturePointEP_PWT : public OPvPCapturePoint
-{
- public:
-
- OPvPCapturePointEP_PWT(OutdoorPvP* pvp);
-
- void ChangeState();
-
- void SendChangePhase();
-
- void FillInitialWorldStates(WorldPacket & data);
-
- // used when player is activated/inactivated in the area
- bool HandlePlayerEnter(Player* player);
- void HandlePlayerLeave(Player* player);
-
- protected:
-
- void SummonFlightMaster(uint32 team);
-
- void UpdateTowerState();
-
- protected:
-
- uint32 m_FlightMasterSpawned;
-
- uint32 m_TowerState;
-};
-
-class OutdoorPvPEP : public OutdoorPvP
-{
- public:
-
- OutdoorPvPEP();
-
- bool SetupOutdoorPvP();
-
- void HandlePlayerEnterZone(Player* player, uint32 zone);
- void HandlePlayerLeaveZone(Player* player, uint32 zone);
-
- bool Update(uint32 diff);
-
- void FillInitialWorldStates(WorldPacket &data);
-
- void SendRemoveWorldStates(Player* player);
-
- void BuffTeams();
-
- void SetControlledState(uint32 index, uint32 state);
-
- private:
-
- // how many towers are controlled
- uint32 EP_Controls[EP_TOWER_NUM];
-
- uint32 m_AllianceTowersControlled;
- uint32 m_HordeTowersControlled;
-};
-
-#endif
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
index f60cc1d188c..cb9f9cbc15c 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
@@ -926,8 +926,7 @@ class boss_kaelthas : public CreatureScript
unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, me->GetGUID());
//Using packet workaround
- WorldPacket data(12);
- data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
+ WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12);
data.append(unit->GetPackGUID());
data << uint32(0);
unit->SendMessageToSet(&data, true);
@@ -953,8 +952,7 @@ class boss_kaelthas : public CreatureScript
if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()))
{
//Using packet workaround
- WorldPacket data(12);
- data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
+ WorldPacket data(SMSG_MOVE_UNSET_CAN_FLY, 12);
data.append(unit->GetPackGUID());
data << uint32(0);
unit->SendMessageToSet(&data, true);
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 6119c9050fa..5cba8edb37e 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -147,6 +147,130 @@ class spell_dru_insect_swarm : public SpellScriptLoader
}
};
+enum EclipseSpells
+{
+ SPELL_DRUID_WRATH = 5176,
+ SPELL_DRUID_STARFIRE = 2912,
+ SPELL_DRUID_STARSURGE = 78674,
+ SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE = 89265,
+ SPELL_DRUID_STARSURGE_ENERGIZE = 86605,
+ SPELL_DRUID_LUNAR_ECLIPSE_MARKER = 67484, // Will make the yellow arrow on eclipse bar point to the blue side (lunar)
+ SPELL_DRUID_SOLAR_ECLIPSE_MARKER = 67483, // Will make the yellow arrow on eclipse bar point to the yellow side (solar)
+ SPELL_DRUID_SOLAR_ECLIPSE = 48517,
+ SPELL_DRUID_LUNAR_ECLIPSE = 48518,
+ TALENT_TREE_BALANCE = 752,
+};
+
+// Wrath, Starfire, and Starsurge
+class spell_dru_eclipse_energize : public SpellScriptLoader
+{
+public:
+ spell_dru_eclipse_energize() : SpellScriptLoader("spell_dru_eclipse_energize") { }
+
+ class spell_dru_eclipse_energize_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_dru_eclipse_energize_SpellScript);
+
+ int32 energizeAmount;
+
+ bool Load()
+ {
+ if (GetCaster()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+
+ if (GetCaster()->ToPlayer()->getClass() != CLASS_DRUID)
+ return false;
+
+ energizeAmount = 0;
+
+ return true;
+ }
+
+ void HandleEnergize(SpellEffIndex effIndex)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+
+ // No boomy, no deal.
+ if (caster->GetPrimaryTalentTree(caster->GetActiveSpec()) != TALENT_TREE_BALANCE)
+ return;
+
+ switch(GetSpellInfo()->Id)
+ {
+ case SPELL_DRUID_WRATH:
+ {
+ energizeAmount = -GetSpellInfo()->Effects[effIndex].BasePoints; // -13
+ // If we are set to fill the lunar side or we've just logged in with 0 power..
+ if ((!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER))
+ || caster->GetPower(POWER_ECLIPSE) == 0)
+ {
+ caster->CastCustomSpell(caster,SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE,&energizeAmount,0,0,true);
+ // If the energize was due to 0 power, cast the eclipse marker aura
+ if (!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER))
+ caster->CastSpell(caster,SPELL_DRUID_LUNAR_ECLIPSE_MARKER,true);
+ }
+ // The energizing effect brought us out of the solar eclipse, remove the aura
+ if (caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) <= 0)
+ caster->RemoveAurasDueToSpell(SPELL_DRUID_SOLAR_ECLIPSE);
+ break;
+ }
+ case SPELL_DRUID_STARFIRE:
+ {
+ energizeAmount = GetSpellInfo()->Effects[effIndex].BasePoints; // 20
+ // If we are set to fill the solar side or we've just logged in with 0 power..
+ if ((!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER))
+ || caster->GetPower(POWER_ECLIPSE) == 0)
+ {
+ caster->CastCustomSpell(caster,SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE,&energizeAmount,0,0,true);
+ // If the energize was due to 0 power, cast the eclipse marker aura
+ if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER))
+ caster->CastSpell(caster,SPELL_DRUID_SOLAR_ECLIPSE_MARKER,true);
+ }
+ // The energizing effect brought us out of the lunar eclipse, remove the aura
+ if (caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) >= 0)
+ caster->RemoveAura(SPELL_DRUID_LUNAR_ECLIPSE);
+ break;
+ }
+ case SPELL_DRUID_STARSURGE:
+ {
+ // If we are set to fill the solar side or we've just logged in with 0 power (confirmed with sniffs)
+ if ((!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER))
+ || caster->GetPower(POWER_ECLIPSE) == 0)
+ {
+ energizeAmount = GetSpellInfo()->Effects[effIndex].BasePoints; // 15
+ caster->CastCustomSpell(caster,SPELL_DRUID_STARSURGE_ENERGIZE,&energizeAmount,0,0,true);
+
+ // If the energize was due to 0 power, cast the eclipse marker aura
+ if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER))
+ caster->CastSpell(caster,SPELL_DRUID_SOLAR_ECLIPSE_MARKER,true);
+ }
+ else if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER))
+ {
+ energizeAmount = -GetSpellInfo()->Effects[effIndex].BasePoints; // -15
+ caster->CastCustomSpell(caster,SPELL_DRUID_STARSURGE_ENERGIZE,&energizeAmount,0,0,true);
+ }
+ // The energizing effect brought us out of the lunar eclipse, remove the aura
+ if (caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) >= 0)
+ caster->RemoveAura(SPELL_DRUID_LUNAR_ECLIPSE);
+ // The energizing effect brought us out of the solar eclipse, remove the aura
+ else if (caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) <= 0)
+ caster->RemoveAura(SPELL_DRUID_SOLAR_ECLIPSE);
+ break;
+ }
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_dru_eclipse_energize_SpellScript::HandleEnergize, EFFECT_1, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_dru_eclipse_energize_SpellScript;
+ }
+};
+
class spell_dru_lifebloom : public SpellScriptLoader
{
public:
@@ -605,7 +729,7 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
{
if (Player* caster = GetCaster()->ToPlayer())
- if (caster->Has310Flyer(false))
+ if (caster->GetSkillValue(SKILL_RIDING) >= 375)
amount = 310;
}
@@ -719,4 +843,5 @@ void AddSC_druid_spell_scripts()
new spell_dru_swift_flight_passive();
new spell_dru_tiger_s_fury();
new spell_dru_t10_restoration_4p_bonus();
+ new spell_dru_eclipse_energize();
}
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 519d79add6d..3bca0d088a4 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -3111,12 +3111,13 @@ class spell_gen_mount : public SpellScriptLoader
break;
case 300:
if (canFly)
- {
- if (_mount310 && target->Has310Flyer(false))
- mount = _mount310;
- else
- mount = _mount280;
- }
+ mount = _mount280;
+ else
+ mount = _mount100;
+ break;
+ case 375:
+ if (canFly)
+ mount = _mount310;
else
mount = _mount100;
break;
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 41bda3c163d..e09fc074ce9 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -54,7 +54,7 @@ enum PaladinSpells
};
// 31850 - Ardent Defender
-class spell_pal_ardent_defender : public SpellScriptLoader
+/*class spell_pal_ardent_defender : public SpellScriptLoader
{
public:
spell_pal_ardent_defender() : SpellScriptLoader("spell_pal_ardent_defender") { }
@@ -77,7 +77,7 @@ class spell_pal_ardent_defender : public SpellScriptLoader
return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
}
- void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
+ void CalculateAmount(AuraEffect const* aurEff, int32 & amount, bool & canBeRecalculated)
{
// Set absorbtion amount to unlimited
amount = -1;
@@ -127,7 +127,7 @@ class spell_pal_ardent_defender : public SpellScriptLoader
{
return new spell_pal_ardent_defender_AuraScript();
}
-};
+};*/
class spell_pal_blessing_of_faith : public SpellScriptLoader
{
@@ -670,7 +670,7 @@ class spell_pal_divine_sacrifice : public SpellScriptLoader
void AddSC_paladin_spell_scripts()
{
- new spell_pal_ardent_defender();
+ //new spell_pal_ardent_defender();
new spell_pal_blessing_of_faith();
new spell_pal_blessing_of_sanctuary();
new spell_pal_guarded_by_the_light();
diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp
index df6c311ca67..7c8006d9209 100644
--- a/src/server/scripts/Spells/spell_pet.cpp
+++ b/src/server/scripts/Spells/spell_pet.cpp
@@ -1347,24 +1347,6 @@ public:
return;
if (GetCaster()->GetOwner()->ToPlayer())
{
- // Pet's base damage changes depending on happiness
- if (GetCaster()->isPet() && GetCaster()->ToPet()->isHunterPet())
- {
- switch (GetCaster()->ToPet()->GetHappinessState())
- {
- case HAPPY:
- // 125% of normal damage
- amount += 25.0f;
- break;
- case CONTENT:
- // 100% of normal damage, nothing to modify
- break;
- case UNHAPPY:
- // 75% of normal damage
- amount += -25.0f;
- break;
- }
- }
// Cobra Reflexes
if (AuraEffect* cobraReflexes = GetCaster()->GetAuraEffectOfRankedSpell(61682, EFFECT_0))
amount -= cobraReflexes->GetAmount();
@@ -1706,7 +1688,7 @@ public:
if (pet->isGuardian())
((Guardian*)pet)->SetBonusDamage(owner->GetTotalAttackPowerValue(BASE_ATTACK));
- amount += owner->CalculateDamage(BASE_ATTACK, true, true);;
+ amount += owner->CalculateDamage(BASE_ATTACK, true, true);
}
}
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index aee3889e93b..645ac164aef 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -39,6 +39,9 @@ enum PriestSpells
PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT = 3021,
PRIEST_ICON_ID_PAIN_AND_SUFFERING = 2874,
PRIEST_SHADOW_WORD_DEATH = 32409,
+ PRIEST_SHADOWFORM_VISUAL_WITHOUT_GLYPH = 107903,
+ PRIEST_SHADOWFORM_VISUAL_WITH_GLYPH = 107904,
+ PRIEST_GLYPH_OF_SHADOW = 107906,
};
// Guardian Spirit
@@ -449,6 +452,46 @@ class spell_pri_shadow_word_death : public SpellScriptLoader
}
};
+class spell_pri_shadowform : public SpellScriptLoader
+{
+ public:
+ spell_pri_shadowform() : SpellScriptLoader("spell_pri_shadowform") { }
+
+ class spell_pri_shadowform_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pri_shadowform_AuraScript);
+
+ bool Validate(SpellInfo const* /*entry*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(PRIEST_SHADOWFORM_VISUAL_WITHOUT_GLYPH) ||
+ !sSpellMgr->GetSpellInfo(PRIEST_SHADOWFORM_VISUAL_WITH_GLYPH))
+ return false;
+ return true;
+ }
+
+ void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->CastSpell(GetTarget(), GetTarget()->HasAura(PRIEST_GLYPH_OF_SHADOW) ? PRIEST_SHADOWFORM_VISUAL_WITH_GLYPH : PRIEST_SHADOWFORM_VISUAL_WITHOUT_GLYPH, true);
+ }
+
+ void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->RemoveAurasDueToSpell(GetTarget()->HasAura(PRIEST_GLYPH_OF_SHADOW) ? PRIEST_SHADOWFORM_VISUAL_WITH_GLYPH : PRIEST_SHADOWFORM_VISUAL_WITHOUT_GLYPH);
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_pri_shadowform_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_SHAPESHIFT, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_pri_shadowform_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_SHAPESHIFT, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_pri_shadowform_AuraScript();
+ }
+};
+
void AddSC_priest_spell_scripts()
{
new spell_pri_guardian_spirit();
@@ -461,4 +504,5 @@ void AddSC_priest_spell_scripts()
new spell_pri_vampiric_touch();
new spell_priest_renew();
new spell_pri_shadow_word_death();
+ new spell_pri_shadowform();
}
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index ab6d0e95c1d..c47e155accb 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -338,6 +338,9 @@ class spell_rog_deadly_poison : public SpellScriptLoader
// item combat enchantments
for (uint8 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot)
{
+ if (slot > PRISMATIC_ENCHANTMENT_SLOT || slot < PROP_ENCHANTMENT_SLOT_0) // not holding enchantment id
+ continue;
+
SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(EnchantmentSlot(slot)));
if (!enchant)
continue;
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index e107ea954e4..5ddfe1f4dc5 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -29,14 +29,14 @@
enum ShamanSpells
{
- SHAMAN_SPELL_GLYPH_OF_MANA_TIDE = 55441,
- SHAMAN_SPELL_MANA_TIDE_TOTEM = 39609,
- SHAMAN_SPELL_FIRE_NOVA_R1 = 1535,
+ SHAMAN_SPELL_FLAME_SHOCK = 8050,
SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349,
SHAMAN_SPELL_SATED = 57724,
SHAMAN_SPELL_EXHAUSTION = 57723,
+ HUNTER_SPELL_INSANITY = 95809,
+ MAGE_SPELL_TEMPORAL_DISPLACEMENT = 80354,
- SHAMAN_SPELL_STORM_EARTH_AND_FIRE = 51483,
+ SHAMAN_SPELL_EARTH_GRASP = 51483,
EARTHBIND_TOTEM_SPELL_EARTHGRAB = 64695,
// For Earthen Power
@@ -47,54 +47,15 @@ enum ShamanSpells
ICON_ID_SHAMAN_LAVA_FLOW = 3087,
SHAMAN_LAVA_FLOWS_R1 = 51480,
- SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 64694,
-};
-
-// 51474 - Astral shift
-class spell_sha_astral_shift : public SpellScriptLoader
-{
- public:
- spell_sha_astral_shift() : SpellScriptLoader("spell_sha_astral_shift") { }
-
- class spell_sha_astral_shift_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_sha_astral_shift_AuraScript);
-
- uint32 absorbPct;
-
- bool Load()
- {
- absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
- return true;
- }
-
- void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
- {
- // Set absorbtion amount to unlimited
- amount = -1;
- }
-
- void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
- {
- // reduces all damage taken while stun, fear or silence
- if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED) || (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN)))
- absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
- }
-
- void Register()
- {
- DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_astral_shift_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
- OnEffectAbsorb += AuraEffectAbsorbFn(spell_sha_astral_shift_AuraScript::Absorb, EFFECT_0);
- }
- };
-
- AuraScript* GetAuraScript() const
- {
- return new spell_sha_astral_shift_AuraScript();
- }
+ SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 65264,
+ SHAMAN_SPELL_ANCESTRAL_AWAKENING_PROC = 52752,
+
+ ICON_ID_SOOTHING_RAIN = 2011,
+ SPELL_HEALING_STREAM_TOTEM_HEAL = 52042,
};
// 1535 Fire Nova
+/// Updated 4.3.4
class spell_sha_fire_nova : public SpellScriptLoader
{
public:
@@ -104,46 +65,21 @@ class spell_sha_fire_nova : public SpellScriptLoader
{
PrepareSpellScript(spell_sha_fire_nova_SpellScript);
- bool Validate(SpellInfo const* spellEntry)
- {
- if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_FIRE_NOVA_R1) || sSpellMgr->GetFirstSpellInChain(SHAMAN_SPELL_FIRE_NOVA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id))
- return false;
-
- uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id);
- if (!sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank, true))
- return false;
- return true;
- }
-
- SpellCastResult CheckFireTotem()
- {
- // fire totem
- if (!GetCaster()->m_SummonSlot[1])
- {
- SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_FIRE_TOTEM);
- return SPELL_FAILED_CUSTOM_ERROR;
- }
-
- return SPELL_CAST_OK;
- }
-
void HandleDummy(SpellEffIndex /*effIndex*/)
{
- if (Unit* caster = GetCaster())
+ Unit* caster = GetCaster();
+ if (Unit* target = GetHitUnit())
{
- uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id);
- if (uint32 spellId = sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank))
+ if (target->HasAura(SHAMAN_SPELL_FLAME_SHOCK))
{
- Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]);
- if (totem && totem->isTotem())
- caster->CastSpell(totem, spellId, true);
+ caster->CastSpell(target, SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, true);
+ target->RemoveAurasDueToSpell(SHAMAN_SPELL_FLAME_SHOCK);
}
}
}
void Register()
{
- OnCheckCast += SpellCheckCastFn(spell_sha_fire_nova_SpellScript::CheckFireTotem);
OnEffectHitTarget += SpellEffectFn(spell_sha_fire_nova_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
@@ -154,55 +90,39 @@ class spell_sha_fire_nova : public SpellScriptLoader
}
};
-// 39610 Mana Tide Totem
-class spell_sha_mana_tide_totem : public SpellScriptLoader
+// 16191 Mana Tide
+/// Updated 4.3.4
+class spell_sha_mana_tide : public SpellScriptLoader
{
public:
- spell_sha_mana_tide_totem() : SpellScriptLoader("spell_sha_mana_tide_totem") { }
+ spell_sha_mana_tide() : SpellScriptLoader("spell_sha_mana_tide") { }
- class spell_sha_mana_tide_totem_SpellScript : public SpellScript
+ class spell_sha_mana_tide_AuraScript : public AuraScript
{
- PrepareSpellScript(spell_sha_mana_tide_totem_SpellScript);
-
- bool Validate(SpellInfo const* /*spellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE) || !sSpellMgr->GetSpellInfo(SHAMAN_SPELL_MANA_TIDE_TOTEM))
- return false;
- return true;
- }
+ PrepareAuraScript(spell_sha_mana_tide_AuraScript);
- void HandleDummy(SpellEffIndex /*effIndex*/)
+ void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
{
+ ///@TODO: Exclude the "short term" buffs from the stat value
if (Unit* caster = GetCaster())
- if (Unit* unitTarget = GetHitUnit())
- {
- if (unitTarget->getPowerType() == POWER_MANA)
- {
- int32 effValue = GetEffectValue();
- // Glyph of Mana Tide
- if (Unit* owner = caster->GetOwner())
- if (AuraEffect* dummy = owner->GetAuraEffect(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE, 0))
- effValue += dummy->GetAmount();
- // Regenerate 6% of Total Mana Every 3 secs
- int32 effBasePoints0 = int32(CalculatePct(unitTarget->GetMaxPower(POWER_MANA), effValue));
- caster->CastCustomSpell(unitTarget, SHAMAN_SPELL_MANA_TIDE_TOTEM, &effBasePoints0, NULL, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID());
- }
- }
+ if (Unit* owner = caster->GetOwner())
+ amount = CalculatePct(owner->GetStat(STAT_SPIRIT), aurEff->GetAmount());
}
void Register()
{
- OnEffectHitTarget += SpellEffectFn(spell_sha_mana_tide_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_mana_tide_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_STAT);
}
};
- SpellScript* GetSpellScript() const
+ AuraScript* GetAuraScript() const
{
- return new spell_sha_mana_tide_totem_SpellScript();
+ return new spell_sha_mana_tide_AuraScript();
}
};
-// 6474 - Earthbind Totem - Fix Talent:Earthen Power
+// 6474 - Earthbind Totem - Fix Talent:Earthen Power, Earth's Grasp
+/// Updated 4.3.4
class spell_sha_earthbind_totem : public SpellScriptLoader
{
public:
@@ -236,8 +156,8 @@ class spell_sha_earthbind_totem : public SpellScriptLoader
Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself();
if (!owner)
return;
- // Storm, Earth and Fire
- if (AuraEffect* aurEff = owner->GetAuraEffectOfRankedSpell(SHAMAN_SPELL_STORM_EARTH_AND_FIRE, EFFECT_1))
+ // Earth's Grasp
+ if (AuraEffect* aurEff = owner->GetAuraEffectOfRankedSpell(SHAMAN_SPELL_EARTH_GRASP, EFFECT_0))
{
if (roll_chance_i(aurEff->GetAmount()))
GetCaster()->CastSpell(GetCaster(), EARTHBIND_TOTEM_SPELL_EARTHGRAB, false);
@@ -300,6 +220,7 @@ class spell_sha_earthen_power : public SpellScriptLoader
}
};
+/// Updated 4.3.4
class spell_sha_bloodlust : public SpellScriptLoader
{
public:
@@ -319,6 +240,8 @@ class spell_sha_bloodlust : public SpellScriptLoader
void RemoveInvalidTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_SATED));
+ targets.remove_if(Trinity::UnitAuraCheck(true, HUNTER_SPELL_INSANITY));
+ targets.remove_if(Trinity::UnitAuraCheck(true, MAGE_SPELL_TEMPORAL_DISPLACEMENT));
}
void ApplyDebuff()
@@ -342,6 +265,7 @@ class spell_sha_bloodlust : public SpellScriptLoader
}
};
+/// Updated 4.3.4
class spell_sha_heroism : public SpellScriptLoader
{
public:
@@ -361,6 +285,8 @@ class spell_sha_heroism : public SpellScriptLoader
void RemoveInvalidTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_EXHAUSTION));
+ targets.remove_if(Trinity::UnitAuraCheck(true, HUNTER_SPELL_INSANITY));
+ targets.remove_if(Trinity::UnitAuraCheck(true, MAGE_SPELL_TEMPORAL_DISPLACEMENT));
}
void ApplyDebuff()
@@ -384,11 +310,7 @@ class spell_sha_heroism : public SpellScriptLoader
}
};
-enum AncestralAwakeningProc
-{
- SPELL_ANCESTRAL_AWAKENING_PROC = 52752,
-};
-
+/// Updated 4.3.4
class spell_sha_ancestral_awakening_proc : public SpellScriptLoader
{
public:
@@ -400,7 +322,7 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader
bool Validate(SpellInfo const* /*SpellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_ANCESTRAL_AWAKENING_PROC))
+ if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_ANCESTRAL_AWAKENING_PROC))
return false;
return true;
}
@@ -409,7 +331,7 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader
{
int32 damage = GetEffectValue();
if (GetCaster() && GetHitUnit())
- GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_ANCESTRAL_AWAKENING_PROC, &damage, NULL, NULL, true);
+ GetCaster()->CastCustomSpell(GetHitUnit(), SHAMAN_SPELL_ANCESTRAL_AWAKENING_PROC, &damage, NULL, NULL, true);
}
void Register()
@@ -424,53 +346,7 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader
}
};
-enum CleansingTotemPulse
-{
- SPELL_CLEANSING_TOTEM_EFFECT = 52025,
-};
-
-class spell_sha_cleansing_totem_pulse : public SpellScriptLoader
-{
- public:
- spell_sha_cleansing_totem_pulse() : SpellScriptLoader("spell_sha_cleansing_totem_pulse") { }
-
- class spell_sha_cleansing_totem_pulse_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_sha_cleansing_totem_pulse_SpellScript);
-
- bool Validate(SpellInfo const* /*SpellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_CLEANSING_TOTEM_EFFECT))
- return false;
- return true;
- }
-
- void HandleDummy(SpellEffIndex /* effIndex */)
- {
- int32 bp = 1;
- if (GetCaster() && GetHitUnit() && GetOriginalCaster())
- GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_CLEANSING_TOTEM_EFFECT, NULL, &bp, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID());
- }
-
- void Register()
- {
- OnEffectHitTarget += SpellEffectFn(spell_sha_cleansing_totem_pulse_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_sha_cleansing_totem_pulse_SpellScript();
- }
-};
-
-enum HealingStreamTotem
-{
- SPELL_GLYPH_OF_HEALING_STREAM_TOTEM = 55456,
- ICON_ID_RESTORATIVE_TOTEMS = 338,
- SPELL_HEALING_STREAM_TOTEM_HEAL = 52042,
-};
-
+/// Updated 4.3.4
class spell_sha_healing_stream_totem : public SpellScriptLoader
{
public:
@@ -482,9 +358,7 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader
bool Validate(SpellInfo const* /*SpellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_GLYPH_OF_HEALING_STREAM_TOTEM) || !sSpellMgr->GetSpellInfo(SPELL_HEALING_STREAM_TOTEM_HEAL))
- return false;
- return true;
+ return sSpellMgr->GetSpellInfo(SPELL_HEALING_STREAM_TOTEM_HEAL);
}
void HandleDummy(SpellEffIndex /* effIndex */)
@@ -499,14 +373,10 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader
if (triggeringSpell)
damage = int32(owner->SpellHealingBonusDone(target, triggeringSpell, damage, HEAL));
- // Restorative Totems
- if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, ICON_ID_RESTORATIVE_TOTEMS, 1))
+ // Soothing Rains
+ if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, ICON_ID_SOOTHING_RAIN, EFFECT_0))
AddPct(damage, dummy->GetAmount());
- // Glyph of Healing Stream Totem
- if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0))
- AddPct(damage, aurEff->GetAmount());
-
damage = int32(target->SpellHealingBonusTaken(owner, triggeringSpell, damage, HEAL));
}
caster->CastCustomSpell(target, SPELL_HEALING_STREAM_TOTEM_HEAL, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID());
@@ -525,49 +395,7 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader
}
};
-enum ManaSpringTotem
-{
- SPELL_MANA_SPRING_TOTEM_ENERGIZE = 52032,
-};
-
-class spell_sha_mana_spring_totem : public SpellScriptLoader
-{
- public:
- spell_sha_mana_spring_totem() : SpellScriptLoader("spell_sha_mana_spring_totem") { }
-
- class spell_sha_mana_spring_totem_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_sha_mana_spring_totem_SpellScript);
-
- bool Validate(SpellInfo const* /*SpellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_MANA_SPRING_TOTEM_ENERGIZE))
- return false;
- return true;
- }
-
- void HandleDummy(SpellEffIndex /* effIndex */)
- {
- int32 damage = GetEffectValue();
- if (Unit* target = GetHitUnit())
- if (Unit* caster = GetCaster())
- if (target->getPowerType() == POWER_MANA)
- caster->CastCustomSpell(target, SPELL_MANA_SPRING_TOTEM_ENERGIZE, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID());
- }
-
- void Register()
- {
- OnEffectHitTarget += SpellEffectFn(spell_sha_mana_spring_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
-
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_sha_mana_spring_totem_SpellScript();
- }
-};
-
+/// Updated 4.3.4
class spell_sha_lava_lash : public SpellScriptLoader
{
public:
@@ -612,6 +440,7 @@ class spell_sha_lava_lash : public SpellScriptLoader
};
// 1064 Chain Heal
+/// Updated 4.3.4
class spell_sha_chain_heal : public SpellScriptLoader
{
public:
@@ -625,6 +454,7 @@ class spell_sha_chain_heal : public SpellScriptLoader
{
firstHeal = true;
riptide = false;
+ amount = 0;
return true;
}
@@ -636,6 +466,7 @@ class spell_sha_chain_heal : public SpellScriptLoader
if (AuraEffect* aurEff = GetHitUnit()->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, 0, 0, 0x10, GetCaster()->GetGUID()))
{
riptide = true;
+ amount = aurEff->GetSpellInfo()->Effects[EFFECT_2].CalcValue();
// Consume it
GetHitUnit()->RemoveAura(aurEff->GetBase());
}
@@ -643,7 +474,10 @@ class spell_sha_chain_heal : public SpellScriptLoader
}
// Riptide increases the Chain Heal effect by 25%
if (riptide)
- SetHitHeal(GetHitHeal() * 1.25f);
+ {
+ uint32 bonus = CalculatePct(GetHitHeal(), amount);
+ SetHitHeal(GetHitHeal() + bonus);
+ }
}
void Register()
@@ -653,6 +487,7 @@ class spell_sha_chain_heal : public SpellScriptLoader
bool firstHeal;
bool riptide;
+ uint32 amount;
};
SpellScript* GetSpellScript() const
@@ -661,6 +496,7 @@ class spell_sha_chain_heal : public SpellScriptLoader
}
};
+/// Updated 4.3.4
class spell_sha_flame_shock : public SpellScriptLoader
{
public:
@@ -682,15 +518,17 @@ class spell_sha_flame_shock : public SpellScriptLoader
void HandleDispel(DispelInfo* /*dispelInfo*/)
{
if (Unit* caster = GetCaster())
+ {
// Lava Flows
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, ICON_ID_SHAMAN_LAVA_FLOW, EFFECT_0))
{
if (sSpellMgr->GetFirstSpellInChain(SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId()))
return;
- uint8 rank = sSpellMgr->GetSpellRank(aurEff->GetId());
- caster->CastSpell(caster, sSpellMgr->GetSpellWithRank(SHAMAN_LAVA_FLOWS_TRIGGERED_R1, rank), true);
+ int32 basepoints = aurEff->GetAmount();
+ caster->CastCustomSpell(caster, SHAMAN_LAVA_FLOWS_TRIGGERED_R1, &basepoints, NULL, NULL, true);
}
+ }
}
void Register()
@@ -705,65 +543,17 @@ class spell_sha_flame_shock : public SpellScriptLoader
}
};
-class spell_sha_sentry_totem : public SpellScriptLoader
-{
- public:
- spell_sha_sentry_totem() : SpellScriptLoader("spell_sha_sentry_totem") { }
-
- class spell_sha_sentry_totem_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_sha_sentry_totem_AuraScript);
-
- bool Validate(SpellInfo const* /*spell*/)
- {
- if (!sSpellMgr->GetSpellInfo(SHAMAN_BIND_SIGHT))
- return false;
- return true;
- }
-
- void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- if (Unit* caster = GetCaster())
- if (Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[4]))
- if (totem->isTotem())
- caster->CastSpell(totem, SHAMAN_BIND_SIGHT, true);
- }
-
- void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- if (Unit* caster = GetCaster())
- if (caster->GetTypeId() == TYPEID_PLAYER)
- caster->ToPlayer()->StopCastingBindSight();
- }
-
- void Register()
- {
- AfterEffectApply += AuraEffectApplyFn(spell_sha_sentry_totem_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
- AfterEffectRemove += AuraEffectRemoveFn(spell_sha_sentry_totem_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
- }
- };
-
- AuraScript* GetAuraScript() const
- {
- return new spell_sha_sentry_totem_AuraScript();
- }
-};
-
void AddSC_shaman_spell_scripts()
{
- new spell_sha_astral_shift();
new spell_sha_fire_nova();
- new spell_sha_mana_tide_totem();
+ new spell_sha_mana_tide();
new spell_sha_earthbind_totem();
new spell_sha_earthen_power();
new spell_sha_bloodlust();
new spell_sha_heroism();
new spell_sha_ancestral_awakening_proc();
- new spell_sha_cleansing_totem_pulse();
new spell_sha_healing_stream_totem();
- new spell_sha_mana_spring_totem();
new spell_sha_lava_lash();
new spell_sha_chain_heal();
new spell_sha_flame_shock();
- new spell_sha_sentry_totem();
}
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index aa56f8300bc..42296154634 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -40,13 +40,19 @@ enum WarlockSpells
WARLOCK_HAUNT = 48181,
WARLOCK_HAUNT_HEAL = 48210,
WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117,
- WARLOCK_CURSE_OF_DOOM_EFFECT = 18662,
+ WARLOCK_BANE_OF_DOOM_EFFECT = 18662,
WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703,
WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704,
WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955,
WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956,
+ WARLOCK_SOULSHATTER = 32835,
+ WARLOCK_LIFE_TAP_ENERGIZE = 31818,
+ WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553,
+ WARLOCK_IMPROVED_LIFE_TAP_ICON_ID = 208,
+ WARLOCK_MANA_FEED_ICON_ID = 1982,
};
+/// Updated 4.3.4
class spell_warl_banish : public SpellScriptLoader
{
public:
@@ -64,11 +70,13 @@ public:
void HandleBanish()
{
+ /// Casting Banish on a banished target will cancel the effect
+ /// Check if the target already has Banish, if so, do nothing.
if (Unit* target = GetHitUnit())
{
if (target->GetAuraEffect(SPELL_AURA_SCHOOL_IMMUNITY, SPELLFAMILY_WARLOCK, 0, 0x08000000, 0))
{
- //No need to remove old aura since its removed due to not stack by current Banish aura
+ // No need to remove old aura since its removed due to not stack by current Banish aura
PreventHitDefaultEffect(EFFECT_0);
PreventHitDefaultEffect(EFFECT_1);
PreventHitDefaultEffect(EFFECT_2);
@@ -99,6 +107,7 @@ public:
};
// 47193 Demonic Empowerment
+/// Updated 4.3.4
class spell_warl_demonic_empowerment : public SpellScriptLoader
{
public:
@@ -132,7 +141,6 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER);
int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0)));
targetCreature->CastCustomSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, NULL, NULL, true);
- //unitTarget->CastSpell(unitTarget, 54441, true);
break;
}
case CREATURE_FAMILY_FELGUARD:
@@ -161,7 +169,7 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader
}
};
-// 6201 Create Healthstone (and ranks)
+// 6201 Create Healthstone
class spell_warl_create_healthstone : public SpellScriptLoader
{
public:
@@ -241,6 +249,7 @@ uint32 const spell_warl_create_healthstone::spell_warl_create_healthstone_SpellS
};
// 47422 Everlasting Affliction
+/// Updated 4.3.4
class spell_warl_everlasting_affliction : public SpellScriptLoader
{
public:
@@ -270,34 +279,8 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader
}
};
-// 18541 Ritual of Doom Effect
-class spell_warl_ritual_of_doom_effect : public SpellScriptLoader
-{
-public:
- spell_warl_ritual_of_doom_effect() : SpellScriptLoader("spell_warl_ritual_of_doom_effect") { }
-
- class spell_warl_ritual_of_doom_effect_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_warl_ritual_of_doom_effect_SpellScript);
-
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- Unit* caster = GetCaster();
- caster->CastSpell(caster, GetEffectValue(), true);
- }
-
- void Register()
- {
- OnEffectHit += SpellEffectFn(spell_warl_ritual_of_doom_effect_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_warl_ritual_of_doom_effect_SpellScript();
- }
-};
-
+// 27285 Seed of Corruption
+/// Updated 4.3.4
class spell_warl_seed_of_corruption : public SpellScriptLoader
{
public:
@@ -325,11 +308,8 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader
}
};
-enum Soulshatter
-{
- SPELL_SOULSHATTER = 32835,
-};
-
+// 29858 Soulshatter
+/// Updated 4.3.4
class spell_warl_soulshatter : public SpellScriptLoader
{
public:
@@ -341,7 +321,7 @@ class spell_warl_soulshatter : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_SOULSHATTER))
+ if (!sSpellMgr->GetSpellInfo(WARLOCK_SOULSHATTER))
return false;
return true;
}
@@ -350,10 +330,8 @@ class spell_warl_soulshatter : public SpellScriptLoader
{
Unit* caster = GetCaster();
if (Unit* target = GetHitUnit())
- {
if (target->CanHaveThreatList() && target->getThreatManager().getThreat(caster) > 0.0f)
- caster->CastSpell(target, SPELL_SOULSHATTER, true);
- }
+ caster->CastSpell(target, WARLOCK_SOULSHATTER, true);
}
void Register()
@@ -368,14 +346,8 @@ class spell_warl_soulshatter : public SpellScriptLoader
}
};
-enum LifeTap
-{
- SPELL_LIFE_TAP_ENERGIZE = 31818,
- SPELL_LIFE_TAP_ENERGIZE_2 = 32553,
- ICON_ID_IMPROVED_LIFE_TAP = 208,
- ICON_ID_MANA_FEED = 1982,
-};
-
+// 1454 Life Tap
+/// Updated 4.3.4
class spell_warl_life_tap : public SpellScriptLoader
{
public:
@@ -392,7 +364,7 @@ class spell_warl_life_tap : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/)
{
- if (!sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE_2))
+ if (!sSpellMgr->GetSpellInfo(WARLOCK_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(WARLOCK_LIFE_TAP_ENERGIZE_2))
return false;
return true;
}
@@ -402,34 +374,31 @@ class spell_warl_life_tap : public SpellScriptLoader
Player* caster = GetCaster()->ToPlayer();
if (Unit* target = GetHitUnit())
{
- int32 damage = GetEffectValue();
- int32 mana = int32(damage + (caster->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * 0.5f));
+ int32 damage = caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue());
+ int32 mana = CalculatePct(damage, GetSpellInfo()->Effects[EFFECT_1].CalcValue());
// Shouldn't Appear in Combat Log
target->ModifyHealth(-damage);
// Improved Life Tap mod
- if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, ICON_ID_IMPROVED_LIFE_TAP, 0))
+ if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_IMPROVED_LIFE_TAP_ICON_ID, 0))
AddPct(mana, aurEff->GetAmount());
- caster->CastCustomSpell(target, SPELL_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false);
+ caster->CastCustomSpell(target, WARLOCK_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false);
// Mana Feed
- int32 manaFeedVal = 0;
- if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, ICON_ID_MANA_FEED, 0))
- manaFeedVal = aurEff->GetAmount();
-
- if (manaFeedVal > 0)
+ if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, WARLOCK_MANA_FEED_ICON_ID, 0))
{
+ int32 manaFeedVal = aurEff->GetAmount();
ApplyPct(manaFeedVal, mana);
- caster->CastCustomSpell(caster, SPELL_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL);
+ caster->CastCustomSpell(caster, WARLOCK_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL);
}
}
}
SpellCastResult CheckCast()
{
- if ((int32(GetCaster()->GetHealth()) > int32(GetSpellInfo()->Effects[EFFECT_0].CalcValue() + (6.3875 * GetSpellInfo()->BaseLevel))))
+ if (int32(GetCaster()->GetHealth()) > int32(GetCaster()->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue())))
return SPELL_CAST_OK;
return SPELL_FAILED_FIZZLE;
}
@@ -447,6 +416,8 @@ class spell_warl_life_tap : public SpellScriptLoader
}
};
+// 48018 Demonic Circle: Summon
+/// Updated 4.3.4
class spell_warl_demonic_circle_summon : public SpellScriptLoader
{
public:
@@ -498,6 +469,8 @@ class spell_warl_demonic_circle_summon : public SpellScriptLoader
}
};
+// 48020 Demonic Circle: Teleport
+/// Updated 4.3.4
class spell_warl_demonic_circle_teleport : public SpellScriptLoader
{
public:
@@ -531,6 +504,8 @@ class spell_warl_demonic_circle_teleport : public SpellScriptLoader
}
};
+// 48181 Haunt
+/// Updated 4.3.4
class spell_warl_haunt : public SpellScriptLoader
{
public:
@@ -590,6 +565,7 @@ class spell_warl_haunt : public SpellScriptLoader
}
};
+/// Updated 4.3.4
class spell_warl_unstable_affliction : public SpellScriptLoader
{
public:
@@ -629,10 +605,12 @@ class spell_warl_unstable_affliction : public SpellScriptLoader
}
};
-class spell_warl_curse_of_doom : public SpellScriptLoader
+// 603 Bane of Doom
+/// Updated 4.3.4
+class spell_warl_bane_of_doom : public SpellScriptLoader
{
public:
- spell_warl_curse_of_doom() : SpellScriptLoader("spell_warl_curse_of_doom") { }
+ spell_warl_bane_of_doom() : SpellScriptLoader("spell_warl_bane_of_doom") { }
class spell_warl_curse_of_doom_AuraScript : public AuraScript
{
@@ -640,7 +618,7 @@ class spell_warl_curse_of_doom : public SpellScriptLoader
bool Validate(SpellInfo const* /*spell*/)
{
- if (!sSpellMgr->GetSpellInfo(WARLOCK_CURSE_OF_DOOM_EFFECT))
+ if (!sSpellMgr->GetSpellInfo(WARLOCK_BANE_OF_DOOM_EFFECT))
return false;
return true;
}
@@ -660,7 +638,7 @@ class spell_warl_curse_of_doom : public SpellScriptLoader
return;
if (GetCaster()->ToPlayer()->isHonorOrXPTarget(GetTarget()))
- GetCaster()->CastSpell(GetTarget(), WARLOCK_CURSE_OF_DOOM_EFFECT, true, NULL, aurEff);
+ GetCaster()->CastSpell(GetTarget(), WARLOCK_BANE_OF_DOOM_EFFECT, true, NULL, aurEff);
}
void Register()
@@ -675,6 +653,8 @@ class spell_warl_curse_of_doom : public SpellScriptLoader
}
};
+// 755 Health Funnel
+/// Updated 4.3.4
class spell_warl_health_funnel : public SpellScriptLoader
{
public:
@@ -723,7 +703,6 @@ void AddSC_warlock_spell_scripts()
new spell_warl_demonic_empowerment();
new spell_warl_create_healthstone();
new spell_warl_everlasting_affliction();
- new spell_warl_ritual_of_doom_effect();
new spell_warl_seed_of_corruption();
new spell_warl_soulshatter();
new spell_warl_life_tap();
@@ -731,6 +710,6 @@ void AddSC_warlock_spell_scripts()
new spell_warl_demonic_circle_teleport();
new spell_warl_haunt();
new spell_warl_unstable_affliction();
- new spell_warl_curse_of_doom();
+ new spell_warl_bane_of_doom();
new spell_warl_health_funnel();
}
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index cc8dbe35703..ac0e124f53b 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -27,9 +27,21 @@
enum WarriorSpells
{
- WARRIOR_SPELL_LAST_STAND_TRIGGERED = 12976,
+ SPELL_LAST_STAND_TRIGGERED = 12976,
+ SPELL_DEEP_WOUNDS_RANK_1 = 12162,
+ SPELL_DEEP_WOUNDS_RANK_2 = 12850,
+ SPELL_DEEP_WOUNDS_RANK_3 = 12868,
+ SPELL_DEEP_WOUNDS_RANK_PERIODIC = 12721,
+ SPELL_JUGGERNAUT_CRIT_BONUS_TALENT = 64976,
+ SPELL_JUGGERNAUT_CRIT_BONUS_BUFF = 65156,
+ SPELL_CHARGE = 34846,
+ SPELL_SLAM = 50782,
+ ICON_ID_SUDDEN_DEATH = 1989,
+ SPELL_BLOODTHIRST_DAMAGE = 23881,
+ SPELL_BLOODTHIRST = 23885,
};
+/// Updated 4.3.4
class spell_warr_last_stand : public SpellScriptLoader
{
public:
@@ -41,7 +53,7 @@ class spell_warr_last_stand : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellEntry*/)
{
- if (!sSpellMgr->GetSpellInfo(WARRIOR_SPELL_LAST_STAND_TRIGGERED))
+ if (!sSpellMgr->GetSpellInfo(SPELL_LAST_STAND_TRIGGERED))
return false;
return true;
}
@@ -50,8 +62,8 @@ class spell_warr_last_stand : public SpellScriptLoader
{
if (Unit* caster = GetCaster())
{
- int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30));
- caster->CastCustomSpell(caster, WARRIOR_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
+ int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(GetEffectValue()));
+ caster->CastCustomSpell(caster, SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
}
}
@@ -68,96 +80,7 @@ class spell_warr_last_stand : public SpellScriptLoader
}
};
-class spell_warr_improved_spell_reflection : public SpellScriptLoader
-{
- public:
- spell_warr_improved_spell_reflection() : SpellScriptLoader("spell_warr_improved_spell_reflection") { }
-
- class spell_warr_improved_spell_reflection_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_warr_improved_spell_reflection_SpellScript);
-
- void FilterTargets(std::list<WorldObject*>& unitList)
- {
- if (GetCaster())
- unitList.remove(GetCaster());
- }
-
- void Register()
- {
- OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_improved_spell_reflection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY);
- }
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_warr_improved_spell_reflection_SpellScript();
- }
-};
-
-enum DamageReductionAura
-{
- SPELL_BLESSING_OF_SANCTUARY = 20911,
- SPELL_GREATER_BLESSING_OF_SANCTUARY = 25899,
- SPELL_RENEWED_HOPE = 63944,
- SPELL_DAMAGE_REDUCTION_AURA = 68066,
-};
-
-class spell_warr_vigilance : public SpellScriptLoader
-{
-public:
- spell_warr_vigilance() : SpellScriptLoader("spell_warr_vigilance") { }
-
- class spell_warr_vigilance_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_warr_vigilance_AuraScript);
-
- bool Validate(SpellInfo const* /*SpellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_DAMAGE_REDUCTION_AURA))
- return false;
- return true;
- }
-
- void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- if (Unit* target = GetTarget())
- target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true);
- }
-
- void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- if (Unit* target = GetTarget())
- {
- if (target->HasAura(SPELL_DAMAGE_REDUCTION_AURA) && !(target->HasAura(SPELL_BLESSING_OF_SANCTUARY) ||
- target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) ||
- target->HasAura(SPELL_RENEWED_HOPE)))
- target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA);
- }
- }
-
- void Register()
- {
- OnEffectApply += AuraEffectApplyFn(spell_warr_vigilance_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
- OnEffectRemove += AuraEffectRemoveFn(spell_warr_vigilance_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
- }
-
- };
-
- AuraScript* GetAuraScript() const
- {
- return new spell_warr_vigilance_AuraScript();
- }
-};
-
-enum DeepWounds
-{
- SPELL_DEEP_WOUNDS_RANK_1 = 12162,
- SPELL_DEEP_WOUNDS_RANK_2 = 12850,
- SPELL_DEEP_WOUNDS_RANK_3 = 12868,
- SPELL_DEEP_WOUNDS_RANK_PERIODIC = 12721,
-};
-
+/// Updated 4.3.4
class spell_warr_deep_wounds : public SpellScriptLoader
{
public:
@@ -174,7 +97,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader
return true;
}
- void HandleDummy(SpellEffIndex /* effIndex */)
+ void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 damage = GetEffectValue();
Unit* caster = GetCaster();
@@ -212,13 +135,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader
}
};
-enum Charge
-{
- SPELL_JUGGERNAUT_CRIT_BONUS_TALENT = 64976,
- SPELL_JUGGERNAUT_CRIT_BONUS_BUFF = 65156,
- SPELL_CHARGE = 34846,
-};
-
+/// Updated 4.3.4
class spell_warr_charge : public SpellScriptLoader
{
public:
@@ -234,7 +151,7 @@ class spell_warr_charge : public SpellScriptLoader
return false;
return true;
}
- void HandleDummy(SpellEffIndex /* effIndex */)
+ void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 chargeBasePoints0 = GetEffectValue();
Unit* caster = GetCaster();
@@ -257,11 +174,7 @@ class spell_warr_charge : public SpellScriptLoader
}
};
-enum Slam
-{
- SPELL_SLAM = 50783,
-};
-
+/// Updated 4.3.4
class spell_warr_slam : public SpellScriptLoader
{
public:
@@ -277,7 +190,7 @@ class spell_warr_slam : public SpellScriptLoader
return false;
return true;
}
- void HandleDummy(SpellEffIndex /* effIndex */)
+ void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 bp0 = GetEffectValue();
if (GetHitUnit())
@@ -296,13 +209,7 @@ class spell_warr_slam : public SpellScriptLoader
}
};
-enum Execute
-{
- SPELL_EXECUTE = 20647,
- SPELL_GLYPH_OF_EXECUTION = 58367,
- ICON_ID_SUDDEN_DEATH = 1989,
-};
-
+/// Updated 4.3.4
class spell_warr_execute : public SpellScriptLoader
{
public:
@@ -312,42 +219,35 @@ class spell_warr_execute : public SpellScriptLoader
{
PrepareSpellScript(spell_warr_execute_SpellScript);
- bool Validate(SpellInfo const* /*SpellEntry*/)
- {
- if (!sSpellMgr->GetSpellInfo(SPELL_EXECUTE) || !sSpellMgr->GetSpellInfo(SPELL_GLYPH_OF_EXECUTION))
- return false;
- return true;
- }
- void HandleDummy(SpellEffIndex effIndex)
+ void HandleEffect(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
- if (Unit* target = GetHitUnit())
+ if (GetHitUnit())
{
SpellInfo const* spellInfo = GetSpellInfo();
- int32 rageUsed = std::min<int32>(300 - spellInfo->CalcPowerCost(caster, SpellSchoolMask(spellInfo->SchoolMask)), caster->GetPower(POWER_RAGE));
+ int32 rageUsed = std::min<int32>(200 - spellInfo->CalcPowerCost(caster, SpellSchoolMask(spellInfo->SchoolMask)), caster->GetPower(POWER_RAGE));
int32 newRage = std::max<int32>(0, caster->GetPower(POWER_RAGE) - rageUsed);
// Sudden Death rage save
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_GENERIC, ICON_ID_SUDDEN_DEATH, EFFECT_0))
{
- int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue() * 10;
+ int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_0].CalcValue() * 10;
newRage = std::max(newRage, ragesave);
}
caster->SetPower(POWER_RAGE, uint32(newRage));
- // Glyph of Execution bonus
- if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_GLYPH_OF_EXECUTION, EFFECT_0))
- rageUsed += aurEff->GetAmount() * 10;
-
- int32 bp = GetEffectValue() + int32(rageUsed * spellInfo->Effects[effIndex].DamageMultiplier + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.2f);
- caster->CastCustomSpell(target,SPELL_EXECUTE,&bp,0,0,true,0,0,GetOriginalCaster()->GetGUID());
+ /// Formula taken from the DBC: "${10+$AP*0.437*$m1/100}"
+ int32 baseDamage = int32(10 + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.437f * GetEffectValue() / 100.0f);
+ /// Formula taken from the DBC: "${$ap*0.874*$m1/100-1} = 20 rage"
+ int32 moreDamage = int32(rageUsed * (caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.874f * GetEffectValue() / 100.0f - 1) / 200);
+ SetHitDamage(baseDamage + moreDamage);
}
}
void Register()
{
- OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
@@ -357,6 +257,7 @@ class spell_warr_execute : public SpellScriptLoader
}
};
+/// Updated 4.3.4
class spell_warr_concussion_blow : public SpellScriptLoader
{
public:
@@ -366,7 +267,7 @@ class spell_warr_concussion_blow : public SpellScriptLoader
{
PrepareSpellScript(spell_warr_concussion_blow_SpellScript);
- void HandleDummy(SpellEffIndex /* effIndex */)
+ void HandleDummy(SpellEffIndex /*effIndex*/)
{
SetHitDamage(CalculatePct(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetEffectValue()));
}
@@ -383,11 +284,7 @@ class spell_warr_concussion_blow : public SpellScriptLoader
}
};
-enum Bloodthirst
-{
- SPELL_BLOODTHIRST = 23885,
-};
-
+/// Updated 4.3.4
class spell_warr_bloodthirst : public SpellScriptLoader
{
public:
@@ -429,11 +326,7 @@ class spell_warr_bloodthirst : public SpellScriptLoader
}
};
-enum BloodthirstHeal
-{
- SPELL_BLOODTHIRST_DAMAGE = 23881,
-};
-
+/// Updated 4.3.4
class spell_warr_bloodthirst_heal : public SpellScriptLoader
{
public:
@@ -446,7 +339,7 @@ class spell_warr_bloodthirst_heal : public SpellScriptLoader
void HandleHeal(SpellEffIndex /*effIndex*/)
{
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_BLOODTHIRST_DAMAGE))
- SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster())));
+ SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster())) / 100);
}
void Register()
@@ -461,56 +354,9 @@ class spell_warr_bloodthirst_heal : public SpellScriptLoader
}
};
-enum Overpower
-{
- SPELL_UNRELENTING_ASSAULT_RANK_1 = 46859,
- SPELL_UNRELENTING_ASSAULT_RANK_2 = 46860,
- SPELL_UNRELENTING_ASSAULT_TRIGGER_1 = 64849,
- SPELL_UNRELENTING_ASSAULT_TRIGGER_2 = 64850,
-};
-
-class spell_warr_overpower : public SpellScriptLoader
-{
-public:
- spell_warr_overpower() : SpellScriptLoader("spell_warr_overpower") { }
-
- class spell_warr_overpower_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_warr_overpower_SpellScript);
-
- void HandleEffect(SpellEffIndex /* effIndex */)
- {
- uint32 spellId = 0;
- if (GetCaster()->HasAura(SPELL_UNRELENTING_ASSAULT_RANK_1))
- spellId = SPELL_UNRELENTING_ASSAULT_TRIGGER_1;
- else if (GetCaster()->HasAura(SPELL_UNRELENTING_ASSAULT_RANK_2))
- spellId = SPELL_UNRELENTING_ASSAULT_TRIGGER_2;
-
- if (!spellId)
- return;
-
- if (Player* target = GetHitPlayer())
- if (target->HasUnitState(UNIT_STATE_CASTING))
- target->CastSpell(target, spellId, true);
- }
-
- void Register()
- {
- OnEffectHitTarget += SpellEffectFn(spell_warr_overpower_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_ANY);
- }
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_warr_overpower_SpellScript();
- }
-};
-
void AddSC_warrior_spell_scripts()
{
new spell_warr_last_stand();
- new spell_warr_improved_spell_reflection();
- new spell_warr_vigilance();
new spell_warr_deep_wounds();
new spell_warr_charge();
new spell_warr_slam();
@@ -518,5 +364,4 @@ void AddSC_warrior_spell_scripts()
new spell_warr_concussion_blow();
new spell_warr_bloodthirst();
new spell_warr_bloodthirst_heal();
- new spell_warr_overpower();
}
diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp
index d888e6cb56b..e7883f4f11f 100644
--- a/src/server/scripts/World/item_scripts.cpp
+++ b/src/server/scripts/World/item_scripts.cpp
@@ -75,7 +75,7 @@ public:
return false;
// error
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
+ player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL);
return true;
}
};
@@ -118,7 +118,7 @@ public:
targets.GetUnitTarget()->GetEntry() == 20748 && !targets.GetUnitTarget()->HasAura(32578))
return false;
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
+ player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL);
return true;
}
};
@@ -267,15 +267,13 @@ class item_petrov_cluster_bombs : public ItemScript
public:
item_petrov_cluster_bombs() : ItemScript("item_petrov_cluster_bombs") { }
- bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/)
+ bool OnUse(Player* player, Item* /*item*/, const SpellCastTargets & /*targets*/)
{
if (player->GetZoneId() != ZONE_ID_HOWLING)
return false;
if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS)
{
- player->SendEquipError(EQUIP_ERR_NONE, item, NULL);
-
if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB))
Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE);
@@ -380,7 +378,7 @@ public:
} else
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL);
} else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
+ player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL);
return true;
}
};
@@ -406,7 +404,7 @@ public:
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL);
}
else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
+ player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL);
return true;
}
};
diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp
index 175cfb190d7..e6ac4a3a2a1 100644
--- a/src/server/scripts/World/npc_professions.cpp
+++ b/src/server/scripts/World/npc_professions.cpp
@@ -211,7 +211,7 @@ int32 DoLowUnlearnCost(Player* player) //blacksmith
void ProcessCastaction(Player* player, Creature* creature, uint32 spellId, uint32 triggeredSpellId, int32 cost)
{
- if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney(cost))
+ if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney((int64)cost))
{
player->CastSpell(player, triggeredSpellId, true);
player->ModifyMoney(-cost);
@@ -349,11 +349,11 @@ void ProcessUnlearnAction(Player* player, Creature* creature, uint32 spellId, ui
{
if (EquippedOk(player, spellId))
{
- if (player->HasEnoughMoney(cost))
+ if (player->HasEnoughMoney(int64(cost)))
{
player->CastSpell(player, spellId, true);
ProfessionUnlearnSpells(player, spellId);
- player->ModifyMoney(-cost);
+ player->ModifyMoney(-int64(cost));
if (alternativeSpellId)
creature->CastSpell(player, alternativeSpellId, true);
}
@@ -361,7 +361,7 @@ void ProcessUnlearnAction(Player* player, Creature* creature, uint32 spellId, ui
player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, 0, 0);
}
else
- player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, NULL, NULL);
+ player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, NULL, NULL);
player->CLOSE_GOSSIP_MENU();
}
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index b291b9751b4..f7363f2fb0a 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -1297,7 +1297,7 @@ public:
case GOSSIP_OPTION_LEARNDUALSPEC:
if (player->GetSpecsCount() == 1 && !(player->getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL)))
{
- if (!player->HasEnoughMoney(10000000))
+ if (!player->HasEnoughMoney(uint64(10000000)))
{
player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0);
player->PlayerTalkClass->SendCloseGossip();
@@ -1305,7 +1305,7 @@ public:
}
else
{
- player->ModifyMoney(-10000000);
+ player->ModifyMoney(int64(-10000000));
// Cast spells that teach dual spec
// Both are also ImplicitTarget self and must be cast by player
@@ -2608,11 +2608,11 @@ public:
}
if (doSwitch)
{
- if (!player->HasEnoughMoney(EXP_COST))
+ if (!player->HasEnoughMoney(uint64(EXP_COST)))
player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0);
else if (noXPGain)
{
- player->ModifyMoney(-EXP_COST);
+ player->ModifyMoney(-int64(EXP_COST));
player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN);
}
else if (!noXPGain)