mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-09 22:20:24 +00:00
[Quest API] Add CopyHateList() to Perl/Lua. (#2623)
* [Quest API] Add CopyHateList() to Perl/Lua. # Perl - Add `$mob->CopyHateList(to_mob)`. # Lua - Add `mob:CopyHateList(to_mob)`. # Notes - Allows operators to easily copy and entire hatelist from one mob to another. * Update mob.cpp
This commit is contained in:
@@ -7051,3 +7051,15 @@ void Mob::CloneAppearance(Mob* other, bool clone_name)
|
||||
TempName(other->GetCleanName());
|
||||
}
|
||||
}
|
||||
|
||||
void Mob::CopyHateList(Mob* to) {
|
||||
if (hate_list.IsHateListEmpty() || !to || to->IsClient()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto& h : hate_list.GetHateList()) {
|
||||
if (h->entity_on_hatelist) {
|
||||
to->AddToHateList(h->entity_on_hatelist, h->stored_hate_amount, h->hatelist_damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user