• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

(Request!) New Mana Burn

Status
Not open for further replies.
Level 4
Joined
Jul 2, 2008
Messages
50
It would be nice if anyone can help me with this trigger, credits will be given of course.


Mana Burn:

Sends a bolt of negative energy that burns a target enemy unit's life and mana by 5 times the target's intelligence. Stuns the target for 2 second if its mana is depleted to 0.


Note:
-Burns the same amount of mana burned to life.
-Stun target if mana is burned to 0.
 
Level 4
Joined
Jul 2, 2008
Messages
50
Actually I am more interested in knowing how to make it instead of having someone directly make it for me. Thanks anyways I didn't catch the request Section in the Forum.
 
This could be made really easily ^^

If you use the regular mana drain spell, just null it
  • Events
    • Unit uses an ability
  • Conditions
    • Ability = mana drain
  • Action
    • If then else multiple function
      • Conditions
        • Mana of Targeted unit greater than = Arithmatic((Intelect of casting) unit x5)
      • Then
        • Unit - Set mana of targeted unit to arithmatic(mana of targeted unit - Arithmatic(intelect of Casting unit) x5))
        • Else
          • Unit - Set mana of unit targeted unit = 0
          • Set TargetMoveSpeed = unit movment speed
          • Unit - set movement speed = 0
          • Wait 2 seconds
          • Unit - set movement speed = TargetMoveSpeed
Thats just with out looking at triggers just doing it in my head, but you should be able to get something like that to work.
 
A bit of math and logic for the mana burn part and if/then/else dummy order to stormbolt for the stun part.

This shouldn't be so hard to make ;)

since i have time I'll write up the process:

-Event units starts the effect of an ability
-Condition ability being cast...
-Actions
Set all the needed variables here:
Caster = triggering unit [unit]
Target = targeted unit of ability being cast [unit]
Damage factor = 5 [real]
Attribute = intelligence of Caster [integer]
Damage = Damage factor x Attribute [real]
Dummy ability = storm bolt [ability]
Current mana = current mana of Target
-------
Execution:

set mana of Target to mana of Target - Damage [unit - set mana to value]

if

Current mana is less than or equal to Damage

then

cause Caster to damage Target dealing Current mana damage [damage unit]

else


cause Caster to damage Target dealing Damage damage [damage unit]

If/Then/else

If
mana of Target is equal to 0 [integer]
Then
set Loc = position of Target
 
Last edited:
Level 9
Joined
Dec 12, 2007
Messages
489
-------
Execution:

cause Caster to damage Target dealing Damage damage [damage unit]
set mana of Target to mana of Target - Damage [unit - set mana to value]
ehm.... shouldn't it be the mana is reduced first, and then check how much it is reduced, and then deals the damage?
something like this:

set CurMana = Mana of Target
set mana of Target to CurMana - Damage
cause Caster to damage Target dealing CurMana - (Mana of Target) damage

.....
 
ehm.... shouldn't it be the mana is reduced first, and then check how much it is reduced, and then deals the damage?
something like this:

set CurMana = Mana of Target
set mana of Target to CurMana - Damage
cause Caster to damage Target dealing CurMana - (Mana of Target) damage

.....

Oh yes, the amount of damage should be equal to amount of mana burned... I'll edit the upper post.
 
Level 9
Joined
Dec 12, 2007
Messages
489
set mana of Target to mana of Target - Damage [unit - set mana to value]

Set Target mana = Target 's max mana - current mana - Damage [real]
cause Caster to damage Target dealing Target mana damage [damage unit]

I think this still not right...
let me give an example:
there is a hero with 1000 max mana, for some reason it has only 500 mana left.
you cast manaburn on it, and the manaburn will burns 100 mana of it.
therefore, the hero should end with 400 mana and takes 100 damage from it, isn't?

now if we use your formula:
==>Set Target mana = Target 's max mana - current mana - Damage
cause Caster to damage Target dealing Target mana damage [damage unit]
==>Set Target mana = 1000 - 400 (because we already reduce the mana) - 100 (the damage)
that Target mana will be 500, and based on your function, it will deal this 500 damage instead of 100 damage. :grin:

EDIT:
well I'm managed to make the trigger btw:
  • New Mana Burn
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Burn
    • Actions
      • Set CASTER = (Casting unit)
      • Set TARGET = (Target unit of ability being cast)
      • Set MANA = (Mana of TARGET)
      • Set DAMAGE = (5.00 x (Real((Intelligence of TARGET (Include bonuses))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DAMAGE Greater than or equal to MANA
        • Then - Actions
          • Unit - Set mana of TARGET to 0
          • -------- make the stun part here --------
        • Else - Actions
          • Unit - Set mana of TARGET to (MANA - DAMAGE)
      • Unit - Cause CASTER to damage TARGET, dealing (MANA - (Mana of TARGET)) damage of attack type Spells and damage type Normal
that's the base of it...
 
Last edited:
Level 4
Joined
Jul 2, 2008
Messages
50
I thank you ALL who posted and helped me here. Actually most of your posts are similar to the test i get. But my result was this:

When the hero was mana burned to 0, it is not stunned by the dummy, however, when the same hero is burned the second time, it is stunned. I am sure theres some kind of leak there.


  • Mana Burn
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Burn
    • Actions
      • Set Burn_Caster = (Casting unit)
      • Set Burn_Target = (Target unit of ability being cast)
      • Set Burn_Damage = ((Real((Intelligence of Burn_Target (Include bonuses)))) x ((Real((Level of Burn for Burn_Caster))) + 2.00))
      • Unit - Cause Burn_Caster to damage Burn_Target, dealing Burn_Damage damage of attack type Spells and damage type Normal
      • Unit - Set mana of Burn_Target to ((Mana of Burn_Target) - Burn_Damage)

Yes my spell base is Chain Lightning to start with, after knowing that using mana burn would give me a "-0" when i cast it on heroes. But as mentioned, the only trouble i have is the secondary effect. I want to stun the target WHEN it reach 0 mana from this spell and not because ITS already 0 mana when spell is begin casted. This part have been bugging me before i even start the test and it was my only problem after doing this experiment. It's more complicated as i thought lol.
 
Level 9
Joined
Dec 12, 2007
Messages
489
  • Mana Burn
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Burn
    • Actions
      • Set Burn_Caster = (Casting unit)
      • Set Burn_Target = (Target unit of ability being cast)
      • Set Burn_Damage = ((Real((Intelligence of Burn_Target (Include bonuses)))) x ((Real((Level of Burn for Burn_Caster))) + 2.00))
      • Unit - Cause Burn_Caster to damage Burn_Target, dealing Burn_Damage damage of attack type Spells and damage type Normal
      • Unit - Set mana of Burn_Target to ((Mana of Burn_Target) - Burn_Damage)

hmmm.... how 'bout right after you set the mana of Burn_Target, you check if the mana is zero or not by using:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Mana of Burn_Target equal to 0
 
Do as I said in my firsts post here.

Give me a minute and I'll try to figure out that damage thing.

Ok, got it.

Before you "burn the mana" store Current mana of Target, then make another if/then/else that would check if mana is less than Damage, and if it is, cause Caster to damage Target dealing Stored mana damage.

Edit: No that wouldn't work... Man this one is tricky :>

Edit: Or it would, yes that would work I guess (seems logical to me) :)

Edited the first of my post in this thread.
 
Level 14
Joined
Aug 31, 2009
Messages
775
hmmm.... how 'bout right after you set the mana of Burn_Target, you check if the mana is zero or not by using:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Mana of Burn_Target equal to 0

Would probably be better to use:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Mana of Burn_Target less than or equal to 0.5
Just to avoid the hero regenerating say 0.01 mana before the check comes in (has happened before to my own triggers).
Less than 0.5 mana will display on the unit's bar as 0 anyway, so the user can't tell the difference.
 
Yeh, my bad :/

Anyway, if anyone have noticed I've attached a made spell to my previous post.

Edit:

There is a bug in spell I've submitted, here is an updated version with some improvements.

And a code if anyone wants to see.

  • Psychic Rape
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Psychic Rape
    • Actions
      • Set PR_Caster = (Triggering unit)
      • Set PR_Target = (Target unit of ability being cast)
      • Set PR_Target_Loc = (Position of PR_Target)
      • Set PR_Ability_Level = (Level of (Ability being cast) for PR_Caster)
      • -------- ----------------------- --------
      • Set PR_Damage_Factor = 2.00
      • Set PR_Atribute = (Intelligence of PR_Caster (Include bonuses))
      • Set PR_Damage = (PR_Damage_Factor x ((Real(PR_Atribute)) x (Real(PR_Ability_Level))))
      • Set PR_Dummy_Ability = Psychic Rape (Dummy)
      • Set PR_Target_Mana = (Mana of PR_Target)
      • -------- ----------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mana of PR_Target) Less than or equal to PR_Damage
        • Then - Actions
          • Unit - Cause PR_Caster to damage PR_Target, dealing PR_Target_Mana damage of attack type Spells and damage type Mind
          • Floating Text - Create floating text that reads (- + (String((Integer(PR_Target_Mana))))) above PR_Target with Z offset 0.00, using font size 11.00, color (0.00%, 30.00%, 70.00%), and 0.00% transparency
        • Else - Actions
          • Unit - Cause PR_Caster to damage PR_Target, dealing PR_Damage damage of attack type Spells and damage type Mind
          • Floating Text - Create floating text that reads (- + (String((Integer(PR_Damage))))) above PR_Target with Z offset 0.00, using font size 11.00, color (0.00%, 30.00%, 70.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 2.50 seconds
      • Unit - Set mana of PR_Target to ((Mana of PR_Target) - PR_Damage)
      • Special Effect - Create a special effect attached to the origin of PR_Target using Abilities\Spells\NightElf\ManaBurn\ManaBurnTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mana of PR_Target) Equal to 0.00
        • Then - Actions
          • Unit - Create 1 Dummy for (Owner of PR_Caster) at PR_Target_Loc facing Default building facing degrees
          • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
          • Unit - Add PR_Dummy_Ability to (Last created unit)
          • Unit - Set level of PR_Dummy_Ability for (Last created unit) to PR_Ability_Level
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt PR_Target
          • Special Effect - Create a special effect attached to the origin of PR_Target using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_PR_Target_Loc)
 

Attachments

  • Psychic Rape.w3x
    17.2 KB · Views: 44
Last edited:
Status
Not open for further replies.
Top