Ir para conteúdo
  • Cadastre-se

(Resolvido)Dano Variar Pela ml -TFS 0.4


Ir para solução Resolvido por Mathias Kenfi,

Posts Recomendados

boa tarde, tem como acrescentar no script, pra ter uma variação de acordo com magic level ??

 

local min, max = 25000,25000 --Ataque mínimo e ataque máximo

local w = {
    [1] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
}

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

 

Editado por BilauX (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
Em 25/01/2019 em 13:32, BilauX disse:

boa tarde, tem como acrescentar no script, pra ter uma variação de acordo com magic level ??

 


local min, max = 25000,25000 --Ataque mínimo e ataque máximo

local w = {
    [1] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
}

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

 

 

local magic = getPlayerMagLevel(cid) -- Não mexa
local dano = (magic * 25000/100) -- Aqui é a porcentagem que de 25000, se seu Magic Level é 25, irá retornar 25% de 25000
local min, max = (25000+dano),(25000+dano) -- Aqui irá somar o valor anterior ou seja, (25000+% de 25000)

local w = {
    [1] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
}

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

Link para o post
Compartilhar em outros sites
[10:9:08.508] [Error - Weapon Interface] 
[10:9:08.508] data/weapons/scripts/super vara.lua
[10:9:08.508] Description: 
[10:9:08.508] data/weapons/scripts/super vara.lua:2: attempt to perform arithmetic on local 'magic' (a boolean value)
[10:9:08.508] [Warning - Event::loadScript] Cannot load script (data/weapons/scripts/super vara.lua)

 

7 horas atrás, Joaovettor disse:

local magic = getPlayerMagLevel(cid) -- Não mexa
local dano = (magic * 25000/100) -- Aqui é a porcentagem que de 25000, se seu Magic Level é 25, irá retornar 25% de 25000
local min, max = (25000+dano),(25000+dano) -- Aqui irá somar o valor anterior ou seja, (25000+% de 25000)

local w = {
    [1] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
}

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

 

 

Link para o post
Compartilhar em outros sites
3 horas atrás, BilauX disse:

[10:9:08.508] [Error - Weapon Interface] 
[10:9:08.508] data/weapons/scripts/super vara.lua
[10:9:08.508] Description: 
[10:9:08.508] data/weapons/scripts/super vara.lua:2: attempt to perform arithmetic on local 'magic' (a boolean value)
[10:9:08.508] [Warning - Event::loadScript] Cannot load script (data/weapons/scripts/super vara.lua)

 

 

 

local dano = (getPlayerMagLevel(cid) * 25000/100) -- Aqui é a porcentagem que de 25000, se seu Magic Level é 25, irá retornar 25% de 25000
local min, max = (25000+dano),(25000+dano) -- Aqui irá somar o valor anterior ou seja, (25000+% de 25000)

local w = {
    [1] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
}

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

Link para o post
Compartilhar em outros sites
[16:18:21.443] [Error - Weapon Interface] 
[16:18:21.443] data/weapons/scripts/super vara.lua
[16:18:21.443] Description: 
[16:18:21.443] data/weapons/scripts/super vara.lua:1: attempt to perform arithmetic on a boolean value
[16:18:21.443] [Warning - Event::loadScript] Cannot load script (data/weapons/scripts/super vara.lua)

 

2 horas atrás, Joaovettor disse:

local dano = (getPlayerMagLevel(cid) * 25000/100) -- Aqui é a porcentagem que de 25000, se seu Magic Level é 25, irá retornar 25% de 25000
local min, max = (25000+dano),(25000+dano) -- Aqui irá somar o valor anterior ou seja, (25000+% de 25000)

local w = {
    [1] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
}

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

 

 

Link para o post
Compartilhar em outros sites
  • Solução
4 minutos atrás, BilauX disse:

[16:18:21.443] [Error - Weapon Interface] 
[16:18:21.443] data/weapons/scripts/super vara.lua
[16:18:21.443] Description: 
[16:18:21.443] data/weapons/scripts/super vara.lua:1: attempt to perform arithmetic on a boolean value
[16:18:21.443] [Warning - Event::loadScript] Cannot load script (data/weapons/scripts/super vara.lua)

 

 

 

local w = {
    [1] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
}

function onUseWeapon(cid, var)
        local ml = (getPlayerMagLevel(cid)*25000/100)
        local min, max = (25000+ml),(25000+ml)
        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

 

 

Link para o post
Compartilhar em outros sites

agora não deu erro, a configuração fica como, ta quantos porcentos a cada ml ou ta uma porcentagem fixa referente ml ??

 

49 minutos atrás, Joaovettor disse:

local w = {
    [1] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
}

function onUseWeapon(cid, var)
        local ml = (getPlayerMagLevel(cid)*25000/100)
        local min, max = (25000+ml),(25000+ml)
        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

 

 

 

 

Link para o post
Compartilhar em outros sites
58 minutos atrás, BilauX disse:

agora não deu erro, a configuração fica como, ta quantos porcentos a cada ml ou ta uma porcentagem fixa referente ml ??

 

 

 

Sua quantidade ML é a quantidade em % que aumenta no Dano Base

 

 

 

EXEMPLO:

Se o Dano base é 25000 e você tem 35 de Magic Level, vai aumentar 35% de 25000 ou seja, 25000+8750=33750

Link para o post
Compartilhar em outros sites

ok, então o único lugar q mexo e nos 25000 né ?? tu faz um de skill pra mim tbm ?? tem q criar outro tópico ??? muito obrigado

 

1 minuto atrás, Joaovettor disse:

Sua quantidade ML é a quantidade em % que aumenta no Dano Base

 

 

 

EXEMPLO:

Se o Dano base é 25000 e você tem 35 de Magic Level, vai aumentar 35% de 25000 ou seja, 25000+8750=33750

 

 

Link para o post
Compartilhar em outros sites

Para fazer por Skill você deve mudar > getPlayerMagLevel(cid) < para getPlayerSkillLevel(cid, skillid)

 

em Skill ID você coloca o ID da skill que vai checar


SKILL_CLUB = 1
SKILL_SWORD = 2
SKILL_AXE = 3
SKILL_DISTANCE = 4
SKILL_SHIELD = 5
SKILL_FISHING = 6

 

 

 

Editado por Joaovettor (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
Citar

function onUseWeapon(cid, var)
        local skill = (getPlayerSkillLevel(cid, 2)*25000/100)
        local min, max = (25000+skill),(25000+skill)
        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

seria assim ??

 

4 minutos atrás, Joaovettor disse:

Para fazer por Skill você deve mudar > getPlayerMagLevel(cid) < para getPlayerSkillLevel(cid, skillid)

 

em Skill ID você coloca o ID da skill que vai checar


SKILL_CLUB = 1
SKILL_SWORD = 2
SKILL_AXE = 3
SKILL_DISTANCE = 4
SKILL_SHIELD = 5
SKILL_FISHING = 6

 

 

 

Link para o post
Compartilhar em outros sites
5 horas atrás, BilauX disse:

muito obrigado, boa tarde, ótimo dia para vc...

 

@Joaovettor com skill o escalonamento ficaria como ??

 

Da mesma forma

Link para o post
Compartilhar em outros sites

 

bom dia, teria como fazer q o script puxasse a procentagem de critico q o cara tem tbm ou mudar o script do crítico, tanto faz desde as armas fiquem do msm jeito e usem o critical tbm,  pq assim, o sistema de critical não funciona..

 

meu sistema de critical aí..

 

Spoiler

local lvlcrit = 48913
local multiplier = 1.0
local effect = 16


function onStatsChange(cid, attacker, type, combat, value)
if (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and isPlayer(attacker) and isCreature(cid) then
if (getPlayerStorageValue(attacker, lvlcrit)*1) >= math.random (0,1000) then
value = math.ceil(value*(multiplier))
doTargetCombatHealth(attacker, cid, combat, -value, -value, 255)
doSendMagicEffect(getCreaturePosition(cid), effect)
doSendAnimatedText(getCreaturePos(attacker), "Critical!", 35)
return false
end
end
return true
end

Em 29/01/2019 em 00:29, Joaovettor disse:

Da mesma forma

 

 

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo