Postado Abril 10, 2013 12 anos Bom estou encontrando grande dificuldade para editar uma spell que encontrei aqui no forum (vou postar ao final deste topico) criada pelo oneshot para hitar varias vezes. Ela é diferenciada pois empurra a criatura para onde o player está olhando (diferente de outras que encontrei ,que empurram na direção contraria do conjurador, não importando a direção que ele esteja olhando), o que ajudaria por demais no server que estou criando. Eu gostaria que a spell hitasse varias vezes(como na spell que irei postar ao final do tópico) e continuasse empurrando na direção em que o player está olhando.Spell que empurra na direção que o player está olhando: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_POFF) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, 0, -1, 0) local area = createCombatArea({ {1, 0, 1}, {1, 0, 1}, {1, 0, 1}, {1, 2, 1}, }) setCombatArea(combat, area) local function push(cid, target) local direction = getCreatureLookDirection(cid) local x = (direction == 1 and 1 or (direction == 3 and -1 or 0)) local y = (direction == 0 and -1 or (direction == 2 and 1 or 0)) local position = getCreaturePosition(target) position.x = position.x + x position.y = position.y + y if doTileQueryAdd(target, position) == RETURNVALUE_NOERROR then doTeleportThing(target, position, true) end end function onTargetCreature(cid, target) if not isNpc(target) then addEvent(push, 100, cid, target) end end setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") function onCastSpell(cid, var) return doCombat(cid, combat, var) end Spell que hita varias vezes: local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -399.5, -399975, -399.5, -399975) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -399.5, -399975, -399.5, -399975) local combat3 = createCombatObject() setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat3, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -399.5, -399975, -399.5, -399975) local combat4 = createCombatObject() setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat4, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -399.5, -399975, -399.5, -399975) local combat5 = createCombatObject() setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat5, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA) setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, -399.5, -399975, -399.5, -399975) local combat6 = createCombatObject() setCombatParam(combat6, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat6, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA) setCombatFormula(combat6, COMBAT_FORMULA_LEVELMAGIC, -399.5, -399975, -399.5, -399975) local combat7 = createCombatObject() setCombatParam(combat7, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat7, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA) setCombatFormula(combat7, COMBAT_FORMULA_LEVELMAGIC, -399.5, -399975, -399.5, -399975) local combat8 = createCombatObject() setCombatParam(combat8, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat8, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA) setCombatFormula(combat8, COMBAT_FORMULA_LEVELMAGIC, -399.5, -399975, -399.5, -399975) arr1 = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0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 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } arr7 = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } arr8 = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } local area1 = createCombatArea(arr1) local area2 = createCombatArea(arr2) local area3 = createCombatArea(arr3) local area4 = createCombatArea(arr4) local area5 = createCombatArea(arr5) local area6 = createCombatArea(arr6) local area7 = createCombatArea(arr7) local area8 = createCombatArea(arr8) setCombatArea(combat1, area1) setCombatArea(combat2, area2) setCombatArea(combat3, area3) setCombatArea(combat4, area4) setCombatArea(combat5, area5) setCombatArea(combat6, area6) setCombatArea(combat7, area7) setCombatArea(combat8, area8) local function onCastSpell1(parameters) doCombat(parameters.cid, combat1, parameters.var) end local function onCastSpell2(parameters) doCombat(parameters.cid, combat2, parameters.var) end local function onCastSpell3(parameters) doCombat(parameters.cid, combat3, parameters.var) end local function onCastSpell4(parameters) doCombat(parameters.cid, combat4, parameters.var) end local function onCastSpell5(parameters) doCombat(parameters.cid, combat5, parameters.var) end local function onCastSpell6(parameters) doCombat(parameters.cid, combat6, parameters.var) end local function onCastSpell7(parameters) doCombat(parameters.cid, combat7, parameters.var) end local function onCastSpell8(parameters) doCombat(parameters.cid, combat8, parameters.var) end function onCastSpell(cid, var) local parameters = { cid = cid, var = var} addEvent(onCastSpell1, 100, parameters) addEvent(onCastSpell2, 200, parameters) addEvent(onCastSpell3, 300, parameters) addEvent(onCastSpell4, 400, parameters) addEvent(onCastSpell5, 500, parameters) addEvent(onCastSpell6, 600, parameters) addEvent(onCastSpell7, 700, parameters) addEvent(onCastSpell8, 800, parameters) return TRUE end Resumindo: Eu gostaria uma "fusão entre estas duas spells, ond a spell resultante ainda empurre na direção desejada e tambem cause varios hits. Obrigado pela atenção. Acesse o tópico!
Postado Abril 10, 2013 12 anos local dirs = { [0] = {0, -1}, [1] = {1, 0}, [2] = {0, 1}, [3] = {-1, 0}, } local function push(cid, target) local dir = dirs[getCreatureLookDirection(cid)] local pos = getCreaturePosition(target) pos.x = pos.x + dir[1] pos.y = pos.y + dir[2] if doTileQueryAdd(target, pos) == RETURNVALUE_NOERROR then doTeleportThing(target, pos, true) end return true end function onTargetCreature(cid, target) if not isNpc(target) then addEvent(push, 100, cid, target) end return true end local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -399.5, -399975, -399.5, -399975) setCombatArea(combat, createCombatArea({{3}})) setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") local function onCastSpell1(cid, var) return isCreature(cid) and doCombat(cid, combat, var) or false end function onCastSpell(cid, var) for a = 1, 8 do addEvent(onCastSpell1, a * 100, cid, var) end return true end -"Supra Omnes Lux Lucis" - Acima de todos brilha a Luz -
Postado Novembro 25, 2013 11 anos Postado 10 abril 2013 - "03:56 local dirs = { [0] = {0, -1}, [1] = {1, 0}, [2] = {0, 1}, [3] = {-1, 0}, } local function push(cid, target) local dir = dirs[getCreatureLookDirection(cid)] local pos = getCreaturePosition(target) pos.x = pos.x + dir[1] pos.y = pos.y + dir[2] if doTileQueryAdd(target, pos) == RETURNVALUE_NOERROR then doTeleportThing(target, pos, true) end return true end function onTargetCreature(cid, target) if not isNpc(target) then addEvent(push, 100, cid, target) end return true end local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -399.5, -399975, -399.5, -399975) setCombatArea(combat, createCombatArea({{3}})) setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") local function onCastSpell1(cid, var) return isCreature(cid) and doCombat(cid, combat, var) or false end function onCastSpell(cid, var) for a = 1, 8 do addEvent(onCastSpell1, a * 100, cid, var) end return true end MAXWELLDEN poderia explicar como se fez as 2 se misturarem e ficar com tanta poucas letras, hauhaur, ou me indicar um tutorial onde possa aprender? PoKemon Manins~ ~ Um servidor diferente Em breve, Aguardem !
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.