Replace tabs with spaces, and fix crlf issues
--HG-- branch : trunk
This commit is contained in:
@@ -99,7 +99,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);
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ SET(game_STAT_SRCS
|
||||
Creature.h
|
||||
CreatureGroups.cpp
|
||||
CreatureGroups.h
|
||||
debugcmds.cpp
|
||||
Debugcmds.cpp
|
||||
DestinationHolder.cpp
|
||||
DestinationHolder.h
|
||||
DestinationHolderImp.h
|
||||
@@ -221,7 +221,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
@@ -144,7 +144,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 }
|
||||
};
|
||||
|
||||
@@ -534,11 +534,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 },
|
||||
@@ -553,7 +553,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 },
|
||||
@@ -622,10 +622,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
-4
@@ -73,7 +73,7 @@ class ChatHandler
|
||||
int ParseCommands(const char* text);
|
||||
|
||||
virtual char const* GetName() const;
|
||||
|
||||
|
||||
protected:
|
||||
explicit ChatHandler() : m_session(NULL) {} // for CLI subclass
|
||||
|
||||
@@ -410,7 +410,7 @@ class ChatHandler
|
||||
|
||||
bool HandleResetAllCommand(const char * args);
|
||||
|
||||
|
||||
|
||||
// GM ticket command handlers
|
||||
bool HandleGMTicketListCommand(const char* args);
|
||||
bool HandleGMTicketListOnlineCommand(const char* args);
|
||||
@@ -433,7 +433,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);
|
||||
@@ -511,7 +511,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);
|
||||
|
||||
@@ -198,10 +198,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);
|
||||
}
|
||||
}
|
||||
@@ -417,7 +417,7 @@ void Creature::Update(uint32 diff)
|
||||
|
||||
CreatureInfo const *cinfo = GetCreatureInfo();
|
||||
SelectLevel(cinfo);
|
||||
|
||||
|
||||
if (m_isDeadByDefault)
|
||||
{
|
||||
setDeathState(JUST_DIED);
|
||||
@@ -1424,7 +1424,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
-3
@@ -621,10 +621,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;}
|
||||
|
||||
@@ -687,7 +687,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-2008 MaNGOS <http://www.mangosproject.org/>
|
||||
*
|
||||
* Copyright (C) 2008 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-2008 MaNGOS <http://www.mangosproject.org/>
|
||||
*
|
||||
* Copyright (C) 2008 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;
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ void GameEvent::LoadFromDB()
|
||||
delete result;
|
||||
|
||||
// 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;
|
||||
@@ -621,7 +621,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;
|
||||
@@ -666,7 +666,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;
|
||||
@@ -1385,7 +1385,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
|
||||
@@ -1410,7 +1410,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
|
||||
|
||||
@@ -504,7 +504,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask)
|
||||
|
||||
if (!goI)
|
||||
return;
|
||||
|
||||
|
||||
if (!m_DBTableGuid)
|
||||
m_DBTableGuid = GetGUIDLow();
|
||||
// update in loaded data (changing data only in this place)
|
||||
@@ -1209,7 +1209,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
Player* player = (Player*)user;
|
||||
|
||||
if( player->isAllowUseBattleGroundObject() )
|
||||
if( player->isAllowUseBattleGroundObject() )
|
||||
{
|
||||
// in battleground check
|
||||
BattleGround *bg = player->GetBattleGround();
|
||||
|
||||
@@ -149,7 +149,7 @@ VisibleNotifier::Notify()
|
||||
i_player.SendAuraDurationsForTarget((Unit*)(*vItr));
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
Deliverer::Visit(PlayerMapType &m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
@@ -169,7 +169,7 @@ Deliverer::Visit(PlayerMapType &m)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
Deliverer::Visit(CreatureMapType &m)
|
||||
{
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
|
||||
@@ -105,7 +105,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) {}
|
||||
@@ -595,7 +595,7 @@ namespace Trinity
|
||||
Unit const* i_funit;
|
||||
float i_range;
|
||||
};
|
||||
|
||||
|
||||
class CreatureWithDbGUIDCheck
|
||||
{
|
||||
public:
|
||||
@@ -714,7 +714,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);
|
||||
@@ -890,7 +890,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;
|
||||
|
||||
+16
-16
@@ -84,10 +84,10 @@ bool Group::Create(const uint64 &guid, const char * name)
|
||||
m_leaderName = name;
|
||||
|
||||
m_groupType = isBGGroup() ? GROUPTYPE_RAID : GROUPTYPE_NORMAL;
|
||||
|
||||
|
||||
if (m_groupType == GROUPTYPE_RAID)
|
||||
_initRaidSubGroupsCounter();
|
||||
|
||||
|
||||
m_lootMethod = GROUP_LOOT;
|
||||
m_lootThreshold = ITEM_QUALITY_UNCOMMON;
|
||||
m_looterGuid = guid;
|
||||
@@ -143,10 +143,10 @@ bool Group::LoadGroupFromDB(const uint64 &leaderGuid, QueryResult *result, bool
|
||||
}
|
||||
|
||||
m_groupType = (*result)[13].GetBool() ? GROUPTYPE_RAID : GROUPTYPE_NORMAL;
|
||||
|
||||
|
||||
if (m_groupType == GROUPTYPE_RAID)
|
||||
_initRaidSubGroupsCounter();
|
||||
|
||||
|
||||
m_difficulty = (*result)[14].GetUInt8();
|
||||
m_mainTank = (*result)[0].GetUInt64();
|
||||
m_mainAssistant = (*result)[1].GetUInt64();
|
||||
@@ -189,18 +189,18 @@ bool Group::LoadMemberFromDB(uint32 guidLow, uint8 subgroup, bool assistant)
|
||||
member.group = subgroup;
|
||||
member.assistant = assistant;
|
||||
m_memberSlots.push_back(member);
|
||||
|
||||
|
||||
SubGroupCounterIncrease(subgroup);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Group::ConvertToRaid()
|
||||
{
|
||||
m_groupType = GROUPTYPE_RAID;
|
||||
|
||||
|
||||
_initRaidSubGroupsCounter();
|
||||
|
||||
|
||||
if(!isBGGroup()) CharacterDatabase.PExecute("UPDATE groups SET isRaid = 1 WHERE leaderGuid='%u'", GUID_LOPART(m_leaderGuid));
|
||||
SendUpdate();
|
||||
}
|
||||
@@ -1006,7 +1006,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant, u
|
||||
member.group = group;
|
||||
member.assistant = isAssistant;
|
||||
m_memberSlots.push_back(member);
|
||||
|
||||
|
||||
SubGroupCounterIncrease(group);
|
||||
|
||||
if(player)
|
||||
@@ -1149,11 +1149,11 @@ bool Group::_setMembersGroup(const uint64 &guid, const uint8 &group)
|
||||
return false;
|
||||
|
||||
slot->group = group;
|
||||
|
||||
|
||||
SubGroupCounterIncrease(group);
|
||||
|
||||
|
||||
if(!isBGGroup()) CharacterDatabase.PExecute("UPDATE group_member SET subgroup='%u' WHERE memberGuid='%u'", group, GUID_LOPART(guid));
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1211,9 +1211,9 @@ void Group::ChangeMembersGroup(const uint64 &guid, const uint8 &group)
|
||||
{
|
||||
uint8 prevSubGroup;
|
||||
prevSubGroup = GetMemberGroup(guid);
|
||||
|
||||
|
||||
SubGroupCounterDecrease(prevSubGroup);
|
||||
|
||||
|
||||
if(_setMembersGroup(guid, group))
|
||||
SendUpdate();
|
||||
}
|
||||
@@ -1230,9 +1230,9 @@ void Group::ChangeMembersGroup(Player *player, const uint8 &group)
|
||||
{
|
||||
uint8 prevSubGroup;
|
||||
prevSubGroup = player->GetSubGroup();
|
||||
|
||||
|
||||
SubGroupCounterDecrease(prevSubGroup);
|
||||
|
||||
|
||||
player->GetGroupRef().setSubGroup(group);
|
||||
SendUpdate();
|
||||
}
|
||||
|
||||
+6
-6
@@ -224,7 +224,7 @@ class TRINITY_DLL_SPEC Group
|
||||
|
||||
return (mslot1->group==slot2->group);
|
||||
}
|
||||
|
||||
|
||||
bool HasFreeSlotSubGroup(uint8 subgroup) const
|
||||
{
|
||||
return (m_subGroupsCounts && m_subGroupsCounts[subgroup] < MAXGROUPSIZE);
|
||||
@@ -347,15 +347,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];
|
||||
}
|
||||
@@ -379,13 +379,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)
|
||||
|
||||
@@ -549,7 +549,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);
|
||||
|
||||
+6
-6
@@ -270,7 +270,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,
|
||||
@@ -757,15 +757,15 @@ enum TrinityStrings
|
||||
LANG_MUST_MALE_OR_FEMALE = 1119,
|
||||
LANG_YOU_CHANGE_GENDER = 1120,
|
||||
LANG_YOUR_GENDER_CHANGED = 1121,
|
||||
|
||||
|
||||
// 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,
|
||||
@@ -798,7 +798,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
@@ -136,7 +136,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;
|
||||
}
|
||||
@@ -306,7 +306,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);
|
||||
@@ -328,7 +328,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);
|
||||
@@ -347,7 +347,7 @@ bool ChatHandler::HandleGMTicketGetByIdCommand(const char* args)
|
||||
{
|
||||
if(!*args)
|
||||
return false;
|
||||
|
||||
|
||||
uint64 tguid = atoi(args);
|
||||
GM_Ticket *ticket = ticketmgr.GetGMTicket(tguid);
|
||||
if(!ticket)
|
||||
@@ -355,7 +355,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);
|
||||
@@ -378,14 +378,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);
|
||||
@@ -408,7 +408,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)
|
||||
@@ -484,7 +484,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;
|
||||
@@ -517,13 +517,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());
|
||||
@@ -577,7 +577,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;
|
||||
@@ -594,7 +594,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());
|
||||
|
||||
+111
-111
@@ -1685,7 +1685,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)
|
||||
{
|
||||
@@ -1696,14 +1696,14 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(player==m_session->GetPlayer())
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_KICKSELF);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
|
||||
{
|
||||
|
||||
@@ -1741,19 +1741,19 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(m_session && player->GetSession()->GetSecurity() > m_session->GetSecurity())
|
||||
{
|
||||
SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); //maybe replacement string for this later on
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(sWorld.KickPlayer(name.c_str()))
|
||||
{
|
||||
if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
|
||||
{
|
||||
|
||||
|
||||
sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, name.c_str(), kicker.c_str(), reason.c_str());
|
||||
}
|
||||
else
|
||||
@@ -1850,7 +1850,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||
Field *fields = result->Fetch();
|
||||
total_player_time = fields[0].GetUInt32();
|
||||
delete result;
|
||||
|
||||
|
||||
Tokens data;
|
||||
if (!Player::LoadValuesArrayFromDB(data,targetGUID))
|
||||
{
|
||||
@@ -1858,7 +1858,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
money = Player::GetUInt32ValueFromArray(data, PLAYER_FIELD_COINAGE);
|
||||
level = Player::GetUInt32ValueFromArray(data, UNIT_FIELD_LEVEL);
|
||||
accId = objmgr.GetPlayerAccountIdByGUID(targetGUID);
|
||||
@@ -1875,7 +1875,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||
Field* fields = result->Fetch();
|
||||
username = fields[0].GetCppString();
|
||||
security = fields[1].GetUInt32();
|
||||
|
||||
|
||||
if(!m_session || m_session->GetSecurity() >= security)
|
||||
{
|
||||
last_ip = fields[2].GetCppString();
|
||||
@@ -2022,21 +2022,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.");
|
||||
@@ -2044,27 +2044,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();
|
||||
|
||||
@@ -2072,7 +2072,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
|
||||
|
||||
@@ -2080,29 +2080,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?");
|
||||
@@ -2111,16 +2111,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);
|
||||
@@ -2128,15 +2128,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -2146,7 +2146,7 @@ if(!*args)
|
||||
return false;
|
||||
|
||||
uint32 id = atoi(args);
|
||||
|
||||
|
||||
if(!id)
|
||||
return false;
|
||||
|
||||
@@ -2193,25 +2193,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);
|
||||
@@ -2229,38 +2229,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
|
||||
{
|
||||
@@ -2275,21 +2275,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 )
|
||||
{
|
||||
|
||||
@@ -2299,21 +2299,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)
|
||||
@@ -2323,15 +2323,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")
|
||||
@@ -2342,7 +2342,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;}
|
||||
@@ -2350,13 +2350,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);
|
||||
@@ -2370,31 +2370,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")
|
||||
@@ -2456,7 +2456,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;
|
||||
@@ -2477,7 +2477,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'");
|
||||
@@ -2515,7 +2515,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
|
||||
@@ -2531,7 +2531,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));
|
||||
@@ -2616,7 +2616,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;
|
||||
@@ -2639,7 +2639,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();
|
||||
|
||||
@@ -2684,14 +2684,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 )
|
||||
|
||||
@@ -2703,16 +2703,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();
|
||||
@@ -2738,19 +2738,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;
|
||||
@@ -2774,9 +2774,9 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
}
|
||||
|
||||
}while( result2->NextRow() );
|
||||
|
||||
|
||||
delete result2;
|
||||
|
||||
|
||||
if( hasError )
|
||||
{
|
||||
PSendSysMessage(LANG_WAYPOINT_TOOFAR1);
|
||||
@@ -2807,9 +2807,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());
|
||||
@@ -2825,7 +2825,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()));
|
||||
wpCreature->LoadFromDB(wpCreature->GetDBTableGUIDLow(),map);
|
||||
map->Add(wpCreature);
|
||||
|
||||
|
||||
if(target)
|
||||
{
|
||||
wpCreature->SetDisplayId(target->GetDisplayId());
|
||||
@@ -2880,17 +2880,17 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
delete result;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()));
|
||||
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;
|
||||
@@ -2945,17 +2945,17 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
delete result;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()));
|
||||
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;
|
||||
@@ -3241,7 +3241,7 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
|
||||
if (Utf8FitTo(descr, wnamepart))
|
||||
{
|
||||
char const* active = activeEvents.find(id) != activeEvents.end() ? GetTrinityString(LANG_ACTIVE) : "";
|
||||
|
||||
|
||||
if(m_session)
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT,id,id,eventData.description.c_str(),active );
|
||||
else
|
||||
@@ -3575,7 +3575,7 @@ bool ChatHandler::HandleLearnAllRecipesCommand(const char* args)
|
||||
|
||||
bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
|
||||
{
|
||||
|
||||
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
@@ -3611,7 +3611,7 @@ bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args)
|
||||
|
||||
bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args)
|
||||
{
|
||||
|
||||
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
@@ -3641,7 +3641,7 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult* result, int32 limit)
|
||||
Field* fields = result->Fetch();
|
||||
uint32 acc_id = fields[0].GetUInt32();
|
||||
std::string acc_name = fields[1].GetCppString();
|
||||
|
||||
|
||||
QueryResult* chars = CharacterDatabase.PQuery("SELECT guid,name FROM characters WHERE account = '%u'", acc_id);
|
||||
if(chars)
|
||||
{
|
||||
@@ -3757,7 +3757,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);
|
||||
@@ -4041,11 +4041,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
@@ -929,7 +929,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.");
|
||||
|
||||
@@ -1136,7 +1136,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
|
||||
@@ -1144,7 +1144,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(const char* args)
|
||||
// Check for second parameter
|
||||
if(!arg2)
|
||||
return false;
|
||||
|
||||
|
||||
// Check for account
|
||||
targetAccountName = arg1;
|
||||
if(!AccountMgr::normilizeString(targetAccountName))
|
||||
@@ -1153,7 +1153,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) )
|
||||
@@ -1162,7 +1162,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;
|
||||
@@ -7075,7 +7075,7 @@ bool ChatHandler::HandleFreezeCommand(const char *args)
|
||||
{
|
||||
player = getSelectedPlayer();
|
||||
if (player) //prevent crash with creature as target
|
||||
{
|
||||
{
|
||||
name = player->GetName();
|
||||
normalizePlayerName(name);
|
||||
}
|
||||
@@ -7136,7 +7136,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);
|
||||
@@ -7160,7 +7160,7 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args)
|
||||
{
|
||||
player = getSelectedPlayer();
|
||||
if (player) //prevent crash with creature as target
|
||||
{
|
||||
{
|
||||
name = player->GetName();
|
||||
}
|
||||
}
|
||||
@@ -7192,7 +7192,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)
|
||||
@@ -7311,7 +7311,7 @@ bool ChatHandler::HandleBindSightCommand(const char* args)
|
||||
Unit* pUnit = getSelectedUnit();
|
||||
if (!pUnit)
|
||||
return false;
|
||||
|
||||
|
||||
if (m_session->GetPlayer()->isPossessing())
|
||||
return false;
|
||||
|
||||
@@ -7324,7 +7324,7 @@ bool ChatHandler::HandleUnbindSightCommand(const char* args)
|
||||
{
|
||||
if (m_session->GetPlayer()->isPossessing())
|
||||
return false;
|
||||
|
||||
|
||||
m_session->GetPlayer()->RemoveFarsightTarget();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,8 @@ $(srcdir)/ArenaTeam.cpp \
|
||||
$(srcdir)/ArenaTeam.h \
|
||||
$(srcdir)/ArenaTeamHandler.cpp \
|
||||
$(srcdir)/AuctionHouse.cpp \
|
||||
$(srcdir)/AuctionHouseBot.cpp \
|
||||
$(srcdir)/AuctionHouseBot.h \
|
||||
$(srcdir)/AuctionHouseObject.h \
|
||||
$(srcdir)/Bag.cpp \
|
||||
$(srcdir)/Bag.h \
|
||||
@@ -100,7 +102,7 @@ $(srcdir)/CreatureGroups.cpp \
|
||||
$(srcdir)/CreatureGroups.h \
|
||||
$(srcdir)/Creature.cpp \
|
||||
$(srcdir)/Creature.h \
|
||||
$(srcdir)/debugcmds.cpp \
|
||||
$(srcdir)/Debugcmds.cpp \
|
||||
$(srcdir)/DestinationHolder.cpp \
|
||||
$(srcdir)/DestinationHolder.h \
|
||||
$(srcdir)/DestinationHolderImp.h \
|
||||
@@ -256,7 +258,7 @@ $(srcdir)/TemporarySummon.h \
|
||||
$(srcdir)/TicketHandler.cpp \
|
||||
$(srcdir)/TicketMgr.cpp \
|
||||
$(srcdir)/TicketMgr.h \
|
||||
$(srcdir)/tools.cpp \
|
||||
$(srcdir)/Tools.cpp \
|
||||
$(srcdir)/Tools.h \
|
||||
$(srcdir)/TotemAI.cpp \
|
||||
$(srcdir)/TotemAI.h \
|
||||
|
||||
+6
-6
@@ -134,13 +134,13 @@ class TRINITY_DLL_SPEC Map : public GridRefManager<NGridType>, public Trinity::O
|
||||
|
||||
// currently unused for normal maps
|
||||
bool CanUnload(uint32 diff)
|
||||
{
|
||||
if(!m_unloadTimer)
|
||||
{
|
||||
if(!m_unloadTimer)
|
||||
return false;
|
||||
if(m_unloadTimer <= diff)
|
||||
return true;
|
||||
m_unloadTimer -= diff;
|
||||
return false;
|
||||
if(m_unloadTimer <= diff)
|
||||
return true;
|
||||
m_unloadTimer -= diff;
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool Add(Player *);
|
||||
|
||||
@@ -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" );
|
||||
}
|
||||
|
||||
|
||||
@@ -365,7 +365,7 @@ void WorldSession::HandlePossessedMovement(WorldPacket& recv_data, MovementInfo&
|
||||
if (pos_unit->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Player* plr = (Player*)pos_unit;
|
||||
|
||||
|
||||
if (recv_data.GetOpcode() == MSG_MOVE_FALL_LAND)
|
||||
plr->HandleFallDamage(movementInfo);
|
||||
|
||||
@@ -374,7 +374,7 @@ void WorldSession::HandlePossessedMovement(WorldPacket& recv_data, MovementInfo&
|
||||
// Now client not include swimming flag in case jumping under water
|
||||
plr->SetInWater( !plr->IsInWater() || plr->GetBaseMap()->IsUnderWater(movementInfo.x, movementInfo.y, movementInfo.z) );
|
||||
}
|
||||
|
||||
|
||||
plr->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o, false);
|
||||
plr->m_movementInfo = movementInfo;
|
||||
|
||||
@@ -386,7 +386,7 @@ void WorldSession::HandlePossessedMovement(WorldPacket& recv_data, MovementInfo&
|
||||
GetPlayer()->RemovePossess(false);
|
||||
plr->HandleFallUnderMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
else // Possessed unit is a creature
|
||||
{
|
||||
Map* map = MapManager::Instance().GetMap(pos_unit->GetMapId(), pos_unit);
|
||||
|
||||
+2
-2
@@ -1356,7 +1356,7 @@ namespace Trinity
|
||||
{
|
||||
public:
|
||||
MessageChatLocaleCacheDo(WorldObject const& obj, ChatMsg msgtype, int32 textId, uint32 language, uint64 targetGUID, float dist)
|
||||
: i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(language),
|
||||
: i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(language),
|
||||
i_targetGUID(targetGUID), i_dist(dist)
|
||||
{
|
||||
}
|
||||
@@ -1669,7 +1669,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);
|
||||
|
||||
@@ -222,7 +222,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;
|
||||
}
|
||||
@@ -1020,7 +1020,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;
|
||||
}
|
||||
@@ -7555,7 +7555,7 @@ ObjectMgr::ScriptNameMap & GetScriptNames()
|
||||
|
||||
void ObjectMgr::LoadTransportEvents()
|
||||
{
|
||||
|
||||
|
||||
QueryResult *result = WorldDatabase.Query("SELECT entry, waypoint_id, event_id FROM transport_events");
|
||||
|
||||
if( !result )
|
||||
@@ -7571,19 +7571,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-2008 MaNGOS <http://www.mangosproject.org/>
|
||||
*
|
||||
* Copyright (C) 2008 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); }
|
||||
|
||||
@@ -537,7 +537,7 @@ class ObjectMgr
|
||||
void LoadEventScripts();
|
||||
void LoadSpellScripts();
|
||||
void LoadWaypointScripts();
|
||||
|
||||
|
||||
void LoadTransportEvents();
|
||||
|
||||
bool LoadTrinityStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value);
|
||||
@@ -594,7 +594,7 @@ class ObjectMgr
|
||||
void LoadNpcTextId();
|
||||
void LoadVendors();
|
||||
void LoadTrainerSpell();
|
||||
|
||||
|
||||
std::string GeneratePetName(uint32 entry);
|
||||
uint32 GetBaseXP(uint32 level);
|
||||
|
||||
@@ -614,7 +614,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 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 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008 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 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 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008 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->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->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 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008 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 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
+2
-2
@@ -288,7 +288,7 @@ bool Pet::LoadPetFromDB( Unit* owner, uint32 petentry, uint32 petnumber, bool cu
|
||||
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_CAST;
|
||||
}
|
||||
@@ -1717,7 +1717,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((uint16)spellid);
|
||||
|
||||
|
||||
+10
-11
@@ -268,7 +268,7 @@ Player::Player (WorldSession *session): Unit()
|
||||
m_divider = 0;
|
||||
|
||||
m_ExtraFlags = 0;
|
||||
|
||||
|
||||
// players always accept
|
||||
if(GetSession()->GetSecurity() == SEC_PLAYER)
|
||||
SetAcceptWhispers(true);
|
||||
@@ -1580,13 +1580,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())
|
||||
@@ -6198,7 +6198,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor, bool pvpt
|
||||
{
|
||||
// Check if allowed to receive it in current map
|
||||
uint8 MapType = sWorld.getConfig(CONFIG_PVP_TOKEN_MAP_TYPE);
|
||||
if( (MapType == 1 && !InBattleGround() && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP))
|
||||
if( (MapType == 1 && !InBattleGround() && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP))
|
||||
|| (MapType == 2 && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_FFA_PVP))
|
||||
|| (MapType == 3 && !InBattleGround()) )
|
||||
return true;
|
||||
@@ -7988,7 +7988,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
|
||||
}
|
||||
}
|
||||
@@ -8081,7 +8081,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
|
||||
@@ -8097,7 +8097,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
|
||||
@@ -15478,7 +15478,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
|
||||
@@ -19072,13 +19072,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);
|
||||
@@ -19219,4 +19219,3 @@ void Player::UpdateCharmedAI()
|
||||
Attack(target, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2036,7 +2036,7 @@ class TRINITY_DLL_SPEC Player : public Unit
|
||||
uint32 GetOldPetSpell() const { return m_oldpetspell; }
|
||||
void SetOldPetSpell(uint32 petspell) { m_oldpetspell = petspell; }
|
||||
|
||||
|
||||
|
||||
/*********************************************************/
|
||||
/*** INSTANCE SYSTEM ***/
|
||||
/*********************************************************/
|
||||
|
||||
@@ -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 &);
|
||||
|
||||
@@ -811,7 +811,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,
|
||||
@@ -874,7 +874,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,
|
||||
|
||||
+14
-14
@@ -1123,7 +1123,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),true) ||
|
||||
unit->IsImmunedToSpell(m_spellInfo,true) ))
|
||||
@@ -1231,7 +1231,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);
|
||||
}*/
|
||||
}
|
||||
@@ -1389,7 +1389,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;
|
||||
@@ -1399,7 +1399,7 @@ void Spell::SearchChainTarget(std::list<Unit*> &TagUnitMap, float max_range, uin
|
||||
}
|
||||
|
||||
cur = *next;
|
||||
tempUnitMap.erase(next);
|
||||
tempUnitMap.erase(next);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1437,7 +1437,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
|
||||
@@ -1992,7 +1992,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;
|
||||
}
|
||||
|
||||
@@ -2017,7 +2017,7 @@ void Spell::prepare(SpellCastTargets * targets, Aura* triggeredByAura)
|
||||
m_castItemGUID = m_CastItem->GetGUID();
|
||||
else
|
||||
m_castItemGUID = 0;
|
||||
|
||||
|
||||
m_targets = *targets;
|
||||
|
||||
m_spellState = SPELL_STATE_PREPARING;
|
||||
@@ -2092,7 +2092,7 @@ void Spell::prepare(SpellCastTargets * 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);
|
||||
@@ -2147,14 +2147,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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3462,7 +3462,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)
|
||||
&& (m_spellInfo->SpellFamilyName != SPELLFAMILY_DRUID || m_spellInfo->SpellFamilyFlags != 0x0000000000020000LL))
|
||||
{
|
||||
SendInterrupted(2);
|
||||
@@ -5423,7 +5423,7 @@ int32 Spell::CalculateDamageDone(Unit *unit, const uint32 effectMask, float *mul
|
||||
m_damage *= m_damageMultipliers[i];
|
||||
m_damageMultipliers[i] *= multiplier[i];
|
||||
}
|
||||
|
||||
|
||||
damageDone += m_damage;
|
||||
}
|
||||
}
|
||||
|
||||
+11
-11
@@ -344,7 +344,7 @@ m_periodicTimer(0), m_PeriodicEventId(0), m_AuraDRGroup(DIMINISHING_NONE)
|
||||
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);
|
||||
@@ -616,7 +616,7 @@ void AreaAura::Update(uint32 diff)
|
||||
switch(m_areaAuraType)
|
||||
{
|
||||
case AREA_AURA_PARTY:
|
||||
caster->GetPartyMember(targets, m_radius);
|
||||
caster->GetPartyMember(targets, m_radius);
|
||||
break;
|
||||
case AREA_AURA_FRIEND:
|
||||
{
|
||||
@@ -878,7 +878,7 @@ void Aura::_AddAura()
|
||||
SetAuraFlag(slot, true);
|
||||
SetAuraLevel(slot,caster ? caster->getLevel() : sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
|
||||
UpdateAuraCharges();
|
||||
|
||||
|
||||
// update for out of range group members
|
||||
m_target->UpdateAuraForGroup(slot);
|
||||
}
|
||||
@@ -887,7 +887,7 @@ void Aura::_AddAura()
|
||||
{
|
||||
SetAuraSlot( slot );
|
||||
}
|
||||
|
||||
|
||||
UpdateSlotCounterAndDuration();
|
||||
|
||||
// Update Seals information
|
||||
@@ -1270,7 +1270,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)
|
||||
{
|
||||
@@ -1578,7 +1578,7 @@ void Aura::TriggerSpell()
|
||||
(*i)->ApplyModifier(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}break;
|
||||
// // Dementia
|
||||
// case 41404: break;
|
||||
@@ -2180,7 +2180,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
|
||||
if (totem && totem->isTotem())
|
||||
totem->AddPlayerToVision((Player*)caster);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
((Player*)caster)->RemoveFarsightTarget();
|
||||
return;
|
||||
@@ -2909,7 +2909,7 @@ void Aura::HandleModCharm(bool apply, bool Real)
|
||||
{
|
||||
if(int32(m_target->getLevel()) > m_modifier.m_amount)
|
||||
return;
|
||||
|
||||
|
||||
m_target->SetCharmedOrPossessedBy(caster, false);
|
||||
}
|
||||
else
|
||||
@@ -3606,7 +3606,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)
|
||||
@@ -5288,7 +5288,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)
|
||||
{
|
||||
@@ -5299,7 +5299,7 @@ void Aura::PeriodicTick()
|
||||
(*i)->ApplyModifier(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
m_modifier.m_amount += 100;
|
||||
}break;
|
||||
default:
|
||||
|
||||
@@ -630,7 +630,7 @@ void Spell::EffectDummy(uint32 i)
|
||||
if (!creatureTarget || !pGameObj) return;
|
||||
|
||||
if (!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 181574, creatureTarget->GetMap(),
|
||||
creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(),
|
||||
creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(),
|
||||
creatureTarget->GetOrientation(), 0, 0, 0, 0, 100, 1))
|
||||
{
|
||||
delete pGameObj;
|
||||
@@ -955,7 +955,7 @@ void Spell::EffectDummy(uint32 i)
|
||||
{
|
||||
Aura * dummy = m_caster->GetDummyAura(28734);
|
||||
if (dummy)
|
||||
{
|
||||
{
|
||||
int32 bp = damage * dummy->GetStackAmount();
|
||||
m_caster->CastCustomSpell(m_caster, 28733, &bp, NULL, NULL, true);
|
||||
m_caster->RemoveAurasDueToSpell(28734);
|
||||
@@ -3517,7 +3517,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);
|
||||
@@ -3600,7 +3600,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);
|
||||
@@ -4437,7 +4437,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
|
||||
@@ -4835,7 +4835,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
||||
{
|
||||
if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE);
|
||||
unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE);
|
||||
break;
|
||||
}
|
||||
// Netherbloom
|
||||
@@ -4962,7 +4962,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
||||
int bag=19;
|
||||
int slot=0;
|
||||
Item* item = NULL;
|
||||
|
||||
|
||||
while (bag < 256)
|
||||
{
|
||||
item = ((Player*)m_caster)->GetItemByPos(bag,slot);
|
||||
|
||||
@@ -383,7 +383,7 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// channeled spell case (it currently casted then)
|
||||
if(IsChanneledSpell(spellInfo))
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -267,17 +267,17 @@ HostilReference* ThreatContainer::selectNextVictim(Creature* pAttacker, HostilRe
|
||||
{
|
||||
HostilReference* currentRef = NULL;
|
||||
bool found = false;
|
||||
|
||||
|
||||
std::list<HostilReference*>::iterator lastRef = iThreatList.end();
|
||||
lastRef--;
|
||||
|
||||
|
||||
for(std::list<HostilReference*>::iterator iter = iThreatList.begin(); iter != iThreatList.end() && !found; ++iter)
|
||||
{
|
||||
currentRef = (*iter);
|
||||
|
||||
Unit* target = currentRef->getTarget();
|
||||
assert(target); // if the ref has status online the target must be there !
|
||||
|
||||
|
||||
// some units are preferred in comparison to others
|
||||
if(iter != lastRef && (target->IsImmunedToDamage(pAttacker->GetMeleeDamageSchoolMask(), false) ||
|
||||
target->hasUnitState(UNIT_STAT_CONFUSED)
|
||||
|
||||
+13
-13
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2008 MaNGOS
|
||||
* Copyright (C) 2005-2008 MaNGOS
|
||||
*
|
||||
* Copyright (C) 2008 Trinity
|
||||
* Copyright (C) 2008 Trinity
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2008 MaNGOS
|
||||
* Copyright (C) 2005-2008 MaNGOS
|
||||
*
|
||||
* Copyright (C) 2008 Trinity
|
||||
* Copyright (C) 2008 Trinity
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -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)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2008 MaNGOS
|
||||
* Copyright (C) 2005-2008 MaNGOS
|
||||
*
|
||||
* Copyright (C) 2008 Trinity
|
||||
* Copyright (C) 2008 Trinity
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -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;
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ class Totem : public Creature
|
||||
void UpdateMaxPower(Powers /*power*/) {}
|
||||
void UpdateAttackPowerAndDamage(bool /*ranged*/ ) {}
|
||||
void UpdateDamagePhysical(WeaponAttackType /*attType*/) {}
|
||||
|
||||
|
||||
bool IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges = false);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -556,7 +556,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);
|
||||
}
|
||||
|
||||
|
||||
+21
-21
@@ -534,7 +534,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);
|
||||
@@ -602,7 +602,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())
|
||||
{
|
||||
@@ -620,14 +620,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)
|
||||
{
|
||||
@@ -4508,7 +4508,7 @@ void Unit::RemoveSingleAuraFromStackByDispel(uint32 spellId)
|
||||
iter->second->ApplyModifier(false,true);
|
||||
iter->second->SetStackAmount(iter->second->GetStackAmount()-1);
|
||||
iter->second->ApplyModifier(true,true);
|
||||
|
||||
|
||||
iter->second->UpdateSlotCounterAndDuration();
|
||||
return; // not remove aura if stack amount > 1
|
||||
}
|
||||
@@ -4668,7 +4668,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)
|
||||
{
|
||||
@@ -4676,7 +4676,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)
|
||||
{
|
||||
@@ -4691,9 +4691,9 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
|
||||
sLog.outDebug("Aura %u (%u) now is remove mode %d", Aur->GetId(), Aur->GetModifier()->m_auraname, mode);
|
||||
assert(!Aur->IsInUse());
|
||||
Aur->ApplyModifier(false,true);
|
||||
|
||||
|
||||
Aur->SetStackAmount(0);
|
||||
|
||||
|
||||
Aur->_RemoveAura();
|
||||
|
||||
if(mode != AURA_REMOVE_BY_STACK)
|
||||
@@ -8437,8 +8437,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);
|
||||
@@ -8448,9 +8448,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);
|
||||
@@ -8910,7 +8910,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
|
||||
CoefficientPtc /= 100.0f;
|
||||
|
||||
//float DoneActualBenefit = DoneAdvertisedBenefit * (CastingTime / 3500.0f) * DotFactor * SpellModSpellDamage * LvlPenalty;
|
||||
|
||||
|
||||
float DoneActualBenefit = DoneAdvertisedBenefit * CoefficientPtc * LvlPenalty;
|
||||
float TakenActualBenefit = TakenAdvertisedBenefit * DotFactor * LvlPenalty;
|
||||
if(spellProto->SpellFamilyName && spellProto->SchoolMask != SPELL_SCHOOL_MASK_NORMAL)
|
||||
@@ -9224,7 +9224,7 @@ uint32 Unit::SpellHealingBonus(SpellEntry const *spellProto, uint32 healamount,
|
||||
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;
|
||||
@@ -9864,7 +9864,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;
|
||||
|
||||
@@ -10479,7 +10479,7 @@ Unit* Creature::SelectVictim()
|
||||
AI()->EnterEvadeMode();
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// enter in evade mode in other case
|
||||
@@ -13028,7 +13028,7 @@ void Unit::SetCharmedOrPossessedBy(Unit* charmer, bool possess)
|
||||
}
|
||||
}
|
||||
|
||||
if(possess)
|
||||
if(possess)
|
||||
((Player*)charmer)->PossessSpellInitialize();
|
||||
else if(charmer->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)charmer)->CharmSpellInitialize();
|
||||
@@ -13084,7 +13084,7 @@ void Unit::RemoveCharmedOrPossessedBy(Unit *charmer)
|
||||
return;
|
||||
|
||||
assert(!possess || charmer->GetTypeId() == TYPEID_PLAYER);
|
||||
|
||||
|
||||
charmer->SetCharm(0);
|
||||
if(possess)
|
||||
{
|
||||
@@ -13187,7 +13187,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);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1018,7 +1018,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);
|
||||
|
||||
@@ -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
@@ -402,7 +402,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
|
||||
@@ -1361,7 +1361,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();
|
||||
|
||||
@@ -1752,7 +1752,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;
|
||||
}
|
||||
@@ -2299,7 +2299,7 @@ void World::ScriptsProcess()
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case SCRIPT_COMMAND_LOAD_PATH:
|
||||
{
|
||||
if(!source)
|
||||
@@ -2312,18 +2312,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)
|
||||
@@ -2333,17 +2333,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(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()));
|
||||
@@ -2383,19 +2383,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)
|
||||
|
||||
@@ -275,7 +275,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-2008 MaNGOS <http://www.mangosproject.org/>
|
||||
*
|
||||
* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
|
||||
*
|
||||
* Copyright (C) 2008 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