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.
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.
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!
Fórum: www.forum-radstyfler.forumeiros.com
Versão: 8.6
Equipe Styfler RadBR!
é 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
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.
só colocar esse script na pasta weapons
function onCastSpell(cid, var)
trocar para
function onUseWeapon(cid, var)
Me segui lá (:
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/
Te ajudei. Então REP+
Meus Trabalhos:
O melhor pokebot!
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 ?
Funciona com os 2. Quando acerta o sugar aparece uma msg no player de quanto sugou.
Te ajudei. Então REP+
Meus Trabalhos:
O melhor pokebot!
Então acho que não deu certo não apareceu aqui
Acabei de testar, esta funcionando perfeitamente.
Só colocar os itens que tu quer que funcione e a chance.
Te ajudei. Então REP+
Meus Trabalhos:
O melhor pokebot!
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.
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.
Te ajudei. Então REP+
Meus Trabalhos:
O melhor pokebot!
Estarei esperando .
Só mais uma coisa o efeito 68 também não aparece.
-- <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
Te ajudei. Então REP+
Meus Trabalhos:
O melhor pokebot!