Merge branch 'master' into Playerbot

This commit is contained in:
Oiuv
2023-12-28 17:33:26 +08:00
83 changed files with 805 additions and 300 deletions

View File

@@ -19,7 +19,6 @@
#include "CommandScript.h"
#include "DatabaseEnv.h"
#include "Item.h"
#include "Language.h"
#include "Mail.h"
#include "ObjectMgr.h"
#include "Pet.h"

View File

@@ -24,10 +24,8 @@
#include "Chat.h"
#include "CommandScript.h"
#include "Config.h"
#include "GameTime.h"
#include "GitRevision.h"
#include "Language.h"
#include "ModuleMgr.h"
#include "MotdMgr.h"
#include "MySQLThreading.h"

View File

@@ -21,7 +21,6 @@
#include "Chat.h"
#include "CommandScript.h"
#include "Player.h"
#include "World.h"
using namespace Acore::ChatCommands;

View File

@@ -27,7 +27,6 @@ EndScriptData */
#include "DBCStores.h"
#include "DatabaseEnv.h"
#include "Group.h"
#include "Language.h"
#include "MapMgr.h"
#include "ObjectMgr.h"
#include "Player.h"

View File

@@ -26,7 +26,6 @@ EndScriptData */
#include "Chat.h"
#include "CommandScript.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "Player.h"
#include "Realm.h"
#include "TicketMgr.h"

View File

@@ -25,7 +25,6 @@ EndScriptData */
#include "Chat.h"
#include "CommandScript.h"
#include "DBCStores.h"
#include "Language.h"
#include "Player.h"
using namespace Acore::ChatCommands;

View File

@@ -24,7 +24,6 @@ EndScriptData */
#include "Chat.h"
#include "CommandScript.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "WaypointMgr.h"

View File

@@ -1,34 +0,0 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 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 Affero 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: Alterac_Mountains
SD%Complete: 0
SDComment: Placeholder
SDCategory: Alterac Mountains
EndScriptData */
/* ContentData
EndContentData */
//#include "CreatureScript.h"
//#include "ScriptedCreature.h"
/*void AddSC_alterac_mountains()
{
Script* newscript;
}*/

View File

@@ -1,18 +0,0 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 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 Affero 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/>.
*/
//void AddSC_ironforge() { }

View File

