Rage

Lmfaocj

Active Member
Reaction score
1
Sorry this may of been asked already but I don't really know what to search for because when I did do my search all I found wars random raging and other stuff not related to what I am going to ask.

I wanted to know how to make a warriors rage I already made one but I don't think its a really good one I am using damage by jesus4lyf or how ever you spell his name.

JASS:
function Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetEventDamageSource()) == 'O003' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Warrior_Func001001 takes nothing returns boolean
    return ( GetUnitStateSwap(UNIT_STATE_MANA, GetEventDamageSource()) >= 90.00 )
endfunction

function Actions takes nothing returns nothing
    if ( Trig_Warrior_Func001001() ) then
        call SetUnitManaBJ( GetEventDamageSource(), 100.00 )
    else
        call SetUnitManaBJ( GetEventDamageSource(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetEventDamageSource()) + 3.00 ) )
    endif
endfunction

//===========================================================================
function InitTrig_Warrior takes nothing returns nothing
    local trigger t= CreateTrigger()
    call TriggerAddCondition( t, Condition( function Conditions ) )
    call TriggerAddAction( t, function Actions )
    call Damage_RegisterEvent(t)
endfunction
 

Carnerox

The one and only.
Reaction score
84
Try this and tell me if it works or not.
JASS:
scope warriorsRage initializer init
    
    private function Conditions takes nothing returns boolean
        return (GetUnitTypeId(GetEventDamageSource()) == 'O003')
    endfunction

    private function Actions takes nothing returns nothing
        if (GetUnitState(GetEventDamageSource(),UNIT_STATE_MANA) >= 90) then
            call SetUnitState(GetEventDamageSource(),UNIT_STATE_MANA,100.00)
        else
            call SetUnitState(GetEventDamageSource(),UNIT_STATE_MANA,GetUnitState(GetEventDamageSource(),UNIT_STATE_MANA) + 3.00)
        endif
    endfunction

    //===========================================================================
    private function init takes nothing returns nothing
        local trigger t= CreateTrigger()
        call TriggerAddCondition(t, Condition(function Conditions))
        call TriggerAddAction(t,function Actions)
        call Damage_RegisterEvent(t)
    endfunction
endscope
 

Lmfaocj

Active Member
Reaction score
1
oh I am sure that would work but sorry I didn't really add much detail what I really wanted. I wanted it so when you get hit it adds one rage and when you attack it adds 3 but I wanted it to do that all in one trigger if that is possible
 

Bankde

Member
Reaction score
20
Then there is two event: Get Hit, Hit
It would not be possible in GUI or Jass (Not sure in vJass or cJass)
 

XeNiM666

I lurk for pizza
Reaction score
138
it would be possible if you put enough effort to it...
now, like Bankde said, you need 2 events: GetHit and Hit, both needs registration from Damage_RegisterEvent(t)
now, to check for NORMAL ATTACKS only, use, Damage_IsAttack() == true...
In GetHit = SetMana = Mana + 1
in Hit = SetMana = Mana + 3
 

XeNiM666

I lurk for pizza
Reaction score
138
yup.
That function is from Jesus4lyf's Damage system. It checks for normal attacks PROVIDED, that you set to "true" the value "attack" in the UnitDamageTarget(), UnitDamageTargetEx() and Damage_Physical() function.
it really helped me in a lot of times.. :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top