- Reaction score
- 149
Long time no see.
And here I return to world editor again, hoping for something to work as it is supposed to.
Yet, very first trigger that cannot be done in GUI seems to throw up more errors than I could ever imagine.
So here it goes again, ugly looking, non-optimizied triggers that vere freshly converted to JASS.
Anyone could explain me what's so wrong about it all?
And here I return to world editor again, hoping for something to work as it is supposed to.
Yet, very first trigger that cannot be done in GUI seems to throw up more errors than I could ever imagine.
So here it goes again, ugly looking, non-optimizied triggers that vere freshly converted to JASS.
Anyone could explain me what's so wrong about it all?
JASS:
local integer A
function Trig_SettingUp_Copy_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Trig_SettingUp_Copy_Func010Func001C takes nothing returns boolean
if ( not ( udg_Hero_AbilityType1[A] == 039;A008039; ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped(udg_Hero_Abilities[GetForLoopIndexA()], udg_tempHero) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_SettingUp_Copy_Actions takes nothing returns nothing
set udg_tempHero = GetTriggerUnit()
set A = GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))
set udg_tempPlayerA[A] = GetOwningPlayer(udg_tempHero)
set udg_checkHero[A] = true
set udg_Hero[A] = udg_tempHero
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = udg_SaveLoad_Abilities_LastIndex
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_SettingUp_Copy_Func010Func001C() ) then
set udg_Hero_AbilityType1[A] = udg_Hero_Abilities[GetForLoopIndexA()]
set udg_Hero_AbilityLevel_I[A] = GetUnitAbilityLevelSwapped(udg_Hero_AbilityType1[A], udg_tempHero)
call MultiboardDisplayBJ( false, udg_SkillBoard[A] )
call MultiboardSetItemValueBJ( udg_SkillBoard[A], 2, 1, ( GetAbilityName(udg_Hero_AbilityType1[A]) + ":" ) )
call MultiboardSetItemValueBJ( udg_SkillBoard[A], 3, 1, ( ( I2S(udg_Hero_AbilityExpierence_I[A]) + " / " ) + I2S(( udg_Hero_AbilityLevel_I[A] * 16 )) ) )
if GetLocalPlayer() == udg_tempPlayerA[A] then
call MultiboardDisplayBJ( true, udg_SkillBoard[A] )
endif
else
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_SettingUp_JASS takes nothing returns nothing
set gg_trg_SettingUp_JASS = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_SettingUp_JASS, GetPlayableMapRect() )
call TriggerAddCondition( gg_trg_SettingUp_JASS, Condition( function Trig_SettingUp_Copy_Conditions ) )
call TriggerAddAction( gg_trg_SettingUp_JASS, function Trig_SettingUp_Copy_Actions )
endfunction
JASS:
function Trig_Casting_JASS_Func005Func002C takes nothing returns boolean
if ( not ( udg_Hero_AbilityExpierence_I[A] >= ( udg_Hero_AbilityLevel_I[A] * 16 ) ) ) then
return false
endif
return true
endfunction
function Trig_Casting_JASS_Func005C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped(udg_Hero_AbilityType1[A], GetTriggerUnit()) < 100 ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == udg_Hero_AbilityType1[A] ) ) then
return false
endif
return true
endfunction
function Trig_Casting_JASS_Actions takes nothing returns nothing
local integer A
set A = GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))
set udg_tempPlayerA[A] = GetOwningPlayer(udg_tempHero)
set A = GetConvertedPlayerId(udg_tempPlayerA[A])
if ( Trig_Casting_JASS_Func005C() ) then
set udg_Hero_AbilityExpierence_I[A] = ( udg_Hero_AbilityExpierence_I[A] + ( ( 1 + udg_Hero_AbilityBonus ) + ( udg_Hero_AbilityLevel_I[A] / 7 ) ) )
if ( Trig_Casting_JASS_Func005Func002C() ) then
set udg_Hero_AbilityExpierence_I[A] = ( udg_Hero_AbilityExpierence_I[A] - ( 16 * GetUnitAbilityLevelSwapped(udg_Hero_AbilityType1[A], GetTriggerUnit()) ) )
call SetUnitAbilityLevelSwapped( udg_Hero_AbilityType1[A], GetTriggerUnit(), ( GetUnitAbilityLevelSwapped(udg_Hero_AbilityType1[A], GetTriggerUnit()) + 1 ) )
set udg_Hero_AbilityLevel_I[A] = GetUnitAbilityLevelSwapped(udg_Hero_AbilityType1[A], udg_Hero[A])
else
endif
call MultiboardSetItemValueBJ( udg_SkillBoard[A], 3, 1, ( ( I2S(udg_Hero_AbilityExpierence_I[A]) + " / " ) + I2S(( udg_Hero_AbilityLevel_I[A] * 16 )) ) )
call MultiboardDisplayBJ( false, udg_SkillBoard[A] )
if GetLocalPlayer() == udg_tempPlayerA[A] then
call MultiboardDisplayBJ( true, udg_SkillBoard[A] )
endif
else
endif
endfunction
//===========================================================================
function InitTrig_Casting_JASS takes nothing returns nothing
set gg_trg_Casting_JASS = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Casting_JASS, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Casting_JASS, function Trig_Casting_JASS_Actions )
endfunction