mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
[Quest API] Add GetNPCAggro() and SetNPCAggro() to Perl/Lua (#3781)
* [Quest API] Add GetNPCAggro() and SetNPCAggro() to Perl/Lua # Perl - Add `$npc->GetNPCAggro()`. - Add `$npc->SetNPCAggro(in_npc_aggro)`. # Lua - Add `npc:GetNPCAggro()`. - Add `npc:SetNPCAggro(in_npc_aggro)`. # Notes - Allows operators to enable or disable an NPC's NPC aggro capability dynamically. * Update api_service.cpp
This commit is contained in:
+3
-3
@@ -448,7 +448,7 @@ void Mob::AI_Start(uint32 iMoveDelay) {
|
||||
hate_list_cleanup_timer.Disable();
|
||||
}
|
||||
|
||||
if (CastToNPC()->WillAggroNPCs())
|
||||
if (CastToNPC()->GetNPCAggro())
|
||||
AI_scan_area_timer = std::make_unique<Timer>(RandomTimer(RuleI(NPC, NPCToNPCAggroTimerMin), RuleI(NPC, NPCToNPCAggroTimerMax)));
|
||||
|
||||
AI_check_signal_timer = std::make_unique<Timer>(AI_check_signal_timer_delay);
|
||||
@@ -1066,7 +1066,7 @@ void Mob::AI_Process() {
|
||||
IsNPC() &&
|
||||
!CastToNPC()->GetSwarmInfo() &&
|
||||
(!IsPet() || (HasOwner() && GetOwner()->IsNPC())) &&
|
||||
!CastToNPC()->WillAggroNPCs()
|
||||
!CastToNPC()->GetNPCAggro()
|
||||
) {
|
||||
WipeHateList(true); // wipe NPCs from hate list to prevent faction war
|
||||
}
|
||||
@@ -1386,7 +1386,7 @@ void Mob::AI_Process() {
|
||||
StopNavigation();
|
||||
}
|
||||
}
|
||||
else if (zone->CanDoCombat() && CastToNPC()->WillAggroNPCs() && AI_scan_area_timer->Check()) {
|
||||
else if (zone->CanDoCombat() && CastToNPC()->GetNPCAggro() && AI_scan_area_timer->Check()) {
|
||||
|
||||
/**
|
||||
* NPC to NPC aggro (npc_aggro flag set)
|
||||
|
||||
Reference in New Issue
Block a user