- Joined
- May 3, 2008
- Messages
- 3,154
JASS:
globals
constant integer TA = 'A004'
constant integer Ship = 'h002'
constant integer Iceberg = 'h001'
endglobals
function Titanic_Conditions takes nothing returns boolean
return GetSpellAbilityId() == TA
endfunction
function Titanic_Dash_Timer takes nothing returns nothing
local timer TDT = GetExpiredTimer()
call DestroyTimer (TDT)
set TDT = null
endfunction
function Titanic_Fall_Timer takes nothing returns nothing
local timer TFT = GetExpiredTimer()
local timer TDT = CreateTimer()
call TimerStart (TDT, 0.02, true, function Titanic_Dash_Timer)
call DestroyTimer (TFT)
set TFT = null
endfunction
function Titanic_Actions takes nothing returns nothing
local unit C = GetTriggerUnit()
local location TL = GetSpellTargetLoc()
local location UL = GetUnitLoc(C)
local real FP1 = AngleBetweenPoints(TL, UL)
local real FP2 = AngleBetweenPoints(UL, TL)
local unit Tit = CreateUnitAtLoc(GetOwningPlayer(C), Ship, TL, FP1)
local unit Ice = CreateUnitAtLoc(GetOwningPlayer(C), Iceberg, UL, FP2)
local timer TFT = CreateTimer()
call SetUnitPathing(Tit,false)
call UnitAddAbility(Tit,'Arav')
call UnitRemoveAbility(Tit,'Arav')
call SetUnitFlyHeight(Tit,800,0)
call SetUnitFlyHeight (Tit,1,1)
call TimerStart (TFT, 0.02, true, function Titanic_Fall_Timer)
call RemoveLocation(TL)
call RemoveLocation(UL)
set C = null
set TL = null
set UL = null
endfunction
//===========================================================================
constant function DF takes nothing returns boolean
return true
endfunction
function InitTrig_Titanic_JASS takes nothing returns nothing
local trigger T = CreateTrigger()
local integer TI = 0
local filterfunc FF = Filter(function DF)
loop
exitwhen (TI >= bj_MAX_PLAYER_SLOTS)
call TriggerRegisterPlayerUnitEvent(T, Player(TI), EVENT_PLAYER_UNIT_SPELL_EFFECT, FF)
set TI = TI + 1
endloop
call DestroyBoolExpr(FF)
call DestroyFilter(FF)
call TriggerAddAction(T,function Titanic_Actions)
call TriggerAddCondition(T,Condition(function Titanic_Conditions))
set FF = null
set T = null
endfunction
I been trying to learn JASS/VJASS, but only manage to learn a little of it as I am quite busy with my other schedule.
Currently I been trying to learn how to use timer, condition and loop. Which I have not learn about it yet.
I am stump at how to make the ship fall from the sky and dash forward to the iceberg and crush upon impact while knocking down every enemy that are within it's path.
Of course, this spells was currently using loc instead of x/y/z coordinates. But as I say, I am learning too little of it at this moment.
Note : GUI and VJASS are from other users, they are not from me.
Last edited: