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

TFS 1.X+ WEAPON PROBLEM

darknelson

Member
Joined
Jun 19, 2011
Messages
190
Solutions
1
Reaction score
15
my weapon is not hitting damage, why?

LUA:
-- SpellCreator generated.

-- =============== COMBAT VARS ===============
-- Areas/Combat for 0ms
local combat0_Brush = createCombatObject()
setCombatParam(combat0_Brush, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat0_Brush, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_LARGEROCK)
setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat0_Brush, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat0_Brush, COMBAT_PARAM_BLOCKSHIELD, true)
setCombatArea(combat0_Brush,createCombatArea({{3}}))
setCombatFormula(combat0_Brush, COMBAT_FORMULA_LEVELMAGIC, 10, 20, 10, 20)
local dfcombat0_Brush = {CONST_ANI_LARGEROCK,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 onUseWeapon(cid, var)
    local startPos = getCreaturePosition(cid)
    RunPart(combat0_Brush,cid,var,dfcombat0_Brush,startPos)
    return true
end
 
This line is your only issue
LUA:
setCombatFormula(combat0_Brush, COMBAT_FORMULA_LEVELMAGIC, 10, 20, 10, 20)
How much you want it to hit? You can read more about how setcombatformula works here.
 
Back
Top