R
Rode
Guest
OK, thanks. I think I got it now.
Maybe..
Maybe..
Well, by "Advanced" I didn't mean that the content was going to be advanced. It was just going to be optimization, and some other stuff for optimization that can be considered "Advanced"...
Wtf is CLR?
I wish to sign up! But I can't promise you my everyday commitment- sometimes I get "occupied" during weekends.
Assignment # 4
Create a simple spell using your knowledge on JASS. The spell does not have to be a hugely complicated spell, hence the word "Simple"
If you need help post it here...no one will steal your work that is in this class..If they do..points will be deducted..The grading is done like:
Creativity: -/5
Code: -/5
When you are done with this assignment attach the map here...I will download them and check them. When I am done checking them I will post to tell you that you may remove it so that it doesn't take space on your profile.
scope StormBounce
constant function RawSB takes nothing returns integer
return 039;A000039;
endfunction
constant function RawSBDummy takes nothing returns integer
return 039;A001039;
endfunction
constant function RawDumStomer takes nothing returns integer
return 039;h001039;
endfunction
constant function BounceInterval takes nothing returns real
return .75 //interval before the second bounce
endfunction
constant function GetBounceTimes takes integer Lvl returns integer
return Lvl+1 //how many time to bounce
endfunction
constant function Range takes nothing returns real
return 750.00 //bounce in what range
endfunction
function SurroundCond takes nothing returns boolean
return GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)>0 and IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)!= true and IsUnitAlly(GetFilterUnit(),GetOwningPlayer(GetSpellAbilityUnit())) != true
endfunction
function tAct takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer BounceTime = GetHandleInt(t,"bouncetime")
local integer loopCount = 0
local integer Lvl = GetHandleInt(t,"lvl")
local unit target = GetHandleUnit(t,"target")
local unit caster = GetHandleUnit(t,"caster")
local unit randomU
local unit dummy
local group Surround = CreateGroup()
local group Randomed = CreateGroup()
if BounceTime >0 then
call GroupEnumUnitsInRange(Surround,GetUnitX(target),GetUnitY(target),Range(),Condition(function SurroundCond))
loop
exitwhen loopCount>CountUnitsInGroup(Surround)
set Randomed = GetRandomSubGroup(1,Surround)
set randomU = FirstOfGroup(Randomed)
if IsUnitAlly(randomU,GetOwningPlayer(caster)) == false and randomU != target then
set loopCount = 8191
elseif IsUnitAlly(randomU,GetOwningPlayer(caster)) == true then
call DestroyGroup(Randomed)
endif
set loopCount = loopCount + 1
endloop
set dummy = CreateUnit(GetOwningPlayer(caster),RawDumStomer(),GetUnitX(target),GetUnitY(target),270)
call UnitApplyTimedLife(dummy,039;BTLF039;,1.2)
call UnitAddAbility(dummy,RawSBDummy())
call SetUnitAbilityLevel(dummy,RawSBDummy(),Lvl)
call IssueTargetOrder(dummy,"thunderbolt",randomU)
call SetHandleHandle(t,"target",randomU)
call SetHandleInt(t,"bouncetime",BounceTime-1)
elseif BounceTime<= 0 then
call PauseTimer(t)
call FlushHandleLocals(t)
call DestroyTimer(t)
endif
call DestroyGroup(Surround)
call DestroyGroup(Randomed)
set t = null
set target = null
set randomU = null
set dummy = null
set caster = null
set Surround = null
set Randomed = null
endfunction
function SBCond takes nothing returns boolean
return GetSpellAbilityId() == RawSB()
endfunction
function Trig_Storm_Bounce_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local integer Lvl = GetUnitAbilityLevel(caster,RawSB())
local integer BounceTime = GetBounceTimes(Lvl)
call SetHandleHandle(t,"target",target)
call SetHandleHandle(t,"caster",caster)
call SetHandleInt(t,"bouncetime",BounceTime)
call SetHandleInt(t,"lvl",Lvl)
call TimerStart(t,BounceInterval(),true,function tAct)
set t = null
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_Storm_Bounce takes nothing returns nothing
set gg_trg_Storm_Bounce = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(gg_trg_Storm_Bounce, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Storm_Bounce, Condition(function SBCond))
call TriggerAddAction( gg_trg_Storm_Bounce, function Trig_Storm_Bounce_Actions )
endfunction
endscope
Great, a new assignment. I'll get on to it as soon as I get home.
>I have lost interest in Warcraft III
You'll be back..
I have 2 questions-
1) Who is my teacher (who will I have to annoy)?
2) Do I have to do my homework from the 1st assignment?