cara, todas as armas sugam life do oponente '-' voce pode explicar melhor?
Tipo seria uma boa ideia ela sugar life dele e transferir para voce, só que como eu não sou scripter.... nao tem como eu fazer mals.
apenas dei uma sugestao.
info
Group: Campones
Joined: 24/10/11
Posts: 65
Reputation: 0
Tibia Character: Fleps Drunou

cara, todas as armas sugam life do oponente '-' voce pode explicar melhor?
Tipo seria uma boa ideia ela sugar life dele e transferir para voce, só que como eu não sou scripter.... nao tem como eu fazer mals.
apenas dei uma sugestao.
é isso mesmo
Foi como eu coloquei como você fosse um vampiro
Pega-se 10% da vida do oponente
e quando acerta o hit no oponente que aparece o efeito 68 junto com o hit
Edited Abril 6 by Liah
info
Group: Visconde
Joined: 21/12/06
Posts: 355
Reputation: +118
Gender: Masculino

Bem, voce pode tentar colocar para essa arma usar LifeDrain no bixo.
Ghoul usa esta magia, tenta colocar ela em uma arma, parecendo wand.
Tentae é uma luz.
Ai esta um spell de lifedrain que voce pode tentar usar combinando com uma ARMA. (OBS é antigo este codigo, talvez seja nescessario modificar)
--[[ -- You can use this spell and copy and modify it. -- -- Created By SailorMoonLive -- -- But pls don't remove this comment -- ]] function onCastSpell(cid, var) local CreatureMaxHealth = getCreatureMaxHealth(getCreatureTarget(cid)) if getCreatureTarget(cid) then local CreatureHealth = getCreatureHealth(getCreatureTarget(cid)) local critLife = CreatureMaxHealth/2 local lifedraw = ( CreatureHealth / 10) if CreatureHealth >= critLife then local Target = getCreatureTarget(cid) local targetPos = getPlayerPosition(Target) doCreatureAddHealth(Target, -lifedraw, COMBAT_LIFEDRAIN) doSendAnimatedText(targetPos, lifedraw , TEXTCOLOR_GOLD) doSendMagicEffect(targetPos, 0) local pos = getPlayerPosition(cid) doCreatureAddHealth(cid, lifedraw, 1) doSendAnimatedText(playerPos, lifedraw , TEXTCOLOR_GOLD) doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE) else doCreatureSay(getCreatureTarget(cid), "No Kill Me PLS", 1) doCreatureSay(cid, "Vasa Daqui antes que eu mude de ideia", 1) end end end
Nem imagino como eu possa fazer isso ,pois a minha arma seria uma arrow.
info
Group: Lorde
Joined: 17/01/09
Posts: 2.1k
Reputation: +395
Tibia Character: Adra Sata

só colocar esse script na pasta weapons
function onCastSpell(cid, var)
trocar para
function onUseWeapon(cid, var)
Edited Abril 9 by SkyDangerous
info
Group: Conde
Joined: 30/06/11
Posts: 631
Reputation: +371
Tibia Character: Warrior of Mort

Faiz assim:
Abra a pasta "data/creaturescripts/scripts" duplique um arquivo qualquer e renomeie para "weaponsugar" sem as aspas e nele cole:
-- <Script by jhon992> --
local weaponpar = {2377, 2378, 2379, 2380} -- id dos items que sugarão life
local chancepar = 5 -- chance de sugar (10 = 10%, 20 = 20%, 30 = 30%, 1 = 1%, 5 = 5%) e assim por diante
function onAttack(cid, target)
if ((getCreaturePosition(target).x == getCreaturePosition(cid).x or getCreaturePosition(target).x == getCreaturePosition(cid).x+1 or getCreaturePosition(target).x == getCreaturePosition(cid).x-1) and (getCreaturePosition(target).y == getCreaturePosition(cid).y or getCreaturePosition(target).y == getCreaturePosition(cid).y+1 or getCreaturePosition(target).y == getCreaturePosition(cid).y-1)) then
for i=0, #weaponpar do
if (getPlayerSlotItem(cid, 5).itemid == weaponpar[i] or getPlayerSlotItem(cid, 6).itemid == weaponpar[i]) then
if (math.random(1,100) > (100 - chancepar)) then
life = (getCreatureHealth(target)*0.1)
doPlayerSendTextMessage(cid, 23, "Você sugou "..life.." de hp do "..getCreatureName(target)..".")
doSendMagicEffect(getCreaturePosition(target), 98)
doCreatureAddHealth(target, -life)
doCreatureAddHealth(cid, life)
return true
else
return true
end
end
end
end
return true
end
Agora no arquivo, "data/creaturescripts/creaturescripts.xml" cole a tag:
<event type="attack" name="WeaponSugar" event="script" value="weaponsugar.lua"/>
E por último, abra o arquivo login.lua que esta localizado em "data/creaturescripts/scripts" e cole a tag:
registerCreatureEvent(cid, "WeaponSugar")
Créditos pro cara desse tópico:
http://www.xtibia.com/forum/topic/175370-creaturescript-weapons-paralyze/
Como eu saberei que funcionou
tipo eu queria que aparece-se um Simbolo
para falar que sugou tipo assim "---"
Descupe tava escrevendo antes de você postar
Darei rep + a todos que tentaram me ajudar .
To testando Já coloco se funcionou
-| Só funciona com player ou monstro também ?
Edited Abril 9 by Liah
info
Group: Conde
Joined: 30/06/11
Posts: 631
Reputation: +371
Tibia Character: Warrior of Mort

Funciona com os 2. Quando acerta o sugar aparece uma msg no player de quanto sugou.
Então acho que não deu certo não apareceu aqui
info
Group: Conde
Joined: 30/06/11
Posts: 631
Reputation: +371
Tibia Character: Warrior of Mort

Acabei de testar, esta funcionando perfeitamente.
Só colocar os itens que tu quer que funcione e a chance.
Está funcionando mas o problema e que eu queria coloca uma arrow .
e só funciona estando do lado dele.
Ou seja ele não funciona a mais de 1 sqm.
info
Group: Conde
Joined: 30/06/11
Posts: 631
Reputation: +371
Tibia Character: Warrior of Mort

Fiz pra funcionar soh pra weapons dos slots de hand, se tu tivese explicado melhor tinha feito de arrow. Agora to sem tempo, quando tiver tempo eu faço se ninguem tiver feito antes.
Estarei esperando .
Só mais uma coisa o efeito 68 também não aparece.
info
Group: Conde
Joined: 30/06/11
Posts: 631
Reputation: +371
Tibia Character: Warrior of Mort

-- <Script by jhon992> --
local weaponpar = {2377, 2378, 2379, 2380} -- id dos items que sugarão life
local arrows = {1234, 5463} -- coloca o id das arrows
local bows = {1234, 5463} -- coloque os ids das bows
local chancepar = 5 -- chance de sugar (10 = 10%, 20 = 20%, 30 = 30%, 1 = 1%, 5 = 5%) e assim por diante
function onAttack(cid, target)
if ((getCreaturePosition(target).x == getCreaturePosition(cid).x or getCreaturePosition(target).x == getCreaturePosition(cid).x+1 or getCreaturePosition(target).x == getCreaturePosition(cid).x-1) and (getCreaturePosition(target).y == getCreaturePosition(cid).y or getCreaturePosition(target).y == getCreaturePosition(cid).y+1 or getCreaturePosition(target).y == getCreaturePosition(cid).y-1)) then
if (isInArray(weaponpar, getPlayerSlotItem(cid, 5).itemid) or isInArray(weaponpar, getPlayerSlotItem(cid, 6).itemid)) then
if (math.random(1,100) > (100 - chancepar)) then
life = (getCreatureHealth(target)*0.1)
doPlayerSendTextMessage(cid, 23, "Você sugou "..life.." de hp do "..getCreatureName(target)..".")
doSendMagicEffect(getCreaturePosition(target), 68)
doCreatureAddHealth(target, -life)
doCreatureAddHealth(cid, life)
return true
else
return true
end
end
end
if (isInArray(bows, getPlayerSlotItem(cid, 5).itemid) or isInArray(bows, getPlayerSlotItem(cid, 6).itemid)) then
if (isInArray(arrows, getPlayerSlotItem(cid, 10).itemid)) then
if (math.random(1,100) > (100 - chancepar)) then
life = (getCreatureHealth(target)*0.1)
doPlayerSendTextMessage(cid, 23, "Você sugou "..life.." de hp do "..getCreatureName(target)..".")
doSendMagicEffect(getCreaturePosition(target), 68)
doCreatureAddHealth(target, -life)
doCreatureAddHealth(cid, life)
return true
else
return true
end
end
end
return true
end
Edited Abril 11 by Jhon992
info
Group: Campones
Joined: 19/05/08
Posts: 15
Reputation: +1
Eu queria um Script que pode adicionar em uma arma que ela ,quando atingisse
o Hit ela ranca-se 10 % do sangue De player e monstros ,Como se fo-se um vampiro.