How Add Damage To Unit?

Salaramon

New Member
Reaction score
0
I have started learning JASS :D, and the best way to learn it for me is making what i want to make. So i am totally nub in JASS :D


So i just wonder how do i make a JASS trigger that add damage to unit:
JASS:
function Trig_Add_Damage_Conditions takes nothing returns boolean
    if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I003' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Add_Damage_Actions takes nothing returns nothing
endfunction

//===========================================================================
function InitTrig_Add_Damage takes nothing returns nothing
    set gg_trg_Add_Damage = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Add_Damage, EVENT_PLAYER_UNIT_PICKUP_ITEM )
    call TriggerAddCondition( gg_trg_Add_Damage, Condition( function Trig_Add_Damage_Conditions ) )
    call TriggerAddAction( gg_trg_Add_Damage, function Trig_Add_Damage_Actions )
endfunction

Converted and copied this, so what next, just missing the action function?
 

_whelp

New Member
Reaction score
54

Salaramon

New Member
Reaction score
0
JASS:
call UnitDamageTarget(unit, target, ...)

I'm feeling it is missing something: call UnitDamageTarget(unit, target, ...) <- like i said i am totally nub xD, that means i don't even know basics of JASS if this is it, so what more?

JASS:
function Trig_Add_Damage_Conditions takes nothing returns boolean
    if ( not ( GetItemTypeId(GetManipulatedItem()) == &#039;I003&#039; ) ) then
        return false
    endif
    return true
endfunction

function Trig_Add_Damage_Actions takes nothing returns nothing
    call UnitDamageTarget(unit, target, ...)
endfunction
 

Anachron

New Member
Reaction score
53
Aww lol! Sorry... I missunderstood you!

BonusMod.
(Can apply damage, armor, lifereg, manareg, sightrange, agy, int, str, etc)
 

LearningCode

New Member
Reaction score
24
WAIT!!!!!

No using tomes.
They leak and are funky.

I was told that, lol.
Give them the ability of the tomes instead.
(I have yet to try it out myself)

I think it's [lJASS]UnitAddAbility(unit, abilcode)[/lJASS]
 

Sickle

New Member
Reaction score
13
No. No matter what the model is, it leaks. The tome just happens to lag faster because it has more polygons than model-less tomes. There are three systems or so that remove tome leaks.
 
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