[Ajuda] Arma Que Suga Life Do Oponente .

Liah
Por Liah
em Scripts
  • 1
  • 2

Liah

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/05/08Posts: 15

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.

StyflerDrunou

Styfler Zikz Styfler
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 24/10/11Posts: 65Char no Tibia: 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.

Atenciosamente...

 

 

Equipe Styfler RadBR!



 

 

Contato msn: suporteradstyfler@hotmail.com

 

Servidor: maparadstyfler.servegame.com

 

Fórum: www.forum-radstyfler.forumeiros.com

Versão: 8.6



Porta: 7171

Exp: 700x

 

Ao entrar no servidor diga !comandos, !notice e !trocasrad..

 

Atenciosamente...

 

Equipe Styfler RadBR!

Liah

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/05/08Posts: 15

é 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

beddy

O fais TUDO...
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 21/12/06Posts: 355Gênero: 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

a.png

Liah

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/05/08Posts: 15

Nem imagino como eu possa fazer isso ,pois a minha arma seria uma arrow.

SkyDangerous

Deus Kalec
avatar
Lorde
Lorde

INFOS

Grupo: LordeRegistrado: 17/01/09Posts: 2098Char no Tibia: Adra Sata

só colocar esse script na pasta weapons

 

function onCastSpell(cid, var)

 

trocar para

 

function onUseWeapon(cid, var)

Me segui lá (:

 

b906.png

http://ageofwar.servegame.com/

IP: ageofwar.servegame.com

TIBIA: 10.78

GLOBAL PERFECT CUSTOM

jhon992

Dono JhonBot
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/06/11Posts: 631Char no Tibia: 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/

Liah

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/05/08Posts: 15

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 ?

jhon992

Dono JhonBot
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/06/11Posts: 631Char no Tibia: Warrior of Mort

Liah

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/05/08Posts: 15

Então acho que não deu certo não apareceu aqui

jhon992

Dono JhonBot
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/06/11Posts: 631Char no Tibia: Warrior of Mort

Liah

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/05/08Posts: 15

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.

jhon992

Dono JhonBot
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/06/11Posts: 631Char no Tibia: 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.

Liah

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/05/08Posts: 15

Estarei esperando .

 

Só mais uma coisa o efeito 68 também não aparece.

jhon992

Dono JhonBot
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/06/11Posts: 631Char no Tibia: 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

  • 1
  • 2