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

How can I make death pact to give bonus damage?

Status
Not open for further replies.
Level 1
Joined
Jul 25, 2018
Messages
1
Can anyone help me? I like to make death pact give bonus damage and bonus hp. (like the clinkz' one) Do I need to make triggers for this? I have no experience on making triggers.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
It depends if you want the bonus damage and hp to be a % of the targeted unit's current hp, or if it will be static damage of some kind. The former requires either complex triggers or a system like BonusMod, but the latter can be nearly as good without requiring as much effort.

Instead of "8% current hp of target unit gained as hp and damage" you say "bonus hp and damage scales from 50+10 to 500+100 as unit target current health scales from 100 to 5500". You set a few different thresholds in the range you choose which correspond to different levels' bonuses in a modified Avatar ability that grants bonus hp+damage. I might pick 10 levels and my health range is 50 (lvl 1)->500 (lvl 10) means each level increases by (500-50)/(10-1) = 50. Note that there are 9 steps for 10 levels of spell. I get the following values:
levelhpdamagehp threshold
15010100
21002700
3150301300
4200401900
5250502500
6300603100
7350703700
8400804300
9450904900
105001005500
Then you just store these hp threshold values in an array and compare the sacrificed unit's current hp to each value, which will determine the level at which to cast the avatar spell. Temporarily enable the ability so the unit can cast it, set the level, and order it to use avatar. You add this AvatarLikeAbility to the unit's unit ability list in the Object Editor (it should work as a unit ability not just hero), and on map initialization disable it for all players
  • -------- in map init trigger --------
  • Player Group - Pick every player in (All Players) and do (Player - Disable AvatarLikeAbility for (Picked Player))
  • -------- in "unit starts the effect of an ability" trigger --------
  • Set SacHP = Current Life of (Target unit of ability being cast)
  • Loop - For each (Integer A) from 1 to SacLVLS do (actions)
    • Loop - Actions
      • If conditions then actions else actions
        • If - Conditions
          • SacHP less than SacTHRESH[(Integer A)]
        • Then - Actions
          • Set SacLEV = Max((Integer A) - 1, 0)
          • Custom script: exitwhen true //there might be a GUI equivalent for this but IDK
        • Else - Actions
  • Player - Enable (AvatarLikeAbility) for (Owner of (Triggering Unit))
  • Unit - Set level of (AvatarLikeAbility) for (Triggering Unit) to SacLEV
  • Unit - Order (Triggering Unit) to Avatar
  • Player - Disable (AvatarLikeAbility) for (Owner of (Triggering Unit))
maybe disabling it that fast doesn't allow the unit to cast it, I'm not sure.
 
Status
Not open for further replies.
Top