Gosto de fazer pedidos com ideias interessantes. Mas, no caso, como eu faria para obter o tipo de runa? É um atributo ou posso verificar o nome da runa?
info
Grupo: Visconde
Registrado: 21/09/10
Posts: 319
Reputação: +27
Char no Tibia: lest sarif

Bom o nome da runa seria,
Poison Rune
Energy Rune
Fire Rune
Ice Rune
porém se o cara colocasse a fire rune , e a wand dele fosse de fire , dobrava o atk ,
Oneshot , obrigado ,
Sobre dobrar o ataque, não estou afim de fazer, mas dá pra atirar duas vezes com fogo.
FLW!
local spell = {
[1] = {
type = COMBAT_ENERGYDAMAGE,
effect = CONST_ME_PURPLEENERGY,
shoot = CONST_ANI_ENERGYBALL,
formula = {
type = COMBAT_FORMULA_LEVELMAGIC,
values = {0, -40, 0, -80}
},
},
[2] = {
type = COMBAT_EARTHDAMAGE,
effect = CONST_ME_HITBYPOISON,
shoot = CONST_ANI_EARTH,
formula = {
type = COMBAT_FORMULA_LEVELMAGIC,
values = {0, -40, 0, -80}
},
},
[3] = {
type = COMBAT_FIREDAMAGE,
effect = CONST_ME_FIREAREA,
shoot = CONST_ANI_FIRE,
formula = {
type = COMBAT_FORMULA_LEVELMAGIC,
values = {0, -40, 0, -80}
},
},
[4] = {
type = COMBAT_ICEDAMAGE,
effect = CONST_ME_ICEATTACK,
shoot = CONST_ANI_ICE,
formula = {
type = COMBAT_FORMULA_LEVELMAGIC,
values = {0, -40, 0, -80}
},
},
}
local combat = {}
for n = 1, #spell do
local config = spell[n]
combat[n] = createCombatObject()
setCombatParam(combat[n], COMBAT_PARAM_TYPE, config.type)
setCombatParam(combat[n], COMBAT_PARAM_EFFECT, config.effect)
setCombatParam(combat[n], COMBAT_PARAM_DISTANCEEFFECT, config.shoot)
setCombatFormula(combat[n], config.formula.type, unpack(config.formula.values))
end
function onCastSpell(cid, var)
local tmp = {}
local container = getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
if not isContainer(container.uid) then
doCombat(cid, combat[1], var)
return true
end
local elements = {["energy"] = 1, ["poison"] = 2, ["fire"] = 3, ["ice"] = 4}
for slot = getContainerCap(container.uid), 0, -1 do
local item = getContainerItem(container.uid, slot)
if item.uid > 0 then
local element = getItemName(item.uid):match("(%a+)%s*rune"):lower()
if isInArray(elements, elements[element]) then
table.insert(tmp, elements[element])
end
end
end
for n = 1, #tmp do
addEvent(doCombat, (n * 200) - 200, cid, combat[tmp[n]], var)
end
return true
end
info
Grupo: Visconde
Registrado: 21/09/10
Posts: 319
Reputação: +27
Char no Tibia: lest sarif

VOCE, É , FODA. SIMPLES ASSIM
onde ponho isso?, weapons?
Editado Janeiro 26 por tonynamoral
info
Grupo: Artesão
Registrado: 15/11/12
Posts: 120
Reputação: +17
Char no Tibia: Ba Rao

Esse script ai vai na pasta data\spells\scripts, ai você coloca no spells.xml:
<rune name="Poison Rune" id="2285" allowfaruse="1" charges="3" lvl="14" maglv="0" exhaustion="2000" blocktype="solid" event="script" value="SCRIPT DO ONESHOT.lua"/>
Abraços!
Editado Janeiro 26 por juliok80
info
Grupo: Visconde
Registrado: 21/09/10
Posts: 319
Reputação: +27
Char no Tibia: lest sarif

