• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Spell Cast Based On Level&Magic Level

hucko

Special Order
Joined
May 6, 2011
Messages
79
Reaction score
1
Help Otlanders,

i Got new Spell " Creative " and i made it based on magic level,

but it didn't work well, " There is no damage " :(

i just need it work :D i tried to put " setAttackFormula " Istead SetCombatFormula " but it still based on just Magic level

i Need it based on level & Magic level !!!

so can i find any one help

Code:
-- Areas/Combat for 0ms
local combat0_Brush = createCombatObject()
setCombatParam(combat0_Brush, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat0_Brush, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatArea(combat0_Brush,createCombatArea({{1, 0, 1, 0, 1},
{0, 1, 0, 1, 0},
{1, 0, 2, 0, 1},
{0, 1, 0, 1, 0},
{1, 0, 1, 0, 1}}))
setCombatFormula(combat0_Brush, COMBAT_FORMULA_LEVELMAGIC, 1, 2, 3, 4)local combat0_Brush_2 = createCombatObject()
setCombatParam(combat0_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
setCombatParam(combat0_Brush_2, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatArea(combat0_Brush_2,createCombatArea({{0, 1, 0, 1, 0},
{1, 0, 0, 0, 1},
{0, 0, 2, 0, 0},
{1, 0, 0, 0, 1},
{0, 1, 0, 1, 0}}))
setCombatFormula(combat0_Brush_2, COMBAT_FORMULA_LEVELMAGIC, 1, 2, 3, 4)

-- =============== CORE FUNCTIONS ===============
local function RunPart(c,cid,var,dirList,dirEmitPos) -- Part
   if (isCreature(cid)) then
     doCombat(cid, c, var)
     if (dirList ~= nil) then -- Emit distance effects
       local i = 2;
       while (i < #dirList) do
         doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList[i],y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1])
         i = i + 2
       end    
     end
   end
end

function onCastSpell(cid, var)
   local startPos = getCreaturePosition(cid)
   RunPart(combat0_Brush,cid,var)
   RunPart(combat0_Brush_2,cid,var)
   return true
end
 
You can use this instead of setCombatFormula(combat0_Brush, COMBAT_FORMULA_LEVELMAGIC, 1, 2, 3, 4).
Code:
function onGetFormulaValues(cid, level, maglevel)
   min = (maglevel*3) +(level/5) +76
   max = (maglevel*4) +(level/5) +108

   return -min, -max
end

setCombatCallback(combat0_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

Add it under
Code:
setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)

Same goes for the second combat.
 
Thank's Too much it fixed now, but there is something i don't know to do yet... !!

How i Rep++ you now ?
 
Back
Top