Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado
  • Autor
4 horas atrás, reisbro disse:

auheuahea é chatinho mesmo

 

eu tava com um sistema em mente parecido, e vou começar a programar e tentar deixar bem fácil pra editar e adicionar coisas novas. se eu conseguir fazer dar certo eu posto aqui pra ti

Obrigado, ficarei esperando!

  • 4 months later...
  • Respostas 9
  • Visualizações 3.2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Para evitar maiores modificações, você poderia utilizar esse aumento de dano apenas para player vs player (com monstros não funciona). Após usar a magia, o player só poderia utilizar novamente assim q

  • Entao, desculpa a demora mas só vi esse post agora hahaha se tu tiver conhecimentos de lua vai ser fácil, só vou mandar a ideia p ti. Pensei nisso agora, e nao sei se tem outro jeito de fazer mas

  • 4 weeks later...
Postado
  • Solução

Para evitar maiores modificações, você poderia utilizar esse aumento de dano apenas para player vs player (com monstros não funciona). Após usar a magia, o player só poderia utilizar novamente assim que o efeito do bônus no elemento (fire, ice, etc) acabasse. Então, teste assim:

 

Em spells/scripts crie um arquivo:

 

buffelemental.lua

 

Spoiler

local t = {
stors = {96572, 96573}, -- modifique apenas se for realmente necessário
effect_time = {5, "min"}, -- tempo de efeito da spell
["flam"] = {bonus = 10, element = COMBAT_FIREDAMAGE}, -- bonus = % de aumento no hit, element = tipo do dano
["tera"] = {bonus = 10, element = COMBAT_EARTHDAMAGE},
["ico"] = {bonus = 10, element = COMBAT_PHYSICALDAMAGE},
["frigo"] = {bonus = 10, element = COMBAT_ICEDAMAGE}
}

function onCastSpell(cid, var)
    local p, buff = getPlayerPosition(cid), t[var.string]
    local buff_on = getPlayerStorageValue(cid, t.stors[1])
    if not buff then
        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
        doSendMagicEffect(p, CONST_ME_POFF)
        return true
    end
    if buff_on > os.time() then
        doPlayerSendCancel(cid, "Your elemental buff is already active.")
        doSendMagicEffect(p, CONST_ME_POFF)
        return true
    end
    setPlayerStorageValue(cid, t.stors[1], mathtime(t.effect_time) + os.time())
    local info = var.string..","..buff.bonus..","..buff.element
    setPlayerStorageValue(cid, t.stors[2], info)
    doSendMagicEffect(p, CONST_ME_MAGIC_GREEN)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, (var.string:upper()).." BUFF ON!")
    return true
end

function mathtime(table) -- by dwarfer
local unit = {"sec", "min", "hour", "day"}
for i, v in pairs(unit) do
if v == table[2] then
return table[1]*(60^(v == unit[4] and 2 or i-1))*(v == unit[4] and 24 or 1)
end
end
return error("Bad declaration in mathtime function.")
end

 

 

Edite as palavras "flam", "frigo" como queira ou adicione outras.

 

Em spells.xml: (Edite as palavras da magia, o maglvl, mana e os outros parâmetros de acordo com o que desejar, esse aí é apenas para servir como base caso você não saiba como fazer)

 

Spoiler

<instant name="Elemental Buff" words="utori buff" aggressive="1" params="1" needtarget="0" lvl="1" maglv="1" mana="10" soul="0" exhaustion="1" prem="1" enabled="1" script="buffelemental.lua">
 <vocation id="1"/>
 <vocation id="2"/>
<vocation id="3"/>
<vocation id="4"/>
<vocation id="5"/>
<vocation id="6"/>
<vocation id="7"/>
<vocation id="8"/>
  </instant>

 

 

Em creaturescripts/scripts crie um arquivo:

 

buffelementalattack.lua

 

Spoiler

local protect, stors = {}, {96572, 96573} -- modifique os storages apenas se necessário

function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(attacker) and (not (attacker == cid)) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and isPlayer(cid) and value >= 1 then
        if getPlayerStorageValue(attacker, stors[1]) > os.time() then
            if protect[attacker] then protect[attacker] = nil return true end
            local t = string.explode(tostring(getPlayerStorageValue(attacker, stors[2])), ",")
            local buff = {type = (t[1]:upper()).."!", bonus = tonumber(t[2])/100, element = tonumber(t[3])}
            if combat == buff.element then
                attack_bonus = math.ceil(2*value*(1+buff.bonus))
                protect[attacker] = true
                doTargetCombatHealth(attacker, cid, combat, -attack_bonus, -attack_bonus, CONST_ME_NONE)
                doSendAnimatedText(getPlayerPosition(attacker), buff.type, COLOR_TEAL)
                return false
            end
        end
    end
    return true
end

 

 

No login.lua, registre o evento adicionando: 

registerCreatureEvent(cid, "BuffElemental")

Em creaturescripts.xml, adicione a tag: 

 <event type="statschange" name="BuffElemental" event="script" value="buffelementalattack.lua"/>

Para utilizar a magia:

 

