local unit dBU
local unit dbU = CreateUnit(GetOwningPlayer(tvaU), dummyBuffer, tvaX, tvaY, GetUnitFacing(tvaU))
call TriggerSleepAction(loopSFXTime)
call SetUnitPositionLoc(aTV, PolarProjectionBJ(atTV, I2R(GetUnitAbilityLevel(tTV, ability_TVid)) * teleDistance, GetRandomReal(0.00, 360.00)))
if GetUnitAbilityLevel(aTV, buff_TVDBid) < 1 then
if GetUnitAbilityLevel(tTV, buff_TVBid) > 0 then
set ddbU = CreateUnit(GetOwningPlayer(tTV), dummyCaster, aTVX, aTVY, GetUnitFacing(aTV))
call SetUnitAbilityLevel(ddbU, ability_TVDBid, GetUnitAbilityLevel(tTV, ability_TVid))
call IssueTargetOrder(ddbU, dbTry, aTV)
call UnitApplyTimedLife(ddbU, 'BTLF', 1.00)
call DestroyEffect(AddSpecialEffectTarget(offEffect, tTV, offAttachPoint))
call DestroyEffect(AddSpecialEffectLoc(startEffect, atTV))
set x = aTVY + (I2R(GetUnitAbilityLevel(tTV, ability_TVid)) * teleDistance) * Cos(GetRandomReal(0.00, 360.00) * bj_DEGTORAD)
set y = aTVY + (I2R(GetUnitAbilityLevel(tTV, ability_TVid)) * teleDistance) * Sin(GetRandomReal(0.00, 360.00) * bj_DEGTORAD)
call SetUnitPosition(aTV, x, y)
call DestroyEffect(AddSpecialEffectTarget(endEffect, aTV, attachPoint))
call RemoveLocation(atTV)
endif
endif
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(t, Condition(function TVAConditions))
call TriggerAddAction(t, function TVAActions)
set t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(t, Condition(function TVConditions))
call TriggerAddAction(t, function TVActions)
set t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(TVRtrig, EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(t, Condition(function TVRConditions))
call TriggerAddAction(t, function TVRActions)
set t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(TRYtrig, EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(t, Condition(function TRYConditions))
call TriggerAddAction(t, function TRYActions)
endfunction
scope TemporalVortex initializer Init
// +-------------------------------------+
// | -=-=- MODIFY HERE -=-=- |
// | -=-=- MODIFY HERE -=-=- |
// | -=-=- MODIFY HERE -=-=- |
// +-------------------------------------+
globals
private constant integer ability_TVid = 'A001'
// Raw code of 'Temporal Vortex' ability
private constant integer ability_TVDBid = 'A002'
// Raw code of 'Temporal Vortex (Debuff)' ability
private constant integer buff_TVBid = 'B000'
// Raw code of 'Temporal Vortex (Buff)' buff
private constant integer buff_TVDBid = 'B001'
// Raw code of 'Temporal Vortex (Debuff)' buff
private constant integer dummyCaster = 'n000'
// Raw code of 'DummyCaster' unit
private constant integer dummyBuffer = 'n001'
// Raw code of 'DummyBuffer' unit
private constant integer tvMin = 1
// Minimum for vortex chance
// I recommend leaving these two at '1' and '100'
private constant integer tvMax = 100
// Maximum for vortex chance
private constant integer tvChance = 100
// Chance to cast Temporal Vortex (0-100) (NOTE: This value is for level 1)
// This value will double for each level
// So if you set it to 25, the chances would be 25/50/75/100
// Set it to 15, chances would be 15/30/45/60
private constant string startEffect = "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl"
// Path for SFX when the unit starts to teleport
private constant string endEffect = "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl"
// Path for SFX when the unit finished teleporting
private constant string attachPoint = "origin"
// Attachment point of the above SFX
private constant string offEffect = "Abilities\\Weapons\\GyroCopter\\GyroCopterImpact.mdl"
// Path for SFX above attacked unit when Temporal Vortex goes off
private constant string offAttachPoint = "overhead"
// Attachment point of the above SFX
private constant string auraEffect = "Abilities\\Weapons\\GyroCopter\\GyroCopterImpact.mdl"
// Path for SFX at units feet when Temporal Vortex is on
private constant real teleDistance = 125.00
// Distance the attacking unit teleports
// This value will double for each level
// So if you set this to 200, the distance would be 200/400/600/800
// Set it to 75, distance would be 75/150/225/300
private constant string tvOn = "innerfireon"
// 'Order String Activate' for 'Temporal Vortex' ability
private constant string tvOff = "innerfireoff"
// 'Order String Deactivate for 'Temporal Vortex' ability
private constant string tvTry = "innerfire"
// 'Order String Use/Turn On' for 'Temporal Vortex' and 'Temporal Vortex (Buff)' abilities
private constant string dbTry = "slow"
// 'Order String Use/Turn On' for 'Temporal Vortex (Debuff)' ability
private constant real loopSFXTime = 1.50
// Time to wait in between the Temporal Vortex SFX at units feet spawning
endglobals
// +----------------------------------------------+
// | -=-=- NO TOUCHIE PAST HERE -=-=- |
// | -=-=- NO TOUCHIE PAST HERE -=-=- |
// | -=-=- NO TOUCHIE PAST HERE -=-=- |
// +----------------------------------------------+
private function TVAConditions takes nothing returns boolean
return GetIssuedOrderId() == OrderId(tvOn)
endfunction
private function TVAActions takes nothing returns nothing
local unit tvaU = GetTriggerUnit()
local real tvaX = GetUnitX(tvaU)
local real tvaY = GetUnitY(tvaU)
local unit dbU = CreateUnit(GetOwningPlayer(tvaU), dummyBuffer, tvaX, tvaY, GetUnitFacing(tvaU))
call IssueTargetOrder(dbU, tvTry, tvaU)
call UnitApplyTimedLife(dbU, 'BTLF', 1.00)
loop
exitwhen GetUnitAbilityLevel(tvaU, buff_TVBid) < 1
call DestroyEffect(AddSpecialEffectTarget(auraEffect, tvaU, attachPoint))
call TriggerSleepAction(loopSFXTime)
endloop
set dbU = null
set tvaU = null
endfunction
private function TVConditions takes nothing returns boolean
return IsPlayerEnemy(GetOwningPlayer(GetTriggerUnit()), GetOwningPlayer(GetAttacker())) and GetRandomInt(tvMin, tvMax) <= tvChance * GetUnitAbilityLevel(GetTriggerUnit(), ability_TVid) and GetUnitAbilityLevel(GetTriggerUnit(), ability_TVid) > 0
endfunction
private function TVActions takes nothing returns nothing
local unit tTV = GetTriggerUnit()
local unit aTV = GetAttacker()
local location atTV = GetUnitLoc(aTV)
local real aTVX = GetUnitX(aTV)
local real aTVY = GetUnitY(aTV)
local unit ddbU
local real x
local real y
if GetUnitAbilityLevel(aTV, buff_TVDBid) < 1 then
if GetUnitAbilityLevel(tTV, buff_TVBid) > 0 then
set ddbU = CreateUnit(GetOwningPlayer(tTV), dummyCaster, aTVX, aTVY, GetUnitFacing(aTV))
call SetUnitAbilityLevel(ddbU, ability_TVDBid, GetUnitAbilityLevel(tTV, ability_TVid))
call IssueTargetOrder(ddbU, dbTry, aTV)
call UnitApplyTimedLife(ddbU, 'BTLF', 1.00)
call DestroyEffect(AddSpecialEffectTarget(offEffect, tTV, offAttachPoint))
call DestroyEffect(AddSpecialEffectLoc(startEffect, atTV))
set x = aTVY + (I2R(GetUnitAbilityLevel(tTV, ability_TVid)) * teleDistance) * Cos(GetRandomReal(0.00, 360.00) * bj_DEGTORAD)
set y = aTVY + (I2R(GetUnitAbilityLevel(tTV, ability_TVid)) * teleDistance) * Sin(GetRandomReal(0.00, 360.00) * bj_DEGTORAD)
call SetUnitPosition(aTV, x, y)
call DestroyEffect(AddSpecialEffectTarget(endEffect, aTV, attachPoint))
call RemoveLocation(atTV)
endif
endif
set ddbU = null
set aTV = null
set tTV = null
endfunction
private function TVRConditions takes nothing returns boolean
return GetIssuedOrderId() == OrderId(tvOff)
endfunction
private function TVRActions takes nothing returns nothing
local unit tvrU = GetTriggerUnit()
call UnitRemoveAbility(tvrU, buff_TVBid)
set tvrU = null
endfunction
private function TRYConditions takes nothing returns boolean
return GetSpellAbilityId() == ability_TVid
endfunction
private function TRYActions takes nothing returns nothing
local unit tryU = GetTriggerUnit()
call IssueImmediateOrder(tryU, "stop")
call TriggerSleepAction(0.01)
call SetUnitAnimation(tryU, "walk")
set tryU = null
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(t, Condition(function TVAConditions))
call TriggerAddAction(t, function TVAActions)
set t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(t, Condition(function TVConditions))
call TriggerAddAction(t, function TVActions)
set t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(TVRtrig, EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(t, Condition(function TVRConditions))
call TriggerAddAction(t, function TVRActions)
set t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(TRYtrig, EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(t, Condition(function TRYConditions))
call TriggerAddAction(t, function TRYActions)
endfunction
endscope
Should've noticed that, thanks.Can become
ew, inaccurate waits, why not setup some timer.
I didn't know how to use all those, thanks for fixing that.And you also have an unneeded BJ.
to fix that just do something like...
did it pretty quick so not sure if thats the correct facing angle you wanted it.
If not, then sorry![]()
I think I'll keep it the way I have it;Now your init trigger could be simplified like...
Though thats only a personal choice.
function Actions takes nothing returns nothing
call BJDebugMsg("0.05 Seconds has passed again"
endfunction
function init takes nothing returns nothing
local timer t = TimerCreate()
call TimerStart(t, 0.05, function actions)
endfunction
Read these:Cool spell.
But as kirbyman said it need more eyecandness!
You can attach a effect on the chest of the teleported unit before it teleports.
When it reaches the destination you destroy it.
The effect must be something like Phoenix Fire effect.
Good Job.
Too much eye-candy is actually a bad thing, IMO.
That's a matter of opinion how much/how little SFX there should be.
I feel too much makes the spell feel like an ultimate.
The SFX are customizable to make them bigger/better SFX if you want.
I don't want to add more eye-candy as I don't want to make the spell look like an ultimate!
And as I've said before, the SFX used are customizable;
So you can change them to a bigger/better SFX to achieve more eye-candy if so desired.
Now now;Maybe you can add a chance of units near the teleported unit be teleported too?
scope TemporalVortex initializer Init
private function TVRActions takes nothing returns nothing
local unit tvrU = GetTriggerUnit()
call UnitRemoveAbility(tvrU, buff_TVBid)
set tvrU = null
endfunction
private function TVRActions takes nothing returns nothing
call UnitRemoveAbility(GetTriggerUnit(), buff_TVBid)
endfunction
private function Init takes nothing returns nothing
local trigger TVAtrig = CreateTrigger()
local trigger TVtrig = CreateTrigger()
local trigger TVRtrig = CreateTrigger()
local trigger TRYtrig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(TVAtrig, EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(TVAtrig, Condition(function TVAConditions))
call TriggerAddAction(TVAtrig, function TVAActions)
call TriggerRegisterAnyUnitEventBJ(TVtrig, EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(TVtrig, Condition(function TVConditions))
call TriggerAddAction(TVtrig, function TVActions)
call TriggerRegisterAnyUnitEventBJ(TVRtrig, EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(TVRtrig, Condition(function TVRConditions))
call TriggerAddAction(TVRtrig, function TVRActions)
call TriggerRegisterAnyUnitEventBJ(TRYtrig, EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(TRYtrig, Condition(function TRYConditions))
call TriggerAddAction(TRYtrig, function TRYActions)
endfunction
private function Init takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(trig, Condition(function TVAConditions))
call TriggerAddAction(trig, function TVAActions)
set trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(trig, Condition(function TVConditions))
call TriggerAddAction(trig, function TVActions)
set trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(trig, Condition(function TVRConditions))
call TriggerAddAction(trig, function TVRActions)
set trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(trig, Condition(function TRYConditions))
call TriggerAddAction(trig, function TRYActions)
endfunction
I've looked at lots of spells and (some) don't offer the customization to the extent my spell does.Comes standard with Jass
I'll remove thatAnd this is a pro.. How?
How soLooks to mee like the dota spell "Greater Bash" rip off.
Learn Temporal Vortex]Temporal Vortex comes as two subskills: [COLOR="DarkOrange said:Defense:[/COLOR] Causes attackers to have a chance to randomly teleport away from this Hero. Teleported units cannot be affected by the vortex again for a certain period.
Level 1 - 3% chance, 150 units away, 5 second debuff.
Level 2 - 6% chance, 300 units away, 4 second debuff.
Level 3 - 9% chance, 450 units away, 3 second debuff.
Level 4 - 12% chance, 600 units away, 2 second debuff.
Offense: Every 3 seconds, units are randomly chosen in a 600 AoE around the Hero. These chosen units are pulled into the Hero.
Level 1 - 7% chance, pulls 1 unit.
Level 2 - 14% chance, pulls up to 2 units.
Level 3 - 21% chance, pulls up to 3 units.
Level 4 - 28% chance, pulls up to 4 units.
Changelog
v1.4
- Fixed up code more
- Added new subskill
Temporal Vortex (Offense)
ThanksNice nice, like the new offensive spell as well.
In the next version I'll implement it only pulling enemies.Even though, considder making it enemy units only? Pulling your own units to you is quiet useless?![]()
Discussed, fixed.Also, what is it that over-rules the "Hold" function? Was quiet annoying that my hero ignored the hold when I wanted to test the offensive function.
Changelog
v1.4b
- Fixed bug with hero stopping instead of holding
- Fixed spells to make them uncastable
local group offGroup = GetRandomSubGroup(GetUnitAbilityLevel(offtTV, ability_OFFTVid), GetUnitsInRangeOfLocAll(pullRange, GetUnitLoc(offtTV)))
//In OffTVActions
call GroupClear(offGroup)
call DestroyGroup(offGroup)
if GetRandomInt(OFFMin, OFFMax) <= OFFChance * GetUnitAbilityLevel(offtTV, ability_OFFTVid) then
loop
set pickedUnit = FirstOfGroup(offGroup)
exitwhen pickedUnit == null
set pickedUnit = FirstOfGroup(offGroup)
call DestroyEffect(AddSpecialEffectTarget(pullStart, pickedUnit, startAttach))
call SetUnitPosition(pickedUnit, tTVX, tTVY)
call DestroyEffect(AddSpecialEffectTarget(pullEnd, pickedUnit, endAttach))
call GroupRemoveUnit(offGroup, pickedUnit)
set pickedUnit = null
[COLOR="Red"]set i = i + 1[/COLOR]
endloop
private constant integer tvChance = 3
// Chance to cast Temporal Vortex (Defense) (0-100) (NOTE: This value is for level 1)
// This value will double for each level
// So if you set it to 25, the chances would be 25/50/75/100
// Set it to 15, chances would be 15/30/45/60