Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Quests

Archive::Quests Archive area for Quests's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 02-19-2004, 05:24 PM
m0oni9
Hill Giant
 
Join Date: Dec 2003
Posts: 166
Default

I have a quick and dirty interim way to implement this.

In Mob::CreateHPPacket(), mob.cpp, about line 688:
Code:
   else
   {
      if(IsNPC() && IsEngaged())
        parse->Event(EVENT_HP, GetNPCTypeID(), NULL, CastToNPC(), CastToMob());
      ds->cur_hp=IsNPC()?(sint32)GetHPRatio():cur_hp;
      ds->max_hp=100;
   }
In PerlembParser::Event(), embparser.cpp, about line 184:
Code:
                        break;
                }
                case EVENT_HP: {
                        SendCommands(packagename.c_str(), "EVENT_HP", npcid,
                                npcmob, mob);
                }
                default: {
event_codes.h, add:
Code:
#define EVENT_HP  9
(imho would look better with enums in here)

You should now be able to make an EVENT_HP sub in your script. You can use the code Monrezz supplied to get access to mob HP, and possibly create another variable (ie: mobHPpercent). The problem with this implementation is that it is (possibly) invoked every time HP updates happen, which is very frequently -- however, I'll note that it didn't affect my load noticeably. I really can't see this being implemented in a way other than using a timer, and calling EVENT_HP sub on engaged mobs, so hopefully this won't be too far off.
Reply With Quote
 


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