- Joined
- Jun 20, 2017
- Messages
- 380
First my jass is not good, second I try import these GUI into JASS, But they are broken and won't work, I also get a lot of errors.
gui
jass
my jass
gui
-
Attack Destroy Building
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
Multiple ConditionsAnd - All (Conditions) are true
-
Conditions
-
((Attacking unit) is A peon-type unit) Equal to (==) True
-
((Attacked unit) is A structure) Equal to (==) True
-
(Owner of (Attacking unit)) Equal to (==) (Owner of (Attacked unit))
-
(Unit-type of (Attacked unit)) Not equal to (!=) Flag
-
-
-
-
Actions
-
Wait 0.50 seconds
-
Unit - Kill (Attacked unit)
-
-
-
Cannot attack ally
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
Multiple ConditionsAnd - All (Conditions) are true
-
Conditions
-
((Attacked unit) is An Ancient) Equal to (==) True
-
((Attacking unit) belongs to an ally of (Owner of (Attacked unit))) Equal to (==) True
-
-
-
-
Actions
-
Unit - Order (Attacking unit) to Stop
-
-
-
Attack Heroic Heartbreak
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
Multiple ConditionsOr - Any (Conditions) are true
-
Conditions
-
(Unit-type of (Attacking unit)) Equal to (==) Kael
-
(Unit-type of (Attacking unit)) Equal to (==) Arthas
-
(Unit-type of (Attacking unit)) Equal to (==) Maiev
-
(Unit-type of (Attacking unit)) Equal to (==) Malfurion
-
(Unit-type of (Attacking unit)) Equal to (==) Rexxar
-
(Unit-type of (Attacking unit)) Equal to (==) Marine
-
-
-
-
Actions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item carried by (Attacking unit) of type Heroic-Heartbreak)) Equal to (==) Heroic-Heartbreak
-
((Owner of (Attacking unit)) is an ally of (Owner of (Attacked unit))) Not equal to (!=) True
-
(Owner of (Attacking unit)) Not equal to (!=) (Owner of (Attacked unit))
-
-
Then - Actions
-
Unit - Kill (Attacked unit)
-
Trigger - Turn on Heroic Heartbreak <gen>
-
Trigger - Turn on Vampires Dead <gen>
-
-
Else - Actions
-
-
-
JASS:
function Trig_Attack_Func001C takes nothing returns boolean
if ( not ( IsUnitType(GetAttacker(), UNIT_TYPE_PEON) == true ) ) then
return false
endif
if ( not ( IsUnitType(GetAttackedUnitBJ(), UNIT_TYPE_STRUCTURE) == true ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetAttacker()) == GetOwningPlayer(GetAttackedUnitBJ()) ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetAttackedUnitBJ()) != 'h00B' ) ) then
return false
endif
return true
endfunction
function Trig_Attack_Conditions takes nothing returns boolean
if ( not Trig_Attack_Func001C() ) then
return false
endif
return true
endfunction
function Trig_Attack_Actions takes nothing returns nothing
call TriggerSleepAction( 0.50 )
call KillUnit( GetAttackedUnitBJ() )
endfunction
//===========================================================================
function InitTrig_Attack takes nothing returns nothing
set gg_trg_Attack = CreateTrigger( )
call DisableTrigger( gg_trg_Attack )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Attack, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Attack, Condition( function Trig_Attack_Conditions ) )
call TriggerAddAction( gg_trg_Attack, function Trig_Attack_Actions )
endfunction
JASS:
function Trig_Cannot_attack_ally_Func001C takes nothing returns boolean
if ( not ( IsUnitType(GetAttackedUnitBJ(), UNIT_TYPE_ANCIENT) == true ) ) then
return false
endif
if ( not ( IsUnitAlly(GetAttacker(), GetOwningPlayer(GetAttackedUnitBJ())) == true ) ) then
return false
endif
return true
endfunction
function Trig_Cannot_attack_ally_Conditions takes nothing returns boolean
if ( not Trig_Cannot_attack_ally_Func001C() ) then
return false
endif
return true
endfunction
function Trig_Cannot_attack_ally_Actions takes nothing returns nothing
call IssueImmediateOrder( GetAttacker(), "stop" )
endfunction
//===========================================================================
function InitTrig_Cannot_attack_ally takes nothing returns nothing
set gg_trg_Cannot_attack_ally = CreateTrigger( )
call DisableTrigger( gg_trg_Cannot_attack_ally )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Cannot_attack_ally, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Cannot_attack_ally, Condition( function Trig_Cannot_attack_ally_Conditions ) )
call TriggerAddAction( gg_trg_Cannot_attack_ally, function Trig_Cannot_attack_ally_Actions )
endfunction
JASS:
function Trig_Attack_Heroic_Heartbreak_Func001C takes nothing returns boolean
if ( ( GetUnitTypeId(GetAttacker()) == 'H019' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetAttacker()) == 'H024' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetAttacker()) == 'H025' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetAttacker()) == 'H026' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetAttacker()) == 'H027' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetAttacker()) == 'H004' ) ) then
return true
endif
return false
endfunction
function Trig_Attack_Heroic_Heartbreak_Conditions takes nothing returns boolean
if ( not Trig_Attack_Heroic_Heartbreak_Func001C() ) then
return false
endif
return true
endfunction
function Trig_Attack_Heroic_Heartbreak_Func002C takes nothing returns boolean
if ( not ( GetItemTypeId(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00M')) == 'I00M' ) ) then
return false
endif
if ( not ( IsPlayerAlly(GetOwningPlayer(GetAttacker()), GetOwningPlayer(GetAttackedUnitBJ())) != true ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetAttacker()) != GetOwningPlayer(GetAttackedUnitBJ()) ) ) then
return false
endif
return true
endfunction
function Trig_Attack_Heroic_Heartbreak_Actions takes nothing returns nothing
if ( Trig_Attack_Heroic_Heartbreak_Func002C() ) then
call KillUnit( GetAttackedUnitBJ() )
call EnableTrigger( gg_trg_Heroic_Heartbreak )
call EnableTrigger( gg_trg_Vampires_Dead )
else
endif
endfunction
//===========================================================================
function InitTrig_Attack_Heroic_Heartbreak takes nothing returns nothing
set gg_trg_Attack_Heroic_Heartbreak = CreateTrigger( )
call DisableTrigger( gg_trg_Attack_Heroic_Heartbreak )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Attack_Heroic_Heartbreak, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Attack_Heroic_Heartbreak, Condition( function Trig_Attack_Heroic_Heartbreak_Conditions ) )
call TriggerAddAction( gg_trg_Attack_Heroic_Heartbreak, function Trig_Attack_Heroic_Heartbreak_Actions )
endfunction
JASS:
function Trig_Attack_Cannot_Attack_Actions takes nothing returns nothing
local unit Attacker = GetAttacker()
local unit Attacked = GetTriggerUnit()
//Attack Destroy Building
if IsUnitType(Attacker, UNIT_TYPE_PEON) == true then
elseif IsUnitType(Attacked, UNIT_TYPE_STRUCTURE) == true then
elseif GetOwningPlayer(Attacker) == GetOwningPlayer(Attacked) then
elseif GetUnitTypeId(Attacked) != 'h00B' then
elseif TriggerSleepAction(0.50)
elseif KillUnit(Attacked)
call TriggerSleepAction(0.50)
call KillUnit(Attacked)
//Attack Heroic Heartbreak
elseif GetUnitTypeId(Attacker) == 'H019' then
elseif GetUnitTypeId(Attacker) == 'H024' then
elseif GetUnitTypeId(Attacker) == 'H025' then
elseif GetUnitTypeId(Attacker) == 'H026' then
elseif GetUnitTypeId(Attacker) == 'H027' then
elseif GetUnitTypeId(Attacker) == 'H004' then
elseif GetItemTypeId(GetItemOfTypeFromUnitBJ(Attacker, 'I00M')) == 'I00M' then
elseif IsPlayerAlly(GetOwningPlayer(Attacker), GetOwningPlayer(Attacked) != true) then
elseif GetOwningPlayer(Attacker) != GetOwningPlayer(Attacked) then
call KillUnit(Attacked)
call EnableTrigger(gg_trg_Heroic_Heartbreak)
call EnableTrigger(gg_trg_Vampires_Dead)
//Cannot Attack Ally
elseif IsUnitType(Attacked, UNIT_TYPE_ANCIENT) == true then
elseif IsUnitAlly(Attacker, GetOwningPlayer(Attacked)) == true then
call IssueImmediateOrder(Attacker, "stop")
//UnitGroup_Vampires
elseif IsUnitInGroup(Attacked, udg_UnitGroup_Vampires) == true then
elseif IsUnitInGroup(Attacker, udg_UnitGroup_Vampires) == true then
call IssueImmediateOrder(Attacker, "stop")
//Shadow Wolf - Security Helper
elseif GetUnitTypeId(Attacker) == 'o003' then
elseif GetUnitTypeId(Attacked) != 'h00I' then
call IssueImmediateOrder(Attacker, "stop")
//Grave
elseif IsUnitInGroup(Attacker, udg_UnitGroup_Humans) == true then
elseif GetOwningPlayer(Attacker) != GetOwningPlayer(Attacked) then
elseif IsUnitAlly(Attacked, GetOwningPlayer(Attacker)) then
elseif GetUnitTypeId(Attacked) != 'u002' then
call IssueImmediateOrder(Attacker, "stop")
//Flag
elseif IsUnitInGroup(Attacker, udg_UnitGroup_Vampires) != true
call IssueImmediateOrder(Attacker, "stop")
endif
set Attacker = null
set Attacked = null
endfunction
//Flag
function Trig_Attack_Cannot_Attack1_Conditions takes nothing returns boolean
return GetUnitTypeId(GetTriggerUnit()) == 'h00B'
endfunction
//===========================================================================
function InitTrig_Attack_Cannot_Attack takes nothing returns nothing
set gg_trg_Attack_Cannot_Attack = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Attack_Cannot_Attack, EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(gg_trg_Attack_Cannot_Attack, Condition(function Trig_Attack_Cannot_Attack1_Conditions))
call TriggerAddAction(gg_trg_Attack_Cannot_Attack, function Trig_Attack_Cannot_Attack_Actions)
endfunction
Last edited: