Skip to content

Commit

Permalink
Merge branch 'ObjectGuid' of https://github.com/TrinityCore/TrinityCore
Browse files Browse the repository at this point in the history
Conflicts:
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Player/Player.h
	src/server/game/Scripting/MapScripts.cpp
	src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
	src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
	src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp
	src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp
	src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
	src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp
	src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp
	src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
	src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
	src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
	src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
	src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
	src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
	src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
  • Loading branch information
Shauren committed Sep 16, 2014
2 parents 6810a44 + 9b933b4 commit 7d1d551
Show file tree
Hide file tree
Showing 545 changed files with 6,749 additions and 7,502 deletions.
16 changes: 8 additions & 8 deletions sql/base/characters_database.sql
Expand Up @@ -1621,14 +1621,14 @@ CREATE TABLE `groups` (
`lootMethod` tinyint(3) unsigned NOT NULL,
`looterGuid` int(10) unsigned NOT NULL,
`lootThreshold` tinyint(3) unsigned NOT NULL,
`icon1` int(10) unsigned NOT NULL,
`icon2` int(10) unsigned NOT NULL,
`icon3` int(10) unsigned NOT NULL,
`icon4` int(10) unsigned NOT NULL,
`icon5` int(10) unsigned NOT NULL,
`icon6` int(10) unsigned NOT NULL,
`icon7` int(10) unsigned NOT NULL,
`icon8` int(10) unsigned NOT NULL,
`icon1` bigint(20) unsigned NOT NULL,
`icon2` bigint(20) unsigned NOT NULL,
`icon3` bigint(20) unsigned NOT NULL,
`icon4` bigint(20) unsigned NOT NULL,
`icon5` bigint(20) unsigned NOT NULL,
`icon6` bigint(20) unsigned NOT NULL,
`icon7` bigint(20) unsigned NOT NULL,
`icon8` bigint(20) unsigned NOT NULL,
`groupType` tinyint(3) unsigned NOT NULL,
`difficulty` tinyint(3) unsigned NOT NULL DEFAULT '0',
`raiddifficulty` tinyint(3) unsigned NOT NULL DEFAULT '0',
Expand Down
9 changes: 9 additions & 0 deletions sql/updates/characters/2014_09_16_00_characters_groups.sql
@@ -0,0 +1,9 @@
ALTER TABLE `groups`
MODIFY `icon1` BIGINT(20) UNSIGNED NOT NULL,
MODIFY `icon2` BIGINT(20) UNSIGNED NOT NULL,
MODIFY `icon3` BIGINT(20) UNSIGNED NOT NULL,
MODIFY `icon4` BIGINT(20) UNSIGNED NOT NULL,
MODIFY `icon5` BIGINT(20) UNSIGNED NOT NULL,
MODIFY `icon6` BIGINT(20) UNSIGNED NOT NULL,
MODIFY `icon7` BIGINT(20) UNSIGNED NOT NULL,
MODIFY `icon8` BIGINT(20) UNSIGNED NOT NULL;
6 changes: 3 additions & 3 deletions src/server/game/AI/CoreAI/PetAI.cpp
Expand Up @@ -164,7 +164,7 @@ void PetAI::UpdateAI(uint32 diff)
continue;
}

Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE, 0);
Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE);
bool spellUsed = false;

// Some spells can target enemy or friendly (DK Ghoul's Leap)
Expand Down Expand Up @@ -192,7 +192,7 @@ void PetAI::UpdateAI(uint32 diff)
// No enemy, check friendly
if (!spellUsed)
{
for (std::set<uint64>::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar)
for (GuidSet::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar)
{
Unit* ally = ObjectAccessor::GetUnit(*me, *tar);

Expand All @@ -215,7 +215,7 @@ void PetAI::UpdateAI(uint32 diff)
}
else if (me->GetVictim() && CanAttack(me->GetVictim()) && spellInfo->CanBeUsedInCombat())
{
Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE, 0);
Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE);
if (spell->CanAutoCast(me->GetVictim()))
targetSpellStore.push_back(std::make_pair(me->GetVictim(), spell));
else
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/AI/CoreAI/PetAI.h
Expand Up @@ -57,7 +57,7 @@ class PetAI : public CreatureAI
void UpdateAllies();

