canary
canary copied to clipboard
Conditions are not being reseted upon death
Oki so I have a bug with soulfire runes, fire bombs and all this kind of mechanic, some example: Person A fights with person B, A soulfires person B, after for example 2 minutes, person A dies, and respawn in temple but person B is still soulfired, so almost instantly person A gets skull even after she died coz this fire damage does not reset.
Someone have idea how to fix it?
Add this on logout: player:removeAllConditions()
function Player.removeAllConditions(self) local conditions = { CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY, CONDITION_PARALYZE, CONDITION_DRUNK, CONDITION_DROWN, CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED, CONDITION_BLEEDING, CONDITION_HASTE } for i = 1, #conditions do self:removeCondition(conditions[i]) end end
Add this on logout: player:removeAllConditions()
function Player.removeAllConditions(self) local conditions = { CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY, CONDITION_PARALYZE, CONDITION_DRUNK, CONDITION_DROWN, CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED, CONDITION_BLEEDING, CONDITION_HASTE } for i = 1, #conditions do self:removeCondition(conditions[i]) end end
you can show me exactly how to add it?
Function to functions.lua and execution in logout.lua
I put this into player_death.lua `local conditions = { CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY, CONDITION_PARALYZE, CONDITION_DRUNK, CONDITION_DROWN, CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED, CONDITION_BLEEDING, CONDITION_HASTE } for i = 1, #conditions do killer:removeCondition(conditions[i]) end And it delete all condition, but if player B will go back on fire, player A get skull :/
after for example 2 minutes, person A dies, and respawn in temple but person B is still soulfired, so almost instantly person A gets skull even after she died coz this fire damage does not reset.
It's related to player ID generator code: https://github.com/opentibiabr/otservbr-global/blob/develop/src/creatures/players/player.h#L155-L161
In all old engines player ID changed every relog, so after relog 'fire condition' and 'fire filed' had no owner - it's 'owner id' pointed to not existing player. In otservbr it was changed, because client 12.x expects same ID of player every relog, to keep windows/backpacks positions and other settings for given player.
after for example 2 minutes, person A dies, and respawn in temple but person B is still soulfired, so almost instantly person A gets skull even after she died coz this fire damage does not reset.
It's related to player ID generator code: https://github.com/opentibiabr/otservbr-global/blob/develop/src/creatures/players/player.h#L155-L161
In all old engines player ID changed every relog, so after relog 'fire condition' and 'fire filed' had no owner - it's 'owner id' pointed to not existing player. In otservbr it was changed, because client 12.x expects same ID of player every relog, to keep windows/backpacks positions and other settings for given player.
So no one has any idea how to fix it in the current version
Your issue will be transferred to the canary repository
This issue is stale because it has been open 120 days with no activity.
This issue is stale because it has been open 120 days with no activity.