Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-07-03 16:03:45 +08:00
81 changed files with 889 additions and 415 deletions

View File

@@ -347,21 +347,22 @@ public:
return false;
}
if (ObjectMgr::CheckPlayerName(newName, true) != CHAR_NAME_SUCCESS)
ResponseCodes res = ResponseCodes(ObjectMgr::CheckPlayerName(newName, true));
if (res != CHAR_NAME_SUCCESS)
{
handler->SendErrorMessage(LANG_BAD_VALUE);
return false;
}
switch (res)
{
case CHAR_NAME_RESERVED:
handler->SendErrorMessage(LANG_RESERVED_NAME);
break;
case CHAR_NAME_PROFANE:
handler->SendErrorMessage(LANG_PROFANITY_NAME);
break;
default:
handler->SendErrorMessage(LANG_BAD_VALUE);
break;
}
if (sObjectMgr->IsReservedName(newName))
{
handler->SendErrorMessage(LANG_RESERVED_NAME);
return false;
}
if (sObjectMgr->IsProfanityName(newName))
{
handler->SendErrorMessage(LANG_PROFANITY_NAME);
return false;
}

View File

@@ -85,7 +85,7 @@ public:
return false;
}
if (sObjectMgr->IsReservedName(guildName) || sObjectMgr->IsProfanityName(guildName) || !sObjectMgr->IsValidCharterName(guildName))
if (!sObjectMgr->IsValidCharterName(guildName))
{
handler->SendErrorMessage(LANG_BAD_VALUE);
return false;

View File

@@ -31,9 +31,9 @@ EndScriptData */
#include "ObjectMgr.h"
#include "Player.h"
#include "ReputationMgr.h"
#include "SharedDefines.h"
#include "SpellInfo.h"
#include "SpellMgr.h"
#include "SharedDefines.h"
using namespace Acore::ChatCommands;
@@ -812,13 +812,13 @@ public:
switch (status)
{
case QUEST_STATUS_COMPLETE:
statusStr = handler->GetAcoreString(LANG_COMMAND_QUEST_COMPLETE);
statusStr = handler->GetAcoreString(LANG_COMPLETE);
break;
case QUEST_STATUS_INCOMPLETE:
statusStr = handler->GetAcoreString(LANG_COMMAND_QUEST_ACTIVE);
statusStr = handler->GetAcoreString(LANG_ACTIVE);
break;
case QUEST_STATUS_REWARDED:
statusStr = handler->GetAcoreString(LANG_COMMAND_QUEST_REWARDED);
statusStr = handler->GetAcoreString(LANG_REWARDED);
break;
default:
break;
@@ -868,13 +868,13 @@ public:
switch (status)
{
case QUEST_STATUS_COMPLETE:
statusStr = handler->GetAcoreString(LANG_COMMAND_QUEST_COMPLETE);
statusStr = handler->GetAcoreString(LANG_COMPLETE);
break;
case QUEST_STATUS_INCOMPLETE:
statusStr = handler->GetAcoreString(LANG_COMMAND_QUEST_ACTIVE);
statusStr = handler->GetAcoreString(LANG_ACTIVE);
break;
case QUEST_STATUS_REWARDED:
statusStr = handler->GetAcoreString(LANG_COMMAND_QUEST_REWARDED);
statusStr = handler->GetAcoreString(LANG_REWARDED);
break;
default:
break;

View File

@@ -1428,7 +1428,7 @@ public:
if (location->empty() || *location == "inn")
{
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->m_homebindO);
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->GetOrientation());
return true;
}

View File

@@ -687,10 +687,11 @@ public:
ObjectGuid::LowType guid = fields[0].Get<uint32>();
uint32 entry = fields[1].Get<uint32>();
//uint32 entry2 = fields[2].Get<uint32>();
float x = fields[3].Get<float>();
float y = fields[4].Get<float>();
float z = fields[5].Get<float>();
uint16 mapId = fields[6].Get<uint16>();
//uint32 entry3 = fields[3].Get<uint32>();
float x = fields[4].Get<float>();
float y = fields[5].Get<float>();
float z = fields[6].Get<float>();
uint16 mapId = fields[7].Get<uint16>();
CreatureTemplate const* creatureTemplate = sObjectMgr->GetCreatureTemplate(entry);
if (!creatureTemplate)

View File

@@ -780,17 +780,19 @@ public:
static bool HandleReloadReservedNameCommand(ChatHandler* handler)
{
LOG_INFO("server.loading", "Re-Loading `reserved_player` Table!");
sObjectMgr->LoadReservedPlayersNames();
handler->SendGlobalGMSysMessage("DB table `reserved_name` reloaded.");
LOG_INFO("server.loading", "Re-Loading Reserved Names!");
sObjectMgr->LoadReservedPlayerNamesDB();
sObjectMgr->LoadReservedPlayerNamesDBC(); // Needed because we clear the store in LoadReservedPlayerNamesDB()
handler->SendGlobalGMSysMessage("Reserved Names reloaded.");
return true;
}
static bool HandleReloadProfanityNameCommand(ChatHandler* handler)
{
LOG_INFO("server.loading", "Re-Loading `profanity_player` Table!");
sObjectMgr->LoadProfanityPlayersNames();
handler->SendGlobalGMSysMessage("DB table `profanity_player` reloaded.");
LOG_INFO("server.loading", "Re-Loading Profanity Names!");
sObjectMgr->LoadProfanityNamesFromDB();
sObjectMgr->LoadProfanityNamesFromDBC(); // Needed because we clear the store in LoadProfanityNamesFromDB()
handler->SendGlobalGMSysMessage("Profanity Names reloaded.");
return true;
}

View File

@@ -176,7 +176,7 @@ public:
if (where.index() == 1) // References target's homebind
{
if (Player* target = player->GetConnectedPlayer())
target->TeleportTo(target->m_homebindMapId, target->m_homebindX, target->m_homebindY, target->m_homebindZ, target->m_homebindO);
target->TeleportTo(target->m_homebindMapId, target->m_homebindX, target->m_homebindY, target->m_homebindZ, target->GetOrientation());
else
{
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_HOMEBIND);

View File

@@ -15,12 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "molten_core.h"
#include "CreatureScript.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "TaskScheduler.h"
#include "molten_core.h"
enum Texts
{

View File

@@ -17,10 +17,10 @@
#include "CreatureScript.h"
#include "GameObjectScript.h"
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "TaskScheduler.h"
#include "PassiveAI.h"
#include "karazhan.h"
enum Spells

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "karazhan.h"
#include "AreaTriggerScript.h"
#include "CreatureScript.h"
#include "Player.h"
@@ -25,7 +26,6 @@
#include "SpellAuras.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "karazhan.h"
/* ScriptData
SDName: Karazhan
SD%Complete: 100

View File

@@ -16,6 +16,7 @@
*/
#include "CreatureScript.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
#include "LFGMgr.h"
#include "Player.h"
@@ -26,7 +27,6 @@
#include "SpellScriptLoader.h"
#include "TaskScheduler.h"
#include "shadowfang_keep.h"
#include "GridNotifiersImpl.h"
enum ApothecarySpells
{

View File

@@ -37,49 +37,38 @@ enum DeathlyUsher
SPELL_TELEPORT_GROUP = 27686
};
class spell_razelikh_teleport_group : public SpellScriptLoader
class spell_razelikh_teleport_group : public SpellScript
{
public:
spell_razelikh_teleport_group() : SpellScriptLoader("spell_razelikh_teleport_group") { }
PrepareSpellScript(spell_razelikh_teleport_group);
class spell_razelikh_teleport_group_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spell*/) override
{
PrepareSpellScript(spell_razelikh_teleport_group_SpellScript);
return ValidateSpellInfo({ SPELL_TELEPORT_SINGLE, SPELL_TELEPORT_SINGLE_IN_GROUP });
}
bool Validate(SpellInfo const* /*spell*/) override
void HandleScriptEffect(SpellEffIndex /* effIndex */)
{
if (Player* player = GetHitPlayer())
{
return ValidateSpellInfo({ SPELL_TELEPORT_SINGLE, SPELL_TELEPORT_SINGLE_IN_GROUP });
}
void HandleScriptEffect(SpellEffIndex /* effIndex */)
{
if (Player* player = GetHitPlayer())
if (Group* group = player->GetGroup())
{
if (Group* group = player->GetGroup())
{
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
if (Player* member = itr->GetSource())
if (member->IsWithinDistInMap(player, 20.0f) && !member->isDead())
member->CastSpell(member, SPELL_TELEPORT_SINGLE_IN_GROUP, true);
}
else
player->CastSpell(player, SPELL_TELEPORT_SINGLE, true);
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
if (Player* member = itr->GetSource())
if (member->IsWithinDistInMap(player, 20.0f) && !member->isDead())
member->CastSpell(member, SPELL_TELEPORT_SINGLE_IN_GROUP, true);
}
else
player->CastSpell(player, SPELL_TELEPORT_SINGLE, true);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_razelikh_teleport_group_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_razelikh_teleport_group_SpellScript();
OnEffectHitTarget += SpellEffectFn(spell_razelikh_teleport_group::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
void AddSC_blasted_lands()
{
new spell_razelikh_teleport_group();
RegisterSpellScript(spell_razelikh_teleport_group);
}

View File

@@ -457,31 +457,20 @@ enum PurificationIds
NPC_AURIC = 37765,
};
class spell_bh_cleanse_quel_delar : public SpellScriptLoader
class spell_bh_cleanse_quel_delar : public SpellScript
{
public:
spell_bh_cleanse_quel_delar() : SpellScriptLoader("spell_bh_cleanse_quel_delar") { }
PrepareSpellScript(spell_bh_cleanse_quel_delar);
class spell_bh_cleanse_quel_delar_SpellScript : public SpellScript
void OnEffect(SpellEffIndex /*effIndex*/)
{
PrepareSpellScript(spell_bh_cleanse_quel_delar_SpellScript);
if (Unit* caster = GetCaster())
if (Creature* c = caster->FindNearestCreature(NPC_ROMMATH, 50.0f, true))
c->AI()->DoAction(-1);
}
void OnEffect(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
if (Creature* c = caster->FindNearestCreature(NPC_ROMMATH, 50.0f, true))
c->AI()->DoAction(-1);
}
void Register() override
{
OnEffectLaunch += SpellEffectFn(spell_bh_cleanse_quel_delar_SpellScript::OnEffect, EFFECT_0, SPELL_EFFECT_SEND_EVENT);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_bh_cleanse_quel_delar_SpellScript();
OnEffectLaunch += SpellEffectFn(spell_bh_cleanse_quel_delar::OnEffect, EFFECT_0, SPELL_EFFECT_SEND_EVENT);
}
};
@@ -692,7 +681,7 @@ void AddSC_isle_of_queldanas()
{
// OUR:
new npc_bh_thalorien_dawnseeker();
new spell_bh_cleanse_quel_delar();
RegisterSpellScript(spell_bh_cleanse_quel_delar);
new npc_grand_magister_rommath();
// THEIR:

View File

@@ -2223,36 +2223,25 @@ public:
######*/
// - 61123 - Ingest
class spell_blight_worm_ingest : public SpellScriptLoader
class spell_blight_worm_ingest : public SpellScript
{
public:
spell_blight_worm_ingest() : SpellScriptLoader("spell_blight_worm_ingest") { }
PrepareSpellScript(spell_blight_worm_ingest);
class spell_blight_worm_ingest_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_blight_worm_ingest_SpellScript);
return ValidateSpellInfo({ SPELL_INGEST });
}
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_INGEST });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
if (Unit* caster = GetCaster())
target->CastSpell(caster, SPELL_INGEST_TRIGGER, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_blight_worm_ingest_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
void HandleScript(SpellEffIndex /*effIndex*/)
{
return new spell_blight_worm_ingest_SpellScript();
if (Unit* target = GetHitUnit())
if (Unit* caster = GetCaster())
target->CastSpell(caster, SPELL_INGEST_TRIGGER, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_blight_worm_ingest::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
@@ -4082,5 +4071,5 @@ void AddSC_undercity()
new npc_jaina_proudmoore_bfu();
new npc_lady_sylvanas_windrunner_bfu();
new boss_blight_worm();
new spell_blight_worm_ingest();
RegisterSpellScript(spell_blight_worm_ingest);
}

View File

@@ -15,13 +15,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "hyjal.h"
#include "CreatureScript.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "hyjal.h"
enum Spells
{

View File

@@ -405,7 +405,22 @@ public:
}
if (_bossWave != TO_BE_DECIDED)
{
DoUpdateWorldState(WORLD_STATE_WAVES, 0);
scheduler.Schedule(30s, [this](TaskContext context)
{
if (IsEncounterInProgress())
{
// Reset the instance if its empty.
// This is necessary because bosses get stuck fighting unreachable mobs.
// Remove this when we are sure pathing no longer causes this.
if (!instance->GetPlayersCountExceptGMs())
SetData(DATA_RESET_ALLIANCE, 0);
else
context.Repeat();
}
});
}
break;
case DATA_SPAWN_INFERNALS:
@@ -479,8 +494,6 @@ public:
break;
}
// LOG_DEBUG("scripts", "Instance Hyjal: Instance data updated for event {} (Data={})", type, data);
if (data == DONE)
{
SaveToDB();

View File

@@ -15,12 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "the_black_morass.h"
#include "CreatureScript.h"
#include "MoveSplineInit.h"
#include "ScriptedCreature.h"
#include "SmartAI.h"
#include "SpellScriptLoader.h"
#include "the_black_morass.h"
enum medivhMisc
{

View File

@@ -15,11 +15,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ruins_of_ahnqiraj.h"
#include "CreatureScript.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "ruins_of_ahnqiraj.h"
enum Spells
{

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "temple_of_ahnqiraj.h"
#include "AreaTriggerScript.h"
#include "CreatureScript.h"
#include "MapReference.h"
@@ -22,7 +23,6 @@
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "temple_of_ahnqiraj.h"
enum Spells
{

View File

@@ -17,12 +17,12 @@
#include "CreatureScript.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "SpellScriptLoader.h"
#include "TemporarySummon.h"
#include "zulfarrak.h"
#include "GridNotifiersImpl.h"
enum Misc
{

View File

@@ -15,13 +15,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "forge_of_souls.h"
#include "CreatureScript.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "forge_of_souls.h"
enum Yells
{

View File

@@ -15,11 +15,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "halls_of_reflection.h"
#include "AreaTriggerScript.h"
#include "CreatureScript.h"
#include "MotionMaster.h"
#include "SpellScriptLoader.h"
#include "halls_of_reflection.h"
enum Events
{

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pit_of_saron.h"
#include "AreaTriggerScript.h"
#include "CreatureGroups.h"
#include "CreatureScript.h"
@@ -26,7 +27,6 @@
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "pit_of_saron.h"
class npc_pos_leader : public CreatureScript
{

View File

@@ -16,6 +16,7 @@
*/
#include "AchievementCriteriaScript.h"
#include "Config.h"
#include "CreatureScript.h"
#include "CreatureTextMgr.h"
#include "GameTime.h"
@@ -585,7 +586,7 @@ public:
_instance->SetBossState(DATA_ICECROWN_GUNSHIP_BATTLE, isVictory ? DONE : FAIL);
me->GetMap()->SetZoneMusic(AREA_ICECROWN_CITADEL, 0);
if (Creature* creature = me->FindNearestCreature(me->GetEntry() == NPC_ORGRIMS_HAMMER ? NPC_THE_SKYBREAKER : NPC_ORGRIMS_HAMMER, 200.0f))
if (Creature* creature = _instance->GetCreature(me->GetEntry() == NPC_ORGRIMS_HAMMER ? DATA_THE_SKYBREAKER : DATA_ORGRIMS_HAMMER))
{
_instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, creature);
if (Aura* a = creature->GetAura(SPELL_CHECK_FOR_PLAYERS))
@@ -646,7 +647,7 @@ public:
me->GetTransport()->ToMotionTransport()->EnableMovement(true);
if (Creature* ship = me->FindNearestCreature(_teamIdInInstance == TEAM_HORDE ? NPC_ORGRIMS_HAMMER : NPC_THE_SKYBREAKER, 200.0f))
if (Creature* ship = _instance->GetCreature(_teamIdInInstance == TEAM_HORDE ? DATA_ORGRIMS_HAMMER : DATA_THE_SKYBREAKER))
{
ship->CastSpell(ship, SPELL_TELEPORT_PLAYERS_ON_VICTORY, true);
ship->CastSpell(ship, SPELL_ACHIEVEMENT, true);
@@ -675,6 +676,30 @@ public:
}
}
void UpdateAI(uint32 /*diff*/) override
{
if (!sConfigMgr->GetOption<int32>("WipeGunshipBlizzlike.Enable", 1))
return;
if (_instance->GetBossState(DATA_ICECROWN_GUNSHIP_BATTLE) != IN_PROGRESS)
return;
bool playerOnDeck = false;
me->GetMap()->DoForAllPlayers([&](Player* player)
{
if (!player->GetVehicle() && player->IsAlive())
playerOnDeck = true;
});
// Wipe if no player is on the deck
if (!playerOnDeck)
{
// Script runs on enemy ship. We want to kill our ship.
if (Creature* ship = _instance->GetCreature(_teamIdInInstance == TEAM_HORDE ? DATA_ORGRIMS_HAMMER : DATA_THE_SKYBREAKER))
Creature::Kill(me, ship);
}
}
void SetGUID(ObjectGuid guid, int32 id/* = 0*/) override
{
if (id != ACTION_SHIP_VISITS_ENEMY && id != ACTION_SHIP_VISITS_SELF)
@@ -807,9 +832,9 @@ public:
_events.ScheduleEvent(EVENT_INTRO_H_6, 11s);
_events.ScheduleEvent(EVENT_KEEP_PLAYER_IN_COMBAT, 1ms);
if (Creature* skybreaker = me->FindNearestCreature(NPC_THE_SKYBREAKER, 200.0f))
if (Creature* skybreaker = _instance->GetCreature(DATA_THE_SKYBREAKER))
_instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, skybreaker, 1);
if (Creature* orgrimsHammer = me->FindNearestCreature(NPC_ORGRIMS_HAMMER, 200.0f))
if (Creature* orgrimsHammer = _instance->GetCreature(DATA_ORGRIMS_HAMMER))
{
_instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, orgrimsHammer, 2);
orgrimsHammer->CastSpell(orgrimsHammer, SPELL_CHECK_FOR_PLAYERS, true);
@@ -1143,9 +1168,9 @@ public:
_events.ScheduleEvent(EVENT_INTRO_A_7, 11s);
_events.ScheduleEvent(EVENT_KEEP_PLAYER_IN_COMBAT, 1ms);
if (Creature* orgrimsHammer = me->FindNearestCreature(NPC_ORGRIMS_HAMMER, 200.0f))
if (Creature* orgrimsHammer = _instance->GetCreature(DATA_ORGRIMS_HAMMER))
_instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, orgrimsHammer, 1);
if (Creature* skybreaker = me->FindNearestCreature(NPC_THE_SKYBREAKER, 200.0f))
if (Creature* skybreaker = _instance->GetCreature(DATA_THE_SKYBREAKER))
{
_instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, skybreaker, 2);
skybreaker->CastSpell(skybreaker, SPELL_CHECK_FOR_PLAYERS, true);

View File

@@ -20,12 +20,12 @@
#include "CellImpl.h"
#include "CreatureScript.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "ObjectMgr.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellScriptLoader.h"
#include "icecrown_citadel.h"
#include "GridNotifiersImpl.h"
enum Texts
{

View File

@@ -15,12 +15,14 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "icecrown_citadel.h"
#include "AccountMgr.h"
#include "AreaTriggerScript.h"
#include "Cell.h"
#include "CellImpl.h"
#include "CreatureScript.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
#include "ObjectMgr.h"
#include "PassiveAI.h"
@@ -29,8 +31,6 @@
#include "SmartAI.h"
#include "SpellAuraEffects.h"
#include "SpellScriptLoader.h"
#include "icecrown_citadel.h"
#include "GridNotifiersImpl.h"
enum Texts
{

View File

@@ -137,6 +137,8 @@ enum DataTypes
DATA_ARTHAS_PLATFORM = 38,
DATA_TERENAS_MENETHIL = 39,
DATA_ENEMY_GUNSHIP = 40,
DATA_THE_SKYBREAKER = 41,
DATA_ORGRIMS_HAMMER = 42,
// pussywizard:
DATA_BUFF_AVAILABLE = 251,

View File

@@ -123,8 +123,10 @@ DoorData const doorData[] =
ObjectData const creatureData[] =
{
{ NPC_SINDRAGOSA, DATA_SINDRAGOSA },
{ 0, 0 }
{ NPC_SINDRAGOSA, DATA_SINDRAGOSA },
{ NPC_THE_SKYBREAKER, DATA_THE_SKYBREAKER },
{ NPC_ORGRIMS_HAMMER, DATA_ORGRIMS_HAMMER },
{ 0, 0 }
};
// this doesnt have to only store questgivers, also can be used for related quest spawns

View File

@@ -30,6 +30,7 @@ void AddSC_boss_gothik()
{
new boss_gothik();
new npc_boss_gothik_minion();
new npc_gothik_trigger();
RegisterSpellScript(spell_gothik_shadow_bolt_volley);
}

View File

@@ -34,15 +34,15 @@ enum Spells
SPELL_TELEPORT_DEAD = 28025,
SPELL_TELEPORT_LIVE = 28026,
// Visual spells
SPELL_INFORM_LIVING_TRAINEE = 27892,
SPELL_INFORM_LIVING_KNIGHT = 27928,
SPELL_INFORM_LIVING_RIDER = 27935,
SPELL_INFORM_DEAD_TRAINEE = 27915,
SPELL_INFORM_DEAD_KNIGHT = 27931,
SPELL_INFORM_DEAD_RIDER = 27937,
/*SPELL_ANCHOR_2_TRAINEE = 27893,
SPELL_ANCHOR_1_TRAINEE = 27892,
SPELL_ANCHOR_1_DK = 27928,
SPELL_ANCHOR_1_RIDER = 27935,
SPELL_ANCHOR_2_TRAINEE = 27893,
SPELL_ANCHOR_2_DK = 27929,
SPELL_ANCHOR_2_RIDER = 27936, fix me */
SPELL_ANCHOR_2_RIDER = 27936,
SPELL_SKULLS_TRAINEE = 27915,
SPELL_SKULLS_DK = 27931,
SPELL_SKULLS_RIDER = 27937,
// Living trainee
SPELL_DEATH_PLAGUE = 55604,
// Dead trainee
@@ -69,7 +69,7 @@ enum Misc
NPC_DEAD_KNIGHT = 16148,
NPC_DEAD_HORSE = 16149,
NPC_DEAD_RIDER = 16150,
//NPC_TRIGGER = 16137, fix me
NPC_TRIGGER = 16137
};
enum Events
@@ -264,31 +264,41 @@ public:
void JustSummoned(Creature* summon) override
{
summons.Summon(summon);
if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 200.0f))
// If central gate is open, attack any one
if (gateOpened)
{
if (gateOpened)
if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 200.0f))
{
summon->AI()->AttackStart(target);
summon->CallForHelp(40.0f);
summon->SetInCombatWithZone();
summon->SetReactState(REACT_AGGRESSIVE);
summon->CallForHelp(150.0f);
}
else
}
// Else look for a random target on the side the summoned NPC is
else
{
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
std::vector<Player*> tList;
for(Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
{
if (summon->GetEntry() == NPC_LIVING_TRAINEE ||
summon->GetEntry() == NPC_LIVING_KNIGHT ||
summon->GetEntry() == NPC_LIVING_RIDER )
if (!me->IsWithinDistInMap(itr->GetSource(), 200.0f, true, false) || !itr->GetSource()->IsAlive() || itr->GetSource()->IsGameMaster())
{
if (IN_LIVE_SIDE(target))
{
summon->AI()->AttackStart(target);
}
continue;
}
else
if (IN_LIVE_SIDE(itr->GetSource()) != IN_LIVE_SIDE(summon))
{
if (!IN_LIVE_SIDE(target))
{
summon->AI()->AttackStart(target);
}
continue;
}
tList.push_back(itr->GetSource());
}
if (!tList.empty())
{
Player* target = tList[urand(0, tList.size() - 1)];
summon->AI()->AttackStart(target);
summon->SetInCombatWithZone();
summon->SetReactState(REACT_AGGRESSIVE);
summon->CallForHelp(150.0f);
}
}
}
@@ -391,25 +401,6 @@ public:
return false;
}
void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
{
uint8 pos = urand(0, 4);
switch (spellInfo->Id)
{
case SPELL_INFORM_LIVING_TRAINEE:
me->SummonCreature(NPC_DEAD_TRAINEE, PosSummonDead[pos].GetPositionX(), PosSummonDead[pos].GetPositionY(), PosSummonDead[pos].GetPositionZ(), PosSummonDead[pos].GetOrientation());
break;
case SPELL_INFORM_LIVING_KNIGHT:
me->SummonCreature(NPC_DEAD_KNIGHT, PosSummonDead[pos].GetPositionX(), PosSummonDead[pos].GetPositionY(), PosSummonDead[pos].GetPositionZ(), PosSummonDead[pos].GetOrientation());
break;
case SPELL_INFORM_LIVING_RIDER:
me->SummonCreature(NPC_DEAD_RIDER, PosSummonDead[pos].GetPositionX(), PosSummonDead[pos].GetPositionY(), PosSummonDead[pos].GetPositionZ(), PosSummonDead[pos].GetOrientation());
me->SummonCreature(NPC_DEAD_HORSE, PosSummonDead[pos].GetPositionX(), PosSummonDead[pos].GetPositionY(), PosSummonDead[pos].GetPositionZ(), PosSummonDead[pos].GetOrientation());
break;
}
me->HandleEmoteCommand(EMOTE_ONESHOT_SPELL_CAST);
}
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if (!secondPhase)
@@ -580,13 +571,13 @@ public:
switch (me->GetEntry())
{
case NPC_LIVING_TRAINEE:
me->CastSpell(me, SPELL_INFORM_LIVING_TRAINEE, true);
DoCastAOE(SPELL_ANCHOR_1_TRAINEE, true);
break;
case NPC_LIVING_KNIGHT:
me->CastSpell(me, SPELL_INFORM_LIVING_KNIGHT, true);
DoCastAOE(SPELL_ANCHOR_1_DK, true);
break;
case NPC_LIVING_RIDER:
me->CastSpell(me, SPELL_INFORM_LIVING_RIDER, true);
DoCastAOE(SPELL_ANCHOR_1_RIDER, true);
break;
}
}
@@ -675,6 +666,109 @@ public:
};
};
class npc_gothik_trigger : public CreatureScript
{
public:
npc_gothik_trigger() : CreatureScript("npc_gothik_trigger") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_gothik_triggerAI(creature);
}
struct npc_gothik_triggerAI : public ScriptedAI
{
npc_gothik_triggerAI(Creature* creature) : ScriptedAI(creature) { creature->SetDisableGravity(true); }
void EnterEvadeMode(EvadeReason /*why*/) override {}
void UpdateAI(uint32 /*diff*/) override {}
void JustEngagedWith(Unit* /*who*/) override {}
void DamageTaken(Unit* /*who*/, uint32& damage, DamageEffectType /*damagetype*/, SpellSchoolMask /*damageSchoolMask*/) override { damage = 0; }
Creature* SelectRandomSkullPile()
{
std::list<Creature*> triggers;
me->GetCreatureListWithEntryInGrid(triggers, NPC_TRIGGER, 150.0f);
// Remove triggers that are on live side or soul triggers on the platform
triggers.remove_if([](Creature* trigger){
return ((trigger->GetPositionY() < POS_Y_GATE) || (trigger->GetPositionZ() > 280.0f));
});
if (!triggers.empty())
{
std::list<Creature*>::iterator itr = triggers.begin();
std::advance(itr, urand(0, triggers.size() - 1));
return *itr;
}
return nullptr;
}
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (!spell)
{
return;
}
switch (spell->Id)
{
case SPELL_ANCHOR_1_TRAINEE:
DoCastAOE(SPELL_ANCHOR_2_TRAINEE, true);
break;
case SPELL_ANCHOR_1_DK:
DoCastAOE(SPELL_ANCHOR_2_DK, true);
break;
case SPELL_ANCHOR_1_RIDER:
DoCastAOE(SPELL_ANCHOR_2_RIDER, true);
break;
case SPELL_ANCHOR_2_TRAINEE:
if (Creature* target = SelectRandomSkullPile())
{
DoCast(target, SPELL_SKULLS_TRAINEE, true);
}
break;
case SPELL_ANCHOR_2_DK:
if (Creature* target = SelectRandomSkullPile())
{
DoCast(target, SPELL_SKULLS_DK, true);
}
break;
case SPELL_ANCHOR_2_RIDER:
if (Creature* target = SelectRandomSkullPile())
{
DoCast(target, SPELL_SKULLS_RIDER, true);
}
break;
case SPELL_SKULLS_TRAINEE:
DoSummon(NPC_DEAD_TRAINEE, me, 0.0f, 15 * IN_MILLISECONDS, TEMPSUMMON_CORPSE_TIMED_DESPAWN);
break;
case SPELL_SKULLS_DK:
DoSummon(NPC_DEAD_KNIGHT, me, 0.0f, 15 * IN_MILLISECONDS, TEMPSUMMON_CORPSE_TIMED_DESPAWN);
break;
case SPELL_SKULLS_RIDER:
DoSummon(NPC_DEAD_RIDER, me, 0.0f, 15 * IN_MILLISECONDS, TEMPSUMMON_CORPSE_TIMED_DESPAWN);
DoSummon(NPC_DEAD_HORSE, me, 0.0f, 15 * IN_MILLISECONDS, TEMPSUMMON_CORPSE_TIMED_DESPAWN);
break;
}
}
// dead side summons are "owned" by gothik
void JustSummoned(Creature* summon) override
{
if (Creature* gothik = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetGuidData(DATA_GOTHIK_BOSS)))
{
gothik->AI()->JustSummoned(summon);
}
}
void SummonedCreatureDespawn(Creature* summon) override
{
if (Creature* gothik = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetGuidData(DATA_GOTHIK_BOSS)))
{
gothik->AI()->SummonedCreatureDespawn(summon);
}
}
};
};
class spell_gothik_shadow_bolt_volley : public SpellScript
{
PrepareSpellScript(spell_gothik_shadow_bolt_volley);

View File

@@ -17,8 +17,8 @@
#include "boss_maexxna.h"
#include "CreatureScript.h"
#include "Player.h"
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"

View File

@@ -137,6 +137,7 @@ public:
GuidList PatchwerkRoomTrash;
ObjectGuid _patchwerkGUID;
ObjectGuid _thaddiusGUID;
ObjectGuid _gothikGUID;
ObjectGuid _stalaggGUID;
ObjectGuid _feugenGUID;
ObjectGuid _zeliekGUID;
@@ -227,6 +228,9 @@ public:
case NPC_FEUGEN:
_feugenGUID = creature->GetGUID();
return;
case NPC_GOTHIK:
_gothikGUID = creature->GetGUID();
return;
case NPC_LADY_BLAUMEUX:
_blaumeuxGUID = creature->GetGUID();
return;
@@ -1092,6 +1096,8 @@ public:
return _stalaggGUID;
case DATA_FEUGEN_BOSS:
return _feugenGUID;
case DATA_GOTHIK_BOSS:
return _gothikGUID;
case DATA_LICH_KING_BOSS:
return _lichkingGUID;
default:

View File

@@ -58,25 +58,26 @@ enum NXData
DATA_STALAGG_BOSS = 108,
DATA_FEUGEN_BOSS = 109,
DATA_THADDIUS_GATE = 110,
DATA_GOTHIK_ENTER_GATE = 111,
DATA_GOTHIK_INNER_GATE = 112,
DATA_GOTHIK_EXIT_GATE = 113,
DATA_HORSEMEN_GATE = 114,
DATA_LICH_KING_BOSS = 115,
DATA_KELTHUZAD_FLOOR = 116,
DATA_ABOMINATION_KILLED = 117,
DATA_FRENZY_REMOVED = 118,
DATA_CHARGES_CROSSED = 119,
DATA_SPORE_KILLED = 120,
DATA_HUNDRED_CLUB = 121,
DATA_DANCE_FAIL = 122,
DATA_IMMORTAL_FAIL = 123,
DATA_KELTHUZAD_GATE = 124,
DATA_HAD_THADDIUS_GREET = 125,
DATA_KELTHUZAD_PORTAL_1 = 126,
DATA_KELTHUZAD_PORTAL_2 = 127,
DATA_KELTHUZAD_PORTAL_3 = 128,
DATA_KELTHUZAD_PORTAL_4 = 129
DATA_GOTHIK_BOSS = 111,
DATA_GOTHIK_ENTER_GATE = 112,
DATA_GOTHIK_INNER_GATE = 113,
DATA_GOTHIK_EXIT_GATE = 114,
DATA_HORSEMEN_GATE = 115,
DATA_LICH_KING_BOSS = 116,
DATA_KELTHUZAD_FLOOR = 117,
DATA_ABOMINATION_KILLED = 118,
DATA_FRENZY_REMOVED = 119,
DATA_CHARGES_CROSSED = 120,
DATA_SPORE_KILLED = 121,
DATA_HUNDRED_CLUB = 122,
DATA_DANCE_FAIL = 123,
DATA_IMMORTAL_FAIL = 124,
DATA_KELTHUZAD_GATE = 125,
DATA_HAD_THADDIUS_GREET = 126,
DATA_KELTHUZAD_PORTAL_1 = 127,
DATA_KELTHUZAD_PORTAL_2 = 128,
DATA_KELTHUZAD_PORTAL_3 = 129,
DATA_KELTHUZAD_PORTAL_4 = 130
};
enum NXGOs
@@ -162,6 +163,9 @@ enum NXNPCs
NPC_LIVING_MONSTROSITY = 16021,
NPC_SURGICAL_ASSIST = 16022,
NPC_SLUDGE_BELCHER = 16029,
// Gothik
NPC_GOTHIK = 16060
};
enum NXMisc

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "oculus.h"
#include "CombatAI.h"
#include "CreatureScript.h"
#include "InstanceScript.h"
@@ -27,7 +28,6 @@
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "Vehicle.h"
#include "oculus.h"
#include <unordered_map>
enum Drakes

View File

@@ -15,20 +15,20 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ulduar.h"
#include "AreaTriggerScript.h"
#include "CombatAI.h"
#include "CreatureScript.h"
#include "GameObjectScript.h"
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "PassiveAI.h"
#include "ScriptedGossip.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "TaskScheduler.h"
#include "Vehicle.h"
#include "ulduar.h"
enum Texts
{

View File

@@ -15,12 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "utgarde_keep.h"
#include "CreatureScript.h"
#include "GameObjectAI.h"
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "Vehicle.h"
#include "utgarde_keep.h"
class npc_dragonflayer_forge_master : public CreatureScript
{

View File

@@ -15,11 +15,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "utgarde_pinnacle.h"
#include "SpellInfo.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "Unit.h"
#include "utgarde_pinnacle.h"
enum UtgardeSpells
{

View File

@@ -121,7 +121,7 @@ public:
if (!PlayerList.IsEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* player = i->GetSource())
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->m_homebindO);
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->GetOrientation());
}
}
}

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "violet_hold.h"
#include "CreatureScript.h"
#include "GameObjectScript.h"
#include "PassiveAI.h"
@@ -24,7 +25,6 @@
#include "ScriptedGossip.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "violet_hold.h"
/// @todo: Missing Sinclari Trigger announcements (32204) Look at its creature_text for more info.
/// @todo: Activation Crystals (go_vh_activation_crystal) (193611) are spammable, should be a 1 time use per crystal.

