*Merge
--HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
# Be sure to specify files instead of * when running the script.
|
||||||
|
perl -p -i -e "s/\t/ /g" *
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# Be sure to specify files instead of * when running the script.
|
||||||
|
perl -p -i -e "s/ +$//g" *
|
||||||
@@ -1413,7 +1413,6 @@ LOCK TABLES `petition_sign` WRITE;
|
|||||||
/*!40000 ALTER TABLE `petition_sign` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `petition_sign` DISABLE KEYS */;
|
||||||
/*!40000 ALTER TABLE `petition_sign` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `petition_sign` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `saved_variables`
|
-- Table structure for table `saved_variables`
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
DELETE FROM `trinity_string` WHERE `entry` = 5007;
|
||||||
|
INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES (5007, 'You must be in a raid group to enter this instance.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||||
@@ -501,12 +501,12 @@ CreatureAI* GetAI_npc_isla_starmaneAI(Creature *_Creature)
|
|||||||
|
|
||||||
bool GossipHello_go_skull_pile(Player *player, GameObject* _GO)
|
bool GossipHello_go_skull_pile(Player *player, GameObject* _GO)
|
||||||
{
|
{
|
||||||
if (player->GetQuestStatus(11885) == QUEST_STATUS_INCOMPLETE)
|
if ((player->GetQuestStatus(11885) == QUEST_STATUS_INCOMPLETE) || player->GetQuestRewardStatus(11885))
|
||||||
{
|
{
|
||||||
player->ADD_GOSSIP_ITEM(1, GOSSIP_S_DARKSCREECHER_AKKARAI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
player->ADD_GOSSIP_ITEM(0, GOSSIP_S_DARKSCREECHER_AKKARAI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||||
player->ADD_GOSSIP_ITEM(2, GOSSIP_S_KARROG, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
player->ADD_GOSSIP_ITEM(0, GOSSIP_S_KARROG, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||||
player->ADD_GOSSIP_ITEM(3, GOSSIP_S_GEZZARAK_THE_HUNTRESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
player->ADD_GOSSIP_ITEM(0, GOSSIP_S_GEZZARAK_THE_HUNTRESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||||
player->ADD_GOSSIP_ITEM(4, GOSSIP_S_VAKKIZ_THE_WINDRAGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
player->ADD_GOSSIP_ITEM(0, GOSSIP_S_VAKKIZ_THE_WINDRAGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
player->SEND_GOSSIP_MENU(_GO->GetGOInfo()->questgiver.gossipID, _GO->GetGUID());
|
player->SEND_GOSSIP_MENU(_GO->GetGOInfo()->questgiver.gossipID, _GO->GetGUID());
|
||||||
|
|||||||
+5
-5
@@ -1033,11 +1033,11 @@ int ChatHandler::ParseCommands(const char* text)
|
|||||||
++text;
|
++text;
|
||||||
|
|
||||||
if(!ExecuteCommandInTable(getCommandTable(), text, fullcmd))
|
if(!ExecuteCommandInTable(getCommandTable(), text, fullcmd))
|
||||||
{
|
{
|
||||||
if(m_session && m_session->GetSecurity() == SEC_PLAYER)
|
if(m_session && m_session->GetSecurity() == SEC_PLAYER)
|
||||||
return 0;
|
return 0;
|
||||||
SendSysMessage(LANG_NO_CMD);
|
SendSysMessage(LANG_NO_CMD);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+34
-13
@@ -139,7 +139,7 @@ m_deathTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_resp
|
|||||||
m_gossipOptionLoaded(false), m_emoteState(0),
|
m_gossipOptionLoaded(false), m_emoteState(0),
|
||||||
m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_AlreadyCallAssistance(false),
|
m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_AlreadyCallAssistance(false),
|
||||||
m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),
|
m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),
|
||||||
m_creatureInfo(NULL), m_reactState(REACT_AGGRESSIVE), m_formationID(0), m_summonMask(SUMMON_MASK_NONE)
|
m_creatureInfo(NULL), m_reactState(REACT_AGGRESSIVE), m_formation(NULL), m_summonMask(SUMMON_MASK_NONE)
|
||||||
{
|
{
|
||||||
m_regenTimer = 200;
|
m_regenTimer = 200;
|
||||||
m_valuesCount = UNIT_END;
|
m_valuesCount = UNIT_END;
|
||||||
@@ -174,18 +174,18 @@ void Creature::AddToWorld()
|
|||||||
{
|
{
|
||||||
ObjectAccessor::Instance().AddObject(this);
|
ObjectAccessor::Instance().AddObject(this);
|
||||||
Unit::AddToWorld();
|
Unit::AddToWorld();
|
||||||
AIM_Initialize();
|
|
||||||
SearchFormation();
|
SearchFormation();
|
||||||
|
AIM_Initialize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature::RemoveFromWorld()
|
void Creature::RemoveFromWorld()
|
||||||
{
|
{
|
||||||
///- Remove the creature from the accessor
|
|
||||||
if(IsInWorld())
|
if(IsInWorld())
|
||||||
{
|
{
|
||||||
if(m_formationID)
|
// Clear formation info
|
||||||
formation_mgr.DestroyGroup(m_formationID, GetGUID());
|
if(m_formation)
|
||||||
|
formation_mgr.RemoveCreatureFromGroup(m_formation, this);
|
||||||
Unit::RemoveFromWorld();
|
Unit::RemoveFromWorld();
|
||||||
ObjectAccessor::Instance().RemoveObject(this);
|
ObjectAccessor::Instance().RemoveObject(this);
|
||||||
}
|
}
|
||||||
@@ -193,16 +193,16 @@ void Creature::RemoveFromWorld()
|
|||||||
|
|
||||||
void Creature::SearchFormation()
|
void Creature::SearchFormation()
|
||||||
{
|
{
|
||||||
if(isPet())
|
if(isSummon())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32 lowguid = GetDBTableGUIDLow();
|
uint32 lowguid = GetDBTableGUIDLow();
|
||||||
|
if(!lowguid)
|
||||||
|
return;
|
||||||
|
|
||||||
if(lowguid && CreatureGroupMap.find(lowguid) != CreatureGroupMap.end())
|
CreatureGroupInfoType::iterator frmdata = CreatureGroupMap.find(lowguid);
|
||||||
{
|
if(frmdata != CreatureGroupMap.end())
|
||||||
m_formationID = CreatureGroupMap[lowguid]->leaderGUID;
|
formation_mgr.AddCreatureToGroup(frmdata->second->leaderGUID, this);
|
||||||
formation_mgr.UpdateCreatureGroup(m_formationID, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature::RemoveCorpse()
|
void Creature::RemoveCorpse()
|
||||||
@@ -611,7 +611,9 @@ bool Creature::AIM_Initialize(CreatureAI* ai)
|
|||||||
}
|
}
|
||||||
|
|
||||||
UnitAI *oldAI = i_AI;
|
UnitAI *oldAI = i_AI;
|
||||||
i_motionMaster.Initialize();
|
|
||||||
|
Motion_Initialize();
|
||||||
|
|
||||||
i_AI = ai ? ai : FactorySelector::selectAI(this);
|
i_AI = ai ? ai : FactorySelector::selectAI(this);
|
||||||
if(oldAI) delete oldAI;
|
if(oldAI) delete oldAI;
|
||||||
IsAIEnabled = true;
|
IsAIEnabled = true;
|
||||||
@@ -619,6 +621,21 @@ bool Creature::AIM_Initialize(CreatureAI* ai)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Creature::Motion_Initialize()
|
||||||
|
{
|
||||||
|
if(!m_formation)
|
||||||
|
i_motionMaster.Initialize();
|
||||||
|
else if(m_formation->getLeader() == this)
|
||||||
|
{
|
||||||
|
m_formation->FormationReset(false);
|
||||||
|
i_motionMaster.Initialize();
|
||||||
|
}
|
||||||
|
else if(m_formation->isFormed())
|
||||||
|
i_motionMaster.MoveIdle(MOTION_SLOT_IDLE); //wait the order of leader
|
||||||
|
else
|
||||||
|
i_motionMaster.Initialize();
|
||||||
|
}
|
||||||
|
|
||||||
bool Creature::Create (uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 team, const CreatureData *data)
|
bool Creature::Create (uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 team, const CreatureData *data)
|
||||||
{
|
{
|
||||||
SetMapId(map->GetId());
|
SetMapId(map->GetId());
|
||||||
@@ -1654,6 +1671,10 @@ void Creature::setDeathState(DeathState s)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Unit::setDeathState(CORPSE);
|
Unit::setDeathState(CORPSE);
|
||||||
|
|
||||||
|
//Dismiss group if is leader
|
||||||
|
if(m_formation && m_formation->getLeader() == this)
|
||||||
|
m_formation->FormationReset(true);
|
||||||
}
|
}
|
||||||
if(s == JUST_ALIVED)
|
if(s == JUST_ALIVED)
|
||||||
{
|
{
|
||||||
@@ -1667,9 +1688,9 @@ void Creature::setDeathState(DeathState s)
|
|||||||
AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||||
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
|
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
|
||||||
clearUnitState(UNIT_STAT_ALL_STATE);
|
clearUnitState(UNIT_STAT_ALL_STATE);
|
||||||
i_motionMaster.Initialize();
|
|
||||||
SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));
|
SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));
|
||||||
LoadCreaturesAddon(true);
|
LoadCreaturesAddon(true);
|
||||||
|
Motion_Initialize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-4
@@ -28,7 +28,6 @@
|
|||||||
#include "LootMgr.h"
|
#include "LootMgr.h"
|
||||||
#include "Database/DatabaseEnv.h"
|
#include "Database/DatabaseEnv.h"
|
||||||
#include "Cell.h"
|
#include "Cell.h"
|
||||||
#include "CreatureGroups.h"
|
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
@@ -38,6 +37,7 @@ class CreatureAI;
|
|||||||
class Quest;
|
class Quest;
|
||||||
class Player;
|
class Player;
|
||||||
class WorldSession;
|
class WorldSession;
|
||||||
|
class CreatureGroup;
|
||||||
|
|
||||||
enum Gossip_Option
|
enum Gossip_Option
|
||||||
{
|
{
|
||||||
@@ -494,6 +494,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
|||||||
bool IsInEvadeMode() const;
|
bool IsInEvadeMode() const;
|
||||||
|
|
||||||
bool AIM_Initialize(CreatureAI* ai = NULL);
|
bool AIM_Initialize(CreatureAI* ai = NULL);
|
||||||
|
void Motion_Initialize();
|
||||||
|
|
||||||
void AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint32 MovementFlags, uint8 type);
|
void AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint32 MovementFlags, uint8 type);
|
||||||
CreatureAI* AI() { return (CreatureAI*)i_AI; }
|
CreatureAI* AI() { return (CreatureAI*)i_AI; }
|
||||||
@@ -651,8 +652,8 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
|||||||
void UpdateWaypointID(uint32 wpID){m_waypointID = wpID;}
|
void UpdateWaypointID(uint32 wpID){m_waypointID = wpID;}
|
||||||
|
|
||||||
void SearchFormation();
|
void SearchFormation();
|
||||||
bool IsFormationLeader() {return (GetDBTableGUIDLow() && GetDBTableGUIDLow() == m_formationID);}
|
CreatureGroup *GetFormation() {return m_formation;}
|
||||||
uint32 GetFormationID(){return m_formationID;}
|
void SetFormation(CreatureGroup *formation) {m_formation = formation;}
|
||||||
|
|
||||||
Unit *SelectVictim();
|
Unit *SelectVictim();
|
||||||
void SetDeadByDefault (bool death_state) {m_isDeadByDefault = death_state;}
|
void SetDeadByDefault (bool death_state) {m_isDeadByDefault = death_state;}
|
||||||
@@ -711,7 +712,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
|||||||
uint32 m_path_id;
|
uint32 m_path_id;
|
||||||
|
|
||||||
//Formation var
|
//Formation var
|
||||||
uint32 m_formationID;
|
CreatureGroup *m_formation;
|
||||||
|
|
||||||
GridReference<Creature> m_gridRef;
|
GridReference<Creature> m_gridRef;
|
||||||
CreatureInfo const* m_creatureInfo; // in heroic mode can different from ObjMgr::GetCreatureTemplate(GetEntry())
|
CreatureInfo const* m_creatureInfo; // in heroic mode can different from ObjMgr::GetCreatureTemplate(GetEntry())
|
||||||
|
|||||||
+126
-97
@@ -25,40 +25,59 @@
|
|||||||
#include "Policies/SingletonImp.h"
|
#include "Policies/SingletonImp.h"
|
||||||
|
|
||||||
#define MAX_DESYNC 5.0f
|
#define MAX_DESYNC 5.0f
|
||||||
//TODO: Create group manager for each map
|
|
||||||
INSTANTIATE_SINGLETON_1(CreatureGroupManager);
|
INSTANTIATE_SINGLETON_1(CreatureGroupManager);
|
||||||
|
|
||||||
UNORDERED_MAP<uint32, CreatureGroup*> CreatureGroupHolder;
|
CreatureGroupHolderType CreatureGroupHolder;
|
||||||
UNORDERED_MAP<uint32, FormationMember*> CreatureGroupMap;
|
CreatureGroupInfoType CreatureGroupMap;
|
||||||
|
|
||||||
void CreatureGroupManager::UpdateCreatureGroup(uint32 group_id, Creature *member)
|
void CreatureGroupManager::AddCreatureToGroup(uint32 group_id, Creature *member)
|
||||||
{
|
{
|
||||||
if(CreatureGroupHolder.find(group_id) != CreatureGroupHolder.end())
|
CreatureGroupHolderType::iterator cgroup_data = CreatureGroupHolder.find(group_id);
|
||||||
|
|
||||||
|
//Add member to an existing group
|
||||||
|
if(cgroup_data != CreatureGroupHolder.end())
|
||||||
{
|
{
|
||||||
sLog.outDebug("Group found: %u, inserting creature GUID: %u", group_id, member->GetGUIDLow());
|
typedef std::multimap<uint32, CreatureGroup *>::iterator multiplegroup;
|
||||||
CreatureGroupHolder[group_id]->AddMember(member);
|
std::pair<multiplegroup, multiplegroup> range = CreatureGroupHolder.equal_range(group_id);
|
||||||
}
|
|
||||||
else
|
for(multiplegroup i = range.first; i != range.second; ++i)
|
||||||
{
|
{
|
||||||
sLog.outDebug("Group not found: %u. Creating new group.", group_id);
|
if(i->second->getInstanceID() == member->GetInstanceId())
|
||||||
CreatureGroup* formation = new CreatureGroup;
|
{
|
||||||
CreatureGroupHolder[group_id] = formation;
|
sLog.outDebug("Group found: %u, inserting creature GUID: %u, Group InstanceID %u", group_id, member->GetGUIDLow(), i->second->getInstanceID());
|
||||||
formation->AddMember(member);
|
i->second->AddMember(member);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Create new group
|
||||||
|
sLog.outDebug("Group not found: %u. Creating new group.", group_id);
|
||||||
|
CreatureGroup* cgroup = new CreatureGroup(group_id, member->GetInstanceId());
|
||||||
|
CreatureGroupHolder.insert(std::make_pair(group_id, cgroup));
|
||||||
|
cgroup->AddMember(member);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreatureGroupManager::DestroyGroup(uint32 group_id, uint64 guid)
|
void CreatureGroupManager::RemoveCreatureFromGroup(CreatureGroup *formation, Creature *member)
|
||||||
{
|
{
|
||||||
if(CreatureGroupHolder.find(group_id) != CreatureGroupHolder.end())
|
sLog.outDebug("Deleting member pointer to GUID: %u from group %u", formation->GetId(), member->GetDBTableGUIDLow());
|
||||||
{
|
formation->RemoveMember(member);
|
||||||
sLog.outDebug("Deleting member pointer to GUID: %u from group %u", group_id, guid);
|
|
||||||
CreatureGroupHolder[group_id]->RemoveMember(guid);
|
|
||||||
|
|
||||||
if(CreatureGroupHolder[group_id]->isEmpty())
|
if(formation->isEmpty())
|
||||||
|
{
|
||||||
|
uint32 id = formation->GetId();
|
||||||
|
typedef std::multimap<uint32, CreatureGroup *>::iterator multiplegroup;
|
||||||
|
std::pair<multiplegroup, multiplegroup> range = CreatureGroupHolder.equal_range(id);
|
||||||
|
|
||||||
|
for(multiplegroup i = range.first; i != range.second; ++i)
|
||||||
{
|
{
|
||||||
sLog.outDebug("Deleting group %u", group_id);
|
if(i->second == formation)
|
||||||
delete CreatureGroupHolder[group_id];
|
{
|
||||||
CreatureGroupHolder.erase(group_id);
|
sLog.outDebug("Deleting group with InstanceID %u", i->second->getInstanceID());
|
||||||
|
CreatureGroupHolder.erase(i);
|
||||||
|
delete formation;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -73,7 +92,7 @@ void CreatureGroupManager::LoadCreatureFormations()
|
|||||||
|
|
||||||
if(!result)
|
if(!result)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb(" an error occured while loading the table `creature_formations` ( maybe it doesn't exist ?)\n");
|
sLog.outErrorDb(" ...an error occured while loading the table `creature_formations` ( maybe it doesn't exist ?)\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
delete result;
|
delete result;
|
||||||
@@ -91,7 +110,7 @@ void CreatureGroupManager::LoadCreatureFormations()
|
|||||||
barGoLink bar( total_records);
|
barGoLink bar( total_records);
|
||||||
Field *fields;
|
Field *fields;
|
||||||
|
|
||||||
FormationMember *group_member;
|
FormationInfo *group_member;
|
||||||
//Loading data...
|
//Loading data...
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@@ -99,15 +118,15 @@ void CreatureGroupManager::LoadCreatureFormations()
|
|||||||
|
|
||||||
bar.step();
|
bar.step();
|
||||||
//Load group member data
|
//Load group member data
|
||||||
group_member = new FormationMember;
|
group_member = new FormationInfo;
|
||||||
group_member->leaderGUID = fields[0].GetUInt32();
|
group_member->leaderGUID = fields[0].GetUInt32();
|
||||||
group_member->memberGUID = fields[1].GetUInt32();
|
uint32 memberGUID = fields[1].GetUInt32();
|
||||||
group_member->groupAI = fields[4].GetUInt8();
|
group_member->groupAI = fields[4].GetUInt8();
|
||||||
//If creature is group leader we may skip loading of dist/angle
|
//If creature is group leader we may skip loading of dist/angle
|
||||||
if(group_member->leaderGUID != group_member->memberGUID)
|
if(group_member->leaderGUID != memberGUID)
|
||||||
{
|
{
|
||||||
group_member->follow_dist = fields[2].GetUInt32();
|
group_member->follow_dist = fields[2].GetUInt32();
|
||||||
group_member->follow_angle = fields[3].GetUInt32();
|
group_member->follow_angle = fields[3].GetUInt32();
|
||||||
}
|
}
|
||||||
|
|
||||||
// check data correctness
|
// check data correctness
|
||||||
@@ -119,16 +138,16 @@ void CreatureGroupManager::LoadCreatureFormations()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = WorldDatabase.PQuery("SELECT guid FROM creature WHERE guid = %u", group_member->memberGUID);
|
result = WorldDatabase.PQuery("SELECT guid FROM creature WHERE guid = %u", memberGUID);
|
||||||
if(!result)
|
if(!result)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("creature_formations table member guid %u incorrect (not exist)", group_member->memberGUID);
|
sLog.outErrorDb("creature_formations table member guid %u incorrect (not exist)", memberGUID);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CreatureGroupMap[group_member->memberGUID] = group_member;
|
CreatureGroupMap[memberGUID] = group_member;
|
||||||
}
|
}
|
||||||
while(result->NextRow()) ;
|
while(result->NextRow()) ;
|
||||||
|
|
||||||
sLog.outString();
|
sLog.outString();
|
||||||
@@ -140,90 +159,100 @@ void CreatureGroupManager::LoadCreatureFormations()
|
|||||||
|
|
||||||
void CreatureGroup::AddMember(Creature *member)
|
void CreatureGroup::AddMember(Creature *member)
|
||||||
{
|
{
|
||||||
sLog.outDebug("Adding unit GUID: %u.", member->GetGUIDLow());
|
sLog.outDebug("CreatureGroup::AddMember: Adding unit GUIDLow: %u.", member->GetGUIDLow());
|
||||||
|
|
||||||
uint64 guid = member->GetGUID();
|
//Check if it is a leader
|
||||||
//We first search creature member if exist
|
if(member->GetDBTableGUIDLow() == m_groupID)
|
||||||
if(CreatureGroupMembers.find(guid) != CreatureGroupMembers.end())
|
|
||||||
return;
|
|
||||||
//Check is that shit is a leader
|
|
||||||
if(member->IsFormationLeader())
|
|
||||||
{
|
{
|
||||||
sLog.outDebug("Unit GUID: %u is formation leader. Adding group.", member->GetGUIDLow());
|
sLog.outDebug("Unit GUID: %u is formation leader. Adding group.", member->GetGUIDLow());
|
||||||
m_leader = member;
|
m_leader = member;
|
||||||
}
|
}
|
||||||
//Add to the club
|
|
||||||
CreatureGroupMembers[guid] = member;
|
m_members[member] = CreatureGroupMap.find(member->GetDBTableGUIDLow())->second;
|
||||||
sLog.outDebug("Unit GUID: %u added.", member->GetGUID());
|
member->SetFormation(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreatureGroup::RemoveMember(uint64 guid)
|
void CreatureGroup::RemoveMember(Creature *member)
|
||||||
{
|
{
|
||||||
if(CreatureGroupMembers.find(guid) != CreatureGroupMembers.end())
|
if(m_leader == member)
|
||||||
CreatureGroupMembers.erase(guid);
|
m_leader = NULL;
|
||||||
|
|
||||||
|
m_members.erase(member);
|
||||||
|
member->SetFormation(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreatureGroup::MemberHasAttacked(Creature *member)
|
void CreatureGroup::MemberAttackStart(Creature *member, Unit *target)
|
||||||
{
|
{
|
||||||
uint8 groupAI = CreatureGroupMap[member->GetDBTableGUIDLow()]->groupAI;;
|
uint8 groupAI = CreatureGroupMap[member->GetDBTableGUIDLow()]->groupAI;
|
||||||
|
if(!groupAI)
|
||||||
for(UNORDERED_MAP<uint64, Creature*>::iterator itr = CreatureGroupMembers.begin(); itr != CreatureGroupMembers.end(); itr++)
|
|
||||||
{
|
|
||||||
sLog.outDebug("AI:%u:Group member found: %u, attacked by %s.", groupAI, itr->second->GetGUIDLow(), member->getVictim()->GetName());
|
|
||||||
if(itr->second)
|
|
||||||
{
|
|
||||||
switch(groupAI)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
return;
|
|
||||||
case 1:
|
|
||||||
if(!member->IsFormationLeader())
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//Attack if everything is OK
|
|
||||||
itr->second->AI()->AttackStart(member->getVictim());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CreatureGroup::LeaderMovedInEvade()
|
|
||||||
{
|
|
||||||
for(UNORDERED_MAP<uint64, Creature*>::iterator itr = CreatureGroupMembers.begin(); itr != CreatureGroupMembers.end(); itr++)
|
|
||||||
{
|
|
||||||
if(itr->second && itr->second->isAlive() && !itr->second->isInCombat() && !itr->second->getVictim())
|
|
||||||
SetMemberDestination(itr->second);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CreatureGroup::SetMemberDestination(Creature *member)
|
|
||||||
{
|
|
||||||
if(!member || !m_leader || member->IsFormationLeader())
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float x,y,z;
|
if(groupAI == 1 && member != m_leader)
|
||||||
uint32 lowguid = member->GetDBTableGUIDLow();
|
return;
|
||||||
|
|
||||||
UNORDERED_MAP<uint32, FormationMember*>::iterator itr2 = CreatureGroupMap.find(lowguid);
|
for(CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||||
|
|
||||||
if(m_leader->GetMotionMaster()->GetDestination(x,y,z) && itr2 != CreatureGroupMap.end())
|
|
||||||
{
|
{
|
||||||
float dist, angle, pathangle;
|
sLog.outDebug("GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId());
|
||||||
|
//sLog.outDebug("AI:%u:Group member found: %u, attacked by %s.", groupAI, itr->second->GetGUIDLow(), member->getVictim()->GetName());
|
||||||
|
|
||||||
angle = CreatureGroupMap[lowguid]->follow_angle;
|
//Skip one check
|
||||||
dist = CreatureGroupMap[lowguid]->follow_dist;
|
if(itr->first == member)
|
||||||
pathangle = atan2(m_leader->GetPositionY()-y, m_leader->GetPositionX()-x);
|
continue;
|
||||||
|
|
||||||
x = x+cos(angle+pathangle)*dist;
|
if(!itr->first->isAlive())
|
||||||
y = y+sin(angle+pathangle)*dist;
|
continue;
|
||||||
|
|
||||||
member->GetMotionMaster()->Clear();
|
if(itr->first->getVictim())
|
||||||
|
continue;
|
||||||
|
|
||||||
if(member->GetDistance(m_leader) < dist+MAX_DESYNC)
|
if(itr->first->canAttack(target))
|
||||||
|
itr->first->AI()->AttackStart(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreatureGroup::FormationReset(bool dismiss)
|
||||||
|
{
|
||||||
|
for(CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||||
|
{
|
||||||
|
if(itr->first != m_leader && itr->first->isAlive())
|
||||||
|
{
|
||||||
|
if(dismiss)
|
||||||
|
itr->first->GetMotionMaster()->Initialize();
|
||||||
|
else
|
||||||
|
itr->first->GetMotionMaster()->MoveIdle(MOTION_SLOT_IDLE);
|
||||||
|
sLog.outDebug("Set %s movement for member GUID: %u", dismiss ? "default" : "idle", itr->first->GetGUIDLow());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_Formed = !dismiss;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreatureGroup::LeaderMoveTo(float x, float y, float z)
|
||||||
|
{
|
||||||
|
if(!m_leader)
|
||||||
|
return;
|
||||||
|
|
||||||
|
float pathangle = atan2(m_leader->GetPositionY() - y, m_leader->GetPositionX() - x);
|
||||||
|
|
||||||
|
for(CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||||
|
{
|
||||||
|
Creature *member = itr->first;
|
||||||
|
if(member == m_leader || !member->isAlive() || member->getVictim())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
float angle = itr->second->follow_angle;
|
||||||
|
float dist = itr->second->follow_dist;
|
||||||
|
|
||||||
|
float dx = x + cos(angle + pathangle) * dist;
|
||||||
|
float dy = y + sin(angle + pathangle) * dist;
|
||||||
|
float dz;
|
||||||
|
member->UpdateGroundPositionZ(dx, dy, dz);
|
||||||
|
|
||||||
|
if(member->GetDistance(m_leader) < dist + MAX_DESYNC)
|
||||||
member->SetUnitMovementFlags(m_leader->GetUnitMovementFlags());
|
member->SetUnitMovementFlags(m_leader->GetUnitMovementFlags());
|
||||||
else
|
else
|
||||||
member->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
member->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||||
|
|
||||||
member->GetMotionMaster()->MovePoint(0, x, y, z);
|
member->GetMotionMaster()->MovePoint(0, dx, dy, dz);
|
||||||
|
member->SetHomePosition(dx, dy, dz, pathangle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+37
-25
@@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||||
@@ -21,49 +21,61 @@
|
|||||||
#ifndef _FORMATIONS_H
|
#ifndef _FORMATIONS_H
|
||||||
#define _FORMATIONS_H
|
#define _FORMATIONS_H
|
||||||
|
|
||||||
#include <map>
|
#include "Common.h"
|
||||||
#include "Creature.h"
|
|
||||||
#include "Policies/Singleton.h"
|
|
||||||
|
|
||||||
struct FormationMember
|
class CreatureGroup;
|
||||||
|
|
||||||
|
struct FormationInfo
|
||||||
{
|
{
|
||||||
float follow_dist;
|
|
||||||
float follow_angle;
|
|
||||||
uint32 memberGUID;
|
|
||||||
uint32 leaderGUID;
|
uint32 leaderGUID;
|
||||||
|
float follow_dist;
|
||||||
|
float follow_angle;
|
||||||
uint8 groupAI;
|
uint8 groupAI;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CreatureGroupManager
|
class CreatureGroupManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void UpdateCreatureGroup(uint32 group_id, Creature *member);
|
void AddCreatureToGroup(uint32 group_id, Creature *creature);
|
||||||
void DestroyGroup(uint32 group_id, uint64 guid);
|
void RemoveCreatureFromGroup(CreatureGroup *group, Creature *creature);
|
||||||
void LoadCreatureFormations();
|
void LoadCreatureFormations();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef std::multimap<uint32/*leaderDBGUID*/, CreatureGroup*> CreatureGroupHolderType;
|
||||||
|
typedef UNORDERED_MAP<uint32/*memberDBGUID*/, FormationInfo*> CreatureGroupInfoType;
|
||||||
|
|
||||||
|
extern CreatureGroupHolderType CreatureGroupHolder;
|
||||||
|
extern CreatureGroupInfoType CreatureGroupMap;
|
||||||
|
|
||||||
class CreatureGroup
|
class CreatureGroup
|
||||||
{
|
{
|
||||||
UNORDERED_MAP<uint64, Creature*>CreatureGroupMembers;
|
private:
|
||||||
Creature *m_leader; //Important do not forget sometimes to work with pointers instead synonims :D:D
|
Creature *m_leader; //Important do not forget sometimes to work with pointers instead synonims :D:D
|
||||||
|
typedef std::map<Creature*, FormationInfo*> CreatureGroupMemberType;
|
||||||
|
CreatureGroupMemberType m_members;
|
||||||
|
|
||||||
|
uint32 m_groupID, mInstanceID;
|
||||||
|
bool m_Formed;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CreatureGroup() : m_leader(NULL) {}
|
//Group cannot be created empty
|
||||||
|
explicit CreatureGroup(uint32 id, uint32 InstanceID) : m_groupID(id), m_leader(NULL), mInstanceID(InstanceID), m_Formed(false) {}
|
||||||
~CreatureGroup(){sLog.outDebug("Destroying group");}
|
~CreatureGroup(){sLog.outDebug("Destroying group");}
|
||||||
void AddMember(Creature *);
|
|
||||||
void RemoveMember(uint64 guid);
|
Creature* getLeader() const { return m_leader; }
|
||||||
void LeaderMovedInEvade();
|
uint32 GetId() const { return m_groupID; }
|
||||||
void MemberHasAttacked(Creature *);
|
uint32 getInstanceID() const { return mInstanceID; }
|
||||||
void SetMemberDestination(Creature *);
|
bool isEmpty() const { return m_members.empty(); }
|
||||||
bool isEmpty() {return CreatureGroupMembers.empty();}
|
bool isFormed() const { return m_Formed; }
|
||||||
|
|
||||||
|
void AddMember(Creature *member);
|
||||||
|
void RemoveMember(Creature *member);
|
||||||
|
void FormationReset(bool dismiss);
|
||||||
|
|
||||||
|
void LeaderMoveTo(float x, float y, float z);
|
||||||
|
void MemberAttackStart(Creature* member, Unit *target);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef UNORDERED_MAP<uint32, CreatureGroup*> CreatureGroupHolderType;
|
|
||||||
|
|
||||||
extern CreatureGroupHolderType CreatureGroupHolder;
|
|
||||||
extern UNORDERED_MAP<uint32, FormationMember*> CreatureGroupMap;
|
|
||||||
|
|
||||||
#define formation_mgr Trinity::Singleton<CreatureGroupManager>::Instance()
|
#define formation_mgr Trinity::Singleton<CreatureGroupManager>::Instance()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff
|
|||||||
// restore orientation of not moving creature at returning to home
|
// restore orientation of not moving creature at returning to home
|
||||||
if(owner.GetDefaultMovementType()==IDLE_MOTION_TYPE)
|
if(owner.GetDefaultMovementType()==IDLE_MOTION_TYPE)
|
||||||
{
|
{
|
||||||
|
sLog.outDebug("Entering HomeMovement::GetDestination(z,y,z)");
|
||||||
owner.SetOrientation(ori);
|
owner.SetOrientation(ori);
|
||||||
WorldPacket packet;
|
WorldPacket packet;
|
||||||
owner.BuildHeartBeatMsg(&packet);
|
owner.BuildHeartBeatMsg(&packet);
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class TRINITY_DLL_SPEC HomeMovementGenerator<Creature>
|
|||||||
MovementGeneratorType GetMovementGeneratorType() { return HOME_MOTION_TYPE; }
|
MovementGeneratorType GetMovementGeneratorType() { return HOME_MOTION_TYPE; }
|
||||||
|
|
||||||
bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; }
|
bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _setTargetLocation(Creature &);
|
void _setTargetLocation(Creature &);
|
||||||
DestinationHolder< Traveller<Creature> > i_destinationHolder;
|
DestinationHolder< Traveller<Creature> > i_destinationHolder;
|
||||||
|
|||||||
+22
-22
@@ -272,9 +272,9 @@ enum TrinityStrings
|
|||||||
LANG_COMMAND_WHISPERON = 285,
|
LANG_COMMAND_WHISPERON = 285,
|
||||||
LANG_COMMAND_WHISPEROFF = 286,
|
LANG_COMMAND_WHISPEROFF = 286,
|
||||||
LANG_COMMAND_CREATGUIDNOTFOUND = 287,
|
LANG_COMMAND_CREATGUIDNOTFOUND = 287,
|
||||||
// TICKET STRINGS NEED REWRITE // 288-296 FREE
|
// TICKET STRINGS NEED REWRITE // 288-296 FREE
|
||||||
|
|
||||||
// END
|
// END
|
||||||
LANG_COMMAND_SPAWNDIST = 297,
|
LANG_COMMAND_SPAWNDIST = 297,
|
||||||
LANG_COMMAND_SPAWNTIME = 298,
|
LANG_COMMAND_SPAWNTIME = 298,
|
||||||
LANG_COMMAND_MODIFY_HONOR = 299,
|
LANG_COMMAND_MODIFY_HONOR = 299,
|
||||||
@@ -768,7 +768,7 @@ enum TrinityStrings
|
|||||||
// Room for more level 3 1128-1199 not used
|
// Room for more level 3 1128-1199 not used
|
||||||
|
|
||||||
// AV
|
// AV
|
||||||
LANG_BG_AV_ALLY = 1200,
|
LANG_BG_AV_ALLY = 1200,
|
||||||
LANG_BG_AV_HORDE = 1201,
|
LANG_BG_AV_HORDE = 1201,
|
||||||
LANG_BG_AV_TOWER_TAKEN = 1202,
|
LANG_BG_AV_TOWER_TAKEN = 1202,
|
||||||
LANG_BG_AV_TOWER_ASSAULTED = 1203,
|
LANG_BG_AV_TOWER_ASSAULTED = 1203,
|
||||||
@@ -806,24 +806,24 @@ enum TrinityStrings
|
|||||||
LANG_BG_AV_A_CAPTAIN_DEAD = 1232,
|
LANG_BG_AV_A_CAPTAIN_DEAD = 1232,
|
||||||
// FREE IDS 1233-9999
|
// FREE IDS 1233-9999
|
||||||
|
|
||||||
// Ticket Strings 2000-2029
|
// Ticket Strings 2000-2029
|
||||||
LANG_COMMAND_TICKETNEW = 2000,
|
LANG_COMMAND_TICKETNEW = 2000,
|
||||||
LANG_COMMAND_TICKETUPDATED = 2001,
|
LANG_COMMAND_TICKETUPDATED = 2001,
|
||||||
LANG_COMMAND_TICKETPLAYERABANDON = 2002,
|
LANG_COMMAND_TICKETPLAYERABANDON = 2002,
|
||||||
LANG_COMMAND_TICKETCLOSED = 2003,
|
LANG_COMMAND_TICKETCLOSED = 2003,
|
||||||
LANG_COMMAND_TICKETDELETED = 2004,
|
LANG_COMMAND_TICKETDELETED = 2004,
|
||||||
LANG_COMMAND_TICKETNOTEXIST = 2005,
|
LANG_COMMAND_TICKETNOTEXIST = 2005,
|
||||||
LANG_COMMAND_TICKETCLOSEFIRST = 2006,
|
LANG_COMMAND_TICKETCLOSEFIRST = 2006,
|
||||||
LANG_COMMAND_TICKETALREADYASSIGNED = 2007,
|
LANG_COMMAND_TICKETALREADYASSIGNED = 2007,
|
||||||
LANG_COMMAND_TICKETRELOAD = 2008,
|
LANG_COMMAND_TICKETRELOAD = 2008,
|
||||||
LANG_COMMAND_TICKETSHOWLIST = 2009,
|
LANG_COMMAND_TICKETSHOWLIST = 2009,
|
||||||
LANG_COMMAND_TICKETSHOWONLINELIST = 2010,
|
LANG_COMMAND_TICKETSHOWONLINELIST = 2010,
|
||||||
LANG_COMMAND_TICKETSHOWCLOSEDLIST = 2011,
|
LANG_COMMAND_TICKETSHOWCLOSEDLIST = 2011,
|
||||||
LANG_COMMAND_TICKETASSIGNERROR_A = 2012,
|
LANG_COMMAND_TICKETASSIGNERROR_A = 2012,
|
||||||
LANG_COMMAND_TICKETASSIGNERROR_B = 2013,
|
LANG_COMMAND_TICKETASSIGNERROR_B = 2013,
|
||||||
LANG_COMMAND_TICKETNOTASSIGNED = 2014,
|
LANG_COMMAND_TICKETNOTASSIGNED = 2014,
|
||||||
LANG_COMMAND_TICKETUNASSIGNSECURITY = 2015,
|
LANG_COMMAND_TICKETUNASSIGNSECURITY = 2015,
|
||||||
LANG_COMMAND_TICKETCANNOTCLOSE = 2016,
|
LANG_COMMAND_TICKETCANNOTCLOSE = 2016,
|
||||||
LANG_COMMAND_TICKETLISTGUID = 2017,
|
LANG_COMMAND_TICKETLISTGUID = 2017,
|
||||||
LANG_COMMAND_TICKETLISTNAME = 2018,
|
LANG_COMMAND_TICKETLISTNAME = 2018,
|
||||||
LANG_COMMAND_TICKETLISTAGE = 2019,
|
LANG_COMMAND_TICKETLISTAGE = 2019,
|
||||||
@@ -842,7 +842,7 @@ enum TrinityStrings
|
|||||||
LANG_COMMAND_NO_FROZEN_PLAYERS = 5004,
|
LANG_COMMAND_NO_FROZEN_PLAYERS = 5004,
|
||||||
LANG_COMMAND_LIST_FREEZE = 5005,
|
LANG_COMMAND_LIST_FREEZE = 5005,
|
||||||
LANG_COMMAND_FROZEN_PLAYERS = 5006,
|
LANG_COMMAND_FROZEN_PLAYERS = 5006,
|
||||||
//LANG_INSTANCE_MUST_RAID_GRP = 5007,
|
LANG_INSTANCE_RAID_GROUP_ONLY = 5007,
|
||||||
//LANG_INSTANCE_NOT_AS_GHOST = 5008,
|
//LANG_INSTANCE_NOT_AS_GHOST = 5008,
|
||||||
LANG_COMMAND_PLAYED_TO_ALL = 5009,
|
LANG_COMMAND_PLAYED_TO_ALL = 5009,
|
||||||
// Room for more Trinity strings 5010-9999
|
// Room for more Trinity strings 5010-9999
|
||||||
@@ -925,7 +925,7 @@ enum TrinityStrings
|
|||||||
LANG_OPVP_EP_FLIGHT_CGT = 10053,
|
LANG_OPVP_EP_FLIGHT_CGT = 10053,
|
||||||
LANG_OPVP_ZM_GOSSIP_ALLIANCE = 10054,
|
LANG_OPVP_ZM_GOSSIP_ALLIANCE = 10054,
|
||||||
LANG_OPVP_ZM_GOSSIP_HORDE = 10055,
|
LANG_OPVP_ZM_GOSSIP_HORDE = 10055,
|
||||||
|
|
||||||
// Use for custom patches 11000-11999
|
// Use for custom patches 11000-11999
|
||||||
|
|
||||||
// NOT RESERVED IDS 12000-1999999999
|
// NOT RESERVED IDS 12000-1999999999
|
||||||
|
|||||||
+12
-12
@@ -44,6 +44,7 @@
|
|||||||
#include "GlobalEvents.h"
|
#include "GlobalEvents.h"
|
||||||
|
|
||||||
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
|
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
|
||||||
|
#include "CreatureGroups.h"
|
||||||
|
|
||||||
static uint32 ReputationRankStrIndex[MAX_REPUTATION_RANK] =
|
static uint32 ReputationRankStrIndex[MAX_REPUTATION_RANK] =
|
||||||
{
|
{
|
||||||
@@ -2144,7 +2145,7 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(HasLowerSecurity(player, 0))
|
if(HasLowerSecurity(player, 0))
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); //maybe replacement string for this later on
|
SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); //maybe replacement string for this later on
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
@@ -2152,21 +2153,21 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string nameLink = playerLink(name);
|
std::string nameLink = playerLink(name);
|
||||||
|
|
||||||
if(sWorld.KickPlayer(name))
|
if(sWorld.KickPlayer(name))
|
||||||
{
|
{
|
||||||
if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
|
if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
|
||||||
{
|
{
|
||||||
sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, nameLink.c_str(), kicker.c_str(), reason.c_str());
|
sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, nameLink.c_str(), kicker.c_str(), reason.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_COMMAND_KICKMESSAGE,nameLink.c_str());
|
PSendSysMessage(LANG_COMMAND_KICKMESSAGE,nameLink.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_COMMAND_KICKNOTFOUNDPLAYER,nameLink.c_str());
|
PSendSysMessage(LANG_COMMAND_KICKNOTFOUNDPLAYER,nameLink.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4457,7 +4458,7 @@ bool ChatHandler::HandlePetTpCommand(const char *args)
|
|||||||
|
|
||||||
uint32 tp = atol(args);
|
uint32 tp = atol(args);
|
||||||
|
|
||||||
//pet->SetTP(tp);
|
//pet->SetTP(tp);
|
||||||
|
|
||||||
PSendSysMessage("Pet's tp changed to %u", tp);
|
PSendSysMessage("Pet's tp changed to %u", tp);
|
||||||
return true;
|
return true;
|
||||||
@@ -4569,9 +4570,9 @@ bool ChatHandler::HandleNpcAddFormationCommand(const char* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32 lowguid = pCreature->GetDBTableGUIDLow();
|
uint32 lowguid = pCreature->GetDBTableGUIDLow();
|
||||||
if(pCreature->GetFormationID())
|
if(pCreature->GetFormation())
|
||||||
{
|
{
|
||||||
PSendSysMessage("Selected creature is already member of group %u", pCreature->GetFormationID());
|
PSendSysMessage("Selected creature is already member of group %u", pCreature->GetFormation()->GetId());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4579,12 +4580,11 @@ bool ChatHandler::HandleNpcAddFormationCommand(const char* args)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
Player *chr = m_session->GetPlayer();
|
Player *chr = m_session->GetPlayer();
|
||||||
FormationMember *group_member;
|
FormationInfo *group_member;
|
||||||
|
|
||||||
group_member = new FormationMember;
|
group_member = new FormationInfo;
|
||||||
group_member->follow_angle = pCreature->GetAngle(chr) - chr->GetOrientation();
|
group_member->follow_angle = pCreature->GetAngle(chr) - chr->GetOrientation();
|
||||||
group_member->follow_dist = sqrtf(pow(chr->GetPositionX() - pCreature->GetPositionX(),int(2))+pow(chr->GetPositionY()-pCreature->GetPositionY(),int(2)));
|
group_member->follow_dist = sqrtf(pow(chr->GetPositionX() - pCreature->GetPositionX(),int(2))+pow(chr->GetPositionY()-pCreature->GetPositionY(),int(2)));
|
||||||
group_member->memberGUID = lowguid;
|
|
||||||
group_member->leaderGUID = leaderGUID;
|
group_member->leaderGUID = leaderGUID;
|
||||||
group_member->groupAI = 0;
|
group_member->groupAI = 0;
|
||||||
|
|
||||||
|
|||||||
+260
-260
@@ -311,266 +311,266 @@ libmangosgame_a_SOURCES = \
|
|||||||
GroupReference.h \
|
GroupReference.h \
|
||||||
GroupRefManager.h
|
GroupRefManager.h
|
||||||
=======
|
=======
|
||||||
AccountMgr.cpp \
|
AccountMgr.cpp \
|
||||||
AccountMgr.h \
|
AccountMgr.h \
|
||||||
AchievementMgr.h \
|
AchievementMgr.h \
|
||||||
AchievementMgr.cpp \
|
AchievementMgr.cpp \
|
||||||
AggressorAI.cpp \
|
AggressorAI.cpp \
|
||||||
AggressorAI.h \
|
AggressorAI.h \
|
||||||
AnimalRandomMovementGenerator.h \
|
AnimalRandomMovementGenerator.h \
|
||||||
ArenaTeam.cpp \
|
ArenaTeam.cpp \
|
||||||
ArenaTeam.h \
|
ArenaTeam.h \
|
||||||
ArenaTeamHandler.cpp \
|
ArenaTeamHandler.cpp \
|
||||||
AuctionHouseHandler.cpp \
|
AuctionHouseHandler.cpp \
|
||||||
AuctionHouseMgr.cpp \
|
AuctionHouseMgr.cpp \
|
||||||
AuctionHouseMgr.h \
|
AuctionHouseMgr.h \
|
||||||
Bag.cpp \
|
Bag.cpp \
|
||||||
Bag.h \
|
Bag.h \
|
||||||
BattleGround.cpp \
|
BattleGround.cpp \
|
||||||
BattleGroundAA.cpp \
|
BattleGroundAA.cpp \
|
||||||
BattleGroundAB.cpp \
|
BattleGroundAB.cpp \
|
||||||
BattleGroundAV.cpp \
|
BattleGroundAV.cpp \
|
||||||
BattleGroundBE.cpp \
|
BattleGroundBE.cpp \
|
||||||
BattleGroundDS.cpp \
|
BattleGroundDS.cpp \
|
||||||
BattleGroundEY.cpp \
|
BattleGroundEY.cpp \
|
||||||
BattleGroundNA.cpp \
|
BattleGroundNA.cpp \
|
||||||
BattleGroundRL.cpp \
|
BattleGroundRL.cpp \
|
||||||
BattleGroundRV.cpp \
|
BattleGroundRV.cpp \
|
||||||
BattleGroundSA.cpp \
|
BattleGroundSA.cpp \
|
||||||
BattleGroundWS.cpp \
|
BattleGroundWS.cpp \
|
||||||
BattleGround.h \
|
BattleGround.h \
|
||||||
BattleGroundAA.h \
|
BattleGroundAA.h \
|
||||||
BattleGroundAB.h \
|
BattleGroundAB.h \
|
||||||
BattleGroundAV.h \
|
BattleGroundAV.h \
|
||||||
BattleGroundBE.h \
|
BattleGroundBE.h \
|
||||||
BattleGroundDS.h \
|
BattleGroundDS.h \
|
||||||
BattleGroundEY.h \
|
BattleGroundEY.h \
|
||||||
BattleGroundNA.h \
|
BattleGroundNA.h \
|
||||||
BattleGroundRL.h \
|
BattleGroundRL.h \
|
||||||
BattleGroundRV.h \
|
BattleGroundRV.h \
|
||||||
BattleGroundSA.h \
|
BattleGroundSA.h \
|
||||||
BattleGroundWS.h \
|
BattleGroundWS.h \
|
||||||
BattleGroundHandler.cpp \
|
BattleGroundHandler.cpp \
|
||||||
BattleGroundMgr.cpp \
|
BattleGroundMgr.cpp \
|
||||||
BattleGroundMgr.h \
|
BattleGroundMgr.h \
|
||||||
Calendar.cpp \
|
Calendar.cpp \
|
||||||
Calendar.h \
|
Calendar.h \
|
||||||
CalendarHandler.cpp \
|
CalendarHandler.cpp \
|
||||||
Cell.h \
|
Cell.h \
|
||||||
CellImpl.h \
|
CellImpl.h \
|
||||||
Channel.cpp \
|
Channel.cpp \
|
||||||
Channel.h \
|
Channel.h \
|
||||||
ChannelHandler.cpp \
|
ChannelHandler.cpp \
|
||||||
ChannelMgr.h \
|
ChannelMgr.h \
|
||||||
CharacterHandler.cpp \
|
CharacterHandler.cpp \
|
||||||
Chat.cpp \
|
Chat.cpp \
|
||||||
Chat.h \
|
Chat.h \
|
||||||
ChatHandler.cpp \
|
ChatHandler.cpp \
|
||||||
CombatHandler.cpp \
|
CombatHandler.cpp \
|
||||||
ConfusedMovementGenerator.cpp \
|
ConfusedMovementGenerator.cpp \
|
||||||
ConfusedMovementGenerator.h \
|
ConfusedMovementGenerator.h \
|
||||||
Corpse.cpp \
|
Corpse.cpp \
|
||||||
Corpse.h \
|
Corpse.h \
|
||||||
CreatureAI.cpp \
|
CreatureAI.cpp \
|
||||||
CreatureAI.h \
|
CreatureAI.h \
|
||||||
CreatureAIImpl.h \
|
CreatureAIImpl.h \
|
||||||
CreatureAIRegistry.cpp \
|
CreatureAIRegistry.cpp \
|
||||||
CreatureAIRegistry.h \
|
CreatureAIRegistry.h \
|
||||||
CreatureAISelector.cpp \
|
CreatureAISelector.cpp \
|
||||||
CreatureAISelector.h \
|
CreatureAISelector.h \
|
||||||
Creature.cpp \
|
Creature.cpp \
|
||||||
Creature.h \
|
Creature.h \
|
||||||
DBCEnums.h \
|
DBCEnums.h \
|
||||||
DBCfmt.h \
|
DBCfmt.h \
|
||||||
DBCStores.cpp \
|
DBCStores.cpp \
|
||||||
DBCStores.h \
|
DBCStores.h \
|
||||||
DBCStructure.h \
|
DBCStructure.h \
|
||||||
debugcmds.cpp \
|
debugcmds.cpp \
|
||||||
DestinationHolder.cpp \
|
DestinationHolder.cpp \
|
||||||
DestinationHolder.h \
|
DestinationHolder.h \
|
||||||
DestinationHolderImp.h \
|
DestinationHolderImp.h \
|
||||||
DuelHandler.cpp \
|
DuelHandler.cpp \
|
||||||
DynamicObject.cpp \
|
DynamicObject.cpp \
|
||||||
DynamicObject.h \
|
DynamicObject.h \
|
||||||
FleeingMovementGenerator.cpp \
|
FleeingMovementGenerator.cpp \
|
||||||
FleeingMovementGenerator.h \
|
FleeingMovementGenerator.h \
|
||||||
Formulas.h \
|
Formulas.h \
|
||||||
GameEventMgr.cpp \
|
GameEventMgr.cpp \
|
||||||
GameEventMgr.h \
|
GameEventMgr.h \
|
||||||
GameObject.cpp \
|
GameObject.cpp \
|
||||||
GameObject.h \
|
GameObject.h \
|
||||||
GlobalEvents.cpp \
|
GlobalEvents.cpp \
|
||||||
GlobalEvents.h \
|
GlobalEvents.h \
|
||||||
GMTicketHandler.cpp \
|
GMTicketHandler.cpp \
|
||||||
GMTicketMgr.cpp \
|
GMTicketMgr.cpp \
|
||||||
GMTicketMgr.h \
|
GMTicketMgr.h \
|
||||||
GossipDef.cpp \
|
GossipDef.cpp \
|
||||||
GossipDef.h \
|
GossipDef.h \
|
||||||
GridDefines.h \
|
GridDefines.h \
|
||||||
GridNotifiers.cpp \
|
GridNotifiers.cpp \
|
||||||
GridNotifiers.h \
|
GridNotifiers.h \
|
||||||
GridNotifiersImpl.h \
|
GridNotifiersImpl.h \
|
||||||
GridStates.cpp \
|
GridStates.cpp \
|
||||||
GridStates.h \
|
GridStates.h \
|
||||||
Group.cpp \
|
Group.cpp \
|
||||||
Group.h \
|
Group.h \
|
||||||
GroupHandler.cpp \
|
GroupHandler.cpp \
|
||||||
GuardAI.cpp \
|
GuardAI.cpp \
|
||||||
GuardAI.h \
|
GuardAI.h \
|
||||||
Guild.cpp \
|
Guild.cpp \
|
||||||
Guild.h \
|
Guild.h \
|
||||||
GuildHandler.cpp \
|
GuildHandler.cpp \
|
||||||
HomeMovementGenerator.cpp \
|
HomeMovementGenerator.cpp \
|
||||||
HomeMovementGenerator.h \
|
HomeMovementGenerator.h \
|
||||||
HostilRefManager.cpp \
|
HostilRefManager.cpp \
|
||||||
HostilRefManager.h \
|
HostilRefManager.h \
|
||||||
IdleMovementGenerator.cpp \
|
IdleMovementGenerator.cpp \
|
||||||
IdleMovementGenerator.h \
|
IdleMovementGenerator.h \
|
||||||
InstanceData.cpp \
|
InstanceData.cpp \
|
||||||
InstanceData.h \
|
InstanceData.h \
|
||||||
InstanceSaveMgr.cpp \
|
InstanceSaveMgr.cpp \
|
||||||
InstanceSaveMgr.h \
|
InstanceSaveMgr.h \
|
||||||
Item.cpp \
|
Item.cpp \
|
||||||
Item.h \
|
Item.h \
|
||||||
ItemEnchantmentMgr.cpp \
|
ItemEnchantmentMgr.cpp \
|
||||||
ItemEnchantmentMgr.h \
|
ItemEnchantmentMgr.h \
|
||||||
ItemHandler.cpp \
|
ItemHandler.cpp \
|
||||||
ItemPrototype.h \
|
ItemPrototype.h \
|
||||||
Language.h \
|
Language.h \
|
||||||
Level0.cpp \
|
Level0.cpp \
|
||||||
Level1.cpp \
|
Level1.cpp \
|
||||||
Level2.cpp \
|
Level2.cpp \
|
||||||
Level3.cpp \
|
Level3.cpp \
|
||||||
LFGHandler.cpp \
|
LFGHandler.cpp \
|
||||||
LootHandler.cpp \
|
LootHandler.cpp \
|
||||||
LootMgr.cpp \
|
LootMgr.cpp \
|
||||||
LootMgr.h \
|
LootMgr.h \
|
||||||
Mail.cpp \
|
Mail.cpp \
|
||||||
Mail.h \
|
Mail.h \
|
||||||
Map.cpp \
|
Map.cpp \
|
||||||
Map.h \
|
Map.h \
|
||||||
MapInstanced.cpp \
|
MapInstanced.cpp \
|
||||||
MapInstanced.h \
|
MapInstanced.h \
|
||||||
MapManager.cpp \
|
MapManager.cpp \
|
||||||
MapManager.h \
|
MapManager.h \
|
||||||
MapReference.h \
|
MapReference.h \
|
||||||
MapRefManager.h \
|
MapRefManager.h \
|
||||||
MiscHandler.cpp \
|
MiscHandler.cpp \
|
||||||
MotionMaster.cpp \
|
MotionMaster.cpp \
|
||||||
MotionMaster.h \
|
MotionMaster.h \
|
||||||
MovementGenerator.cpp \
|
MovementGenerator.cpp \
|
||||||
MovementGenerator.h \
|
MovementGenerator.h \
|
||||||
MovementGeneratorImpl.h \
|
MovementGeneratorImpl.h \
|
||||||
MovementHandler.cpp \
|
MovementHandler.cpp \
|
||||||
NPCHandler.cpp \
|
NPCHandler.cpp \
|
||||||
NPCHandler.h \
|
NPCHandler.h \
|
||||||
NullCreatureAI.cpp \
|
NullCreatureAI.cpp \
|
||||||
NullCreatureAI.h \
|
NullCreatureAI.h \
|
||||||
ObjectAccessor.cpp \
|
ObjectAccessor.cpp \
|
||||||
ObjectAccessor.h \
|
ObjectAccessor.h \
|
||||||
Object.cpp \
|
Object.cpp \
|
||||||
ObjectDefines.h \
|
ObjectDefines.h \
|
||||||
ObjectGridLoader.cpp \
|
ObjectGridLoader.cpp \
|
||||||
ObjectGridLoader.h \
|
ObjectGridLoader.h \
|
||||||
Object.h \
|
Object.h \
|
||||||
ObjectMgr.cpp \
|
ObjectMgr.cpp \
|
||||||
ObjectMgr.h \
|
ObjectMgr.h \
|
||||||
ObjectPosSelector.cpp \
|
ObjectPosSelector.cpp \
|
||||||
ObjectPosSelector.h \
|
ObjectPosSelector.h \
|
||||||
Opcodes.cpp \
|
Opcodes.cpp \
|
||||||
Opcodes.h \
|
Opcodes.h \
|
||||||
Path.h \
|
Path.h \
|
||||||
PetAI.cpp \
|
PetAI.cpp \
|
||||||
PetAI.h \
|
PetAI.h \
|
||||||
Pet.cpp \
|
Pet.cpp \
|
||||||
Pet.h \
|
Pet.h \
|
||||||
PetHandler.cpp \
|
PetHandler.cpp \
|
||||||
PetitionsHandler.cpp \
|
PetitionsHandler.cpp \
|
||||||
Player.cpp \
|
Player.cpp \
|
||||||
Player.h \
|
Player.h \
|
||||||
PlayerDump.cpp \
|
PlayerDump.cpp \
|
||||||
PlayerDump.h \
|
PlayerDump.h \
|
||||||
PointMovementGenerator.cpp \
|
PointMovementGenerator.cpp \
|
||||||
PointMovementGenerator.h \
|
PointMovementGenerator.h \
|
||||||
PoolHandler.cpp \
|
PoolHandler.cpp \
|
||||||
PoolHandler.h \
|
PoolHandler.h \
|
||||||
QueryHandler.cpp \
|
QueryHandler.cpp \
|
||||||
QuestDef.cpp \
|
QuestDef.cpp \
|
||||||
QuestDef.h \
|
QuestDef.h \
|
||||||
QuestHandler.cpp \
|
QuestHandler.cpp \
|
||||||
RandomMovementGenerator.cpp \
|
RandomMovementGenerator.cpp \
|
||||||
RandomMovementGenerator.h \
|
RandomMovementGenerator.h \
|
||||||
ReactorAI.cpp \
|
ReactorAI.cpp \
|
||||||
ReactorAI.h \
|
ReactorAI.h \
|
||||||
ReputationMgr.cpp \
|
ReputationMgr.cpp \
|
||||||
ReputationMgr.h \
|
ReputationMgr.h \
|
||||||
ScriptCalls.cpp \
|
ScriptCalls.cpp \
|
||||||
ScriptCalls.h \
|
ScriptCalls.h \
|
||||||
SharedDefines.h \
|
SharedDefines.h \
|
||||||
SkillHandler.cpp \
|
SkillHandler.cpp \
|
||||||
SpellAuraDefines.h \
|
SpellAuraDefines.h \
|
||||||
SpellAuras.cpp \
|
SpellAuras.cpp \
|
||||||
SpellAuras.h \
|
SpellAuras.h \
|
||||||
Spell.cpp \
|
Spell.cpp \
|
||||||
SpellEffects.cpp \
|
SpellEffects.cpp \
|
||||||
Spell.h \
|
Spell.h \
|
||||||
SkillDiscovery.cpp \
|
SkillDiscovery.cpp \
|
||||||
SkillDiscovery.h \
|
SkillDiscovery.h \
|
||||||
SkillExtraItems.cpp \
|
SkillExtraItems.cpp \
|
||||||
SkillExtraItems.h \
|
SkillExtraItems.h \
|
||||||
SpellHandler.cpp \
|
SpellHandler.cpp \
|
||||||
SocialMgr.cpp \
|
SocialMgr.cpp \
|
||||||
SocialMgr.h \
|
SocialMgr.h \
|
||||||
SpellMgr.cpp \
|
SpellMgr.cpp \
|
||||||
SpellMgr.h \
|
SpellMgr.h \
|
||||||
StatSystem.cpp \
|
StatSystem.cpp \
|
||||||
TargetedMovementGenerator.cpp \
|
TargetedMovementGenerator.cpp \
|
||||||
TargetedMovementGenerator.h \
|
TargetedMovementGenerator.h \
|
||||||
TaxiHandler.cpp \
|
TaxiHandler.cpp \
|
||||||
TemporarySummon.cpp \
|
TemporarySummon.cpp \
|
||||||
TemporarySummon.h \
|
TemporarySummon.h \
|
||||||
TotemAI.cpp \
|
TotemAI.cpp \
|
||||||
TotemAI.h \
|
TotemAI.h \
|
||||||
Totem.cpp \
|
Totem.cpp \
|
||||||
Totem.h \
|
Totem.h \
|
||||||
TradeHandler.cpp \
|
TradeHandler.cpp \
|
||||||
Transports.cpp \
|
Transports.cpp \
|
||||||
Transports.h \
|
Transports.h \
|
||||||
ThreatManager.cpp \
|
ThreatManager.cpp \
|
||||||
ThreatManager.h \
|
ThreatManager.h \
|
||||||
Traveller.h \
|
Traveller.h \
|
||||||
Unit.cpp \
|
Unit.cpp \
|
||||||
Unit.h \
|
Unit.h \
|
||||||
UnitEvents.h \
|
UnitEvents.h \
|
||||||
UpdateData.cpp \
|
UpdateData.cpp \
|
||||||
UpdateData.h \
|
UpdateData.h \
|
||||||
UpdateFields.h \
|
UpdateFields.h \
|
||||||
UpdateMask.h \
|
UpdateMask.h \
|
||||||
Vehicle.cpp \
|
Vehicle.cpp \
|
||||||
Vehicle.h \
|
Vehicle.h \
|
||||||
VoiceChatHandler.cpp \
|
VoiceChatHandler.cpp \
|
||||||
WaypointManager.cpp \
|
WaypointManager.cpp \
|
||||||
WaypointManager.h \
|
WaypointManager.h \
|
||||||
WaypointMovementGenerator.cpp \
|
WaypointMovementGenerator.cpp \
|
||||||
WaypointMovementGenerator.h \
|
WaypointMovementGenerator.h \
|
||||||
Weather.cpp \
|
Weather.cpp \
|
||||||
Weather.h \
|
Weather.h \
|
||||||
World.cpp \
|
World.cpp \
|
||||||
World.h \
|
World.h \
|
||||||
WorldLog.cpp \
|
WorldLog.cpp \
|
||||||
WorldLog.h \
|
WorldLog.h \
|
||||||
WorldSession.cpp \
|
WorldSession.cpp \
|
||||||
WorldSession.h \
|
WorldSession.h \
|
||||||
WorldSocket.cpp \
|
WorldSocket.cpp \
|
||||||
WorldSocket.h \
|
WorldSocket.h \
|
||||||
WorldSocketMgr.cpp \
|
WorldSocketMgr.cpp \
|
||||||
WorldSocketMgr.h \
|
WorldSocketMgr.h \
|
||||||
FollowerReference.cpp \
|
FollowerReference.cpp \
|
||||||
FollowerReference.h \
|
FollowerReference.h \
|
||||||
FollowerRefManager.h \
|
FollowerRefManager.h \
|
||||||
GroupReference.cpp \
|
GroupReference.cpp \
|
||||||
GroupReference.h \
|
GroupReference.h \
|
||||||
GroupRefManager.h
|
GroupRefManager.h
|
||||||
>>>>>>> 2429aaf2276d689e101ed88285f18449dbe4280d:src/game/Makefile.am
|
>>>>>>> 2429aaf2276d689e101ed88285f18449dbe4280d:src/game/Makefile.am
|
||||||
|
|
||||||
## Link against shared library
|
## Link against shared library
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#include "CellImpl.h"
|
#include "CellImpl.h"
|
||||||
#include "Corpse.h"
|
#include "Corpse.h"
|
||||||
#include "ObjectMgr.h"
|
#include "ObjectMgr.h"
|
||||||
|
#include "Language.h"
|
||||||
|
|
||||||
#define CLASS_LOCK Trinity::ClassLevelLockable<MapManager, ZThread::Mutex>
|
#define CLASS_LOCK Trinity::ClassLevelLockable<MapManager, ZThread::Mutex>
|
||||||
INSTANTIATE_SINGLETON_2(MapManager, CLASS_LOCK);
|
INSTANTIATE_SINGLETON_2(MapManager, CLASS_LOCK);
|
||||||
@@ -165,7 +166,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player)
|
|||||||
{
|
{
|
||||||
// probably there must be special opcode, because client has this string constant in GlobalStrings.lua
|
// probably there must be special opcode, because client has this string constant in GlobalStrings.lua
|
||||||
// TODO: this is not a good place to send the message
|
// TODO: this is not a good place to send the message
|
||||||
player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetTrinityString(810), mapName);
|
player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetTrinityString(LANG_INSTANCE_RAID_GROUP_ONLY), mapName);
|
||||||
sLog.outDebug("MAP: Player '%s' must be in a raid group to enter instance of '%s'", player->GetName(), mapName);
|
sLog.outDebug("MAP: Player '%s' must be in a raid group to enter instance of '%s'", player->GetName(), mapName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -525,9 +525,9 @@ void MotionMaster::DelayedDelete(_Ty curr)
|
|||||||
|
|
||||||
bool MotionMaster::GetDestination(float &x, float &y, float &z)
|
bool MotionMaster::GetDestination(float &x, float &y, float &z)
|
||||||
{
|
{
|
||||||
if(empty())
|
if(empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return top()->GetDestination(x,y,z);
|
return top()->GetDestination(x,y,z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class TRINITY_DLL_SPEC MotionMaster //: private std::stack<MovementGenerator *>
|
|||||||
typedef std::vector<_Ty> ExpireList;
|
typedef std::vector<_Ty> ExpireList;
|
||||||
int i_top;
|
int i_top;
|
||||||
|
|
||||||
bool empty() const { return i_top < 0; }
|
bool empty() const { return (i_top < 0); }
|
||||||
void pop() { Impl[i_top] = NULL; --i_top; }
|
void pop() { Impl[i_top] = NULL; --i_top; }
|
||||||
void push(_Ty _Val) { ++i_top; Impl[i_top] = _Val; }
|
void push(_Ty _Val) { ++i_top; Impl[i_top] = _Val; }
|
||||||
|
|
||||||
|
|||||||
@@ -5149,9 +5149,9 @@ void ObjectMgr::LoadAccessRequirements()
|
|||||||
|
|
||||||
uint32 count = 0;
|
uint32 count = 0;
|
||||||
|
|
||||||
// 0 1 2 3 4 5 6 7 8 9 10
|
// 0 1 2 3 4 5 6 7 8 9 10
|
||||||
QueryResult *result = WorldDatabase.Query("SELECT id, level_min, level_max, item, item2, heroic_key, heroic_key2, quest_done, quest_failed_text, heroic_quest_done, heroic_quest_failed_text FROM access_requirement");
|
QueryResult *result = WorldDatabase.Query("SELECT id, level_min, level_max, item, item2, heroic_key, heroic_key2, quest_done, quest_failed_text, heroic_quest_done, heroic_quest_failed_text FROM access_requirement");
|
||||||
if( !result )
|
if( !result )
|
||||||
{
|
{
|
||||||
|
|
||||||
barGoLink bar( 1 );
|
barGoLink bar( 1 );
|
||||||
@@ -5228,15 +5228,15 @@ void ObjectMgr::LoadAccessRequirements()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ar.heroicQuest)
|
if(ar.heroicQuest)
|
||||||
{
|
{
|
||||||
QuestMap::iterator qReqItr = mQuestTemplates.find(ar.heroicQuest);
|
QuestMap::iterator qReqItr = mQuestTemplates.find(ar.heroicQuest);
|
||||||
if(qReqItr == mQuestTemplates.end())
|
if(qReqItr == mQuestTemplates.end())
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Required Heroic Quest %u not exist for trigger %u, remove heroic quest done requirement.",ar.heroicQuest,requiremt_ID);
|
sLog.outErrorDb("Required Heroic Quest %u not exist for trigger %u, remove heroic quest done requirement.",ar.heroicQuest,requiremt_ID);
|
||||||
ar.heroicQuest = 0;
|
ar.heroicQuest = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ar.quest)
|
if(ar.quest)
|
||||||
{
|
{
|
||||||
|
|||||||
+8
-5
@@ -6273,6 +6273,8 @@ void Player::DuelComplete(DuelCompleteType type)
|
|||||||
if(!duel)
|
if(!duel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
sLog.outDebug("Dual Complete %s %s", GetName(), duel->opponent->GetName());
|
||||||
|
|
||||||
WorldPacket data(SMSG_DUEL_COMPLETE, (1));
|
WorldPacket data(SMSG_DUEL_COMPLETE, (1));
|
||||||
data << (uint8)((type != DUEL_INTERUPTED) ? 1 : 0);
|
data << (uint8)((type != DUEL_INTERUPTED) ? 1 : 0);
|
||||||
GetSession()->SendPacket(&data);
|
GetSession()->SendPacket(&data);
|
||||||
@@ -6309,8 +6311,8 @@ void Player::DuelComplete(DuelCompleteType type)
|
|||||||
duel->initiator->RemoveGameObject(obj,true);
|
duel->initiator->RemoveGameObject(obj,true);
|
||||||
|
|
||||||
/* remove auras */
|
/* remove auras */
|
||||||
AuraMap & vAuras = duel->opponent->GetAuras();
|
AuraMap &itsAuras = duel->opponent->GetAuras();
|
||||||
for(AuraMap::iterator i = vAuras.begin(); i != vAuras.end();)
|
for(AuraMap::iterator i = itsAuras.begin(); i != itsAuras.end();)
|
||||||
{
|
{
|
||||||
if (!i->second->IsPositive() && i->second->GetCasterGUID() == GetGUID() && i->second->GetAuraApplyTime() >= duel->startTime)
|
if (!i->second->IsPositive() && i->second->GetCasterGUID() == GetGUID() && i->second->GetAuraApplyTime() >= duel->startTime)
|
||||||
{
|
{
|
||||||
@@ -6320,7 +6322,8 @@ void Player::DuelComplete(DuelCompleteType type)
|
|||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end();)
|
AuraMap &myAuras = GetAuras();
|
||||||
|
for(AuraMap::iterator i = myAuras.begin(); i != myAuras.end();)
|
||||||
{
|
{
|
||||||
if (!i->second->IsPositive() && i->second->GetCasterGUID() == duel->opponent->GetGUID() && i->second->GetAuraApplyTime() >= duel->startTime)
|
if (!i->second->IsPositive() && i->second->GetCasterGUID() == duel->opponent->GetGUID() && i->second->GetAuraApplyTime() >= duel->startTime)
|
||||||
{
|
{
|
||||||
@@ -15523,7 +15526,7 @@ bool Player::Satisfy(AccessRequirement const *ar, uint32 target_map, bool report
|
|||||||
missingItem = ar->item2;
|
missingItem = ar->item2;
|
||||||
|
|
||||||
uint32 missingKey = 0;
|
uint32 missingKey = 0;
|
||||||
uint32 missingHeroicQuest = 0;
|
uint32 missingHeroicQuest = 0;
|
||||||
if(GetDifficulty() == DIFFICULTY_HEROIC)
|
if(GetDifficulty() == DIFFICULTY_HEROIC)
|
||||||
{
|
{
|
||||||
if(ar->heroicKey)
|
if(ar->heroicKey)
|
||||||
@@ -15535,7 +15538,7 @@ bool Player::Satisfy(AccessRequirement const *ar, uint32 target_map, bool report
|
|||||||
else if(ar->heroicKey2 && !HasItemCount(ar->heroicKey2, 1))
|
else if(ar->heroicKey2 && !HasItemCount(ar->heroicKey2, 1))
|
||||||
missingKey = ar->heroicKey2;
|
missingKey = ar->heroicKey2;
|
||||||
|
|
||||||
if(ar->heroicQuest && !GetQuestRewardStatus(ar->heroicQuest))
|
if(ar->heroicQuest && !GetQuestRewardStatus(ar->heroicQuest))
|
||||||
missingHeroicQuest = ar->heroicQuest;
|
missingHeroicQuest = ar->heroicQuest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -784,7 +784,7 @@ struct AccessRequirement
|
|||||||
uint32 heroicKey2;
|
uint32 heroicKey2;
|
||||||
uint32 quest;
|
uint32 quest;
|
||||||
std::string questFailedText;
|
std::string questFailedText;
|
||||||
uint32 heroicQuest;
|
uint32 heroicQuest;
|
||||||
std::string heroicQuestFailedText;
|
std::string heroicQuestFailedText;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include "DestinationHolderImp.h"
|
#include "DestinationHolderImp.h"
|
||||||
#include "Map.h"
|
#include "Map.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
|
#include "CreatureGroups.h"
|
||||||
|
|
||||||
#define RUNNING_CHANCE_RANDOMMV 20 //will be "1 / RUNNING_CHANCE_RANDOMMV"
|
#define RUNNING_CHANCE_RANDOMMV 20 //will be "1 / RUNNING_CHANCE_RANDOMMV"
|
||||||
|
|
||||||
@@ -114,6 +115,12 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
|
|||||||
i_nextMoveTime.Reset(urand(500+i_destinationHolder.GetTotalTravelTime(),5000+i_destinationHolder.GetTotalTravelTime()));
|
i_nextMoveTime.Reset(urand(500+i_destinationHolder.GetTotalTravelTime(),5000+i_destinationHolder.GetTotalTravelTime()));
|
||||||
creature.SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
|
creature.SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Call for creature group update
|
||||||
|
if(creature.GetFormation() && creature.GetFormation()->getLeader() == &creature)
|
||||||
|
{
|
||||||
|
creature.GetFormation()->LeaderMoveTo(nx, ny, nz);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri
|
|||||||
Player *pFriend = ObjectAccessor::FindPlayer(friendGUID);
|
Player *pFriend = ObjectAccessor::FindPlayer(friendGUID);
|
||||||
|
|
||||||
if(!pFriend)
|
if(!pFriend)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32 team = player->GetTeam();
|
uint32 team = player->GetTeam();
|
||||||
uint32 security = player->GetSession()->GetSecurity();
|
uint32 security = player->GetSession()->GetSecurity();
|
||||||
|
|||||||
@@ -1340,13 +1340,13 @@ void Spell::EffectDummy(uint32 i)
|
|||||||
m_caster->CastCustomSpell(m_caster,34846,&chargeBasePoints0,NULL,NULL,true);
|
m_caster->CastCustomSpell(m_caster,34846,&chargeBasePoints0,NULL,NULL,true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//Slam
|
//Slam
|
||||||
if(m_spellInfo->SpellFamilyFlags[0] & 0x200000 && m_spellInfo->SpellIconID == 559)
|
if(m_spellInfo->SpellFamilyFlags[0] & 0x200000 && m_spellInfo->SpellIconID == 559)
|
||||||
{
|
{
|
||||||
int32 bp0 = damage;
|
int32 bp0 = damage;
|
||||||
m_caster->CastCustomSpell(unitTarget, 50783, &bp0, NULL, NULL, true, 0);
|
m_caster->CastCustomSpell(unitTarget, 50783, &bp0, NULL, NULL, true, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Execute
|
// Execute
|
||||||
if(m_spellInfo->SpellFamilyFlags[0] & 0x20000000)
|
if(m_spellInfo->SpellFamilyFlags[0] & 0x20000000)
|
||||||
{
|
{
|
||||||
@@ -5818,15 +5818,15 @@ void Spell::EffectSummonDeadPet(uint32 /*i*/)
|
|||||||
return;
|
return;
|
||||||
if(damage < 0)
|
if(damage < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
|
pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
|
||||||
pet->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
pet->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
||||||
pet->setDeathState( ALIVE );
|
pet->setDeathState( ALIVE );
|
||||||
pet->clearUnitState(UNIT_STAT_ALL_STATE);
|
pet->clearUnitState(UNIT_STAT_ALL_STATE);
|
||||||
pet->SetHealth( uint32(pet->GetMaxHealth()*(float(damage)/100)));
|
pet->SetHealth( uint32(pet->GetMaxHealth()*(float(damage)/100)));
|
||||||
|
|
||||||
pet->AIM_Initialize();
|
//pet->AIM_Initialize();
|
||||||
|
//_player->PetSpellInitialize();
|
||||||
_player->PetSpellInitialize();
|
|
||||||
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
|
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2326,7 +2326,7 @@ void SpellMgr::LoadSpellCustomAttr()
|
|||||||
case 45027: // Revitalize
|
case 45027: // Revitalize
|
||||||
case 45976: // Muru Portal Channel
|
case 45976: // Muru Portal Channel
|
||||||
case 39365: // Thundering Storm
|
case 39365: // Thundering Storm
|
||||||
case 41071: // Raise Dead (HACK)
|
case 41071: // Raise Dead (HACK)
|
||||||
spellInfo->MaxAffectedTargets = 1;
|
spellInfo->MaxAffectedTargets = 1;
|
||||||
break;
|
break;
|
||||||
case 41376: // Spite
|
case 41376: // Spite
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include "Creature.h"
|
#include "Creature.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include "CreatureGroups.h"
|
|
||||||
|
|
||||||
/** Traveller is a wrapper for units (creatures or players) that
|
/** Traveller is a wrapper for units (creatures or players) that
|
||||||
* travel from point A to point B using the destination holder.
|
* travel from point A to point B using the destination holder.
|
||||||
@@ -109,11 +108,6 @@ inline float Traveller<Creature>::GetMoveDestinationTo(float x, float y, float z
|
|||||||
template<>
|
template<>
|
||||||
inline void Traveller<Creature>::MoveTo(float x, float y, float z, uint32 t)
|
inline void Traveller<Creature>::MoveTo(float x, float y, float z, uint32 t)
|
||||||
{
|
{
|
||||||
//Call for creature group update
|
|
||||||
if(i_traveller.IsFormationLeader() && !i_traveller.isInCombat() &&
|
|
||||||
CreatureGroupHolder.find(i_traveller.GetFormationID()) != CreatureGroupHolder.end())
|
|
||||||
CreatureGroupHolder[i_traveller.GetFormationID()]->LeaderMovedInEvade();
|
|
||||||
|
|
||||||
//i_traveller.AI_SendMoveToPacket(x, y, z, t, i_traveller.GetUnitMovementFlags(), 0);
|
//i_traveller.AI_SendMoveToPacket(x, y, z, t, i_traveller.GetUnitMovementFlags(), 0);
|
||||||
i_traveller.SendMonsterMove(x, y, z, t);
|
i_traveller.SendMonsterMove(x, y, z, t);
|
||||||
}
|
}
|
||||||
|
|||||||
+31
-47
@@ -3216,47 +3216,35 @@ void Unit::_UpdateSpells( uint32 time )
|
|||||||
|
|
||||||
// TODO: Find a better way to prevent crash when multiple auras are removed.
|
// TODO: Find a better way to prevent crash when multiple auras are removed.
|
||||||
for (AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end(); ++i)
|
for (AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end(); ++i)
|
||||||
if ((*i).second)
|
i->second->SetUpdated(false);
|
||||||
(*i).second->SetUpdated(false);
|
|
||||||
for (AuraMap::iterator i = m_Auras.begin(), next; i != m_Auras.end(); i = next)
|
|
||||||
{
|
|
||||||
next = i;
|
|
||||||
++next;
|
|
||||||
if ((*i).second)
|
|
||||||
{
|
|
||||||
// prevent double update
|
|
||||||
if ((*i).second->IsUpdated())
|
|
||||||
continue;
|
|
||||||
uint32 removedAuras = m_removedAuras.size();
|
|
||||||
(*i).second->SetUpdated(true);
|
|
||||||
(*i).second->Update( time );
|
|
||||||
// several auras can be deleted due to update
|
|
||||||
if (removedAuras < m_removedAuras.size())
|
|
||||||
{
|
|
||||||
if (m_Auras.empty()) break;
|
|
||||||
next = m_Auras.begin();
|
|
||||||
removedAuras = m_removedAuras.size();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end();)
|
for(AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end();)
|
||||||
{
|
{
|
||||||
if ((*i).second)
|
Aura *aur = i->second;
|
||||||
|
|
||||||
|
// prevent double update
|
||||||
|
if (aur->IsUpdated())
|
||||||
|
continue;
|
||||||
|
aur->SetUpdated(true);
|
||||||
|
|
||||||
|
uint32 removedAuras = m_removedAuras.size();
|
||||||
|
aur->Update( time );
|
||||||
|
|
||||||
|
// several auras can be deleted due to update
|
||||||
|
if(removedAuras < m_removedAuras.size())
|
||||||
{
|
{
|
||||||
if ( !(*i).second->GetAuraDuration() && !((*i).second->IsPermanent() || ((*i).second->IsPassive())) )
|
i = m_Auras.begin();
|
||||||
{
|
|
||||||
RemoveAura(i, AURA_REMOVE_BY_EXPIRE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
++i;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(AuraMap::iterator i = m_Auras.begin(); i != m_Auras.end();)
|
||||||
|
{
|
||||||
|
if(!i->second->GetAuraDuration() && !(i->second->IsPermanent() || (i->second->IsPassive())))
|
||||||
|
RemoveAura(i, AURA_REMOVE_BY_EXPIRE);
|
||||||
|
else
|
||||||
++i;
|
++i;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (AuraList::iterator i = m_removedAuras.begin(); i != m_removedAuras.end();i = m_removedAuras.begin())
|
for (AuraList::iterator i = m_removedAuras.begin(); i != m_removedAuras.end();i = m_removedAuras.begin())
|
||||||
@@ -4165,10 +4153,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
|
|||||||
statue->UnSummon();
|
statue->UnSummon();
|
||||||
|
|
||||||
// only way correctly remove all auras from list
|
// only way correctly remove all auras from list
|
||||||
if( m_Auras.empty() )
|
i = m_Auras.begin();
|
||||||
i = m_Auras.end();
|
|
||||||
else
|
|
||||||
i = m_Auras.begin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::RemoveAllAuras()
|
void Unit::RemoveAllAuras()
|
||||||
@@ -9555,7 +9540,14 @@ void Unit::CombatStart(Unit* target)
|
|||||||
|
|
||||||
if(!target->isInCombat() && target->GetTypeId() != TYPEID_PLAYER
|
if(!target->isInCombat() && target->GetTypeId() != TYPEID_PLAYER
|
||||||
&& !((Creature*)target)->HasReactState(REACT_PASSIVE) && ((Creature*)target)->IsAIEnabled)
|
&& !((Creature*)target)->HasReactState(REACT_PASSIVE) && ((Creature*)target)->IsAIEnabled)
|
||||||
|
{
|
||||||
((Creature*)target)->AI()->AttackStart(this);
|
((Creature*)target)->AI()->AttackStart(this);
|
||||||
|
if(((Creature*)target)->GetFormation())
|
||||||
|
{
|
||||||
|
((Creature*)target)->GetFormation()->MemberAttackStart((Creature*)target, this);
|
||||||
|
sLog.outDebug("Unit::CombatStart() calls CreatureGroups::MemberHasAttacked(this);");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SetInCombatWith(target);
|
SetInCombatWith(target);
|
||||||
target->SetInCombatWith(this);
|
target->SetInCombatWith(this);
|
||||||
@@ -9572,14 +9564,6 @@ void Unit::CombatStart(Unit* target)
|
|||||||
me->UpdatePvP(true);
|
me->UpdatePvP(true);
|
||||||
me->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
|
me->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Call creature group update
|
|
||||||
if(GetTypeId()==TYPEID_UNIT && ((Creature*)this)->GetFormationID())
|
|
||||||
{
|
|
||||||
CreatureGroupHolderType::iterator itr = CreatureGroupHolder.find(((Creature*)this)->GetFormationID());
|
|
||||||
if(itr != CreatureGroupHolder.end())
|
|
||||||
itr->second->MemberHasAttacked(((Creature*)this));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::SetInCombatState(bool PvP)
|
void Unit::SetInCombatState(bool PvP)
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
//Creature-specific headers
|
//Creature-specific headers
|
||||||
#include "Creature.h"
|
#include "Creature.h"
|
||||||
#include "CreatureAI.h"
|
#include "CreatureAI.h"
|
||||||
|
#include "CreatureGroups.h"
|
||||||
//Player-specific
|
//Player-specific
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
|
|
||||||
@@ -54,7 +55,7 @@ bool WaypointMovementGenerator<Creature>::GetDestination(float &x, float &y, flo
|
|||||||
{
|
{
|
||||||
if(i_destinationHolder.HasArrived())
|
if(i_destinationHolder.HasArrived())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
i_destinationHolder.GetDestination(x, y, z);
|
i_destinationHolder.GetDestination(x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -109,6 +110,10 @@ WaypointMovementGenerator<Creature>::Initialize(Creature &u)
|
|||||||
InitTraveller(u, *node);
|
InitTraveller(u, *node);
|
||||||
i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
|
i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
|
||||||
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
|
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
|
||||||
|
|
||||||
|
//Call for creature group update
|
||||||
|
if(u.GetFormation() && u.GetFormation()->getLeader() == &u)
|
||||||
|
u.GetFormation()->LeaderMoveTo(node->x, node->y, node->z);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
node = NULL;
|
node = NULL;
|
||||||
@@ -180,6 +185,10 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
|||||||
InitTraveller(unit, *node);
|
InitTraveller(unit, *node);
|
||||||
i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
|
i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
|
||||||
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
|
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
|
||||||
|
|
||||||
|
//Call for creature group update
|
||||||
|
if(unit.GetFormation() && unit.GetFormation()->getLeader() == &unit)
|
||||||
|
unit.GetFormation()->LeaderMoveTo(node->x, node->y, node->z);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
+11
-11
@@ -1526,17 +1526,17 @@ void World::SetInitialWorldSettings()
|
|||||||
sLog.outString("Initialize AuctionHouseBot...");
|
sLog.outString("Initialize AuctionHouseBot...");
|
||||||
AuctionHouseBotInit();
|
AuctionHouseBotInit();
|
||||||
|
|
||||||
// possibly enable db logging; avoid massive startup spam by doing it here.
|
// possibly enable db logging; avoid massive startup spam by doing it here.
|
||||||
if (sLog.GetLogDBLater())
|
if (sLog.GetLogDBLater())
|
||||||
{
|
{
|
||||||
sLog.outString("Enabling database logging...");
|
sLog.outString("Enabling database logging...");
|
||||||
sLog.SetLogDBLater(false);
|
sLog.SetLogDBLater(false);
|
||||||
sLog.SetLogDB(true);
|
sLog.SetLogDB(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sLog.SetLogDBLater(false);
|
sLog.SetLogDBLater(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
sLog.outString( "WORLD: World initialized" );
|
sLog.outString( "WORLD: World initialized" );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user