1579091 109 Postado Setembro 18, 2012 Share Postado Setembro 18, 2012 (editado) *~'Mod Vengance'~* Créditos: Nandonalt Como funciona?-Ao usar o spell, o hit que o player/monstro te der, voltará pra ele em alguns porcentos. Script:Em mods, crie um arquivo chamado Vengance.xml: <?xml version="1.0" encoding="UTF-8"?> <mod name="Vengeance" version="1.0" author="Nandonalt" contact="nando_cardoso3@hotmail.com" enabled="yes"> <config name="vengeconf"><![CDATA[ config = { storage = 4328, time = 15, percent_min = 20, percent_max = 30, manaused = 800 } ]]></config> <event type="statschange" name="VengeanceV" event="script"><![CDATA[ function onStatsChange(cid, attacker, type, combat, value) domodlib('vengeconf') if type == STATSCHANGE_HEALTHLOSS and value >= 1 then local percentage = math.random(config.percent_min, config.percent_max) local formula = math.floor((percentage * value) / 100) if getPlayerStorageValue(cid,config.storage) == 1 and isCreature(attacker) then doSendAnimatedText(getCreaturePosition(attacker),"-"..formula,COLOR_RED) doCreatureSay(cid,"Taste Vengeance!",19) doSendMagicEffect(getCreaturePosition(cid),17) doSendMagicEffect(getCreaturePosition(attacker),29) doCreatureAddHealth(attacker,-formula) end end return 1 end ]]></event> <event type="login" name="VengeanceLogin" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid,"VengeanceV") local storage = 4328 if getPlayerStorageValue(cid,storage) == 1 then doPlayerSendCancel(cid,"Vengeance effect ended.") setPlayerStorageValue(cid,storage,-1) doSendMagicEffect(getCreaturePosition(cid),17) else end return 1 end ]]></event> <instant name="Vengeance" words="vengeance" lvl="85" mana="800" exhaustion="10000" needlearn="0" event="script" ><![CDATA[ domodlib('vengeconf') local secs = config.time * 1000 local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, 17) function no_vengeance(param) domodlib('vengeconf') pid = getPlayerByNameWildcard(param.name) if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then else doPlayerSendCancel(pid,"Vengeance effect ended.") setPlayerStorageValue(pid,config.storage,-1) doSendMagicEffect(getCreaturePosition(pid),17) end return 1 end function onCastSpell(cid, var) domodlib('vengeconf') if getPlayerStorageValue(cid,config.storage) == -1 then doCreatureSay(cid,"Vengeance!",19) setPlayerStorageValue(cid,config.storage,1) addEvent(no_vengeance,secs,{cid = cid, name = getPlayerName(cid)}) doCombat(cid, combat, var) else doPlayerSendCancel(cid,"This spell is already active.") doPlayerAddMana(cid,config.manaused) end return 1 end ]]> </instant></mod> Configurando:config = { storage = 4328, -- Storage, não mecha.time = 15, -- Tempo que a buff ficará ativa.percent_min = 20, -- Mínimo de porcentagem em que o hit voltará.percent_max = 30, -- Máximo de porcentagem em que o hit voltarámanaused = 800 -- mana que vai gasta.}Agora em spells, crie um arquivo.lua e renomei-o para vengance.lua: local config = {storage = 4328,time = 15,percent_min = 20,percent_max = 30,manaused = 800}local secs = config.time * 1000local combat = createCombatObject()setCombatParam(combat, COMBAT_PARAM_EFFECT, 17)function no_vengeance(param)pid = getPlayerByNameWildcard(param.name)if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) thenelsedoPlayerSendCancel(pid,"Vengeance effect ended.")setPlayerStorageValue(pid,config.storage,-1)doSendMagicEffect(getCreaturePosition(pid),17)endreturn 1endfunction onCastSpell(cid, var)if getPlayerStorageValue(cid,config.storage) == -1 thendoCreatureSay(cid,"Vengeance!",19)setPlayerStorageValue(cid,config.storage,1)addEvent(no_vengeance,secs,{cid = cid, name = getPlayerName(cid)})doCombat(cid, combat, var)elsedoPlayerSendCancel(cid,"This spell is already active.")doPlayerAddMana(cid,config.manaused)endreturn 1end E depois em spells.xml:<instant name="Vengeance" words="vengeance" lvl="85" mana="800" exhaustion="10000" needlearn="0" event="script" value="vengeance.lua"></instant> Lembrando que se for trocar o tanto de mana à gastar, aqui, terá que trocar la em cima também. Editado Abril 10, 2015 por CyberBot Link para o comentário Compartilhar em outros sites More sharing options...
JustinnoTibianno 71 Postado Setembro 18, 2012 Share Postado Setembro 18, 2012 muito bom cara, achei bem RPG =) Link para o comentário Compartilhar em outros sites More sharing options...
1579091 109 Postado Setembro 18, 2012 Autor Share Postado Setembro 18, 2012 Obrigado... Sim deicha mais emoçionante, você tirar sangue e seu oponente fazer com que seu hit se torne veneno contra si mesmo. Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados