Set Max HP

General support forum. If you require assistance and your problem doesnt fall in any of the other categories, this is the forum for you!

Moderator: Team Members

Forum rules
READ THE FORUM STICKY THREADS BEFORE ASKING FOR HELP!
Most information can be found there, and if not, the posts will help you determine the information required to get assistance from the development team.
Incomplete Help Requests will be locked or deleted.
Post Reply
User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Set Max HP

Post by Gangrenous » Tue May 07, 2019 9:33 am

Regarding this prior post

https://www.eq2emulator.net/phpBB3/view ... xhp#p33640

Could someone please make this change. If we send a character sheet change, it fixes it.
LuaFunctions.cpp around 1273

Code: Select all

int EQ2Emu_lua_SetMaxHP(lua_State* state){
	if(!lua_interface)
		return 0;
	Spawn* spawn = lua_interface->GetSpawn(state);
	sint32 value = lua_interface->GetSInt32Value(state, 2);
	lua_interface->ResetFunctionStack(state);
	if (spawn && spawn->IsEntity() && value > 0)
		((Entity*)spawn)->AddSpellBonus(0, ITEM_STAT_HEALTH, value - spawn->GetTotalHP());
	
	if (spawn->IsPlayer())
			((Player*)spawn)->SetCharSheetChanged(true);
		
	return 0;
}
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Set Max HP

Post by Jabantiz » Tue May 07, 2019 12:29 pm

Committed this change.

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Re: Set Max HP

Post by Ememjr » Tue May 07, 2019 2:34 pm

any idea when the compile will be fixed, or is it

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Set Max HP

Post by Jabantiz » Tue May 07, 2019 3:59 pm

I just checked and my connection was refused so no clue when it will be back.

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Set Max HP

Post by Gangrenous » Tue May 07, 2019 5:21 pm

What is the issue anyway? I hear bits and pieces.
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Set Max HP

Post by Jabantiz » Tue May 07, 2019 6:09 pm

Currently ssh is refusing connections so we can't remote connect to the server at this time.

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Re: Set Max HP

Post by Ememjr » Wed May 08, 2019 4:08 am

this same change should most likely be made to SetMaxPower as well in fact, any script that uses ((Entity*)spawn)->AddSpellBonus( should be following it with SetCharSheetChanged(true);

or better yet maybe the void Entity::AddSpellBonus() function should call SetCharSheetChanged(true); then none of the lua functions would have to call it any more, but i am sure there are many reasons it would not work

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Set Max HP

Post by Jabantiz » Wed May 08, 2019 4:20 pm

I would have thought that AddSpellBonus() would set the flag if it was a player and if the spell got applied but yea it would be better to put it in there then having it scattered across multiple lua function.

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Set Max HP

Post by Gangrenous » Wed May 08, 2019 4:51 pm

I concur
Resident Dirty Hippy

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests