Jump to content
  • 0

Weapon Manadrain


Thiach

Question

4 answers to this question

Recommended Posts

  • 0

Testa ae: No meu server funciona perfeitamente
Creditos : -- Script by LuckOake com ajuda de Vodkart
vai em data/creaturescripts/script cria 1 arquivo chamado ManaDrain.lua e coloca isso

-- Script by LuckOake com ajuda de Vodkart


local weaponsID = {7765; 2413} -- IDs das armas
local mana = 80 -- Mana Obtida

function onStatsChange(cid, attacker, type, combat, value)

if not isCreature(cid) or not isCreature(attacker) or getCreatureHealth(cid) <= 0 then
return true
end

if isPlayer(attacker) and type == STATSCHANGE_HEALTHLOSS and combat == COMBAT_PHYSICALDAMAGE and
(isInArray(weaponsID, getPlayerSlotItem(attacker, CONST_SLOT_LEFT).itemid) or
isInArray(weaponsID, getPlayerSlotItem(attacker, CONST_SLOT_RIGHT).itemid)) then
doPlayerAddMana(attacker, mana)
doSendAnimatedText(getCreaturePos(attacker), "+"..mana.."", TEXTCOLOR_LIGHTBLUE)
if isPlayer(cid) then
doPlayerAddMana(cid, -mana)
doSendAnimatedText(getCreaturePos(cid), "-"..mana.."", TEXTCOLOR_PURPLE)
elseif isMonster(cid) then
doSendAnimatedText(getCreaturePos(cid), "-"..mana.."", TEXTCOLOR_PURPLE)
end
end

return true
end





depois vai em login.lua e adiciona isso:

registerCreatureEvent(cid, "ManaDrain")



depois vai em data/creaturescripts em creaturescripts.xml coloca:

<event type="statschange" name="ManaDrain" event="script" value="manadrain.lua"/>





Esse script nao é meu como eu disse é do

-- Script by LuckOake com ajuda de Vodkart

Edited by sens
Link to comment
Share on other sites

×
×
  • Create New...