Advertisement
Skymagnum

Untitled

May 18th, 2013
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.13 KB | None | 0 0
  1. function onStatsChange(cid, attacker, type, combat, value)
  2.  
  3. local _TYPES = {
  4.     ["fire"] = {efect = 36, dmg = COMBAT_FIREDAMAGE},
  5.     ["ice"] = {efect = 42, dmg = COMBAT_ICEDAMAGE},
  6.     ["earth"] = {efect = 45, dmg = COMBAT_POISONDAMAGE},
  7.     ["death"] = {efect = 17, dmg = COMBAT_DEATHDAMAGE},
  8.     ["energy"] = {efect = 11, dmg = COMBAT_ENERGYDAMAGE},
  9.     ["holy"] = {efect = 49, dmg = COMBAT_HOLYDAMAGE}
  10. }
  11. local slotRight = getPlayerSlotItem(attacker, 5)
  12. local slotLeft = getPlayerSlotItem(attacker, 6)
  13.  
  14.     local _HAND = getHand(attacker) == "right" and slotRight or slotLeft
  15.     local _TYPE = _TYPES[getWandDmgType(_HAND.itemid)]
  16.     local _EXTRA = getWandExtraDmg(_HAND)
  17.     local _MIN, _MAX = getWandDmg(_HAND.itemid) + _EXTRA, getWandDmg(_HAND.itemid) + _EXTRA
  18.  
  19.     if _MIN > _MAX then
  20.        _MIN = _MAX
  21.     end
  22.  
  23.     if _EXTRA > 0 then
  24.         if getCreatureCondition(cid, CONDITION_MANASHIELD) then
  25.             doTargetCombatMana(attacker, cid, _MIN, _MAX, _TYPE.efect)
  26.         else
  27.             doTargetCombatHealth(attacker, cid, _TYPE.dmg, - _MIN, - _MAX, _TYPE.efect)
  28.         end
  29.     end
  30.  
  31.     return true
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement