Greetings,
The following code will fix the problem that you have an onDeEquip when you logout.
For those who used a static code like this (example)
that if you reloged, the ammount would have been added again, without removing it first (so the player can add everytime he relogs the 100 more max health)
example:
Then this is the solution for your problem:
0.2.x Version!
search for:
goto:
add this afterwards:
compile and you're done.
0.3.x Version! (I'm not sure if 0.4 has this bug aswell)
search for:
goto:
add this afterwards:
rebuild and you're done.
kind regards, Evil Hero.
The following code will fix the problem that you have an onDeEquip when you logout.
For those who used a static code like this (example)
Code:
function onEquip(cid, item, slot)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 100)
return true
end
function onDeEquip(cid, item, slot)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 100)
return true
end
example:
Code:
Player has 800hp
relog..
Player has 900hp
another relog...
Player has 1000hp
and so on...
Then this is the solution for your problem:
0.2.x Version!
search for:
Code:
void Player::eek:nCreatureDisappear(const Creature* creature, uint32_t stackpos, bool isLogout)
Code:
if(isLogout)
{
loginPosition = getPosition();
lastLogout = time(NULL);
}
Code:
//Evil Hero, handling DeEquip if the Player logout or die.
Item* item;
for(int32_t slot = SLOT_FIRST; slot < SLOT_LAST; ++slot)
{
if((item = getInventoryItem((slots_t)slot)))
{
g_moveEvents->onPlayerDeEquip(this, item, (slots_t)slot, false);
}
}
compile and you're done.
0.3.x Version! (I'm not sure if 0.4 has this bug aswell)
search for:
Code:
void Player::eek:nCreatureDisappear(const Creature* creature, bool isLogout)
Code:
if(isLogout)
{
loginPosition = getPosition();
lastLogout = time(NULL);
}
Code:
//Evil Hero, handling DeEquip if the Player logout or die.
Item* item = NULL;
for(int32_t slot = SLOT_FIRST; slot < SLOT_LAST; ++slot)
{
if(!(item = getInventoryItem((slots_t)slot)))
continue;
g_moveEvents->onPlayerDeEquip(this, item, (slots_t)slot, false);
}
rebuild and you're done.
kind regards, Evil Hero.
Last edited: