Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2006, 04:34 PM
Zuesrooster
Fire Beetle
 
Join Date: Mar 2006
Location: NYC
Posts: 20
Default Mob/Pet Logic

Had a friend of mine complain that his fire pet wasn't working on my server, I looked into the code and I found some lines of code I had to change to make it work. Just wanted to see if these where real bugs or if there are repercussions to the changes I made, also to let anyone who runs into this problem know how to possible fix it.

MobAI.cpp Line 145
It use to be:

&& !(tar->IsPet() && tar->GetOwner()->IsClient()) //no buffing PC's pets

this doesn't seem to account for when a pet is trying to buff itself. so i changed it to:

&& !(tar->IsPet() && tar->GetOwner()->IsClient() && tar != this)

this seamed to fix it but then the next problem was it was casting it nonstop.

spells_effect.cpp line 67:

if(spell.buffdurationformula != 0 && spell.buffduration > 0)
The pets spell has a duration = 0 (spell_id = 927) so i changed it to >=, this is the change that worries me the most because I don't know if that assumption is made anywhere else in code and the mismatch might cause a problem.

Finally on the mob::CanBuffStack method I added

if(curbuf.spellid == spellid)
return(-1);

I didn't think NPC's had to worry about refreshing their buff's since they cast so often. This seemed to fix the problem with the fire pets. It might also fix the problem with airpets casting invis on owners nonstop (they shouldn't even be casting it on anything but themselves but I'll look into that later). I haven't played EQ live in a really long time so maybe the mechanics ahve changed and my changes are outdated. Unkown if this address the problem with NPC's casting frequently.

Last edited by Zuesrooster; 08-14-2006 at 12:36 AM..
Reply With Quote
  #2  
Old 08-14-2006, 12:30 PM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

hey,

thanks for the changes, looks relatively good, I changed the buff duration stuff to:
if((spell.buffdurationformula != 0 && spell.buffduration > 0) || spell.buffdurationformula == 50) {
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 09:40 PM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3