Ir para conteúdo
  • 0

AddEvent


koete

Pergunta

Pow eu ja vi em varios lugares os caras usando add event mole... mas eu n consigo.

Por exemplo eu queria que ao eu usar uma spell (qualquer uma) fique saindo um efeito ate a spell terminar

SCRIPT DA SPELL:

 

local tempo = 60

local vidatotalpercent = 110
local vidatotal = 0
local manatotalpercent = 110
local manatotal = 0
local health = 2000
local segundoshealth = 1
local mana = 2000
local segundosmana = 1
local shield = 10
local magiclevel = 10
local fist = 10
local sword = 10
local axe = 10
local distance = 10
local club = 10
local fishing = 10
local speed = 2500
local light = 6
local lightcolor = 30
local tempoluz = 20
local movie = 47
local consumesoul = 0
local soulgain = 10
local soulticks = 1
local lock = 223
local bebado = CONDITION_DRUNK
local invisivel = CONDITION_INVISIBLE
local utamovita = CONDITION_MANASHIELD
local battle = CONDITION_INFIGHT
local mudo = CONDITION_MUTED
local gm = CONDITION_GAMEMASTER
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, movie)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, vidatotalpercent)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, vidatotal)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANAPERCENT, manatotalpercent)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANA, manatotal)
setConditionParam(condition, CONDITION_PARAM_STAT_SOUL, consumesoul)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, shield)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, magiclevel)
setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, fist)
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, sword)
setConditionParam(condition, CONDITION_PARAM_SKILL_MOLD_CHAKRA, axe)
setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, distance)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, club)
setConditionParam(condition, CONDITION_PARAM_SKILL_FISHING, fishing)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_INFIGHT, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_SPEED, speed)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_MANAGAIN, mana)
setConditionParam(condition, CONDITION_PARAM_MANATICKS, segundosmana*1000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, segundoshealth*1000)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_LIGHT)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempoluz*1000)
setConditionParam(condition, CONDITION_PARAM_LIGHT_LEVEL, light)
setConditionParam(condition, CONDITION_PARAM_LIGHT_COLOR, lightcolor)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_SOUL)
setConditionParam(condition, CONDITION_PARAM_SOULGAIN, soulgain)
setConditionParam(condition, CONDITION_PARAM_SOULTICKS, soulticks)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setCombatCondition(combat, condition)
function onCastSpell(cid, var)
local outfit = getCreatureOutfit(cid)
outfit.lookType = lock
doSetCreatureOutfit(cid, outfit, tempo*1000)
return doCombat(cid, combat, var)

end

 

Link para o comentário
Compartilhar em outros sites

6 respostass a esta questão

Posts Recomendados

  • 0

Que efeito e de quanto em quanto tempo quer que ele apareça?

 

Se não souber me dizer qual o efeito, post uma imagem dele.

Editado por gabisaoo
Link para o comentário
Compartilhar em outros sites

  • 0

Aqui Amigo eu adicionei um efeito nela por id , para saber qual efeito você quer é só logar o god é da /z 2 , é assim por diante ate 48 eu acho :

Script :

 

 

local tempo = 60
local vidatotalpercent = 110
local vidatotal = 0
local manatotalpercent = 110
local manatotal = 0
local health = 2000
local segundoshealth = 1
local mana = 2000
local segundosmana = 1
local shield = 10
local magiclevel = 10
local fist = 10
local sword = 10
local axe = 10
local distance = 10
local club = 10
local fishing = 10
local speed = 2500
local light = 6
local lightcolor = 30
local tempoluz = 20
local movie = 47
local consumesoul = 0
local soulgain = 10
local soulticks = 1
local lock = 223
local bebado = CONDITION_DRUNK
local invisivel = CONDITION_INVISIBLE
local utamovita = CONDITION_MANASHIELD
local battle = CONDITION_INFIGHT
local mudo = CONDITION_MUTED
local gm = CONDITION_GAMEMASTER
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, movie)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 21) ---- Local do efeito por id
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, vidatotalpercent)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, vidatotal)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANAPERCENT, manatotalpercent)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANA, manatotal)
setConditionParam(condition, CONDITION_PARAM_STAT_SOUL, consumesoul)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, shield)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, magiclevel)
setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, fist)
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, sword)
setConditionParam(condition, CONDITION_PARAM_SKILL_MOLD_CHAKRA, axe)
setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, distance)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, club)
setConditionParam(condition, CONDITION_PARAM_SKILL_FISHING, fishing)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_INFIGHT, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_SPEED, speed)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_MANAGAIN, mana)
setConditionParam(condition, CONDITION_PARAM_MANATICKS, segundosmana*1000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, segundoshealth*1000)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_LIGHT)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempoluz*1000)
setConditionParam(condition, CONDITION_PARAM_LIGHT_LEVEL, light)
setConditionParam(condition, CONDITION_PARAM_LIGHT_COLOR, lightcolor)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_SOUL)
setConditionParam(condition, CONDITION_PARAM_SOULGAIN, soulgain)
setConditionParam(condition, CONDITION_PARAM_SOULTICKS, soulticks)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setCombatCondition(combat, condition)
function onCastSpell(cid, var)
local outfit = getCreatureOutfit(cid)
outfit.lookType = lock
doSetCreatureOutfit(cid, outfit, tempo*1000)
return doCombat(cid, combat, var)
end

Sé não funcionar tenta esse :

