w00t22
CSS L4D DoD? Steam ID = w00t22
- Reaction score
- 43
[DotA Spell] Mana Void
Mana Void
Creates a powerful void in an enemy unit caused by a lack of mana. For each mana point missing, the unit takes damage.
Level 1 - .6 damage per mana point missing.
Level 2 - .85 damage per mana point missing.
Level 3 - 1.1 damage per mana point missing.
Cooldown: 120 seconds.
Level 1: 175 mana, 120 sec cooldown.
Level 2: 225 mana, 120 sec cooldown.
Level 3: 275 mana, 120 sec cooldown.
Picture of spell in action
Tells the damage when it's casted MUI, Leakless. I'm pretty sure. Tell me if any problems.
Spell
JASS:
function ManaVoidSpellID takes nothing returns integer
return 039;A000039; // Mana Void spell Id
endfunction
function StunBuffID takes nothing returns integer
return 039;B000039; // Stun Buff Spell Id
endfunction
function Stun_Buff takes unit u returns boolean
return UnitHasBuffBJ (u, StunBuffID ())
endfunction
function Trig_Mana_Void_Conditions takes nothing returns boolean
return GetSpellAbilityId() == ManaVoidSpellID ()
endfunction
function Trig_Mana_Void_Actions takes nothing returns nothing
// Units
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
// Reals
local real mana = ( GetUnitStateSwap(UNIT_STATE_MAX_MANA, target) - GetUnitStateSwap(UNIT_STATE_MANA, target) )
local real level = I2R(GetUnitAbilityLevelSwapped(ManaVoidSpellID (), caster))
local real damage = ( mana * ( 0.45 + ( 0.25 * level ) ) )
// Text Tag
local texttag time
// Checks the target to see if hes dead or if he has got stunned yet for damage to be dealt
loop
exitwhen Stun_Buff(target) or GetWidgetLife(target) < 0.405
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 0.10))
endloop
// Does damage and creates the texttag for people to see the damage
call UnitDamageTarget ( caster, target, damage, false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_AXE_MEDIUM_CHOP )
set time = CreateTextTagUnitBJ (( R2S(damage) + " damage was done" ), target, 0, 10, 0.00, 0.00, 100, 0 )
call SetTextTagPermanent( time, false )
call SetTextTagLifespan( time, 5 )
// Cleaing up
set caster = null
set target = null
set time = null
endfunction
//===========================================================================
function InitTrig_Mana_Void takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t, Condition( function Trig_Mana_Void_Conditions ) )
call TriggerAddAction( t, function Trig_Mana_Void_Actions )
endfunction
Updated with changes from others. Thank you