Core: header cleanup, split realmlist, boost compatibility, cotire, remove stormlib/zlib and stormlib/bzip2 and instead use dep sources

This commit is contained in:
ariel- committed 2018-03-28 04:41:59 -03:00
1 parent 7fff6c424f
commit 5ff847159c
1243 files changed
+29780 -36517

No files matched your search

@@ -16,9 +16,9 @@
*/
#include "ScriptMgr.h"
#include "Channel.h"
#include "Guild.h"
#include "Group.h"
#include "DatabaseEnv.h"
#include "Player.h"
#include "WorldSession.h"
enum IPLoggingTypes
{
@@ -124,7 +124,7 @@ class AccountActionIpLogger : public AccountScript
/*case ACCOUNT_LOGOUT:
systemNote = "Logged on AccountLogout"; //Can not be logged
break;*/
// Neither should happen. Ever. Period. If it does, call Ghostbusters and all your local software defences to investigate.
// Neither should happen. Ever. Period. If it does, call Ghostbusters and all your local software defenses to investigate.
case UNKNOWN_ACTION:
default:
systemNote = "ERROR! Unknown action!";
@@ -35,10 +35,15 @@ at_brewfest
at_area_52_entrance
EndContentData */
#include "GameTime.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "DBCStructure.h"
#include "GameObject.h"
#include "GameTime.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
/*######
## at_coilfang_waterfall
@@ -17,12 +17,13 @@
*/
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "MotionMaster.h"
#include "PassiveAI.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "ScriptMgr.h"
#include "Spell.h"
#include "SpellAuraEffects.h"
#include "PassiveAI.h"
#include "SpellScript.h"
//
// Emerald Dragon NPCs and IDs (kept here for reference)
@@ -397,7 +398,7 @@ class boss_lethon : public CreatureScript
switch (eventId)
{
case EVENT_SHADOW_BOLT_WHIRL:
me->CastSpell((Unit*)NULL, SPELL_SHADOW_BOLT_WHIRL, false);
me->CastSpell((Unit*)nullptr, SPELL_SHADOW_BOLT_WHIRL, false);
events.ScheduleEvent(EVENT_SHADOW_BOLT_WHIRL, urand(15000, 30000));
break;
default:
@@ -437,7 +438,7 @@ class npc_spirit_shade : public CreatureScript
{
if (moveType == FOLLOW_MOTION_TYPE && data == _summonerGuid.GetCounter())
{
me->CastSpell((Unit*)NULL, SPELL_DARK_OFFERING, false);
me->CastSpell((Unit*)nullptr, SPELL_DARK_OFFERING, false);
me->DespawnOrUnsummon(1000);
}
}
@@ -770,11 +771,11 @@ class spell_mark_of_nature : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_MARK_OF_NATURE))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_AURA_OF_NATURE))
return false;
return true;
return ValidateSpellInfo(
{
SPELL_MARK_OF_NATURE,
SPELL_AURA_OF_NATURE
});
}
void FilterTargets(std::list<WorldObject*>& targets)
+3 -1
View File
@@ -17,8 +17,10 @@
#include "ScriptMgr.h"
#include "Channel.h"
#include "Guild.h"
#include "Group.h"
#include "Guild.h"
#include "Log.h"
#include "Player.h"
class ChatLogScript : public PlayerScript
{
+5 -2
View File
@@ -15,11 +15,14 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "GameTime.h"
#include "ScriptMgr.h"
#include "Player.h"
#include "GameTime.h"
#include "Pet.h"
#include "Player.h"
#include "SpelLHistory.h"
#include "SpellInfo.h"
#include "SpellMgr.h"
#include "World.h"
class DuelResetScript : public PlayerScript
{
+22 -17
View File
@@ -45,14 +45,20 @@ go_bells
EndContentData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "GameObjectAI.h"
#include "Spell.h"
#include "Player.h"
#include "WorldSession.h"
#include "Creature.h"
#include "CreatureAI.h"
#include "DBCStructure.h"
#include "GameEventMgr.h"
#include "GameObject.h"
#include "GameObjectAI.h"
#include "GameTime.h"
#include "Log.h"
#include "MotionMaster.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptedGossip.h"
#include "TemporarySummon.h"
#include "WorldSession.h"
/*######
## go_cat_figurine
@@ -562,7 +568,6 @@ class go_tele_to_dalaran_crystal : public GameObjectScript
return false;
player->GetSession()->SendNotification(GO_TELE_TO_DALARAN_CRYSTAL_FAILED);
return true;
}
};
@@ -1207,7 +1212,7 @@ class go_amberpine_outhouse : public GameObjectScript
if (action == GOSSIP_ACTION_INFO_DEF + 1)
{
CloseGossipMenuFor(player);
Creature* target = GetClosestCreatureWithEntry(player, NPC_OUTHOUSE_BUNNY, 3.0f);
Creature* target = player->FindNearestCreature(NPC_OUTHOUSE_BUNNY, 3.0f);
if (target)
{
target->AI()->SetData(1, player->getGender());
@@ -1315,15 +1320,15 @@ class go_veil_skith_cage : public GameObjectScript
me->UseDoorOrButton();
if (player->GetQuestStatus(QUEST_MISSING_FRIENDS) == QUEST_STATUS_INCOMPLETE)
{
std::list<Creature*> childrenList;
GetCreatureListWithEntryInGrid(childrenList, me, NPC_CAPTIVE_CHILD, INTERACTION_DISTANCE);
for (std::list<Creature*>::const_iterator itr = childrenList.begin(); itr != childrenList.end(); ++itr)
std::vector<Creature*> childrenList;
me->GetCreatureListWithEntryInGrid(childrenList, NPC_CAPTIVE_CHILD, INTERACTION_DISTANCE);
for (Creature* children : childrenList)
{
player->KilledMonsterCredit(NPC_CAPTIVE_CHILD, (*itr)->GetGUID());
(*itr)->DespawnOrUnsummon(5000);
(*itr)->GetMotionMaster()->MovePoint(1, me->GetPositionX() + 5, me->GetPositionY(), me->GetPositionZ());
(*itr)->AI()->Talk(SAY_FREE_0);
(*itr)->GetMotionMaster()->Clear();
player->KilledMonsterCredit(NPC_CAPTIVE_CHILD, children->GetGUID());
children->DespawnOrUnsummon(5000);
children->GetMotionMaster()->MovePoint(1, me->GetPositionX() + 5, me->GetPositionY(), me->GetPositionZ());
children->AI()->Talk(SAY_FREE_0);
children->GetMotionMaster()->Clear();
}
}
return false;
@@ -1655,7 +1660,7 @@ public:
break;
std::vector<Player*> playersNearby;
me->GetPlayerListInGrid(playersNearby, me->GetMap()->GetVisibilityRange());
me->GetPlayerListInGrid(playersNearby, me->GetVisibilityRange());
for (Player* player : playersNearby)
{
if (player->GetTeamId() == TEAM_HORDE)
+5 -3
View File
@@ -30,9 +30,11 @@ guard_shattrath_scryer
EndContentData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "GuardAI.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
enum GuardGeneric
@@ -120,7 +122,7 @@ public:
if (me->IsWithinMeleeRange(me->GetVictim()))
{
bool healing = false;
SpellInfo const* info = NULL;
SpellInfo const* info = nullptr;
//Select a healing spell if less than 30% hp
if (me->HealthBelowPct(30))
@@ -156,7 +158,7 @@ public:
if (!me->IsNonMeleeSpellCast(false))
{
bool healing = false;
SpellInfo const* info = NULL;
SpellInfo const* info = nullptr;
//Select a healing spell if less than 30% hp ONLY 33% of the time
if (me->HealthBelowPct(30) && 33 > urand(0, 99))
+16 -12
View File
@@ -31,9 +31,13 @@ item_only_for_flight Items which should only useable while flying
EndContentData */
#include "ScriptMgr.h"
#include "GameObject.h"
#include "Item.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "Spell.h"
#include "Player.h"
#include "SpellMgr.h"
#include "TemporarySummon.h"
/*#####
# item_only_for_flight
@@ -76,7 +80,7 @@ public:
return false;
// error
player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL);
player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, nullptr);
return true;
}
};
@@ -119,7 +123,7 @@ public:
targets.GetUnitTarget()->GetEntry() == 20748 && !targets.GetUnitTarget()->HasAura(32578))
return false;
player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL);
player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, nullptr);
return true;
}
};
@@ -139,7 +143,7 @@ public:
return false;
else
{
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL);
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, nullptr);
return true;
}
}
@@ -159,7 +163,7 @@ public:
ItemPosCountVec dest;
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 39883, 1); // Cracked Egg
if (msg == EQUIP_ERR_OK)
player->StoreNewItem(dest, 39883, true, Item::GenerateItemRandomPropertyId(39883));
player->StoreNewItem(dest, 39883, true, GenerateItemRandomPropertyId(39883));
return true;
}
@@ -179,7 +183,7 @@ public:
ItemPosCountVec dest;
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 44718, 1); // Ripe Disgusting Jar
if (msg == EQUIP_ERR_OK)
player->StoreNewItem(dest, 44718, true, Item::GenerateItemRandomPropertyId(44718));
player->StoreNewItem(dest, 44718, true, GenerateItemRandomPropertyId(44718));
return true;
}
@@ -225,7 +229,7 @@ public:
bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const & /*targets*/) override
{
GameObject* go = NULL;
GameObject* go = nullptr;
for (uint8 i = 0; i < CaribouTrapsNum; ++i)
{
go = player->FindNearestGameObject(CaribouTraps[i], 5.0f);
@@ -241,7 +245,7 @@ public:
float x, y, z;
go->GetClosePoint(x, y, z, go->GetObjectSize() / 3, 7.0f);
go->SummonGameObject(GO_HIGH_QUALITY_FUR, *go, G3D::Quat(), 1);
go->SummonGameObject(GO_HIGH_QUALITY_FUR, *go, QuaternionData(), 1);
if (TempSummon* summon = player->SummonCreature(NPC_NESINGWARY_TRAPPER, x, y, z, go->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 1000))
{
summon->SetVisible(false);
@@ -275,7 +279,7 @@ public:
if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS)
{
if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB))
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB))
Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE);
return true;
@@ -341,7 +345,7 @@ public:
if (!pMammoth)
return false;
GameObject* pTrap = NULL;
GameObject* pTrap = nullptr;
for (uint8 i = 0; i < MammothTrapsNum; ++i)
{
pTrap = player->FindNearestGameObject(MammothTraps[i], 11.0f);
@@ -375,10 +379,10 @@ public:
if (player->FindNearestCreature(NPC_VANIRAS_SENTRY_TOTEM, 10.0f))
return false;
else
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL);
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, nullptr);
}
else
player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL);
player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, nullptr);
return true;
}
};
@@ -17,8 +17,9 @@
*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "PassiveAI.h"
#include "ScriptedCreature.h"
#include "SpellMgr.h"
class trigger_periodic : public CreatureScript
{
@@ -29,13 +30,13 @@ public:
{
trigger_periodicAI(Creature* creature) : NullCreatureAI(creature)
{
spell = me->m_spells[0] ? sSpellMgr->GetSpellInfo(me->m_spells[0]) : NULL;
spell = me->m_spells[0] ? sSpellMgr->GetSpellInfo(me->m_spells[0]) : nullptr;
interval = me->GetAttackTime(BASE_ATTACK);
timer = interval;
}
uint32 timer, interval;
const SpellInfo* spell;
SpellInfo const* spell;
void UpdateAI(uint32 diff) override
{
+6 -6
View File
@@ -38,18 +38,18 @@ enum Spells
#define LOCALE_TRICK_OR_TREAT_0 "Trick or Treat!"
#define LOCALE_TRICK_OR_TREAT_2 "Des bonbons ou des blagues!"
#define LOCALE_TRICK_OR_TREAT_3 "Süßes oder Saures!"
#define LOCALE_TRICK_OR_TREAT_6 "¡Truco o trato!"
#define LOCALE_TRICK_OR_TREAT_3 "Süßes oder Saures!"
#define LOCALE_TRICK_OR_TREAT_6 "¡Truco o trato!"
#define LOCALE_INNKEEPER_0 "Make this inn my home."
#define LOCALE_INNKEEPER_2 "Faites de cette auberge votre foyer."
#define LOCALE_INNKEEPER_3 "Ich möchte dieses Gasthaus zu meinem Heimatort machen."
#define LOCALE_INNKEEPER_3 "Ich möchte dieses Gasthaus zu meinem Heimatort machen."
#define LOCALE_INNKEEPER_6 "Fija tu hogar en esta taberna."
#define LOCALE_VENDOR_0 "I want to browse your goods."
#define LOCALE_VENDOR_2 "Je voudrais regarder vos articles."
#define LOCALE_VENDOR_3 "Ich sehe mich nur mal um."
#define LOCALE_VENDOR_6 "Quiero ver tus mercancías."
#define LOCALE_VENDOR_6 "Quiero ver tus mercancías."
class npc_innkeeper : public CreatureScript
{
@@ -64,7 +64,7 @@ class npc_innkeeper : public CreatureScript
{
if (IsHolidayActive(HOLIDAY_HALLOWS_END) && !player->HasAura(SPELL_TRICK_OR_TREATED))
{
const char* localizedEntry;
char const* localizedEntry;
switch (player->GetSession()->GetSessionDbcLocale())
{
case LOCALE_frFR: localizedEntry = LOCALE_TRICK_OR_TREAT_2; break;
@@ -94,7 +94,7 @@ class npc_innkeeper : public CreatureScript
if (me->IsInnkeeper())
{
const char* localizedEntry;
char const* localizedEntry;
switch (player->GetSession()->GetSessionDbcLocale())
{
case LOCALE_frFR: localizedEntry = LOCALE_INNKEEPER_2; break;
+6 -3
View File
@@ -24,10 +24,13 @@ SDCategory: NPCs/GOBs
EndScriptData */
#include "ScriptMgr.h"
#include "Item.h"
#include "Log.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "Player.h"
#include "SpellInfo.h"
#include "SpellMgr.h"
#include "WorldSession.h"
/*
@@ -244,7 +247,7 @@ bool EquippedOk(Player* player, uint32 spellId)
if (!reqSpell)
continue;
Item* item = NULL;
Item* item = nullptr;
for (uint8 j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; ++j)
{
item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j);
@@ -368,7 +371,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_CLIENT_LOCKED_OUT, NULL, NULL);
player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, nullptr, nullptr);
CloseGossipMenuFor(player);
}
+29 -30
View File
@@ -17,26 +17,27 @@
*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "World.h"
#include "PassiveAI.h"
#include "GameEventMgr.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Cell.h"
#include "CellImpl.h"
#include "SpellHistory.h"
#include "SpellAuras.h"
#include "Pet.h"
#include "CreatureTextMgr.h"
#include "CombatAI.h"
#include "SmartAI.h"
#include "Vehicle.h"
#include "CreatureTextMgr.h"
#include "GameEventMgr.h"
#include "GridNotifiersImpl.h"
#include "Log.h"
#include "MotionMaster.h"
#include "MoveSplineInit.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "PassiveAI.h"
#include "Pet.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "ScriptMgr.h"
#include "SmartAI.h"
#include "SpellAuras.h"
#include "SpellHistory.h"
#include "SpellMgr.h"
#include "Vehicle.h"
#include "World.h"
/*########
# npc_air_force_bots
@@ -104,7 +105,7 @@ public:
{
npc_air_force_botsAI(Creature* creature) : ScriptedAI(creature)
{
SpawnAssoc = NULL;
SpawnAssoc = nullptr;
SpawnedGUID.Clear();
// find the correct spawnhandling
@@ -128,7 +129,7 @@ public:
if (!spawnedTemplate)
{
TC_LOG_ERROR("sql.sql", "TCSR: Creature template entry %u does not exist in DB, which is required by npc_air_force_bots", SpawnAssoc->spawnedCreatureEntry);
SpawnAssoc = NULL;
SpawnAssoc = nullptr;
return;
}
}
@@ -148,7 +149,7 @@ public:
else
{
TC_LOG_ERROR("sql.sql", "TCSR: npc_air_force_bots: wasn't able to spawn Creature %u", SpawnAssoc->spawnedCreatureEntry);
SpawnAssoc = NULL;
SpawnAssoc = nullptr;
}
return summoned;
@@ -157,11 +158,10 @@ public:
Creature* GetSummonedGuard()
{
Creature* creature = ObjectAccessor::GetCreature(*me, SpawnedGUID);
if (creature && creature->IsAlive())
return creature;
return NULL;
return nullptr;
}
void MoveInLineOfSight(Unit* who) override
@@ -177,7 +177,7 @@ public:
if (!playerTarget)
return;
Creature* lastSpawnedGuard = SpawnedGUID.IsEmpty() ? NULL : GetSummonedGuard();
Creature* lastSpawnedGuard = SpawnedGUID.IsEmpty() ? nullptr : GetSummonedGuard();
// prevent calling Unit::GetUnit at next MoveInLineOfSight call - speedup
if (!lastSpawnedGuard)
@@ -840,7 +840,7 @@ public:
void Initialize()
{
DoctorGUID.Clear();
Coord = NULL;
Coord = nullptr;
}
ObjectGuid DoctorGUID;
@@ -1815,7 +1815,7 @@ public:
void DamageTaken(Unit* doneBy, uint32& damage) override
{
me->AddThreat(doneBy, float(damage)); // just to create threat reference
_damageTimes[doneBy->GetGUID()] = time(NULL);
_damageTimes[doneBy->GetGUID()] = time(nullptr);
damage = 0;
}
@@ -1854,7 +1854,7 @@ public:
{
case EVENT_TD_CHECK_COMBAT:
{
time_t now = time(NULL);
time_t now = time(nullptr);
for (std::unordered_map<ObjectGuid, time_t>::iterator itr = _damageTimes.begin(); itr != _damageTimes.end();)
{
// If unit has not dealt damage to training dummy for 5 seconds, remove him from combat
@@ -2211,7 +2211,7 @@ public:
GameObject* FindNearestLauncher()
{
GameObject* launcher = NULL;
GameObject* launcher = nullptr;
if (isCluster())
{
@@ -2326,8 +2326,7 @@ public:
break;
}
const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (spellInfo && spellInfo->Effects[0].Effect == SPELL_EFFECT_SUMMON_OBJECT_WILD)
return spellInfo->Effects[0].MiscValue;
@@ -2371,7 +2370,7 @@ public:
float displacement = 0.7f;
for (uint8 i = 0; i < 4; i++)
me->SummonGameObject(GetFireworkGameObjectId(), me->GetPositionX() + (i % 2 == 0 ? displacement : -displacement), me->GetPositionY() + (i > 1 ? displacement : -displacement), me->GetPositionZ() + 4.0f, me->GetOrientation(), G3D::Quat(), 1);
me->SummonGameObject(GetFireworkGameObjectId(), me->GetPositionX() + (i % 2 == 0 ? displacement : -displacement), me->GetPositionY() + (i > 1 ? displacement : -displacement), me->GetPositionZ() + 4.0f, me->GetOrientation(), QuaternionData(), 1);
}
else
//me->CastSpell(me, GetFireworkSpell(me->GetEntry()), true);