- Reaction score
- 534
I've been working on this spell for a while and I decided it would make out something great.
So, here it is!
What is it? Here's its description:
"Creates an expanding circle of holy energy, damaging every enemy unit caught."
Simply put, here's a screeny:
The spell
- It is MUI
- It is in vJASS
- Leakless
- Very low lag
Steps for implementation are listed, although there are several of them
Here's the code!
--------------------------------------
I made this at first for myself but then I realized the whole community could use it, because I feel it is good.
Tell me what you think!
*Credits to JetFangInferno for the Holy Strike model and KaTTaNa for the Local Handle Vars system!*
EDIT: First update.
EDIT: 2nd update.
EDIT: 3rd update.
EDIT: 4th update.
EDIT: 5th update.
EDIT: (After a while) Update! Credits to kenny! for the whole changes.
So, here it is!
What is it? Here's its description:
"Creates an expanding circle of holy energy, damaging every enemy unit caught."
Simply put, here's a screeny:
The spell
- It is MUI
- It is in vJASS
- Leakless
- Very low lag
Steps for implementation are listed, although there are several of them
Here's the code!
JASS:
//¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
//¤
//¤ *****************
//¤ - Sacred Circle -
//¤ *****************
//¤
//¤ By: Daxtreme
//¤
//¤ --> How to implement in your map:
//¤
//¤ 1. Copy the game cache variable named "GameCache" in your map.
//¤ 2. Copy the spell "Sacred Circle" in your map.
//¤ 3. Copy everything found in the "Custom script code" section. To do this, click
//¤ on the name of the map in the top-left corner in the trigger editor.
//¤ 4. Make a variable called "GameCache".
//¤ 5. Copy this trigger into your map.
//¤ 6. Import the HolyStrike.mdx model in your map.
//¤
//¤ --> How to customize it:
//¤
//¤ You can configure the spell using the constant functions just below. Change their values.
//¤
//¤ CREDITS:
//¤
//¤ - JetFangInferno's Holy Strike.
//¤ - kenny! for testing, bug-finding, and updating!
//¤
//¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
scope SacredCircle2
globals
private constant integer ABIL_ID = 039;A000039; // Sacred Circle's ability Id
private constant integer ORDER_ID = 852183
private constant real INTERVAL = 0.04 // Period
private constant string EFFECT = "war3mapImported\\HolyStrike.mdx" // Spell model art
private constant attacktype A_TYPE = ATTACK_TYPE_CHAOS
private constant damagetype D_TYPE = DAMAGE_TYPE_UNIVERSAL
private constant weapontype W_TYPE = WEAPON_TYPE_WHOKNOWS
private constant boolean STOP_FIRST = false
endglobals
private function Damage_dealt takes integer lvl returns real
return 100.00 * lvl
endfunction
private function Damage_radius takes integer lvl returns real
return 175.00 + (0.00 * lvl)
endfunction
private function Filter_enemies takes unit filter, unit caster returns boolean
return GetWidgetLife(filter) > 0.406 and IsUnitEnemy(filter,GetOwningPlayer(caster)) == true and IsUnitType(filter,UNIT_TYPE_MAGIC_IMMUNE) == false
endfunction
private struct Data
unit cast = null
real time = 0.00
real dist = 0.00
real ang = 0.00
integer lvl = 0
boolean stop = false
static Data array D
static integer D_total = 0
static timer Timer = null
static group Group = null
static boolexpr Filt = null
static method filt takes nothing returns boolean
return true
endmethod
method onDestroy takes nothing returns nothing
set .cast = null
endmethod
method search takes nothing returns nothing
local integer i = 1
loop
exitwhen i > Data.D_total
if Data.D<i>.cast == .cast then
if STOP_FIRST then
set Data.D<i>.stop = true
else
set .stop = true
endif
endif
set i = i + 1
endloop
endmethod
method periodic takes nothing returns boolean
local real x = GetUnitX(.cast)
local real y = GetUnitY(.cast)
local unit u = null
if GetUnitCurrentOrder(.cast) != ORDER_ID or .time <= 0 then
return true
else
set x = x + (50.00 + .dist * 10.00) * Cos(.ang * bj_DEGTORAD)
set y = y + (50.00 + .dist * 10.00) * Sin(.ang * bj_DEGTORAD)
call DestroyEffect(AddSpecialEffect(EFFECT,x,y))
call GroupEnumUnitsInRange(Data.Group,x,y,Damage_radius(.lvl),Data.Filt)
loop
set u = FirstOfGroup(Data.Group)
exitwhen u == null
call GroupRemoveUnit(Data.Group,u)
if Filter_enemies(u,.cast) then
call UnitDamageTarget(.cast,u,Damage_dealt(.lvl),false,false,A_TYPE,D_TYPE,W_TYPE)
endif
endloop
set .ang = (.ang + 24.00 - .dist / 6.00)
set .dist = (.dist + 1.00)
set .time = (.time - INTERVAL)
endif
set u = null
return false
endmethod
static method update takes nothing returns nothing
local integer i = 1
loop
exitwhen i > Data.D_total
if Data.D<i>.stop or Data.D<i>.periodic() then
call Data.D<i>.destroy()
set Data.D<i> = Data.D[Data.D_total]
set Data.D_total = Data.D_total - 1
set i = i - 1
endif
set i = i + 1
endloop
if Data.D_total <= 0 then
call PauseTimer(Data.Timer)
set Data.D_total = 0
endif
endmethod
static method actions takes nothing returns boolean
local Data d = Data.create()
set d.cast = GetTriggerUnit()
set d.lvl = GetUnitAbilityLevel(d.cast,ABIL_ID)
set d.time = 100.00 * INTERVAL
call d.search()
set Data.D_total = Data.D_total + 1
set Data.D[Data.D_total] = d
if Data.D_total == 1 then
call TimerStart(Data.Timer,INTERVAL,true,function Data.update)
endif
return false
endmethod
static method conditions takes nothing returns boolean
return GetSpellAbilityId() == ABIL_ID
endmethod
static method onInit takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer i = 0
set Data.Timer = CreateTimer()
set Data.Group = CreateGroup()
set Data.Filt = Filter(function Data.filt)
loop
call TriggerRegisterPlayerUnitEvent(trig,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,Data.Filt)
set i = i + 1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition(trig,Condition(function Data.conditions))
call TriggerAddAction(trig,function Data.actions)
endmethod
endstruct
endscope
</i></i></i></i></i></i>
--------------------------------------
I made this at first for myself but then I realized the whole community could use it, because I feel it is good.
Tell me what you think!
*Credits to JetFangInferno for the Holy Strike model and KaTTaNa for the Local Handle Vars system!*
EDIT: First update.
EDIT: 2nd update.
EDIT: 3rd update.
EDIT: 4th update.
EDIT: 5th update.
EDIT: (After a while) Update! Credits to kenny! for the whole changes.