WolfieeifloW
WEHZ Helper
- Reaction score
- 372
Temporal Vortex
Created By: Wolfie[NoCT]
Version: 2.0
If something needs to be added for these to be approved, please tell me mods.
Credits:
Spell editing, idea, and triggers were created by Wolfie[NoCT].
If you take the time to download / look at these, please at least leave a comment.
Don't forget to rate also (using the stars
) !
Screenshots serve no justice, try the spell out ingame.
Created By: Wolfie[NoCT]
Version: 2.0
If something needs to be added for these to be approved, please tell me mods.
Credits:
Spell editing, idea, and triggers were created by Wolfie[NoCT].
If you take the time to download / look at these, please at least leave a comment.
Don't forget to rate also (using the stars
Screenshots serve no justice, try the spell out ingame.
Features:
- An Offense and Defense mode
- Leakless
- Lagless
- MUI
Spell Description
Learn Temporal Vortex said:Defense: Attackers have a chance to teleport away from this Hero. Teleported units cannot be affected by the vortex again for a certain time.
Level 1 - 6% chance, 300 units away, 4 second debuff.
Level 2 - 12% chance, 450 units away, 3 second debuff.
Level 3 - 18% chance, 600 units away, 2 second debuff.
Offense: Every 2.5 seconds, units are randomly chosen in an AoE around the Hero. These chosen units are pulled into the Hero.
Level 1 - 11% chance, pulls up to 1 unit, 500AoE.
Level 2 - 18% chance, pulls up to 2 units, 600AoE.
Level 3 - 25% chance, pulls up to 3 units, 700AoE.
Spell Code
JASS:
// +------------------------------------------------------------+
// | |
// | -=-=- Temporal Vortex [v2.0] -=-=- |
// | -=-=- By Wolfie[NoCT] -=-=- |
// | Requires Jass NewGen |
// | |
// +------------------------------------------------------------+
// | |
// | Temporal Vortex (Defense): |
// | Attackers have a chance to teleport away from this |
// | Hero. Teleported units cannot be affected by the |
// | vortex again for a certain time. |
// | |
// | Temporal Vortex (Offense): |
// | Every 2.5 seconds, units are randomly chosen in an |
// | AoE around the Hero. These chosen units are pulled |
// | into the Hero. |
// | |
// +------------------------------------------------------------+
// | |
// | -=-=- How To Implement -=-=- |
// | 1. Copy this trigger into your map |
// | 2. Copy the buffs into your map |
// | 3. Copy the abilities into your map |
// | 4. Copy the dummies into your map |
// | 5. Make sure the 'Rawcodes' in the trigger match |
// | your buffs/abilities/units in Object Editor |
// | 6. Customize the spell |
// | 7. Enjoy! |
// | |
// +------------------------------------------------------------+
// | |
// | -=-=- Credits -=-=- |
// | Credits are not needed, but appreciated |
// | Just don't claim this as yours |
// | |
// +------------------------------------------------------------+
// | -=-=- Version History -=-=- |
// | |
// | Version 2.0 |
// | - Major code revamp |
// | - You now click the spell to change between |
// | the Defense/Offense modes |
// | - Added map boundaries so units don't teleport |
// | outside the map (Thanks DrEvil) |
// | |
// | Older versions... |
// | Read changelog in thread |
// | |
// +------------------------------------------------------------+
scope TemporalVortex initializer Init
globals
// +-------------------------------+
// | MODIFY HERE |
// | MODIFY HERE |
// | MODIFY HERE |
// +-------------------------------+
// +--------------------------------+
// | Constant Configurables |
// +--------------------------------+
private constant integer SPELLO = 039;A000039;
//Rawcode of the "Temporal Vortex (Offense)" ability
private constant integer SPELLD = 039;A001039;
//Rawcode of the "Temporal Vortex (Defense)" ability
private constant integer SPELLDEBUFF = 039;A002039;
//Rawcode of the "Temporal Vortex Debuff" ability
private constant integer DEFID = 039;A003039;
//Rawcode of the "Temporal Vortex DBuff" ability
private constant integer OFFID = 039;A004039;
//Rawcode of the "Temporal Vortex OBuff" ability
private constant integer DEBUFFID = 039;B000039;
//Rawcode of the "Temporal Vortex" buff
private constant integer DEFBUFF = 039;B001039;
//Rawcode of the "Temporal Vortex (Defense)" buff
private constant integer OFFBUFF = 039;B002039;
//Rawcode of the "Temporal Vortex (Offense)" buff
private constant integer DUMID = 039;n000039;
//Rawcode of the "Dummy" unit
private constant string ORDERONO = "replenishlifeon"
//'Order String - Activate' of the Temporal Vortex (Offense) ability
private constant string ORDEROND = "replenishmanaon"
//'Order String - Activate' of the Temporal Vortex (Defense) ability
private constant string ORDEROFFO = "replenishlifeoff"
//'Order String - Deactivate' of the Temporal Vortex (Offense) ability
private constant string ORDEROFFD = "replenishmanaoff"
//'Order String - Deactivate' of the Temporal Vortex (Defense) ability
private constant string BUFFORDER = "innerfire"
//'Order String - Use/Turn On' of the Temporal Vortex (D/O)Buff abilities
private constant string DEBUFFORDER = "slow"
//'Order String - Use/Turn On' of the Temporal Vortex Debuff ability
private constant real INTERVAL = 2.5
//Time between each pull for Temporal Vortex Offense
private constant string SFXOFF = "Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl"
//Path of the SFX used when you change to Temporal Vortex (Offense)
private constant string SFXDEF = "Abilities\\Spells\\Undead\\ReplenishMana\\SpiritTouchTarget.mdl"
//Path of the SFX used when you change to Temporal Vortex (Defense)
private constant string SFXATTACH = "overhead"
//Attachment point for the above SFX
private constant string SFXSTART = "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl"
//Path of the SFX used when the target starts to teleport
private constant string SFXEND = "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl"
//Path of the SFX used then target lands at teleported location
//Advanced setting:
private constant real ANGLE = 90.
//The angle at which units teleport away
endglobals
// +--------------------------------+
// | Function Configurables |
// +--------------------------------+
private function DEFCHANCE takes integer level returns real
return level * 6.
//The chance for Temporal Vortex (Defense) to go off
endfunction
private function DEFDIST takes integer level returns real
return (level * 150) + 150.
//The distance units teleport away
endfunction
private function OFFCHANCE takes integer level returns real
return (level * 7) + 4.
//The chance for Temporal Vortex (Offense) to go off
endfunction
private function OFFDIST takes integer level returns real
return (level + 100) + 400.
//The distance units can get pulled from
endfunction
private function OFFNUM takes integer level returns integer
return level * 1
//The number of units to pull
endfunction
// +----------------------------------------+
// | NO TOUCHIE PAST HERE |
// | NO TOUCHIE PAST HERE |
// | NO TOUCHIE PAST HERE |
// +----------------------------------------+
globals
private group OFF = CreateGroup()
private group DEF = CreateGroup()
private group OFFB = CreateGroup()
private group PULL = CreateGroup()
private group PULLB = CreateGroup()
private integer OLDLVL = 0
private unit DUMMY
private player DEFP
private real MAP_MIN_X
private real MAP_MAX_X
private real MAP_MIN_Y
private real MAP_MAX_Y
endglobals
private function InMapX takes real x returns boolean
return x > MAP_MIN_X and x < MAP_MAX_X
endfunction
private function InMapY takes real y returns boolean
return y > MAP_MIN_Y and y < MAP_MAX_Y
endfunction
private function SetInX takes real x returns real
if (x > MAP_MAX_X) then
set x = MAP_MAX_X
elseif (x < MAP_MIN_X) then
set x = MAP_MIN_X
endif
return x
endfunction
private function SetInY takes real y returns real
if (y > MAP_MAX_Y) then
set y = MAP_MAX_Y
elseif (y < MAP_MIN_Y) then
set y = MAP_MIN_Y
endif
return y
endfunction
private function ActionsMethod takes unit whichUnit, integer dumAbil, group whatGroup returns nothing
set DUMMY = CreateUnit(GetOwningPlayer(whichUnit), DUMID, GetUnitX(whichUnit), GetUnitY(whichUnit), bj_UNIT_FACING)
call UnitAddAbility(DUMMY, dumAbil)
call IssueTargetOrder(DUMMY, BUFFORDER, whichUnit)
call UnitApplyTimedLife(DUMMY, 039;BTLF039;, 1.)
call GroupAddUnit(whatGroup, whichUnit)
endfunction
private function ChangeMethod takes unit whichUnit, integer oldSpell, integer newSpell, group oldGroup, group newGroup, integer dumAbil, string whichOrder, string whichSFX returns nothing
set OLDLVL = GetUnitAbilityLevel(whichUnit, oldSpell)
call UnitRemoveAbility(whichUnit, oldSpell)
call UnitAddAbility(whichUnit, newSpell)
call SetUnitAbilityLevel(whichUnit, newSpell, OLDLVL)
if (IsUnitInGroup(whichUnit, oldGroup)) then
call ActionsMethod(whichUnit, dumAbil, null)
call GroupAddUnit(newGroup, whichUnit)
call IssueImmediateOrder(whichUnit, whichOrder)
endif
call GroupRemoveUnit(oldGroup, whichUnit)
call DestroyEffect(AddSpecialEffectTarget(whichSFX, whichUnit, SFXATTACH))
endfunction
//====================================================================================================
private function Actions takes nothing returns boolean
if (GetIssuedOrderId() == OrderId(ORDERONO)) then
call ActionsMethod(GetTriggerUnit(), OFFID, OFF)
elseif (GetIssuedOrderId() == OrderId(ORDEROND)) then
call ActionsMethod(GetTriggerUnit(), DEFID, DEF)
elseif (GetIssuedOrderId() == OrderId(ORDEROFFO)) then
call UnitRemoveAbility(GetTriggerUnit(), OFFBUFF)
call GroupRemoveUnit(OFF, GetTriggerUnit())
elseif (GetIssuedOrderId() == OrderId(ORDEROFFD)) then
call UnitRemoveAbility(GetTriggerUnit(), DEFBUFF)
call GroupRemoveUnit(DEF, GetTriggerUnit())
endif
return false
endfunction
private function Change takes nothing returns boolean
if (GetSpellAbilityId() == SPELLO) then
call ChangeMethod(GetTriggerUnit(), SPELLO, SPELLD, OFF, DEF, DEFID, ORDEROND, SFXDEF)
elseif (GetSpellAbilityId() == SPELLD) then
call ChangeMethod(GetTriggerUnit(), SPELLD, SPELLO, DEF, OFF, OFFID, ORDERONO, SFXOFF)
endif
return false
endfunction
private function DefActions takes nothing returns boolean
local unit tu = GetTriggerUnit()
local unit au = GetAttacker()
local integer QT = GetUnitAbilityLevel(tu, SPELLD)
local real ax = GetUnitX(au)
local real ay = GetUnitY(au)
local real facing = GetUnitFacing(au)
if (GetRandomInt(0, 100) <= DEFCHANCE(QT) and IsUnitInGroup(tu, DEF) and GetUnitAbilityLevel(au, DEBUFFID) <= 0) then
call DestroyEffect(AddSpecialEffect(SFXSTART, ax, ay))
set DUMMY = CreateUnit(GetOwningPlayer(tu), DUMID, ax, ay, bj_UNIT_FACING)
call UnitAddAbility(DUMMY, SPELLDEBUFF)
call SetUnitAbilityLevel(DUMMY, SPELLDEBUFF, QT)
call IssueTargetOrder(DUMMY, DEBUFFORDER, au)
call UnitApplyTimedLife(DUMMY, 039;BTLF039;, 1.)
set facing = GetRandomReal(facing - ANGLE, facing + ANGLE)
set ax = ax + DEFDIST(QT) * Cos(facing)
set ay = ay + DEFDIST(QT) * Sin(facing)
if (not InMapX(ax)) then
set ax = SetInX(ax)
endif
if (not InMapY(ay)) then
set ay = SetInY(ay)
endif
call SetUnitX(au, ax)
call SetUnitY(au, ay)
call DestroyEffect(AddSpecialEffect(SFXEND, ax, ay))
endif
set au = null
set tu = null
return false
endfunction
private function CondGroup takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(), DEFP) and IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false
endfunction
private function OffActions takes nothing returns nothing
local unit fog
local unit fogg
local real fx
local real fy
local integer QT = 0
if (CountUnitsInGroup(OFF) >= 1) then
loop
set fog = FirstOfGroup(OFF)
set QT = GetUnitAbilityLevel(fog, SPELLO)
if (GetRandomInt(0, 100) <= OFFCHANCE(QT)) then
exitwhen fog == null
set DEFP = GetOwningPlayer(fog)
call GroupEnumUnitsInRange(PULL, GetUnitX(fog), GetUnitY(fog), OFFDIST(QT), Condition(function CondGroup))
set PULLB = GetRandomSubGroup(OFFNUM(QT), PULL)
loop
set fogg = FirstOfGroup(PULLB)
exitwhen fogg == null
set fx = GetUnitX(fogg)
set fy = GetUnitY(fogg)
call DestroyEffect(AddSpecialEffect(SFXSTART, fx, fy))
call SetUnitX(fogg, GetUnitX(fog))
call SetUnitY(fogg, GetUnitY(fog))
call DestroyEffect(AddSpecialEffect(SFXEND, fx, fy))
call GroupRemoveUnit(PULLB, fogg)
endloop
call GroupRemoveUnit(OFF, fog)
call GroupAddUnit(OFFB, fog)
endif
endloop
loop
set fog = FirstOfGroup(OFFB)
exitwhen fog == null
call GroupRemoveUnit(OFFB, fog)
call GroupAddUnit(OFF, fog)
endloop
endif
endfunction
//====================================================================================================
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
set MAP_MIN_X = GetRectMinX(bj_mapInitialPlayableArea) + 40
set MAP_MAX_X = GetRectMaxX(bj_mapInitialPlayableArea) - 40
set MAP_MIN_Y = GetRectMinY(bj_mapInitialPlayableArea) + 40
set MAP_MAX_Y = GetRectMaxY(bj_mapInitialPlayableArea) - 40
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(t, Condition(function Actions))
set t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function Change))
set t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(t, Condition(function DefActions))
set t = CreateTrigger()
call TimerStart(CreateTimer(), INTERVAL, true, function OffActions)
endfunction
endscope
Test map included.
Constructive criticism is welcomed, flaming is not.
This spell will only be submitted to TH.net.
Do not redistribute or modify without permission.
Hope you enjoy it!
Constructive criticism is welcomed, flaming is not.
This spell will only be submitted to TH.net.
Do not redistribute or modify without permission.
Hope you enjoy it!
Changelog
v2.0
- Major code revamp
- You now click the spell to change between the Defense/Offense modes
- Added map boundaries so units don't teleport outside the map (Thanks DrEvil)
v1.7b
- Fixed SFX leak
v1.7
- Code touchup
- Fixed a minor bug
v1.6b
- Fixed loop pickedUnit setting
Credits to kenny!
v1.6
- Code layout touchup
v1.5b
- Code touchup
Replaced a location with X/Y
v1.5
- Major code revamp
Certain configs (can) use formulas now
Credits to Flare
v1.4c
- Code cleanup
Credits to Flare
- Fixed map description
- Fixed tooltip not showing level 4 for Offense
- Fixed code not showing description for Offense
v1.4b
- Fixed bug with hero stopping instead of holding
- Fixed spells to make them uncastable
v1.4
- Fixed up code more
- Added new subskill
Temporal Vortex (Offense)
v1.3
- Fixed up code
Credits to 'TriggerHappy
v1.2
- Fixed research icon
- Added configurable loop wait time
- Added more units to test map
They do less damage now too.
v1.1
- Added a 'learn' hotkey
- Added an SFX for when spell is active
v1.0
- Initial release
- Major code revamp
- You now click the spell to change between the Defense/Offense modes
- Added map boundaries so units don't teleport outside the map (Thanks DrEvil)
v1.7b
- Fixed SFX leak
v1.7
- Code touchup
- Fixed a minor bug
v1.6b
- Fixed loop pickedUnit setting
Credits to kenny!
v1.6
- Code layout touchup
v1.5b
- Code touchup
Replaced a location with X/Y
v1.5
- Major code revamp
Certain configs (can) use formulas now
Credits to Flare
v1.4c
- Code cleanup
Credits to Flare
- Fixed map description
- Fixed tooltip not showing level 4 for Offense
- Fixed code not showing description for Offense
v1.4b
- Fixed bug with hero stopping instead of holding
- Fixed spells to make them uncastable
v1.4
- Fixed up code more
- Added new subskill
Temporal Vortex (Offense)
v1.3
- Fixed up code
Credits to 'TriggerHappy
v1.2
- Fixed research icon
- Added configurable loop wait time
- Added more units to test map
They do less damage now too.
v1.1
- Added a 'learn' hotkey
- Added an SFX for when spell is active
v1.0
- Initial release
Attachments
-
opt-Temporal_Vortex_v14b.w3x25.7 KB · Views: 280
-
opt-Temporal_Vortex_v14c.w3x25.4 KB · Views: 298
-
opt-Temporal_Vortex_v15.w3x25.3 KB · Views: 310
-
opt-Temporal_Vortex_v15b.w3x25.3 KB · Views: 289
-
opt-Temporal_Vortex_v16.w3x25.2 KB · Views: 288
-
opt-Temporal_Vortex_v16b.w3x25.3 KB · Views: 286
-
opt-Temporal_Vortex_v17.w3x25.2 KB · Views: 281
-
opt-Temporal_Vortex_v17b.w3x24.9 KB · Views: 277
-
opt-Temporal_Vortex_v20.w3x22.1 KB · Views: 357