View File

@@ -16,8 +16,8 @@
*/
#include "CreatureScript.h"
#include "Player.h"
#include "MoveSplineInit.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "World.h"

View File

@@ -22,6 +22,7 @@
#include "CreatureScript.h"
#include "CreatureTextMgr.h"
#include "GameObjectScript.h"
#include "GridNotifiersImpl.h"
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -30,7 +31,6 @@
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "Vehicle.h"
#include "GridNotifiersImpl.h"
// Ours
/********

View File

@@ -17,15 +17,15 @@
#include "OutdoorPvPNA.h"
#include "CreatureScript.h"
#include "GridNotifiers.h"
#include "ScriptedCreature.h"
#include "GameGraveyard.h"
#include "GridNotifiers.h"
#include "Language.h"
#include "MapMgr.h"
#include "ObjectMgr.h"
#include "OutdoorPvPMgr.h"
#include "OutdoorPvPScript.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "World.h"
#include "WorldPacket.h"

View File

@@ -19,10 +19,10 @@
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "TemporarySummon.h"
#include "serpent_shrine.h"
#include "ScriptedCreature.h"
DoorData const doorData[] =
{

View File

@@ -15,13 +15,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "GameObjectScript.h"
#include "ScriptMgr.h"
#include "Containers.h"
#include "CreatureScript.h"
#include "CreatureTextMgr.h"
#include "GameObject.h"
#include "GameObjectAI.h"
#include "GameObjectScript.h"
#include "Group.h"
#include "InstanceScript.h"
#include "LFGMgr.h"
@@ -30,6 +29,7 @@
#include "ObjectAccessor.h"
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellAuraEffects.h"

View File

@@ -15,13 +15,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <cmath>
#include "CreatureScript.h"
#include "MoveSplineInit.h"
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "WaypointMgr.h"
#include "the_eye.h"
#include <cmath>
enum Spells
{

View File

@@ -15,10 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "arcatraz.h"
#include "CreatureScript.h"
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "arcatraz.h"
enum MillhouseSays
{

View File

@@ -3973,7 +3973,7 @@ class spell_item_eye_of_grillok_aura : public AuraScript
return ValidateSpellInfo({ SPELL_EYE_OF_GRILLOK });
}
void OnPeriodic(AuraEffect const* aurEff)
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
Unit* caster = GetCaster();
if (!caster || !GetTarget())