*Merge.
--HG-- branch : trunk
This commit is contained in:
@@ -95,7 +95,7 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accid)
|
||||
|
||||
LoginDatabase.BeginTransaction();
|
||||
|
||||
bool res =
|
||||
bool res =
|
||||
LoginDatabase.PExecute("DELETE FROM account WHERE id='%d'", accid) &&
|
||||
LoginDatabase.PExecute("DELETE FROM realmcharacters WHERE acctid='%d'", accid);
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ SET(game_STAT_SRCS
|
||||
Creature.h
|
||||
CreatureGroups.cpp
|
||||
CreatureGroups.h
|
||||
debugcmds.cpp
|
||||
Debugcmds.cpp
|
||||
DestinationHolder.cpp
|
||||
DestinationHolder.h
|
||||
DestinationHolderImp.h
|
||||
@@ -236,7 +236,7 @@ SET(game_STAT_SRCS
|
||||
TicketHandler.cpp
|
||||
TicketMgr.cpp
|
||||
TicketMgr.h
|
||||
tools.cpp
|
||||
Tools.cpp
|
||||
Tools.h
|
||||
TotemAI.cpp
|
||||
TotemAI.h
|
||||
|
||||
+1
-1
@@ -154,7 +154,7 @@ Cell::Visit(const CellLock<LOCK_TYPE> &l, TypeContainerVisitor<T, CONTAINER> &vi
|
||||
{
|
||||
m.Visit(l, visitor);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
CellPair begin_cell = standing_cell;
|
||||
CellPair end_cell = standing_cell;
|
||||
|
||||
+8
-8
@@ -164,7 +164,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ "modify", SEC_GAMEMASTER, false, &ChatHandler::HandleWpModifyCommand, "", NULL },
|
||||
{ "event", SEC_GAMEMASTER, false, &ChatHandler::HandleWpEventCommand, "", NULL },
|
||||
{ "unload", SEC_GAMEMASTER, false, &ChatHandler::HandleWpUnLoadPathCommand, "", NULL },
|
||||
|
||||
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
@@ -560,11 +560,11 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ "event", SEC_GAMEMASTER, false, NULL, "", eventCommandTable },
|
||||
{ "gobject", SEC_GAMEMASTER, false, NULL, "", gobjectCommandTable },
|
||||
{ "honor", SEC_GAMEMASTER, false, NULL, "", honorCommandTable },
|
||||
|
||||
|
||||
//wp commands
|
||||
{ "path", SEC_GAMEMASTER, false, NULL, "", wpCommandTable },
|
||||
{ "loadpath", SEC_ADMINISTRATOR, false, &ChatHandler::HandleReloadAllPaths, "", NULL },
|
||||
|
||||
|
||||
{ "quest", SEC_ADMINISTRATOR, false, NULL, "", questCommandTable },
|
||||
{ "reload", SEC_ADMINISTRATOR, true, NULL, "", reloadCommandTable },
|
||||
{ "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable },
|
||||
@@ -579,7 +579,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
|
||||
{ "aura", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAuraCommand, "", NULL },
|
||||
{ "unaura", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnAuraCommand, "", NULL },
|
||||
{ "nameannounce", SEC_MODERATOR, false, &ChatHandler::HandleNameAnnounceCommand, "", NULL },
|
||||
{ "nameannounce", SEC_MODERATOR, false, &ChatHandler::HandleNameAnnounceCommand, "", NULL },
|
||||
{ "gmnameannounce", SEC_MODERATOR, false, &ChatHandler::HandleGMNameAnnounceCommand, "", NULL },
|
||||
{ "announce", SEC_MODERATOR, true, &ChatHandler::HandleAnnounceCommand, "", NULL },
|
||||
{ "gmannounce", SEC_MODERATOR, true, &ChatHandler::HandleGMAnnounceCommand, "", NULL },
|
||||
@@ -649,10 +649,10 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ "sendmessage", SEC_ADMINISTRATOR, true, &ChatHandler::HandleSendMessageCommand, "", NULL },
|
||||
{ "playall", SEC_ADMINISTRATOR, false, &ChatHandler::HandlePlayAllCommand, "", NULL },
|
||||
{ "repairitems", SEC_GAMEMASTER, false, &ChatHandler::HandleRepairitemsCommand, "", NULL },
|
||||
{ "freeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFreezeCommand, "", NULL },
|
||||
{ "unfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnFreezeCommand, "", NULL },
|
||||
{ "listfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleListFreezeCommand, "", NULL },
|
||||
{ "flusharenapoints", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlushArenaPointsCommand, "", NULL },
|
||||
{ "freeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFreezeCommand, "", NULL },
|
||||
{ "unfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnFreezeCommand, "", NULL },
|
||||
{ "listfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleListFreezeCommand, "", NULL },
|
||||
{ "flusharenapoints", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlushArenaPointsCommand, "", NULL },
|
||||
{ "possess", SEC_ADMINISTRATOR, false, &ChatHandler::HandlePossessCommand, "", NULL },
|
||||
{ "unpossess", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnPossessCommand, "", NULL },
|
||||
{ "bindsight", SEC_ADMINISTRATOR, false, &ChatHandler::HandleBindSightCommand, "", NULL },
|
||||
|
||||
+4
-3
@@ -71,6 +71,7 @@ class ChatHandler
|
||||
std::string PGetParseString(int32 entry, ...);
|
||||
|
||||
int ParseCommands(const char* text);
|
||||
|
||||
protected:
|
||||
explicit ChatHandler() : m_session(NULL) {} // for CLI subclass
|
||||
|
||||
@@ -415,7 +416,7 @@ class ChatHandler
|
||||
|
||||
bool HandleResetAllCommand(const char * args);
|
||||
|
||||
|
||||
|
||||
// GM ticket command handlers
|
||||
bool HandleGMTicketListCommand(const char* args);
|
||||
bool HandleGMTicketListOnlineCommand(const char* args);
|
||||
@@ -438,7 +439,7 @@ class ChatHandler
|
||||
bool HandlePasswordCommand(const char* args);
|
||||
bool HandleLockAccountCommand(const char* args);
|
||||
bool HandleRespawnCommand(const char* args);
|
||||
|
||||
|
||||
//New Wp Commands
|
||||
bool HandleWpAddCommand(const char* args);
|
||||
bool HandleWpLoadPathCommand(const char* args);
|
||||
@@ -527,7 +528,7 @@ class ChatHandler
|
||||
void SetSentErrorMessage(bool val){ sentErrorMessage = val;};
|
||||
private:
|
||||
WorldSession * m_session; // != NULL for chat command call and NULL for CLI command
|
||||
|
||||
|
||||
// common global flag
|
||||
static bool load_command_table;
|
||||
bool sentErrorMessage;
|
||||
|
||||
@@ -318,7 +318,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
|
||||
Group *group = GetPlayer()->GetGroup();
|
||||
if(!group || !group->isRaidGroup() || group->isBGGroup())
|
||||
return;
|
||||
|
||||
|
||||
WorldPacket data;
|
||||
ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID, lang, "", 0, msg.c_str(),NULL);
|
||||
group->BroadcastPacket(&data);
|
||||
|
||||
@@ -199,10 +199,10 @@ void Creature::RemoveFromWorld()
|
||||
void Creature::SearchFormation()
|
||||
{
|
||||
uint32 lowguid = GetDBTableGUIDLow();
|
||||
|
||||
|
||||
if(CreatureGroupMap.find(lowguid) != CreatureGroupMap.end())
|
||||
{
|
||||
m_formationID = CreatureGroupMap[lowguid]->leaderGUID;
|
||||
m_formationID = CreatureGroupMap[lowguid]->leaderGUID;
|
||||
formation_mgr.UpdateCreatureGroup(m_formationID, this);
|
||||
}
|
||||
}
|
||||
@@ -415,7 +415,7 @@ void Creature::Update(uint32 diff)
|
||||
|
||||
CreatureInfo const *cinfo = GetCreatureInfo();
|
||||
SelectLevel(cinfo);
|
||||
|
||||
|
||||
if (m_isDeadByDefault)
|
||||
{
|
||||
setDeathState(JUST_DIED);
|
||||
@@ -1425,7 +1425,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
|
||||
}
|
||||
//We should set first home position, because then AI calls home movement
|
||||
SetHomePosition(data->posX,data->posY,data->posZ,data->orientation);
|
||||
|
||||
|
||||
m_respawnradius = data->spawndist;
|
||||
|
||||
m_respawnDelay = data->spawntimesecs;
|
||||
|
||||
+3
-4
@@ -625,10 +625,10 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
||||
void GetHomePosition(float &x, float &y, float &z, float &ori) { x = mHome_X; y = mHome_Y; z = mHome_Z; ori = mHome_O; }
|
||||
|
||||
uint32 GetGlobalCooldown() const { return m_GlobalCooldown; }
|
||||
|
||||
|
||||
uint32 GetWaypointPath(){return m_path_id;}
|
||||
void LoadPath(uint32 pathid) { m_path_id = pathid; }
|
||||
|
||||
|
||||
uint32 GetCurrentWaypointID(){return m_waypointID;}
|
||||
void UpdateWaypointID(uint32 wpID){m_waypointID = wpID;}
|
||||
|
||||
@@ -677,7 +677,6 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
||||
bool m_AlreadyCallAssistance;
|
||||
bool m_regenHealth;
|
||||
bool m_AI_locked;
|
||||
bool m_AI_enabled;
|
||||
bool m_isDeadByDefault;
|
||||
|
||||
SpellSchoolMask m_meleeDamageSchoolMask;
|
||||
@@ -692,7 +691,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
||||
//WaypointMovementGenerator vars
|
||||
uint32 m_waypointID;
|
||||
uint32 m_path_id;
|
||||
|
||||
|
||||
//Formation var
|
||||
uint32 m_formationID;
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ class TRINITY_DLL_SPEC CreatureAI : public UnitAI
|
||||
virtual void SpellHit(Unit*, const SpellEntry*) {}
|
||||
|
||||
// Called when spell hits a target
|
||||
virtual void SpellHitTarget(Unit* target, const SpellEntry*) {}
|
||||
virtual void SpellHitTarget(Unit* target, const SpellEntry*) {}
|
||||
|
||||
// Called when vitim entered water and creature can not enter water
|
||||
virtual bool canReachByRangeAttack(Unit*) { return false; }
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace FactorySelector
|
||||
if(!ai_factory)
|
||||
{
|
||||
if( creature->isGuard() )
|
||||
ai_factory = ai_registry.GetRegistryItem("GuardAI");
|
||||
ai_factory = ai_registry.GetRegistryItem("GuardAI");
|
||||
else if(creature->isPet() || (creature->isCharmed() && !creature->isPossessed()))
|
||||
ai_factory = ai_registry.GetRegistryItem("PetAI");
|
||||
else if(creature->isTotem())
|
||||
|
||||
+27
-27
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
@@ -34,7 +34,7 @@ UNORDERED_MAP<uint32, FormationMember*> CreatureGroupMap;
|
||||
void CreatureGroupManager::UpdateCreatureGroup(uint32 group_id, Creature *member)
|
||||
{
|
||||
if(CreatureGroupHolder.find(group_id) != CreatureGroupHolder.end())
|
||||
{
|
||||
{
|
||||
sLog.outDebug("Group found: %u, inserting creature GUID: %u", group_id, member->GetGUIDLow());
|
||||
CreatureGroupHolder[group_id]->AddMember(member);
|
||||
}
|
||||
@@ -67,10 +67,10 @@ void CreatureGroupManager::LoadCreatureFormations()
|
||||
{
|
||||
//Clear existing map
|
||||
CreatureGroupMap.clear();
|
||||
|
||||
|
||||
//Check Integrity of the table
|
||||
QueryResult *result = WorldDatabase.PQuery("SELECT MAX(`leaderGUID`) FROM `creature_formations`");
|
||||
|
||||
|
||||
if(!result)
|
||||
{
|
||||
sLog.outErrorDb(" an error occured while loading the table `creature_formations` ( maybe it doesn't exist ?)\n");
|
||||
@@ -80,7 +80,7 @@ void CreatureGroupManager::LoadCreatureFormations()
|
||||
|
||||
//Get group data
|
||||
result = WorldDatabase.PQuery("SELECT `leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI` FROM `creature_formations` ORDER BY `leaderGUID`");
|
||||
|
||||
|
||||
if(!result)
|
||||
{
|
||||
sLog.outErrorDb("The table `creature_formations` is empty or corrupted");
|
||||
@@ -90,13 +90,13 @@ void CreatureGroupManager::LoadCreatureFormations()
|
||||
uint32 total_records = result->GetRowCount(), lastLeaderGUID = 0;
|
||||
barGoLink bar( total_records);
|
||||
Field *fields;
|
||||
|
||||
|
||||
FormationMember *group_member;
|
||||
//Loading data...
|
||||
do
|
||||
{
|
||||
fields = result->Fetch();
|
||||
|
||||
|
||||
bar.step();
|
||||
//Load group member data
|
||||
group_member = new FormationMember;
|
||||
@@ -109,14 +109,14 @@ void CreatureGroupManager::LoadCreatureFormations()
|
||||
group_member->follow_dist = fields[2].GetUInt32();
|
||||
group_member->follow_angle = fields[3].GetUInt32();
|
||||
}
|
||||
|
||||
|
||||
CreatureGroupMap[group_member->memberGUID] = group_member;
|
||||
|
||||
|
||||
if(lastLeaderGUID != group_member->leaderGUID)
|
||||
lastLeaderGUID = group_member->leaderGUID;
|
||||
}
|
||||
}
|
||||
while(result->NextRow()) ;
|
||||
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString( ">> Loaded %u creatures in formations", total_records );
|
||||
sLog.outString();
|
||||
@@ -127,14 +127,14 @@ void CreatureGroupManager::LoadCreatureFormations()
|
||||
void CreatureGroup::AddMember(Creature *member)
|
||||
{
|
||||
sLog.outDebug("Adding unit GUID: %u.", member->GetGUIDLow());
|
||||
|
||||
|
||||
uint64 guid = member->GetGUID();
|
||||
//We first search creature member if exist
|
||||
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());
|
||||
m_leader = member;
|
||||
}
|
||||
@@ -146,7 +146,7 @@ void CreatureGroup::AddMember(Creature *member)
|
||||
void CreatureGroup::RemoveMember(uint64 guid)
|
||||
{
|
||||
if(CreatureGroupMembers.find(guid) != CreatureGroupMembers.end())
|
||||
CreatureGroupMembers.erase(guid);
|
||||
CreatureGroupMembers.erase(guid);
|
||||
}
|
||||
|
||||
void CreatureGroup::MemberHasAttacked(Creature *member)
|
||||
@@ -165,9 +165,9 @@ void CreatureGroup::MemberHasAttacked(Creature *member)
|
||||
case 1:
|
||||
if(!member->IsFormationLeader())
|
||||
return;
|
||||
}
|
||||
}
|
||||
//Attack if everything is OK
|
||||
itr->second->AI()->AttackStart(member->getVictim());
|
||||
itr->second->AI()->AttackStart(member->getVictim());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -177,31 +177,31 @@ 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);
|
||||
SetMemberDestination(itr->second);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CreatureGroup::SetMemberDestination(Creature *member)
|
||||
{
|
||||
if(!member || !m_leader || member->IsFormationLeader())
|
||||
return;
|
||||
|
||||
|
||||
float x,y,z;
|
||||
uint32 lowguid = member->GetGUIDLow();
|
||||
|
||||
|
||||
UNORDERED_MAP<uint32, FormationMember*>::iterator itr2 = CreatureGroupMap.find(lowguid);
|
||||
|
||||
|
||||
if(m_leader->GetMotionMaster()->GetDestination(x,y,z) && itr2 != CreatureGroupMap.end())
|
||||
{
|
||||
{
|
||||
float dist, angle, pathangle;
|
||||
|
||||
angle = CreatureGroupMap[lowguid]->follow_angle;
|
||||
dist = CreatureGroupMap[lowguid]->follow_dist;
|
||||
|
||||
angle = CreatureGroupMap[lowguid]->follow_angle;
|
||||
dist = CreatureGroupMap[lowguid]->follow_dist;
|
||||
pathangle = atan2(m_leader->GetPositionY()-y, m_leader->GetPositionX()-x);
|
||||
|
||||
|
||||
x = x+cos(angle+pathangle)*dist;
|
||||
y = y+sin(angle+pathangle)*dist;
|
||||
|
||||
|
||||
member->GetMotionMaster()->Clear();
|
||||
|
||||
if(member->GetDistance(m_leader) < dist+MAX_DESYNC)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
@@ -27,9 +27,9 @@
|
||||
|
||||
struct FormationMember
|
||||
{
|
||||
float follow_dist;
|
||||
float follow_angle;
|
||||
uint32 memberGUID;
|
||||
float follow_dist;
|
||||
float follow_angle;
|
||||
uint32 memberGUID;
|
||||
uint32 leaderGUID;
|
||||
uint8 groupAI;
|
||||
};
|
||||
@@ -46,7 +46,7 @@ class CreatureGroup
|
||||
{
|
||||
UNORDERED_MAP<uint64, Creature*>CreatureGroupMembers;
|
||||
Creature *m_leader; //Important do not forget sometimes to work with pointers instead synonims :D:D
|
||||
|
||||
|
||||
public:
|
||||
CreatureGroup() : m_leader(NULL) {}
|
||||
~CreatureGroup(){sLog.outDebug("Destroying group");}
|
||||
|
||||
@@ -160,13 +160,13 @@ DestinationHolder<TRAVELLER>::UpdateTraveller(TRAVELLER &traveller, uint32 diff,
|
||||
}
|
||||
// Change movement computation to micro movement based on last tick coords, this makes system work
|
||||
// even on multiple floors zones without hugh vmaps usage ;)
|
||||
|
||||
|
||||
// Take care of underrun of uint32
|
||||
if (i_totalTravelTime >= i_timeElapsed)
|
||||
i_totalTravelTime -= i_timeElapsed; // Consider only the remaining part
|
||||
else
|
||||
i_totalTravelTime = 0;
|
||||
|
||||
|
||||
i_timeElapsed = 0;
|
||||
i_fromX = x; // and change origine
|
||||
i_fromY = y; // then I take into account only micro movement
|
||||
|
||||
@@ -156,7 +156,7 @@ void DynamicObject::Delay(int32 delaytime)
|
||||
|
||||
bool DynamicObject::isVisibleForInState(Player const* u, bool inVisibleList) const
|
||||
{
|
||||
return IsInWorld() && u->IsInWorld()
|
||||
return IsInWorld() && u->IsInWorld()
|
||||
&& (IsWithinDistInMap(u,World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f), false)
|
||||
|| GetCasterGUID() == u->GetGUID());
|
||||
}
|
||||
|
||||
@@ -53,14 +53,14 @@ template<>
|
||||
bool FleeingMovementGenerator<Creature>::GetDestination(float &x, float &y, float &z) const
|
||||
{
|
||||
if(i_destinationHolder.HasArrived())
|
||||
return false;
|
||||
|
||||
i_destinationHolder.GetDestination(x, y, z);
|
||||
return false;
|
||||
|
||||
i_destinationHolder.GetDestination(x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
template<>
|
||||
bool FleeingMovementGenerator<Player>::GetDestination(float &x, float &y, float &z) const
|
||||
bool FleeingMovementGenerator<Player>::GetDestination(float &x, float &y, float &z) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ void GameEvent::LoadFromDB()
|
||||
}
|
||||
|
||||
// load game event saves
|
||||
// 0 1 2
|
||||
// 0 1 2
|
||||
result = CharacterDatabase.Query("SELECT event_id, state, UNIX_TIMESTAMP(next_start) FROM game_event_save");
|
||||
|
||||
count = 0;
|
||||
@@ -624,7 +624,7 @@ void GameEvent::LoadFromDB()
|
||||
}
|
||||
|
||||
// load conditions of the events
|
||||
// 0 1 2 3 4
|
||||
// 0 1 2 3 4
|
||||
result = WorldDatabase.Query("SELECT event_id, condition_id, req_num, max_world_state_field, done_world_state_field FROM game_event_condition");
|
||||
|
||||
count = 0;
|
||||
@@ -669,7 +669,7 @@ void GameEvent::LoadFromDB()
|
||||
}
|
||||
|
||||
// load condition saves
|
||||
// 0 1 2
|
||||
// 0 1 2
|
||||
result = CharacterDatabase.Query("SELECT event_id, condition_id, done FROM game_event_condition_save");
|
||||
|
||||
count = 0;
|
||||
@@ -1388,7 +1388,7 @@ void GameEvent::UpdateEventQuests(uint16 event_id, bool Activate)
|
||||
if (Activate) // Add the pair(id,quest) to the multimap
|
||||
CreatureQuestMap.insert(QuestRelations::value_type(itr->first, itr->second));
|
||||
else
|
||||
{
|
||||
{
|
||||
if(!hasCreatureQuestActiveEventExcept(itr->second,event_id))
|
||||
{
|
||||
// Remove the pair(id,quest) from the multimap
|
||||
@@ -1413,7 +1413,7 @@ void GameEvent::UpdateEventQuests(uint16 event_id, bool Activate)
|
||||
if (Activate) // Add the pair(id,quest) to the multimap
|
||||
GameObjectQuestMap.insert(QuestRelations::value_type(itr->first, itr->second));
|
||||
else
|
||||
{
|
||||
{
|
||||
if(!hasGameObjectQuestActiveEventExcept(itr->second,event_id))
|
||||
{
|
||||
// Remove the pair(id,quest) from the multimap
|
||||
|
||||
@@ -149,7 +149,7 @@ VisibleNotifier::Notify()
|
||||
i_player.SendAurasForTarget((Unit*)(*vItr));
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
Deliverer::Visit(PlayerMapType &m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
@@ -174,7 +174,7 @@ Deliverer::Visit(PlayerMapType &m)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
Deliverer::Visit(CreatureMapType &m)
|
||||
{
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Trinity
|
||||
void SendPacket(Player* plr);
|
||||
template<class SKIP> void Visit(GridRefManager<SKIP> &) {}
|
||||
};
|
||||
|
||||
|
||||
struct TRINITY_DLL_DECL MessageDeliverer : public Deliverer
|
||||
{
|
||||
MessageDeliverer(Player &pl, WorldPacket *msg, bool to_possessor, bool to_self) : Deliverer(pl, msg, to_possessor, to_self) {}
|
||||
@@ -631,7 +631,7 @@ namespace Trinity
|
||||
Unit const* i_funit;
|
||||
float i_range;
|
||||
};
|
||||
|
||||
|
||||
class CreatureWithDbGUIDCheck
|
||||
{
|
||||
public:
|
||||
@@ -750,7 +750,7 @@ namespace Trinity
|
||||
class NearestHostileUnitInAttackDistanceCheck
|
||||
{
|
||||
public:
|
||||
explicit NearestHostileUnitInAttackDistanceCheck(Creature const* creature, float dist = 0) : m_creature(creature)
|
||||
explicit NearestHostileUnitInAttackDistanceCheck(Creature const* creature, float dist = 0) : m_creature(creature)
|
||||
{
|
||||
m_range = (dist == 0 ? 9999 : dist);
|
||||
m_force = (dist == 0 ? false : true);
|
||||
@@ -926,7 +926,7 @@ namespace Trinity
|
||||
FriendlyMissingBuffInRange(Unit const* obj, float range, uint32 spellid) : i_obj(obj), i_range(range), i_spell(spellid) {}
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if(u->isAlive() && u->isInCombat() && /*!i_obj->IsHostileTo(u)*/ i_obj->IsFriendlyTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
|
||||
if(u->isAlive() && u->isInCombat() && /*!i_obj->IsHostileTo(u)*/ i_obj->IsFriendlyTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
|
||||
!(u->HasAura(i_spell, 0) || u->HasAura(i_spell, 1) || u->HasAura(i_spell, 2)))
|
||||
{
|
||||
return true;
|
||||
|
||||
+6
-6
@@ -225,7 +225,7 @@ class TRINITY_DLL_SPEC Group
|
||||
|
||||
return (mslot1->group==slot2->group);
|
||||
}
|
||||
|
||||
|
||||
bool HasFreeSlotSubGroup(uint8 subgroup) const
|
||||
{
|
||||
return (m_subGroupsCounts && m_subGroupsCounts[subgroup] < MAXGROUPSIZE);
|
||||
@@ -348,15 +348,15 @@ class TRINITY_DLL_SPEC Group
|
||||
bool _setMainAssistant(const uint64 &guid);
|
||||
|
||||
void _homebindIfInstance(Player *player);
|
||||
|
||||
|
||||
void _initRaidSubGroupsCounter()
|
||||
{
|
||||
// Sub group counters initialization
|
||||
if (!m_subGroupsCounts)
|
||||
m_subGroupsCounts = new uint8[MAXRAIDSIZE / MAXGROUPSIZE];
|
||||
|
||||
|
||||
memset((void*)m_subGroupsCounts, 0, (MAXRAIDSIZE / MAXGROUPSIZE)*sizeof(uint8));
|
||||
|
||||
|
||||
for (member_citerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr)
|
||||
++m_subGroupsCounts[itr->group];
|
||||
}
|
||||
@@ -380,13 +380,13 @@ class TRINITY_DLL_SPEC Group
|
||||
}
|
||||
return m_memberSlots.end();
|
||||
}
|
||||
|
||||
|
||||
void SubGroupCounterIncrease(uint8 subgroup)
|
||||
{
|
||||
if (m_subGroupsCounts)
|
||||
++m_subGroupsCounts[subgroup];
|
||||
}
|
||||
|
||||
|
||||
void SubGroupCounterDecrease(uint8 subgroup)
|
||||
{
|
||||
if (m_subGroupsCounts)
|
||||
|
||||
@@ -550,7 +550,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode( WorldPacket & recv_data )
|
||||
/** error handling **/
|
||||
if(!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()))
|
||||
return;
|
||||
|
||||
|
||||
if (!group->HasFreeSlotSubGroup(groupNr))
|
||||
return;
|
||||
/********************/
|
||||
|
||||
+14
-14
@@ -166,13 +166,13 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_REMOVE))
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
uint64 plGuid;
|
||||
MemberSlot* slot = guild->GetMemberSlot(plName, plGuid);
|
||||
if(!slot)
|
||||
@@ -282,7 +282,7 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
|
||||
|
||||
if(!normalizePlayerName(plName))
|
||||
return;
|
||||
|
||||
|
||||
Guild* guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
|
||||
if(!guild)
|
||||
{
|
||||
@@ -294,7 +294,7 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
uint64 plGuid;
|
||||
MemberSlot* slot = guild->GetMemberSlot(plName, plGuid);
|
||||
|
||||
@@ -309,7 +309,7 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_NAME_INVALID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(slot->RankId < 2 || (slot->RankId-1) < GetPlayer()->GetRank())
|
||||
return;
|
||||
|
||||
@@ -348,13 +348,13 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_DEMOTE))
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
uint64 plGuid;
|
||||
MemberSlot* slot = guild->GetMemberSlot(plName, plGuid);
|
||||
|
||||
@@ -466,15 +466,15 @@ void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket)
|
||||
|
||||
if(!normalizePlayerName(name))
|
||||
return;
|
||||
|
||||
|
||||
guild = objmgr.GetGuildById(oldLeader->GetGuildId());
|
||||
|
||||
|
||||
if (!guild)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if( oldLeader->GetGUID() != guild->GetLeader())
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
@@ -557,13 +557,13 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
|
||||
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_EPNOTE))
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
uint64 plGuid;
|
||||
MemberSlot* slot = guild->GetMemberSlot(name, plGuid);
|
||||
|
||||
@@ -603,10 +603,10 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
|
||||
SendGuildCommandResult(GUILD_INVITE_S, "", GUILD_PERMISSIONS);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
uint64 plGuid;
|
||||
MemberSlot* slot = guild->GetMemberSlot(plName, plGuid);
|
||||
|
||||
|
||||
if (!slot)
|
||||
{
|
||||
SendGuildCommandResult(GUILD_INVITE_S, plName, GUILD_PLAYER_NOT_IN_GUILD_S);
|
||||
|
||||
+1
-1
@@ -288,7 +288,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff)
|
||||
}
|
||||
|
||||
SetUInt32Value(ITEM_FIELD_DURATION, GetUInt32Value(ITEM_FIELD_DURATION) - diff);
|
||||
SetState(ITEM_CHANGED); // save new time in database
|
||||
SetState(ITEM_CHANGED, owner); // save new time in database
|
||||
}
|
||||
|
||||
void Item::SaveToDB()
|
||||
|
||||
@@ -167,6 +167,8 @@ enum EnchantmentSlot
|
||||
|
||||
#define MAX_VISIBLE_ITEM_OFFSET 18 // 18 fields per visible item (creator(2) + enchantments(13) + properties(1) + seed(1) + pad(1))
|
||||
|
||||
#define MAX_GEM_SOCKETS 3 // (BONUS_ENCHANTMENT_SLOT-SOCK_ENCHANTMENT_SLOT)
|
||||
|
||||
enum EnchantmentOffset
|
||||
{
|
||||
ENCHANTMENT_ID_OFFSET = 0,
|
||||
|
||||
+53
-28
@@ -1111,55 +1111,80 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
sLog.outDebug("WORLD: CMSG_SOCKET_GEMS");
|
||||
|
||||
CHECK_PACKET_SIZE(recv_data,8*4);
|
||||
CHECK_PACKET_SIZE(recv_data,8+8*MAX_GEM_SOCKETS);
|
||||
|
||||
uint64 guids[4];
|
||||
for(int i = 0; i < 4; i++)
|
||||
recv_data >> guids[i];
|
||||
uint64 item_guid;
|
||||
uint64 gem_guids[MAX_GEM_SOCKETS];
|
||||
|
||||
if(!guids[0])
|
||||
recv_data >> item_guid;
|
||||
if(!item_guid)
|
||||
return;
|
||||
|
||||
for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
|
||||
recv_data >> gem_guids[i];
|
||||
|
||||
//cheat -> tried to socket same gem multiple times
|
||||
if((guids[1] && (guids[1] == guids[2] || guids[1] == guids[3])) || (guids[2] && (guids[2] == guids[3])))
|
||||
if ((gem_guids[0] && (gem_guids[0] == gem_guids[1] || gem_guids[0] == gem_guids[2])) ||
|
||||
(gem_guids[1] && (gem_guids[1] == gem_guids[2])))
|
||||
return;
|
||||
|
||||
Item *itemTarget = _player->GetItemByGuid(guids[0]);
|
||||
Item *itemTarget = _player->GetItemByGuid(item_guid);
|
||||
if(!itemTarget) //missing item to socket
|
||||
return;
|
||||
|
||||
ItemPrototype const* itemProto = itemTarget->GetProto();
|
||||
if(!itemProto)
|
||||
return;
|
||||
|
||||
//this slot is excepted when applying / removing meta gem bonus
|
||||
uint8 slot = itemTarget->IsEquipped() ? itemTarget->GetSlot() : NULL_SLOT;
|
||||
|
||||
Item *Gems[3];
|
||||
for(int i = 0; i < 3; i++)
|
||||
Gems[i] = guids[i + 1] ? _player->GetItemByGuid(guids[i + 1]) : NULL;
|
||||
Item *Gems[MAX_GEM_SOCKETS];
|
||||
for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
|
||||
Gems[i] = gem_guids[i] ? _player->GetItemByGuid(gem_guids[i]) : NULL;
|
||||
|
||||
GemPropertiesEntry const *GemProps[3];
|
||||
for(int i = 0; i < 3; ++i) //get geminfo from dbc storage
|
||||
{
|
||||
GemPropertiesEntry const *GemProps[MAX_GEM_SOCKETS];
|
||||
for(int i = 0; i < MAX_GEM_SOCKETS; ++i) //get geminfo from dbc storage
|
||||
GemProps[i] = (Gems[i]) ? sGemPropertiesStore.LookupEntry(Gems[i]->GetProto()->GemProperties) : NULL;
|
||||
}
|
||||
|
||||
for(int i = 0; i < 3; ++i) //check for hack maybe
|
||||
for(int i = 0; i < MAX_GEM_SOCKETS; ++i) //check for hack maybe
|
||||
{
|
||||
// tried to put gem in socket where no socket exists / tried to put normal gem in meta socket
|
||||
if (!GemProps[i])
|
||||
continue;
|
||||
|
||||
// tried to put gem in socket where no socket exists (take care about prismatic sockets)
|
||||
if (!itemProto->Socket[i].Color)
|
||||
{
|
||||
// no prismatic socket
|
||||
if(!itemTarget->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT))
|
||||
return;
|
||||
|
||||
// not first not-colored (not normaly used) socket
|
||||
if(i!=0 && !itemProto->Socket[i-1].Color && (i+1 >= MAX_GEM_SOCKETS || itemProto->Socket[i+1].Color))
|
||||
return;
|
||||
|
||||
// ok, this is first not colored socket for item with prismatic socket
|
||||
}
|
||||
|
||||
// tried to put normal gem in meta socket
|
||||
if (itemProto->Socket[i].Color == SOCKET_COLOR_META && GemProps[i]->color != SOCKET_COLOR_META)
|
||||
return;
|
||||
|
||||
// tried to put meta gem in normal socket
|
||||
if( GemProps[i] && ( !itemTarget->GetProto()->Socket[i].Color ||
|
||||
itemTarget->GetProto()->Socket[i].Color == SOCKET_COLOR_META && GemProps[i]->color != SOCKET_COLOR_META ||
|
||||
itemTarget->GetProto()->Socket[i].Color != SOCKET_COLOR_META && GemProps[i]->color == SOCKET_COLOR_META ) )
|
||||
if (itemProto->Socket[i].Color != SOCKET_COLOR_META && GemProps[i]->color == SOCKET_COLOR_META)
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 GemEnchants[3], OldEnchants[3];
|
||||
for(int i = 0; i < 3; ++i) //get new and old enchantments
|
||||
uint32 GemEnchants[MAX_GEM_SOCKETS];
|
||||
uint32 OldEnchants[MAX_GEM_SOCKETS];
|
||||
for(int i = 0; i < MAX_GEM_SOCKETS; ++i) //get new and old enchantments
|
||||
{
|
||||
GemEnchants[i] = (GemProps[i]) ? GemProps[i]->spellitemenchantement : 0;
|
||||
OldEnchants[i] = itemTarget->GetEnchantmentId(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i));
|
||||
}
|
||||
|
||||
// check unique-equipped conditions
|
||||
for(int i = 0; i < 3; ++i)
|
||||
for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
|
||||
{
|
||||
if (Gems[i] && (Gems[i]->GetProto()->Flags & ITEM_FLAGS_UNIQUE_EQUIPPED))
|
||||
{
|
||||
@@ -1174,7 +1199,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||
}
|
||||
|
||||
// continue check for case when attempt add 2 similar unique equipped gems in one item.
|
||||
for (int j = 0; j < 3; ++j)
|
||||
for (int j = 0; j < MAX_GEM_SOCKETS; ++j)
|
||||
{
|
||||
if ((i != j) && (Gems[j]) && (Gems[i]->GetProto()->ItemId == Gems[j]->GetProto()->ItemId))
|
||||
{
|
||||
@@ -1182,7 +1207,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < 3; ++j)
|
||||
for (int j = 0; j < MAX_GEM_SOCKETS; ++j)
|
||||
{
|
||||
if (OldEnchants[j])
|
||||
{
|
||||
@@ -1206,20 +1231,20 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||
//if a meta gem is being equipped, all information has to be written to the item before testing if the conditions for the gem are met
|
||||
|
||||
//remove ALL enchants
|
||||
for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot)
|
||||
for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
|
||||
_player->ApplyEnchantment(itemTarget,EnchantmentSlot(enchant_slot),false);
|
||||
|
||||
for(int i = 0; i < 3; ++i)
|
||||
for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
|
||||
{
|
||||
if(GemEnchants[i])
|
||||
{
|
||||
itemTarget->SetEnchantment(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i), GemEnchants[i],0,0);
|
||||
if(Item* guidItem = _player->GetItemByGuid(guids[i + 1]))
|
||||
if(Item* guidItem = _player->GetItemByGuid(gem_guids[i]))
|
||||
_player->DestroyItem(guidItem->GetBagSlot(), guidItem->GetSlot(), true );
|
||||
}
|
||||
}
|
||||
|
||||
for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot)
|
||||
for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
|
||||
_player->ApplyEnchantment(itemTarget,EnchantmentSlot(enchant_slot),true);
|
||||
|
||||
bool SocketBonusToBeActivated = itemTarget->GemsFitSockets();//current socketbonus state
|
||||
|
||||
+6
-6
@@ -272,7 +272,7 @@ enum TrinityStrings
|
||||
LANG_COMMAND_WHISPEROFF = 286,
|
||||
LANG_COMMAND_CREATGUIDNOTFOUND = 287,
|
||||
// TICKET STRINGS NEED REWRITE // 288-296 FREE
|
||||
|
||||
|
||||
// END
|
||||
LANG_COMMAND_SPAWNDIST = 297,
|
||||
LANG_COMMAND_SPAWNTIME = 298,
|
||||
@@ -789,15 +789,15 @@ enum TrinityStrings
|
||||
// Room for more level 3 1123-1199 not used
|
||||
|
||||
// FREE IDS 1200-9999
|
||||
|
||||
|
||||
// Ticket Strings 2000-2029
|
||||
LANG_COMMAND_TICKETNEW = 2000,
|
||||
LANG_COMMAND_TICKETUPDATED = 2001,
|
||||
LANG_COMMAND_TICKETNEW = 2000,
|
||||
LANG_COMMAND_TICKETUPDATED = 2001,
|
||||
LANG_COMMAND_TICKETPLAYERABANDON = 2002,
|
||||
LANG_COMMAND_TICKETCLOSED = 2003,
|
||||
LANG_COMMAND_TICKETDELETED = 2004,
|
||||
LANG_COMMAND_TICKETNOTEXIST = 2005,
|
||||
LANG_COMMAND_TICKETCLOSEFIRST = 2006,
|
||||
LANG_COMMAND_TICKETCLOSEFIRST = 2006,
|
||||
LANG_COMMAND_TICKETALREADYASSIGNED = 2007,
|
||||
LANG_COMMAND_TICKETRELOAD = 2008,
|
||||
LANG_COMMAND_TICKETSHOWLIST = 2009,
|
||||
@@ -830,7 +830,7 @@ enum TrinityStrings
|
||||
LANG_INSTANCE_NOT_AS_GHOST = 5008,
|
||||
LANG_COMMAND_PLAYED_TO_ALL = 5009,
|
||||
// Room for more Trinity strings 5010-9999
|
||||
// Used for GM Announcements
|
||||
// Used for GM Announcements
|
||||
LANG_GM_BROADCAST = 6613,
|
||||
LANG_GM_NOTIFY = 6614,
|
||||
LANG_GM_ANNOUNCE_COLOR = 6615,
|
||||
|
||||
+13
-13
@@ -139,7 +139,7 @@ bool ChatHandler::HandleGMNameAnnounceCommand(const char* args)
|
||||
WorldPacket data;
|
||||
if(!*args)
|
||||
return false;
|
||||
|
||||
|
||||
sWorld.SendGMText(LANG_GM_ANNOUNCE_COLOR, m_session->GetPlayer()->GetName(), args);
|
||||
return true;
|
||||
}
|
||||
@@ -309,7 +309,7 @@ bool ChatHandler::HandleGMTicketListOnlineCommand(const char* args)
|
||||
{
|
||||
if((*itr)->closed != 0 || !objmgr.GetPlayer((*itr)->playerGuid))
|
||||
continue;
|
||||
|
||||
|
||||
std::string gmname;
|
||||
std::stringstream ss;
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, (*itr)->guid);
|
||||
@@ -331,7 +331,7 @@ bool ChatHandler::HandleGMTicketListClosedCommand(const char* args)
|
||||
{
|
||||
if((*itr)->closed == 0)
|
||||
continue;
|
||||
|
||||
|
||||
std::string gmname;
|
||||
std::stringstream ss;
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, (*itr)->guid);
|
||||
@@ -350,7 +350,7 @@ bool ChatHandler::HandleGMTicketGetByIdCommand(const char* args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
|
||||
|
||||
uint64 tguid = atoi(args);
|
||||
GM_Ticket *ticket = ticketmgr.GetGMTicket(tguid);
|
||||
if(!ticket)
|
||||
@@ -358,7 +358,7 @@ bool ChatHandler::HandleGMTicketGetByIdCommand(const char* args)
|
||||
SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
std::string gmname;
|
||||
std::stringstream ss;
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid);
|
||||
@@ -381,14 +381,14 @@ bool ChatHandler::HandleGMTicketGetByNameCommand(const char* args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
|
||||
|
||||
GM_Ticket *ticket = ticketmgr.GetGMTicketByName(args);
|
||||
if(!ticket)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
std::string gmname;
|
||||
std::stringstream ss;
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid);
|
||||
@@ -411,7 +411,7 @@ bool ChatHandler::HandleGMTicketCloseByIdCommand(const char* args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
|
||||
|
||||
uint64 tguid = atoi(args);
|
||||
GM_Ticket *ticket = ticketmgr.GetGMTicket(tguid);
|
||||
if(!ticket || ticket->closed != 0)
|
||||
@@ -487,7 +487,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
|
||||
PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->guid, gmname.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
ticket->assignedToGM = tarGUID;
|
||||
ticketmgr.UpdateGMTicket(ticket);
|
||||
std::stringstream ss;
|
||||
@@ -520,13 +520,13 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args)
|
||||
|
||||
std::string gmname;
|
||||
objmgr.GetPlayerNameByGUID(ticket->assignedToGM, gmname);
|
||||
Player *plr = objmgr.GetPlayer(ticket->assignedToGM);
|
||||
Player *plr = objmgr.GetPlayer(ticket->assignedToGM);
|
||||
if(plr && plr->IsInWorld() && plr->GetSession()->GetSecurity() > cplr->GetSession()->GetSecurity())
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETUNASSIGNSECURITY);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
std::stringstream ss;
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid);
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str());
|
||||
@@ -580,7 +580,7 @@ bool ChatHandler::HandleGMTicketCommentCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args)
|
||||
bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
@@ -597,7 +597,7 @@ bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args)
|
||||
SendSysMessage(LANG_COMMAND_TICKETCLOSEFIRST);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
std::stringstream ss;
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTGUID, ticket->guid);
|
||||
ss << PGetParseString(LANG_COMMAND_TICKETLISTNAME, ticket->name.c_str());
|
||||
|
||||
+99
-99
@@ -1661,7 +1661,7 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||
if(kickReason)
|
||||
reason = kickReason;
|
||||
if(m_session)
|
||||
kicker = m_session->GetPlayer()->GetName();
|
||||
kicker = m_session->GetPlayer()->GetName();
|
||||
|
||||
if(!kickName)
|
||||
{
|
||||
@@ -1672,7 +1672,7 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(player==m_session->GetPlayer())
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_KICKSELF);
|
||||
@@ -1719,7 +1719,7 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(HasLowerSecurity(player, 0))
|
||||
{
|
||||
SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); //maybe replacement string for this later on
|
||||
@@ -2214,21 +2214,21 @@ bool ChatHandler::HandleWpAddCommand(const char* args)
|
||||
// optional
|
||||
char* path_number = NULL;
|
||||
uint32 pathid = 0;
|
||||
|
||||
|
||||
if(*args)
|
||||
path_number = strtok((char*)args, " ");
|
||||
|
||||
|
||||
uint32 point = 0;
|
||||
Creature* target = getSelectedCreature();
|
||||
|
||||
|
||||
if (!path_number)
|
||||
{
|
||||
if(target)
|
||||
pathid = target->GetWaypointPath();
|
||||
else
|
||||
else
|
||||
{
|
||||
QueryResult *result = WorldDatabase.PQuery( "SELECT MAX(id) FROM waypoint_data");
|
||||
uint32 maxpathid = result->Fetch()->GetInt32();
|
||||
uint32 maxpathid = result->Fetch()->GetInt32();
|
||||
pathid = maxpathid+1;
|
||||
sLog.outDebug("DEBUG: HandleWpAddCommand - New path started.");
|
||||
PSendSysMessage("%s%s|r", "|cff00ff00", "New path started.");
|
||||
@@ -2236,27 +2236,27 @@ bool ChatHandler::HandleWpAddCommand(const char* args)
|
||||
}
|
||||
else
|
||||
pathid = atoi(path_number);
|
||||
|
||||
|
||||
// path_id -> ID of the Path
|
||||
// point -> number of the waypoint (if not 0)
|
||||
|
||||
|
||||
if(!pathid)
|
||||
{
|
||||
sLog.outDebug("DEBUG: HandleWpAddCommand - Current creature haven't loaded path.");
|
||||
PSendSysMessage("%s%s|r", "|cffff33ff", "Current creature haven't loaded path.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
sLog.outDebug("DEBUG: HandleWpAddCommand - point == 0");
|
||||
|
||||
QueryResult *result = WorldDatabase.PQuery( "SELECT MAX(point) FROM waypoint_data WHERE id = '%u'",pathid);
|
||||
|
||||
|
||||
if( result )
|
||||
{
|
||||
point = (*result)[0].GetUInt32();
|
||||
delete result;
|
||||
}
|
||||
|
||||
|
||||
Player* player = m_session->GetPlayer();
|
||||
Map *map = player->GetMap();
|
||||
|
||||
@@ -2264,7 +2264,7 @@ bool ChatHandler::HandleWpAddCommand(const char* args)
|
||||
pathid, point+1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
|
||||
|
||||
PSendSysMessage("%s%s%u%s%u%s|r", "|cff00ff00", "PathID: |r|cff00ffff", pathid, "|r|cff00ff00: Waypoint |r|cff00ffff", point,"|r|cff00ff00 created. ");
|
||||
|
||||
|
||||
return true;
|
||||
} // HandleWpAddCommand
|
||||
|
||||
@@ -2272,29 +2272,29 @@ bool ChatHandler::HandleWpLoadPathCommand(const char *args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
|
||||
|
||||
// optional
|
||||
char* path_number = NULL;
|
||||
|
||||
if(*args)
|
||||
path_number = strtok((char*)args, " ");
|
||||
|
||||
|
||||
|
||||
uint32 pathid = 0;
|
||||
uint32 guidlow = 0;
|
||||
Creature* target = getSelectedCreature();
|
||||
|
||||
|
||||
// Did player provide a path_id?
|
||||
if (!path_number)
|
||||
sLog.outDebug("DEBUG: HandleWpLoadPathCommand - No path number provided");
|
||||
|
||||
|
||||
if(!target)
|
||||
{
|
||||
SendSysMessage(LANG_SELECT_CREATURE);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(target->GetEntry() == 1)
|
||||
{
|
||||
PSendSysMessage("%s%s|r", "|cffff33ff", "You want to load path to a waypoint? Aren't you?");
|
||||
@@ -2303,16 +2303,16 @@ bool ChatHandler::HandleWpLoadPathCommand(const char *args)
|
||||
}
|
||||
|
||||
pathid = atoi(path_number);
|
||||
|
||||
|
||||
if(!pathid)
|
||||
{
|
||||
PSendSysMessage("%s%s|r", "|cffff33ff", "No vallid path number provided.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
guidlow = target->GetGUIDLow();
|
||||
QueryResult *result = WorldDatabase.PQuery( "SELECT guid FROM creature_addon WHERE guid = '%u'",guidlow);
|
||||
|
||||
|
||||
if( result )
|
||||
{
|
||||
WorldDatabase.PExecute("UPDATE creature_addon SET path_id = '%u' WHERE guid = '%u'", pathid, guidlow);
|
||||
@@ -2320,15 +2320,15 @@ bool ChatHandler::HandleWpLoadPathCommand(const char *args)
|
||||
}
|
||||
else
|
||||
WorldDatabase.PExecute("INSERT INTO creature_addon(guid,path_id) VALUES ('%u','%u')", guidlow, pathid);
|
||||
|
||||
|
||||
WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE, guidlow);
|
||||
|
||||
|
||||
target->LoadPath(pathid);
|
||||
target->SetDefaultMovementType(WAYPOINT_MOTION_TYPE);
|
||||
target->GetMotionMaster()->Initialize();
|
||||
target->Say("Path loaded.",0,0);
|
||||
|
||||
return true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2338,7 +2338,7 @@ if(!*args)
|
||||
return false;
|
||||
|
||||
uint32 id = atoi(args);
|
||||
|
||||
|
||||
if(!id)
|
||||
return false;
|
||||
|
||||
@@ -2385,25 +2385,25 @@ if(!*args)
|
||||
return false;
|
||||
|
||||
char* show_str = strtok((char*)args, " ");
|
||||
|
||||
|
||||
std::string show = show_str;
|
||||
|
||||
|
||||
// Check
|
||||
if( (show != "add") && (show != "mod") && (show != "del") && (show != "listid")) return false;
|
||||
|
||||
|
||||
|
||||
|
||||
if(show == "add")
|
||||
{
|
||||
uint32 id = 0;
|
||||
char* arg_id = strtok(NULL, " ");
|
||||
|
||||
char* arg_id = strtok(NULL, " ");
|
||||
|
||||
if(arg_id)
|
||||
uint32 id = atoi(arg_id);
|
||||
|
||||
|
||||
if(id)
|
||||
{
|
||||
QueryResult *result = WorldDatabase.PQuery( "SELECT `id` FROM waypoint_scripts WHERE guid = %u", id);
|
||||
|
||||
|
||||
if( !result )
|
||||
{
|
||||
WorldDatabase.PExecute("INSERT INTO waypoint_scripts(guid)VALUES(%u)", id);
|
||||
@@ -2421,38 +2421,38 @@ if(!*args)
|
||||
id = result->Fetch()->GetUInt32();
|
||||
WorldDatabase.PExecute("INSERT INTO waypoint_scripts(guid)VALUES(%u)", id+1);
|
||||
PSendSysMessage("%s%s%u|r", "|cff00ff00","Wp Event: New waypoint event added: |r|cff00ffff", id+1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(show == "listid")
|
||||
{
|
||||
uint32 id;
|
||||
char* arg_id = strtok(NULL, " ");
|
||||
|
||||
|
||||
if(!arg_id)
|
||||
{
|
||||
PSendSysMessage("%s%s|r", "|cff33ffff","Wp Event: You must provide waypoint script id.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
id = atoi(arg_id);
|
||||
|
||||
|
||||
uint32 a2, a3, a4, a5, a6;
|
||||
float a8, a9, a10, a11;
|
||||
char const* a7;
|
||||
|
||||
|
||||
QueryResult *result = WorldDatabase.PQuery( "SELECT `guid`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o` FROM waypoint_scripts WHERE id = %u", id);
|
||||
|
||||
|
||||
if( !result )
|
||||
{
|
||||
PSendSysMessage("%s%s%u|r", "|cff33ffff", "Wp Event: No waypoint scripts found on id: ", id);
|
||||
return true;
|
||||
}
|
||||
|
||||
Field *fields;
|
||||
|
||||
Field *fields;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -2467,21 +2467,21 @@ if(!*args)
|
||||
a9 = fields[7].GetFloat();
|
||||
a10 = fields[8].GetFloat();
|
||||
a11 = fields[9].GetFloat();
|
||||
|
||||
|
||||
PSendSysMessage("|cffff33ffid:|r|cff00ffff %u|r|cff00ff00, guid: |r|cff00ffff%u|r|cff00ff00, delay: |r|cff00ffff%u|r|cff00ff00, command: |r|cff00ffff%u|r|cff00ff00, datalong: |r|cff00ffff%u|r|cff00ff00, datalong2: |r|cff00ffff%u|r|cff00ff00, datatext: |r|cff00ffff%s|r|cff00ff00, posx: |r|cff00ffff%f|r|cff00ff00, posy: |r|cff00ffff%f|r|cff00ff00, posz: |r|cff00ffff%f|r|cff00ff00, orientation: |r|cff00ffff%f|r", id, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
|
||||
}while(result->NextRow());
|
||||
|
||||
|
||||
delete result;
|
||||
}
|
||||
|
||||
|
||||
if(show == "del")
|
||||
{
|
||||
|
||||
char* arg_id = strtok(NULL, " ");
|
||||
|
||||
char* arg_id = strtok(NULL, " ");
|
||||
uint32 id = atoi(arg_id);
|
||||
|
||||
|
||||
QueryResult *result = WorldDatabase.PQuery( "SELECT `guid` FROM waypoint_scripts WHERE guid = %u", id);
|
||||
|
||||
|
||||
if( result )
|
||||
{
|
||||
|
||||
@@ -2491,21 +2491,21 @@ if(!*args)
|
||||
}
|
||||
else
|
||||
PSendSysMessage("|cffff33ffWp Event: ERROR: you have selected a non existing script: %u|r", id);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(show == "mod")
|
||||
{
|
||||
char* arg_1 = strtok(NULL," ");
|
||||
|
||||
|
||||
if(!arg_1)
|
||||
{
|
||||
SendSysMessage("|cffff33ffERROR: Waypoint script guid not present.|r");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
uint32 id = atoi(arg_1);
|
||||
|
||||
if(!id)
|
||||
@@ -2515,15 +2515,15 @@ if(!*args)
|
||||
}
|
||||
|
||||
char* arg_2 = strtok(NULL," ");
|
||||
|
||||
|
||||
if(!arg_2)
|
||||
{ SendSysMessage("|cffff33ffERROR: No argument present.|r");
|
||||
return true;}
|
||||
|
||||
|
||||
|
||||
|
||||
std::string arg_string = arg_2;
|
||||
|
||||
|
||||
|
||||
|
||||
if( (arg_string != "setid") && (arg_string != "delay") && (arg_string != "command")
|
||||
&& (arg_string != "datalong") && (arg_string != "datalong2") && (arg_string != "dataint") && (arg_string != "posx")
|
||||
&& (arg_string != "posy") && (arg_string != "posz") && (arg_string != "orientation")
|
||||
@@ -2534,7 +2534,7 @@ if( (arg_string != "setid") && (arg_string != "delay") && (arg_string != "comman
|
||||
char* arg_3;
|
||||
std::string arg_str_2 = arg_2;
|
||||
arg_3 = strtok(NULL," ");
|
||||
|
||||
|
||||
if(!arg_3)
|
||||
{SendSysMessage("|cffff33ffERROR: No additional argument present.|r");
|
||||
return true;}
|
||||
@@ -2542,13 +2542,13 @@ if(!arg_3)
|
||||
float coord;
|
||||
|
||||
if(arg_str_2 == "setid")
|
||||
{
|
||||
{
|
||||
uint32 newid = atoi(arg_3);
|
||||
PSendSysMessage("%s%s|r|cff00ffff%u|r|cff00ff00%s|r|cff00ffff%u|r","|cff00ff00","Wp Event: Wypoint scipt guid: ", newid," id changed: ", id);
|
||||
WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET id='%u' WHERE guid='%u'",
|
||||
newid, id); return true;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
|
||||
QueryResult *result = WorldDatabase.PQuery("SELECT id FROM waypoint_scripts WHERE guid='%u'",id);
|
||||
@@ -2562,31 +2562,31 @@ float coord;
|
||||
delete result;
|
||||
|
||||
if(arg_str_2 == "posx")
|
||||
{
|
||||
{
|
||||
coord = atof(arg_3);
|
||||
WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET x='%f' WHERE guid='%u'",
|
||||
coord, id);
|
||||
coord, id);
|
||||
PSendSysMessage("|cff00ff00Waypoint script:|r|cff00ffff %u|r|cff00ff00 position_x updated.|r", id);
|
||||
return true;
|
||||
}else if(arg_str_2 == "posy")
|
||||
{
|
||||
coord = atof(arg_3);
|
||||
WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET y='%f' WHERE guid='%u'",
|
||||
coord, id);
|
||||
coord, id);
|
||||
PSendSysMessage("|cff00ff00Waypoint script: %u position_y updated.|r", id);
|
||||
return true;
|
||||
} else if(arg_str_2 == "posz")
|
||||
{
|
||||
coord = atof(arg_3);
|
||||
WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET z='%f' WHERE guid='%u'",
|
||||
coord, id);
|
||||
coord, id);
|
||||
PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 position_z updated.|r", id);
|
||||
return true;
|
||||
} else if(arg_str_2 == "orientation")
|
||||
{
|
||||
coord = atof(arg_3);
|
||||
WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET o='%f' WHERE guid='%u'",
|
||||
coord, id);
|
||||
coord, id);
|
||||
PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 orientation updated.|r", id);
|
||||
return true;
|
||||
} else if(arg_str_2 == "dataint")
|
||||
@@ -2648,7 +2648,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
|
||||
SendSysMessage("|cffff33ffERROR: You must select a waypoint.|r");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
sLog.outDebug("DEBUG: HandleWpModifyCommand - User did select an NPC");
|
||||
// The visual waypoint
|
||||
Creature* wpCreature = NULL;
|
||||
@@ -2669,7 +2669,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
|
||||
{
|
||||
QueryResult *result =
|
||||
WorldDatabase.PQuery( "SELECT id, point FROM waypoint_data WHERE wpguid = %u", wpGuid);
|
||||
|
||||
|
||||
if(!result)
|
||||
{
|
||||
sLog.outDebug("DEBUG: HandleWpModifyCommand - No waypoint found - used 'wpguid'");
|
||||
@@ -2707,7 +2707,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
|
||||
// Text is enclosed in "<>", all other arguments not
|
||||
arg_str = strtok((char*)NULL, " ");
|
||||
}
|
||||
|
||||
|
||||
sLog.outDebug("DEBUG: HandleWpModifyCommand - Parameters parsed - now execute the command");
|
||||
|
||||
// Check for argument
|
||||
@@ -2723,7 +2723,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
|
||||
|
||||
// wpCreature
|
||||
Creature* wpCreature = NULL;
|
||||
|
||||
|
||||
if( wpGuid != 0 )
|
||||
{
|
||||
wpCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
|
||||
@@ -2808,7 +2808,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
|
||||
WorldDatabase.PExecuteLog("UPDATE waypoint_data SET %s='%s' WHERE id='%u' AND point='%u'",
|
||||
show_str, text2.c_str(), pathid, point);
|
||||
}
|
||||
|
||||
|
||||
PSendSysMessage(LANG_WAYPOINT_CHANGED_NO, show_str);
|
||||
return true;
|
||||
}
|
||||
@@ -2830,7 +2830,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
// second arg: GUID (optional, if a creature is selected)
|
||||
char* guid_str = strtok((char*)NULL, " ");
|
||||
sLog.outDebug("DEBUG: HandleWpShowCommand: show_str: %s guid_str: %s", show_str, guid_str);
|
||||
|
||||
|
||||
uint32 pathid = 0;
|
||||
Creature* target = getSelectedCreature();
|
||||
|
||||
@@ -2875,14 +2875,14 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
uint32 Maxpoint;
|
||||
|
||||
sLog.outDebug("DEBUG: HandleWpShowCommand: PathID: %u", pathid);
|
||||
|
||||
|
||||
//PSendSysMessage("wpshow - show: %s", show);
|
||||
|
||||
// Show info for the selected waypoint
|
||||
if(show == "info")
|
||||
|
||||
{
|
||||
|
||||
|
||||
// Check if the user did specify a visual waypoint
|
||||
if( target->GetEntry() != VISUAL_WAYPOINT )
|
||||
|
||||
@@ -2894,16 +2894,16 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
|
||||
|
||||
QueryResult *result = WorldDatabase.PQuery( "SELECT id, point, delay, move_flag, action, action_chance FROM waypoint_data WHERE wpguid = %u", target->GetGUIDLow());
|
||||
|
||||
|
||||
if(!result)
|
||||
|
||||
{
|
||||
SendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM);
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
SendSysMessage("|cff00ffffDEBUG: wp show info:|r");
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
@@ -2929,19 +2929,19 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
if(show == "on")
|
||||
{
|
||||
QueryResult *result = WorldDatabase.PQuery( "SELECT point, position_x,position_y,position_z FROM waypoint_data WHERE id = '%u'", pathid);
|
||||
|
||||
|
||||
if(!result)
|
||||
{
|
||||
SendSysMessage("|cffff33ffPath no found.|r");
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
PSendSysMessage("|cff00ff00DEBUG: wp on, PathID: |cff00ffff%u|r", pathid);
|
||||
|
||||
|
||||
// Delete all visuals for this NPC
|
||||
QueryResult *result2 = WorldDatabase.PQuery( "SELECT wpguid FROM waypoint_data WHERE id = '%u' and wpguid <> 0", pathid);
|
||||
|
||||
|
||||
if(result2)
|
||||
{
|
||||
bool hasError = false;
|
||||
@@ -2965,9 +2965,9 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
}
|
||||
|
||||
}while( result2->NextRow() );
|
||||
|
||||
|
||||
delete result2;
|
||||
|
||||
|
||||
if( hasError )
|
||||
{
|
||||
PSendSysMessage(LANG_WAYPOINT_TOOFAR1);
|
||||
@@ -2998,9 +2998,9 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
delete result;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
wpCreature->Relocate(x, y, z, o);
|
||||
|
||||
|
||||
if(!wpCreature->IsPositionValid())
|
||||
{
|
||||
sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",wpCreature->GetGUIDLow(),wpCreature->GetEntry(),wpCreature->GetPositionX(),wpCreature->GetPositionY());
|
||||
@@ -3017,7 +3017,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
|
||||
wpCreature->LoadFromDB(wpCreature->GetDBTableGUIDLow(),map);
|
||||
map->Add(wpCreature);
|
||||
|
||||
|
||||
if(target)
|
||||
{
|
||||
wpCreature->SetDisplayId(target->GetDisplayId());
|
||||
@@ -3076,13 +3076,13 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
|
||||
pCreature->LoadFromDB(pCreature->GetDBTableGUIDLow(), map);
|
||||
map->Add(pCreature);
|
||||
|
||||
|
||||
if(target)
|
||||
{
|
||||
pCreature->SetDisplayId(target->GetDisplayId());
|
||||
pCreature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5);
|
||||
}
|
||||
|
||||
|
||||
// Cleanup memory
|
||||
delete result;
|
||||
return true;
|
||||
@@ -3141,13 +3141,13 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
|
||||
pCreature->LoadFromDB(pCreature->GetDBTableGUIDLow(), map);
|
||||
map->Add(pCreature);
|
||||
|
||||
|
||||
if(target)
|
||||
{
|
||||
pCreature->SetDisplayId(target->GetDisplayId());
|
||||
pCreature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5);
|
||||
}
|
||||
|
||||
|
||||
// Cleanup memory
|
||||
delete result;
|
||||
return true;
|
||||
@@ -4131,7 +4131,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* args)
|
||||
{
|
||||
Player *player = m_session->GetPlayer();
|
||||
Creature *creatureTarget = getSelectedCreature();
|
||||
|
||||
|
||||
if(!creatureTarget || creatureTarget->isPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
PSendSysMessage(LANG_SELECT_CREATURE);
|
||||
@@ -4415,11 +4415,11 @@ bool ChatHandler::HandleNpcAddFormationCommand(const char* args)
|
||||
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->groupAI = 0;
|
||||
group_member->groupAI = 0;
|
||||
|
||||
CreatureGroupMap[lowguid] = group_member;
|
||||
pCreature->SearchFormation();
|
||||
|
||||
|
||||
WorldDatabase.PExecuteLog("INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`) VALUES ('%u','%u','%f', '%f', '%u')",
|
||||
leaderGUID, lowguid, group_member->follow_dist, group_member->follow_angle, group_member->groupAI);
|
||||
|
||||
|
||||
+11
-11
@@ -952,7 +952,7 @@ bool ChatHandler::HandleReloadWpScriptsCommand(const char* arg)
|
||||
sLog.outString( "Re-Loading Scripts from `waypoint_scripts`...");
|
||||
|
||||
objmgr.LoadWaypointScripts();
|
||||
|
||||
|
||||
if(*arg!='a')
|
||||
SendGlobalGMSysMessage("DB table `waypoint_scripts` reloaded.");
|
||||
|
||||
@@ -1159,7 +1159,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
|
||||
}else{
|
||||
PSendSysMessage(LANG_YOURS_SECURITY_CHANGED, m_session->GetPlayer()->GetName(), gm);
|
||||
}
|
||||
|
||||
|
||||
LoginDatabase.PExecute("UPDATE account SET gmlevel = '%d' WHERE id = '%u'", gm, targetAccountId);
|
||||
return true;
|
||||
}else
|
||||
@@ -1167,7 +1167,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
|
||||
// Check for second parameter
|
||||
if(!arg2)
|
||||
return false;
|
||||
|
||||
|
||||
// Check for account
|
||||
targetAccountName = arg1;
|
||||
if(!AccountMgr::normilizeString(targetAccountName))
|
||||
@@ -1176,7 +1176,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Check for invalid specified GM level.
|
||||
gm = atoi(arg2);
|
||||
if ( (gm < SEC_PLAYER || gm > SEC_ADMINISTRATOR) )
|
||||
@@ -1185,7 +1185,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
targetAccountId = accmgr.GetId(arg1);
|
||||
/// m_session==NULL only for console
|
||||
uint32 plSecurity = m_session ? m_session->GetSecurity() : SEC_CONSOLE;
|
||||
@@ -7086,7 +7086,7 @@ bool ChatHandler::HandleFreezeCommand(const char *args)
|
||||
{
|
||||
player = getSelectedPlayer();
|
||||
if (player) //prevent crash with creature as target
|
||||
{
|
||||
{
|
||||
name = player->GetName();
|
||||
normalizePlayerName(name);
|
||||
}
|
||||
@@ -7147,7 +7147,7 @@ bool ChatHandler::HandleFreezeCommand(const char *args)
|
||||
if (eff>=TOTAL_SPELL_EFFECTS)
|
||||
continue;
|
||||
if( eff == SPELL_EFFECT_APPLY_AREA_AURA_PARTY || eff == SPELL_EFFECT_APPLY_AURA ||
|
||||
eff == SPELL_EFFECT_PERSISTENT_AREA_AURA || eff == SPELL_EFFECT_APPLY_AREA_AURA_FRIEND ||
|
||||
eff == SPELL_EFFECT_PERSISTENT_AREA_AURA || eff == SPELL_EFFECT_APPLY_AREA_AURA_FRIEND ||
|
||||
eff == SPELL_EFFECT_APPLY_AREA_AURA_ENEMY)
|
||||
{
|
||||
Aura *Aur = CreateAura(spellInfo, i, NULL, player);
|
||||
@@ -7171,7 +7171,7 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args)
|
||||
{
|
||||
player = getSelectedPlayer();
|
||||
if (player) //prevent crash with creature as target
|
||||
{
|
||||
{
|
||||
name = player->GetName();
|
||||
}
|
||||
}
|
||||
@@ -7203,7 +7203,7 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args)
|
||||
if (!player)
|
||||
{
|
||||
if (TargetName)
|
||||
{
|
||||
{
|
||||
//check for offline players
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT characters.guid FROM `characters` WHERE characters.name = '%s'",name.c_str());
|
||||
if(!result)
|
||||
@@ -7322,7 +7322,7 @@ bool ChatHandler::HandleBindSightCommand(const char* args)
|
||||
Unit* pUnit = getSelectedUnit();
|
||||
if (!pUnit)
|
||||
return false;
|
||||
|
||||
|
||||
if (m_session->GetPlayer()->isPossessing())
|
||||
return false;
|
||||
|
||||
@@ -7335,7 +7335,7 @@ bool ChatHandler::HandleUnbindSightCommand(const char* args)
|
||||
{
|
||||
if (m_session->GetPlayer()->isPossessing())
|
||||
return false;
|
||||
|
||||
|
||||
m_session->GetPlayer()->RemoveFarsightTarget();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ void MotionMaster::Mutate(MovementGenerator *m, MovementSlot slot)
|
||||
}
|
||||
else if(i_top < slot)
|
||||
{
|
||||
i_top = slot;
|
||||
i_top = slot;
|
||||
}
|
||||
m->Initialize(*i_owner);
|
||||
Impl[slot] = m;
|
||||
@@ -400,13 +400,13 @@ void MotionMaster::MovePath(uint32 path_id, bool repeatable)
|
||||
if( !isStatic( curr ) )
|
||||
delete curr;
|
||||
}*/
|
||||
|
||||
|
||||
//i_owner->GetTypeId()==TYPEID_PLAYER ?
|
||||
//Mutate(new WaypointMovementGenerator<Player>(path_id, repeatable)):
|
||||
Mutate(new WaypointMovementGenerator<Creature>(path_id, repeatable), MOTION_SLOT_IDLE);
|
||||
|
||||
DEBUG_LOG("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)",
|
||||
i_owner->GetTypeId()==TYPEID_PLAYER ? "Player" : "Creature",
|
||||
|
||||
DEBUG_LOG("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)",
|
||||
i_owner->GetTypeId()==TYPEID_PLAYER ? "Player" : "Creature",
|
||||
i_owner->GetGUIDLow(), path_id, repeatable ? "YES" : "NO" );
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1702,7 +1702,7 @@ void WorldObject::GetNearPoint2D(float &x, float &y, float distance2d, float abs
|
||||
void WorldObject::GetNearPoint(WorldObject const* searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle ) const
|
||||
{
|
||||
GetNearPoint2D(x,y,distance2d+searcher_size,absAngle);
|
||||
|
||||
|
||||
z = GetPositionZ();
|
||||
|
||||
UpdateGroundPositionZ(x,y,z);
|
||||
|
||||
@@ -223,7 +223,7 @@ void ObjectMgr::LoadPlayerInfoInCache()
|
||||
pPPlayerInfo->unArenaInfoSlot0 = Player::GetUInt32ValueFromArray(tdata,PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 0 * 6 + 5);
|
||||
pPPlayerInfo->unArenaInfoSlot1 = Player::GetUInt32ValueFromArray(tdata,PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 * 6 + 5);
|
||||
pPPlayerInfo->unArenaInfoSlot2 = Player::GetUInt32ValueFromArray(tdata,PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 2 * 6 + 5);
|
||||
|
||||
|
||||
pPPlayerInfo->unClass = (uint32)fields[3].GetUInt32();
|
||||
m_mPlayerInfoMap[fields[0].GetUInt32()] = pPPlayerInfo;
|
||||
}
|
||||
@@ -1082,7 +1082,7 @@ uint32 ObjectMgr::ChooseDisplayId(uint32 team, const CreatureInfo *cinfo, const
|
||||
if (!data || data->displayid == 0) // use defaults from the template
|
||||
{
|
||||
display_id = cinfo->GetRandomValidModelId();
|
||||
} else display_id = data->displayid; // overwritten from creature data
|
||||
} else display_id = data->displayid; // overwritten from creature data
|
||||
|
||||
return display_id;
|
||||
}
|
||||
@@ -7921,7 +7921,7 @@ ObjectMgr::ScriptNameMap & GetScriptNames()
|
||||
|
||||
void ObjectMgr::LoadTransportEvents()
|
||||
{
|
||||
|
||||
|
||||
QueryResult *result = WorldDatabase.Query("SELECT entry, waypoint_id, event_id FROM transport_events");
|
||||
|
||||
if( !result )
|
||||
@@ -7937,19 +7937,19 @@ void ObjectMgr::LoadTransportEvents()
|
||||
do
|
||||
{
|
||||
bar1.step();
|
||||
|
||||
|
||||
Field *fields = result->Fetch();
|
||||
|
||||
|
||||
//Load event values
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
uint32 waypoint_id = fields[1].GetUInt32();
|
||||
uint32 event_id = fields[2].GetUInt32();
|
||||
|
||||
|
||||
uint32 event_count = (entry*100)+waypoint_id;
|
||||
TransportEventMap[event_count] = event_id;
|
||||
}
|
||||
while(result->NextRow());
|
||||
|
||||
|
||||
sLog.outString( "\n>> Loaded %u transport events \n", result->GetRowCount() );
|
||||
|
||||
delete result;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
@@ -324,7 +324,7 @@ class ObjectMgr
|
||||
typedef std::vector<std::string> ScriptNameMap;
|
||||
|
||||
UNORDERED_MAP<uint32, uint32> TransportEventMap;
|
||||
|
||||
|
||||
Player* GetPlayer(const char* name) const { return ObjectAccessor::Instance().FindPlayerByName(name);}
|
||||
Player* GetPlayer(uint64 guid) const { return ObjectAccessor::FindPlayer(guid); }
|
||||
|
||||
@@ -538,7 +538,7 @@ class ObjectMgr
|
||||
void LoadEventScripts();
|
||||
void LoadSpellScripts();
|
||||
void LoadWaypointScripts();
|
||||
|
||||
|
||||
void LoadTransportEvents();
|
||||
|
||||
bool LoadTrinityStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value);
|
||||
@@ -616,7 +616,7 @@ class ObjectMgr
|
||||
uint32 GeneratePetNumber();
|
||||
uint32 GenerateArenaTeamId();
|
||||
uint32 GenerateGuildId();
|
||||
|
||||
|
||||
void LoadPlayerInfoInCache();
|
||||
PCachePlayerInfo GetPlayerInfoFromCache(uint32 unPlayerGuid) const;
|
||||
CachePlayerInfoMap m_mPlayerInfoMap;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -26,9 +26,9 @@
|
||||
#include "Group.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
OutdoorPvPObjective::OutdoorPvPObjective(OutdoorPvP * pvp)
|
||||
OutdoorPvPObjective::OutdoorPvPObjective(OutdoorPvP * pvp)
|
||||
: m_PvP(pvp), m_ShiftPhase(0), m_ShiftMaxPhase(0), m_OldPhase(0),
|
||||
m_State(0), m_OldState(0), m_CapturePoint(0), m_NeutralValue(0),
|
||||
m_State(0), m_OldState(0), m_CapturePoint(0), m_NeutralValue(0),
|
||||
m_ShiftMaxCaptureSpeed(0), m_CapturePointCreature(0)
|
||||
{
|
||||
}
|
||||
@@ -767,7 +767,7 @@ int32 OutdoorPvPObjective::HandleOpenGo(Player *plr, uint64 guid)
|
||||
std::map<uint64,uint32>::iterator itr = m_ObjectTypes.find(guid);
|
||||
if(itr != m_ObjectTypes.end())
|
||||
{
|
||||
return itr->second;
|
||||
return itr->second;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -160,9 +160,9 @@ void OutdoorPvPObjectiveNA::SpawnGOsForTeam(uint32 team)
|
||||
i == NA_ROOST_W ||
|
||||
i == NA_ROOST_N ||
|
||||
i == NA_ROOST_E ||
|
||||
i == NA_BOMB_WAGON_S ||
|
||||
i == NA_BOMB_WAGON_W ||
|
||||
i == NA_BOMB_WAGON_N ||
|
||||
i == NA_BOMB_WAGON_S ||
|
||||
i == NA_BOMB_WAGON_W ||
|
||||
i == NA_BOMB_WAGON_N ||
|
||||
i == NA_BOMB_WAGON_E )
|
||||
continue; // roosts and bomb wagons are spawned when someone uses the matching destroyed roost
|
||||
AddObject(i,gos[i].entry,gos[i].map,gos[i].x,gos[i].y,gos[i].z,gos[i].o,gos[i].rot0,gos[i].rot1,gos[i].rot2,gos[i].rot3);
|
||||
@@ -244,7 +244,7 @@ void OutdoorPvPObjectiveNA::HandlePlayerLeave(Player *plr)
|
||||
OutdoorPvPObjective::HandlePlayerLeave(plr);
|
||||
}
|
||||
|
||||
OutdoorPvPObjectiveNA::OutdoorPvPObjectiveNA(OutdoorPvP *pvp) :
|
||||
OutdoorPvPObjectiveNA::OutdoorPvPObjectiveNA(OutdoorPvP *pvp) :
|
||||
OutdoorPvPObjective(pvp), m_capturable(true), m_GuardsAlive(0), m_ControllingFaction(0),
|
||||
m_HalaaState(HALAA_N), m_WyvernStateSouth(0), m_WyvernStateNorth(0), m_WyvernStateWest(0),
|
||||
m_WyvernStateEast(0), m_RespawnTimer(NA_RESPAWN_TIME), m_GuardCheckTimer(NA_GUARD_CHECK_TIME)
|
||||
@@ -336,7 +336,7 @@ void OutdoorPvPObjectiveNA::FillInitialWorldStates(WorldPacket &data)
|
||||
data << NA_MAP_HALAA_NEU_A << uint32(bool(m_HalaaState & HALAA_N_A));
|
||||
data << NA_MAP_HALAA_NEU_H << uint32(bool(m_HalaaState & HALAA_N_H));
|
||||
data << NA_MAP_HALAA_HORDE << uint32(bool(m_HalaaState & HALAA_H));
|
||||
data << NA_MAP_HALAA_ALLIANCE << uint32(bool(m_HalaaState & HALAA_A));
|
||||
data << NA_MAP_HALAA_ALLIANCE << uint32(bool(m_HalaaState & HALAA_A));
|
||||
}
|
||||
|
||||
void OutdoorPvPNA::SendRemoveWorldStates(Player *plr)
|
||||
@@ -368,7 +368,7 @@ void OutdoorPvPNA::SendRemoveWorldStates(Player *plr)
|
||||
plr->SendUpdateWorldState(NA_MAP_HALAA_NEU_A,0);
|
||||
plr->SendUpdateWorldState(NA_MAP_HALAA_NEU_H,0);
|
||||
plr->SendUpdateWorldState(NA_MAP_HALAA_HORDE,0);
|
||||
plr->SendUpdateWorldState(NA_MAP_HALAA_ALLIANCE,0);
|
||||
plr->SendUpdateWorldState(NA_MAP_HALAA_ALLIANCE,0);
|
||||
}
|
||||
|
||||
bool OutdoorPvPNA::Update(uint32 diff)
|
||||
@@ -425,7 +425,7 @@ bool OutdoorPvPObjectiveNA::HandleCustomSpell(Player * plr, uint32 spellId, Game
|
||||
uint32 noSpaceForCount = 0;
|
||||
|
||||
// check space and find places
|
||||
ItemPosCountVec dest;
|
||||
ItemPosCountVec dest;
|
||||
|
||||
int32 count = 10;
|
||||
uint32 itemid = 24538;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -77,7 +77,7 @@ enum OutdoorPvPNAWorldStates{
|
||||
NA_MAP_HALAA_NEU_A = 2676,
|
||||
NA_MAP_HALAA_NEU_H = 2677,
|
||||
NA_MAP_HALAA_HORDE = 2672,
|
||||
NA_MAP_HALAA_ALLIANCE = 2673
|
||||
NA_MAP_HALAA_ALLIANCE = 2673
|
||||
};
|
||||
|
||||
const uint32 FLIGHT_NODES_NUM = 4;
|
||||
@@ -94,8 +94,8 @@ enum ControlGOTypes{
|
||||
NA_BOMB_WAGON_N = 6,
|
||||
NA_BOMB_WAGON_E = 7,
|
||||
|
||||
NA_DESTROYED_ROOST_S = 8,
|
||||
NA_DESTROYED_ROOST_W = 9,
|
||||
NA_DESTROYED_ROOST_S = 8,
|
||||
NA_DESTROYED_ROOST_W = 9,
|
||||
NA_DESTROYED_ROOST_N = 10,
|
||||
NA_DESTROYED_ROOST_E = 11,
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -204,7 +204,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player *plr, uint32 spellId)
|
||||
return true;
|
||||
if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map, plr->GetPhaseMask(), plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,1))
|
||||
{
|
||||
delete go;
|
||||
delete go;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -230,7 +230,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player *plr, uint32 spellId)
|
||||
return true;
|
||||
if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map, plr->GetPhaseMask() ,plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,1))
|
||||
{
|
||||
delete go;
|
||||
delete go;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -269,7 +269,7 @@ bool OutdoorPvPTF::SetupOutdoorPvP()
|
||||
|
||||
m_IsLocked = false;
|
||||
m_LockTimer = TF_LOCK_TIME;
|
||||
m_LockTimerUpdate = 0;
|
||||
m_LockTimerUpdate = 0;
|
||||
hours_left = 6;
|
||||
second_digit = 0;
|
||||
first_digit = 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
+2
-2
@@ -247,7 +247,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
|
||||
m_charmInfo->GetActionBarEntry(index)->SpellOrAction = atol((*iter).c_str());
|
||||
|
||||
// patch for old data where some spells have ACT_DECIDE but should have ACT_CAST
|
||||
// so overwrite old state
|
||||
// so overwrite old state
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_charmInfo->GetActionBarEntry(index)->SpellOrAction);
|
||||
if (spellInfo && spellInfo->AttributesEx & SPELL_ATTR_EX_UNAUTOCASTABLE_BY_PET) m_charmInfo->GetActionBarEntry(index)->Type = ACT_ENABLED;
|
||||
}
|
||||
@@ -1674,7 +1674,7 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
|
||||
//if(const SpellEntry *tempSpell = GetSpellStore()->LookupEntry(spellid))
|
||||
// if(tempSpell->EffectImplicitTargetA[0] != TARGET_ALL_AROUND_CASTER
|
||||
// && tempSpell->EffectImplicitTargetA[0] != TARGET_CHAIN_DAMAGE)
|
||||
// return;
|
||||
// return;
|
||||
|
||||
PetSpellMap::const_iterator itr = m_spells.find(spellid);
|
||||
|
||||
|
||||
+12
-9
@@ -289,7 +289,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this)
|
||||
m_divider = 0;
|
||||
|
||||
m_ExtraFlags = 0;
|
||||
|
||||
|
||||
// players always accept
|
||||
if(GetSession()->GetSecurity() == SEC_PLAYER)
|
||||
SetAcceptWhispers(true);
|
||||
@@ -1583,13 +1583,13 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
||||
{
|
||||
GetSession()->SendNotification(LANG_NO_ENTER_CHAMPIONS_HALL);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(mapid == 450 && GetTeam() == ALLIANCE)
|
||||
{
|
||||
GetSession()->SendNotification(LANG_NO_ENTER_HALL_OF_LEGENDS);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// client without expansion support
|
||||
if(GetSession()->Expansion() < mEntry->Expansion())
|
||||
@@ -8263,7 +8263,7 @@ void Player::SendInitWorldStates(bool forceZone, uint32 forceZoneId)
|
||||
data << uint32(2474) << uint32(50); //: ally / horde slider percentage, 100 for ally, 0 for horde // show only in direct vicinity!
|
||||
data << uint32(2473) << uint32(0); //: ally / horde slider display // show only in direct vicinity!
|
||||
data << uint32(0x9a8) << uint32(0x0); // 20 // show the neutral stadium icon // 2472
|
||||
data << uint32(0x9a7) << uint32(0x0); // 21 // show the ally stadium icon // 2471
|
||||
data << uint32(0x9a7) << uint32(0x0); // 21 // show the ally stadium icon // 2471
|
||||
data << uint32(0x9a6) << uint32(0x1); // 22 // show the horde stadium icon // 2470
|
||||
}
|
||||
}
|
||||
@@ -8356,7 +8356,7 @@ void Player::SendInitWorldStates(bool forceZone, uint32 forceZoneId)
|
||||
data << uint32(0x9e1) << uint32(0x0); // 10 //2529
|
||||
data << uint32(0x9e0) << uint32(0x0); // 11
|
||||
data << uint32(0x9df) << uint32(0x0); // 12
|
||||
data << uint32(0xa5d) << uint32(0x1); // 13 //2653
|
||||
data << uint32(0xa5d) << uint32(0x1); // 13 //2653
|
||||
data << uint32(0xa5c) << uint32(0x0); // 14 //2652 east beacon neutral
|
||||
data << uint32(0xa5b) << uint32(0x1); // 15 horde
|
||||
data << uint32(0xa5a) << uint32(0x0); // 16 ally
|
||||
@@ -8372,7 +8372,7 @@ void Player::SendInitWorldStates(bool forceZone, uint32 forceZoneId)
|
||||
data << uint32(0xa00) << uint32(0x0); // 26 // 2560
|
||||
data << uint32(0x9ff) << uint32(0x1); // 27
|
||||
data << uint32(0x9fe) << uint32(0x0); // 28
|
||||
data << uint32(0x9fd) << uint32(0x0); // 29
|
||||
data << uint32(0x9fd) << uint32(0x0); // 29
|
||||
data << uint32(0x9fc) << uint32(0x1); // 30
|
||||
data << uint32(0x9fb) << uint32(0x0); // 31
|
||||
data << uint32(0xa62) << uint32(0x0); // 32 // 2658
|
||||
@@ -12403,6 +12403,9 @@ void Player::ApplyEnchantment(Item *item,EnchantmentSlot slot,bool apply, bool a
|
||||
case ITEM_ENCHANTMENT_TYPE_USE_SPELL:
|
||||
// processed in Player::CastItemUseSpell
|
||||
break;
|
||||
case ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET:
|
||||
// nothing do..
|
||||
break;
|
||||
default:
|
||||
sLog.outError("Unknown item enchantment (id = %d) display type: %d", enchant_id, enchant_display_type);
|
||||
break;
|
||||
@@ -16053,7 +16056,7 @@ void Player::SaveToDB()
|
||||
// save pet (hunter pet level and experience and all type pets health/mana).
|
||||
if(Pet* pet = GetPet())
|
||||
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
|
||||
|
||||
|
||||
//to prevent access to DB we should cache some data, which is used very often
|
||||
/*CachePlayerInfoMap::iterator _iter = objmgr.m_mPlayerInfoMap.find(GetGUIDLow());
|
||||
if(_iter != objmgr.m_mPlayerInfoMap.end())//skip new players
|
||||
@@ -19807,13 +19810,13 @@ void Player::RemovePossess(bool attack)
|
||||
target->GetMotionMaster()->Clear();
|
||||
target->GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
target->GetMotionMaster()->Clear();
|
||||
target->GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
|
||||
|
||||
// Add high amount of threat on the player
|
||||
if(attack)
|
||||
target->AddThreat(this, 1000000.0f);
|
||||
|
||||
+1
-1
@@ -1061,7 +1061,7 @@ class TRINITY_DLL_SPEC Player : public Unit
|
||||
Item* GetItemByGuid( uint64 guid ) const;
|
||||
Item* GetItemByPos( uint16 pos ) const;
|
||||
Item* GetItemByPos( uint8 bag, uint8 slot ) const;
|
||||
inline Item* Player::GetUseableItemByPos( uint8 bag, uint8 slot ) const //Does additional check for disarmed weapons
|
||||
inline Item* GetUseableItemByPos( uint8 bag, uint8 slot ) const //Does additional check for disarmed weapons
|
||||
{
|
||||
if (!CanUseAttackType(GetAttackBySlot(slot)))
|
||||
return NULL;
|
||||
|
||||
@@ -32,7 +32,7 @@ void PointMovementGenerator<T>::Initialize(T &unit)
|
||||
unit.StopMoving();
|
||||
Traveller<T> traveller(unit);
|
||||
i_destinationHolder.SetDestination(traveller,i_x,i_y,i_z);
|
||||
|
||||
|
||||
if (unit.GetTypeId() == TYPEID_UNIT && ((Creature*)&unit)->canFly())
|
||||
unit.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2);
|
||||
}
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
#define RUNNING_CHANCE_RANDOMMV 20 //will be "1 / RUNNING_CHANCE_RANDOMMV"
|
||||
|
||||
template<>
|
||||
bool
|
||||
bool
|
||||
RandomMovementGenerator<Creature>::GetDestination(float &x, float &y, float &z) const
|
||||
{
|
||||
if(i_destinationHolder.HasArrived())
|
||||
return false;
|
||||
|
||||
i_destinationHolder.GetDestination(x, y, z);
|
||||
return false;
|
||||
|
||||
i_destinationHolder.GetDestination(x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
|
||||
nx = X + distanceX;
|
||||
ny = Y + distanceY;
|
||||
|
||||
// prevent invalid coordinates generation
|
||||
// prevent invalid coordinates generation
|
||||
Trinity::NormalizeMapCoord(nx);
|
||||
Trinity::NormalizeMapCoord(ny);
|
||||
|
||||
@@ -122,9 +122,9 @@ RandomMovementGenerator<Creature>::Initialize(Creature &creature)
|
||||
{
|
||||
if(!creature.isAlive())
|
||||
return;
|
||||
|
||||
|
||||
wander_distance = creature.GetRespawnRadius();
|
||||
|
||||
|
||||
if (creature.canFly())
|
||||
creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2);
|
||||
else
|
||||
|
||||
@@ -32,7 +32,7 @@ class TRINITY_DLL_SPEC RandomMovementGenerator
|
||||
public:
|
||||
// Wander dist is related on db spawn dist. So what if we wanna set eandom movement on summoned creature?!
|
||||
RandomMovementGenerator(float spawn_dist = 0.0f) : i_nextMoveTime(0), wander_distance(spawn_dist) {}
|
||||
|
||||
|
||||
void _setRandomLocation(T &);
|
||||
void Initialize(T &);
|
||||
void Finalize(T &);
|
||||
|
||||
@@ -685,7 +685,7 @@ enum SpellEffects
|
||||
SPELL_EFFECT_153 = 153,
|
||||
SPELL_EFFECT_154 = 154,
|
||||
SPELL_EFFECT_TITAN_GRIP = 155,
|
||||
SPELL_EFFECT_ADD_SOCKET = 156,
|
||||
SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC = 156,
|
||||
SPELL_EFFECT_CREATE_ITEM_2 = 157,
|
||||
SPELL_EFFECT_MILLING = 158,
|
||||
SPELL_EFFECT_ALLOW_RENAME_PET = 159,
|
||||
@@ -829,7 +829,7 @@ enum Targets
|
||||
TARGET_TABLE_X_Y_Z_COORDINATES = 17, // uses in teleport spells and some other
|
||||
//TARGET_DEST_TABLE
|
||||
TARGET_EFFECT_SELECT = 18, // highly depends on the spell effect
|
||||
TARGET_DEST_CASTER_GROUND = 18,
|
||||
TARGET_DEST_CASTER_GROUND = 18,
|
||||
TARGET_ALL_PARTY_AROUND_CASTER = 20,
|
||||
TARGET_UNIT_PARTY_CASTER = 20,
|
||||
TARGET_SINGLE_FRIEND = 21,
|
||||
@@ -891,7 +891,7 @@ enum Targets
|
||||
TARGET_UNIT_AREA_SCRIPT = 60,
|
||||
TARGET_AREAEFFECT_PARTY_AND_CLASS = 61,
|
||||
TARGET_UNIT_CLASS_TARGET = 61,
|
||||
TARGET_TEST = 62, // for a test spell
|
||||
TARGET_TEST = 62, // for a test spell
|
||||
TARGET_DUELVSPLAYER_COORDINATES = 63,
|
||||
TARGET_DEST_TARGET_ENEMY_UNKNOWN = 63,
|
||||
TARGET_DEST_TARGET_FRONT = 64,
|
||||
|
||||
+35
-33
@@ -574,6 +574,7 @@ void Spell::FillTargetMap()
|
||||
break;
|
||||
/*case SPELL_EFFECT_ENCHANT_ITEM:
|
||||
case SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY:
|
||||
case SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC:
|
||||
case SPELL_EFFECT_DISENCHANT:
|
||||
case SPELL_EFFECT_PROSPECTING:
|
||||
case SPELL_EFFECT_MILLING:
|
||||
@@ -1045,7 +1046,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
|
||||
return;
|
||||
|
||||
// Recheck immune (only for delayed spells)
|
||||
if( m_spellInfo->speed &&
|
||||
if( m_spellInfo->speed &&
|
||||
!(m_spellInfo->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY)
|
||||
&& (unit->IsImmunedToDamage(GetSpellSchoolMask(m_spellInfo)) ||
|
||||
unit->IsImmunedToSpell(m_spellInfo)))
|
||||
@@ -1169,7 +1170,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
|
||||
{
|
||||
if(m_customAttr & SPELL_ATTR_CU_EFFECT_HEAL)
|
||||
m_originalCaster->ProcDamageAndSpell(unit, PROC_FLAG_HEAL, PROC_FLAG_NONE, 0, GetSpellSchoolMask(m_spellInfo), m_spellInfo);
|
||||
if(m_originalCaster != unit && (m_customAttr & SPELL_ATTR_CU_EFFECT_DAMAGE))
|
||||
if(m_originalCaster != unit && (m_customAttr & SPELL_ATTR_CU_EFFECT_DAMAGE))
|
||||
m_originalCaster->ProcDamageAndSpell(unit, PROC_FLAG_HIT_SPELL, PROC_FLAG_STRUCK_SPELL, 0, GetSpellSchoolMask(m_spellInfo), m_spellInfo);
|
||||
}*/
|
||||
}
|
||||
@@ -1337,7 +1338,7 @@ void Spell::SearchChainTarget(std::list<Unit*> &TagUnitMap, float max_range, uin
|
||||
if(cur->GetDistance(*next) > CHAIN_SPELL_JUMP_RADIUS)
|
||||
break;
|
||||
while(!cur->IsWithinLOSInMap(*next)
|
||||
|| m_spellInfo->DmgClass==SPELL_DAMAGE_CLASS_MELEE
|
||||
|| m_spellInfo->DmgClass==SPELL_DAMAGE_CLASS_MELEE
|
||||
&& !m_caster->isInFront(*next, max_range))
|
||||
{
|
||||
++next;
|
||||
@@ -1347,7 +1348,7 @@ void Spell::SearchChainTarget(std::list<Unit*> &TagUnitMap, float max_range, uin
|
||||
}
|
||||
|
||||
cur = *next;
|
||||
tempUnitMap.erase(next);
|
||||
tempUnitMap.erase(next);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1385,7 +1386,7 @@ void Spell::SearchAreaTarget(std::list<Unit*> &TagUnitMap, float radius, const u
|
||||
}
|
||||
|
||||
Trinity::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, type, TargetType, entry, x, y, z);
|
||||
if((m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_PLAYERS_ONLY)
|
||||
if((m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_PLAYERS_ONLY)
|
||||
|| TargetType == SPELL_TARGETS_ENTRY && !entry)
|
||||
m_caster->GetMap()->VisitWorld(x, y, radius, notifier);
|
||||
else
|
||||
@@ -1946,7 +1947,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
||||
if(m_targets.getUnitTarget())
|
||||
{
|
||||
TagUnitMap.remove(m_targets.getUnitTarget());
|
||||
if(m_spellInfo->Id != 5246) //Intimidating Shout
|
||||
if(m_spellInfo->Id != 5246) //Intimidating Shout
|
||||
--unMaxTargets;
|
||||
}
|
||||
|
||||
@@ -1971,7 +1972,7 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
|
||||
m_castItemGUID = m_CastItem->GetGUID();
|
||||
else
|
||||
m_castItemGUID = 0;
|
||||
|
||||
|
||||
m_targets = *targets;
|
||||
|
||||
m_spellState = SPELL_STATE_PREPARING;
|
||||
@@ -2046,7 +2047,7 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
|
||||
if(isSpellBreakStealth(m_spellInfo) )
|
||||
m_caster->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CAST);
|
||||
|
||||
if(!m_casttime && !m_spellInfo->StartRecoveryTime
|
||||
if(!m_casttime && !m_spellInfo->StartRecoveryTime
|
||||
&& !m_castItemGUID //item: first cast may destroy item and second cast causes crash
|
||||
&& GetCurrentContainer() == CURRENT_GENERIC_SPELL)
|
||||
cast(true);
|
||||
@@ -2054,8 +2055,9 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
|
||||
{
|
||||
m_caster->SetCurrentCastedSpell( this );
|
||||
m_selfContainer = &(m_caster->m_currentSpells[GetCurrentContainer()]);
|
||||
SendSpellStart();
|
||||
}
|
||||
|
||||
SendSpellStart();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2100,14 +2102,14 @@ void Spell::cancel(bool report)
|
||||
// Unsummon summon as possessed creatures on spell cancel
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if (m_spellInfo->Effect[i] == SPELL_EFFECT_SUMMON &&
|
||||
(m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED ||
|
||||
m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 ||
|
||||
if (m_spellInfo->Effect[i] == SPELL_EFFECT_SUMMON &&
|
||||
(m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED ||
|
||||
m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 ||
|
||||
m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3))
|
||||
{
|
||||
// Possession is removed in the UnSummon function
|
||||
if (m_caster->GetCharm())
|
||||
((TemporarySummon*)m_caster->GetCharm())->UnSummon();
|
||||
((TemporarySummon*)m_caster->GetCharm())->UnSummon();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2136,13 +2138,16 @@ void Spell::cast(bool skipCheck)
|
||||
if(m_caster->GetTypeId() != TYPEID_PLAYER && m_targets.getUnitTarget() && m_targets.getUnitTarget() != m_caster)
|
||||
m_caster->SetInFront(m_targets.getUnitTarget());
|
||||
|
||||
castResult = CheckPower();
|
||||
if(castResult != 0)
|
||||
if(!m_IsTriggeredSpell)
|
||||
{
|
||||
SendCastResult(castResult);
|
||||
finish(false);
|
||||
SetExecutedCurrently(false);
|
||||
return;
|
||||
castResult = CheckPower();
|
||||
if(castResult != 0)
|
||||
{
|
||||
SendCastResult(castResult);
|
||||
finish(false);
|
||||
SetExecutedCurrently(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// triggered cast called from Spell::prepare where it was already checked
|
||||
@@ -2197,22 +2202,15 @@ void Spell::cast(bool skipCheck)
|
||||
((Player*)m_caster)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, m_spellInfo->Id);
|
||||
}
|
||||
|
||||
// CAST SPELL
|
||||
SendSpellCooldown();
|
||||
|
||||
if(!m_IsTriggeredSpell)
|
||||
{
|
||||
//TakePower();
|
||||
TakeReagents(); // we must remove reagents before HandleEffects to allow place crafted item in same slot
|
||||
}
|
||||
|
||||
if(m_spellState == SPELL_STATE_FINISHED) // stop cast if spell marked as finish somewhere in Take*/FillTargetMap
|
||||
{
|
||||
SetExecutedCurrently(false);
|
||||
return;
|
||||
}
|
||||
|
||||
SendCastResult(castResult);
|
||||
// CAST SPELL
|
||||
SendSpellCooldown();
|
||||
//SendCastResult(castResult);
|
||||
SendSpellGo(); // we must send smsg_spell_go packet before m_castItem delete in TakeCastItem()...
|
||||
|
||||
if(m_customAttr & SPELL_ATTR_CU_DIRECT_DAMAGE)
|
||||
@@ -2257,9 +2255,12 @@ void Spell::cast(bool skipCheck)
|
||||
uint32 auraSpellIdx = (*i)->GetEffIndex();
|
||||
// Calculate chance at that moment (can be depend for example from combo points)
|
||||
int32 chance = m_caster->CalculateSpellDamage(auraSpellInfo, auraSpellIdx, (*i)->GetBasePoints(),unit);
|
||||
chance *= (*i)->GetStackAmount();
|
||||
if(roll_chance_i(chance))
|
||||
for (int j=0; j != (*i)->GetStackAmount(); ++j)
|
||||
m_caster->CastSpell(unit, auraSpellInfo->EffectTriggerSpell[auraSpellIdx], true, NULL, (*i));
|
||||
{
|
||||
if(SpellEntry const *spellInfo = sSpellStore.LookupEntry(auraSpellInfo->EffectTriggerSpell[auraSpellIdx]))
|
||||
m_TriggerSpells.push_back(spellInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3721,7 +3722,7 @@ uint8 Spell::CanCast(bool strict)
|
||||
}
|
||||
|
||||
//Must be behind the target.
|
||||
if( m_spellInfo->AttributesEx2 == 0x100000 && (m_spellInfo->AttributesEx & 0x200) == 0x200 && target->HasInArc(M_PI, m_caster)
|
||||
if( m_spellInfo->AttributesEx2 == 0x100000 && (m_spellInfo->AttributesEx & 0x200) == 0x200 && target->HasInArc(M_PI, m_caster)
|
||||
//Exclusion for Pounce: Facing Limitation was removed in 2.0.1, but it still uses the same, old Ex-Flags
|
||||
&& (m_spellInfo->SpellFamilyName != SPELLFAMILY_DRUID || !m_spellInfo->SpellFamilyFlags.IsEqual(0x20000,0,0)))
|
||||
{
|
||||
@@ -5008,6 +5009,7 @@ uint8 Spell::CheckItems()
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_ENCHANT_ITEM:
|
||||
case SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC:
|
||||
{
|
||||
Item* targetItem = m_targets.getItemTarget();
|
||||
if(!targetItem)
|
||||
@@ -5746,7 +5748,7 @@ int32 Spell::CalculateDamageDone(Unit *unit, const uint32 effectMask, float *mul
|
||||
m_damage *= m_damageMultipliers[i];
|
||||
m_damageMultipliers[i] *= multiplier[i];
|
||||
}
|
||||
|
||||
|
||||
damageDone += m_damage;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,6 +350,7 @@ class Spell
|
||||
void EffectRedirectThreat(uint32 i);
|
||||
void EffectActivateRune(uint32 i);
|
||||
void EffectTitanGrip(uint32 i);
|
||||
void EffectEnchantItemPrismatic(uint32 i);
|
||||
|
||||
Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID = 0, Spell** triggeringContainer = NULL, bool skipCheck = false );
|
||||
~Spell();
|
||||
|
||||
@@ -366,7 +366,7 @@ m_updated(false), m_isRemovedOnShapeLost(true), m_in_use(false)
|
||||
damage = caster->CalculateSpellDamage(m_spellProto, m_effIndex, m_currentBasePoints, target);
|
||||
else
|
||||
damage = m_currentBasePoints + 1;
|
||||
}
|
||||
}
|
||||
|
||||
m_isPassive = IsPassiveSpell(GetId());
|
||||
m_positive = IsPositiveEffect(GetId(), m_effIndex);
|
||||
@@ -1313,7 +1313,7 @@ void Aura::TriggerSpell()
|
||||
// // Five Fat Finger Exploding Heart Technique
|
||||
// case 27673: break;
|
||||
// Nitrous Boost
|
||||
case 27746:
|
||||
case 27746:
|
||||
{
|
||||
if (caster->GetPower(POWER_MANA) >= 10)
|
||||
{
|
||||
@@ -1621,7 +1621,7 @@ void Aura::TriggerSpell()
|
||||
(*i)->ApplyModifier(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}break;
|
||||
// // Dementia
|
||||
// case 41404: break;
|
||||
@@ -2270,7 +2270,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
|
||||
if (totem && totem->isTotem())
|
||||
totem->AddPlayerToVision((Player*)caster);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
((Player*)caster)->RemoveFarsightTarget();
|
||||
return;
|
||||
@@ -3821,7 +3821,7 @@ void Aura::HandleAuraModSchoolImmunity(bool apply, bool Real)
|
||||
{
|
||||
if(apply && m_modifier.m_miscvalue == SPELL_SCHOOL_MASK_NORMAL)
|
||||
m_target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_UNATTACKABLE);
|
||||
|
||||
|
||||
m_target->ApplySpellImmune(GetId(),IMMUNITY_SCHOOL,m_modifier.m_miscvalue,apply);
|
||||
|
||||
if(Real && apply && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)
|
||||
@@ -5432,7 +5432,7 @@ void Aura::PeriodicTick()
|
||||
break;
|
||||
}
|
||||
case 41337:// aura of anger
|
||||
{
|
||||
{
|
||||
Unit::AuraList const& mMod = m_target->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
|
||||
for(Unit::AuraList::const_iterator i = mMod.begin(); i != mMod.end(); ++i)
|
||||
{
|
||||
@@ -5443,7 +5443,7 @@ void Aura::PeriodicTick()
|
||||
(*i)->ApplyModifier(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
m_modifier.m_amount += 100;
|
||||
}break;
|
||||
default:
|
||||
|
||||
@@ -220,7 +220,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
|
||||
&Spell::EffectNULL, //153 SPELL_EFFECT_CREATE_PET misc value is creature entry
|
||||
&Spell::EffectNULL, //154 unused
|
||||
&Spell::EffectTitanGrip, //155 SPELL_EFFECT_TITAN_GRIP Allows you to equip two-handed axes, maces and swords in one hand, but you attack $49152s1% slower than normal.
|
||||
&Spell::EffectNULL, //156 Add Socket
|
||||
&Spell::EffectEnchantItemPrismatic, //156 SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC
|
||||
&Spell::EffectCreateItem, //157 SPELL_EFFECT_CREATE_ITEM_2 create/learn item/spell for profession
|
||||
&Spell::EffectMilling, //158 SPELL_EFFECT_MILLING milling
|
||||
&Spell::EffectRenamePet //159 SPELL_EFFECT_ALLOW_RENAME_PET allow rename pet once again
|
||||
@@ -684,7 +684,7 @@ void Spell::EffectDummy(uint32 i)
|
||||
if (!creatureTarget || !pGameObj) return;
|
||||
|
||||
if (!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 181574, creatureTarget->GetMap(), creatureTarget->GetPhaseMask(),
|
||||
creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(),
|
||||
creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(),
|
||||
creatureTarget->GetOrientation(), 0, 0, 0, 0, 100, 1))
|
||||
{
|
||||
delete pGameObj;
|
||||
@@ -1319,7 +1319,7 @@ void Spell::EffectDummy(uint32 i)
|
||||
rage+=aura->GetModifier()->m_amount;
|
||||
|
||||
spell_id = 20647;
|
||||
int32 bp = damage+int32(rage * m_spellInfo->DmgMultiplier[i] +
|
||||
bp = damage+int32(rage * m_spellInfo->DmgMultiplier[i] +
|
||||
m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f);
|
||||
m_caster->SetPower(POWER_RAGE,0);
|
||||
break;
|
||||
@@ -3615,7 +3615,7 @@ void Spell::EffectAddFarsight(uint32 i)
|
||||
map->Add(dynObj);
|
||||
map->SwitchGridContainers(dynObj, true); // Needed for forwarding player packets
|
||||
dynObj->setActive(true); // Keep the grid updated even if there are no players in it
|
||||
|
||||
|
||||
// Need to update visibility of object for client to accept farsight guid
|
||||
((Player*)m_caster)->UpdateVisibilityOf(dynObj);
|
||||
((Player*)m_caster)->SetFarsightTarget(dynObj);
|
||||
@@ -3698,7 +3698,7 @@ void Spell::EffectSummonGuardian(uint32 i)
|
||||
}
|
||||
|
||||
// trigger
|
||||
if(!m_originalCaster || m_originalCaster->GetTypeId() != TYPEID_PLAYER
|
||||
if(!m_originalCaster || m_originalCaster->GetTypeId() != TYPEID_PLAYER
|
||||
&& !((Creature*)m_originalCaster)->isTotem()/*m_spellInfo->Id == 40276*/)
|
||||
{
|
||||
EffectSummonWild(i);
|
||||
@@ -3888,7 +3888,7 @@ void Spell::EffectTradeSkill(uint32 /*i*/)
|
||||
// ((Player*)unitTarget)->SetSkill(skillid,skillval?skillval:1,skillmax+75);
|
||||
}
|
||||
|
||||
void Spell::EffectEnchantItemPerm(uint32 i)
|
||||
void Spell::EffectEnchantItemPerm(uint32 effect_idx)
|
||||
{
|
||||
if(m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
@@ -3897,9 +3897,10 @@ void Spell::EffectEnchantItemPerm(uint32 i)
|
||||
|
||||
Player* p_caster = (Player*)m_caster;
|
||||
|
||||
// not grow at item use at item case
|
||||
p_caster->UpdateCraftSkill(m_spellInfo->Id);
|
||||
|
||||
uint32 enchant_id = m_spellInfo->EffectMiscValue[i];
|
||||
uint32 enchant_id = m_spellInfo->EffectMiscValue[effect_idx];
|
||||
if (!enchant_id)
|
||||
return;
|
||||
|
||||
@@ -3929,6 +3930,64 @@ void Spell::EffectEnchantItemPerm(uint32 i)
|
||||
item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,true);
|
||||
}
|
||||
|
||||
void Spell::EffectEnchantItemPrismatic(uint32 effect_idx)
|
||||
{
|
||||
if(m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
if (!itemTarget)
|
||||
return;
|
||||
|
||||
Player* p_caster = (Player*)m_caster;
|
||||
|
||||
uint32 enchant_id = m_spellInfo->EffectMiscValue[effect_idx];
|
||||
if (!enchant_id)
|
||||
return;
|
||||
|
||||
SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
|
||||
if(!pEnchant)
|
||||
return;
|
||||
|
||||
// support only enchantings with add socket in this slot
|
||||
{
|
||||
bool add_socket = false;
|
||||
for(int i = 0; i < 3; ++i)
|
||||
{
|
||||
if(pEnchant->type[i]==ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET)
|
||||
{
|
||||
add_socket = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!add_socket)
|
||||
{
|
||||
sLog.outError("Spell::EffectEnchantItemPrismatic: attempt apply enchant spell %u with SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC (%u) but without ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET (u), not suppoted yet.",
|
||||
m_spellInfo->Id,SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC,ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// item can be in trade slot and have owner diff. from caster
|
||||
Player* item_owner = itemTarget->GetOwner();
|
||||
if(!item_owner)
|
||||
return;
|
||||
|
||||
if(item_owner!=p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) )
|
||||
{
|
||||
sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
|
||||
p_caster->GetName(),p_caster->GetSession()->GetAccountId(),
|
||||
itemTarget->GetProto()->Name1,itemTarget->GetEntry(),
|
||||
item_owner->GetName(),item_owner->GetSession()->GetAccountId());
|
||||
}
|
||||
|
||||
// remove old enchanting before applying new if equipped
|
||||
item_owner->ApplyEnchantment(itemTarget,PRISMATIC_ENCHANTMENT_SLOT,false);
|
||||
|
||||
itemTarget->SetEnchantment(PRISMATIC_ENCHANTMENT_SLOT, enchant_id, 0, 0);
|
||||
|
||||
// add new enchanting if equipped
|
||||
item_owner->ApplyEnchantment(itemTarget,PRISMATIC_ENCHANTMENT_SLOT,true);
|
||||
}
|
||||
|
||||
void Spell::EffectEnchantItemTmp(uint32 i)
|
||||
{
|
||||
if(m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
@@ -4539,7 +4598,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
|
||||
if(spell_bonus)
|
||||
spell_bonus = int32(spell_bonus * weapon_total_pct);
|
||||
}
|
||||
|
||||
|
||||
int32 weaponDamage = m_caster->CalculateDamage(m_attackType, normalized);
|
||||
|
||||
// Sequence is important
|
||||
|
||||
@@ -59,7 +59,7 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner)
|
||||
float x, y, z;
|
||||
if(!i_offset)
|
||||
{
|
||||
// to nearest random contact position
|
||||
// to nearest random contact position
|
||||
i_target->GetRandomContactPoint( &owner, x, y, z, 0, MELEE_RANGE - 0.5f );
|
||||
}
|
||||
else
|
||||
@@ -101,7 +101,7 @@ TargetedMovementGenerator<T>::Initialize(T &owner)
|
||||
|
||||
if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->canFly())
|
||||
owner.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2);
|
||||
|
||||
|
||||
_setTargetLocation(owner);
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -54,7 +54,7 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
|
||||
|
||||
// get additional data, rarely used
|
||||
recv_data >> ticketText2;
|
||||
|
||||
|
||||
// assign values
|
||||
ticket->name = GetPlayer()->GetName();
|
||||
ticket->guid = ticketmgr.GenerateTicketID();
|
||||
@@ -67,7 +67,7 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
|
||||
|
||||
// remove ticket by player, shouldn't happen
|
||||
ticketmgr.RemoveGMTicketByPlayer(GetPlayer()->GetGUID(), GetPlayer()->GetGUID());
|
||||
|
||||
|
||||
// add ticket
|
||||
ticketmgr.AddGMTicket(ticket, false);
|
||||
|
||||
@@ -76,15 +76,15 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
|
||||
|
||||
// Send ticket creation
|
||||
SendPacket(&data);
|
||||
|
||||
|
||||
sWorld.SendGMText(LANG_COMMAND_TICKETNEW, ticket->name.c_str(), ticket->guid);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void WorldSession::HandleGMTicketUpdateOpcode( WorldPacket & recv_data)
|
||||
{
|
||||
// always do a packet check
|
||||
CHECK_PACKET_SIZE(recv_data,1);
|
||||
CHECK_PACKET_SIZE(recv_data,1);
|
||||
|
||||
std::string message = "";
|
||||
time_t t = time(NULL);
|
||||
@@ -98,7 +98,7 @@ void WorldSession::HandleGMTicketUpdateOpcode( WorldPacket & recv_data)
|
||||
GM_Ticket *ticket = ticketmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID());
|
||||
|
||||
// Check if player has a GM Ticket yet
|
||||
if(!ticket)
|
||||
if(!ticket)
|
||||
{
|
||||
// Response - error couldnt find existing Ticket
|
||||
data << uint32(1);
|
||||
@@ -133,7 +133,7 @@ void WorldSession::HandleGMTicketDeleteOpcode( WorldPacket & /*recv_data*/)
|
||||
if(ticket)
|
||||
{
|
||||
// Remove Tickets from Player
|
||||
|
||||
|
||||
// Response - no errors
|
||||
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
|
||||
data << uint32(9);
|
||||
@@ -150,12 +150,12 @@ void WorldSession::HandleGMTicketGetTicketOpcode( WorldPacket & /*recv_data*/)
|
||||
// NO recv_data NO packet size check
|
||||
|
||||
WorldPacket data(SMSG_GMTICKET_GETTICKET, 400);
|
||||
|
||||
|
||||
// get Current Ticket
|
||||
GM_Ticket *ticket = ticketmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID());
|
||||
|
||||
// check for existing ticket
|
||||
if(!ticket)
|
||||
if(!ticket)
|
||||
{
|
||||
data << uint32(10);
|
||||
// send packet
|
||||
@@ -183,8 +183,8 @@ void WorldSession::HandleGMTicketSystemStatusOpcode( WorldPacket & /*recv_data*/
|
||||
// in case of disactivity, this should be set to (0)
|
||||
|
||||
data << uint32(1);
|
||||
|
||||
|
||||
|
||||
|
||||
// Send Packet
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ GM_Ticket* TicketMgr::GetGMTicketByName(const char* name)
|
||||
Player *plr = objmgr.GetPlayer(pname.c_str());
|
||||
if(!plr)
|
||||
return NULL;
|
||||
|
||||
|
||||
uint64 playerGuid = plr->GetGUID();
|
||||
|
||||
for(GmTicketList::iterator i = GM_TicketList.begin(); i != GM_TicketList.end();)
|
||||
@@ -184,7 +184,7 @@ void TicketMgr::SaveGMTicket(GM_Ticket* ticket)
|
||||
CharacterDatabase.BeginTransaction();
|
||||
CharacterDatabase.Execute(ss.str().c_str());
|
||||
CharacterDatabase.CommitTransaction();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void TicketMgr::UpdateGMTicket(GM_Ticket *ticket)
|
||||
|
||||
@@ -59,13 +59,13 @@ class TicketMgr
|
||||
void RemoveGMTicket(uint64 ticketGuid, uint64 GMguid);
|
||||
void UpdateGMTicket(GM_Ticket *ticket);
|
||||
void SaveGMTicket(GM_Ticket* ticket);
|
||||
|
||||
|
||||
uint64 GenerateTicketID();
|
||||
void InitTicketID();
|
||||
GM_Ticket* GetGMTicket(uint64 ticketGuid);
|
||||
GM_Ticket* GetGMTicketByPlayer(uint64 playerGuid);
|
||||
GM_Ticket* GetGMTicketByName(const char *name);
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
uint64 m_ticketid;
|
||||
|
||||
@@ -555,7 +555,7 @@ void Transport::Update(uint32 /*p_time*/)
|
||||
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_TRANSPORT_MOVES)==0)
|
||||
sLog.outDetail("%s moved to %f %f %f %d", this->m_name.c_str(), m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid);
|
||||
|
||||
|
||||
//Transport Event System
|
||||
CheckForEvent(this->GetEntry(), m_curr->second.id);
|
||||
sLog.outDetail("%s is at wp id: %u", this->m_name.c_str(), m_curr->second.id);
|
||||
|
||||
@@ -83,7 +83,7 @@ inline void Traveller<Creature>::MoveTo(float x, float y, float z, uint32 t)
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
+22
-18
@@ -74,7 +74,7 @@ static bool procPrepared = InitTriggerAuraData();
|
||||
|
||||
Unit::Unit()
|
||||
: WorldObject(), i_motionMaster(this), m_ThreatManager(this), m_HostilRefManager(this)
|
||||
, m_IsInNotifyList(false), m_Notified(false)
|
||||
, m_IsInNotifyList(false), m_Notified(false), m_AI_enabled(false)
|
||||
{
|
||||
m_objectType |= TYPEMASK_UNIT;
|
||||
m_objectTypeId = TYPEID_UNIT;
|
||||
@@ -464,7 +464,7 @@ void Unit::RemoveAurasWithInterruptFlags(uint32 flag, uint32 except)
|
||||
|
||||
// interrupt channeled spell
|
||||
if(Spell* spell = m_currentSpells[CURRENT_CHANNELED_SPELL])
|
||||
if(spell->getState() == SPELL_STATE_CASTING
|
||||
if(spell->getState() == SPELL_STATE_CASTING
|
||||
&& (spell->m_spellInfo->ChannelInterruptFlags & flag)
|
||||
&& spell->m_spellInfo->Id != except)
|
||||
InterruptNonMeleeSpells(false);
|
||||
@@ -532,7 +532,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
if( pVictim->GetTypeId()== TYPEID_UNIT && ((Creature *)pVictim)->AI() )
|
||||
{
|
||||
((Creature *)pVictim)->AI()->DamageTaken(this, damage);
|
||||
|
||||
|
||||
// Set tagging
|
||||
if(!pVictim->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_OTHER_TAGGER) && !((Creature*)pVictim)->isPet())
|
||||
{
|
||||
@@ -550,14 +550,14 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
{
|
||||
if(((Creature*)this)->isPet())
|
||||
{
|
||||
((Creature *)pVictim)->SetLootRecipient(this->GetOwner());
|
||||
((Creature *)pVictim)->SetLootRecipient(this->GetOwner());
|
||||
((Creature *)pVictim)->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_OTHER_TAGGER);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (damagetype != NODAMAGE)
|
||||
{
|
||||
@@ -3034,7 +3034,11 @@ uint32 Unit::GetWeaponSkillValue (WeaponAttackType attType, Unit const* target)
|
||||
|
||||
// feral or unarmed skill only for base attack
|
||||
if(attType != BASE_ATTACK && !item )
|
||||
{
|
||||
if(attType == RANGED_ATTACK && getClass() == CLASS_PALADIN) //hammer
|
||||
return GetMaxSkillValueForLevel();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(((Player*)this)->IsInFeralForm())
|
||||
return GetMaxSkillValueForLevel(); // always maximized SKILL_FERAL_COMBAT in fact
|
||||
@@ -4053,7 +4057,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
|
||||
statue = ((Totem*)caster);
|
||||
|
||||
// stop caster chanelling state
|
||||
else if(caster->m_currentSpells[CURRENT_CHANNELED_SPELL]
|
||||
else if(caster->m_currentSpells[CURRENT_CHANNELED_SPELL]
|
||||
//prevent recurential call
|
||||
&& caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED)
|
||||
{
|
||||
@@ -4061,7 +4065,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
|
||||
{
|
||||
// remove auras only for non-aoe spells or when chanelled aura is removed
|
||||
// because aoe spells don't require aura on target to continue
|
||||
if (AurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()]!=SPELL_AURA_PERIODIC_DUMMY
|
||||
if (AurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()]!=SPELL_AURA_PERIODIC_DUMMY
|
||||
&& AurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()]!= SPELL_AURA_DUMMY)
|
||||
//don't stop channeling of scripted spells (this is actually a hack)
|
||||
{
|
||||
@@ -7561,8 +7565,8 @@ void Unit::SetCharm(Unit* pet)
|
||||
SetUInt64Value(UNIT_FIELD_CHARM, pet ? pet->GetGUID() : 0);
|
||||
}
|
||||
|
||||
void Unit::AddPlayerToVision(Player* plr)
|
||||
{
|
||||
void Unit::AddPlayerToVision(Player* plr)
|
||||
{
|
||||
if (m_sharedVision.empty() && GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
setActive(true);
|
||||
@@ -7572,9 +7576,9 @@ void Unit::AddPlayerToVision(Player* plr)
|
||||
plr->SetFarsightTarget(this);
|
||||
}
|
||||
|
||||
void Unit::RemovePlayerFromVision(Player* plr)
|
||||
{
|
||||
m_sharedVision.remove(plr);
|
||||
void Unit::RemovePlayerFromVision(Player* plr)
|
||||
{
|
||||
m_sharedVision.remove(plr);
|
||||
if (m_sharedVision.empty() && GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
setActive(false);
|
||||
@@ -8499,7 +8503,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
|
||||
CastingTime = damagetype == DOT ? 3500 : 1010;
|
||||
}
|
||||
// Improved Leader of the Pack
|
||||
else if (spellProto->AttributesEx2 == 536870912 && spellProto->SpellIconID == 312
|
||||
else if (spellProto->AttributesEx2 == 536870912 && spellProto->SpellIconID == 312
|
||||
&& spellProto->AttributesEx3 == 33554432)
|
||||
{
|
||||
CastingTime = 0;
|
||||
@@ -9216,7 +9220,7 @@ bool Unit::isAttackableByAOE() const
|
||||
if(!isAlive())
|
||||
return false;
|
||||
|
||||
if(HasFlag(UNIT_FIELD_FLAGS,
|
||||
if(HasFlag(UNIT_FIELD_FLAGS,
|
||||
UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NOT_ATTACKABLE_2))
|
||||
return false;
|
||||
|
||||
@@ -9867,7 +9871,7 @@ Unit* Creature::SelectVictim()
|
||||
AI()->EnterEvadeMode();
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// enter in evade mode in other case
|
||||
@@ -12257,7 +12261,7 @@ void Unit::SetCharmedOrPossessedBy(Unit* charmer, bool possess)
|
||||
}
|
||||
}
|
||||
|
||||
if(possess)
|
||||
if(possess)
|
||||
((Player*)charmer)->PossessSpellInitialize();
|
||||
else if(charmer->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)charmer)->CharmSpellInitialize();
|
||||
@@ -12313,7 +12317,7 @@ void Unit::RemoveCharmedOrPossessedBy(Unit *charmer)
|
||||
return;
|
||||
|
||||
assert(!possess || charmer->GetTypeId() == TYPEID_PLAYER);
|
||||
|
||||
|
||||
charmer->SetCharm(0);
|
||||
if(possess)
|
||||
{
|
||||
@@ -12417,7 +12421,7 @@ void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius)
|
||||
Player* Target = itr->getSource();
|
||||
|
||||
// IsHostileTo check duel and controlled by enemy
|
||||
if( Target && Target != this && Target->isAlive()
|
||||
if( Target && Target != this && Target->isAlive()
|
||||
&& IsWithinDistInMap(Target, radius) && !IsHostileTo(Target) )
|
||||
nearMembers.push_back(Target);
|
||||
}
|
||||
|
||||
+3
-1
@@ -1103,7 +1103,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
|
||||
void DeMorph();
|
||||
|
||||
void SendAttackStart(Unit* pVictim);
|
||||
void SendAttackStart(Unit* pVictim);
|
||||
void SendAttackStateUpdate(CalcDamageInfo *damageInfo);
|
||||
void SendAttackStateUpdate(uint32 HitInfo, Unit *target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount);
|
||||
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log);
|
||||
@@ -1559,6 +1559,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
uint32 m_regenTimer;
|
||||
|
||||
ThreatManager m_ThreatManager;
|
||||
|
||||
bool m_AI_enabled;
|
||||
private:
|
||||
void SendAttackStop(Unit* victim); // only from AttackStop(Unit*)
|
||||
//void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)
|
||||
|
||||
@@ -57,17 +57,17 @@ void WaypointStore::Load()
|
||||
barGoLink bar( total_records);
|
||||
Field *fields;
|
||||
uint32 last_id = 0;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
fields = result->Fetch();
|
||||
uint32 id = fields[0].GetUInt32();
|
||||
bar.step();
|
||||
WaypointData *wp = new WaypointData;
|
||||
|
||||
|
||||
if(last_id != id)
|
||||
path_data = new WaypointPath;
|
||||
|
||||
|
||||
float x,y,z;
|
||||
x = fields[2].GetFloat();
|
||||
y = fields[3].GetFloat();
|
||||
@@ -84,12 +84,12 @@ void WaypointStore::Load()
|
||||
wp->delay = fields[6].GetUInt32();
|
||||
wp->event_id = fields[7].GetUInt32();
|
||||
wp->event_chance = fields[8].GetUInt8();
|
||||
|
||||
|
||||
path_data->push_back(wp);
|
||||
|
||||
if(id != last_id)
|
||||
|
||||
if(id != last_id)
|
||||
waypoint_map[id] = path_data;
|
||||
|
||||
|
||||
last_id = id;
|
||||
|
||||
} while(result->NextRow()) ;
|
||||
@@ -100,28 +100,28 @@ void WaypointStore::Load()
|
||||
|
||||
void WaypointStore::UpdatePath(uint32 id)
|
||||
{
|
||||
|
||||
|
||||
if(waypoint_map.find(id)!= waypoint_map.end())
|
||||
waypoint_map[id]->clear();
|
||||
|
||||
|
||||
QueryResult *result;
|
||||
|
||||
result = WorldDatabase.PQuery("SELECT `id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`,`delay`,`action`,`action_chance` FROM `waypoint_data` WHERE id = %u ORDER BY `point`", id);
|
||||
|
||||
|
||||
if(!result)
|
||||
return;
|
||||
|
||||
|
||||
WaypointPath* path_data;
|
||||
|
||||
|
||||
path_data = new WaypointPath;
|
||||
|
||||
|
||||
Field *fields;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
fields = result->Fetch();
|
||||
uint32 id = fields[0].GetUInt32();
|
||||
|
||||
|
||||
WaypointData *wp = new WaypointData;
|
||||
|
||||
float x,y,z;
|
||||
@@ -140,11 +140,11 @@ void WaypointStore::UpdatePath(uint32 id)
|
||||
wp->delay = fields[6].GetUInt32();
|
||||
wp->event_id = fields[7].GetUInt32();
|
||||
wp->event_chance = fields[8].GetUInt8();
|
||||
|
||||
|
||||
path_data->push_back(wp);
|
||||
|
||||
}while (result->NextRow());
|
||||
|
||||
|
||||
waypoint_map[id] = path_data;
|
||||
|
||||
delete result;
|
||||
|
||||
@@ -40,19 +40,19 @@ class WaypointStore
|
||||
{
|
||||
private :
|
||||
uint32 records;
|
||||
|
||||
|
||||
public:
|
||||
void UpdatePath(uint32 id);
|
||||
void Load();
|
||||
void Free();
|
||||
|
||||
|
||||
WaypointPath* GetPath(uint32 id)
|
||||
{
|
||||
if(waypoint_map.find(id) != waypoint_map.end())
|
||||
return waypoint_map[id];
|
||||
else return 0;
|
||||
}
|
||||
|
||||
|
||||
inline uint32 GetRecordsCount() { return records; }
|
||||
};
|
||||
|
||||
|
||||
@@ -53,14 +53,14 @@ template<>
|
||||
bool WaypointMovementGenerator<Creature>::GetDestination(float &x, float &y, float &z) const
|
||||
{
|
||||
if(i_destinationHolder.HasArrived())
|
||||
return false;
|
||||
|
||||
i_destinationHolder.GetDestination(x, y, z);
|
||||
return false;
|
||||
|
||||
i_destinationHolder.GetDestination(x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
template<>
|
||||
bool WaypointMovementGenerator<Player>::GetDestination(float &x, float &y, float &z) const
|
||||
bool WaypointMovementGenerator<Player>::GetDestination(float &x, float &y, float &z) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -80,13 +80,13 @@ void WaypointMovementGenerator<Creature>::InitTraveller(Creature &unit, const Wa
|
||||
{
|
||||
node.run ? unit.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE):
|
||||
unit.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||
|
||||
|
||||
unit.SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
|
||||
unit.SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
|
||||
|
||||
if(unit.canFly())
|
||||
unit.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2);
|
||||
|
||||
|
||||
unit.addUnitState(UNIT_STAT_ROAMING);
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
||||
|
||||
if(!path_id)
|
||||
return false;
|
||||
|
||||
|
||||
// Waypoint movement can be switched on/off
|
||||
// This is quite handy for escort quests and other stuff
|
||||
if(unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||
@@ -161,7 +161,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
||||
StopedByPlayer = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if(i_currentNode == waypoints->size() - 1) //If that's our last waypoint
|
||||
{
|
||||
if(repeating) //If the movement is repeating
|
||||
@@ -173,7 +173,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
||||
return false; //Clear the waypoint movement
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
i_currentNode++;
|
||||
|
||||
node = waypoints->at(i_currentNode);
|
||||
@@ -183,20 +183,20 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
|
||||
}
|
||||
else
|
||||
{
|
||||
//Determine waittime
|
||||
//Determine waittime
|
||||
if(node->delay)
|
||||
i_nextMoveTime.Reset(node->delay);
|
||||
|
||||
|
||||
if(node->event_id && rand()%100 < node->event_chance)
|
||||
sWorld.ScriptsStart(sWaypointScripts, node->event_id, &unit, NULL);
|
||||
|
||||
|
||||
MovementInform(unit);
|
||||
unit.UpdateWaypointID(i_currentNode);
|
||||
unit.clearUnitState(UNIT_STAT_MOVING);
|
||||
unit.Relocate(node->x, node->y, node->z);
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if(unit.IsStopped() && !i_destinationHolder.HasArrived())
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ class TRINITY_DLL_SPEC PathMovementBase
|
||||
void LoadPath(T &);
|
||||
void ReloadPath(T &);
|
||||
uint32 GetCurrentNode() const { return i_currentNode; }
|
||||
|
||||
|
||||
protected:
|
||||
uint32 i_currentNode;
|
||||
DestinationHolder< Traveller<T> > i_destinationHolder;
|
||||
@@ -66,9 +66,9 @@ class TRINITY_DLL_SPEC WaypointMovementGenerator
|
||||
: public MovementGeneratorMedium< T, WaypointMovementGenerator<T> >, public PathMovementBase<T>
|
||||
{
|
||||
public:
|
||||
WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) :
|
||||
WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) :
|
||||
i_nextMoveTime(0), path_id(_path_id), repeating(_repeating), StopedByPlayer(false), node(NULL) {}
|
||||
|
||||
|
||||
void Initialize(T &);
|
||||
void Finalize(T &);
|
||||
void MovementInform(T &);
|
||||
|
||||
+15
-15
@@ -403,7 +403,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
sLog.outError("World settings reload fail: can't read settings from %s.",sConfig.GetFilename().c_str());
|
||||
return;
|
||||
}
|
||||
//TODO Check if config is outdated
|
||||
//TODO Check if config is outdated
|
||||
}
|
||||
|
||||
///- Read the player limit and the Message of the day from the config file
|
||||
@@ -1440,7 +1440,7 @@ void World::SetInitialWorldSettings()
|
||||
//Not sure if this can be moved up in the sequence (with static data loading) as it uses MapManager
|
||||
sLog.outString( "Loading Transports..." );
|
||||
MapManager::Instance().LoadTransports();
|
||||
|
||||
|
||||
sLog.outString( "Loading Transports Events..." );
|
||||
objmgr.LoadTransportEvents();
|
||||
|
||||
@@ -1835,7 +1835,7 @@ void World::ScriptsProcess()
|
||||
for (MapManager::TransportSet::iterator iter = MapManager::Instance().m_Transports.begin(); iter != MapManager::Instance().m_Transports.end(); ++iter)
|
||||
{
|
||||
if((*iter)->GetGUID() == step.sourceGUID)
|
||||
{
|
||||
{
|
||||
source = reinterpret_cast<Object*>(*iter);
|
||||
break;
|
||||
}
|
||||
@@ -2385,7 +2385,7 @@ void World::ScriptsProcess()
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case SCRIPT_COMMAND_LOAD_PATH:
|
||||
{
|
||||
if(!source)
|
||||
@@ -2398,18 +2398,18 @@ void World::ScriptsProcess()
|
||||
{
|
||||
sLog.outError("SCRIPT_COMMAND_START_MOVE source mover isn't unit (TypeId: %u), skipping.",source->GetTypeId());
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!WaypointMgr.GetPath(step.script->datalong))
|
||||
{
|
||||
sLog.outError("SCRIPT_COMMAND_START_MOVE source mover has an invallid path, skipping.", step.script->datalong2);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
dynamic_cast<Unit*>(source)->GetMotionMaster()->MovePath(step.script->datalong, step.script->datalong2);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT:
|
||||
{
|
||||
if(!step.script->datalong || !step.script->datalong2)
|
||||
@@ -2419,17 +2419,17 @@ void World::ScriptsProcess()
|
||||
}
|
||||
//our target
|
||||
Creature* target = NULL;
|
||||
|
||||
|
||||
if(source) //using grid searcher
|
||||
{
|
||||
CellPair p(Trinity::ComputeCellPair(((Unit*)source)->GetPositionX(), ((Unit*)source)->GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
|
||||
|
||||
//sLog.outDebug("Attempting to find Creature: Db GUID: %i", step.script->datalong);
|
||||
Trinity::CreatureWithDbGUIDCheck target_check(((Unit*)source), step.script->datalong);
|
||||
Trinity::CreatureSearcher<Trinity::CreatureWithDbGUIDCheck> checker(((Unit*)source), target, target_check);
|
||||
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureSearcher <Trinity::CreatureWithDbGUIDCheck>, GridTypeMapContainer > unit_checker(checker);
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, unit_checker, *(((Unit*)source)->GetMap()));
|
||||
@@ -2469,19 +2469,19 @@ void World::ScriptsProcess()
|
||||
sLog.outError("SCRIPT_COMMAND_CALLSCRIPT ERROR: no scriptmap present... ignoring");
|
||||
break;
|
||||
}
|
||||
//if no scriptmap present...
|
||||
//if no scriptmap present...
|
||||
if(!datamap)
|
||||
break;
|
||||
|
||||
|
||||
uint32 script_id = step.script->datalong2;
|
||||
//delete iter and return it to begin pos(next one)
|
||||
m_scriptSchedule.erase(iter);
|
||||
iter = m_scriptSchedule.begin();
|
||||
|
||||
|
||||
ScriptsStart(*datamap, script_id, target, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
case SCRIPT_COMMAND_PLAYSOUND:
|
||||
{
|
||||
if(!source)
|
||||
|
||||
@@ -292,7 +292,7 @@ class TRINITY_DLL_SPEC WorldSession
|
||||
void HandleGMTicketDeleteOpcode(WorldPacket& recvPacket);
|
||||
void HandleGMTicketGetTicketOpcode(WorldPacket& recvPacket);
|
||||
void HandleGMTicketSystemStatusOpcode(WorldPacket& recvPacket);
|
||||
|
||||
|
||||
//void HandleGMSurveySubmit(WorldPacket& recvPacket);
|
||||
|
||||
void HandleTogglePvP(WorldPacket& recvPacket);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
|
||||
+11
-11
@@ -36,7 +36,7 @@ class ReactorRunnable;
|
||||
class ACE_Event_Handler;
|
||||
|
||||
/// Manages all sockets connected to peers and network threads
|
||||
class WorldSocketMgr
|
||||
class WorldSocketMgr
|
||||
{
|
||||
public:
|
||||
friend class WorldSocket;
|
||||
@@ -44,32 +44,32 @@ public:
|
||||
|
||||
/// Start network, listen at address:port .
|
||||
int StartNetwork (ACE_UINT16 port, const char* address);
|
||||
|
||||
|
||||
/// Stops all network threads, It will wait for all running threads .
|
||||
void StopNetwork ();
|
||||
|
||||
|
||||
/// Wait untill all network threads have "joined" .
|
||||
void Wait ();
|
||||
|
||||
|
||||
/// Make this class singleton .
|
||||
static WorldSocketMgr* Instance ();
|
||||
|
||||
|
||||
private:
|
||||
int OnSocketOpen(WorldSocket* sock);
|
||||
|
||||
|
||||
int StartReactiveIO(ACE_UINT16 port, const char* address);
|
||||
|
||||
private:
|
||||
|
||||
private:
|
||||
WorldSocketMgr ();
|
||||
virtual ~WorldSocketMgr ();
|
||||
|
||||
|
||||
ReactorRunnable* m_NetThreads;
|
||||
size_t m_NetThreadsCount;
|
||||
|
||||
|
||||
int m_SockOutKBuff;
|
||||
int m_SockOutUBuff;
|
||||
bool m_UseNoDelay;
|
||||
|
||||
|
||||
ACE_Event_Handler* m_Acceptor;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user