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

Spell Help!?

Status
Not open for further replies.
Level 2
Joined
Sep 10, 2007
Messages
16
I was wondering how you do spells that are based on the heroes' attributes. For example in Dota the Morphlings Adaptive Strike. Please help me :hohum:
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
For the most part, you use a Dummy Ability (ability with no effects, but is castable, has mana costs, the correct tooltip, icon, cooldown, targets, etc), then you use triggers to detect when that ability is cast.

Then, you simulate the effect of the ability through triggers, perhaps through other abilities and perhaps solely through triggers.

The action Unit - Damage Target can be used to deal any amount of damage, and since you can retrieve values such as the stats of a hero, this can be used to cause stat-based damage, among other things.
 
Level 2
Joined
Sep 10, 2007
Messages
16
Does the dummy spell need to have no damage. I was looking for a spell that does base damage and the heroes' stats just boost its damage. Thats for the help :thumbs_up:.
 
Level 2
Joined
Sep 10, 2007
Messages
16
Alright thanks. I'm still getting the hang of spell triggers and dummy spells.:grin:

*UPDATE*
Sorry i didnt put this in the original post but how would you make it so the multipler would get stronger the more ranks in the spell?
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Unit - Level of Ability for Unit (it's also an integer, so you need to use Convert integer to Real inside Unit - Damage Target)

Eg; you could do

Unit - Cause ... to damage ..., dealing ((100 * Real((Level of Super Stat Blast for (Triggering Unit)))) + ((2+Real((Level of Super Stat Blast for (Triggering Unit))) * Real((Strength of (Triggering Unit)))) ...

Which would cause 100*level + (2+level)*strength

in damage (a little overpowered, yes :p)
 
Level 7
Joined
Sep 9, 2007
Messages
253
Here is a trigger I made yesterday for an heal ability based off a percentage of the casters mana, i think making your spell could look very similar to mine but using strength instead of current mana.

Mend
Heals a target friendly unit, this spell gains bonus healing based off Shindo's current mana.

|cffffcc00Level 1|r - 100 + 35% of mana.
|cffffcc00Level 2|r - 175 + 40% of mana.
|cffffcc00Level 3|r - 250 + 45% of mana.
|cffffcc00Level 4|r - 350 + 40% of mana.


  • PS Mend
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mend PS
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Mend PS for (Casting unit)) Equal to 1
        • Then - Actions
          • Set MendReal = (100.00 + ((Mana of (Casting unit)) x 0.35))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Mend PS for (Casting unit)) Equal to 2
            • Then - Actions
              • Set MendReal = (175.00 + ((Mana of (Casting unit)) x 0.40))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Mend PS for (Casting unit)) Equal to 3
                • Then - Actions
                  • Set MendReal = (250.00 + ((Mana of (Casting unit)) x 0.45))
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Mend PS for (Casting unit)) Equal to 4
                    • Then - Actions
                      • Set MendReal = (350.00 + ((Mana of (Casting unit)) x 0.50))
                    • Else - Actions
                      • Do nothing
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + MendReal)
      • Set MendInteger = (Integer(MendReal))
      • Floating Text - Create floating text that reads (String(MendInteger)) above (Target unit of ability being cast) with Z offset 0.00, using font size 10.00, color (20.00%, 80.00%, 20.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 10.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Floating Text - Set the velocity of (Last created floating text) to 32.00 towards 90.00 degrees
      • Set MendReal = 0.00
      • Set MendInteger = 0

The dummy ability does no healing it just costs mana. Im sure this trigger could be done more efficiently, but i fiddled for a bit and it seems to work nicely. What it does is sets a Real Variable "MendReal" (i was unable to retrieve the casters current mana using integer) which takes the level of the ability and the casters current mana into account. Then adds the real value stored in "MendReal" and adds that amount of life to the target unit.

I also created floating text, i think its a good idea to do this where the magnitude of the spell can vary like this without you knowing what the result is. But using the Real variable "MendReal" in the floating text displayed three decimal places, eg "Heal for 205.000", so instead i made an Integer variable "MendInteger" and it is set to the same value as "MendReal" (to the nearest whole number of course as it is an integer after all) now that this second variable is the same value as the first variable i can use it for the floating text, and it will display the value as a whole number instead of showing decimal places.
 
Last edited:
Status
Not open for further replies.
Top