- Joined
- Sep 4, 2007
- Messages
- 407
I got a problem. I got this trigger that works perfecly except for one thing. it don't change the units flying height as it is told to.
here's the trigger.
here's the trigger.
JASS:
function Trig_Creature_Model_Air_Conditions takes nothing returns boolean
if GetSpellAbilityId() == 'A00G' then
return true
endif
return false
endfunction
function Trig_Creature_Model_Air_Actions takes nothing returns nothing
local unit creator = GetSpellAbilityUnit()
local player playerA = GetOwningPlayer(creator)
local real x = -256.000
local real y = 8576.000
local unit creature
local effect effectA
call AddSpecialEffect("Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl", x, y )
call RemoveUnit(udg_CC_Unit[GetPlayerId(playerA) + 1])
if GetSpellAbilityId() == 'A00G' then
if udg_CC_Size[GetPlayerId(playerA) + 1] == 1 then
set creature = CreateUnit( playerA, 'h00G', x, y, 270)
call SetUnitAbilityLevel(creature, 'A008', 1 )
endif
if udg_CC_Size[GetPlayerId(playerA) + 1] == 2 then
set creature = CreateUnit( playerA, 'h00H', x, y, 270)
call SetUnitAbilityLevel(creature, 'A008', 2 )
endif
if udg_CC_Size[GetPlayerId(playerA) + 1] == 3 then
set creature = CreateUnit( playerA, 'h00I', x, y, 270)
call SetUnitAbilityLevel(creature, 'A008', 3 )
endif
endif
call SetUnitFlyHeight(creature, 100.00, 0.01)
set udg_CC_Unit[GetPlayerId(playerA) + 1] = creature
set udg_CC_CreatureType[GetPlayerId(playerA) + 1] = GetUnitTypeId(creature)
call UnitAddAbility(creature, 'Apiv')
call UnitRemoveAbility(creator, 'A00G')
call UnitRemoveAbility(creature, 'Awan')
call UnitAddAbility(creator, 'A00L')
call UnitAddAbility(creator, 'A00K')
call UnitAddAbility(creator, 'A00J')
set creator = null
set creature = null
set playerA = null
call DestroyEffect(effectA)
endfunction
//===========================================================================
function InitTrig_Creature_Model_Air takes nothing returns nothing
set gg_trg_Creature_Model_Air = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Creature_Model_Air, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Creature_Model_Air, Condition( function Trig_Creature_Model_Air_Conditions ) )
call TriggerAddAction( gg_trg_Creature_Model_Air, function Trig_Creature_Model_Air_Actions )
endfunction