wewso
New Member
- Reaction score
- 11
Hi everyone. I am having problem with triggering DoTs and haven't found any solution yet so I hope you can help me.
I want to have a spell named Corruption that deals damage every 3 seconds for 18 seconds. (Like the one in WOW) I don't want to use any Globals or dummies and just one triggerfor the spell. I have tried these things and none works.
The problem appears to be that WE can't detect the Target of ability being cast after waiting seconds. So maybe only jass can help here with some locals, but i dont know jass well so can you please write it for me.
Thank you in advance.
Wewso
I want to have a spell named Corruption that deals damage every 3 seconds for 18 seconds. (Like the one in WOW) I don't want to use any Globals or dummies and just one triggerfor the spell. I have tried these things and none works.
JASS:
function Trig_Corruption_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 039;A007039; ) ) then
return false
endif
return true
endfunction
function Trig_Corruption_Func002C takes nothing returns boolean
local unit target = GetSpellTargetUnit()
if ( not ( UnitHasBuffBJ(target, 039;B001039;) == true ) ) then
return false
endif
return true
endfunction
function Trig_Corruption_Actions takes nothing returns nothing
local unit target = GetSpellTargetUnit()
if ( Trig_Corruption_Func002C() ) then
set udg_REAL = GetRandomReal(105.00, 125.00)
call UnitDamageTargetBJ( GetTriggerUnit(), target, udg_REAL, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_DEATH )
call CreateTextTagUnitBJ( R2S(udg_REAL), target, 0, 10, 100, 0.00, 100, 0 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 64, 90 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 1.50 )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 1.00 )
else
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_138" )
return
endif
call TriggerSleepAction( 3.00 )
call TriggerExecute( GetTriggeringTrigger() )
endfunction
Code:
Corruption Effect
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Corruption
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) has buff Corruption Warlock) Equal to True
Then - Actions
Set REAL = (Random real number between 105.00 and 125.00)
Game - Display to (All players) the text: (String(REAL))
Unit - Cause Hero[(Player number of (Owner of (Attacking unit)))] to damage (Triggering unit), dealing REAL damage of attack type Magic and damage type Death
Floating Text - Create floating text that reads (String(REAL)) above (Target unit of ability being cast) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Else - Actions
Skip remaining actions
Wait 3.00 seconds
Trigger - Run (This trigger) (ignoring conditions)
JASS:
function Trig_looooooooop_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 039;A007039; ) ) then
return false
endif
return true
endfunction
function Trig_looooooooop_Actions takes nothing returns nothing
local unit target = GetSpellTargetUnit()
call UnitDamageTargetBJ( target, GetSpellTargetUnit(), 100.00, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_DEATH )
call TriggerSleepAction( 2 )
call UnitDamageTargetBJ( target, GetSpellTargetUnit(), 100.00, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_DEATH )
call TriggerSleepAction( 2 )
call UnitDamageTargetBJ( target, GetSpellTargetUnit(), 100.00, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_DEATH )
call TriggerSleepAction( 2 )
endfunction
The problem appears to be that WE can't detect the Target of ability being cast after waiting seconds. So maybe only jass can help here with some locals, but i dont know jass well so can you please write it for me.
Thank you in advance.
Wewso