What's new

Lekkie przerobienie manaruny.

Status
Not open for further replies.

VencenzoCapone

Active User
Joined
Nov 21, 2010
Messages
57
Reaction score
2
Witam,
Mam problem poniewa? podczas u?ywania manaruny nie mo?na u?ywa? czar?w, z potem dzia?a normalnie lecz manaruna "blokuje" u?ywanie czar?w.
Chodzi mi o to, ?e dopiero jak si? wpisze exura vita to trzeba czeka? zanim b?dzie mo?na u?y? manaruny.
Jak to poprawi??
Tutaj jest kod mr :
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
function onCastSpell(cid, var)
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local pos = getPlayerPosition(cid)

local mana_minimum = (level * 1.6) + (mlevel * 5.0) * 1.08
local mana_maximum = (level * 2.1) + (mlevel * 9.0) * 1.13

if getPlayerVocation(cid) == 3 or 7 then
local mana_minimum = (level * 1.65) + (mlevel * 0.5) * 1.08
local mana_maximum = (level * 2.1) + (mlevel * 0.65) * 1.11
end

if getPlayerVocation(cid) == 4 or 8 then
local mana_minimum = (level * 0.9) + (mlevel * 2.6) * 1.1
local mana_maximum = (level * 1.1) + (mlevel * 3.5) * 1.15
end


local mana_add = math.random(mana_minimum, mana_maximum)
doPlayerAddMana(cid, mana_add)
doSendAnimatedText(pos, mana_add, TEXTCOLOR_PURPLE)
return doCombat(cid, combat, var)
end
 

Mikix95

Advanced User
Joined
Nov 3, 2009
Messages
169
Reaction score
6
Odp: Lekkie przerobienie manaruny.

To dzia?a chyba na podstawie exhausted, wi?c zmie? go dla czar?w, a mo?e i run? b?dzie mo?na u?ywa? (chyba ?e ma osobny dla run)
 

Sooh

Advanced User
Joined
Jun 26, 2014
Messages
489
Reaction score
26
Age
30
Odp: Lekkie przerobienie manaruny.

Dodaj osobny exhausted na storage.
 

VencenzoCapone

Active User
Joined
Nov 21, 2010
Messages
57
Reaction score
2
Odp: Lekkie przerobienie manaruny.

Nie rozumiem. Sooh mo?esz troch? ja?niej ;d ?
 

Sooh

Advanced User
Joined
Jun 26, 2014
Messages
489
Reaction score
26
Age
30
Odp: Lekkie przerobienie manaruny.

[lua]
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
local STORAGE = 1111
local DELAY = 2.0
local EXHAUSTED = exhaustion.check(cid, STORAGE)
if (EXHAUSTED) then
doPlayerSendCancel(cid, "Please wait " .. (exhaustion.get(cid, STORAGE)) .. " seconds.")
doSendMagicEffect(getCreaturePosition(cid), 2)
return false
else
local level = getPlayerLevel(cid)
local magic_level = getPlayerMagLevel(cid)
local position = getPlayerPosition(cid)
local mana_minimum = (level * 1.6) + (magic_level * 5.0) * 1.08
local mana_maximum = (level * 2.1) + (magic_level * 9.0) * 1.13
if (getPlayerVocation(cid) == 3 or 7) then
local mana_minimum = (level * 1.65) + (magic_level * 0.5) * 1.08
local mana_maximum = (level * 2.1) + (magic_level * 0.65) * 1.11
end
if (getPlayerVocation(cid) == 4 or 8) then
local mana_minimum = (level * 0.9) + (magic_level * 2.6) * 1.1
local mana_maximum = (level * 1.1) + (magic_level * 3.5) * 1.15
end
local mana_points = math.random(mana_minimum, mana_maximum)
doPlayerAddMana(cid, mana_points)
doSendAnimatedText(position, mana_points, TEXTCOLOR_PURPLE)
doCombat(cid, combat, var)
exhaustion.set(cid, STORAGE, DELAY)
return true
end
end
[/lua]
 