@@ -16,9 +16,11 @@
*/
#include "CreatureScript.h"
#include "GameEventMgr.h"
#include "GameObjectScript.h"
#include "GameTime.h"
#include "Player.h"
#include "PlayerScript.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "Spell.h"
@@ -29,10 +31,28 @@
enum eBonfire
{
GO_MIDSUMMER_BONFIRE = 181288,
GO_MIDSUMMER_BONFIRE_CAMPFIRE_SPELL_FOCUS = 181377,
GO_AHUNE_BONFIRE = 188073,
SPELL_MIDSUMMER_BONFIRE_BUNNIES_2 = 29114,
SPELL_STAMP_OUT_BONFIRE = 45437,
SPELL_LIGHT_BONFIRE = 29831,
SPELL_STAMP_OUT_BONFIRE_ART_KIT = 46903,
SPELL_TOSS_FUEL_ON_BONFIRE = 28806,
SPELL_LIGHT_BONFIRE_ART_KIT = 46904,
SPELL_BONFIRES_BLESSING = 45444,
BONFIRE_TYPE_NONE = 0,
BONFIRE_TYPE_ALLIANCE = 1,
BONFIRE_TYPE_HORDE = 2,
BONFIRE_TYPE_CITY = 3,
BONFIRE_TYPE_AHUNE = 4,
COUNT_GO_BONFIRE_ALLIANCE = 40,
COUNT_GO_BONFIRE_HORDE = 38,
COUNT_GO_BONFIRE_CITY = 9,
};
class go_midsummer_bonfire : public GameObjectScript
@@ -49,6 +69,313 @@ public:
}
};
static bool BonfireStampedOutState[COUNT_GO_BONFIRE_ALLIANCE + COUNT_GO_BONFIRE_HORDE];
// <mapId, zoneId, teamId>, <state>
const std::map<std::tuple<uint32, uint32, TeamId>, bool*> BonfireStateStore = {
// Map 0
{ { 0, 1, TEAM_ALLIANCE }, &BonfireStampedOutState[0] },
{ { 0, 3, TEAM_HORDE }, &BonfireStampedOutState[1] },
{ { 0, 4, TEAM_ALLIANCE }, &BonfireStampedOutState[2] },
{ { 0, 8, TEAM_HORDE }, &BonfireStampedOutState[3] },
{ { 0, 10, TEAM_ALLIANCE }, &BonfireStampedOutState[4] },
{ { 0, 11, TEAM_ALLIANCE }, &BonfireStampedOutState[5] },
{ { 0, 12, TEAM_ALLIANCE }, &BonfireStampedOutState[6] },
{ { 0, 28, TEAM_ALLIANCE }, &BonfireStampedOutState[7] },
{ { 0, 33, TEAM_ALLIANCE }, &BonfireStampedOutState[8] },
{ { 0, 33, TEAM_HORDE }, &BonfireStampedOutState[9] },
{ { 0, 38, TEAM_ALLIANCE }, &BonfireStampedOutState[10] },
{ { 0, 40, TEAM_ALLIANCE }, &BonfireStampedOutState[11] },
{ { 0, 44, TEAM_ALLIANCE }, &BonfireStampedOutState[12] },
{ { 0, 45, TEAM_ALLIANCE }, &BonfireStampedOutState[13] },
{ { 0, 45, TEAM_HORDE }, &BonfireStampedOutState[14] },
{ { 0, 46, TEAM_ALLIANCE }, &BonfireStampedOutState[15] },
{ { 0, 46, TEAM_HORDE }, &BonfireStampedOutState[16] },
{ { 0, 47, TEAM_ALLIANCE }, &BonfireStampedOutState[17] },
{ { 0, 47, TEAM_HORDE }, &BonfireStampedOutState[18] },
{ { 0, 85, TEAM_HORDE }, &BonfireStampedOutState[19] },
{ { 0, 130, TEAM_HORDE }, &BonfireStampedOutState[20] },
{ { 0, 267, TEAM_ALLIANCE }, &BonfireStampedOutState[21] },
{ { 0, 267, TEAM_HORDE }, &BonfireStampedOutState[22] },
// Map 1
{ { 1, 14, TEAM_HORDE }, &BonfireStampedOutState[23] },
{ { 1, 15, TEAM_ALLIANCE }, &BonfireStampedOutState[24] },
{ { 1, 15, TEAM_HORDE }, &BonfireStampedOutState[25] },
{ { 1, 17, TEAM_HORDE }, &BonfireStampedOutState[26] },
{ { 1, 141, TEAM_ALLIANCE }, &BonfireStampedOutState[27] },
{ { 1, 148, TEAM_ALLIANCE }, &BonfireStampedOutState[28] },
{ { 1, 215, TEAM_HORDE }, &BonfireStampedOutState[29] },
{ { 1, 331, TEAM_ALLIANCE }, &BonfireStampedOutState[30] },
{ { 1, 331, TEAM_HORDE }, &BonfireStampedOutState[31] },
{ { 1, 357, TEAM_ALLIANCE }, &BonfireStampedOutState[32] },
{ { 1, 357, TEAM_HORDE }, &BonfireStampedOutState[33] },
{ { 1, 400, TEAM_HORDE }, &BonfireStampedOutState[34] },
{ { 1, 405, TEAM_ALLIANCE }, &BonfireStampedOutState[35] },
{ { 1, 405, TEAM_HORDE }, &BonfireStampedOutState[36] },
{ { 1, 406, TEAM_HORDE }, &BonfireStampedOutState[37] },
{ { 1, 440, TEAM_ALLIANCE }, &BonfireStampedOutState[38] },
{ { 1, 440, TEAM_HORDE }, &BonfireStampedOutState[39] },
{ { 1, 618, TEAM_ALLIANCE }, &BonfireStampedOutState[40] },
{ { 1, 618, TEAM_HORDE }, &BonfireStampedOutState[41] },
{ { 1, 1377, TEAM_ALLIANCE }, &BonfireStampedOutState[42] },
{ { 1, 1377, TEAM_HORDE }, &BonfireStampedOutState[43] },
// Map 530
{ { 530, 3430, TEAM_HORDE }, &BonfireStampedOutState[44] },
{ { 530, 3433, TEAM_HORDE }, &BonfireStampedOutState[45] },
{ { 530, 3483, TEAM_ALLIANCE }, &BonfireStampedOutState[46] },
{ { 530, 3483, TEAM_HORDE }, &BonfireStampedOutState[47] },
{ { 530, 3518, TEAM_ALLIANCE }, &BonfireStampedOutState[48] },
{ { 530, 3518, TEAM_HORDE }, &BonfireStampedOutState[49] },
{ { 530, 3519, TEAM_ALLIANCE }, &BonfireStampedOutState[50] },
{ { 530, 3519, TEAM_HORDE }, &BonfireStampedOutState[51] },
{ { 530, 3520, TEAM_ALLIANCE }, &BonfireStampedOutState[52] },
{ { 530, 3520, TEAM_HORDE }, &BonfireStampedOutState[53] },
{ { 530, 3521, TEAM_ALLIANCE }, &BonfireStampedOutState[54] },
{ { 530, 3521, TEAM_HORDE }, &BonfireStampedOutState[55] },
{ { 530, 3522, TEAM_ALLIANCE }, &BonfireStampedOutState[56] },
{ { 530, 3522, TEAM_HORDE }, &BonfireStampedOutState[57] },
{ { 530, 3523, TEAM_ALLIANCE }, &BonfireStampedOutState[58] },
{ { 530, 3523, TEAM_HORDE }, &BonfireStampedOutState[59] },
{ { 530, 3524, TEAM_ALLIANCE }, &BonfireStampedOutState[60] },
{ { 530, 3525, TEAM_ALLIANCE }, &BonfireStampedOutState[61] },
// Map 571
{ { 571, 65, TEAM_ALLIANCE }, &BonfireStampedOutState[62] },
{ { 571, 65, TEAM_HORDE }, &BonfireStampedOutState[63] },
{ { 571, 66, TEAM_ALLIANCE }, &BonfireStampedOutState[64] },
{ { 571, 66, TEAM_HORDE }, &BonfireStampedOutState[65] },
{ { 571, 67, TEAM_ALLIANCE }, &BonfireStampedOutState[66] },
{ { 571, 67, TEAM_HORDE }, &BonfireStampedOutState[67] },
{ { 571, 394, TEAM_ALLIANCE }, &BonfireStampedOutState[68] },
{ { 571, 394, TEAM_HORDE }, &BonfireStampedOutState[69] },
{ { 571, 495, TEAM_ALLIANCE }, &BonfireStampedOutState[70] },
{ { 571, 495, TEAM_HORDE }, &BonfireStampedOutState[71] },
{ { 571, 2817, TEAM_ALLIANCE }, &BonfireStampedOutState[72] },
{ { 571, 2817, TEAM_HORDE }, &BonfireStampedOutState[73] },
{ { 571, 3537, TEAM_ALLIANCE }, &BonfireStampedOutState[74] },
{ { 571, 3537, TEAM_HORDE }, &BonfireStampedOutState[75] },
{ { 571, 3711, TEAM_ALLIANCE }, &BonfireStampedOutState[76] },
{ { 571, 3711, TEAM_HORDE }, &BonfireStampedOutState[77] },
};
uint32 const GoBonfireAlliance[COUNT_GO_BONFIRE_ALLIANCE] = { 187564, 187914, 187916, 187917, 187919, 187920, 187921, 187922, 187923, 187924, 187925, 187926, 187927, 187928, 187929, 187930, 187931, 187932, 187933, 187934, 187935, 187936, 187937, 187938, 187939, 187940, 187941, 187942, 187943, 187944, 187945, 187946, 194032, 194035, 194036, 194038, 194040, 194044, 194045, 194049 };
uint32 const GoBonfireHorde[COUNT_GO_BONFIRE_HORDE] = { 187559, 187947, 187948, 187949, 187950, 187951, 187952, 187953, 187954, 187955, 187956, 187957, 187958, 187959, 187960, 187961, 187962, 187963, 187964, 187965, 187966, 187967, 187968, 187969, 187970, 187971, 187972, 187973, 187974, 187975, 194033, 194034, 194037, 194039, 194042, 194043, 194046, 194048 };
uint32 const GoBonfireCity[COUNT_GO_BONFIRE_CITY] = { 181332, 181333, 181334, 181335, 181336, 181337, 188128, 188129, 188352 };
class MidsummerPlayerScript : public PlayerScript
{
public:
MidsummerPlayerScript() : PlayerScript("MidsummerPlayerScript")
{
}
void OnUpdateZone(Player* player, uint32 newZone, uint32 /*newArea*/) override
{
if (!IsHolidayActive(HOLIDAY_FIRE_FESTIVAL))
return;
auto itr = BonfireStateStore.find(std::make_tuple(player->GetMapId(), newZone, player->GetTeamId()));
if ((itr != BonfireStateStore.end()) && (itr->second))
{
if (!(*(itr->second)))
{
if (!player->HasAura(SPELL_BONFIRES_BLESSING))
player->CastSpell(player, SPELL_BONFIRES_BLESSING, true);
return;
}
}
player->RemoveAurasDueToSpell(SPELL_BONFIRES_BLESSING);
}
};
struct npc_midsummer_bonfire : public ScriptedAI
{
npc_midsummer_bonfire(Creature* creature) : ScriptedAI(creature)
{
_isStampedOut = nullptr;
_teamId = TEAM_NEUTRAL;
_type = BONFIRE_TYPE_NONE;
_spellFocus = nullptr;
if (!IsHolidayActive(HOLIDAY_FIRE_FESTIVAL))
return;
scheduler.Schedule(420ms, [this](TaskContext context)
{
if (!InitBonfire())
context.Repeat();
});
}
void Ignite()
{
if (_isStampedOut)
*_isStampedOut = false;
if (!_spellFocus)
{
DoCastSelf(SPELL_MIDSUMMER_BONFIRE_BUNNIES_2, true);
if ((_spellFocus = me->FindNearestGameObject(GO_MIDSUMMER_BONFIRE_CAMPFIRE_SPELL_FOCUS, 10.0f)))
me->AddGameObject(_spellFocus);
}
switch (_type)
{
case BONFIRE_TYPE_ALLIANCE:
case BONFIRE_TYPE_HORDE:
DoCastSelf(SPELL_LIGHT_BONFIRE_ART_KIT, true);
UpdateBonfireBlessingBuffs();
break;
case BONFIRE_TYPE_AHUNE:
if (_bonfire)
_bonfire->SetGoState(GO_STATE_ACTIVE);
break;
default:
break;
}
}
void StampOut()
{
switch (_type)
{
case BONFIRE_TYPE_ALLIANCE:
case BONFIRE_TYPE_HORDE:
if (_isStampedOut)
*_isStampedOut = true;
if (_spellFocus)
{
_spellFocus->DespawnOrUnsummon();
_spellFocus = nullptr;
}
DoCastSelf(SPELL_STAMP_OUT_BONFIRE_ART_KIT, true);
UpdateBonfireBlessingBuffs();
break;
default:
break;
}
}
void UpdateBonfireBlessingBuffs()
{
if ((_type != BONFIRE_TYPE_ALLIANCE) && (_type != BONFIRE_TYPE_HORDE))
return;
me->GetMap()->DoForAllPlayers([&](Player* p)
{
if ((p->GetZoneId() == me->GetZoneId()) && (p->GetTeamId() == _teamId))
{
if (_isStampedOut)
{
if (*_isStampedOut)
p->RemoveAurasDueToSpell(SPELL_BONFIRES_BLESSING);
else
{
if (!p->HasAura(SPELL_BONFIRES_BLESSING))
p->CastSpell(p, SPELL_BONFIRES_BLESSING, true);
}
}
}
});
}
bool InitBonfire()
{
_type = BONFIRE_TYPE_NONE;
_teamId = TEAM_NEUTRAL;
for (uint32 i = 0; (i < COUNT_GO_BONFIRE_ALLIANCE) && (_type == BONFIRE_TYPE_NONE); i++)
{
if ((_bonfire = me->FindNearestGameObject(GoBonfireAlliance[i], 10.0f)))
{
_type = BONFIRE_TYPE_ALLIANCE;
_teamId = TEAM_ALLIANCE;
}
}
for (uint32 i = 0; (i < COUNT_GO_BONFIRE_HORDE) && (_type == BONFIRE_TYPE_NONE); i++)
{
if ((_bonfire = me->FindNearestGameObject(GoBonfireHorde[i], 10.0f)))
{
_type = BONFIRE_TYPE_HORDE;
_teamId = TEAM_HORDE;
}
}
for (uint32 i = 0; (i < COUNT_GO_BONFIRE_CITY) && (_type == BONFIRE_TYPE_NONE); i++)
{
if ((_bonfire = me->FindNearestGameObject(GoBonfireCity[i], 10.0f)))
{
_type = BONFIRE_TYPE_CITY;
return true;
}
}
if ((_type == BONFIRE_TYPE_NONE) && (_bonfire = me->FindNearestGameObject(GO_AHUNE_BONFIRE, 10.0f)))
{
_type = BONFIRE_TYPE_AHUNE;
return true;
}
if (_type == BONFIRE_TYPE_NONE)
return false;
auto itr = BonfireStateStore.find(std::make_tuple(me->GetMapId(), me->GetZoneId(), _teamId));
if ((itr != BonfireStateStore.end()) && (itr->second))
_isStampedOut = itr->second;
else
LOG_ERROR("scripts.midsummer", "NPC {} (GUID{}) in map {}, zone {} with teamId {} can't locate its entry within BonfireStateStore", me->GetGUID().GetEntry(), me->GetSpawnId(), me->GetMapId(), me->GetZoneId(), _teamId);
Ignite();
return true;
}
void SpellHit(Unit* caster, SpellInfo const* spellInfo) override
{
if (caster->GetTypeId() != TYPEID_PLAYER)
return;
switch (spellInfo->Id)
{
case SPELL_TOSS_FUEL_ON_BONFIRE:
{
Ignite();
break;
}
case SPELL_STAMP_OUT_BONFIRE:
{
StampOut();
// desecrating other faction's bonfire flags player for PVP
caster->SetPvP(true);
break;
}
default:
break;
}
}
void UpdateAI(uint32 diff) override
{
scheduler.Update(diff);
}
private:
bool* _isStampedOut;
TeamId _teamId;
uint8 _type;
GameObject* _spellFocus;
GameObject* _bonfire;
};
enum torchToss
{
GO_TORCH_TARGET_BRAZIER = 187708,
@@ -172,6 +499,30 @@ struct npc_midsummer_torch_target : public ScriptedAI
// SPELLS
///////////////////////////////
class spell_bonfires_blessing : public AuraScript
{
PrepareAuraScript(spell_bonfires_blessing)
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_BONFIRES_BLESSING });
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (!IsHolidayActive(HOLIDAY_FIRE_FESTIVAL))
{
if (Unit* target = GetTarget())
target->RemoveAurasDueToSpell(SPELL_BONFIRES_BLESSING);
}
}
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_bonfires_blessing::OnApply, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
enum CrabDisguise
{
SPELL_CRAB_DISGUISE = 46337,
@@ -879,12 +1230,17 @@ class spell_midsummer_torch_catch : public SpellScript
void AddSC_event_midsummer_scripts()
{
// Player
new MidsummerPlayerScript();
// NPCs
new go_midsummer_bonfire();
RegisterCreatureAI(npc_midsummer_bonfire);
RegisterCreatureAI(npc_midsummer_torch_target);
RegisterCreatureAI(npc_midsummer_ribbon_pole_target);
// Spells
RegisterSpellScript(spell_bonfires_blessing);
RegisterSpellScript(spell_gen_crab_disguise);
RegisterSpellScript(spell_midsummer_ribbon_pole_firework);
RegisterSpellScript(spell_midsummer_ribbon_pole);

View File

@@ -23,7 +23,6 @@ SDCategory: Caverns of Time, Mount Hyjal
EndScriptData */
#include "Chat.h"
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "Opcodes.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "EventMap.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"

View File

@@ -15,11 +15,9 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "TemporarySummon.h"
#include "the_black_morass.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"

View File

@@ -23,7 +23,6 @@
#include "GridNotifiersImpl.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
/*######
## npc_belnistrasz for Quest 3525 "Extinguishing the Idol"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"

View File

@@ -19,7 +19,6 @@
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "TaskScheduler.h"
#include "ruins_of_ahnqiraj.h"
enum Emotes

View File

@@ -16,7 +16,6 @@
*/
#include "CreatureGroups.h"
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "Player.h"

View File

@@ -16,7 +16,6 @@
*/
#include "CreatureGroups.h"
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "Player.h"

View File

@@ -17,14 +17,12 @@
#include "zulfarrak.h"
#include "Cell.h"
#include "CellImpl.h"
#include "CreatureScript.h"
#include "GameObject.h"
#include "GameObjectAI.h"
#include "GameObjectScript.h"
#include "GridNotifiers.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptSystem.h"

View File

@@ -16,7 +16,6 @@
*/
#include "CreatureScript.h"
#include "GameTime.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "Group.h"
#include "Player.h"
#include "ScriptedCreature.h"

View File

@@ -35,7 +35,6 @@ EndContentData */
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "SpellInfo.h"
/*######

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "Player.h"
#include "ScriptedCreature.h"

View File

@@ -17,7 +17,6 @@
#include "AreaBoundary.h"
#include "CreatureAIImpl.h"
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "Player.h"
#include "ScriptedCreature.h"

View File

@@ -25,7 +25,6 @@
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "Vehicle.h"
#include "WorldSession.h"
#include "ruby_sanctum.h"
enum Texts

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "Group.h"
#include "InstanceMapScript.h"
#include "Player.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "GameTime.h"
#include "Group.h"
#include "InstanceMapScript.h"

View File

@@ -23,7 +23,6 @@
#include "SpellAuras.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "WorldSession.h"
#include "pit_of_saron.h"
enum Yells

View File

@@ -24,7 +24,6 @@
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "Vehicle.h"
#include "WorldSession.h"
#include "pit_of_saron.h"
enum Yells

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "ScriptedCreature.h"
#include "gundrak.h"

View File

@@ -32,7 +32,6 @@
#include "Vehicle.h"
#include "Weather.h"
#include "icecrown_citadel.h"
#include "GridNotifiersImpl.h"
enum Texts
{

View File

@@ -16,7 +16,6 @@
*/
#include "AreaTriggerScript.h"
#include "CreatureScript.h"
#include "GameObjectScript.h"
#include "InstanceScript.h"
#include "Player.h"

View File

@@ -16,7 +16,6 @@
*/
#include "AccountMgr.h"
#include "CreatureScript.h"
#include "CreatureTextMgr.h"
#include "Group.h"
#include "InstanceMapScript.h"

View File

@@ -18,7 +18,6 @@
#include "CombatAI.h"
#include "CreatureScript.h"
#include "GameObjectScript.h"
#include "MoveSpline.h"
#include "MoveSplineInit.h"
#include "Opcodes.h"
#include "PassiveAI.h"

View File

@@ -19,7 +19,6 @@
#include "CreatureScript.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "nexus.h"
enum Spells

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "Group.h"
#include "InstanceMapScript.h"
#include "LFGMgr.h"

View File

@@ -18,7 +18,6 @@
#include "CombatAI.h"
#include "CreatureScript.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "SpellInfo.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"

View File

@@ -26,7 +26,6 @@
#include "SpellInfo.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "WorldSession.h"
// Ours
enum eDrakeHunt

View File

@@ -25,7 +25,6 @@
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellAuraEffects.h"
#include "SpellAuras.h"
#include "SpellScript.h"

View File

@@ -26,7 +26,6 @@
#include "SpellScriptLoader.h"
#include "Vehicle.h"
#include "WaypointMgr.h"
#include "WorldSession.h"
// Ours
enum qSniffing

View File

@@ -17,7 +17,6 @@
#include "OutdoorPvPZM.h"
#include "Creature.h"
#include "CreatureScript.h"
#include "GameGraveyard.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "Map.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "Map.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "sethekk_halls.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "SpellScriptLoader.h"

View File

@@ -79,9 +79,26 @@ struct boss_the_lurker_below : public BossAI
void EnterEvadeMode(EvadeReason why) override
{
BossAI::EnterEvadeMode(why);
if (GameObject* pool = instance->GetGameObject(DATA_STRANGE_POOL))
{
pool->Respawn();
}
me->DespawnOrUnsummon(2000);
}
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*type*/, SpellSchoolMask /*school*/) override
{
if (damage >= me->GetHealth())
{
// Liquid state around his area is working awkwardly and doesn't consider him to be swimming
// Therefore he falls to the bottom of the lake when he dies, because he is "flying" in his pool
// Removing this prevents him from dropping to the bottom of the lake
// There is also a visual issue currently causing him to drop to the bottom of the lake but his body not update clientside
// So it looks as if he was floating but he has in fact dropped to the bottom of the lake, and thus becomes unlootable
me->SetDisableGravity(false);
}
}
void DoAction(int32 action) override
{
if (action == ACTION_START_EVENT)
@@ -228,6 +245,10 @@ public:
player->CastSpell(player, SPELL_LURKER_SPAWN_TRIGGER, true);
if (Creature* lurker = go->SummonCreature(NPC_THE_LURKER_BELOW, 38.4567f, -417.324f, -18.916666f, 2.94960f, TEMPSUMMON_MANUAL_DESPAWN))
lurker->AI()->DoAction(ACTION_START_EVENT);
go->DespawnOrUnsummon();
go->SetRespawnDelay(7 * DAY);
go->SaveRespawnTime();
return true;
}

View File

@@ -40,6 +40,12 @@ ObjectData const creatureData[] =
{ 0, 0 }
};
ObjectData const gameObjectData[] =
{
{ GO_STRANGE_POOL, DATA_STRANGE_POOL },
{ 0, 0 }
};
MinionData const minionData[] =
{
{ NPC_FATHOM_GUARD_SHARKKIS, DATA_FATHOM_LORD_KARATHRESS },
@@ -69,7 +75,7 @@ public:
SetHeaders(DataHeader);
SetBossNumber(MAX_ENCOUNTERS);
LoadDoorData(doorData);
LoadObjectData(creatureData, nullptr);
LoadObjectData(creatureData, gameObjectData);
LoadMinionData(minionData);
LoadBossBoundaries(boundaries);

View File

@@ -45,6 +45,7 @@ enum DataTypes
DATA_ALIVE_KEEPERS = 22,
DATA_BRIDGE_ACTIVATED = 23,
DATA_ACTIVATE_SHIELD = 24,
DATA_STRANGE_POOL = 25
};
enum SSNPCs
@@ -77,7 +78,9 @@ enum SSNPCs
GO_SHIELD_GENERATOR1 = 185051,
GO_SHIELD_GENERATOR2 = 185052,
GO_SHIELD_GENERATOR3 = 185053,
GO_SHIELD_GENERATOR4 = 185054
GO_SHIELD_GENERATOR4 = 185054,
GO_STRANGE_POOL = 184956
};
enum SSSpells

