Kyux
Active Member
- Reaction score
- 3
Hey, i want my dude to do extra damage to undead, but regular damage to anything else. i also dont want it to be a spell, and if so, i dont miind if its from a weapon.
thanks!
thanks!
Trigger 1
Event - A unit is attacked
Condition -
Attacking unit equal to (Your hero)
Attacked unit is undead equal to true
Actions -
Set variable - UndeadUnit equal to attacked unit
Add event to (Trigger 2) UndeadUnit takes damage
Trigger 2
Events -
Conditions -
Events -
Deal damage to UndeadUnit equal to X
function Undead_Check takes nothing returns boolean
if IsUnitType(GetTriggerUnit(), UNIT_TYPE_UNDEAD) then
call TriggerRegisterUnitEvent(gg_trg_UndeadDamageBonus, GetTriggerUnit(), EVENT_UNIT_DAMAGED)
endif
return false
endfunction
function Undead_Check2 takes nothing returns boolean
if IsUnitType(GetFilterUnit(), UNIT_TYPE_UNDEAD) then
call TriggerRegisterUnitEvent(gg_trg_UndeadDamageBonus, GetFilterUnit(), EVENT_UNIT_DAMAGED)
endif
return false
endfunction
function Trig_UndeadDamageInit_Actions takes nothing returns nothing
local group g = CreateGroup()
local trigger addnewcomers = CreateTrigger()
local region R = CreateRegion()
call RegionAddRect(R, bj_mapInitialPlayableArea)
call TriggerRegisterEnterRegion(addnewcomers, R, Condition(function Undead_Check))
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, Condition(function Undead_Check2))
call DestroyGroup(g)
set g = null
set addnewcomers = null
endfunction
function InitTrig_UndeadDamageInit takes nothing returns nothing
set gg_trg_UndeadDamageInit = CreateTrigger()
call TriggerAddAction(gg_trg_UndeadDamageInit, function Trig_UndeadDamageInit_Actions)
endfunction
function Trig_UndeadDamageInit_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_UndeadDamageInit takes nothing returns nothing
set gg_trg_UndeadDamageInit = CreateTrigger( )
call TriggerAddAction( gg_trg_UndeadDamageInit, function Trig_UndeadDamageInit_Actions )
endfunction
function Undead_Check takes nothing returns boolean
if IsUnitType(GetTriggerUnit(), UNIT_TYPE_UNDEAD) then
call TriggerRegisterUnitEvent(gg_trg_UndeadDamageBonus, GetTriggerUnit(), EVENT_UNIT_DAMAGED)
endif
return false
endfunction
function Undead_Check2 takes nothing returns boolean
if IsUnitType(GetFilterUnit(), UNIT_TYPE_UNDEAD) then
call TriggerRegisterUnitEvent(gg_trg_UndeadDamageBonus, GetFilterUnit(), EVENT_UNIT_DAMAGED)
endif
return false
endfunction
function Trig_UndeadDamageInit_Actions takes nothing returns nothing
local group g = CreateGroup()
local trigger addnewcomers = CreateTrigger()
local region R = CreateRegion()
call RegionAddRect(R, bj_mapInitialPlayableArea)
call TriggerRegisterEnterRegion(addnewcomers, R, Condition(function Undead_Check))
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, Condition(function Undead_Check2))
call DestroyGroup(g)
set g = null
set addnewcomers = null
endfunction
function InitTrig_UndeadDamageInit takes nothing returns nothing
set gg_trg_UndeadDamageInit = CreateTrigger()
call TriggerAddAction(gg_trg_UndeadDamageInit, function Trig_UndeadDamageInit_Actions)
endfunction
function Trig_UndeadDamageInit_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_UndeadDamageInit takes nothing returns nothing
set gg_trg_UndeadDamageInit = CreateTrigger( )
call TriggerAddAction( gg_trg_UndeadDamageInit, function Trig_UndeadDamageInit_Actions )
endfunction
Um...ok, im going to try it now.... but why wrte the first Jass if your just deleting it?
sorry....
function Trig_UndeadDamageInit_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_UndeadDamageInit takes nothing returns nothing
set gg_trg_UndeadDamageInit = CreateTrigger( )
call TriggerAddAction( gg_trg_UndeadDamageInit, function Trig_UndeadDamageInit_Actions )
endfunction