Advertisement
poxipox

Untitled

Mar 16th, 2024 (edited)
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. function onCastSpell(cid, var)
  2.     local pVoc = getPlayerVocation(cid, true) -- TEST: or FALSE
  3.     local loseType = 1 -- 1= mana, 2 = hp
  4.     if pVoc == 1000000 then
  5.         loseType = 2
  6.     end
  7.  
  8.     local spendCount = (loseType == 1 and getCreatureMana(cid) or getCreatureHealth(cid))
  9.  
  10.    
  11.     if  spendCount > 10 then
  12.         doPlayerAddSpentMana(cid, spendCount)
  13.        
  14.         if loseType == 1 then
  15.             doCreatureAddMana(cid,-spendCount)
  16.         elseif loseType == 2 then
  17.             doCreatureAddHealth(cid,-spendCount)
  18.         end
  19.        
  20.         doSendMagicEffect(getPlayerPosition(cid) ,234)
  21.         doRemoveCondition(cid, 11)
  22.     end
  23.     return LUA_NO_ERROR
  24. end
  25.  
  26.  
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement