*Merge with Trinity 702.
--HG-- branch : trunk
This commit is contained in:
@@ -740,11 +740,11 @@ void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
|
|||||||
i_pl->TeleportTo(m_creature->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
|
i_pl->TeleportTo(m_creature->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit* ScriptedAI::FindCreature(uint32 entry, uint32 range)
|
Unit* ScriptedAI::FindCreature(uint32 entry, uint32 range, uint32 district)
|
||||||
{
|
{
|
||||||
CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
|
CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
|
||||||
Cell cell(pair);
|
Cell cell(pair);
|
||||||
cell.data.Part.reserved = ALL_DISTRICT;
|
cell.data.Part.reserved = district;
|
||||||
cell.SetNoCreate();
|
cell.SetNoCreate();
|
||||||
|
|
||||||
std::list<Creature*> NPCList;
|
std::list<Creature*> NPCList;
|
||||||
@@ -765,11 +765,11 @@ Unit* ScriptedAI::FindCreature(uint32 entry, uint32 range)
|
|||||||
}else error_log("SD2 ERROR: Entry: %u not found!", entry); return NULL;
|
}else error_log("SD2 ERROR: Entry: %u not found!", entry); return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
GameObject* ScriptedAI::FindGameObject(uint32 entry)
|
GameObject* ScriptedAI::FindGameObject(uint32 entry, uint32 district)
|
||||||
{
|
{
|
||||||
CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
|
CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
|
||||||
Cell cell(pair);
|
Cell cell(pair);
|
||||||
cell.data.Part.reserved = ALL_DISTRICT;
|
cell.data.Part.reserved = district;
|
||||||
cell.SetNoCreate();
|
cell.SetNoCreate();
|
||||||
|
|
||||||
std::list<GameObject*> GOList;
|
std::list<GameObject*> GOList;
|
||||||
|
|||||||
@@ -149,10 +149,10 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
|
|||||||
void DoTeleportAll(float x, float y, float z, float o);
|
void DoTeleportAll(float x, float y, float z, float o);
|
||||||
|
|
||||||
//Get a single creature of given entry
|
//Get a single creature of given entry
|
||||||
Unit* FindCreature(uint32 entry, uint32 range);
|
Unit* FindCreature(uint32 entry, uint32 range, uint32 district = ALL_DISTRICT);
|
||||||
|
|
||||||
//Get a single gameobject of given entry
|
//Get a single gameobject of given entry
|
||||||
GameObject* FindGameObject(uint32 entry);
|
GameObject* FindGameObject(uint32 entry, uint32 district = ALL_DISTRICT);
|
||||||
|
|
||||||
//Returns friendly unit with the most amount of hp missing from max hp
|
//Returns friendly unit with the most amount of hp missing from max hp
|
||||||
Unit* DoSelectLowestHpFriendly(float range, uint32 MinHPDiff = 1);
|
Unit* DoSelectLowestHpFriendly(float range, uint32 MinHPDiff = 1);
|
||||||
|
|||||||
+3
-3
@@ -845,8 +845,8 @@ int ChatHandler::ParseCommands(const char* text)
|
|||||||
ASSERT(text);
|
ASSERT(text);
|
||||||
ASSERT(*text);
|
ASSERT(*text);
|
||||||
|
|
||||||
//if(m_session->GetSecurity() == 0)
|
if(m_session->GetSecurity() == 0)
|
||||||
// return 0;
|
return 0;
|
||||||
|
|
||||||
/// chat case (.command or !command format)
|
/// chat case (.command or !command format)
|
||||||
if(m_session)
|
if(m_session)
|
||||||
@@ -869,7 +869,7 @@ int ChatHandler::ParseCommands(const char* text)
|
|||||||
if(text[0] == '!' || text[0] == '.')
|
if(text[0] == '!' || text[0] == '.')
|
||||||
++text;
|
++text;
|
||||||
|
|
||||||
if(!ExecuteCommandInTable(getCommandTable(), text, fullcmd) && m_session->GetSecurity() > SEC_PLAYER)
|
if(!ExecuteCommandInTable(getCommandTable(), text, fullcmd))
|
||||||
SendSysMessage(LANG_NO_CMD);
|
SendSysMessage(LANG_NO_CMD);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
+38
-14
@@ -1679,20 +1679,48 @@ bool ChatHandler::HandleNpcFactionIdCommand(const char* args)
|
|||||||
//kick player
|
//kick player
|
||||||
bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||||
{
|
{
|
||||||
if(!*args)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
const char* kickName = strtok((char*)args, " ");
|
const char* kickName = strtok((char*)args, " ");
|
||||||
|
char* kickReason = strtok(NULL, "\n");
|
||||||
|
std::string reason = "No Reason";
|
||||||
|
std::string kicker = "Console";
|
||||||
|
if(kickReason)
|
||||||
|
reason = kickReason;
|
||||||
|
if(m_session)
|
||||||
|
kicker = m_session->GetPlayer()->GetName();
|
||||||
|
|
||||||
if(!kickName)
|
if(!kickName)
|
||||||
{
|
{
|
||||||
|
Player* player = getSelectedPlayer();
|
||||||
|
if(!player)
|
||||||
|
{
|
||||||
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string name = kickName;
|
if(player==m_session->GetPlayer())
|
||||||
|
{
|
||||||
|
SendSysMessage(LANG_COMMAND_KICKSELF);
|
||||||
|
SetSentErrorMessage(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
|
||||||
|
{
|
||||||
|
|
||||||
|
sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, player->GetName(), kicker.c_str(), reason.c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
PSendSysMessage(LANG_COMMAND_KICKMESSAGE, player->GetName(), kicker.c_str(), reason.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
player->GetSession()->KickPlayer();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::string name = kickName;
|
||||||
if(!normalizePlayerName(name))
|
if(!normalizePlayerName(name))
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||||
@@ -1715,27 +1743,23 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(player->GetSession()->GetSecurity() > m_session->GetSecurity())
|
if(m_session && player->GetSession()->GetSecurity() > m_session->GetSecurity())
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); //maybe replacement string for this later on
|
SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); //maybe replacement string for this later on
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* kickReason = strtok(NULL, "\n");
|
|
||||||
std::string reason = "No Reason";
|
|
||||||
if(kickReason)
|
|
||||||
{reason = kickReason;}
|
|
||||||
|
|
||||||
if(sWorld.KickPlayer(name.c_str()))
|
if(sWorld.KickPlayer(name.c_str()))
|
||||||
{
|
{
|
||||||
if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
|
if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
|
||||||
{
|
{
|
||||||
sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, name.c_str(), m_session->GetPlayer()->GetName(), reason.c_str());
|
|
||||||
|
sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, name.c_str(), kicker.c_str(), reason.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_COMMAND_KICKMESSAGE, name.c_str(), m_session->GetPlayer()->GetName(), reason.c_str());
|
PSendSysMessage(LANG_COMMAND_KICKMESSAGE, name.c_str(), kicker.c_str(), reason.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1743,7 +1767,7 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
|||||||
PSendSysMessage(LANG_COMMAND_KICKNOTFOUNDPLAYER, name.c_str());
|
PSendSysMessage(LANG_COMMAND_KICKNOTFOUNDPLAYER, name.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ WaypointMovementGenerator<Creature>::Initialize(Creature &u)
|
|||||||
StopedByPlayer = false;
|
StopedByPlayer = false;
|
||||||
if(!path_id)
|
if(!path_id)
|
||||||
path_id = u.GetWaypointPath();
|
path_id = u.GetWaypointPath();
|
||||||
/*i_currentNode = 0;
|
|
||||||
waypoints = WaypointMgr.GetPath(path_id);
|
waypoints = WaypointMgr.GetPath(path_id);
|
||||||
|
/*i_currentNode = 0;
|
||||||
if(waypoints && waypoints->size())
|
if(waypoints && waypoints->size())
|
||||||
{
|
{
|
||||||
Traveller<Creature> traveller(u);
|
Traveller<Creature> traveller(u);
|
||||||
|
|||||||
Reference in New Issue
Block a user