doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não possui balas.")
end
return false
end
galera essa varinha gostaria de mudar porq para atacar tem que selecionar o bixo pra depois dar use na varinha e usa-la no bixo gostaria que quando eu seleciona-se o bixo ela ja ataca-se como uma rod ou wand de tibia normal mais com essa script se alguem ajudar dou +rep
info
Grupo: Marquês
Registrado: 05/12/11
Posts: 1.2k
Reputação: +173
Gênero: Masculino
local runa = 2376
local text = "......Estupefata....."
local msg = "Equipe a %s na mão, para poder atirar."
local attackmin, attackmax = 5, 10 -- attack minimo, attack maximo
local ring = { -- [iddoitemnoslotdoring] = acrescimonohit
[2207] = 10,
[2166] = 20,
[2169] = 30,
[2208] = 40,
[2167] = 50,
[2209] = 60,
[2168] = 80,
}
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, runa, 0) 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_MAGIC) / 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_POISONARROW)
doCreatureSay(cid, text, 19)
return true
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não possui balas.")
end
return false
end
galera essa varinha gostaria de mudar porq para atacar tem que selecionar o bixo pra depois dar use na varinha e usa-la no bixo gostaria que quando eu seleciona-se o bixo ela ja ataca-se como uma rod ou wand de tibia normal mais com essa script se alguem ajudar dou +rep