What's new

Skrypty & Kody Mana runa

sempele

Active User
Joined
Nov 19, 2010
Messages
107
Reaction score
3
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]
 

Avari

Active User
Joined
Jun 29, 2017
Messages
55
Reaction score
2
Odp: Mana runa

Pobaw si? z tym skryptem:

[LUA]function onUse(cid, item, frompos,itemEx,topos)
if exhaustion.check(cid, 381214) then
return false
end
exhaustion.set(cid, 381214, 0.96)
if not isPlayer(itemEx.uid) then
return false
end
local level = getPlayerLevel(cid)
if level < 200 then -- LEVEL----------------------------------------------------------------
return doPlayerSendCancel(cid,"You need to have 200 level or higher to use sMR.")
end
local mlevel = getPlayerMagLevel(cid)
local pos = getPlayerPosition(cid)
-- Mana Formula Settings --
-- You can use "level" and "mlevel" --
local mana_minimum = (level * 5.1) + (mlevel * 4.7) - 50
local mana_maximum = (level * 5.5) + (mlevel * 5.1)
-- Mana Formula Settings END --
local mana_add = math.random(mana_minimum, mana_maximum)
doPlayerAddMana(itemEx.uid, mana_add)
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doSendAnimatedText(topos, "+"..mana_add, TEXTCOLOR_PURPLE)
return true
end[/LUA]
 
Top