BE

[Pedido] Runa - Solta Bolt, Tem Dano Minimo E Depende De Skill

Por beddy, 09 de abr. de 2012 em Scripts

tibia
script
otserv
7
1.3k
beddyB
09 de abril de 2012 às 09:07

Tipo do script: Spell

Protocolo (versão do Tibia): 8.6

Servidor utilizado: TFS

Nível de experiência: Alta

Adicionais/Informações:

 

 

Queria uma runa "x"

- ao usar, tem efeito de bolt

- ao chegar no target (atingir) tem efeito de psical

 

Ela deveria ter um dano minimo, e uma formula para adicionar atack por exemplo, (level + distance / 3)

 

 

Bem, estou com um pouco de dificuldade em fazer uma runa deste tipo. Ja tentei usar como base algumas tags de spell de exori hur e talz porem nao consegui, essa nao é a minha area, de spells eu nao sei quase nada, ja pesquisei porem nao achei.

 

Obrigado, se alguem quiser tambem dar uma luz aqui, aceito.

jhon992J
09 de abril de 2012 às 10:09

Creio que assim funcionara:

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BOLT)
local attackmin, attackmax = 100, 300 -- attack minimo, attack maximo

function onCastSpell(cid, var)
target = getCreatureTarget(cid)
hit = (math.random(attackmin,attackmax) + getPlayerSkillLevel(cid, SKILL_DISTANCE) / 3)
doCreatureAddHealth(target, -hit)
return doCombat(cid, combat, var)
end

Editado Abril 9 por Jhon992

beddyB
09 de abril de 2012 às 11:02

kkkkkk, todas as minhas questoes sao respondidas pelo Jhon.

 

Valeu ae manolo!

 

Seguinte, testei aqui, só que ha um problema.

Os efeitos estao certinhos, porem os monstros nao recebem dano... ;/

 

Tem como fazer esta runa dar REMOVE em bolts?

Editado Abril 9 por beddy

jhon992J
09 de abril de 2012 às 12:36

Ta aew =)

 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BOLT)
local attackmin, attackmax = 100, 300 -- attack minimo, attack maximo

function onCastSpell(cid, var)

if doPlayerRemoveItem(cid, 2160, 1) then -- 2160, troque pelo id da bolt
target = getCreatureTarget(cid)
if (target <= 0) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Selecione um target.")
return false
end
hit = (math.random(attackmin,attackmax) + getPlayerSkillLevel(cid, SKILL_DISTANCE) / 3)
   doCreatureAddHealth(target, -hit)
   doSendAnimatedText(getCreaturePosition(target), math.floor(hit), 144)
   return doCombat(cid, combat, var)
end
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não possui bolt's.")
return false
end

beddyB
09 de abril de 2012 às 20:07

Mano, brigadão, queria só pedir mais uma coisa..

 

Como eu coloco pra poder usar a runa de longe? (Coloquei ela em uma Bright Sword)

Quando vou dar use fala qe estou muito longe...

 

tentei no spells.xml colocar range "5" e nao consegui.. tem como colocar na rune ou vou ter que modificar em items algo assim?

 

 

RESOLVIDO!!!! ÊÊÊÊ!

Editado Abril 9 por beddy

jhon992J
10 de abril de 2012 às 10:04

Reportado para moverem, para Pedidos Atendidos!

HisashiitYamagutiH
10 de abril de 2012 às 11:46

Tópico movido para Pedidos Atendidos