HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Gate HP,

04-10-2008, 03:23 PM#1
Pinzu
This is the Setup trigger for the real trigger, Storing the value, for "Gate-1", the real/intiger value 1 is to mark that, and also set the life of the gate.
Trigger:
Gate Setup
Collapse Events
Map initialization
Conditions
Collapse Actions
Unit - Set the custom value of Gate Tower 0111 <gen> to 1
Set Gate[1] = Gate (Dalaran Outern) 0159 <gen>
Set GateLife[1] = (Max life of Gate (Dalaran Outern) 0159 <gen>)

Here is the trigger which to open the gate, the only problem is that the "Set GateLife..." in the previous trigger and using it in this is having trouble, the gate gets full hp instead of geting the GateLife[1] value.

Trigger:
Collapse Gate Tower
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Unit-type of (Casting unit)) Equal to Gate Tower
Collapse Actions
Custom script: local unit u = GetTriggerUnit()
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Ability being cast) Equal to Open Gate (custom)
Collapse Then - Actions
Custom script: call UnitRemoveAbilityBJ( 'A000', u )
Wait 2.00 seconds
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
GateLife[(Custom value of (Triggering unit))] Greater than 0.00
Collapse Then - Actions
Custom script: set udg_GateLife[GetUnitPointValue(u)] = GetDestructableLife(udg_Gate[GetUnitUserData(u)])
Custom script: call ModifyGateBJ( bj_GATEOPERATION_OPEN, udg_Gate[GetUnitUserData(u)] )
Custom script: call UnitAddAbilityBJ( 'A001', u )
Custom script: set u = null
Collapse
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Ability being cast) Equal to Close Gate (custom)
Collapse Then - Actions
Custom script: call UnitRemoveAbilityBJ( 'A001', u )
Wait 2.00 seconds
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
GateLife[(Custom value of (Triggering unit))] Greater than 0.00
Collapse Then - Actions
Custom script: call ModifyGateBJ( bj_GATEOPERATION_CLOSE, udg_Gate[GetUnitUserData(u)] )
Custom script: call SetDestructableLife( udg_Gate[GetUnitUserData(u)], udg_GateLife[GetUnitUserData(u)] )
Custom script: call UnitAddAbilityBJ( 'A000', u )
Custom script: set u = null
04-10-2008, 08:00 PM#2
Thunder_Eye
Quote:
(Max life of Gate (Dalaran Outern) 0159 <gen>)

This might be your problem.