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

Monster attack spell. tfs 1.3

CesarZ

Active Member
Joined
Sep 20, 2012
Messages
242
Solutions
4
Reaction score
48
i created the spell with spell Creator why the monster is making the effects but is not making any damage.
Here is the script given to me by the spell creator.

Lua:
-- SpellCreator generated.
-- =============== COMBAT VARS ===============
-- Areas/Combat for 0ms
local combat0_Brush = createCombatObject()
setCombatParam(combat0_Brush, COMBAT_PARAM_EFFECT, CONST_ME_POISONAREA)
setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat0_Brush,createCombatArea({{0, 0, 0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 3, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0, 0, 0}}))
function getDmg_Brush(cid, level, maglevel)
    return (500)*-1,(700)*-1 
end
setCombatCallback(combat0_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")
-- =============== 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)
    creature = type(creature) == "userdata" and creature:getId() or creature
    local startPos = getCreaturePosition(cid)
    RunPart(combat0_Brush,cid,var)
    return true
end
 

Sarah Wesker

ค∂vαηcε รүηтαx ❤
Support Team
Joined
Mar 16, 2017
Messages
997
Solutions
100
Reaction score
1,034
Location
London
GitHub
MillhioreBT
maybe creature = type(creature) == "userdata" and creature:getId() or creature change to cid = type(cid) == "userdata" and cid:getId() or cid
 
OP
OP
CesarZ

CesarZ

Active Member
Joined
Sep 20, 2012
Messages
242
Solutions
4
Reaction score
48
@Levi999x , @Sarah Wesker

not working, i dont know if its because my monsters are in lua.
spells are written inside the same monster lua.
Code:
monster.attacks = {
    --{name ="melee", interval = 900, chance = 100, minDamage = 500, maxDamage = -1470, effect = CONST_ME_DRAWBLOOD},
    --{name ="combat", interval = 1000, chance = 50, minDamage = 0, maxDamage = -1000, type = COMBAT_PHYSICALDAMAGE, range = 7, shootEffect = CONST_ANI_LARGEROCK, target = false},
   {name ="masterposion", interval = 1000, chance = 100, target = false}, -- new spell
    {name ="deathsound", interval = 1000, chance = 100, target = false}, -- new spell

    {name ="big energy purple wave2", interval = 1000, chance = 50} -- new spell
}
but when i implement a script from "spell folder" it doesn't work. it shows the effect, but the damage points.
they work for players but no for monsters.

those that are written inside the monster lua with damage and effect ect.. work.

ya think is the lua monster system? this never happened to me with XML file monsters
 
Top