1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[JASS] Opinion and help about spells

Discussion in 'Triggers & Scripts' started by Flame_Phoenix, Sep 14, 2007.

  1. PurplePoot

    PurplePoot

    Joined:
    Dec 14, 2005
    Messages:
    11,161
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    There are still flaws, I just made it work;

    Code (vJASS):
    function IcyAura_Conds takes nothing returns boolean
        local integer ICchance
        local integer lv = GetUnitAbilityLevel(GetFilterUnit(), 'B01G')
        if lv == 1 then
            set ICchance = 5
        elseif lv == 2 then
            set ICchance = 10
        elseif lv == 3 then
            set ICchance = 15
        endif
        return lv > 0 and GetRandomInt(1, 100) <= ICchance
    endfunction
    //==========================================================================
    function IcyAura_Acts takes nothing returns nothing
        local effect e
        local unit en
        local unit dum
        local integer lvl = GetUnitAbilityLevel(GetFilterUnit(), 'B01G')
        if lvl == 1 then
            set en = GetEnumUnit()
            call AddSpecialEffect("Doodads\\Cinematic\\FrostTrapUp\\FrostTrapUp.mdl", GetUnitX(en), GetUnitY(en))
            set dum = CreateUnit(Player(0), 'h01H', GetUnitX(en), GetUnitY(en), 0)
            call UnitApplyTimedLife(dum, 'BTLF', 2.00)
            call UnitAddAbility(dum, 'A02K')
            call SetUnitAbilityLevel(dum, 'A02K', 1)
            call IssueTargetOrder(dum, "thunderbolt", en)
            call TriggerSleepAction(3.0)
            call DestroyEffect(e)
        elseif lvl == 2 then
            set en = GetEnumUnit()
            call AddSpecialEffect("Doodads\\Cinematic\\FrostTrapUp\\FrostTrapUp.mdl", GetUnitX(en), GetUnitY(en))
            set dum = CreateUnit(Player(0), 'h01H', GetUnitX(en), GetUnitY(en), 0)
            call UnitApplyTimedLife(dum, 'BTLF', 2.00)
            call UnitAddAbility(dum, 'A02K')
            call SetUnitAbilityLevel(dum, 'A02K', 2)
            call IssueTargetOrder(dum, "thunderbolt", en)
            call TriggerSleepAction(3.0)
            call DestroyEffect(e)
        elseif lvl == 3 then
            set en = GetEnumUnit()
            call AddSpecialEffect("Doodads\\Cinematic\\FrostTrapUp\\FrostTrapUp.mdl", GetUnitX(en), GetUnitY(en))
            set dum = CreateUnit(Player(0), 'h01H', GetUnitX(en), GetUnitY(en), 0)
            call UnitApplyTimedLife(dum, 'BTLF', 2.00)
            call UnitAddAbility(dum, 'A02K')
            call SetUnitAbilityLevel(dum, 'A02K', 3)
            call IssueTargetOrder(dum, "thunderbolt", en)
            call TriggerSleepAction(3.0)
            call DestroyEffect(e)
        endif
        set e = null
        set en = null
        set dum = null  
    endfunction
    //==========================================================================
    function Icy_Aura_GroupCall takes nothing returns nothing
        call ForGroup( GetRandomSubGroup(1, GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function IcyAura_Conds))), function IcyAura_Acts )
    endfunction
    //===========================================================================
    function InitTrig_Icy_Aura takes nothing returns nothing
        local trigger IcyAura = CreateTrigger(  )
        call TriggerRegisterTimerEventPeriodic( IcyAura, 2 )
        call TriggerAddCondition(IcyAura, Condition(function IcyAura_Conds))
        call TriggerAddAction( IcyAura, function Icy_Aura_GroupCall )
        set IcyAura = null
    endfunction
     
  2. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    mmm, what did you change ??? I see you removed the BJ, but that's the only thing you did correct ?
     
  3. PurplePoot

    PurplePoot

    Joined:
    Dec 14, 2005
    Messages:
    11,161
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    I fixed all the compile errors. (Brackets in bad places, >0 in integers, so on)
     
  4. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    mmm thx by the help. But i still have 1 error.

    Code (vJASS):
    function IcyAura_Conds takes nothing returns boolean
        local integer ICchance
        local integer lv = GetUnitAbilityLevel(GetFilterUnit(), 'B01G')
        if lv == 1 then
            set ICchance = 5
        elseif lv == 2 then
            set ICchance = 10
        elseif lv == 3 then
            set ICchance = 15
        endif
        return lv > 0 and GetRandomInt(1, 100) <= ICchance
    endfunction
    //==========================================================================
    function Icy_Aura_GroupCall takes nothing returns nothing
        call ForGroup( GetRandomSubGroup(1, GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function IcyAura_Conds))), function IcyAura_Acts )
    endfunction
    //==========================================================================
    function IcyAura_Acts takes nothing returns nothing
        local effect e
        local unit en
        local unit dum
        local integer lvl = GetUnitAbilityLevel(GetFilterUnit(), 'B01G')
        if lvl == 1 then
            set en = GetEnumUnit()
            call AddSpecialEffect("Doodads\\Cinematic\\FrostTrapUp\\FrostTrapUp.mdl", GetUnitX(en), GetUnitY(en))
            set dum = CreateUnit(Player(0), 'h01H', GetUnitX(en), GetUnitY(en), 0)
            call UnitApplyTimedLife(dum, 'BTLF', 2.00)
            call UnitAddAbility(dum, 'A02K')
            call SetUnitAbilityLevel(dum, 'A02K', 1)
            call IssueTargetOrder(dum, "thunderbolt", en)
            call TriggerSleepAction(3.0)
            call DestroyEffect(e)
        elseif lvl == 2 then
            set en = GetEnumUnit()
            call AddSpecialEffect("Doodads\\Cinematic\\FrostTrapUp\\FrostTrapUp.mdl", GetUnitX(en), GetUnitY(en))
            set dum = CreateUnit(Player(0), 'h01H', GetUnitX(en), GetUnitY(en), 0)
            call UnitApplyTimedLife(dum, 'BTLF', 2.00)
            call UnitAddAbility(dum, 'A02K')
            call SetUnitAbilityLevel(dum, 'A02K', 2)
            call IssueTargetOrder(dum, "thunderbolt", en)
            call TriggerSleepAction(3.0)
            call DestroyEffect(e)
        elseif lvl == 3 then
            set en = GetEnumUnit()
            call AddSpecialEffect("Doodads\\Cinematic\\FrostTrapUp\\FrostTrapUp.mdl", GetUnitX(en), GetUnitY(en))
            set dum = CreateUnit(Player(0), 'h01H', GetUnitX(en), GetUnitY(en), 0)
            call UnitApplyTimedLife(dum, 'BTLF', 2.00)
            call UnitAddAbility(dum, 'A02K')
            call SetUnitAbilityLevel(dum, 'A02K', 3)
            call IssueTargetOrder(dum, "thunderbolt", en)
            call TriggerSleepAction(3.0)
            call DestroyEffect(e)
        endif
        set e = null
        set en = null
        set dum = null  
    endfunction
    //===========================================================================
    function InitTrig_Icy_Aura takes nothing returns nothing
        local trigger IcyAura = CreateTrigger(  )
        call TriggerRegisterTimerEventPeriodic( IcyAura, 2 )
        call TriggerAddCondition(IcyAura, Condition(function IcyAura_Conds))
        call TriggerAddAction( IcyAura, function Icy_Aura_GroupCall )
        set IcyAura = null
    endfunction


    In
    Code (vJASS):
    function Icy_Aura_GroupCall takes nothing returns nothing
        call ForGroup( GetRandomSubGroup(1, GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function IcyAura_Conds))), function IcyAura_Acts )
    endfunction

    It says i have an undefined function ... what is that supposed to mean !?
     
  5. PurplePoot

    PurplePoot

    Joined:
    Dec 14, 2005
    Messages:
    11,161
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    It means you didn't use my code ><

    The actions need to be above the ForGroup().
     
  6. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    OMG lol ... mmmm thing is i think i copied that section .... still i will have a look on it again. I refuse to simple copy paste your script, i want to learn it, so i try to find what mine has wrong and i try to correct it. Problem is, that perhaps it is not such a great idea :p
     
  7. PurplePoot

    PurplePoot

    Joined:
    Dec 14, 2005
    Messages:
    11,161
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    Heh, it's fine, the first part was a joke :p
     
  8. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    arrghhh now i understand what i did wrong !!! i can't believe i did such a basic error lol ... thx for help =) Maybe soon i will post some really complicated spells, that i need to make MUI.

    EDIT it seems that the aura doesn't work at all now ... i will have a better look on that soon.

    EDIT EDIT: The aura doesn't work now (again lol) ... It seems that the computer doesn't know who has the buff ... How do i change that ??? use booleans instead of intergers ?? i may post a solution soon for you to evaluate. plz.
     
    Last edited: Sep 29, 2007
  9. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    Guys, it has been a while, have any idea about how to solve my problem plz !?
     
  10. HINDYhat

    HINDYhat

    Joined:
    Apr 22, 2007
    Messages:
    1,594
    Resources:
    3
    Maps:
    2
    Spells:
    1
    Resources:
    3
    Hrm..

    In IceAura_Acts, shouldn't the lvl be this instead??
    Code (vJASS):
    local integer lvl = GetUnitAbilityLevel(GetEnumUnit(), 'B01G')
     
  11. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    MM i make now idea. The GetLevel thing id from "UnitHasBuffBJ" which simplified gets "UnitAbilityLevel bla bla". But i will try it. thx

    EDIT Well, it still doesn0t work ... any idea why ?!
     
    Last edited: Oct 6, 2007