Facebook
From Movie#4361, 2 Years ago, written in Lua.
Embed
Download Paste or View Raw
Hits: 199
  1. --[[
  2.     Dodge & Critical fixado por Movie (Movie#4361)
  3.     Disponibilizado para o TibiaKing e não autorizo outras reproduções
  4.     Mantenha os créditos <3
  5. --]]
  6.  
  7. function onManaChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
  8.    
  9.     if (not attacker or not creature) then  
  10.         return primaryDamage, primaryType, secondaryDamage, secondaryType
  11.     end
  12.    
  13.     if ((creature:getDodgeLevel() * 3) >= math.random (0, 1000) and creature:isPlayer())  then
  14.         primaryDamage = 0
  15.         secondaryDamage = 0
  16.         creature:say("DODGE!", TALKTYPE_MONSTER_SAY)
  17.         creature:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT)
  18.     end
  19.     return primaryDamage, primaryType, secondaryDamage, secondaryType
  20. end
  21. <event type="manachange" name="DodgeMana" script="dodgeMana.lua"/>