• 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.

[Trigger] A little help with the a triggered spell

Status
Not open for further replies.
Level 7
Joined
Aug 29, 2007
Messages
336
I was in the middle of making a spell, giving bonus damage to a unit.
The tricky part is it is needed to be based on the hero's strenght.
I thought it wouldn't be much of a deal but after looking for quite a while I couldn't find a trigger giving the unit bonus damage.
So my question to you people is; is this spell possible?
 
Level 4
Joined
Mar 6, 2008
Messages
73
Well what he meant by that..

making the bonus damage based on the Hero's strength does require some work. First you need to copy any one of the item's damage ability (e.g. claws of attack) and give it a LOT of levels.

CONDITION - [Integer (or real?)] Hero's strength = 20
ACTION - [Unit - ] Set level of [Bonus Damage ability] to _ <----- place number here.

Now if you want this to range 'smoothly', you must create lots and lots of levels for the damage ability.
 
Basically, make an ability based on item damage bonus + 15 (or whatever), turn it into a normal ability, add about 200 levels with damage bonuses of 1 through 200 (or whatever you want), and in the trigger, do
unit add ability (your dummy ability)
set ability level (your dummy ability, Real(get level of dummy ability for your unit)*your unit's strength)
 
Level 7
Joined
Jul 20, 2008
Messages
377
It may also help instead to use these item abilities with 9 levels each, and each ability would represent a digit. You would then add them in combinations to give the desired bonus damage without having to resort to many levels for each ability.

You would have an ability which has 9 levels and gives +1 damage per level. Another ability has 9 levels, but gives +10 per level.

If I wanted +52, I would just set the first ability level to 2, and the second ability level to 5. Simple, no?
 

Rmx

Rmx

Level 19
Joined
Aug 27, 2007
Messages
1,164
Well i say make a triger whenever a unit attack it will deal the amount of strenght to the attacked unit BUT it will not show the damage in the game like 55 - 65 +23 it will not show the +23 this triger is like URSA in DOTA his 3rd skill but now it's renewed :p
 
There is a slight problem with your idea, Rmx - when a trigger detects "when a unit is attacked", it means when it's ABOUT to attack. It can still be stopped before it actually does attack. Your way would bug when this happens. The only way to solve that is to use a damage detection engine, which, unfortunately, are only available in Jass.
 
Level 20
Joined
Oct 21, 2006
Messages
3,230
Make item with 100 levels.
- Level 1 - 1dmg
- Level 2 - 2dmg
- ...

Unit uses ability
Add ability DAMAGE to triggering unit
Set level of DAMAGE for triggering unit to Real(Strenght of triggering unit)
Wait 10.00 seconds
Remove DAMAGE from triggering unit
 
Level 7
Joined
Jul 20, 2008
Messages
377
It may also help instead to use these item abilities with 9 levels each, and each ability would represent a digit. You would then add them in combinations to give the desired bonus damage without having to resort to many levels for each ability.

You would have an ability which has 9 levels and gives +1 damage per level. Another ability has 9 levels, but gives +10 per level.

If I wanted +52, I would just set the first ability level to 2, and the second ability level to 5. Simple, no?

This system is much more efficient and allows for greater ranges of bonus damage without significant detrimental effect to performance (albeit a pre-loading time).
 
Level 7
Joined
Aug 29, 2007
Messages
336
Thanks alot people. I knew I could count on you.
+Rep to the ones who helped :wink:
Okay, so here is the trigger
  • Events
  • Unit - A unit Begins casting a spell
  • Conditions
  • (Ability Being Cast) Equal to Armor of Darkness
  • Set AOD_Caster = (Casting Unit)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • Or - Any (Conditions) are true
  • Conditions
  • (Unit-type of (Target unit of ability being cast) Equal to Ancient Warrior (Level 1)
  • (Unit-type of (Target unit of ability being cast) Equal to Ancient Warrior (Level 2)
  • (Unit-type of (Target unit of ability being cast) Equal to Ancient Warrior (Level 3)
  • (Unit-type of (Target unit of ability being cast) Equal to Ancient Warrior (Level 4)
  • Then - Actions
  • Set AOD_Strenght = (Real((Strenght of AOD_Caster (Include Bonuses))))
  • Set AOD_Target = (Target unit of ability being cast)
  • Unit - Add AOD to AOD_Target
  • Unit - Set level of AOD for AOD_Target to ((Integer(AOD_Strenght)) +0)
  • Wait - 10.00 seconds
  • Unit - Remove AOD from AOD_Target
  • Else - Actions
  • Do Nothing
But it lacks like hell the first time it's used. Anyone got an idea how to stop that?
 
Last edited:
Level 7
Joined
Jul 20, 2008
Messages
377
Like I said, there's gonna be preloading time. Just reserve a bit of time at the beginning of the game to pre-load that ability.
 
Level 7
Joined
Aug 29, 2007
Messages
336
Like I said, there's gonna be preloading time. Just reserve a bit of time at the beginning of the game to pre-load that ability.

Ow yea. Missed that part. Thanks again :grin:
BTW, do you guys think I should upload this to the spell section, or is it too simple?
 
Level 7
Joined
Aug 29, 2007
Messages
336
That's what I thought.
But thanks to everybody. This really helped me and my map :thumbs_up:
*Thread Solved*
 
Level 7
Joined
Aug 29, 2007
Messages
336
sry, in some sections of gui i still do not know anything

how do i preload something and what does it do? ^^
As far as I know preloading is made by just waiting for the trigger to be loaded.
This is done because this spell (and others) will lack in the beginning. Waiting a little will prevent this, if I've understood correctly :p
 
Status
Not open for further replies.
Top