Hi
so i dont exactly know how this bug works, but i noticed couple thinks so lets say my vocation has four transformations every transformation increase health and mana bar so the problem is when i die my health somehow increase randomly and mana drops to zero, and second think i'm not sure about this one. Its really hard to explain so i'll try my best lets say you have 200Hp with default and then you take some items that adds +100hp so now we have 300hp and then i type transform and transform add +200 so now i have 500hp, right? So now when i'm transformed lets say i want to take my item off so now it should be -100 and i should have 400 but the problem that i have 500 so its like if i add items that gives me hp i can bug my health. So i suppose i should show my transform system
This is revert
bump
bump
bump
upupupup
bump
bump
bump
so i dont exactly know how this bug works, but i noticed couple thinks so lets say my vocation has four transformations every transformation increase health and mana bar so the problem is when i die my health somehow increase randomly and mana drops to zero, and second think i'm not sure about this one. Its really hard to explain so i'll try my best lets say you have 200Hp with default and then you take some items that adds +100hp so now we have 300hp and then i type transform and transform add +200 so now i have 500hp, right? So now when i'm transformed lets say i want to take my item off so now it should be -100 and i should have 400 but the problem that i have 500 so its like if i add items that gives me hp i can bug my health. So i suppose i should show my transform system
Code:
function onSay(player, words, param)
local kurwa_gdzie_jest_efekt = Position(player:getPosition().x + 1, player:getPosition().y, player:getPosition().z)
local pid = player:getId()
local TRANS = transform[player:getVocation():getId()]
if not TRANS then
player:sendCancelMessage("TRANSFORM ERROR 11. Vocation = " .. player:getVocation():getId() .. "") -- VOCATION NOT IN GLOBAL TABLE
return false
end
if TRANS.newVoc == 0 then
player:sendCancelMessage("You cannot transform.")
return false
end
if player:getLevel() < TRANS.level then
player:sendCancelMessage("You must reach level "..TRANS.level.." to transform.")
return false
end
if player:getSoul() < TRANS.rage then
player:sendCancelMessage("You need "..TRANS.rage.." to transform.")
return false
end
local outfit = player:getOutfit()
outfit.lookType = TRANS.looktype
if TRANS.constant then
player:setOutfit(outfit)
else
player:setOutfit(outfit, true)
end
player:addSoul(-TRANS.rage)
player:setMaxHealth(player:getMaxHealth() + TRANS.addHealth)
player:setMaxMana(player:getMaxMana() + TRANS.addMana)
kurwa_gdzie_jest_efekt:sendMagicEffect(TRANS.effect)
player:setVocation(TRANS.newVoc)
player:save()
return false
end
Code:
local function removeExhaust(pid)
exhaust_transform[pid] = nil
end
function onSay(player, words, param, channel)
local pid = player:getId()
if exhaust_transform[pid] ~= nil then
return false
end
local TRANS = transform[player:getVocation():getId()]
if not TRANS then
player:sendCancelMessage("TRANSFORM ERROR 11. Vocation = " .. player:getVocation():getId() .. "") -- VOCATION NOT IN GLOBAL TABLE
return false
end
if TRANS.fromVoc == 0 then
player:sendCancelMessage("You cannot revert.")
return false
end
for i = 1, TRANS.transform do
player:setVocation(TRANS.fromVoc)
TRANS = transform[player:getVocation():getId()]
local outfit = player:getOutfit()
outfit.lookType = TRANS.from_looktype
if TRANS.constant then
player:setOutfit(outfit)
else
player:setOutfit(outfit, false)
end
player:setMaxHealth(player:getMaxHealth() - TRANS.addHealth)
player:setMaxMana(player:getMaxMana() - TRANS.addMana)
end
player:save()
exhaust_transform[pid] = 1
addEvent(removeExhaust, 5 * 1000, pid)
return false
end
bump
bump
bump
upupupup
bump
bump
bump
Last edited by a moderator: