Eu faria de um jeito sem precisar de storages para você, pois com storages, você teria que "setar" o storage do alvo e não o do jogador.
Como Colocar Storage Em Uma Spell?
Por razurator, 20 de jul. de 2012 em Scripts
Eu faria de um jeito sem precisar de storages para você, pois com storages, você teria que "setar" o storage do alvo e não o do jogador.
Bom eu não queria mais encher teu saco com aquela spell mas em fim, vamos la:
local damage = COMBAT_PHYSICALDAMAGE
local effect = CONST_ME_DRAWBLOOD
local animation = CONST_ANI_REDSTAR
local rounds = 15
local delay = 3 * 1000
local condition = createConditionObject(CONDITION_PHYSICAL)
local function doCombatCondition(cid, target, type, area, min, max, effect, rounds)
if isCreature(target) then
if getCreatureCondition(target, CONDITION_PHYSICAL) then
doAreaCombatHealth((isCreature(cid) and cid or 0), type, getThingPosition(target), area, min, max, effect)
if rounds > 0 then
addEvent(doCombatCondition, delay, cid, target, type, area, min, max, effect, (rounds - 1))
end
end
end
return true
end
function onCastSpell(cid, var)
local formula_min = getPlayerLevel(cid) * 0.27
local formula_max = getPlayerLevel(cid) * 0.30
local target = variantToNumber(var)
if getDistanceBetween(getThingPosition(target), getThingPosition(cid)) < 6 then
doSendDistanceShoot(getThingPosition(cid), getThingPosition(target), animation)
end
addEvent(doCombatCondition, delay, cid, target, damage, 0, -formula_min, -formula_max, CONST_ME_DRAWBLOOD, rounds)
return true
end
OBS: me parece que não tem nada de errado com o script mas ele parou de funfar, ja que foi você que o fez, teria como arrumar pra mim?
te dou REP +
Simples, não existe CONDITION_PHYSICAL. Existem essas:
CONDITION_NONE = 0 CONDITION_POISON = 1 CONDITION_FIRE = 2 CONDITION_ENERGY = 4 CONDITION_BLEEDING = 8 CONDITION_HASTE = 16 CONDITION_PARALYZE = 32 CONDITION_OUTFIT = 64 CONDITION_INVISIBLE = 128 CONDITION_LIGHT = 256 CONDITION_MANASHIELD = 512 CONDITION_INFIGHT = 1024 CONDITION_DRUNK = 2048 CONDITION_EXHAUST = 4096 CONDITION_FOOD = 8192 CONDITION_REGENERATION = 8192 CONDITION_SOUL = 16384 CONDITION_DROWN = 32768 CONDITION_MUTED = 65536 CONDITION_ATTRIBUTES = 131072 CONDITION_FREEZING = 262144 CONDITION_DAZZLED = 524288 CONDITION_CURSED = 1048576 CONDITION_PACIFIED = 2097152 CONDITION_GAMEMASTER = 4194304 CONDITION_HUNTING = 8388608
Simples, não existe CONDITION_PHYSICAL. Existem essas:
CONDITION_NONE = 0 CONDITION_POISON = 1 CONDITION_FIRE = 2 CONDITION_ENERGY = 4 CONDITION_BLEEDING = 8 CONDITION_HASTE = 16 CONDITION_PARALYZE = 32 CONDITION_OUTFIT = 64 CONDITION_INVISIBLE = 128 CONDITION_LIGHT = 256 CONDITION_MANASHIELD = 512 CONDITION_INFIGHT = 1024 CONDITION_DRUNK = 2048 CONDITION_EXHAUST = 4096 CONDITION_FOOD = 8192 CONDITION_REGENERATION = 8192 CONDITION_SOUL = 16384 CONDITION_DROWN = 32768 CONDITION_MUTED = 65536 CONDITION_ATTRIBUTES = 131072 CONDITION_FREEZING = 262144 CONDITION_DAZZLED = 524288 CONDITION_CURSED = 1048576 CONDITION_PACIFIED = 2097152 CONDITION_GAMEMASTER = 4194304 CONDITION_HUNTING = 8388608
Na minha pasta data esta escrito CONDITION_PHYSICAL tanto na magia de dispel Cure Bleeding (utorikor) quanto na pasta data/lib.
Cure Bleeding (utori kor):
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PHYSICAL) function onCastSpell(cid, var) return doCombat(cid, combat, var) end
data/lib/constant.lua
CONDITION_NONE = 0 CONDITION_POISON = 1 CONDITION_FIRE = 2 CONDITION_ENERGY = 4 CONDITION_PHYSICAL = 8 CONDITION_HASTE = 16 CONDITION_PARALYZE = 32 CONDITION_OUTFIT = 64 CONDITION_INVISIBLE = 128 CONDITION_LIGHT = 256 CONDITION_MANASHIELD = 512 CONDITION_INFIGHT = 1024 CONDITION_DRUNK = 2048 CONDITION_EXHAUST = 4096 CONDITION_FOOD = 8192 CONDITION_REGENERATION = 8192 CONDITION_SOUL = 16384 CONDITION_DROWN = 32768 CONDITION_MUTED = 65536 CONDITION_ATTRIBUTES = 131072 CONDITION_FREEZING = 262144 CONDITION_DAZZLED = 524288 CONDITION_CURSED = 1048576 CONDITION_PACIFIED = 2097152 CONDITION_GAMEMASTER = 4194304 CONDITION_HUNTING = 8388608
tentarei substituir no lib e nas magias para CONDITION_BLEEDING.
E quanto ao problema de limite de uso da magia? Pois os players não poderão aplicar mais de uma bleed em cada target, não sei como fazer isso.
Tenta isso:
local damage = COMBAT_PHYSICALDAMAGE
local effect = CONST_ME_DRAWBLOOD
local animation = CONST_ANI_REDSTAR
local rounds = 15
local delay = 3 * 1000
local condition = createConditionObject(CONDITION_BLEEDING)
setConditionParam(condition, CONDITION_PARAM_SUBID, 307)
local function doCombatCondition(cid, target, type, area, min, max, effect, rounds)
if isCreature(target) then
if getCreatureCondition(target, CONDITION_BLEEDING, 307) then
doAreaCombatHealth((isCreature(cid) and cid or 0), type, getThingPosition(target), area, min, max, effect)
if rounds > 0 then
addEvent(doCombatCondition, delay, cid, target, type, area, min, max, effect, (rounds - 1))
end
end
end
return true
end
function onCastSpell(cid, var)
local formula_min = getPlayerLevel(cid) * 0.27
local formula_max = getPlayerLevel(cid) * 0.30
local target = variantToNumber(var)
if getCreatureCondition(target, CONDITION_BLEEDING, 307) then
return doPlayerSendCancel(cid, "Seu alvo já está sob efeito de Bleeding. Você não pode usar a magia.")
end
if getDistanceBetween(getThingPosition(target), getThingPosition(cid)) < 6 then
doSendDistanceShoot(getThingPosition(cid), getThingPosition(target), animation)
end
addEvent(doCombatCondition, delay, cid, target, damage, 0, -formula_min, -formula_max, CONST_ME_DRAWBLOOD, rounds)
return true
end
Editado Julho 21 por Oneshot
Tenta isso:
local damage = COMBAT_PHYSICALDAMAGE local effect = CONST_ME_DRAWBLOOD local animation = CONST_ANI_REDSTAR local rounds = 15 local delay = 3 * 1000 local condition = createConditionObject(CONDITION_BLEEDING) setConditionParam(condition, CONDITION_PARAM_SUBID, 307) local function doCombatCondition(cid, target, type, area, min, max, effect, rounds) if isCreature(target) then if getCreatureCondition(target, CONDITION_BLEEDING, 307) then doAreaCombatHealth((isCreature(cid) and cid or 0), type, getThingPosition(target), area, min, max, effect) if rounds > 0 then addEvent(doCombatCondition, delay, cid, target, type, area, min, max, effect, (rounds - 1)) end end end return true end function onCastSpell(cid, var) local formula_min = getPlayerLevel(cid) * 0.27 local formula_max = getPlayerLevel(cid) * 0.30 local target = variantToNumber(var) if getCreatureCondition(target, CONDITION_BLEEDING, 307) then return doPlayerSendCancel(cid, "Seu alvo já está sob efeito de Bleeding. Você não pode usar a magia.") end if getDistanceBetween(getThingPosition(target), getThingPosition(cid)) < 6 then doSendDistanceShoot(getThingPosition(cid), getThingPosition(target), animation) end addEvent(doCombatCondition, delay, cid, target, damage, 0, -formula_min, -formula_max, CONST_ME_DRAWBLOOD, rounds) return true end
Testarei, e caso ocorra algum erro eu posto uma Screen Shot pra ficar mais claro.
Prometi Screen Shot do erro mas simplesmente não pega e também não esta dando erro, mas da ultima vez que deu erro é algo relacionado ao script não conseguir localizar a creature para adicionar a condition. Apenas a animação de red stars esta pegando mas os damages periódicos não sobem.



info
Grupo: Campones
Registrado: 17/12/07
Posts: 43
Reputação: 0
Eu queria saber como colocar um storage em uma spell de modo que ela não possa ser usada no mesmo alvo 2 vezes até que o efeito da primeira tenha acabado. No caso é uma condition.
exemplo:
no script a sima temos um local storage de id 23010.
A minha real duvida é como saber se o numero de um storage já existe pois eu vejo varias congruências entre os ID de storage em magias de mesmo gênero como Recovery e Intense Recovery que levam respectivamente 23015 e 23011, números muito próximos entre si.