Page 1 of 1

ModifyMaxHP / ModifyMaxPower

Posted: Thu Sep 12, 2013 3:50 pm
by Jabantiz
While going over and documenting the lua functions I noticed we have these two functions coded out

Code: Select all

int EQ2Emu_lua_ModifyMaxHP(lua_State* state)
int EQ2Emu_lua_ModifyMaxPower(lua_State* state)
They are not registered however so a lua script can never use them, also it seems to be the same thing as SetMaxHP and SetMaxPower which both modify the element by the given value, they just accomplish it different ways. Should we just delete these 2 functions or register them and allow them to be used in lua scripts?

Re: ModifyMaxHP / ModifyMaxPower

Posted: Thu Sep 12, 2013 5:51 pm
by thefoof
Looking at SetMaxHP, shouldn't the stat be ITEM_STAT_MAXHP? Not sure if SetMaxHP works right, but I don't see why we would need more than 1 function that does the same thing ultimately.

Code: Select all

if(spawn && spawn->IsEntity() && value > 0)
		((Entity*)spawn)->AddSpellBonus(0, ITEM_STAT_HEALTH, value - spawn->GetTotalHP());

Re: ModifyMaxHP / ModifyMaxPower

Posted: Thu Sep 12, 2013 6:24 pm
by Jabantiz
Yes it should be, looks like SetMaxPower is wrong as well and needs to be changed to use ITEM_STAT_MAXMANA.