local runa = 2394
local msg = "Equipe a %s na mão, para poder atirar."
local attackmin, attackmax = 300, 340 -- attack minimo, attack maximo
local ring = { -- [iddoitemnoslotdoring] = acrescimonohit
[1234] = 30,
[1235] = 50
}
function onCastSpell(cid, var)
local left, right = getPlayerSlotItem(cid, CONST_SLOT_LEFT), getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
if not isInArray({left.itemid, right.itemid}, runa) then
return doPlayerSendCancel(cid, msg:format(getItemNameById(runa)))
end
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)
if ring[getPlayerSlotItem(cid, CONST_SLOT_RING).itemid] then
hit = hit + ring[getPlayerSlotItem(cid, CONST_SLOT_RING).itemid]
end
doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -hit, -hit, CONST_ME_MORTAREA)
doSendDistanceShoot(getCreaturePos(cid), getCreaturePos(target), CONST_ANI_BOLT)
return true
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não possui balas.")
end
return false
end
@Edited:
- Arrumado.




info
Group: Visconde
Joined: 21/12/06
Posts: 355
Reputation: +118
Gender: Masculino
TFS 8.6
local runa = 2394 local msg = "Equipe a %s na mão, para poder atirar." local attackmin, attackmax = 300, 340 -- attack minimo, attack maximo function onCastSpell(cid, var) local left, right = getPlayerSlotItem(cid, CONST_SLOT_LEFT), getPlayerSlotItem(cid, CONST_SLOT_RIGHT) if isInArray({left.itemid, right.itemid}, runa) then else return doPlayerSendCancel(cid, msg:format(getItemNameById(runa))) end 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 endQuero mudar a formula do hit para seguinte:
se tiver um item XXXX equipado no ANEL, adicionar mais 30 de hit
se tiver outro item XXXX equipado no ANEL. adicionar mais 50 de hit
alguem ajuda?
UP!
Edited Junho 18 by beddy