• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] K need BigTime help!

Status
Not open for further replies.
Level 18
Joined
Oct 18, 2007
Messages
930
ok here is my dum code
JASS:
function Demonic_Fists_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A00C'
endfunction

function Demonic_Fists_Actions takes nothing returns nothing
    local unit cast
    call UnitAddAbility(cast,'A00D')
    call UnitAddAbility(cast,'A00G')
    call UnitAddAbility(cast,'A00E')
    call SetUnitAbilityLevelSwapped( 'A00D', cast, GetUnitAbilityLevelSwapped('A00C', cast) )
    call SetUnitAbilityLevelSwapped( 'A00G', cast, GetUnitAbilityLevelSwapped('A00C', cast) )
    call SetUnitAbilityLevelSwapped( 'A00E', cast, GetUnitAbilityLevelSwapped('A00C', cast) )
    if GetBooleanAnd(GetUnitAbilityLevelSwapped('A00D', cast) > 1,GetBooleanAnd(GetUnitAbilityLevelSwapped('A00G', cast) > 1,GetUnitAbilityLevelSwapped('A00E', cast) > 1)) then
    call BJDebugMsg("All abilities Good")
    endif
    set cast = null
endfunction

//===========================================================================
function InitTrig_Demonic_Fists takes nothing returns nothing
    local trigger T = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( T, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( T, Condition( function Demonic_Fists_Conditions ) )
    call TriggerAddAction( T, function Demonic_Fists_Actions )
    set T = null
endfunction

+

JASS:
function Demonic_Fists_Remove_Conditions takes nothing returns boolean
    return GetIssuedOrderIdBJ() == String2OrderIdBJ("unimmolation")
endfunction

function Demonic_Fists_Remove_Actions takes nothing returns nothing
    local unit cast = GetOrderedUnit()
    if  GetUnitAbilityLevelSwapped('A00C', cast) > 1 then
        call UnitRemoveAbility(cast,'A00D')
        call UnitRemoveAbility(cast,'A00G')
        call UnitRemoveAbility(cast,'A00E')
    endif
    set cast = null
endfunction

//===========================================================================
function InitTrig_Demonic_Fists_Remove takes nothing returns nothing
    local trigger T = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( T, EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddCondition( T, Condition( function Demonic_Fists_Remove_Conditions ) )
    call TriggerAddAction( T, function Demonic_Fists_Remove_Actions )
endfunction

So why does not the BJDebugMsg show up?? what did i do wrong?? some help please
 
Level 5
Joined
Jan 6, 2006
Messages
106
The problem lies on this line.

JASS:
    if GetBooleanAnd(GetUnitAbilityLevelSwapped('A00D', cast) > 1,GetBooleanAnd(GetUnitAbilityLevelSwapped('A00G', cast) > 1,GetUnitAbilityLevelSwapped('A00E', cast) > 1)) then
    call BJDebugMsg("All abilities Good")
    endif

You cannot link multiple conditions with commas. You need to insert them in seperate lines.

JASS:
if ( GetUnitAbilityLevelSwapped('A00D', cast) > 1 ) then
    if ( GetUnitAbilityLevelSwapped('A00G', cast) > 1 ) then
        if ( GetUnitAbilityLevelSwapped('A00E', cast) > 1 ) then
            call BJDebugMsg("All abilities Good")
        endif
    endif
endif

Hope this helps. :)

------------------------------------
Edited; sorry, forgot to remove the GetBooleanAnd
 
Last edited:
Status
Not open for further replies.
Top