local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BOLT)
local attackmin, attackmax = 300, 340 -- attack minimo, attack maximo
function onCastSpell(cid, var)
if doPlayerRemoveItem(cid, 2543, 1) then -- 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)
doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -hit, -hit, CONST_ME_MORTAREA)
doSendAnimatedText(getCreaturePosition(target), math.floor(hit), 144)
return doCombat(cid, combat, var)
end
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não possui balas.")
return false
end
info
Grupo: Conde
Registrado: 30/10/11
Posts: 625
Reputação: +101
Gênero: Masculino

info
Grupo: Visconde
Registrado: 21/12/06
Posts: 355
Reputação: +118
Gênero: Masculino

Ta dando EXP, porem agora a spell ta dando 2 hits.
2 Hits de 340
Tem como ajudar?
Ja vai rep pra tu!
doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -hit, -hit, CONST_ME_MORTAREA)
é só tirar esse 1 desses , -hit neh?
Obrigado
Tirei um desses -HIT
porem bugou...
Pode ajudar?!
Editado Maio 26 por beddy
info
Grupo: Conde
Registrado: 30/10/11
Posts: 625
Reputação: +101
Gênero: Masculino

acho que n dava dois hit,mas duas mensagens, e que se usa doCreatureAddHealth, n sai o quanto tiro dai tem que colocar uma fução pra sai a mensagem.
mas com a função que colquei sai normal, mas eu n tirei a mensagem que saria,dai sai duas vese(mas so tira uma ves, n são dois hits)
corrigido
local attackmin, attackmax = 300, 340 -- attack minimo, attack maximo function onCastSpell(cid, var) if doPlayerRemoveItem(cid, 2543, 1) then -- 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) doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -hit, -hit, CONST_ME_MORTAREA) doSendDistanceShoot(getCreaturePos(cid), getCreaturePos(target), CONST_ANI_BOLT) return TRUE end doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não possui balas.") return false end
info
Grupo: Visconde
Registrado: 21/12/06
Posts: 355
Reputação: +118
Gênero: Masculino

Muito obrigado!



info
Grupo: Visconde
Registrado: 21/12/06
Posts: 355
Reputação: +118
Gênero: Masculino
Spells
8.6
Não consigo fazer com que os players que matam com essa runa e ganhe exp.
Eles matam, porem nao ganham exp ao matar com essa rune.
Por favor me ajudem o mais rapido possivel!
Editado Maio 26 por beddy