xoxdragonxox
New Member
- Reaction score
- 1
I've recently just fixed this trigger because of fatal crashes, Now im asking if it can be improved, ive improved it as much as i can to my knowledge .. btw i SUCK at jass so im not sure if this is good. all i really did was copy n paste things that looked like common sense. if anyone could kindly improve it it'd be great.
i mainly wan tit improved for efficiency and make sure it cant crash or bug
THANK YOU
Sorry Lol. I forgot the main part ha here it is
i mainly wan tit improved for efficiency and make sure it cant crash or bug
THANK YOU
Sorry Lol. I forgot the main part ha here it is
JASS:
function RoadFlareConditions takes nothing returns boolean
return GetSpellAbilityId()==039;A022039;
endfunction
function RoadFlare takes nothing returns nothing
local unit marine = GetTriggerUnit()
local player p = GetOwningPlayer(marine)
local unit u
local unit missile
local location l = GetSpellTargetLoc()
local real x = GetLocationX(l)
local real y = GetLocationY(l)
local integer i = 1
call PolledWait(0.1)
call FieldChat(marine,5.0, udg_Pcolors[GetConvertedPlayerId(p)] + GetPlayerName(p) + "|r : Flare!" )
set missile = CreateUnit(Player(11),039;h00H039;,GetUnitX(marine),GetUnitY(marine),0.0)
call UnitApplyTimedLife(missile,039;Bhwd039;,15.0)
call IssuePointOrderLoc(missile,"attackground",l)
call PolledWait(2.5)
set u = CreateUnit(p,039;h001039;,x,y,0.0)
call UnitApplyTimedLife(u,039;Bhwd039;,40.0)
call RemoveLocation(l)
call RemoveUnit(missile)
set marine = null
set missile = null
set l = null
set u = null
endfunction
//===========================================================================
function InitTrig_Road_Flare takes nothing returns nothing
set gg_trg_Road_Flare = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Road_Flare,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition( gg_trg_Road_Flare, Condition( function RoadFlareConditions ) )
call TriggerAddAction(gg_trg_Road_Flare,function RoadFlare)
endfunction