Postado Março 5, 2018 7 anos É uma gambiarra que só vai funcionar pra essa área aí, mas tenta esse: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA) setCombatParam(combat, COMBAT_PARAM_USECHARGES, true) local area = createCombatArea(AREA_SQUARE1X1) setCombatArea(combat, area) function onGetFormulaValues(cid, level, skill, attack, factor) local skillTotal, levelTotal = skill + attack, level / 5 return -(skillTotal * 0.5 + levelTotal), -(skillTotal * 1.5 + levelTotal) end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") function onCastSpell(cid, var, target) mninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3} fninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3} enemy_mninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3} enemy_fninja = {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3} target = getCreatureTarget(cid) if getPlayerSex(cid) == 0 then doSetCreatureOutfit(cid, mninja, 500) else doSetCreatureOutfit(cid, fninja, 500) end for i=-1,1 do for j=-1,1 do -- adjust position thingPos = getCreaturePosition (target) thingPos.x = thingPos.x + i thingPos.y = thingPos.y + j thingPos.stackpos = 255 -- thing = getThingfromPos(thingPos) thing = thing.uid if isPlayer (thing) then if getPlayerSex (thing) == 0 then doSetCreatureOutfit (thing, enemy_mninja, 500) else doSetCreatureOutfit (thing, enemy_fninja, 500) end end end end return doCombat(cid, combat, var) end
Postado Março 5, 2018 7 anos @marcot É mais por curiosidade, mas vc pode usar o CALLBACK_PARAM_TARGETCREATURE ou CALLBACK_PARAM_TARGETTILE para pegar os targets ou os tiles que a spell atinge. Um exemplo rápido: function changeTargetOutfit(cid, target) if isPlayer(target) then doSetCreatureOutfit(target, {lookType = 117, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}, 500) end end setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "changeTargetOutfit") ~Kydrai www.pokestorm.com.br
Postado Março 5, 2018 7 anos Autor nao deu vei , se ta sem target ele so muda a looktype e n sai a magia se ta com target ele faz a mesma função do setcreatureoutfit erro no executavel [Error - Spell Interface] [05/03/2018 18:26:13] data/spells/scripts/attack/frozenwave.lua:onCastSpell [05/03/2018 18:26:13] Description: [05/03/2018 18:26:13] data/spells/scripts/attack/frozenwave.lua:34: attempt to index global 'thingPos' (a boolean value) [05/03/2018 18:26:13] stack traceback: vo tenta resolver aqui , sou bem ruim mas vou tentar aheuaeh Editado Março 5, 2018 7 anos por Jeanzim (veja o histórico de edições)
Postado Março 5, 2018 7 anos 1 hora atrás, Jeanzim disse: nao deu vei , se ta sem target ele so muda a looktype e n sai a magia se ta com target ele faz a mesma função do setcreatureoutfit erro no executavel [Error - Spell Interface] [05/03/2018 18:26:13] data/spells/scripts/attack/frozenwave.lua:onCastSpell [05/03/2018 18:26:13] Description: [05/03/2018 18:26:13] data/spells/scripts/attack/frozenwave.lua:34: attempt to index global 'thingPos' (a boolean value) [05/03/2018 18:26:13] stack traceback: vo tenta resolver aqui , sou bem ruim mas vou tentar aheuaeh @Jeanzim, Como a skill deve funcionar quando não tem target? sai um exori pra frente e troca a outfit? O que mais deve ser modificado? Editado Março 5, 2018 7 anos por marcot (veja o histórico de edições)
Postado Março 5, 2018 7 anos Autor sim sim , funciona sem target , solta 1 exori e troca outfit.. e velho se não for pedir de mais tu poderia me dar um exemplo de uma função com pos x y z do target referente ao player que usa a magia? tipo eu vou fazer uma magia que paralyza mas só vou retornar o docombat se o target tiver '' y x z'' referente ao cid eu estou aprendendo mas com os negócio de posição eu tenho mt dificuldade ;x Editado Março 5, 2018 7 anos por Jeanzim (veja o histórico de edições)
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.