local tempo = 60
local vidatotalpercent = 110
local vidatotal = 0
local manatotalpercent = 110
local manatotal = 0
local health = 2000
local segundoshealth = 1
local mana = 2000
local segundosmana = 1
local shield = 10
local magiclevel = 10
local fist = 10
local sword = 10
local axe = 10
local distance = 10
local club = 10
local fishing = 10
local speed = 2500
local light = 6
local lightcolor = 30
local tempoluz = 20
local movie = 47
local consumesoul = 0
local soulgain = 10
local soulticks = 1
local lock = 223
local bebado = CONDITION_DRUNK
local invisivel = CONDITION_INVISIBLE
local utamovita = CONDITION_MANASHIELD
local battle = CONDITION_INFIGHT
local mudo = CONDITION_MUTED
local gm = CONDITION_GAMEMASTER
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 21) --- id do efeito
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, vidatotalpercent)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, vidatotal)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANAPERCENT, manatotalpercent)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANA, manatotal)
setConditionParam(condition, CONDITION_PARAM_STAT_SOUL, consumesoul)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, shield)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, magiclevel)
setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, fist)
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, sword)
setConditionParam(condition, CONDITION_PARAM_SKILL_MOLD_CHAKRA, axe)
setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, distance)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, club)
setConditionParam(condition, CONDITION_PARAM_SKILL_FISHING, fishing)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_INFIGHT, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_SPEED, speed)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_MANAGAIN, mana)
setConditionParam(condition, CONDITION_PARAM_MANATICKS, segundosmana*1000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, segundoshealth*1000)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_LIGHT)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempoluz*1000)
setConditionParam(condition, CONDITION_PARAM_LIGHT_LEVEL, light)
setConditionParam(condition, CONDITION_PARAM_LIGHT_COLOR, lightcolor)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_SOUL)
setConditionParam(condition, CONDITION_PARAM_SOULGAIN, soulgain)
setConditionParam(condition, CONDITION_PARAM_SOULTICKS, soulticks)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setCombatCondition(combat, condition)
function onCastSpell(cid, var)
local outfit = getCreatureOutfit(cid)
outfit.lookType = lock
doSetCreatureOutfit(cid, outfit, tempo*1000)
return doCombat(cid, combat, var)
end

Editado por AdilsonHacker
Link para o comentário
Compartilhar em outros sites

  • 0

Adsilson não funcionou não cara

apareceu sim mas no inicio

 

 

 

Que efeito e de quanto em quanto tempo quer que ele apareça?

Se não souber me dizer qual o efeito, post uma imagem dele.

Gabisao tu me ajudou da ultima vez com AddEvent queria de 1 em 1 segundo, e o efeito 25 pode ser depois eu mudo.

Link para o comentário
Compartilhar em outros sites

  • 0

Ae fiz e testei, vê ai o que acha, só não entendi o que essa magia faz, por que ele não hit bixos.

 

Script

 

 

local tempo = 60
local vidatotalpercent = 110
local vidatotal = 0
local manatotalpercent = 110
local manatotal = 0
local health = 2000
local segundoshealth = 1
local mana = 2000
local segundosmana = 1
local shield = 10
local magiclevel = 10
local fist = 10
local sword = 10
local axe = 10
local distance = 10
local club = 10
local fishing = 10
local speed = 2500
local light = 6
local lightcolor = 30
local tempoluz = 20
local movie = 47
local consumesoul = 0
local soulgain = 10
local soulticks = 1
local lock = 223
local bebado = CONDITION_DRUNK
local invisivel = CONDITION_INVISIBLE
local utamovita = CONDITION_MANASHIELD
local battle = CONDITION_INFIGHT
local mudo = CONDITION_MUTED
local gm = CONDITION_GAMEMASTER
local n = n or 0
local efect1 = 2 -- efeito, pode mudar a vontade
local function efeito(cid, n)
if n ~= tempo then
addEvent(efeito, 1000, cid, n+1)
doSendMagicEffect(getCreaturePosition(cid), efect1)
else
end
end
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, movie)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, vidatotalpercent)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, vidatotal)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANAPERCENT, manatotalpercent)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANA, manatotal)
setConditionParam(condition, CONDITION_PARAM_STAT_SOUL, consumesoul)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, shield)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, magiclevel)
setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, fist)
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, sword)
setConditionParam(condition, CONDITION_PARAM_SKILL_MOLD_CHAKRA, axe)
setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, distance)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, club)
setConditionParam(condition, CONDITION_PARAM_SKILL_FISHING, fishing)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_INFIGHT, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_SPEED, speed)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_MANAGAIN, mana)
setConditionParam(condition, CONDITION_PARAM_MANATICKS, segundosmana*1000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, segundoshealth*1000)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_LIGHT)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempoluz*1000)
setConditionParam(condition, CONDITION_PARAM_LIGHT_LEVEL, light)
setConditionParam(condition, CONDITION_PARAM_LIGHT_COLOR, lightcolor)
setCombatCondition(combat, condition)
local condition = createConditionObject(CONDITION_SOUL)
setConditionParam(condition, CONDITION_PARAM_SOULGAIN, soulgain)
setConditionParam(condition, CONDITION_PARAM_SOULTICKS, soulticks)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setCombatCondition(combat, condition)
function onCastSpell(cid, var)
local outfit = getCreatureOutfit(cid)
addEvent(efeito, 1000, cid, n+1)
outfit.lookType = lock
doSetCreatureOutfit(cid, outfit, tempo*1000)
return doCombat(cid, combat, var)
end

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

pow cara não rodou. Não deu erro mas tambem n rodou

quando eu mudo esta parte

if n ~= tempo then

para esta

if n == tempo then

ele lança o efeito mas só uma vez e para


consegui resolver aqui =)

valew pela Atenção!

 

--DUVIDA SANADA--

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...