IsAggroed now defers to info struct for engaged_encounter to assure we are in/out of combat for various game instructions. Add /spawn details hated to show hated by list for players/entities,
This commit is contained in:
parent
7869c2abcb
commit
8f402eb781
@ -4885,6 +4885,17 @@ void Commands::Process(int32 index, EQ2_16BitString* command_parms, Client* clie
|
|||||||
client->Message(CHANNEL_COLOR_YELLOW, "Angle %f between player %s and target %s", spawnAngle, client->GetPlayer()->GetTarget() ? client->GetPlayer()->GetTarget()->GetName() : client->GetPlayer()->GetName(), client->GetPlayer()->GetName());
|
client->Message(CHANNEL_COLOR_YELLOW, "Angle %f between player %s and target %s", spawnAngle, client->GetPlayer()->GetTarget() ? client->GetPlayer()->GetTarget()->GetName() : client->GetPlayer()->GetName(), client->GetPlayer()->GetName());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else if (ToLower(string(sep->arg[0])) == "hated")
|
||||||
|
{
|
||||||
|
if(client->GetPlayer()->GetTarget() && client->GetPlayer()->GetTarget()->IsEntity()) {
|
||||||
|
Entity* target = (Entity*)client->GetPlayer()->GetTarget();
|
||||||
|
target->SendHatedByList(client);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
client->Message(CHANNEL_COLOR_YELLOW, "No target or target is not entity to display hated by list.");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (sep->IsNumber(0))
|
if (sep->IsNumber(0))
|
||||||
{
|
{
|
||||||
|
@ -4138,4 +4138,20 @@ void Entity::CalculateMaxReduction() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GetInfoStruct()->set_max_spell_reduction(maxReduction);
|
GetInfoStruct()->set_max_spell_reduction(maxReduction);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Entity::IsAggroed() {
|
||||||
|
return (bool)GetInfoStruct()->get_engaged_encounter();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Entity::SendHatedByList(Client* client) {
|
||||||
|
set<int32>::iterator itr;
|
||||||
|
MHatedBy.lock();
|
||||||
|
set<int32> hatedByCopy(HatedBy);
|
||||||
|
MHatedBy.unlock();
|
||||||
|
client->Message(CHANNEL_COLOR_RED, "HatedBy List for %s, size: %u", GetName(), hatedByCopy.size());
|
||||||
|
for (itr = hatedByCopy.begin(); itr != hatedByCopy.end(); itr++) {
|
||||||
|
Spawn* spawn = GetZone()->GetSpawnByID(*itr);
|
||||||
|
client->Message(CHANNEL_COLOR_YELLOW, "ID: %u, Name: %s", *itr, spawn ? spawn->GetName() : "N/A");
|
||||||
|
}
|
||||||
}
|
}
|
@ -1992,15 +1992,8 @@ public:
|
|||||||
set<int32> HatedBy;
|
set<int32> HatedBy;
|
||||||
std::mutex MHatedBy;
|
std::mutex MHatedBy;
|
||||||
|
|
||||||
bool IsAggroed() {
|
bool IsAggroed();
|
||||||
int32 size = 0;
|
void SendHatedByList(Client* client);
|
||||||
|
|
||||||
MHatedBy.lock();
|
|
||||||
size = HatedBy.size();
|
|
||||||
MHatedBy.unlock();
|
|
||||||
|
|
||||||
return size > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Mutex MCommandMutex;
|
Mutex MCommandMutex;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user