• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Problem with two items adding percent to max mana / hp.

Zielas92

New Member
Joined
Oct 24, 2010
Messages
17
Reaction score
0
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:

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:
Lua:
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_SUBID, 1)
setConditionParam(addmana, CONDITION_PARAM_STAT_MAXMANAPERCENT, 100 + manaPercent) 
setConditionParam(addmana, CONDITION_PARAM_TICKS, time * 1000)
setCombatCondition(combat, addmana)
 
function remove(cid)
	if not isPlayer(cid) then
		return true
	end
	doPlayerSendTextMessage(cid, 23, "Bonus Ki is time out!")
        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, 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
Lua:
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_SUBID, 2)
setConditionParam(addhealth, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 100 + healthPercent) 
setConditionParam(addhealth, CONDITION_PARAM_TICKS, time * 1000)
setCombatCondition(combat, addhealth)
 
function remove3(cid)
	if not isPlayer(cid) then
		return true
	end
	doPlayerSendTextMessage(cid, 23, "Bonus Hp is time out!")
	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(remove3,time*1000, 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:
Back
Top