utori buff "flam -- o hit do player quando FIRE será aumentado em 10% como foi configurado lá na spell

 

Para os demais:

utori buff "tera
utori buff "ico
utori buff "frigo

Contato:

 

  • 3 years later...
Postado
Em 19/11/2017 em 12:09, Dwarfer disse:

Para evitar maiores modificações, você poderia utilizar esse aumento de dano apenas para player vs player (com monstros não funciona). Após usar a magia, o player só poderia utilizar novamente assim que o efeito do bônus no elemento (fire, ice, etc) acabasse. Então, teste assim:

 

Em spells/scripts crie um arquivo:

 

buffelemental.lua

 

  Mostrar conteúdo oculto


local t = {
stors = {96572, 96573}, -- modifique apenas se for realmente necessário
effect_time = {5, "min"}, -- tempo de efeito da spell
["flam"] = {bonus = 10, element = COMBAT_FIREDAMAGE}, -- bonus = % de aumento no hit, element = tipo do dano
["tera"] = {bonus = 10, element = COMBAT_EARTHDAMAGE},
["ico"] = {bonus = 10, element = COMBAT_PHYSICALDAMAGE},
["frigo"] = {bonus = 10, element = COMBAT_ICEDAMAGE}
}

function onCastSpell(cid, var)
    local p, buff = getPlayerPosition(cid), t[var.string]
    local buff_on = getPlayerStorageValue(cid, t.stors[1])
    if not buff then
        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
        doSendMagicEffect(p, CONST_ME_POFF)
        return true
    end
    if buff_on > os.time() then
        doPlayerSendCancel(cid, "Your elemental buff is already active.")
        doSendMagicEffect(p, CONST_ME_POFF)
        return true
    end
    setPlayerStorageValue(cid, t.stors[1], mathtime(t.effect_time) + os.time())
    local info = var.string..","..buff.bonus..","..buff.element
    setPlayerStorageValue(cid, t.stors[2], info)
    doSendMagicEffect(p, CONST_ME_MAGIC_GREEN)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, (var.string:upper()).." BUFF ON!")
    return true
end

function mathtime(table) -- by dwarfer
local unit = {"sec", "min", "hour", "day"}
for i, v in pairs(unit) do
if v == table[2] then
return table[1]*(60^(v == unit[4] and 2 or i-1))*(v == unit[4] and 24 or 1)
end
end
return error("Bad declaration in mathtime function.")
end

 

 

Edite as palavras "flam", "frigo" como queira ou adicione outras.

 

Em spells.xml: (Edite as palavras da magia, o maglvl, mana e os outros parâmetros de acordo com o que desejar, esse aí é apenas para servir como base caso você não saiba como fazer)

 

  Mostrar conteúdo oculto


<instant name="Elemental Buff" words="utori buff" aggressive="1" params="1" needtarget="0" lvl="1" maglv="1" mana="10" soul="0" exhaustion="1" prem="1" enabled="1" script="buffelemental.lua">
 <vocation id="1"/>
 <vocation id="2"/>
<vocation id="3"/>
<vocation id="4"/>
<vocation id="5"/>
<vocation id="6"/>
<vocation id="7"/>
<vocation id="8"/>
  </instant>

 

 

Em creaturescripts/scripts crie um arquivo:

 

buffelementalattack.lua

 

  Mostrar conteúdo oculto


local protect, stors = {}, {96572, 96573} -- modifique os storages apenas se necessário

function onStatsChange(cid, attacker, type, combat, value)
    if isPlayer(attacker) and (not (attacker == cid)) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and isPlayer(cid) and value >= 1 then
        if getPlayerStorageValue(attacker, stors[1]) > os.time() then
            if protect[attacker] then protect[attacker] = nil return true end
            local t = string.explode(tostring(getPlayerStorageValue(attacker, stors[2])), ",")
            local buff = {type = (t[1]:upper()).."!", bonus = tonumber(t[2])/100, element = tonumber(t[3])}
            if combat == buff.element then
                attack_bonus = math.ceil(2*value*(1+buff.bonus))
                protect[attacker] = true
                doTargetCombatHealth(attacker, cid, combat, -attack_bonus, -attack_bonus, CONST_ME_NONE)
                doSendAnimatedText(getPlayerPosition(attacker), buff.type, COLOR_TEAL)
                return false
            end
        end
    end
    return true
end

 

 

No login.lua, registre o evento adicionando: 


registerCreatureEvent(cid, "BuffElemental")

Em creaturescripts.xml, adicione a tag: 


 <event type="statschange" name="BuffElemental" event="script" value="buffelementalattack.lua"/>

Para utilizar a magia:

 

utori buff "flam -- o hit do player quando FIRE será aumentado em 10% como foi configurado lá na spell

 

Para os demais:

utori buff "tera
utori buff "ico
utori buff "frigo

Boa noite, desculpe-me reviver o tópico, mas seria possivel editar esse script para aumentar o dano do personagem permanent?
Por exemplo, colocar pra usar um item, exemplo "mastermind potion", ao usar o item o jogador ganhará 5% de dano a mais tanto em atk basico quanto em magia, alguém poderia me ajudar por favor?

 

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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo