PDA

View Full Version : New rules NPC:astFightingDelayMovingMin and NPC:astFightingDelayMovingMax


gaeorn
06-12-2009, 11:35 AM
I played a monk on live years ago so I found on the emu that when I would feign, the first mobs to start to return home were too close in time to the last mobs to return home. The difference between the first and the last was larger on live (although, I do not know exactly what it was on live).

Since this was hardcoded in the emu, it wasn't easy to adjust the numbers. So I made them into rules and figured I would share :D

The default values match what was in the emu code to begin with.

Index: common/ruletypes.h
================================================== =================
--- common/ruletypes.h (revision 655)
+++ common/ruletypes.h (working copy)
@@ -200,6 +200,8 @@
RULE_INT ( NPC, OOCRegen, 0)
RULE_BOOL ( NPC, BuffFriends, false )
RULE_BOOL ( NPC, EnableNPCQuestJournal, false)
+RULE_INT ( NPC, LastFightingDelayMovingMin, 10000)
+RULE_INT ( NPC, LastFightingDelayMovingMax, 20000)
RULE_CATEGORY_END()

RULE_CATEGORY ( Aggro )
Index: zone/MobAI.cpp
================================================== =================
--- zone/MobAI.cpp (revision 655)
+++ zone/MobAI.cpp (working copy)
@@ -432,8 +432,8 @@
AIfeignremember_timer = NULL;
AIscanarea_timer = 0;
pLastFightingDelayMoving = 0;
- minLastFightingDelayMoving = 10000;
- maxLastFightingDelayMoving = 20000;
+ minLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMin);
+ maxLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMax);

pDontHealMeBefore = 0;
pDontBuffMeBefore = 0;


SQL:

INSERT INTO `rule_values` VALUES ('1', 'NPC:LastFightingDelayMovingMin', '10000','Minimum time (in ms) before mob goes home after all aggro loss');
INSERT INTO `rule_values` VALUES ('1', 'NPC:LastFightingDelayMovingMax', '20000','Maximum time (in ms) before mob goes home after all aggro loss');

gaeorn
06-22-2009, 01:33 AM
Bumping post

gaeorn
06-22-2009, 05:06 PM
I had originally planned on working on code to have mobs return home immediately upon loss of aggro if they had already started walking home during an earlier loss of aggro (FD pullers should be familiar with this from live). However, since there has not been any apparent interest in the minor changes from this thread, I thought I would ask if anyone is interested in such a change before I invest the time in it. Please reply if you would like me to continue working on this. Thanks.

trevius
06-22-2009, 05:17 PM
The rules will be added. It is just that no one has gotten to them yet. I got a few other code submissions added last night, but didn't get to this one yet. In your thread for the /assist rule, I was going to add that last night too, but I am not sure if that is how it should be coded. I didn't have much time to look it over, so I just didn't get to it. These 2 rules are straight forward and would be easy to add.

The part about NPCs starting to return home immediately is a bit hazy to me from my playing on Live. Was it just that they had a random chance to start walking back instantly if they had already started walking back and were aggro'd again? Either way, sounds like it could be a nice option and would really help out the monks that probably have 2X the pulling challenge on EQEmu as they did for the same events on Live.

Sorry if it seems like there is no interest since your stuff hasn't been added yet. The more complex changes like the 64bit stuff is something that I leave for the experts, because I don't have a clue if it will break anything else or not.

gaeorn
06-22-2009, 05:41 PM
The rules will be added. It is just that no one has gotten to them yet. I got a few other code submissions added last night, but didn't get to this one yet. In your thread for the /assist rule, I was going to add that last night too, but I am not sure if that is how it should be coded. I didn't have much time to look it over, so I just didn't get to it. These 2 rules are straight forward and would be easy to add.

The part about NPCs starting to return home immediately is a bit hazy to me from my playing on Live. Was it just that they had a random chance to start walking back instantly if they had already started walking back and were aggro'd again? Either way, sounds like it could be a nice option and would really help out the monks that probably have 2X the pulling challenge on EQEmu as they did for the same events on Live.

From what I remember (it's been a while as I last played just before OoW came out), there were two types of "return to home" behavior in mobs. Some mobs were coded to always return home immediately. Those would never have any delay, regardless of how many times they were aggroed. These were typically raid situations where Sony wanted it impractical to split the mobs.

The other type is the type I was thinking of working on. This type will corpse camp for a random amount of time before beginning to walk home. If one waking home still has aggro on the FD char and that char stands up and then FD again, the mob will immediately start walking home (no delay). The random component was for mobs that had lost aggro on the FD, causing them to be aggroed again when the FD player stands up (by sharing aggro with other nearby mobs that still have aggro). If I remember correctly, these mobs would corpse camp again for a random amount of time before heading home.

In the long run, it would be best to have a flag on the npc type to determine which behavior should be used. But for now I simply wanted to modify the existing system to have it more live like for the majority of mobs.

Sorry if it seems like there is no interest since your stuff hasn't been added yet. The more complex changes like the 64bit stuff is something that I leave for the experts, because I don't have a clue if it will break anything else or not.

No problem. I was just curious since there hadn't even been a reply to the thread. And I understand about the 64bit stuff. It's always fun trying to merge changes for different systems and architectures.

Anyway, thanks Trev. Appreciate the response. I'll see what I can come up with.

KLS
06-22-2009, 08:13 PM
Yeah I'm sorry, I got a little tied up doing non-code stuff for a couple days. I shoulda had everything done a few days ago but my database got corrupted and I spent all night on fixing that instead (that was entertaining).

gaeorn
06-22-2009, 08:19 PM
Ouch. That sucks. I have nightly backups of my DB that run automatically to protect me from myself (I'm dangerous, particularly after a couple beers at 4am on a weekend).

KLS
06-23-2009, 03:07 AM
I actually spent a lot more time figuring out it was corrupt(a few hours) than it took to fix it(10 minutes).

PS this is going in tonight and some of the 64 bit stuff, but some of the 64 bit stuff will wait till tomorrow probably.

gaeorn
06-23-2009, 03:56 AM
Minor error with how patch was applied to SVN: a line of code went missing. The following patch fixes.

Index: zone/MobAI.cpp
================================================== =================
--- zone/MobAI.cpp (revision 706)
+++ 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);