• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] Flashbang Ability Help

Status
Not open for further replies.
Level 13
Joined
Sep 29, 2008
Messages
671
Can anyone help me with this. How can I make the flash only show on allies and enemies but not the owner of the caster I think I know how to increase the duration and if you can also remove the invisibility code I very much appreciate it. I don't know this codes I only know GUI triggers.


JASS:
function Trig_StartLightGrenade_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A01D' ) ) then
        return false
    endif
    return true
endfunction

function Trig_StartLightGrenade_Func001001003 takes nothing returns boolean
    return ( GetOwningPlayer(GetFilterUnit()) == GetOwningPlayer(GetSpellAbilityUnit()) )
endfunction

function Trig_StartLightGrenade_Func001A takes nothing returns nothing
    call UnitAddAbilityBJ( 'Agho', GetEnumUnit() )
    call GroupAddUnitSimple( GetEnumUnit(), udg_LightGrenadeGroup )
endfunction

function Trig_StartLightGrenade_Func002001 takes nothing returns boolean
    return ( GetUnitAbilityLevelSwapped('A01D', GetSpellAbilityUnit()) == 1 )
endfunction

function Trig_StartLightGrenade_Func003001 takes nothing returns boolean
    return ( GetUnitAbilityLevelSwapped('A01D', GetSpellAbilityUnit()) == 2 )
endfunction

function Trig_StartLightGrenade_Func004001 takes nothing returns boolean
    return ( GetUnitAbilityLevelSwapped('A01D', GetSpellAbilityUnit()) == 3 )
endfunction

function Trig_StartLightGrenade_Func005002 takes nothing returns nothing
    call UnitRemoveAbilityBJ( 'Agho', GetEnumUnit() )
endfunction

function Trig_StartLightGrenade_Actions takes nothing returns nothing
    local group LightGrenade_Targets
    call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUTIN, 0.5, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100.00, 100.00, 100.00, 0 )
    call ForGroupBJ( GetUnitsInRangeOfLocMatching(400.00, GetSpellTargetLoc(), Condition(function Trig_StartLightGrenade_Func001001003)), function Trig_StartLightGrenade_Func001A )
    if ( Trig_StartLightGrenade_Func002001() ) then
        call PolledWait( 4.00 )
    else
        call DoNothing(  )
    endif
    set LightGrenade_Targets = udg_LightGrenadeGroup
    if ( Trig_StartLightGrenade_Func003001() ) then
        call PolledWait( 6.00 )
    else
        call DoNothing(  )
    endif
    if ( Trig_StartLightGrenade_Func004001() ) then
        call PolledWait( 8.00 )
    else
        call DoNothing(  )
    endif
    call ForGroupBJ( LightGrenade_Targets, function Trig_StartLightGrenade_Func005002 )
endfunction

//===========================================================================
function InitTrig_StartLightGrenade takes nothing returns nothing
    set gg_trg_StartLightGrenade = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_StartLightGrenade, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_StartLightGrenade, Condition( function Trig_StartLightGrenade_Conditions ) )
    call TriggerAddAction( gg_trg_StartLightGrenade, function Trig_StartLightGrenade_Actions )
endfunction
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
If you know only GUI why did you convert your trigger to Jass?
Anyways, you use the GetLocalPlayer function. This function returns the player that the code is executing to at that moment.
I'll put it in GUI for you...
  • Set Player = Owner of Triggering Unit or whatever
  • Custom script: if GetLocalPlayer() != udg_Player then
    • put here all your code
  • Custom script: endif
 
Level 12
Joined
Mar 23, 2008
Messages
942
If you know only GUI why did you convert your trigger to Jass?
Anyways, you use the GetLocalPlayer function. This function returns the player that the code is executing to at that moment.
I'll put it in GUI for you...
  • Set Player = Owner of Triggering Unit or whatever
  • Custom script: if GetLocalPlayer() != udg_Player then
    • put here all your code
  • Custom script: endif

Uhm? Desync?
 
Status
Not open for further replies.
Top