• 🏆 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] Beserk / Unholy Frenzy on a unit

Status
Not open for further replies.
Level 3
Joined
Jul 15, 2007
Messages
36
Hi all :grin:

Once again, I am puzzled;

I am trying to run a function that takes a unit then damages it over time and reduces it's armour (or increases the damage delt)

i have tried:

  • Custom ability based on beserk to do increase damage when hit - when i get a unit to order this on itself, it loses it's previous move order
  • Custom ability based on Unholy Frenzy - can't get the unit to even cast it on itself, nor to get a dummy unit to cast it on the target unit
  • My allowed targets on both is: enemy, air, ground.

I know I can do the DoT via timers, but what about the armour reduction / damage increase?

My attempt at using the dummy to do the work:

JASS:
function Scorched_Actions takes unit u, integer level returns nothing
    local unit dummy = CreateUnit(Player(0), 'h005', GetUnitX(u), GetUnitY(u), 270)
    if level == 1 then
        call UnitAddAbility(dummy, 'A027')
        call UnitAddAbility(dummy, 'A028')
        call IssueTargetOrder(dummy, "berserk", u)
        call IssueTargetOrder(dummy, "unholyfrenzy", u)
        call UnitRemoveAbility(dummy, 'A027')
        call UnitRemoveAbility(dummy, 'A028')
    elseif level == 2 then
        call UnitAddAbility(dummy, 'A029')
        call UnitAddAbility(dummy, 'A02A')
        call IssueTargetOrder(dummy, "berserk", u)
        call IssueTargetOrder(dummy, "unholyfrenzy", u)
        call UnitRemoveAbility(dummy, 'A029')
        call UnitRemoveAbility(dummy, 'A02A')
    elseif level == 3 then
        call UnitAddAbility(dummy, 'A02B')
        call UnitAddAbility(dummy, 'A02C')
        call IssueTargetOrder(dummy, "berserk", u)
        call IssueTargetOrder(dummy, "unholyfrenzy", u)
        call UnitRemoveAbility(dummy, 'A02B')
        call UnitRemoveAbility(dummy, 'A02C')
    elseif level == 4 then
        call UnitAddAbility(dummy, 'A02D')
        call UnitAddAbility(dummy, 'A02E')
        call IssueTargetOrder(dummy, "berserk", u)
        call IssueTargetOrder(dummy, "unholyfrenzy", u)
        call UnitRemoveAbility(dummy, 'A02D')
        call UnitRemoveAbility(dummy, 'A02E')
    elseif level == 5 then
        call UnitAddAbility(dummy, 'A02F')
        call UnitAddAbility(dummy, 'A02G')
        call IssueTargetOrder(dummy, "berserk", u)
        call IssueTargetOrder(dummy, "unholyfrenzy", u)
        call UnitRemoveAbility(dummy, 'A02F')
        call UnitRemoveAbility(dummy, 'A02G')
    elseif level == 6 then
        call UnitAddAbility(dummy, 'A02H')
        call UnitAddAbility(dummy, 'A02I')
        call IssueTargetOrder(dummy, "berserk", u)
        call IssueTargetOrder(dummy, "unholyfrenzy", u)
        call UnitRemoveAbility(dummy, 'A02H')
        call UnitRemoveAbility(dummy, 'A02I')
    endif
    call TriggerSleepAction(0.2)
    call KillUnit(dummy)
    call RemoveUnit(dummy)
endfunction

Cheers and Thank-you!:infl_thumbs_up:
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
By the way

A) if you kill the dummy, you don't need to remove it (and vice versa)
B) Instead of all those abilities, use SetUnitAbilityLevel with 6-leveled abilities
C) you can't cast both spells at once from one dummy, most likely
D) berserk is self-targeting
E) use UnitApplyTimedLife as opposed to waiting and then removing/killing
 
Last edited:
Level 3
Joined
Jul 15, 2007
Messages
36
Ty for comments.

decided to "aim lower" - just simple trigger damage, and remembered the "faerie fire" ability and based it off that.
Thanks PP!
 
Status
Not open for further replies.
Top