TimeTracker i_tracker;
std::set<uint64> m_AllySet;
GuidSet m_AllySet;
uint32 m_updateAlliesTimer;

Unit* SelectNextTarget(bool allowAutoSelect) const;
Expand Down
4 changes: 2 additions & 2 deletions src/server/game/AI/CoreAI/TotemAI.cpp
Expand Up @@ -35,7 +35,7 @@ int TotemAI::Permissible(Creature const* creature)
return PERMIT_BASE_NO;
}

TotemAI::TotemAI(Creature* c) : CreatureAI(c), i_victimGuid(0)
TotemAI::TotemAI(Creature* c) : CreatureAI(c), i_victimGuid()
{
ASSERT(c->IsTotem());
}
Expand Down Expand Up @@ -90,7 +90,7 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
me->CastSpell(victim, me->ToTotem()->GetSpell(), false);
}
else
i_victimGuid = 0;
i_victimGuid.Clear();
}

void TotemAI::AttackStart(Unit* /*victim*/)
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/AI/CoreAI/TotemAI.h
Expand Up @@ -39,7 +39,7 @@ class TotemAI : public CreatureAI
static int Permissible(Creature const* creature);

private:
uint64 i_victimGuid;
ObjectGuid i_victimGuid;
};
#endif

4 changes: 2 additions & 2 deletions src/server/game/AI/CoreAI/UnitAI.h
Expand Up @@ -137,8 +137,8 @@ class UnitAI
virtual void DoAction(int32 /*param*/) { }
virtual uint32 GetData(uint32 /*id = 0*/) const { return 0; }
virtual void SetData(uint32 /*id*/, uint32 /*value*/) { }
virtual void SetGUID(uint64 /*guid*/, int32 /*id*/ = 0) { }
virtual uint64 GetGUID(int32 /*id*/ = 0) const { return 0; }
virtual void SetGUID(ObjectGuid /*guid*/, int32 /*id*/ = 0) { }
virtual ObjectGuid GetGUID(int32 /*id*/ = 0) const { return ObjectGuid::Empty; }

