Xedoxo
Member
- Joined
- Oct 24, 2010
- Messages
- 81
- Reaction score
- 7
Hi,
I have edited files in client and also items.otb in TFS.
![1718412820278.png 1718412820278.png](https://static3.otland.net/d/attachments/77/77038-195182f01ba1667a57c21c9a33fdb5af.jpg)
![1718413146275.png 1718413146275.png](https://static3.otland.net/d/attachments/77/77040-0168b2ccb88761a5fb7a7ba85d69b294.jpg)
![1718412853761.png 1718412853761.png](https://static3.otland.net/d/attachments/77/77039-7d1395e3de257bfa9d32fddab916f697.jpg)
And when using at yourself it adds mana, but not vanish after use - like infinity uses. How to fix it?
code i using to add mana:
I have edited files in client and also items.otb in TFS.
![1718412820278.png 1718412820278.png](https://static3.otland.net/d/attachments/77/77038-195182f01ba1667a57c21c9a33fdb5af.jpg)
![1718413146275.png 1718413146275.png](https://static3.otland.net/d/attachments/77/77040-0168b2ccb88761a5fb7a7ba85d69b294.jpg)
![1718412853761.png 1718412853761.png](https://static3.otland.net/d/attachments/77/77039-7d1395e3de257bfa9d32fddab916f697.jpg)
And when using at yourself it adds mana, but not vanish after use - like infinity uses. How to fix it?
code i using to add mana:
Lua:
[7491] = {mana = {80, 120}, vocations = {1, 2, 3, 4, 5, 6, 7, 8}, level = 1,
description = "Aaaah mana!"},
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if type(target) == "userdata" and not target:isPlayer() then
return false
end
local potion = potions[item:getId()]
if potion.level and player:getLevel() < potion.level or potion.vocations and not table.contains(potion.vocations, player:getVocation():getBase():getId()) and not (player:getGroup():getId() >= 2) then
player:say(potion.description, TALKTYPE_MONSTER_SAY)
return true
end
if player:getCondition(CONDITION_EXHAUST_HEAL) then
player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
return true
end
if potion.health or potion.mana or potion.combat then
if potion.health then
doTargetCombatHealth(0, target, COMBAT_HEALING, potion.health[1], potion.health[2], CONST_ME_MAGIC_BLUE)
end
if potion.mana then
doTargetCombatMana(0, target, potion.mana[1], potion.mana[2], CONST_ME_MAGIC_BLUE)
end
if potion.combat then
potion.combat:execute(target, Variant(target:getId()))
end
player:addAchievementProgress('Potion Addict', 100000)
target:say("Aaaah...", TALKTYPE_MONSTER_SAY)
player:addItem(potion.flask, 1)
player:addCondition(exhaust)
player:setStorageValue(38412, player:getStorageValue(38412)+1)
end
if potion.condition then
player:addCondition(potion.condition)
player:say(potion.text, TALKTYPE_MONSTER_SAY)
player:getPosition():sendMagicEffect(potion.effect)
end
if potion.transform then
item:transform(potion.transform.id[math.random(#potion.transform.id)])
item:getPosition():sendMagicEffect(potion.effect)
return true
end
if not configManager.getBoolean(configKeys.REMOVE_POTION_CHARGES) then
return true
end
local client = player:getClient()
if client.version > 1140 then
player:updateSupplyTracker(item)
end
item:remove(1)
return true
end