RO
dúvida

como colocar mais areas

Por rohfagundes, 05 de jan. de 2013 em Scripts

4
789
rohfagundesR
05 de janeiro de 2013 às 11:44

gente eu tentei aqui só q fica dando erro

alguem ai poderia fazer como eu add mais areas pra essa spell aqui

 

edit: eu to querendo add mais local arr

só q da erro querio pq tem q mexer em outra coisa q eu n sei =/

 

 

local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)

setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)

setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)

setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.4, 0, -1.9, 0)

 

local arr = {

{1, 1, 1},

{1, 1, 1},

{1, 1, 1},

{0, 1, 0},

{0, 3, 0},

{0, 0, 0},

{0, 0, 0},

{0, 0, 0},

{0, 0, 0},

}

 

local area = createCombatArea(arr)

setCombatArea(combat, area)

 

function onCastSpell(cid, var)

pos = getPosfromArea(cid,arr)

n = 0

 

while n < #pos do

n = n+1

thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253}

if isCreature(getThingfromPos(thing).uid) == TRUE then

doPushCreature(getThingfromPos(thing).uid,getPlayerLookDir(cid))

end

end

 

return doCombat(cid, combat, var)

end

Editado Janeiro 5 por rohfagundes

SmiXS
05 de janeiro de 2013 às 13:37
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.4, 0, -1.9, 0)
local combat1 = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.4, 0, -1.9, 0)
local combat2 = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.4, 0, -1.9, 0)
local arr = {
{1, 1, 1},
{1, 2, 1},
{1, 1, 1}
}
local arr1 = {
{0, 1, 1, 1, 0},
{1, 0, 0, 0, 1},
{1, 0, 2, 0, 1},
{1, 0, 0, 0, 1},
{0, 1, 1, 1, 0}
}
local arr2 = {
{0, 1, 1, 1, 1, 1, 0},
{1, 1, 0, 0, 0, 1, 0},
{1, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 2, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 1},
{1, 1, 0, 0, 0, 1, 1},
{0, 1, 1, 1, 1, 1, 0}
}

local area = createCombatArea(arr)
setCombatArea(combat, area)
local area1 = createCombatArea(arr1)
setCombatArea(combat1, area1)
local area2 = createCombatArea(arr2)
setCombatArea(combat2, area2)

function onCastSpell(cid, var)
   pos = getPosfromArea(cid,arr)
   n = 0

   while n < #pos do
   n = n+1
   thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253}
         if isCreature(getThingfromPos(thing).uid) == TRUE then
            doPushCreature(getThingfromPos(thing).uid,getPlayerLookDir(cid))
         end
   end
doCombat(cid, combat, var)
addEvent(doCombat, 200, cid, combat1, var)
addEvent(doCombat, 400, cid, combat2, var)
   addEvent(doCombat, 600, cid, combat1, var)
   addEvent(doCombat, 800, cid, combat, var)
end

rohfagundesR
05 de janeiro de 2013 às 14:16

cara a spell ta funcionando

n ta dando nenhum erro no console

porem ela só sai

 

 

local arr = {

{1, 1, 1},

{1, 2, 1},

{1, 1, 1}

}

 

nessa area =/

vc sabe pq?

 

 

edit:

vlw ai eu ja consegui arrumar

vc me ajudou muito =D

podem fechar ja =)

Editado Janeiro 5 por rohfagundes

SlicerS
05 de janeiro de 2013 às 15:00

sanado, movido