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

Development::Bug Reports Post detailed bug reports and what you would like to see next in the emu here.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-23-2009, 01:09 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default A HUGE bug with quest::modifynpcstat

I found a tremendous bug.

The quest::modifynpcstat(identifier, value) command when used for HP doesn't seem to hold for long.

For example let say that in DB a test npc had 400 hp.

You used a script in game and run

quest::modifynpcstat("max_hp", 3500);

All is fine- the npc now has 3500 hp...
Now if npc just stands put (or fights in melee)- he will remain this way.

Now gues what- if npc has a LIFETAP type spell casted on him his Hp will REVERT to his DB default!!!

At first I thought the script didn't run right. I re-run everything. and looked at #showstats - the npc had 3500hp.

My NPC started fighting A Spector.- and suddenly as soon as Spector proced Lifetap - my npc took a large drop in his hit points - I did #showstats again, and his MAX hp were reporting only as 400 again - his Db default.

Then i decided to check everything by hand.

I made a new npc. upped his hps. casted a lifetap on him MYSELF- and his EXTRA hp instantly faded!

Then I repeated same process using a level 1 fire nuke for 5 dmg - same thing! BOOM - and all extra hps are gone

Next try: I cast HP buff on him- BOOM - extra hps gone.

next try: casting heal - extra hps GONE!

next try: Armor buff! (no hps) - his curent hps remain at 3500, but his MaxHp become 400 again! (as reported by #showstats)



Now this ONLY happens with hit points. All other modified stats- ac, resist etc- they all hold.

I have tryed upping npc AC, and then casting AC buff on him - the AC seem to hold up, and buff stacked with modified AC

So, Any ideas on this?

PS: running Rev 535 atm
Reply With Quote
  #2  
Old 06-23-2009, 01:29 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

mmm I haven't experienced this but I'll take a look, I wanted to change/fiddle with some of the commands anyway.
Reply With Quote
  #3  
Old 06-23-2009, 01:33 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

oh KLS btw I posted some new data on players fake hp buffs at Storm Heaven forums in that thread.
Reply With Quote
  #4  
Old 06-23-2009, 01:34 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

Fiddle with them all you like. Just don't banjo with them. *shudder*
Reply With Quote
  #5  
Old 06-23-2009, 08:47 AM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

Well that was a great laugh to start the day off =)
Reply With Quote
  #6  
Old 06-23-2009, 06:20 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

Here is a little update.

I tried to go around quest::modifynpcstat(); and set hps directly with

$npc->SetHP(); and $npc->SetMaxHP();
(also tried using mob-> with same result)

with this simple script



Code:
sub EVENT_SAY 
{ 	
	if($text=~/Hail/i)
	{	

             $npc->SetMaxHP(9999);	
	$npc->SetHP(9999);

	my $hps=$npc->GetHP();	
	my $maxhps=$npc->GetMaxHP();	

	quest::say("my hp is $hps  out of $maxhps"); 

	}
}


Results:

-if script contains: $npc->SetMaxHP(); the cript will NOT run - the npc will not reply to Hail at all.

-if script contains ONLY $npc->SetHP(); the ncp will reply to hail but comand WILL NOT have effect- his hps will remain an altered (default)
Reply With Quote
  #7  
Old 06-23-2009, 06:25 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Using $mob instead of $npc should work just fine for the HP setting quest objects.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #8  
Old 06-23-2009, 06:26 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

I have just tried it- the script won't run at all - the npc won't even reply to hail
Reply With Quote
  #9  
Old 06-23-2009, 06:32 PM
realityincarnate
Developer
 
Join Date: Dec 2007
Posts: 122
Default

The problem with the last script is that SetMaxHP doesn't do what you think it does. It doesn't take any arguments, and just sets the current hp to max. SetHP() seems to work fine, but it won't allow values higher than the max hp.

Of course, none of this solves your real problem, but it's all I know for sure while I'm sitting at work bored.
Reply With Quote
  #10  
Old 06-23-2009, 06:37 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

Ahh, so npc->SetMaxHP() is basically a way of saying npc->SetHPToMax().
Reply With Quote
  #11  
Old 06-23-2009, 06:40 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Ahh, I guess it is $npc after all. Maybe I was thinking of what it shows in the wiki as an example for using that object. Here is an example of one of the quests for SH that use SetHP and it definitely works without any bugs:

$npc->SetHP($hp_increase);

The $hp_increase variable in this case is just something we use for calculating how much to heal the NPC for when certain things happen. That should be replaced with the amount of Current (not max) HPs you want the NPC to have. So, if your NPC has a max of 1000 hps, you could set it to half health by doing:

$npc->SetHP(500);
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #12  
Old 06-23-2009, 07:26 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

ok I got it.
In otherowrds neither of the 2 comands can be used to go above default hps.
Well thats good to know, sicne wiki doens't actualy specify that

But we still have a problem with quest::modifystat =(
Reply With Quote
  #13  
Old 06-23-2009, 08:06 PM
realityincarnate
Developer
 
Join Date: Dec 2007
Posts: 122
Default

I haven't looked into it much, but I did see that quest::modifynpcstat() does change the maxhp for the mob it's called on. So, based on your description, I'd guess that it's actually a problem with something in the spell handling. It probably pulls a max hp value from the database somewhere.

If you modify an npc and fight it without ever casting a spell, does it work properly? Conversely, does anything other than spells cause it to reset?
Reply With Quote
  #14  
Old 06-23-2009, 08:13 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

Quote:
Originally Posted by realityincarnate View Post
I haven't looked into it much, but I did see that quest::modifynpcstat() does change the maxhp for the mob it's called on. So, based on your description, I'd guess that it's actually a problem with something in the spell handling. It probably pulls a max hp value from the database somewhere.

If you modify an npc and fight it without ever casting a spell, does it work properly? Conversely, does anything other than spells cause it to reset?
Yes. if no spells are casted on NPC- and it just fights - as it takes melee dmg, the hps are updated corectly with new max in mind.

So far I cannot tell if anything else can cuase hps to revert other that spells

Note that not just the nukes cause hps to revert- casting a pure Ac buff , or haste or stat buff/debuff - causes the revert of hp to default
Reply With Quote
  #15  
Old 06-23-2009, 09:08 PM
realityincarnate
Developer
 
Join Date: Dec 2007
Posts: 122
Default

Ok, I think I got it. Anytime a spell lands, it recalculates the max hp in case the spell granted any bonuses. The command was directly changing the npc's max hp but not changing the base value that was used in these calculations. I seem to have it fixed in revision 709, but it could probably use some more rigorous testing.
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:13 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3