ModifyMaxHP / ModifyMaxPower

Discussions on development of both the EQ2Emulator LUA Script Engine and Script specifications

Moderator: Team Members

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

ModifyMaxHP / ModifyMaxPower

Post by Jabantiz » Thu Sep 12, 2013 3:50 pm

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?

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: ModifyMaxHP / ModifyMaxPower

Post by thefoof » Thu Sep 12, 2013 5:51 pm

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());

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

Re: ModifyMaxHP / ModifyMaxPower

Post by Jabantiz » Thu Sep 12, 2013 6:24 pm

Yes it should be, looks like SetMaxPower is wrong as well and needs to be changed to use ITEM_STAT_MAXMANA.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests