• 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!

Create item when using spell!

Hashirama479

World of Ninja
Joined
Dec 19, 2016
Messages
536
Solutions
6
Reaction score
74
I have an problem with my spell its a custom spell and I want it like if you using there should come a stone also create item when use spell you know? xD Im using tfs 0.4

Code:
local arr = {
 
{
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
},
 
{
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}
}
 
}
 
local combat = {}
for i = 1, 3 do
        combat[i] = createCombatObject()
end
 
        setCombatArea(combat[1], createCombatArea(arr[1]))
        setCombatParam(combat[1], COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
        setCombatArea(combat[2], createCombatArea(arr[2]))
        setCombatParam(combat[2], COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
 
function spellCallbackStorm(param)
    if param.count > 0 or math.random(0, 1) == 1 then
        doSendMagicEffect(param.pos, CONST_ME_FIREAREA)
        doSendDistanceShoot({ x = param.pos.x - 7, y = param.pos.y - 7, z = param.pos.z}, param.pos, CONST_ANI_FIRE)
        addEvent(doSendMagicEffect, 50, param.pos, CONST_ME_FIREAREA)
    end
 
    if(param.count < 3) then
        param.count = param.count + 1
        addEvent(spellCallbackStorm, math.random(0, 500), param)
    end
end
 
function onTargetTile(cid, pos)
    local param = {}
    param.cid = cid
    param.pos = pos
    param.count = 0
    spellCallbackStorm(param)
end
 
function onTargetTile2(cid, pos)
    doCombat(cid, combat[3], positionToVariant(pos))
end
 
function onGetFormulaValues(cid, level, maglevel)
    local min = -((level*5.0)+(maglevel*1))
    local max = -((level*5.2)+(maglevel*1.5))
    return min, max
end
 
setCombatCallback(combat[1], CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
setCombatCallback(combat[1], CALLBACK_PARAM_TARGETTILE, "onTargetTile")
setCombatCallback(combat[2], CALLBACK_PARAM_TARGETTILE, "onTargetTile2")
 
function onCastSpell(cid, var)
    doCombat(cid, combat[1], var)
    doCombat(cid, combat[2], var)
    return true
end
 
Back
Top