View File

@@ -23,7 +23,6 @@
*/
#include "Creature.h"
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "Map.h"

View File

@@ -17,7 +17,6 @@
#include "the_slave_pens.h"
#include "AreaTriggerScript.h"
#include "CreatureScript.h"
#include "InstanceScript.h"
#include "Player.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "GameObjectScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "Map.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "gruuls_lair.h"

View File

@@ -16,7 +16,6 @@
*/
#include "CreatureAI.h"
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "blood_furnace.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "hellfire_ramparts.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "magtheridons_lair.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "SpellScriptLoader.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "mechanar.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "arcatraz.h"

View File

@@ -17,7 +17,6 @@
#include "Battleground.h"
#include "CreatureScript.h"
#include "GameTime.h"
#include "ObjectMgr.h"
#include "Pet.h"
#include "Player.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "Group.h"
#include "Player.h"
#include "SpellAuraEffects.h"

View File

@@ -1418,7 +1418,7 @@ public:
{
stoneSpell = SPELL_CREATE_MASTER_HEALTH_STONE_R1;
}
else if (owner->HasAura(SPELL_CREATE_MASTER_HEALTH_STONE_R2))
else if (owner->HasAura(SPELL_IMPROVED_HEALTH_STONE_R2))
{
stoneSpell = SPELL_CREATE_MASTER_HEALTH_STONE_R2;
}
@@ -1432,7 +1432,7 @@ public:
{
stoneSpell = SPELL_CREATE_FEL_HEALTH_STONE_R1;
}
else if (owner->HasAura(SPELL_CREATE_MASTER_HEALTH_STONE_R2))
else if (owner->HasAura(SPELL_IMPROVED_HEALTH_STONE_R2))
{
stoneSpell = SPELL_CREATE_FEL_HEALTH_STONE_R2;
}

