Odp: Lekkie przerobienie manaruny.
Aktualnie nie podoba mi si? to, ?e np. przy u?ywaniu MR jest za du?y exh i nie mo?na wpisa? np Utamo Vita i jest to bardzo uci??liwe.
okej to pozostaje ci albo to zmienic na 500 i moc ni? spamowa? albo zrobi? j? w action np. tak jak to jest w kilku skryptach pokazane
[XML]<action itemid="XXXX" event="script" value="other/rune.lua"/>[/XML]
[LUA]local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000) -- time in seconds x1000
function onUse(cid, item, fromPosition, itemEx, toPosition)
local manamax = getPlayerMaxMana(cid)
local min = 3 -- this means 3% minimum healing
local max = 5 -- this means 5% maximum healing
local mana_add = math.random((manamax * (min/100)), (manamax * (max/100)))
if(hasCondition(cid, CONDITION_EXHAUST)) then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted")
return true
end
doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doSendAnimatedText(getPlayerPosition(cid),"+"..mana_add.."", TEXTCOLOR_LIGHTBLUE)
doAddCondition(cid, exhaust)
return true
end[/LUA]
Hp rune (heals % hp of maxhealth).
[LUA]local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000) -- time in seconds x1000
function onUse(cid, item, fromPosition, itemEx, toPosition)
local hpmax = getCreatureMaxHealth(cid)
local min = 3 -- this means 3% minimum healing
local max = 5 -- this means 5% maximum healing
local hp_add = math.random((hpmax * (min/100)), (hpmax * (max/100)))
if(hasCondition(cid, CONDITION_EXHAUST)) then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted")
return true
end
doCreatureAddHealth(cid, hp_add)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doSendAnimatedText(getPlayerPosition(cid),"+"..hp_add.."", TEXTCOLOR_GREEN)
doAddCondition(cid, exhaust)
return true
end[/LUA]
Hp and mana.
[LUA]local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000) -- time in seconds x1000
function onUse(cid, item, fromPosition, itemEx, toPosition)
local hpmax, manamax = getCreatureMaxHealth(cid), getPlayerMaxMana(cid)
local minhp, maxhp = 3, 5 -- this means 3% minimum hp healing and 5% maximum hp healing
local minmana, maxmana = 3, 5 -- this means 3% minimum mana healing and 5% maximum mana healing
local hp_add, mana_add = math.random((hpmax * (minhp/100)), (hpmax * (maxhp/100))), math.random((manamax * (minmana/100)), (manamax * (maxmana/100)))
if(hasCondition(cid, CONDITION_EXHAUST)) then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted")
return true
end
doCreatureAddHealth(cid, hp_add)
doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doSendAnimatedText(getPlayerPosition(cid),"+"..hp_add.."", TEXTCOLOR_GREEN)
doAddCondition(cid, exhaust)
return true
end[/LUA]
Rune for certain vocations (mana rune for sorcerers and druids as example).
[LUA]local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000) -- time in seconds x1000
function onUse(cid, item, fromPosition, itemEx, toPosition)
local manamax = getPlayerMaxMana(cid)
local min = 3 -- this means 3% minimum healing
local max = 5 -- this means 5% maximum healing
local mana_add = math.random((manamax * (min/100)), (manamax * (max/100)))
if(hasCondition(cid, CONDITION_EXHAUST)) then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted")
return true
end
if(isSorcerer(cid) or isDruid(cid))then
doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doSendAnimatedText(getPlayerPosition(cid),"+"..mana_add.."", TEXTCOLOR_LIGHTBLUE)
doAddCondition(cid, exhaust)
else
doPlayerSendTextMessage(cid,22,"This is only for sorcerers and druids.")
end
return true
end[/LUA]
Skrypty wy?ej nie moje jak co?....
Ew. ja u?ywam w spellach co? takiego z tym ze mam osobne ext w spells.xml :
[LUA]function onCast(cid, creaturePos, level, maglv, var)
centerpos = {x=creaturePos.x, y=creaturePos.y, z=creaturePos.z, stackpos=253}
centerpos2 = {x=creaturePos.x, y=creaturePos.y, z=creaturePos.z}
mypos = {x=0,y=0,z=0}
mypos.x,mypos.y,mypos.z = creatureGetPosition(cid)
_mypos = {x=mypos.x,y=mypos.y,z=mypos.z}
if (getPlayerExhaustion(cid) == 0 and mypos.x == centerpos.x and mypos.y == centerpos.y and mypos.z == centerpos.z) then
lvl=getPlayerLevel(cid)
addm = math.floor(lvl*0.18+140)
addm1 = math.floor(lvl*0.18+215)
mana = math.random(addm,addm1)
doPlayerAddMana(cid,mana)
doSendAnimatedText(mypos, '+'.. mana ..'', LIGHT_BLUE)
addPlayerExhausted(cid,1000)
doSendMagicEffect(_mypos,12)
doPlayerSay(cid,'Aaaah...',16)
return true
elseif (getPlayerExhaustion(cid) == 0) then
creature = getThingfromPos(centerpos)
if (creature.itemid ~= 0 ) then
if (isPZTile(mypos) == 0) then
if (canThrowSpell(cid, centerpos2) == 1) then
iks = math.abs(mypos.x - centerpos.x)
igrek = math.abs(mypos.y - centerpos.y)
if (iks <= 1 and igrek <= 1 and mypos.z == centerpos.z) then
add=math.random(140,215)
elseif (iks <= 2 and igrek <= 2 and mypos.z == centerpos.z) then
add=math.random(110,150)
elseif (iks <= 3 and igrek <= 3 and mypos.z == centerpos.z) then
add=math.random(90,150)
elseif (iks <= 4 and igrek <= 4 and mypos.z == centerpos.z) then
add=math.random(60,120)
else
doSendMagicEffect(_mypos,2)
return false
end
lvl=getPlayerLevel(cid)
addp = math.floor(lvl*0.18+add)
addp1 = math.floor(lvl*0.18+add)
manas = math.random(addp,addp1)
doPlayerAddMana(creature.cid,manas)
doSendAnimatedText(centerpos2, '+'.. manas ..'', LIGHT_BLUE)
addPlayerExhausted(cid,1000)
doSendMagicEffect(_mypos,12)
doSendMagicEffect(centerpos,14)
doPlayerSay(cid,'Ohhh...',16)
return true
else
doPlayerSendTextMessage(cid, 23, 'Nie mozesz uzyc tego przedmiotu w tym miejscu.')
doSendMagicEffect(_mypos,2)
return false
end
else
doPlayerSendTextMessage(cid, 23, 'Nie mozesz uzyc tego przedmiotu z bezpiecznej strefy.')
doSendMagicEffect(_mypos,2)
return false
end
else
doSendMagicEffect(_mypos,2)
return false
end
else
--doSendAnimatedText(centerpos2, ''.. 0.001 * getPlayerExhaustion(cid) ..'', DARKYELLOW)
doPlayerSendTextMessage(cid, 23, 'Jestes zmeczony przez '.. 0.001 * getPlayerExhaustion(cid) ..' sec.')
doSendMagicEffect(_mypos,2)
return false
end
end
[/LUA]
s?dz?c po tym ?e dosta?em pkt reputacji koledze to pomog?o - pisz? to jakby kto? kiedy? mia? podobny problem.