• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Threat System

Status
Not open for further replies.
Level 13
Joined
Mar 16, 2008
Messages
941
Hey guys.

Fixed it...^^

Dunno how it's called, but since I played WoW a long time I called it Aggro System, while thread was the english word... but thats of no importance.

For all of you that don't know what I mean:
Spell 1 deals 200 damage, so Caster 1 generates 200 aggro and gets attacked.
Spell 2 deals 500 damage, so Caster 2 generates 500 aggro. Since thats far more he gets attacked instead. With such a system you can also add values to heals and buffs and so on...

That's the system I wrote, but it's bugged.

I had 2 test abilitys,
stormbolt:
JASS:
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call AggroSystem_Add(GetSpellTargetUnit(), GetTriggerUnit(), 200)
endfunction
and siphon life:
JASS:
function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing
    call AggroSystem_Add(GetSpellTargetUnit(), GetTriggerUnit(), 500)
endfunction

Now, what happens when I cast the spells? (these are the messages that appear)
Stormbolt :
Code:
Struct is created
Aggro: 200 MaxAggro: 260
Peasant is attacking Mountainking
Yay, looks good.
Siphon Life:
Code:
Didn't find unit
Aggro: 200 MaxAggro: 260
Woot? This should be 500 and 650 and an attackchange...

Then I set UnitsSaved to 0 in the method:
Stormbolt 1:
Code:
Struct is created
Aggro: 200 MaxAggro: 260
Peasant is attacking Mountainking
Siphon Life 1:
Code:
Didn't find unit
Aggro: 500 MaxAggro: 650
No new attackorder?
Stormbolt 2:
Code:
Didn't find unit
Aggro: 500 MaxAggro: 650
Siphon Life 2:
Code:
Found unit
Aggro: 1000 MaxAggro: 1300
Stormbolt 3:
Code:
Found unit
Aggro: 1000 MaxAggro: 1300

What the hell is going on there?
I hope that someone can help me :S

Greets, Justify
 
Last edited:
Status
Not open for further replies.
Top