• 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 for Palladin

Status
Not open for further replies.

rafix109

New Member
Joined
Dec 5, 2010
Messages
13
Reaction score
0
Hiho, I want to create spell what will shoot 9 arrows (3x3 square with target in centre)
for now I created that:
Code:
-- SpellCreator generated.

-- =============== COMBAT VARS ===============
-- Areas/Combat for 0ms
local combat0_Brush = createCombatObject()
setCombatParam(combat0_Brush, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat0_Brush,createCombatArea({
{1, 1, 1},
{1, 3, 1},
{1, 1, 1}}))
function getDmg_Brush(cid, level, maglevel)
    return (10)*-1,(20)*-1
end
setCombatCallback(combat0_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
local dfcombat0_Brush = {CONST_ANI_ARROW,0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1,0,0}

-- =============== 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,dfcombat0_Brush,startPos)
    return true
end

but I don't know how shot that 9 arrows to target, not near caster. Waiting for reply.
 
Oh those spell creators making things so much more difficult than they have to be.
Here you go:

PHP:
------Scripting yourself instead of using a Generator--------
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

function getDmg_Brush(cid, level, maglevel)
   return (10)*-1,(20)*-1
end

function onTargetTile(cid, position)
   doSendDistanceShoot(getCreaturePosition(cid), position, CONST_ANI_ARROW)
   return true
end

local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")

function onCastSpell(cid, var)
   return doCombat(cid, combat, var)
end
 
oh God, u're awesome, thank u very much =)

@edit, is there possibility to create monster(summon) with exeta res?
 
Last edited:
Status
Not open for further replies.
Back
Top