NoobImbaPro
You can change this now in User CP.
- Reaction score
- 60
Guys I want to make an ability that after activation the caster has increased attack speed and damage for 5 attacks. At 5th attack the target is slowed by 30 ms/as.
The problem if that as and damage bonus doesn't go to hero and from the first attack the curse is applied. Here is the trigger:
The problem if that as and damage bonus doesn't go to hero and from the first attack the curse is applied. Here is the trigger:
JASS:
scope Damage initializer init
globals
integer AC4 = 039;WA03039;
integer AD = 039;WATT039;
integer AS = 039;ATTS039;
integer SLOW = 039;DSLO039;
integer a = 1
group g = CreateGroup()
integer array that
endglobals
//===========================================================================
private function Actions takes nothing returns nothing
local unit ut = GetTriggerUnit()
local integer b = GetUnitAbilityLevel(ut,AC4)
call SetUnitUserData(ut,a)
call GroupAddUnit(g, ut)
set that[a]=5
set a = a + 1
call SetUnitAbilityLevel(ut, AD, b)
set ut = null
endfunction
//===========================================================================
private function Actions2 takes nothing returns nothing
local unit ut = GetTriggerDamageSource()
local integer a = GetUnitUserData(ut)
if that[a] == 1 then
call IssueTargetOrder( DUMMY , "slow", GetTriggerUnit())
call UnitRemoveAbility(ut, AD)
call UnitRemoveAbility(ut, AS)
call GroupRemoveUnit(g, ut)
endif
set ut = null
set that[a] = that[a] - 1
endfunction
//===========================================================================
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == AC4
endfunction
//===========================================================================
private function Conditions2 takes nothing returns boolean
local integer a = GetUnitUserData(GetTriggerDamageSource())
return GetTriggerDamageType() == DAMAGE_TYPE_ATTACK and that[a]!= 0
endfunction
//===========================================================================
private function init takes nothing returns nothing
local trigger CC = CreateTrigger()
local trigger CCB = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( CC, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( CC, function Actions )
call TriggerAddCondition( CC, function Conditions)
call TriggerRegisterDamageEvent(CCB, 2)
call TriggerAddAction( CCB, function Actions2)
call TriggerAddCondition( CCB, function Conditions2)
endfunction
endscope