Unit* SelectTarget(SelectAggroTarget targetType, uint32 position = 0, float dist = 0.0f, bool playerOnly = false, int32 aura = 0);
// Select the targets satisfying the predicate.
Expand Down
4 changes: 2 additions & 2 deletions src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
Expand Up @@ -311,8 +311,8 @@ void ScriptedAI::DoTeleportPlayer(Unit* unit, float x, float y, float z, float o
if (Player* player = unit->ToPlayer())
player->TeleportTo(unit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
else
TC_LOG_ERROR("scripts", "Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.",
me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o);
TC_LOG_ERROR("scripts", "Creature %s Tried to teleport non-player unit (%s) to x: %f y:%f z: %f o: %f. Aborted.",
me->GetGUID().ToString().c_str(), unit->GetGUID().ToString().c_str(), x, y, z, o);
}

void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
Expand Down
8 changes: 4 additions & 4 deletions src/server/game/AI/ScriptedAI/ScriptedCreature.h
Expand Up @@ -40,7 +40,7 @@ class InstanceScript;
class SummonList
{
public:
typedef std::list<uint64> StorageType;
typedef GuidList StorageType;
typedef StorageType::iterator iterator;
typedef StorageType::const_iterator const_iterator;
typedef StorageType::size_type size_type;
Expand Down Expand Up @@ -104,7 +104,7 @@ class SummonList
{
// We need to use a copy of SummonList here, otherwise original SummonList would be modified
StorageType listCopy = storage_;
Trinity::Containers::RandomResizeList<uint64, Predicate>(listCopy, predicate, max);
Trinity::Containers::RandomResizeList<ObjectGuid, Predicate>(listCopy, predicate, max);
for (StorageType::iterator i = listCopy.begin(); i != listCopy.end(); )
{
Creature* summon = ObjectAccessor::GetCreature(*me, *i++);
Expand All @@ -126,7 +126,7 @@ class EntryCheckPredicate
{
public:
EntryCheckPredicate(uint32 entry) : _entry(entry) { }
bool operator()(uint64 guid) { return GUID_ENPART(guid) == _entry; }
bool operator()(ObjectGuid guid) { return guid.GetEntry() == _entry; }

private:
uint32 _entry;
Expand All @@ -135,7 +135,7 @@ class EntryCheckPredicate
class DummyEntryCheckPredicate
{
public:
bool operator()(uint64) { return true; }
bool operator()(ObjectGuid) { return true; }
};

struct ScriptedAI : public CreatureAI
Expand Down
5 changes: 2 additions & 3 deletions src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
Expand Up @@ -35,7 +35,6 @@ enum Points
};

npc_escortAI::npc_escortAI(Creature* creature) : ScriptedAI(creature),
m_uiPlayerGUID(0),
m_uiWPWaitTimer(2500),
m_uiPlayerCheckTimer(1000),
m_uiEscortState(STATE_ESCORT_NONE),
Expand Down Expand Up @@ -430,7 +429,7 @@ void npc_escortAI::SetRun(bool on)
}

/// @todo get rid of this many variables passed in function.
void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false */, uint64 playerGUID /* = 0 */, Quest const* quest /* = NULL */, bool instantRespawn /* = false */, bool canLoopPath /* = false */, bool resetWaypoints /* = true */)
void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false */, ObjectGuid playerGUID /* = 0 */, Quest const* quest /* = NULL */, bool instantRespawn /* = false */, bool canLoopPath /* = false */, bool resetWaypoints /* = true */)
{
if (me->GetVictim())
{
Expand Down Expand Up @@ -486,7 +485,7 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
}

TC_LOG_DEBUG("scripts", "EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID);
TC_LOG_DEBUG("scripts", "EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, %s", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID.ToString().c_str());

CurrentWP = WaypointList.begin();

Expand Down
6 changes: 3 additions & 3 deletions src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
Expand Up @@ -88,7 +88,7 @@ struct npc_escortAI : public ScriptedAI
virtual void WaypointReached(uint32 pointId) = 0;
virtual void WaypointStart(uint32 /*pointId*/) { }

void Start(bool isActiveAttacker = true, bool run = false, uint64 playerGUID = 0, Quest const* quest = NULL, bool instantRespawn = false, bool canLoopPath = false, bool resetWaypoints = true);
void Start(bool isActiveAttacker = true, bool run = false, ObjectGuid playerGUID = ObjectGuid::Empty, Quest const* quest = NULL, bool instantRespawn = false, bool canLoopPath = false, bool resetWaypoints = true);

void SetRun(bool on = true);
void SetEscortPaused(bool on);
Expand All @@ -103,7 +103,7 @@ struct npc_escortAI : public ScriptedAI
void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; }
bool GetAttack() { return m_bIsActiveAttacker; }//used in EnterEvadeMode override
void SetCanAttack(bool attack) { m_bIsActiveAttacker = attack; }
uint64 GetEventStarterGUID() { return m_uiPlayerGUID; }
ObjectGuid GetEventStarterGUID() { return m_uiPlayerGUID; }

protected:
Player* GetPlayerForEscort() { return ObjectAccessor::GetPlayer(*me, m_uiPlayerGUID); }
Expand All @@ -116,7 +116,7 @@ struct npc_escortAI : public ScriptedAI
void AddEscortState(uint32 escortState) { m_uiEscortState |= escortState; }
void RemoveEscortState(uint32 escortState) { m_uiEscortState &= ~escortState; }

uint64 m_uiPlayerGUID;
ObjectGuid m_uiPlayerGUID;
uint32 m_uiWPWaitTimer;
uint32 m_uiPlayerCheckTimer;
uint32 m_uiEscortState;
Expand Down
3 changes: 1 addition & 2 deletions src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
Expand Up @@ -36,7 +36,6 @@ enum Points
};

FollowerAI::FollowerAI(Creature* creature) : ScriptedAI(creature),
m_uiLeaderGUID(0),
m_uiUpdateFollowTimer(2500),
m_uiFollowState(STATE_FOLLOW_NONE),
m_pQuestForFollow(NULL)
Expand Down Expand Up @@ -320,7 +319,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu

me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);