VencenzoCapone

Active User
Joined
Nov 21, 2010
Messages
57
Reaction score
2
Odp: Lekkie przerobienie manaruny.

Nadal to samo, albo mog? u?ywa? exura vita albo mr
 

misztrz440

Banned
Joined
Dec 15, 2012
Messages
1,032
Reaction score
39
Odp: Lekkie przerobienie manaruny.

Przecierz exura to jest do leczenia wiec tak samo jak by? wzi?? 2 rynki manaruny tylko inne i w tym samym czasie si? uhal
 

Sooh

Advanced User
Joined
Jun 26, 2014
Messages
489
Reaction score
26
Age
30
Odp: Lekkie przerobienie manaruny.

[lua]local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local STORAGE = 1111
local DELAY = 1.2

function onCastSpell(cid, var)
local EXHAUSTED = exhaustion.check(cid, STORAGE)
if (EXHAUSTED) then
doPlayerSendCancel(cid, "Please wait " .. (exhaustion.get(cid, STORAGE)) .. " seconds.")
doSendMagicEffect(getCreaturePosition(cid), 2)
return true
end
local level = getPlayerLevel(cid)
local magic_level = getPlayerMagLevel(cid)
local position = getPlayerPosition(cid)
local mana_minimum = (level * 1.6) + (magic_level * 5.0) * 1.08
local mana_maximum = (level * 2.1) + (magic_level * 9.0) * 1.13
if (getPlayerVocation(cid) == 3 or 7) then
local mana_minimum = (level * 1.65) + (magic_level * 0.5) * 1.08
local mana_maximum = (level * 2.1) + (magic_level * 0.65) * 1.11
end
if (getPlayerVocation(cid) == 4 or 8) then
local mana_minimum = (level * 0.9) + (magic_level * 2.6) * 1.1
local mana_maximum = (level * 1.1) + (magic_level * 3.5) * 1.15
end
local mana_points = math.random(mana_minimum, mana_maximum)
doPlayerAddMana(cid, mana_points)
doSendAnimatedText(position, mana_points, TEXTCOLOR_PURPLE)
doCombat(cid, combat, var)
exhaustion.set(cid, STORAGE, DELAY)
return false
end[/lua]
Sprawdza?em i u mnie dobrze dzia?a, nie wiem.
 

Fardos

Senior User
Joined
Mar 21, 2009
Messages
868
Reaction score
34
Odp: Lekkie przerobienie manaruny.

pytanie jest jedno jak sprawa wygl?da z ext w pliku xml ?
 

VencenzoCapone

Active User
Joined
Nov 21, 2010
Messages
57
Reaction score
2
Odp: Lekkie przerobienie manaruny.

Wygl?da tak : Jak zmienia?em exh na 0 albo 1 to mo?na by?o nim spamowa? bez przerwy ;d

---------- Tre?? dodana o 12:43 ----------

Refresh
 

Fardos

Senior User
Joined
Mar 21, 2009
Messages
868
Reaction score
34
Odp: Lekkie przerobienie manaruny.

a co by? chcia? osi?gn?? dok?adniej? Co ile by? mia? jej u?ywa??

Widzisz aktualnie blokuje czary na 1.1 sec, tak jak i ka?da inna runa, oczywi?cie mo?esz zmieni? jej ext na np 100 i b?dziesz m?g? jej u?y? chwile po vicie

Swoj? drog? je?li z potem dzia?a tak jak chcesz mo?esz zrobi? mr na zasadzie pota a nie spella...
 

VencenzoCapone

Active User
Joined
Nov 21, 2010
Messages
57
Reaction score
2
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.
 

Fardos

Senior User
Joined
Mar 21, 2009
Messages
868
Reaction score
34
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. :)
 
Last edited:
Status
Not open for further replies.
Top