View File

@@ -15,159 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Generic_Creature
SD%Complete: 80
SDComment: Should be replaced with core based AI
SDCategory: Creatures
EndScriptData */
#include "CreatureScript.h"
#include "PassiveAI.h"
#include "ScriptedCreature.h"
#define GENERIC_CREATURE_COOLDOWN 5000
class generic_creature : public CreatureScript
{
public:
generic_creature() : CreatureScript("generic_creature") { }
struct generic_creatureAI : public ScriptedAI
{
generic_creatureAI(Creature* creature) : ScriptedAI(creature) { }
uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds)
uint32 BuffTimer; //This variable keeps track of buffs
bool IsSelfRooted;
void Reset() override
{
GlobalCooldown = 0;
BuffTimer = 0; //Rebuff as soon as we can
IsSelfRooted = false;
}
void JustEngagedWith(Unit* who) override
{
if (!me->IsWithinMeleeRange(who))
IsSelfRooted = true;
}
void UpdateAI(uint32 diff) override
{
//Always decrease our global cooldown first
if (GlobalCooldown > diff)
GlobalCooldown -= diff;
else GlobalCooldown = 0;
//Buff timer (only buff when we are alive and not in combat
if (!me->IsInCombat() && me->IsAlive())
{
if (BuffTimer <= diff)
{
//Find a spell that targets friendly and applies an aura (these are generally buffs)
SpellInfo const* info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
if (info && !GlobalCooldown)
{
//Cast the buff spell
DoCastSpell(me, info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
//Set our timer to 10 minutes before rebuff
BuffTimer = 600000;
}//Try agian in 30 seconds
else BuffTimer = 30000;
}
else BuffTimer -= diff;
}
//Return since we have no target
if (!UpdateVictim())
return;
//If we are within range melee the target
if (me->IsWithinMeleeRange(me->GetVictim()))
{
//Make sure our attack is ready and we arn't currently casting
if (me->isAttackReady() && !me->IsNonMeleeSpellCast(false))
{
bool Healing = false;
SpellInfo const* info = nullptr;
//Select a healing spell if less than 30% hp
if (HealthBelowPct(30))
info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
//No healing spell available, select a hostile spell
if (info) Healing = true;
else info = SelectSpell(me->GetVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE);
//50% chance if elite or higher, 20% chance if not, to replace our white hit with a spell
if (info && (rand() % (me->GetCreatureTemplate()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown)
{
//Cast the spell
if (Healing)DoCastSpell(me, info);
else DoCastSpell(me->GetVictim(), info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
}
else me->AttackerStateUpdate(me->GetVictim());
me->resetAttackTimer();
}
}
else
{
//Only run this code if we arn't already casting
if (!me->IsNonMeleeSpellCast(false))
{
bool Healing = false;
SpellInfo const* info = nullptr;
//Select a healing spell if less than 30% hp ONLY 33% of the time
if (HealthBelowPct(30) && rand() % 3 == 0)
info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
//No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE)
if (info) Healing = true;
else info = SelectSpell(me->GetVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, NOMINAL_MELEE_RANGE, 0, SELECT_EFFECT_DONTCARE);
//Found a spell, check if we arn't on cooldown
if (info && !GlobalCooldown)
{
//If we are currently moving stop us and set the movement generator
if (!IsSelfRooted)
IsSelfRooted = true;
//Cast spell
if (Healing) DoCastSpell(me, info);
else DoCastSpell(me->GetVictim(), info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
}//If no spells available and we arn't moving run to target
else if (IsSelfRooted)
{
//Cancel our current spell and then allow movement agian
me->InterruptNonMeleeSpells(false);
IsSelfRooted = false;
}
}
}
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return new generic_creatureAI(creature);
}
};
class trigger_periodic : public CreatureScript
{
public:
@@ -204,30 +55,7 @@ public:
}
};
class trigger_death : public CreatureScript
{
public:
trigger_death() : CreatureScript("trigger_death") { }
struct trigger_deathAI : public NullCreatureAI
{
trigger_deathAI(Creature* creature) : NullCreatureAI(creature) { }
void JustDied(Unit* killer) override
{
if (killer && me->m_spells[0])
me->CastSpell(killer, me->m_spells[0], true);
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return new trigger_deathAI(creature);
}
};
void AddSC_generic_creature()
{
//new generic_creature;
new trigger_periodic;
//new trigger_death;
}