local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN) function onGetFormulaValues(cid, level, maglevel) min = -(maglevel*1) -level/5 -30 max = -(maglevel*1) -level/5 -50 return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_BLOCKARMOR, 1) setCombatParam(combat2, COMBAT_PARAM_BLOCKSHIELD, 1) setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE) setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLICE) setCombatFormula(combat2, COMBAT_FORMULA_DAMAGE, 0, -150, 0, -250) function onUseWeapon(cid, var) local target = getCreatureTarget(cid) local min = getPlayerMagLevel(cid)+getPlayerLevel(cid)/5+30 -- should be the same as the min/max above local max = getPlayerMagLevel(cid)+getPlayerLevel(cid)/5+50 local percent = 80 -- change here the % manadrain local addmana = math.random(min * 0.5 * (percent/100), max * 0.5 * (percent/100)) if getPlayerLevel(cid) >= 200 then if isPlayer(target) and getCreatureMana(target) >= 10 then doCombat(cid, combat, var) doCombat(cid, combat2, var) doPlayerAddMana(cid, addmana) doSendAnimatedText(getPlayerPosition(cid),"+"..addmana.."", TEXTCOLOR_LIGHTBLUE) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) else doCombat(cid, combat2, var) end else doPlayerSendCancel(cid, 'This wand requires a user on level 250 or more.') end end