Rheiko
Spell Reviewer
- Joined
- Aug 27, 2013
- Messages
- 4,214
Hello, so I had this custom exp system that I made in GUI. I made a lot of debug messages in the trigger. When I was done, I deleted the debug messages normally but after that, they still appeared in-game. So I converted it to Jass and deleted the functions manually. But I figured it can't be converted back to GUI so I want it to be at least efficient in my map and I'm no good with Jass.
Can anyone help me making this *more* efficient, pretty please?
Thanks in advance.
Can anyone help me making this *more* efficient, pretty please?
JASS:
function Trig_Exp_System_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == false ) ) then
return false
endif
return true
endfunction
function Trig_Exp_System_Func003002003001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Exp_System_Func003002003002001 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetTriggerPlayer()) == true )
endfunction
function Trig_Exp_System_Func003002003002002 takes nothing returns boolean
return ( GetOwningPlayer(GetFilterUnit()) != Player(PLAYER_NEUTRAL_PASSIVE) )
endfunction
function Trig_Exp_System_Func003002003002 takes nothing returns boolean
return GetBooleanAnd( Trig_Exp_System_Func003002003002001(), Trig_Exp_System_Func003002003002002() )
endfunction
function Trig_Exp_System_Func003002003 takes nothing returns boolean
return GetBooleanAnd( Trig_Exp_System_Func003002003001(), Trig_Exp_System_Func003002003002() )
endfunction
function Trig_Exp_System_Func005C takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Trig_Exp_System_Func006C takes nothing returns boolean
if ( not ( IsUnitAlly(GetKillingUnitBJ(), GetTriggerPlayer()) == true ) ) then
return false
endif
return true
endfunction
function Trig_Exp_System_Func007A takes nothing returns nothing
call AddHeroXPSwapped( R2I(udg_XPS_Final), GetEnumUnit(), true )
endfunction
function Trig_Exp_System_Actions takes nothing returns nothing
set udg_XPS_Loc = GetUnitLoc(GetTriggerUnit())
set udg_XPS_Group = GetUnitsInRangeOfLocMatching(udg_XPS_Area, udg_XPS_Loc, Condition(function Trig_Exp_System_Func003002003))
if ( Trig_Exp_System_Func005C() ) then
set udg_XPS_Final = ( I2R(udg_XPS_XPH[GetHeroLevel(GetTriggerUnit())]) * ( I2R(udg_XPS_XPGainPH[CountUnitsInGroup(udg_XPS_Group)]) / 100.00 ) )
else
set udg_XPS_Final = ( I2R(udg_XPS_XPU[GetUnitLevel(GetTriggerUnit())]) * ( I2R(udg_XPS_XPGainPH[CountUnitsInGroup(udg_XPS_Group)]) / 100.00 ) )
endif
if ( Trig_Exp_System_Func006C() ) then
set udg_XPS_Final = ( udg_XPS_Final * ( I2R(udg_XPS_XPGainDenyPerc) / 100.00 ) )
else
endif
call ForGroupBJ( udg_XPS_Group, function Trig_Exp_System_Func007A )
call DestroyGroup(udg_XPS_Group)
call RemoveLocation(udg_XPS_Loc)
endfunction
//===========================================================================
function InitTrig_Exp_System takes nothing returns nothing
set gg_trg_Exp_System = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Exp_System, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Exp_System, Condition( function Trig_Exp_System_Conditions ) )
call TriggerAddAction( gg_trg_Exp_System, function Trig_Exp_System_Actions )
endfunction
Thanks in advance.