WiLDTuRTLE
Member
- Joined
- Feb 26, 2011
- Messages
- 478
- Reaction score
- 5
My first manarune (the one that works) I want it to heal based on level and magic level ,
2. I got that manarune that would probably be perfect for me but it doesnt works, it gives me and error.
http://img716.imageshack.us/img716/6159/manarune.png
THAANKS FOR ALL THE HELP I APRECIATE IT
- - - Updated - - -
bump still not fixed
- - - Updated - - -
added the pic! bump
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
function onUse(cid, item, fromPosition, itemEx, toPosition)
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local mana_minimum = (level * 1) + (mlevel * 1) - 50
local mana_maximum = (level * 1.2) + (mlevel * 1)
local mana_add = math.random(mana_minimum, mana_maximum)
doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
doRemoveitem(item.uid)
return TRUE
end
2. I got that manarune that would probably be perfect for me but it doesnt works, it gives me and error.
http://img716.imageshack.us/img716/6159/manarune.png
Code:
-- Script by Optus @ OTLand.net
function onUse(cid, item, fromPosition, itemEx, toPosition)
local _setup = {
lvl, mag = getPlayerLevel(cid), getPlayerMagLevel(cid), -- Dont edit.
message = "Aaaah...", -- Message to appear after use.
vocations = true, -- True = different formula for each vocation. False = same formula.
effectID = 32, -- EffectID onuse.
staticformulaMin = _setup.lvl * 1 + _setup.mag * 1 + 20, -- min Static formula that all vocations have if vocations is false.
staticformulaMax = _setup.lvl * 2 + _setup.mag * 2 + 20, -- max Static formula that all vocations have if vocations is false.
rdm = math.random(_setup.staticformulaMin, _setup.staticformulaMax),
addHP = true, -- Also make the use add health. True = yes, False = no.
exhaust = createConditionObject(CONDITION_EXHAUST_HEAL),
setConditionParam(_setup.exhaust, CONDITION_PARAM_TICKS, _setup.exhaustTime),
exhaustTime = 1000 -- exhaust on time 1000 = 1 second exhaust. 10 = 10 second exhaust. NOT COOLDOWN.
}
local k_setup = { -- skip this if vocations set to false.
lvl, mag = getPlayerLevel(cid), getPlayerMagLevel(cid), -- Dont edit.
min1, max1 = k_setup.lvl * 1 + k_setup.mag * 1, k_setup.lvl * 2 + k_setup.mag * 2, -- minimum, and maximum formula for knights.
rdm = math.random(min1, max1)
}
local m_setup = { -- skip this if vocations set to false.
lvl, mag = getPlayerLevel(cid), getPlayerMagLevel(cid), -- Dont edit.
min2, max2 = m_setup.lvl * 1 + k_setup.mag * 1, m_setup.lvl * 2 + m_setup.mag * 2, -- minimum, and maximum formula for sorcerers and druids.
rdm = math.random(min2, max2)
}
local p_setup = { -- skip this if vocations set to false.
lvl, mag = getPlayerLevel(cid), getPlayerMagLevel(cid), -- Dont edit.
min3, max3 = p_setup.lvl * 1 + p_setup.mag * 1, p_setup.lvl * 2 + p_setup.mag * 2, -- minimum, and maximum formula for paladins.
rdm = math.random(min3, max3)
}
setConditionParam(_setup.exhaust, CONDITION_PARAM_TICKS, _setup.exhaustTime)
-- end of setup
if(getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
if isPlayer(itemEx.uid) and _setup.vocations == false and _setup.addHP == false then
doCreatureSay(cid, _setup.message, TALKTYPE_ORANGE_1)
doPlayerAddMana(itemEx.uid, _setup.rdm)
doAddCondition(cid, _setup.exhaust)
doSendMagicEffect(getPlayerPosition(cid), _setup.effectID)
elseif isPlayer(itemEx.uid) and _setup.vocations == false and _setup.addHP == true then
doCreatureSay(cid, _setup.message, TALKTYPE_ORANGE_1)
doPlayerAddMana(itemEx.uid, _setup.rdm)
doCreatureAddHealth(itemEx.uid, _setup.rdm)
doAddCondition(cid, _setup.exhaust)
doSendMagicEffect(getPlayerPosition(cid), _setup.effectID)
end
if isPlayer(itemEx.uid) and _setup.vocations == true and isKnight(cid) then
doCreatureSay(cid, _setup.message, TALKTYPE_ORANGE_1)
doPlayerAddMana(itemEx.uid, k_setup.rdm)
doAddCondition(cid, _setup.exhaust)
doSendMagicEffect(getPlayerPosition(cid), _setup.effectID)
elseif isPlayer(itemEx.uid) and _setup.vocations == true and isKnight(cid) and _setup.addHP == true then
doCreatureSay(cid, _setup.message, TALKTYPE_ORANGE_1)
doPlayerAddMana(itemEx.uid, k_setup.rdm)
doCreatureAddHealth(itemEx.uid, k_setup.rdm)
doAddCondition(cid, _setup.exhaust)
doSendMagicEffect(getPlayerPosition(cid), _setup.effectID)
end
if isPlayer(itemEx.uid) and _setup.vocations == true and isSorcerer(cid) or isDruid(cid) then
doCreatureSay(cid, _setup.message, TALKTYPE_ORANGE_1)
doPlayerAddMana(itemEx.uid, m_setup.rdm)
doAddCondition(cid, _setup.exhaust)
doSendMagicEffect(getPlayerPosition(cid), _setup.effectID)
elseif isPlayer(itemEx.uid) and _setup.vocations == true and isSorcerer(cid) or isDruid(cid) and _setup.addHP == true then
doCreatureSay(cid, _setup.message, TALKTYPE_ORANGE_1)
doPlayerAddMana(itemEx.uid, m_setup.rdm)
doCreatureAddHealth(itemEx.uid, m_setup.rdm)
doAddCondition(cid, _setup.exhaust)
doSendMagicEffect(getPlayerPosition(cid), _setup.effectID)
end
if isPlayer(itemEx.uid) and _setup.vocations == true and isPaladin(cid) then
doCreatureSay(cid, _setup.message, TALKTYPE_ORANGE_1)
doPlayerAddMana(itemEx.uid, p_setup.rdm)
doAddCondition(cid, _setup.exhaust)
doSendMagicEffect(getPlayerPosition(cid), _setup.effectID)
elseif isPlayer(itemEx.uid) and _setup.vocations == true and isPaladin(cid) and _setup.addHP == true then
doCreatureSay(cid, _setup.message, TALKTYPE_ORANGE_1)
doPlayerAddMana(itemEx.uid, p_setup.rdm)
doCreatureAddHealth(itemEx.uid, p_setup.rdm)
doAddCondition(cid, _setup.exhaust)
doSendMagicEffect(getPlayerPosition(cid), _setup.effectID)
end
return true
end
THAANKS FOR ALL THE HELP I APRECIATE IT
- - - Updated - - -
bump still not fixed
- - - Updated - - -
added the pic! bump
Last edited: