BRUTAL
I'm working
- Reaction score
- 118
well i decided to give jass another shot.
im trying to recreate my spell 'ice trap' in vjass, so far im getting there.
a few question though; in the loop function i put the sleep function so the units arent all created instantly, but its rather slow >< whys that?
so how do you make a like..periodic event type of function within the trigger cause ive noticed vjass spells are made in one trigger, like a meathook.
do i need to use a system like ,tt? whatever that is? ><
anyways heres my trigger
also, how would i go about making the pathing walkable after the amount of time it takes for the units created in a circle to die?
again this is my first attempt at jass, so if something is wrong help is welcome : o
im trying to recreate my spell 'ice trap' in vjass, so far im getting there.
a few question though; in the loop function i put the sleep function so the units arent all created instantly, but its rather slow >< whys that?
so how do you make a like..periodic event type of function within the trigger cause ive noticed vjass spells are made in one trigger, like a meathook.
do i need to use a system like ,tt? whatever that is? ><
anyways heres my trigger
JASS:
scope IceTrap initializer Init
// ________________________________________
// || ||
// || Modify below ||
// ||________________________________________||
globals
private constant integer Spellid = 039;A001039; // Raw code of Ice Trap ability
private constant integer Dummyid = 039;h007039; // Raw code of Ice Trap ability
private constant real MaxUnits = 360 // Number of units made to complete the circle
private constant real AOE = 290 //Base AOE of spell, each level AOE gets bigger
endglobals
// ________________________________________
// || ||
// || Do not modify ||
// ||________________________________________||
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == Spellid
endfunction
function Actions takes nothing returns nothing
local unit ITCaster = GetSpellAbilityUnit()
local real ITDuration = (6 + (3 * I2R(GetUnitAbilityLevelSwapped(039;A001039;, ITCaster))))
local location ITTargetPoint = GetSpellTargetLoc()
local real ITTimer = 0
local real ITAngle = ( GetUnitFacing(ITCaster) + 140.00 )
local location ITTargetPos = PolarProjectionBJ(ITTargetPoint, ( AOE + ( I2R(GetUnitAbilityLevelSwapped(039;A001039;, ITCaster)) * 20.00 ) ), ITAngle)
local rect ITCreateRect = RectFromCenterSizeBJ(ITTargetPoint, 100.00, 100.00)
call SetUnitFacingToFaceLocTimed( ITCaster, ITTargetPoint, 0 )
call AddWeatherEffectSaveLast( ITCreateRect, 039;SNls039; )
call EnableWeatherEffect( GetLastCreatedWeatherEffect(), true )
call RemoveRect ( ITCreateRect )
loop
exitwhen ITTimer == MaxUnits
set ITTimer = (ITTimer + 10)
set ITTargetPos = PolarProjectionBJ(ITTargetPoint, ( AOE + ( I2R(GetUnitAbilityLevelSwapped(039;A001039;, ITCaster)) * 20.00 ) ), (ITAngle + ITTimer ))
call CreateNUnitsAtLocFacingLocBJ( 1, Dummyid, GetOwningPlayer(ITCaster), ITTargetPos, ITTargetPoint )
call UnitAddAbilityBJ( 039;A002039;, GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 039;A002039;, GetLastCreatedUnit(), GetUnitAbilityLevelSwapped(039;A001039;, ITCaster) )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "immolation" )
call UnitApplyTimedLifeBJ( ( ITDuration), 039;BTLF039;, GetLastCreatedUnit() )
call SetTerrainPathableBJ( ITTargetPos, PATHING_TYPE_WALKABILITY, false )
call TriggerSleepAction(0.01)
endloop
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function Conditions))
call TriggerAddAction(t, function Actions)
endfunction
endscope
also, how would i go about making the pathing walkable after the amount of time it takes for the units created in a circle to die?
again this is my first attempt at jass, so if something is wrong help is welcome : o