• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Look

Status
Not open for further replies.

DeT

DeT

Level 2
Joined
Dec 27, 2006
Messages
14
It doesn't work.
I think event i used doesn't work on illusions
:witch_doc_sad:
say what's wrong?
Code:
//udg_I_Units : array of unit
//udg_I_UNum : integer
//udg_I_Buf : integer
//udg_I_Triggers : array of trigger

function I_Func takes nothing returns nothing
    if (IsUnitIllusion(GetEnumUnit())) then
        set udg_I_Units[udg_I_Buf] = GetEnumUnit()
        call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "Êëîí:" + GetUnitName(GetEnumUnit()) )
        set udg_I_Buf = udg_I_Buf + 1
        set udg_I_UNum = udg_I_UNum + 1
    else
    endif
    call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "Êîëè÷åñòâî: " + I2S(udg_I_UNum))
endfunction

function I_Damaged takes nothing returns nothing
    local effect e
    call SetUnitLifeBJ( udg_I_Units[13] , ( GetUnitStateSwap(UNIT_STATE_LIFE, udg_I_Units[13]) + GetEventDamage() ) )
    call AddSpecialEffectTargetUnitBJ( "chest", udg_I_Units[13], "Abilities\\Spells\\Other\\Silence\\SilenceAreaBirth.mdl" )
    set e = GetLastCreatedEffectBJ()
    call PolledWait( 0.50 )
    call DestroyEffectBJ( e ) 
    call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "Ñîáûòèå îáðàáîòàíî")  
endfunction

function I_CTriggers takes nothing returns nothing
    local integer a = 0
    loop
    exitwhen (a > udg_I_UNum)
        set udg_I_Triggers[a] = CreateTrigger()
        call TriggerRegisterUnitEvent( udg_I_Triggers[a], udg_I_Units[a], EVENT_UNIT_DAMAGED )
        call TriggerAddAction( udg_I_Triggers[a], function I_Damaged )
        call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "Ñîáûòèå çàðåãèñòðèðîâàíî")
        set a = a + 1
    endloop
    set a = 0
    call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "Òðèããåðû ñîçäàíû")
endfunction

function I_Search4I takes nothing returns nothing
    set udg_I_Units[13] = GetTriggerUnit()
    call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "Ãåðîé:" + GetUnitName(udg_I_Units[13]) )
    set udg_I_Buf = 0
    set udg_I_UNum = 0
    call ForGroupBJ( GetUnitsInRangeOfLocAll(900.00, GetUnitLoc(udg_I_Units[13])), function I_Func )
    call I_CTriggers()
    set udg_I_Buf = 0
    call DestroyGroup(GetLastCreatedGroup())
endfunction

PS: miss is not in func. calling in map..
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
HappyTaurnen I think his triggers make no sense.
He refers to a triggering unit in function "I_Search4I" when he does not include the event that triggers it in the script selection and thus we can not fully find the fault.

Also his structure seems semi GUI since it uses few locals and uses a sickining ammount of BJ functions. (please take no offence)
Also you did not describe what your spell is meant to do next to something to do with illusions.

I recommend learning more jass and how to use it better since although that is a good start, it is far from what jass can fully do.

Also what is with the text? Is it random or just some funny language. . .
 
Status
Not open for further replies.
Top