PDA

View Full Version : New rule NPC SmartLastFightingDelayMoving


gaeorn
06-26-2009, 02:03 AM
This rule is the follow up to these rules (http://www.eqemulator.net/forums/showthread.php?t=28549) to make FD pulling more live like.

With this rule set true, if a mob is already wandering home during a FD pull and the puller stands up and then FD again, the mob's timer to return home will not reset, but instead will return home immediately. The timer will be reset if the mob forgets about the FD puller. This is the default using the code below.

With this rule set false, you will get the old eqemu behavior.

To make FD pulling more live like, I recommend leaving this new rule at the default and setting the following rules to values close to these:
NPC:LastFightingDelayMovingMin = 5000
NPC:LastFightingDelayMovingMax = 30000

These values are approximations pulled from memories from several years ago when I last played live. Perhaps someone with a live account could do some testing to improve the accuracy of these numbers.

Patch:
Index: common/ruletypes.h
================================================== =================
--- common/ruletypes.h (revision 713)
+++ common/ruletypes.h (working copy)
@@ -208,6 +209,7 @@
RULE_BOOL ( NPC, EnableNPCQuestJournal, false)
RULE_INT ( NPC, LastFightingDelayMovingMin, 10000)
RULE_INT ( NPC, LastFightingDelayMovingMax, 20000)
+RULE_BOOL ( NPC, SmartLastFightingDelayMoving, true)
RULE_CATEGORY_END()

RULE_CATEGORY ( Aggro )
Index: zone/aggro.cpp
================================================== =================
--- zone/aggro.cpp (revision 713)
+++ zone/aggro.cpp (working copy)
@@ -1450,12 +1450,19 @@

void Mob::RemoveFromFeignMemory(Client* attacker) {
feign_memory_list.erase(attacker->CharacterID());
- if(feign_memory_list.empty() && AIfeignremember_timer != NULL)
- AIfeignremember_timer->Disable();
+ if(feign_memory_list.empty())
+ {
+ minLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMin);
+ maxLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMax);
+ if(AIfeignremember_timer != NULL)
+ AIfeignremember_timer->Disable();
+ }
}

void Mob::ClearFeignMemory() {
feign_memory_list.clear();
+ minLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMin);
+ maxLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMax);
if(AIfeignremember_timer != NULL)
AIfeignremember_timer->Disable();
}
Index: zone/MobAI.cpp
================================================== =================
--- zone/MobAI.cpp (revision 713)
+++ zone/MobAI.cpp (working copy)
@@ -431,6 +431,7 @@
AItarget_check_timer = 0;
AIfeignremember_timer = NULL;
AIscanarea_timer = 0;
+ pLastFightingDelayMoving = 0;
minLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMin);
maxLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMax);

@@ -1023,7 +1024,14 @@
}

if(IsNPC())
+ {
+ if(RuleB(NPC, SmartLastFightingDelayMoving) && !feign_memory_list.empty())
+ {
+ minLastFightingDelayMoving = 0;
+ maxLastFightingDelayMoving = 0;
+ }
CastToNPC()->AI_DoMovement();
+ }
}

}


SQL:
INSERT INTO `rule_values` VALUES ('1', 'NPC:SmartLastFightingDelayMoving', 'true', 'When true, mobs that started going home previously will do so again immediately if still on FD hate list');

KLS
06-30-2009, 08:01 PM
I'll try to finish up everything I didn't get to the other day today or tomorrow. Probably tomorrow since I wont have much time left today.

gaeorn
06-30-2009, 11:14 PM
No problem KLS. This was submitted after you did a bunch the other day. Thanks tho.

gaeorn
07-01-2009, 02:50 AM
This has been committed.