TC_LOG_DEBUG("scripts", "FollowerAI start follow %s (GUID " UI64FMTD ")", player->GetName().c_str(), m_uiLeaderGUID);
TC_LOG_DEBUG("scripts", "FollowerAI start follow %s (%s)", player->GetName().c_str(), m_uiLeaderGUID.ToString().c_str());
}

Player* FollowerAI::GetLeaderForFollower()
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h
Expand Up @@ -71,7 +71,7 @@ class FollowerAI : public ScriptedAI

bool AssistPlayerInCombat(Unit* who);

uint64 m_uiLeaderGUID;
ObjectGuid m_uiLeaderGUID;
uint32 m_uiUpdateFollowTimer;
uint32 m_uiFollowState;

Expand Down
16 changes: 8 additions & 8 deletions src/server/game/AI/SmartScripts/SmartAI.cpp
Expand Up @@ -61,7 +61,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
mDespawnState = 0;

mEscortInvokerCheckTimer = 1000;
mFollowGuid = 0;
mFollowGuid.Clear();
mFollowDist = 0;
mFollowAngle = 0;
mFollowCredit = 0;
Expand Down Expand Up @@ -540,7 +540,7 @@ void SmartAI::JustRespawned()
mJustReset = true;
JustReachedHome();
GetScript()->ProcessEventsFor(SMART_EVENT_RESPAWN);
mFollowGuid = 0;//do not reset follower on Reset(), we need it after combat evade
mFollowGuid.Clear();//do not reset follower on Reset(), we need it after combat evade
mFollowDist = 0;
mFollowAngle = 0;
mFollowCredit = 0;
Expand Down Expand Up @@ -674,8 +674,8 @@ void SmartAI::OnCharmed(bool apply)
{
GetScript()->ProcessEventsFor(SMART_EVENT_CHARMED, NULL, 0, 0, apply);

if (!apply && !me->IsInEvadeMode() && me->GetUInt64Value(UNIT_FIELD_CHARMEDBY))
if (Unit* charmer = ObjectAccessor::GetUnit(*me, me->GetUInt64Value(UNIT_FIELD_CHARMEDBY)))
if (!apply && !me->IsInEvadeMode() && me->GetCharmerGUID())
if (Unit* charmer = ObjectAccessor::GetUnit(*me, me->GetCharmerGUID()))
AttackStart(charmer);
}

Expand All @@ -694,11 +694,11 @@ void SmartAI::SetData(uint32 id, uint32 value)
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, NULL, id, value);
}

void SmartAI::SetGUID(uint64 /*guid*/, int32 /*id*/) { }
void SmartAI::SetGUID(ObjectGuid /*guid*/, int32 /*id*/) { }

uint64 SmartAI::GetGUID(int32 /*id*/) const
ObjectGuid SmartAI::GetGUID(int32 /*id*/) const
{
return 0;
return ObjectGuid::Empty;
}

void SmartAI::SetRun(bool run)
Expand Down Expand Up @@ -800,7 +800,7 @@ void SmartAI::StopFollow()
player->GroupEventHappens(mFollowCredit, me);
}

mFollowGuid = 0;
mFollowGuid.Clear();
mFollowDist = 0;
mFollowAngle = 0;
mFollowCredit = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/server/game/AI/SmartScripts/SmartAI.h
Expand Up @@ -154,10 +154,10 @@ class SmartAI : public CreatureAI
void SetData(uint32 id, uint32 value) override;

// Used in scripts to share variables
void SetGUID(uint64 guid, int32 id = 0) override;
void SetGUID(ObjectGuid guid, int32 id = 0) override;

// Used in scripts to share variables
uint64 GetGUID(int32 id = 0) const override;
ObjectGuid GetGUID(int32 id = 0) const override;

//core related
static int Permissible(const Creature*);
Expand Down Expand Up @@ -199,7 +199,7 @@ class SmartAI : public CreatureAI
uint32 mFollowArrivedTimer;
uint32 mFollowCredit;
uint32 mFollowArrivedEntry;
uint64 mFollowGuid;
ObjectGuid mFollowGuid;
float mFollowDist;
float mFollowAngle;

Expand Down

0 comments on commit 7d1d551

Please sign in to comment.