Merge branch 'master' into raycast

This commit is contained in:
KimLS
2014-03-01 17:49:21 -08:00
44 changed files with 747 additions and 385 deletions
+51
View File
@@ -1012,6 +1012,22 @@ Mob *EntityList::GetMobByNpcTypeID(uint32 get_id)
return nullptr;
}
bool EntityList::IsMobSpawnedByNpcTypeID(uint32 get_id)
{
if (get_id == 0 || npc_list.empty())
return false;
auto it = npc_list.begin();
while (it != npc_list.end()) {
// Mobs will have a 0 as their GetID() if they're dead
if (it->second->GetNPCTypeID() == get_id && it->second->GetID() != 0)
return true;
++it;
}
return false;
}
Object *EntityList::GetObjectByDBID(uint32 id)
{
if (id == 0 || object_list.empty())
@@ -1891,6 +1907,24 @@ void EntityList::MessageClose_StringID(Mob *sender, bool skipsender, float dist,
}
}
void EntityList::FilteredMessageClose_StringID(Mob *sender, bool skipsender,
float dist, uint32 type, eqFilterType filter, uint32 string_id,
const char *message1, const char *message2, const char *message3,
const char *message4, const char *message5, const char *message6,
const char *message7, const char *message8, const char *message9)
{
Client *c;
float dist2 = dist * dist;
for (auto it = client_list.begin(); it != client_list.end(); ++it) {
c = it->second;
if (c && c->DistNoRoot(*sender) <= dist2 && (!skipsender || c != sender))
c->FilteredMessage_StringID(sender, type, filter, string_id,
message1, message2, message3, message4, message5,
message6, message7, message8, message9);
}
}
void EntityList::Message_StringID(Mob *sender, bool skipsender, uint32 type, uint32 string_id, const char* message1,const char* message2,const char* message3,const char* message4,const char* message5,const char* message6,const char* message7,const char* message8,const char* message9)
{
Client *c;
@@ -1902,6 +1936,23 @@ void EntityList::Message_StringID(Mob *sender, bool skipsender, uint32 type, uin
}
}
void EntityList::FilteredMessage_StringID(Mob *sender, bool skipsender,
uint32 type, eqFilterType filter, uint32 string_id,
const char *message1, const char *message2, const char *message3,
const char *message4, const char *message5, const char *message6,
const char *message7, const char *message8, const char *message9)
{
Client *c;
for (auto it = client_list.begin(); it != client_list.end(); ++it) {
c = it->second;
if (c && (!skipsender || c != sender))
c->FilteredMessage_StringID(sender, type, filter, string_id,
message1, message2, message3, message4, message5, message6,
message7, message8, message9);
}
}
void EntityList::MessageClose(Mob* sender, bool skipsender, float dist, uint32 type, const char* message, ...)
{
va_list argptr;