HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to have stacking buffs.

01-09-2008, 07:20 PM#1
rain9441
I want to be be able to stack multi-level attack damage % increase buffs, but I keep running into problems, here is what I tried.

2 abilities based on Inner Fire: One cancels the other, failure.

1 ability based on inner fire, one ability based on "insert ability here" with negative damage reduction (eg cripple). Problems: Now i'm limited to 2 and i want 10, not much gained. Things like purge will remove the buff because it is a negative buff, which sucks.

Give the unit an aura based on Trueshot with 0.01 area and self target. Problems: Icon shows up. Any time you buff a unit the green +dmg flickers (annoying, unprofessional) for ALL units in the area. Ability is not dispellable and doesnt register in the count buffs routine nor removebuffs routine. Unacceptable.

Give the unit a disabled spellbook with Trueshot Aura in it, like above. Problems: Same green +dmg flickering, when you remove the spellbook it closes any spellbook that was opened, and that is unacceptable. If you only remove the trueshot aura and don't remove the spellbook then the next time you add the spellbook nothing happens. Each level of the buff must also then have its own ability because SetUnitAbilityLevel doesn't refresh aura buffs. So your stuck with either ((1 ability + 1 spellbook) * number of levels per buff) * number of buffs (in this case 9 abilities per buff), or a halfassed 4 second wait until your buff actually works right.

Anyone got any more ideas?
01-09-2008, 08:07 PM#2
Tide-Arc Ephemera
If you're good at vJass you could always give Anitarf's buff system a shot.
http://www.wc3campaigns.net/showthread.php?t=95521
01-09-2008, 08:39 PM#3
Anitarf
Quote:
Originally Posted by Tide-Arc Ephemera
If you're good at vJass you could always give Anitarf's buff system a shot.
Well, my system would only make it easier for him to do the things he is already trying to do, and they aren't working out for him.

The main issue here is what ability to use for the damage bonus. Item damage bonus abilities only add absolute damage so they suck for % bonuses (you'd need a bonus mod and a way to get the unit's base damage), auras like command or trueshot have the issues listed in the first post. Can't really think of a percent damage bonus passive ability; you could try casting a multi-level buff spell like inner fire with dummy casters whenever the buff on the unit has to go up a level.
01-09-2008, 11:45 PM#4
Burning Rose
Well the only way I know of to make a stacking spell is as such:

You base a different spell off of different buffs for each stack. I've used this a number of times and I know it works. Here's a template-type thing:

Trigger:
Trigger
Events
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 10, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
((Triggering unit) has buff SPELL BUFF[(Integer A)]) Equal to True
Collapse And - All (Conditions) are true
Collapse Conditions
(Integer A) Equal to 10
((<TARGET>) has buff <SPELL BUFF 10>) Equal to True
Collapse Then - Actions
Unit - Create 1 <DUMMY> for <PLAYER> at (Position of <TARGET>) facing Default building facing degrees
Unit - Add <SPELL>[(Integer A)] to (Last created unit)
Unit - Order (Last created unit) to <SPELL ORDER STRING> <TARGET>
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(<TARGET> has buff <SPELL BUFF 9> ) Equal to False
(<TARGET> has buff <SPELL BUFF 8> ) Equal to False
(<TARGET> has buff <SPELL BUFF 7> ) Equal to False
(<TARGET> has buff <SPELL BUFF 6> ) Equal to False
(<TARGET> has buff <SPELL BUFF 5> ) Equal to False
(<TARGET> has buff <SPELL BUFF 4> ) Equal to False
(<TARGET> has buff <SPELL BUFF 3> ) Equal to False
(<TARGET> has buff <SPELL BUFF 2> ) Equal to False
(<TARGET> has buff <SPELL BUFF 10> ) Equal to False
(<TARGET> has buff <SPELL BUFF 1> ) Equal to False
Collapse Then - Actions
Unit - Create 1 <DUMMY> for <PLAYER> at (Position of <TARGET>) facing Default building facing degrees
Unit - Add <SPELL> to (Last created unit)
Unit - Order (Last created unit) to <SPELL ORDER STRING> <TARGET>
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Else - Actions

Oh and you'll also need this:
Trigger:
Set Player Colors
Collapse Events
Map initialization
Conditions
Collapse Actions
Set SPELL BUFF[2] = <Spell Buff 9>
Set SPELL BUFF[10] = <Spell Buff 1>
Set SPELL BUFF[9] = <Spell Buff 2>
Set SPELL BUFF[8] = <Spell Buff 3>
Set SPELL BUFF[7] = <Spell Buff 4>
Set SPELL BUFF[6] = <Spell Buff 5>
Set SPELL BUFF[5] = <Spell Buff 6>
Set SPELL BUFF[4] = <Spell Buff 7>
Set SPELL BUFF[3] = <Spell Buff 8>
Set <SPELL>[10] = <SPELL #2>
Set <SPELL>[9] = <SPELL #3>
Set <SPELL>[8] = <SPELL #4>
Set <SPELL>[7] = <SPELL #5>
Set <SPELL>[6] = <SPELL #6>
Set <SPELL>[5] = <SPELL #7>
Set <SPELL>[4] = <SPELL #8>
Set <SPELL>[3] = <SPELL #9>
Set <SPELL>[2] = <SPELL #10>

The Different <SPELL #_> are for different stacks of the spell. That way if it's a Hero spell, when they learn a new rank you can just increase the level of each of those stacks with an upgrade or a trigger. It can go past Ten, Just make sure that you adjust the parts of it used for the Last stack.
01-10-2008, 01:07 PM#5
rain9441
Quote:
Originally Posted by Anitarf
Item damage bonus abilities only add absolute damage so they suck for % bonuses (you'd need a bonus mod and a way to get the unit's base damage)

Well hey, I have a bonus mod and I have all my unit's base damage, how did I overlook this? I actually have more than that, so... Theres an item defense, item attack speed, and item movement speed. The only issue is updating it upon changes then. Which I think will be OK if I don't update. All my items that increase attack damage are also known (scripted) and use bonus mod, so I could theoretically include item damage bonuses in the damage % bonus!

Anitarf you are brilliant. The only problem is its not naturally dispellable, but its the best I can do isn't it...

EDIT: Holy crap, movement speed bonus abilities with negative values dont work at all, they are permanent, even when removed! Bleah! THANK GOD FOR TORNADO SLOW AURA EH?