- Joined
- May 1, 2008
- Messages
- 1,605
Dudes and girls - uberpros and beginners > I have a problem.
As you see in the title "GetSelectedUnit" mess up. First I remember that someone said "GetSelectedUnit" doesn't exist, but JassHelper itselt say, that "GetSelectedUnit" exist so....
But look at the trigger maybe I can take something different.
As you see in the title "GetSelectedUnit" mess up. First I remember that someone said "GetSelectedUnit" doesn't exist, but JassHelper itselt say, that "GetSelectedUnit" exist so....
But look at the trigger maybe I can take something different.
JASS:
function Trig_P_Aura_Jass_Actions takes nothing returns nothing
local unit u = GetSelectedUnit // Error: Undecleared function
local location l = GetUnitLoc(u)
if GetUnitTypeId(u) == 'h000' or GetUnitTypeId(u) == 'h001' then
if GetEventPlayerChatString() == "1" then
call UnitRemoveAbility(u, 'A000')
call UnitRemoveAbility(u, 'A002')
call UnitRemoveAbility(u, 'S000')
call UnitRemoveAbility(u, 'A003')
call UnitAddAbility(u, 'A001')
endif
if GetEventPlayerChatString() == "2" then
call UnitRemoveAbility(u, 'A000')
call UnitRemoveAbility(u, 'A001')
call UnitRemoveAbility(u, 'S000')
call UnitRemoveAbility(u, 'A003')
call UnitAddAbility(u, 'A002')
endif
if GetEventPlayerChatString() == "3" then
call UnitRemoveAbility(u, 'A000')
call UnitRemoveAbility(u, 'A002')
call UnitRemoveAbility(u, 'A001')
call UnitRemoveAbility(u, 'A003')
call UnitAddAbility(u, 'S000')
endif
if GetEventPlayerChatString() == "4" then
call UnitRemoveAbility(u, 'A000')
call UnitRemoveAbility(u, 'A002')
call UnitRemoveAbility(u, 'S000')
call UnitRemoveAbility(u, 'A001')
call UnitAddAbility(u, 'A003')
endif
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" , l))
set u = null
call RemoveLocation(l)
endif
endfunction
//===========================================================================
function InitTrig_P_Aura_Jass takes nothing returns nothing
set gg_trg_P_Aura_Jass = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_P_Aura_Jass, Player(0), "", false )
call TriggerAddAction( gg_trg_P_Aura_Jass, function Trig_P_Aura_Jass_Actions )
endfunction