oshrigames
Active Member
hello
first im using TFS 1.2 (protocol 10.98).
id like to add a cooldown on my custom potions ive been working on for my alchemy system.
for balance reasons i need to make sure not multiple potions can be used at once and have exhaustion for the user.
i've tried but failed in all my attempts to do it on my own.
1) custom pot can be used once per 5 minutes.
2) only one pot effect can be active at a time.
3) diffrent player can't by pass 2. by use potion his friend.
this is a one of my potions (which will release once it's all done)
potions ideas:
ID 21449.
Elixir of Fortitude (tier 3+)
Buff: +8 hp per 2 sec, +100 max hp.
Debuff: minor paralyze, drunk.
Duration: 60 sec.
exhaustion: 5 min.
any help will be much appreciated ♥
first im using TFS 1.2 (protocol 10.98).
id like to add a cooldown on my custom potions ive been working on for my alchemy system.
for balance reasons i need to make sure not multiple potions can be used at once and have exhaustion for the user.
i've tried but failed in all my attempts to do it on my own.
1) custom pot can be used once per 5 minutes.
2) only one pot effect can be active at a time.
3) diffrent player can't by pass 2. by use potion his friend.
this is a one of my potions (which will release once it's all done)
potions ideas:
ID 21449.
Elixir of Fortitude (tier 3+)
Buff: +8 hp per 2 sec, +100 max hp.
Debuff: minor paralyze, drunk.
Duration: 60 sec.
exhaustion: 5 min.
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
combat:setCondition(condition)
local condition = Condition(CONDITION_REGENERATION)
condition:setParameter(CONDITION_PARAM_SUBID, 3)
condition:setParameter(CONDITION_PARAM_TICKS, 60000) -- 1 minute
condition:setParameter(CONDITION_PARAM_HEALTHGAIN, 8) -- heal 8 hp every 2 sec
condition:setParameter(CONDITION_PARAM_HEALTHTICKS, 2000) -- 2 sec
condition:setParameter(CONDITION_PARAM_BUFF_SPELL, true)
local condition1 = Condition(CONDITION_ATTRIBUTES)
condition1:setParameter(CONDITION_PARAM_SUBID, 2)
condition1:setParameter(CONDITION_PARAM_TICKS, 60000) -- 1 minute
condition1:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTS, 100) -- gain 100 to max hp
local condition2 = Condition(CONDITION_PARALYZE)
condition2:setParameter(CONDITION_PARAM_SUBID, 1)
condition2:setParameter(CONDITION_PARAM_TICKS, 60000) -- 1 minute
condition2:setFormula(-0.4, 0, -0.4, 0) -- base speed = 200 | exemple A: (0.2, 0, 0.2, 0) = 240 speed. (20% of base speed) | exemple B: (0, 20, 0, 20) = 210 speed. (20/2)
local condition3 = Condition(CONDITION_DRUNK)
condition3:setParameter(CONDITION_PARAM_TICKS, 60000)
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
player:addCondition(condition)
if player:addCondition(condition1) and player:addCondition(condition2) and player:addCondition(condition3) then
player:getPosition():sendMagicEffect(CONST_ME_POFF)
Item(item.uid):remove(1)
end
return true
end
any help will be much appreciated ♥