Bom, isso iria ativar quando eu estou usando a minha wand né?
Então, caras, agora eu notei, eu fiz isso como spell, lolz.
local spell = {
[1] = {
type = COMBAT_ENERGYDAMAGE,
effect = CONST_ME_PURPLEENERGY,
shoot = CONST_ANI_ENERGYBALL,
formula = {
type = COMBAT_FORMULA_LEVELMAGIC,
values = {0, -40, 0, -80}
},
},
[2] = {
type = COMBAT_EARTHDAMAGE,
effect = CONST_ME_HITBYPOISON,
shoot = CONST_ANI_EARTH,
formula = {
type = COMBAT_FORMULA_LEVELMAGIC,
values = {0, -40, 0, -80}
},
},
[3] = {
type = COMBAT_FIREDAMAGE,
effect = CONST_ME_FIREAREA,
shoot = CONST_ANI_FIRE,
formula = {
type = COMBAT_FORMULA_LEVELMAGIC,
values = {0, -40, 0, -80}
},
},
[4] = {
type = COMBAT_ICEDAMAGE,
effect = CONST_ME_ICEATTACK,
shoot = CONST_ANI_ICE,
formula = {
type = COMBAT_FORMULA_LEVELMAGIC,
values = {0, -40, 0, -80}
},
},
}
local combat = {}
for n = 1, #spell do
local config = spell[n]
combat[n] = createCombatObject()
setCombatParam(combat[n], COMBAT_PARAM_TYPE, config.type)
setCombatParam(combat[n], COMBAT_PARAM_EFFECT, config.effect)
setCombatParam(combat[n], COMBAT_PARAM_DISTANCEEFFECT, config.shoot)
setCombatFormula(combat[n], config.formula.type, unpack(config.formula.values))
end
function onUseWeapon(cid, var)
local tmp = {}
local container = getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
if not isContainer(container.uid) then
doCombat(cid, combat[1], var)
return true
end
local elements = {["energy"] = 1, ["poison"] = 2, ["fire"] = 3, ["ice"] = 4}
for slot = getContainerCap(container.uid), 0, -1 do
local item = getContainerItem(container.uid, slot)
if item.uid > 0 then
local element = getItemName(item.uid):match("(%a+)%s*rune"):lower()
if isInArray(elements, elements[element]) then
table.insert(tmp, elements[element])
end
end
end
for n = 1, #tmp do
addEvent(doCombat, (n * 200) - 200, cid, combat[tmp[n]], var)
end
return true
end
Eu notei também que o que você quer, é que tipo, a wand já tenha um tipo de ataque e adicione ataques extras conforme as tais runas no container, então faça isso, nessa linha:
local tmp = {}
Coloque:
local tmp = {1}
Onde:
1 - Energy 2 - Poison 3 - Fire 4 - Ice
Isso vai ser o ataque inicial da wand sem runas, se tmp estiver vazio, ela não atacará nada.
info
Grupo: Visconde
Registrado: 21/09/10
Posts: 319
Reputação: +27
Char no Tibia: lest sarif

Bom ... não entendi a configuraçao.
Bom ... não entendi a configuraçao.
Nem eu, haha, boa sorte.
Mas o que importa é a funcionalidade.
Abraços.
Editado Janeiro 26 por Oneshot
info
Grupo: Visconde
Registrado: 21/09/10
Posts: 319
Reputação: +27
Char no Tibia: lest sarif

LoL , se o carinha estiver sem a runa , ele nao ataca.
Editado Janeiro 26 por tonynamoral
Você leu meu penúltimo post, meu caro coleguinha desprovido da capacidade de raciocinar?
Editado Janeiro 26 por Oneshot
info
Grupo: Visconde
Registrado: 21/09/10
Posts: 319
Reputação: +27
Char no Tibia: lest sarif

Bom , mesmo assim Oneshot voce é 10+1.




info
Grupo: Visconde
Registrado: 21/09/10
Posts: 319
Reputação: +27
Char no Tibia: lest sarif
Olá galera , eu estou querendo pedir um sistema que nao é muito easy fazer nao ,
bom , ele funciona assim , eu tenho 1 bag que fica na minha (RIGHT HAND) *Mao Direita* {Lugar aonde poe o shield}
Bom , ai dentro dessa bag eu posso por runas, e o funcionamento seria assim
Eu estou usando uma wand de fogo , ai eu tenho a minha bag lá na right hand , e eu tenho 1 poison rune na minha outra bag
ai eu abro a minha bag que está no right hand , e ponho a runa dentro dessa bag , ai a wand de fogo , vai atacar também de poison,
tipo , o mesmo dano que ela tirar de fogo vai tirar de poison , e isso é valido para os 4 elementos
{Fire, Ice, Energy, Poison}
E se eu colocassse +1 rune , iria atirar o Fogo + Posison + A rune que eu colokei.
Então galera é isso ai .