Nova Spell arrow repel para paladins

gusinhi
em Globalevents e Spells

gusinhi

Lukkan
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 24/12/08Posts: 41Gênero: MasculinoChar no Tibia: Aura mage naruto
Spoiler

local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ETHEREALSPEAR)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, 1)

function onGetFormulaValues(player, attack, factor)
    local skillTotal = 2 * player:getEffectiveSkillLevel(SKILL_DISTANCE)
    local levelTotal = player:getLevel() / 5
    return -(((skillTotal + attack / 2500) * 0.5) + (levelTotal) + 7), -(((skillTotal + attack / 1875) * 0.75) + (levelTotal) + 13)
end

 
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
 
local function isWalkable(pos, creature, proj, pz)
    if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
    if getTopCreature(pos).uid > 0 and creature then return false end
    if getTileInfo(pos).protection and pz then return false, true end
    local n = not proj and 3 or 2
    for i = 0, 255 do
        pos.stackpos = i
        local tile = getTileThingByPos(pos)
        if tile.itemid ~= 0 and not isCreature(tile.uid) then
            if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
                return false
            end
        end
    end
    return true
end
 
 
local function push(id, dir, t)
    if t < 0 or not(isCreature(id)) then return true end
    local pos = getPositionByDirection(getThingPos(id), dir)
    if not(isWalkable(pos, true, false, true)) then
        return true
    end
    doTeleportThing(id, pos, true)
    addEvent(push, 0, id, dir, t-1)
end
 
local config = {
    ammu = {2543,2544,2545,2546,2547,6529,7363,7364,7365,7838,7839,7840,7850},
    pushBack = 2
}
function onCastSpell(cid, var)
    local removed = false
    for _, itemid in pairs(config.ammu) do
        if getPlayerItemCount(cid, itemid) >= 1 then
            doPlayerRemoveItem(cid, itemid, 1)
            removed = true
            end
            if getPlayerSlotItem(cid, 5).itemid == 7438 or getPlayerSlotItem(cid, 6).itemid == 7438 then
            removed = true
            break
        
        end
    end
    if not(removed) then return doPlayerSendCancel(cid, "You need ammunation for this spell.") and false end    
    local ret = doCombat(cid, combat, var)
    if ret then
        local dirTo = getDirectionTo(getThingPos(cid), getThingPos(variantToNumber(var)))
        push(variantToNumber(var), dirTo, config.pushBack)
    end
    return ret
end

 

 

 

koete

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 06/02/13Posts: 132Char no Tibia: Koete

O que ela faz? como funciona? tem como postar foto ou video?

gusinhi

Lukkan
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 24/12/08Posts: 41Gênero: MasculinoChar no Tibia: Aura mage naruto

Eskylo

boa sorte
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 11/08/10Posts: 477Gênero: Masculino

A spell empurra o target pra trás, bacana !

Atenciosamente, Eskylo

 

 

Ironman-icon.png

.

.

Administrador

xTibia 2017
avatar
Administrador
Administrador

INFOS

Grupo: AdministradorRegistrado: 09/07/05Posts: 5780Gênero: Outro

Criativo. Adicione informações ao post @gusinhi, vai ficar legal e mais apresentável. :laugh:

Reputado(s).

DICA

Utilize botão @UP, no início de seu tópico, para atualizar o destaque de seu tópico em "Tópicos Recentes" na index, fará com que mais pessoas o vejam.