Ir para conteúdo

Featured Replies

  • 10 months later...
  • Respostas 27
  • Visualizações 8.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Bruno Minervino
    Bruno Minervino

    O sentido ficou parecido, mais totalmente diferente rsrs Até porque essa wand ficou pronta no Sábado de noite, mas consegui postar só hoje '-' Mas de qualquer forma obrigado por compartilhar conosco

  • vai ter para tfs 1.0?

Postado
w = {
    {effect = 36, shoot = 3, dmg = COMBAT_FIREDAMAGE},
    {effect = 42, shoot = 28, dmg = COMBAT_ICEDAMAGE},
    {effect = 45, shoot = 38, dmg = COMBAT_POISONDAMAGE},
    {effect = 17, shoot = 31, dmg = COMBAT_DEATHDAMAGE},
    {effect = 11, shoot = 35, dmg = COMBAT_ENERGYDAMAGE},
    {effect = 31, shoot = 35, dmg = COMBAT_PHYSICALDAMAGE},
    {effect = 49, shoot = 37, dmg = COMBAT_HOLYDAMAGE}
}
 
local min, max = 180, 350
 
function onUseWeapon(player, variant)
    local target = player:getTarget()
    if target then
        local shootType = w[math.random(#w)]
        player:getPosition():sendDistanceEffect(target:getPosition(), shootType.shoot)
        addEvent(function(cid, tid)
            local target = Creature(tid)
            if not Player(cid) or not target then
                return
            end
            doAreaCombatHealth(cid, shootType.dmg, target:getPosition(), 0, -min, -max, shootType.effect)
        end, 100, player:getId(), target:getId())
    end
    return true
end

 

funcionando tfs 1.2 

créditos ao static_

  • 2 weeks later...
Postado
Em 02/02/2015 em 00:21, Bruno Minervino disse:

Introdução:
É uma wand que ataca vários elementos aleatoriamente, porém não somente isso, você pode alterar o elemento dela com uma talkaction.
 
Instalação:
Vá até data/weapons/scripts e crie um arquivo chamando wandelementos.lua e coloque o seguinte conteúdo:

 


local min, max = 1700,1900 --Ataque mínino e ataque máximo

local w = {
	[1] = {ef = 36, sh = 3, dmg = COMBAT_FIREDAMAGE},
	[2] = {ef = 42, sh = 28, dmg = COMBAT_ICEDAMAGE},
	[3] = {ef = 46, sh = 38, dmg = COMBAT_POISONDAMAGE},
	[4] = {ef = 17, sh = 31, dmg = COMBAT_DEATHDAMAGE},
	[5] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
	[6] = {ef = 36, sh = 31, dmg = COMBAT_PHYSICALDAMAGE},
	[7] = {ef = 49, sh = 37, dmg = COMBAT_HOLYDAMAGE}
}

function onUseWeapon(cid, var)
        local effect = getPlayerStorageValue(cid, 4561)
        local target = getCreatureTarget(cid)
        
        if target ~= 0 then
                local wx = w[effect] or w[math.random(#w)]
                doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh)
                addEvent(doAreaCombatHealth, 100, cid, wx.dmg, getThingPos(target), 0, -min, -max, wx.ef)
        end
        return true
end

Altere o min e max de acordo com sua necessidade.
 
Agora vá em data/weapons/weapons.xml e coloque o seguinte conteúdo:

 


<wand id="7424" level="100" mana="30" event="script" value="wandelementos.lua">
	<vocation id="1"/>
	<vocation id="2"/>
	<vocation id="5" showInDescription="0"/>
	<vocation id="6" showInDescription="0"/>
</wand>

Altere o id, level e mana de acordo com sua necessidade.

Agora vamos configurar a talkaction que troca os elementos.
Vá até data/talkactions/scripts e crie um arquivo chamando elementos.lua e coloque o seguinte conteúdo:

 


local config = {
    wand_id = 7424, --ID da wand

    types = {
	["all"] = -1, --Ataca os elementos aleatoriamente
        ["fire"] = 1,
	["ice"] = 2,
	["poison"] = 3,
	["death"] = 4,
	["energy"] = 5,
	["physical"] = 6,
	["holy"] = 7
    }
}

function onSay(cid, words, param)
    local wand_left = getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid
    local wand_right = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid 

    if wand_left ~= config.wand_id and wand_right ~= config.wand_id then
        doPlayerSendCancel(cid, "Voce deve estar equipado com uma ".. getItemNameById(config.wand_id) .." para usar este comando.")
        return true
    end
    
    if config.types[param] then
        setPlayerStorageValue(cid, 4561, config.types[param])
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Sua wand ira atacar ".. param .. ".")
    else
        local str = ""
        
        for i, _ in pairs(config.types) do
            str = str .. ", ".. i
        end
        
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Os elementos disponiveis sao: ".. string.sub(str, 3, #str) ..".")
    end

    return true
end

Altere o wand_id conforme configurado em weapons.

Agora vá em data/talkactions/talkactions.xml e coloque o seguinte conteúdo:

 


<talkaction words="!elemento;/elemento" event="script" value="elementos.lua"/>

Exemplo de funcionamento:

https://www.youtube.com/watch?v=HHmZ1RpsrD0

 
Gostaria de deixar um agradecimento especial para MaXwEllDeN, pela ajuda.

Teria como adicionar um effect cada vez que altera o elemento? por exemplo !elemento ice, ele vai sair um effect de ice do personagem?

Postado
Em 02/02/2015 em 00:21, Bruno Minervino disse:

Introdução:
É uma wand que ataca vários elementos aleatoriamente, porém não somente isso, você pode alterar o elemento dela com uma talkaction.
 
Instalação:
Vá até data/weapons/scripts e crie um arquivo chamando wandelementos.lua e coloque o seguinte conteúdo:

 


local min, max = 1700,1900 --Ataque mínino e ataque máximo

local w = {
	[1] = {ef = 36, sh = 3, dmg = COMBAT_FIREDAMAGE},
	[2] = {ef = 42, sh = 28, dmg = COMBAT_ICEDAMAGE},
	[3] = {ef = 46, sh = 38, dmg = COMBAT_POISONDAMAGE},
	[4] = {ef = 17, sh = 31, dmg = COMBAT_DEATHDAMAGE},
	[5] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
	[6] = {ef = 36, sh = 31, dmg = COMBAT_PHYSICALDAMAGE},
	[7] = {ef = 49, sh = 37, dmg = COMBAT_HOLYDAMAGE}
}

function onUseWeapon(cid, var)
        local effect = getPlayerStorageValue(cid, 4561)
        local target = getCreatureTarget(cid)
        
        if target ~= 0 then
                local wx = w[effect] or w[math.random(#w)]
                doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh)
                addEvent(doAreaCombatHealth, 100, cid, wx.dmg, getThingPos(target), 0, -min, -max, wx.ef)
        end
        return true
end

Altere o min e max de acordo com sua necessidade.
 
Agora vá em data/weapons/weapons.xml e coloque o seguinte conteúdo:

 


<wand id="7424" level="100" mana="30" event="script" value="wandelementos.lua">
	<vocation id="1"/>
	<vocation id="2"/>
	<vocation id="5" showInDescription="0"/>
	<vocation id="6" showInDescription="0"/>
</wand>

Altere o id, level e mana de acordo com sua necessidade.

Agora vamos configurar a talkaction que troca os elementos.
Vá até data/talkactions/scripts e crie um arquivo chamando elementos.lua e coloque o seguinte conteúdo:

 


local config = {
    wand_id = 7424, --ID da wand

    types = {
	["all"] = -1, --Ataca os elementos aleatoriamente
        ["fire"] = 1,
	["ice"] = 2,
	["poison"] = 3,
	["death"] = 4,
	["energy"] = 5,
	["physical"] = 6,
	["holy"] = 7
    }
}

function onSay(cid, words, param)
    local wand_left = getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid
    local wand_right = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid 

    if wand_left ~= config.wand_id and wand_right ~= config.wand_id then
        doPlayerSendCancel(cid, "Voce deve estar equipado com uma ".. getItemNameById(config.wand_id) .." para usar este comando.")
        return true
    end
    
    if config.types[param] then
        setPlayerStorageValue(cid, 4561, config.types[param])
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Sua wand ira atacar ".. param .. ".")
    else
        local str = ""
        
        for i, _ in pairs(config.types) do
            str = str .. ", ".. i
        end
        
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Os elementos disponiveis sao: ".. string.sub(str, 3, #str) ..".")
    end

    return true
end

Altere o wand_id conforme configurado em weapons.

Agora vá em data/talkactions/talkactions.xml e coloque o seguinte conteúdo:

 


<talkaction words="!elemento;/elemento" event="script" value="elementos.lua"/>

Exemplo de funcionamento:

https://www.youtube.com/watch?v=HHmZ1RpsrD0

 
Gostaria de deixar um agradecimento especial para MaXwEllDeN, pela ajuda.

Rep ++++

  • 7 months later...
Postado
Em 02/02/2015 em 00:21, Bruno Minervino disse:

Introdução:
É uma wand que ataca vários elementos aleatoriamente, porém não somente isso, você pode alterar o elemento dela com uma talkaction.
 
Instalação:
Vá até data/weapons/scripts e crie um arquivo chamando wandelementos.lua e coloque o seguinte conteúdo:

 


local min, max = 1700,1900 --Ataque mínino e ataque máximo

local w = {
	[1] = {ef = 36, sh = 3, dmg = COMBAT_FIREDAMAGE},
	[2] = {ef = 42, sh = 28, dmg = COMBAT_ICEDAMAGE},
	[3] = {ef = 46, sh = 38, dmg = COMBAT_POISONDAMAGE},
	[4] = {ef = 17, sh = 31, dmg = COMBAT_DEATHDAMAGE},
	[5] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
	[6] = {ef = 36, sh = 31, dmg = COMBAT_PHYSICALDAMAGE},
	[7] = {ef = 49, sh = 37, dmg = COMBAT_HOLYDAMAGE}
}

function onUseWeapon(cid, var)
        local effect = getPlayerStorageValue(cid, 4561)
        local target = getCreatureTarget(cid)
        
        if target ~= 0 then
                local wx = w[effect] or w[math.random(#w)]
                doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh)
                addEvent(doAreaCombatHealth, 100, cid, wx.dmg, getThingPos(target), 0, -min, -max, wx.ef)
        end
        return true
end

Altere o min e max de acordo com sua necessidade.
 
Agora vá em data/weapons/weapons.xml e coloque o seguinte conteúdo:

 


<wand id="7424" level="100" mana="30" event="script" value="wandelementos.lua">
	<vocation id="1"/>
	<vocation id="2"/>
	<vocation id="5" showInDescription="0"/>
	<vocation id="6" showInDescription="0"/>
</wand>

Altere o id, level e mana de acordo com sua necessidade.

Agora vamos configurar a talkaction que troca os elementos.
Vá até data/talkactions/scripts e crie um arquivo chamando elementos.lua e coloque o seguinte conteúdo:

 


local config = {
    wand_id = 7424, --ID da wand

    types = {
	["all"] = -1, --Ataca os elementos aleatoriamente
        ["fire"] = 1,
	["ice"] = 2,
	["poison"] = 3,
	["death"] = 4,
	["energy"] = 5,
	["physical"] = 6,
	["holy"] = 7
    }
}

function onSay(cid, words, param)
    local wand_left = getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid
    local wand_right = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid 

    if wand_left ~= config.wand_id and wand_right ~= config.wand_id then
        doPlayerSendCancel(cid, "Voce deve estar equipado com uma ".. getItemNameById(config.wand_id) .." para usar este comando.")
        return true
    end
    
    if config.types[param] then
        setPlayerStorageValue(cid, 4561, config.types[param])
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Sua wand ira atacar ".. param .. ".")
    else
        local str = ""
        
        for i, _ in pairs(config.types) do
            str = str .. ", ".. i
        end
        
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Os elementos disponiveis sao: ".. string.sub(str, 3, #str) ..".")
    end

    return true
end

Altere o wand_id conforme configurado em weapons.

Agora vá em data/talkactions/talkactions.xml e coloque o seguinte conteúdo:

 


<talkaction words="!elemento;/elemento" event="script" value="elementos.lua"/>

Exemplo de funcionamento:

https://www.youtube.com/watch?v=HHmZ1RpsrD0

 
Gostaria de deixar um agradecimento especial para MaXwEllDeN, pela ajuda.

vc poderia adapta pra 10.90?

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo