Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 02-13-2013, 01:42 AM
SavageDeath
Fire Beetle
 
Join Date: Jan 2013
Location: In the USA
Posts: 15
Default Question about Events and NPC's

Okay so I have no idea if this is the proper place to post this for the second part of my question but here goes.

First question is, is there some type of sub EVENT for when someone equips any piece of armor? I looked on the QuestTutorial and I checked on the Google Code and I can't find anything about it. The reason I ask is I am looking for a EVENT that will allow me to check what that piece of armor is they equipped and then send them a client message or well anything.

Second question is, anytime I put a NPC's HP's to anything over 2,147,483,647 the NPC's HP's will go negative. I thought this was something to do with the way the source calculated the hp but I ain't too great with c++ so I wouldn't know where to look or even how to fix this problem. Thus my question, is it possible to make it so I can set an NPC's HP's to over 2,147,483,647 without it going negative?

Any help would be greatly appreciated =) Thanks in advance.
Reply With Quote
  #2  
Old 02-13-2013, 01:47 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

Quote:
Originally Posted by SavageDeath View Post
is it possible to make it so I can set an NPC's HP's to over 2,147,483,647 without it going negative?
No, that is the limit of the datatype used to store hit points. If you need more than that you would need to modify the source.
Reply With Quote
  #3  
Old 02-13-2013, 01:53 AM
SavageDeath
Fire Beetle
 
Join Date: Jan 2013
Location: In the USA
Posts: 15
Default

Ah gotcha kinda figured, any chance you can point me in the right direction of where to mod it in the source? I looked at mob.h and mob.cpp but didn't see any places that stood out. And thanks for the quick reply!
Reply With Quote
  #4  
Old 02-13-2013, 02:01 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

I'm afraid if you don't know how to find it already then anything I could say to you here is unlikely to enlighten you.

That said, mob.h, line 836:

Code:
    int32 cur_hp;
    int32 max_hp;
    int32 base_hp;
Keep in mind that these values are manipulated all over the place and you would need to change all of those places, and potentially how the data is stored in the database as well. This is not a small task.

You might want to ask yourself first if maybe 2.1 BILLION hit points is enough and if whatever you are trying to achieve could be done a different way to work within that limitation.
Reply With Quote
  #5  
Old 02-13-2013, 02:08 AM
SavageDeath
Fire Beetle
 
Join Date: Jan 2013
Location: In the USA
Posts: 15
Default

Thanks man, I was actually looking at that and trying to figure out what would best work to make it not go negative. I was honestly hoping there was another area I had missed because I had modded those to 64 bit integers. After I edited all the appropriate places and recompiled(with a successful compile) I tried it and I had the same result of the neg HP's my only guess is that I missed the place where it stores the HP.

But again thank you very much sir!
Reply With Quote
  #6  
Old 02-13-2013, 03:26 PM
SavageDeath
Fire Beetle
 
Join Date: Jan 2013
Location: In the USA
Posts: 15
Default

I have an update. I am now able to make it so the NPC's HP's don't go negative but they won't go past 2,147,483,647 HP's. I changed the int on the table to support the bigger numbers. Anyone have any idea why it won't go past that? I think I'm on the right track seeing as it doesn't go negative anymore =D Again any help would be greatly appreciated, thanks in advance.
Reply With Quote
  #7  
Old 02-13-2013, 03:57 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

That's the limit of a signed int. Even if you change the value in the tables, there is still plenty of code where it would need to be changed as well. However, that too isn't taking into consideration of the client itself, which may not support anything 'bigger' than a signed int (i.e. int64 signed/unsigned, etc.).

My advice, increase the mitigation (AC, etc.) of the NPC to make it tougher to bring down it's HP, rather than just making a grossly large number of HP.

*Edit: But I see lersxt2112 already gave you the same (essentially - he wanted to get you thinking) sound advice.
Reply With Quote
  #8  
Old 02-13-2013, 04:16 PM
SavageDeath
Fire Beetle
 
Join Date: Jan 2013
Location: In the USA
Posts: 15
Default

I have increased the ac to insane numbers, only problem is if the AC gets too high it makes the player unable to hit the monsters thus why I wanted to increase the HP cap, thanks again.
Reply With Quote
  #9  
Old 02-13-2013, 04:53 PM
SavageDeath
Fire Beetle
 
Join Date: Jan 2013
Location: In the USA
Posts: 15
Default

Sorry for the double post I just realized how I made that sound, I did edit the source as well not just the table.
Reply With Quote
  #10  
Old 02-13-2013, 05:37 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Quote:
Originally Posted by SavageDeath View Post
Sorry for the double post I just realized how I made that sound, I did edit the source as well not just the table.
Then, it may be a limitation of the client itself, albeit, I'm not in a position to check at the moment, maybe someone else knows off the top of their heads. First time encountering a desire for a > 2B HP mob sorry.
Reply With Quote
  #11  
Old 02-13-2013, 05:57 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

NPC HP is only communicated to the client in percentages (i.e. 0 to 100%) unless I am mistaken, which is why the packet collector cannot collect absolute NPC max/current hitpoints, so I don't think it is a client limitation.
Reply With Quote
  #12  
Old 02-13-2013, 06:57 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

It seems like you may have selectively read my post. You may have changed the actual variable the data is stored in, but did you change everywhere that value is manipulated either directly or through accessors like GetHP()? Like I said, it's not a small task.
Reply With Quote
  #13  
Old 02-13-2013, 07:12 PM
SavageDeath
Fire Beetle
 
Join Date: Jan 2013
Location: In the USA
Posts: 15
Default

Yes sir, I spent a good 3 hours going through and making sure that anything related to GetHP() was set to int64 and it just won't go higher than 2.14bil. Again my c++ isn't that great but I did look through every place I could think of that would set the NPC's HP's and I changed them to int64 instead of int32.

These are the places I edited.
Maybe I missed a place?
Code:
Mob.h
Mob.cpp
client.h
client.cpp
client_mods.cpp
zonedump.h
merc.h
merc.cpp
bot.h
bot.cpp
The reason I had to change the ones that weren't directly related to NPC's is because it won't compile if you don't edit it for everywhere that it pulls HP.
Reply With Quote
  #14  
Old 02-13-2013, 07:49 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

How are you setting the HP to greater than 2.14 billion? A # command?

How are you determining whether or not the HP is greater than 2.14 billion? A log statement?

Those need to be updated to accept/print a larger datatype as well.
Reply With Quote
  #15  
Old 02-13-2013, 08:55 PM
SavageDeath
Fire Beetle
 
Join Date: Jan 2013
Location: In the USA
Posts: 15
Default

I am setting the hp to greater than 2.14 billion manually in the npc_types table with navicat. I set it at 4bil just to see if it would go over the cap. The table accepts it which is great. The NPC doesn't.

I used #showstats to look at what the NPC's HP's are.
I then used #damage 1000000000 to be sure what the #showstats was showing was correct. On the show stats its weird, it will show the HP at 2.14bil but it will show the MAX hp as 0, not sure why that is.
When I do #damage 1000000000 it takes the NPC's HP's to 53% telling me that the NPC's HP's isn't even close to the 4bil I set it to.
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 12:19 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