- Joined
- Jul 1, 2008
- Messages
- 1,314
hey guys,
i made an ability, please dont mind the german comments, they are not important.
First of all here is the trigger:
The Problem is, that this Effect, i create here
is NOT destroyed at the end of the trigger,
but i wrote this line
at the end of the trigger.
So WHY does it not work?
Can you guys please help me?
Greets
i made an ability, please dont mind the german comments, they are not important.
First of all here is the trigger:
JASS:
function Trig_Giesskanne_Conditions takes nothing returns boolean
if GetSpellAbilityId() == 'A01S' or GetSpellAbilityId() == 'A01V' then
return true
endif
return false
endfunction
function Giessen_Check takes nothing returns boolean
return IsUnitType(GetFilterUnit(), UNIT_TYPE_MECHANICAL) == true
endfunction
function Trig_Giesskanne_Actions takes nothing returns nothing
local unit UG = GetSpellAbilityUnit()
local unit Targ = GetSpellTargetUnit()
local group g
local unit x
local effect Water
local integer Abil = GetSpellAbilityId()
// Gießen
if Abil == 'A01S' then
set g = CreateGroup()
call GroupEnumUnitsInRange(g, GetUnitX(UG),GetUnitY(UG),325.00,Condition(function Giessen_Check))
loop
set x = FirstOfGroup(g)
exitwhen x == null
call SetUnitState(x,UNIT_STATE_MANA, GetUnitState(x,UNIT_STATE_MAX_MANA)*RMaxBJ(0,100) * 0.01)
set Water = AddSpecialEffect("Abilities\\Spells\\Other\\CrushingWave\\CrushingWaveDamage.mdl",GetUnitX(x),GetUnitY(x))
call DestroyEffect(Water)
//------
call GroupRemoveUnit(g,x)
endloop
call SetItemUserData( GetItemOfTypeFromUnitBJ(UG, 'I00I'), 1 )
endif
// Am Brunnen füllen
if Abil == 'A01V' and GetUnitTypeId(Targ) == 'h014' then
set Water = AddSpecialEffect("war3mapImported\\KnockbackWater.mdx", GetUnitX(Targ),GetUnitY(Targ))
call SetItemUserData(GetItemOfTypeFromUnitBJ(UG,'I00I'), 2 )
endif
call TriggerSleepAction( 5.00 )
// Kanne leer?
if GetItemUserData(GetItemOfTypeFromUnitBJ(UG, 'I00I')) == 1 then
call UnitAddAbility(UG, 'A01V')
call UnitRemoveAbility(UG, 'A01S')
else
call UnitAddAbility(UG, 'A01S')
call UnitRemoveAbility(UG, 'A01V')
endif
call DestroyGroup(g)
set g = null
set UG = null
set x = null
set Targ = null
call DestroyEffect(Water)
set Water = null
endfunction
//===========================================================================
function InitTrig_Giesskanne takes nothing returns nothing
set gg_trg_Giesskanne = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Giesskanne, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Giesskanne, Condition( function Trig_Giesskanne_Conditions ) )
call TriggerAddAction( gg_trg_Giesskanne, function Trig_Giesskanne_Actions )
endfunction
The Problem is, that this Effect, i create here
JASS:
// Am Brunnen füllen
if Abil == 'A01V' and GetUnitTypeId(Targ) == 'h014' then
set Water = AddSpecialEffect("war3mapImported\\KnockbackWater.mdx", GetUnitX(Targ),GetUnitY(Targ))
call SetItemUserData(GetItemOfTypeFromUnitBJ(UG,'I00I'), 2 )
endif
but i wrote this line
JASS:
call DestroyEffect(Water)
So WHY does it not work?
Can you guys please help me?
Greets