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

Lua tfs and client connection

poe6man3

Member
Joined
Aug 6, 2020
Messages
87
Solutions
1
Reaction score
12
Hello, does anybody have idea what to use/how can i make this.

My goal is to make a spell which waits for player to choose position where to throw a spell (something like a rune but i want to show that area of the spell)


The spell:
Lua:
local animation = {
    cast = {
        start = 29,
        stop = 33
    },
    loopFirst = {
        start = 34,
        stop = 37
    },
    loopSecond = {
        start = 38,
        stop = 41
    },
    attack = {
        start = 42,
        stop = 50
    },
    fail = {
        start = 51,
        stop = 55
    }
}

local function loopAnimation(creature, lookType)
    if not creature or creature:isRemoved() then return end
    
    creature:setOutfit({lookType = lookType})

    if lookType == animation.loopFirst.stop then
        addEvent(loopAnimation, 100, creature, animation.loopSecond.start)
    elseif lookType == animation.loopSecond.stop then
        addEvent(loopAnimation, 100, creature, animation.loopFirst.start)
    else
        addEvent(loopAnimation, 100, creature, lookType + 1)
    end
end

local function castAnimation(creature, lookType)
    if not creature or creature:isRemoved() then return end
    
    creature:setOutfit({lookType = lookType})

    if lookType == animation.cast.stop then
        addEvent(loopAnimation, 100, creature, animation.loopFirst.start)
        AND THERE I WANT TO SHOW THE PLAYER THE AREA AND LET HIM CHOOSE THE POSITION WHERE TO THROW THE SPELL <--------------------------
    else
        addEvent(castAnimation, 100, creature, lookType + 1)
    end
end


local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, true)


local spell = Spell(SPELL_INSTANT)

function spell.onCastSpell(creature, variant)

    addEvent(castAnimation, 100, creature, animation.cast.start)
end

spell:name("genki dama")
spell:words("genki dama")
spell:group("attack")
spell:id(10)
spell:level(20)
spell:magiclevel(5)
spell:cooldown(10000) -- milliseconds, 10 seconds
spell:needTarget(false)
spell:isAggressive(true)
spell:allowFarUse(false)
spell:vocation("goku")
spell:register()

Anybody have any idea would love to see it.
Using latest tfs and otcv8
 
Back
Top