Witam. Oto skrypt:
[LUA]local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, EXHAUST_HEALING)
function onUse(cid, item, fromPosition, itemEx, toPosition)
local min, max
local lvl, mag = getPlayerLevel(cid), getPlayerMagLevel(cid)
if isSorcerer(cid) or isDruid(cid) then
min = lvl * 1.0 + mag * 1.0
max = lvl * 1.0 + mag * 1.0
elseif isPaladin(cid) then
min = lvl * 1.0 + mag * 1.0
max = lvl * 1.0 + mag * 1.0
elseif isKnight(cid) then
min = lvl * 0.5 + mag * 0.5
max = lvl * 1.0 + mag * 1.0
end
local rand = math.random(min, max)
if rand > 550 then
rand = 550
end
if rand < 350 then
rand = 350
end
if hasCondition(cid, CONDITION_EXHAUST, EXHAUST_HEALING) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
end
if not isPlayer(itemEx.uid) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
return doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE) and doPlayerAddMana(itemEx.uid, rand) and doAddCondition(cid, exhaust) and doCreatureSay(itemEx.uid, "Aaah...", TALKTYPE_ORANGE_1)
end[/LUA]
M?j problem polega na tym, ?e jak zmieni? np. min = lvl * 1.0 + mag * 1.0 na inne warto?ci np. min = lvl * 2.0 + mag * 2.0 i pr?buj? u?y? mana runy to jest to niemo?liwe i wyskakuje mi b??d w konsoli:
[LUA]https://zapodaj.net/a3f166c3233f2.png.html
[/LUA]
[LUA]local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, EXHAUST_HEALING)
function onUse(cid, item, fromPosition, itemEx, toPosition)
local min, max
local lvl, mag = getPlayerLevel(cid), getPlayerMagLevel(cid)
if isSorcerer(cid) or isDruid(cid) then
min = lvl * 1.0 + mag * 1.0
max = lvl * 1.0 + mag * 1.0
elseif isPaladin(cid) then
min = lvl * 1.0 + mag * 1.0
max = lvl * 1.0 + mag * 1.0
elseif isKnight(cid) then
min = lvl * 0.5 + mag * 0.5
max = lvl * 1.0 + mag * 1.0
end
local rand = math.random(min, max)
if rand > 550 then
rand = 550
end
if rand < 350 then
rand = 350
end
if hasCondition(cid, CONDITION_EXHAUST, EXHAUST_HEALING) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
end
if not isPlayer(itemEx.uid) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
return doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE) and doPlayerAddMana(itemEx.uid, rand) and doAddCondition(cid, exhaust) and doCreatureSay(itemEx.uid, "Aaah...", TALKTYPE_ORANGE_1)
end[/LUA]
M?j problem polega na tym, ?e jak zmieni? np. min = lvl * 1.0 + mag * 1.0 na inne warto?ci np. min = lvl * 2.0 + mag * 2.0 i pr?buj? u?y? mana runy to jest to niemo?liwe i wyskakuje mi b??d w konsoli:
[LUA]https://zapodaj.net/a3f166c3233f2.png.html
[/LUA]