- Joined
- Oct 1, 2003
- Messages
- 461
JASS:
function Trig_Intimidating_Shout_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local location casterLoc = GetUnitLoc(caster)
local location array rundest
local unit array feared
local location array fearedLoc
local group aoe
local integer loops = 0
local integer fearinterval = 0
local effect array fearSFX
call AddSpecialEffectTargetUnitBJ("origin", caster, "Abilities\\Spells\\Human\\Avatar\\AvatarCaster.mdl")
call DestroyEffect(GetLastCreatedEffectBJ())
call AddSpecialEffectTargetUnitBJ("origin", caster, "Abilities\\Spells\\NightElf\\BattleRoar\\RoarCaster.mdl")
call DestroyEffect(GetLastCreatedEffectBJ())
call AddSpecialEffectTargetUnitBJ("origin", caster, "Abilities\\Spells\\NightElf\\Taunt\\TauntCaster.mdl")
call DestroyEffect(GetLastCreatedEffectBJ())
set aoe = GetUnitsInRangeOfLocAll(300, casterLoc)
call GroupRemoveUnit(aoe, target)
call GroupRemoveUnit(aoe, caster)
call PauseUnit(target, true)
loop
exitwhen IsUnitGroupEmptyBJ(aoe) == true
if IsUnitEnemy(FirstOfGroup(aoe), GetOwningPlayer(caster)) == true then
set loops = loops + 1
set feared[loops] = FirstOfGroup(aoe)
set fearedLoc[loops] = GetUnitLoc(feared[loops])
call GroupRemoveUnit(aoe, FirstOfGroup(aoe))
exitwhen IsUnitGroupEmptyBJ(aoe) == true
else
call GroupRemoveUnit(aoe, FirstOfGroup(aoe))
endif
exitwhen loops == 5
endloop
set loops = 1
loop
exitwhen feared[loops] == null
call AddSpecialEffectTargetUnitBJ("overheard", feared[loops], "Abilities\\Spells\\Other\\HowlOfTerror\\HowlTarget.mdl")
set fearSFX[loops] = GetLastCreatedEffectBJ()
set loops = loops + 1
endloop
loop
set loops = 1
loop
exitwhen feared[loops] == null
set rundest[loops] = PolarProjectionBJ(fearedLoc[loops], GetRandomReal(140, 310), GetRandomReal(0,359))
call IssuePointOrderLoc(feared[loops], "move", rundest[loops])
set loops = loops + 1
endloop
call RemoveLocation(fearedLoc[1])
call RemoveLocation(fearedLoc[2])
call RemoveLocation(fearedLoc[3])
call RemoveLocation(fearedLoc[4])
call RemoveLocation(fearedLoc[5])
call RemoveLocation(rundest[1])
call RemoveLocation(rundest[2])
call RemoveLocation(rundest[3])
call RemoveLocation(rundest[4])
call RemoveLocation(rundest[5])
call TriggerSleepAction(0.25)
set fearinterval = fearinterval + 1
if fearinterval == 12 then
call PauseUnit(target, false)
endif
exitwhen fearinterval == 32
endloop
set caster = null
set target = null
set fearedLoc[1] = null
set fearedLoc[2] = null
set fearedLoc[3] = null
set fearedLoc[4] = null
set fearedLoc[5] = null
set feared[1] = null
set feared[2] = null
set feared[3] = null
set feared[4] = null
set feared[5] = null
set rundest[1] = null
set rundest[2] = null
set rundest[3] = null
set rundest[4] = null
set rundest[5] = null
call DestroyEffect(fearSFX[1])
call DestroyEffect(fearSFX[2])
call DestroyEffect(fearSFX[3])
call DestroyEffect(fearSFX[4])
call DestroyEffect(fearSFX[5])
call RemoveLocation(casterLoc)
call DestroyGroup(aoe)
set aoe = null
set fearSFX[1] = null
set fearSFX[2] = null
set fearSFX[3] = null
set fearSFX[4] = null
set fearSFX[5] = null
set casterLoc = null
endfunction
Now, this spell is called Intimidating Shout. What this spell does is basically just stun the target for 3 seconds, while causing up to 5 enemies nearby to flee for 8 seconds. While in the 8 seconds, enemies can still be issued order by players, but will have difficulty in doing so.
Now I was wondering if any JASS experts here can help me if there is any memory leak in this spell.
First time doing a non-art, non-MDL thing.
EDIT: Some new spell lawl.
Attachments
Last edited: