Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 06-26-2009, 02:03 AM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default New rule NPC SmartLastFightingDelayMoving

This rule is the follow up to these rules 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:
Code:
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:
Code:
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');
Reply With Quote
  #2  
Old 06-30-2009, 08:01 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

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.
Reply With Quote
  #3  
Old 06-30-2009, 11:14 PM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

No problem KLS. This was submitted after you did a bunch the other day. Thanks tho.
Reply With Quote
  #4  
Old 07-01-2009, 02:50 AM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

This has been committed.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:34 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3