- Joined
- Oct 24, 2012
- Messages
- 6,545
hello this is my first attempt to doing jass im using jngp so i just put vjass as the prefix thing. i did this in gui (i only converted things i couldnt find out how to do online) b4 i started to learn jass but i figured since im learning jass i might as well change over my map to 100% jass made i just want to know if there is anything tht i can change to make this more efficient ? thanks for anyone tht helps also i hope i copied it right lol
note: i plan on changing some of the other variables later since i now know about locals and how to use them but since there r a few tht i dont want to change in this or in other triggers
note: i plan on changing some of the other variables later since i now know about locals and how to use them but since there r a few tht i dont want to change in this or in other triggers
JASS:
\function Trig_Unit_Spawn_Red_all_Lvls_Actions takes nothing returns boolean
local integer LoopA = 1
local real rx
local real ry
call DisableTrigger( gg_trg_Unit_Spawn_Red_all_Lvls )
set udg_Damage_Boss_Round_Count_Player[1] = udg_Damage_Boss_Round_Count_Player[1] + 1
set udg_EnemiesAlive_Counter_Player[1] = udg_Number_Of_Unit_Spawns_Player[1]//#of unit spawns is a selected number of spawns in the game
set udg_Boss_Bonus_Counter[1] = udg_Boss_Bonus_Counter[1] + 1//used for giving players mana to summon a boss
set udg_Round_Player[1] = ( udg_Round_Player[1] + 1 )
call MultiboardSetItemValueBJ( udg_MultiBoard_Game_Scores, 2, 2, I2S(udg_Round_Player[1]) )
if ( udg_Round_Player[1] <= 31 ) then
set udg_Unit_Runner_Red_Spawn = udg_Unit_Runner_Spawn[udg_Round_Player[1]]//unit runner spawn is the array of units to spawn
//used for setting the next unit to be spawned
endif
if ( udg_Boss_Bonus_Counter[1] == 5 ) then
set udg_Boss_Add_Mana_Boolean_Player[1] = true
set udg_Boss_Bonus_Counter[1] = 0
endif
loop //loops for spawning units into map for player 1 ( i do not use 0 for players gets annoying )
exitwhen LoopA > udg_Number_Of_Unit_Spawns_Player[1] // variable tht allows player to pick # of enemy units per round
set rx = GetRectCenterX(gg_rct_red_start)
set ry = GetRectCenterY(gg_rct_red_start)
set udg_Unit_Spawns_Red[LoopA] = CreateUnit(Player(11), udg_Unit_Runner_Red_Spawn, rx, ry, 0)
call SetHeroLevel( udg_Unit_Spawns_Red[LoopA], ( udg_Round_Player[1] - 30 ), false )
set udg_EnemiesAlive_Player[1] = ( udg_EnemiesAlive_Player[1] + 1 ) //multiboard variable enemies alive
call MultiboardSetItemValueBJ( udg_MultiBoard_Game_Scores, 2, 6, I2S(udg_EnemiesAlive_Player[1]) )
call PolledWait( udg_Spawn_Speed_Player[1] )//set the speed between enemy spawns
set LoopA = LoopA + 1
endloop
return false
endfunction
//===========================================================================
function InitTrig_Unit_Spawn_Red_all_Lvls takes nothing returns nothing
set gg_trg_Unit_Spawn_Red_all_Lvls = CreateTrigger()
call TriggerRegisterPlayerEvent(gg_trg_Unit_Spawn_Red_all_Lvls, Player(0), EVENT_PLAYER_END_CINEMATIC)
call TriggerRegisterPlayerChatEvent( gg_trg_Unit_Spawn_Red_all_Lvls, Player(0), ( "-go" ), true )
call TriggerAddAction( gg_trg_Unit_Spawn_Red_all_Lvls, function Trig_Unit_Spawn_Red_all_Lvls_Actions )
endfunction
Last edited: