Ir para conteúdo
  • 0

[Ajuda] Arma Que Suga Life Do Oponente .


Pergunta

Posts Recomendados

  • 0

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.

Link para o comentário
https://xtibia.com/forum/topic/183849-ajuda-arma-que-suga-life-do-oponente/#findComment-1233256
Compartilhar em outros sites

  • 0

é 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

Editado por Liah
Link para o comentário
https://xtibia.com/forum/topic/183849-ajuda-arma-que-suga-life-do-oponente/#findComment-1233451
Compartilhar em outros sites

  • 0

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

Link para o comentário
https://xtibia.com/forum/topic/183849-ajuda-arma-que-suga-life-do-oponente/#findComment-1236813
Compartilhar em outros sites

  • 0

só colocar esse script na pasta weapons

 


function onCastSpell(cid, var)

 

trocar para

 

function onUseWeapon(cid, var)

Editado por SkyDangerous
Link para o comentário
https://xtibia.com/forum/topic/183849-ajuda-arma-que-suga-life-do-oponente/#findComment-1237023
Compartilhar em outros sites

  • 0

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/

Link para o comentário
https://xtibia.com/forum/topic/183849-ajuda-arma-que-suga-life-do-oponente/#findComment-1237124
Compartilhar em outros sites

  • 0

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 ?

Editado por Liah
Link para o comentário
https://xtibia.com/forum/topic/183849-ajuda-arma-que-suga-life-do-oponente/#findComment-1237223
Compartilhar em outros sites

  • 0

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.

Link para o comentário
https://xtibia.com/forum/topic/183849-ajuda-arma-que-suga-life-do-oponente/#findComment-1238058
Compartilhar em outros sites

  • 0
-- <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

Editado por Jhon992
Link para o comentário
https://xtibia.com/forum/topic/183849-ajuda-arma-que-suga-life-do-oponente/#findComment-1238410
Compartilhar em outros sites

×
×
  • Criar Novo...