mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-09 22:20:24 +00:00
[Quest API] Add Group/Raid Overloads to Perl/Lua. (#2587)
# Perl - Add `$group->IsGroupMember(name)`. - Add `$group->IsLeader(name)`. - Add `$raid->IsRaidMember(c)`. - Add `$raid->IsGroupLeader(c)`. # Lua - Add `group:IsGroupMember(name)`. - Add `group:IsLeader(name)`. - Add `raid:IsGroupLeader(client)`. - Add `raid:IsLeader(client)`. - Add `raid:IsRaidMember(client)`. # Notes - Adds overloads to these methods allowing operators to get by name or reference.
This commit is contained in:
+26
-12
@@ -833,26 +833,28 @@ void Group::CastGroupSpell(Mob* caster, uint16 spell_id) {
|
||||
disbandcheck = true;
|
||||
}
|
||||
|
||||
bool Group::IsGroupMember(Mob* client)
|
||||
bool Group::IsGroupMember(Mob* c)
|
||||
{
|
||||
bool Result = false;
|
||||
|
||||
if(client) {
|
||||
for (uint32 i = 0; i < MAX_GROUP_MEMBERS; i++) {
|
||||
if (members[i] == client)
|
||||
Result = true;
|
||||
if (c) {
|
||||
for (const auto &m: members) {
|
||||
if (m == c) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Result;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Group::IsGroupMember(const char *Name)
|
||||
bool Group::IsGroupMember(const char *name)
|
||||
{
|
||||
if(Name)
|
||||
for(uint32 i = 0; i < MAX_GROUP_MEMBERS; i++)
|
||||
if((strlen(Name) == strlen(membername[i])) && !strncmp(membername[i], Name, strlen(Name)))
|
||||
if (name) {
|
||||
for (const auto& m : membername) {
|
||||
if (!strcmp(m, name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -2474,3 +2476,15 @@ bool Group::DoesAnyMemberHaveExpeditionLockout(
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Group::IsLeader(const char* name) {
|
||||
if (name) {
|
||||
for (const auto& m : membername) {
|
||||
if (!strcmp(m, name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user