Hello guys.
I have a problem with 2 items adding percent to max mana and health. When I use a bonus ki and bonus hp at the same time, one of them stops working, mana / hp back to normal, depends what I use first. Example: I have 20k mana, use bonus ki and i have 25k mana, I use the bonus hp and I back 20k mana, the health I have more. I would like to be was to use two at the same time.
Please help. ;p
This is my scripts:
PS: Sorry for my english :blink:
Bonus ki:
Bonus hp:
I have a problem with 2 items adding percent to max mana and health. When I use a bonus ki and bonus hp at the same time, one of them stops working, mana / hp back to normal, depends what I use first. Example: I have 20k mana, use bonus ki and i have 25k mana, I use the bonus hp and I back 20k mana, the health I have more. I would like to be was to use two at the same time.
Please help. ;p
This is my scripts:
PS: Sorry for my english :blink:
Bonus ki:
Code:
local vocations = {191, 179, 182, 203, 197, 206, 209, 212, 185, 200, 227, 239, 194, 188, 251, 264, 6, 12, 18, 24, 30, 36, 42, 48, 63, 74, 81, 171, 220, 232, 244, 257}
local manaPercent = 15 --- How many % MP add!
local time = 900 -- time in seconds
local storage = 40061 -- Must be unused!
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local addmana = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(addmana, CONDITION_PARAM_BUFF, true)
setConditionParam(addmana, CONDITION_PARAM_STAT_MAXMANAPERCENT, 100 + manaPercent)
setConditionParam(addmana, CONDITION_PARAM_TICKS, -1)
setCombatCondition(combat, addmana)
function remove(cid)
setPlayerStorageValue(cid,s,0)
doPlayerSendTextMessage(cid, 23, "Bonus Ki is time out!")
doRemoveCondition(cid, CONDITION_ATTRIBUTES)
exhaustion.set(cid, storage, 300)
end
function onUse(cid, item)
if isInArray(vocations, getPlayerVocation(cid)) then
if exhaustion.get(cid, storage) == FALSE then
doCombat(cid, combat, numberToVariant(cid))
doCreatureSay(cid, "Yeeeah, Bonus Ki!!!\nFeel the power!", 19)
doSendMagicEffect(getCreaturePosition(cid), 133) -
addEvent(remove,time*1000+40, cid)
exhaustion.set(cid, storage, time)
else
doPlayerSendCancel(cid, "Sorry, you only can again use this item after " .. exhaustion.get(cid, storage) .. " seconds.")
end
else
doPlayerSendCancel(cid, "Sorry, you must be on last transform!")
end
return TRUE
end
Bonus hp:
Code:
local vocations = {191, 179, 182, 203, 197, 206, 209, 212, 185, 200, 227, 239, 194, 188, 251, 264, 6, 12, 18, 24, 30, 36, 42, 48, 63, 74, 81, 171, 220, 232, 244, 257}
local healthPercent = 15
local time = 900
local storage = 40063
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local addhealth = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(addhealth, CONDITION_PARAM_BUFF, true)
setConditionParam(addhealth, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 100 + healthPercent)
setConditionParam(addhealth, CONDITION_PARAM_TICKS, -1)
setCombatCondition(combat, addhealth)
function remove3(cid)
setPlayerStorageValue(cid,s,0)
doPlayerSendTextMessage(cid, 23, "Bonus Hp is time out!")
doRemoveCondition(cid, CONDITION_ATTRIBUTES)
exhaustion.set(cid, storage, 300)
end
function onUse(cid, item)
if isInArray(vocations, getPlayerVocation(cid)) then
if exhaustion.get(cid, storage) == FALSE then
doCombat(cid, combat, numberToVariant(cid))
doCreatureSay(cid, "Yeeeah, Bonus HP!!!\nFeel the power!", 19)
doSendMagicEffect(getCreaturePosition(cid), 133)
addEvent(remove,time*1000+40, cid)
exhaustion.set(cid, storage, time)
else
doPlayerSendCancel(cid, "Sorry, you only can again use this item after " .. exhaustion.get(cid, storage) .. " seconds.")
end
else
doPlayerSendCancel(cid, "Sorry, you must be on last transform!")
end
return TRUE
end
Last edited: