- Joined
- Oct 10, 2009
- Messages
- 1,426
SOLVED by Pharoh_
Well, I have this trigger that should be fairly simple but it hates me and won't work as I want it.
It will only spawn the warrior. not the second unit,
no matter which spell I use.
I have the GUI of the code, and Jass code(It's just converted because I did this in GUI (I have a reason)). I'll accept it in either form.
[rainbow]+rep, and thanks will be given[/rainbow]
It will only spawn the warrior. not the second unit,
no matter which spell I use.
I have the GUI of the code, and Jass code(It's just converted because I did this in GUI (I have a reason)). I'll accept it in either form.

JASS:
function SelectHero_RemoveAbility takes nothing returns boolean
call UnitRemoveAbility( GetEnumUnit(),bj_groupEnumTypeId )
return false
endfunction
function Trig_Select_Hero_Actions takes nothing returns nothing
local unit dummy
local unit u = GetTriggerUnit()
local player p = GetTriggerPlayer()
local integer check = 0
local string s = ""
set bj_groupEnumTypeId = GetSpellAbilityId()
if bj_groupEnumTypeId == 'A00E' then
set check = 3
set s = "Warrior"
set dummy = CreateUnit( p, 'Otch', GetWidgetX(u),GetWidgetY(u), 90.00 )
elseif bj_groupEnumTypeId == 'A00G' then
set check = 2
set s = "Rogue"
set dummy = CreateUnit( p, 'Edem', GetWidgetX(u),GetWidgetY(u), 90.00 )
elseif bj_groupEnumTypeId == 'A00F' then
set check = 1
set s = "Shaman"
set dummy = CreateUnit( p, 'O000', GetWidgetX(u),GetWidgetY(u), 90.00 )
endif
if check > 0 then
set udg_Shaman_Rogue_Tauren[GetPlayerId(p)+1] = check
call DisplayTextToPlayer( GetLocalPlayer(), ( "|c00ff0000" + ( GetPlayerName(p) + " has selected the "+s+" class." ) ) )
call UnitAddItemById( dummy,'pghe' )
call UnitAddItemById( dummy,'pgma' )
call UnitAddItemById( dummy,'ankh' )
call GroupEnumUnitsInRect(bj_lastCreatedGroup,gg_rct_Starting_Region, Filter(function SelectHero_RemoveAbility ))
call TriggerSleepAction( 0.00 )
call SelectUnitForPlayerSingle( dummy, p )
set dummy = null
endif
set u = null
endfunction
function Trig_Select_Hero_Conditions takes nothing returns boolean
return GetUnitTypeId(GetTriggerUnit()) == 'ncop'
endfunction
//===========================================================================
function InitTrig_Select_Hero takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t, Condition( function Trig_Select_Hero_Conditions ) )
call TriggerAddAction(t,function Trig_Select_Hero_Actions)
endfunction
[rainbow]+rep, and thanks will be given[/rainbow]
Last edited: