S
sinners_la_b
Guest
This is my magic / mana spell back. Very fun to use in my opinion, hopefully you enjoy
Magic Overload
Jass : Yes
Lag : No
Leaks : No
The caster becomes overloaded with magical energies which then erupt in lines at random distance and random angles.
CODE !
SCREENSHOT !
Corupt Power
Jass : Yes
Lag : No
Leak : No
The caster corupts the power of all enemy units around him dealing damage and returning some of that corupted power back to him in pure form
CODE !
SCREENSHOT !
Mana Flood
Jass : Yes
Lag : No
Leak : No
Floods a unit with mana creating a barrier that absorbs damage. When the barrier reaches its brink it burst releasing the stored damage as mana and restoring some mana to all units around the target. Also when the unit has the shield on it will not take damage however your mana will be minused.
CODE !
SCREENSHOT !
Hope you like them
Sinners
Magic Overload
Jass : Yes
Lag : No
Leaks : No
The caster becomes overloaded with magical energies which then erupt in lines at random distance and random angles.
CODE !
JASS:
<div style="margin-left: 20px">
scope MagicOverload
//*********************************************************************************************
// Magic Overload *
// ------------------ *
// BY *
// *
// *
// sinners_la_b *
// *
// contact at : <a href="mailto:[email protected]">[email protected]</a> *
// *
// Read the README for Implementaion details *
// *
//*********************************************************************************************
globals
//<-------->START RAW CODES<-------->
private constant integer MagicOverload_Raw = 039;A000039; // Raw code of Magic Overload
private constant integer MagicOverload_DummyRaw = 039;u001039; // Raw cope of a dummy units, in the spell they are the effects
//<-------->END RAW CODES<-------->
//<-------->START REAL VALUES<-------->
private constant real MagicOverload_MinimumDistance = 100.00 // Minimum distance from caster the lines will be made
private constant real MagicOverload_MaximumDistance = 500.00 // Base Maximum (Base + Further * level)
private constant real MagicOverload_MaximumDistanceFurther = 100.00 // Further Maximum
private constant real MagicOverload_Damage = 120 // Base Damage ( Base + Further * level)
private constant real MagicOverload_DamageFurther = 50 // Further Damagr
//<-------->END REAL VALUES<-------->
endglobals
struct MO
unit caster
integer count
integer level
group k
endstruct
function MagicOverload_IdCheck takes nothing returns boolean
return GetSpellAbilityId() == MagicOverload_Raw
endfunction
function MagicOverload_Cond takes nothing returns boolean
local timer t = GetExpiredTimer()
local MO d
set d = GetTimerStructA(t)
return (not IsUnitInGroup(GetFilterUnit(), d.k)) and IsPlayerEnemy(GetOwningPlayer(d.caster), GetOwningPlayer(GetFilterUnit())) and GetWidgetLife(GetFilterUnit()) > 0.405 and IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING)==false
endfunction
function MagicOverload_Create takes nothing returns nothing
local timer t = GetExpiredTimer()
local real newx
local real newy
local real newx2
local real newy2
local real distance
local real angle
local real newangle
local unit dummy
local unit array dummy2
local boolexpr b = Condition(function MagicOverload_Cond)
local integer ui = 1
local group g = CreateGroup()
local unit next
local MO d
set d = GetTimerStructA(t)
if GetUnitCurrentOrder(d.caster) == OrderId("channel") then
set dummy = CreateUnit(GetOwningPlayer(d.caster), MagicOverload_DummyRaw, GetUnitX(d.caster), GetUnitY(d.caster), 0.00)
call UnitApplyTimedLife(dummy, 039;BTLF039;, 2.00)
set distance = GetRandomReal(MagicOverload_MinimumDistance, MagicOverload_MaximumDistance + MagicOverload_MaximumDistanceFurther * d.level)
set angle = GetRandomReal(1, 359)
set newx = GetUnitX(d.caster) + distance * Cos(angle * bj_RADTODEG)
set newy = GetUnitY(d.caster) + distance * Sin(angle * bj_RADTODEG)
call SetUnitPosition(dummy, newx, newy)
set newangle = AngleInReal(GetUnitX(d.caster), GetUnitY(d.caster), GetUnitX(dummy), GetUnitY(dummy))
set d.count = 100
loop
exitwhen d.count >= distance
set dummy2[ui] = CreateUnit(GetOwningPlayer(d.caster), MagicOverload_DummyRaw, GetUnitX(d.caster), GetUnitY(d.caster), 0.00)
call UnitApplyTimedLife(dummy2[ui], 039;BTLF039;, 0.50)
set newx2 = GetUnitX(d.caster) + d.count * Cos(newangle * bj_DEGTORAD)
set newy2 = GetUnitY(d.caster) + d.count * Sin(newangle * bj_DEGTORAD)
call SetUnitPosition(dummy2[ui], newx2, newy2)
call GroupEnumUnitsInRange(g, GetUnitX(dummy2[ui]), GetUnitY(dummy2[ui]), 100, b)
call GroupClear(d.k)
loop
set next = FirstOfGroup(g)
exitwhen next == null
call GroupAddUnit(d.k, next)
call UnitDamageTarget(d.caster, next, MagicOverload_Damage + MagicOverload_DamageFurther * d.level , true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
call GroupRemoveUnit(g, next)
endloop
set d.count = d.count + 100
set ui = ui + 1
endloop
else
call PauseTimer(t)
call ClearTimerStructA(t)
call DestroyTimer(t)
call d.destroy()
call DestroyGroup(g)
call DestroyBoolExpr(b)
set t = null
set dummy = null
set d.caster = null
set next = null
loop
exitwhen ui == 0
set dummy2[ui] = null
set ui = ui - 1
endloop
endif
endfunction
function MagicOverload_Core takes nothing returns nothing
local timer t = CreateTimer()
local MO d = MO.create()
set d.count = 100
set d.caster = GetTriggerUnit()
set d.level = GetUnitAbilityLevel(d.caster, MagicOverload_Raw)
set d.k = CreateGroup()
call SetTimerStructA(t, d)
call TimerStart(t, 0.25, true, function MagicOverload_Create)
endfunction
endscope
//===========================================================================
function InitTrig_Magic_Overload takes nothing returns nothing
local trigger gg_trg_Magic_Overload = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Magic_Overload, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Magic_Overload, Condition( function MagicOverload_IdCheck ) )
call TriggerAddAction( gg_trg_Magic_Overload, function MagicOverload_Core )
endfunction
8203;</div>
SCREENSHOT !
Corupt Power
Jass : Yes
Lag : No
Leak : No
The caster corupts the power of all enemy units around him dealing damage and returning some of that corupted power back to him in pure form
CODE !
JASS:
<div style="margin-left: 20px">
scope CoruptPower
//*********************************************************************************************
// Corupt Power *
// --------------- *
// BY *
// *
// *
// sinners_la_b *
// *
// contact at : <a href="mailto:[email protected]">[email protected]</a> *
// *
// Read the README for Implementaion details *
// *
//*********************************************************************************************
globals
//<-------->START RAW CODES<-------->
private constant integer CP_Raw = 039;A001039; // Raw code of Corupt Power
private constant integer CP_DummyRaw = 039;u002039; // Raw code of a dummy unit
private constant integer CP_LightningRaw = 039;A002039; // Raw code of chain lightning that does the damage
//<-------->END RAW CODES<-------->
//======================================================================
//<-------->START REAL VALUES<-------->
private constant real CP_Range = 400.00
private constant real CP_Delay = 1
//<-------->END REAL VALUES<-------->
endglobals
struct CP
unit caster
real x
real y
real count
integer level
endstruct
function CoruptPower_IdCheck takes nothing returns boolean
return GetSpellAbilityId() == CP_Raw
endfunction
function CoruptPower_Cond takes nothing returns boolean
local CP d
set d = GetTimerStructA(GetExpiredTimer())
return IsPlayerEnemy(GetOwningPlayer(d.caster), GetOwningPlayer(GetFilterUnit())) and GetWidgetLife(GetFilterUnit()) > 0.405 and IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING)==false
endfunction
function CoruptPower_Cast takes nothing returns nothing
local CP d
local timer t = GetExpiredTimer()
local unit dummy
set d = GetTimerStructA(t)
set dummy = CreateUnit(GetOwningPlayer(d.caster), CP_DummyRaw , d.x, d.y, 0.00)
call UnitAddAbility(dummy, CP_LightningRaw)
call SetUnitAbilityLevel(dummy, CP_LightningRaw, d.level)
call IssueTargetOrder(dummy, "chainlightning", GetEnumUnit())
call UnitApplyTimedLife(dummy, 039;BTLF039;, 0.25)
set t = null
set dummy = null
endfunction
function CoruptPower_Create takes nothing returns nothing
local timer t = GetExpiredTimer()
local group g = CreateGroup()
local CP d
local integer groupunits
set d = GetTimerStructA(t)
if GetUnitCurrentOrder(d.caster) == OrderId("charm") then
call GroupEnumUnitsInRange(g, d.x, d.y, CP_Range, Condition(function CoruptPower_Cond))
set groupunits = CountUnitsInGroup(g)
call ForGroup(g, function CoruptPower_Cast)
call SetUnitState(d.caster, UNIT_STATE_LIFE, GetUnitState(d.caster, UNIT_STATE_LIFE) + d.level * groupunits * 5 )
else
call PauseTimer(t)
call ClearTimerStructA(t)
call DestroyGroup(g)
call DestroyTimer(t)
call d.destroy()
set t = null
endif
endfunction
function CoruptPower_Core takes nothing returns nothing
local timer t = CreateTimer()
local location l = GetSpellTargetLoc()
local CP d = CP.create()
set d.caster = GetTriggerUnit()
set d.level = GetUnitAbilityLevel(d.caster, 039;A001039;)
set d.x = GetUnitX(d.caster)
set d.y = GetUnitY(d.caster)
call SetTimerStructA(t, d)
call TimerStart(t, CP_Delay , true, function CoruptPower_Create)
set t = null
call RemoveLocation(l)
set l = null
endfunction
endscope
//===========================================================================
function InitTrig_Corupt_Power takes nothing returns nothing
set gg_trg_Corupt_Power = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Corupt_Power, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Corupt_Power, Condition( function CoruptPower_IdCheck ) )
call TriggerAddAction( gg_trg_Corupt_Power, function CoruptPower_Core )
endfunction
8203;</div>
SCREENSHOT !
Mana Flood
Jass : Yes
Lag : No
Leak : No
Floods a unit with mana creating a barrier that absorbs damage. When the barrier reaches its brink it burst releasing the stored damage as mana and restoring some mana to all units around the target. Also when the unit has the shield on it will not take damage however your mana will be minused.
CODE !
JASS:
<div style="margin-left: 20px">
scope ManaFlood
//*********************************************************************************************
// Mana Flood *
// --------------- *
// BY *
// *
// *
// sinners_la_b *
// *
// contact at : <a href="mailto:[email protected]">[email protected]</a> *
// *
// Read the README for Implementaion details *
// *
//*********************************************************************************************
globals
//<-------->START RAW CODES<-------->
private constant integer ManaFlood_Raw = 039;A005039; // Raw code of Mana Flood
private constant integer ManaFlood_DummyRaw = 039;u002039; // Raw code of dummy
private constant integer ManaFlood_LightningRaw = 039;A004039; // Raw code of Lightning
//<-------->END RAW CODES<-------->
//<-------->START REAL VALUES<-------->
private constant real ManaFlood_DamageRecieved = 100.00 // Base of the damage ( base + further * level)
private constant real ManaFlood_DamageRecievedFurther = 50.00 // Further of the damage
private constant real ManaFlood_Mana = 50
private constant real ManaFlood_ManaFurther = 25
real ManaFlood_DamageCounter = 0
//<-------->END REAL VALUES<-------->
endglobals
struct MF
unit caster
unit target
integer level
real DamageRequired
effect e
triggeraction ta
effect e2
endstruct
function ManaFlood_IdCheck takes nothing returns boolean
return GetSpellAbilityId() == ManaFlood_Raw
endfunction
function ManaFlood_Cond takes nothing returns boolean
local MF data = GetTriggerStructA(GetTriggeringTrigger())
return IsUnitAlly(GetFilterUnit(), GetOwningPlayer(data.caster)) and not ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) ) and GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) >0.405 and not ( IsUnitType(GetFilterUnit(), UNIT_TYPE_DEAD))
endfunction
function ManaFlood_Detect takes nothing returns nothing
local trigger tr = GetTriggeringTrigger()
local MF data = GetTriggerStructA(tr)
local group g = CreateGroup()
local unit next
local unit dummy
if ManaFlood_DamageCounter < data.DamageRequired then
set data.e = AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl", data.target, "origin")
set data.e2 = AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl", data.target, "overhead")
call SetUnitState(data.target, UNIT_STATE_LIFE, GetUnitState(data.target, UNIT_STATE_LIFE) + GetEventDamage())
call SetUnitState(data.target, UNIT_STATE_MANA, GetUnitState(data.target, UNIT_STATE_MANA) - GetEventDamage() / data.level)
set ManaFlood_DamageCounter = ManaFlood_DamageCounter + GetEventDamage()
if GetUnitState(data.target, UNIT_STATE_MANA) <= 0.405 then
call TriggerRemoveAction(tr, data.ta)
call DestroyEffect(data.e)
call DestroyEffect(data.e2)
call DestroyTrigger(tr)
call data.destroy()
call DestroyGroup(g)
set next = null
set dummy = null
endif
else
call GroupEnumUnitsInRange(g, GetUnitX(data.target), GetUnitY(data.target), 400.00, Condition( function ManaFlood_Cond))
loop
set next = FirstOfGroup(g)
exitwhen next == null
set dummy = CreateUnit(GetOwningPlayer(data.caster), ManaFlood_DummyRaw, GetUnitX(data.target), GetUnitY(data.target), 0.00)
call UnitAddAbility(dummy, ManaFlood_LightningRaw)
call UnitApplyTimedLife(dummy, 039;BTLF039;, 0.25)
call IssueTargetOrder(dummy, "chainlightning", next)
call SetUnitState(next, UNIT_STATE_MANA, GetUnitState(next, UNIT_STATE_MANA) + ManaFlood_Mana + ManaFlood_ManaFurther * data.level)
call GroupRemoveUnit(g, next)
endloop
call TriggerRemoveAction(tr, data.ta)
call DestroyEffect(data.e)
call DestroyEffect(data.e2)
call DestroyTrigger(tr)
call data.destroy()
call DestroyGroup(g)
set next = null
set dummy = null
endif
endfunction
function ManaFlood_Core takes nothing returns nothing
local MF data = MF.create()
local trigger tr = CreateTrigger()
set ManaFlood_DamageCounter = 0
set data.caster = GetTriggerUnit()
set data.target = GetSpellTargetUnit()
set data.level = GetUnitAbilityLevel(data.caster, ManaFlood_Raw)
set data.DamageRequired = ManaFlood_DamageRecieved + ManaFlood_DamageRecievedFurther * data.level
set data.e = AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl", data.target, "origin")
set data.e2 = AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl", data.target, "overhead")
call SetTriggerStructA(tr, data)
call TriggerRegisterUnitEvent(tr, data.target, EVENT_UNIT_DAMAGED)
set data.ta = TriggerAddAction(tr, function ManaFlood_Detect)
call PolledWait(25)
call TriggerRemoveAction(tr, data.ta)
call DestroyEffect(data.e)
call DestroyEffect(data.e2)
call ClearTriggerStructA(tr)
call DestroyTrigger(tr)
call data.destroy()
endfunction
endscope
//===========================================================================
function InitTrig_Mana_Flood takes nothing returns nothing
set gg_trg_Mana_Flood = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Mana_Flood, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Mana_Flood, Condition( function ManaFlood_IdCheck ) )
call TriggerAddAction( gg_trg_Mana_Flood, function ManaFlood_Core )
endfunction
8203;</div>
SCREENSHOT !
Hope you like them
Sinners