• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Magic consumption ability

Status
Not open for further replies.
Level 16
Joined
May 2, 2011
Messages
1,345
Hello guys,

so, I'm thinking for making new ability the blood mage, but I have no idea how to go about it:

Magic consumption:
235220-albums7600-picture88808.jpg


Hungering for magic, the blood magic has a chance% to consume a negative spell targetting him, recovering all mana used to cast it, and completely negating the effect (completely negating means exactly just like amulet of spell sheild)

so storm bolt would give him 75 mana and death coil too. slow and faerie fire would give him 50 or 45 or so. cycloe would give him 150. and this mana can give him beyond his complete mana (just like mana siphon, i.e. he does not regenerate if he is more than max)

Initially I thought I'd do something like, unit casts an ability, but well, that doesnt seem enough at all, because storm bolt has projectile and is not instant. I also thought of damage detect system (because I will use it in my map) but the problem would be that not all spells does damage and maybe its not easy to un-stun from storm bolt.

lastly, I thought it might be good idea if we could add spell block at the right moment to the blood mage (ofc with %) but then again problem might still be. say we made unit cast ability and it was mountain king, and trigger would give the blood mage spell block, but before the projectile hit, the soreceress casts slow (which is instant) and the trigger says it shouldnt be blocked, so well...

is there some way to go about this? I think it would be good if we can add spell block at the right time, but what is the "right" time?

Edit: btw, the effect should look like spirit touch of obsedien statue (or essence of mana)
another edit: also forgot to say, can also consume star fall thing (might change mind though)
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
You approach the concept from a wrong angle.

The thing you want is a condition on a spell rather than a buff on a unit.

To actually be able to make this work completely, you first of all have to have a very good/perfect system that handles spells.
Such a system does not (yet) exists and would take very long to make.
However the result would be amazing.
(In some maps you might see this but there is no system uploaded to the hive that does it.)

First of all, you want to negate ALL effects from a spell no matter if it deals damage or only applies a debuff.
Therefore a DDS wont solve your problem.
Secondly, you have to get the mana cost of an ability.
Not long ago I learned how you can get the (almost) precise mana cost of any ability, but then you have to save the value to retrieve it when the effect of the ability occurs.

If you really want this, you have to make a system that runs a code(function) related to an ability if some conditions are met.
Then you add a general condition (applies on all abilities) when the effect occurs and checks if the target has the ability "Magic Consumption" then you do a chance calculation which determines wether you will or will not take the effect of an ability.

The second concept of adding a spell shield (which in some of my maps already doesnt work any more) could save your day, and you could at least negate the damage via a DDS.
The buffs on abilities however are not so easily removed as you cannot access that specific data directly.

I doubt if that second option would work.

I am sorry if I disappoint you but you really need that first system to do real cool stuff with abilities. Maybe even a better system than I described.
 
Level 16
Joined
May 2, 2011
Messages
1,345
well, I guess I will have to do it in the imperfect way then :(

maybe what I will do is if random number is % whatever, then I will add the ability to the unit

and if two units casts in very semilar time, then I will have to add it twice. Ofcourse since I cant really add it twice (as far as I have seen), So, well, I guess What I Will have to do is add some integer counter, and when it become more than 0, then add the ability (has 0 CoolDown), if it become 0 again, remove ability, and whenever chance triggers then make the ConsumeCounter = ConsumeCounter +1

Ofcourse I will have to make that ability hidden and make another just show off ability to tell the tool tib.

Edit: not very cleaver way I know, as it will fail when lets say

Mountain King Casts: Storm Bolt,
Warden Casts: ShadowStrike before the Bolt hits BloodMage

the consumption will consume ShadowStrike and Not Storm Bolt no matter what, even if it is supposed to do the opposite sometimes (depend on the randomness)
_______________________________________________________
_______________________________________________________

Another thing,
how do we go about making the mana more than maximum? I wanted it to work as Mana Siphon ability, i.e.

mana siphon is capped at 2 X max mana,
when mana go beyone max, it degenerate I think with -3 or something

so what I think I should do is something like, ummm, add mana siphon buff to the bloodmage?

oh wait, I cant seem to find the buff. I looked into siphon mana ability buffs, and what i saw was the following buffs:
  1. Drain Life & Mana (caster)
  2. Drain Life Drain (Caster)
  3. DrainMana Drain (Caster)
  4. Drain Life & Mana (Target)
  5. Life Drain (Target)
  6. Mana Drain (Target)
  7. Drain Life & Mana
  8. Drain Life
  9. Drain Mana
  10. Siphon Mana

and I cant seem to find the last 4. is there some sort of hidden buffs? or what?
maybe I can add it with custom script or somethin?
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
About the exceed life and mana of the drain... you could use a dummy unit that gives a part of his own health to your unit but it will take time.

The variables for that thing are in Gameplay Constants under "Gameplay - Drain Gives Bonus Life/Mana".

The concept of your "imperfect" solution is also known as an attack indexer.
It is not recommended to use because you have to follow its rules and they could be a pain in the ass.
However, you could use it for complete maps that you make.
With a proper and complete attack indexer, you can get mana cost of the level of the ability that was cast with the level of when it was cast...
You can even get the mana cost after you modified it for some reason.
There are massive things you can do but you won't use it so it doesn't matter telling.

Abilities like these require systems... good systems.
Good systems that I talk about have rules... rules that you do not want to follow.

I give you an easy example of a spell that requires all other spells to use a specific system:
Missile Barrier: "Creates a shield that bounces enemy missiles off."
You require to have made all projectiles by a missile system to change targeted location/angle.

So if you want this ability but already have 200 other abilities based of Storm Bolt, Acid Bomb, Firebolt, etc. (ranged basic attacks too)
Then you have to recreate all those 200 spells.

For you, you have to recreate all attack spells. (all spells that would damage or debuff a target/area)

You can use your imperfect way as it is the only way to do this simple... but you already know why and how it would fail.
 
Level 16
Joined
May 2, 2011
Messages
1,345
About the exceed life and mana of the drain... you could use a dummy unit that gives a part of his own health to your unit but it will take time.

The variables for that thing are in Gameplay Constants under "Gameplay - Drain Gives Bonus Life/Mana".

The concept of your "imperfect" solution is also known as an attack indexer.
It is not recommended to use because you have to follow its rules and they could be a pain in the ass.
However, you could use it for complete maps that you make.
With a proper and complete attack indexer, you can get mana cost of the level of the ability that was cast with the level of when it was cast...
You can even get the mana cost after you modified it for some reason.
There are massive things you can do but you won't use it so it doesn't matter telling.

Abilities like these require systems... good systems.
Good systems that I talk about have rules... rules that you do not want to follow.

I give you an easy example of a spell that requires all other spells to use a specific system:
Missile Barrier: "Creates a shield that bounces enemy missiles off."
You require to have made all projectiles by a missile system to change targeted location/angle.

So if you want this ability but already have 200 other abilities based of Storm Bolt, Acid Bomb, Firebolt, etc. (ranged basic attacks too)
Then you have to recreate all those 200 spells.

For you, you have to recreate all attack spells. (all spells that would damage or debuff a target/area)

You can use your imperfect way as it is the only way to do this simple... but you already know why and how it would fail.

Yes, I know about the mana siphon exceeding Max mana, but I want magic consumption to do that too. Drain mana give bonus mana is already set to true in my map, but what I am thinking is that I want lets say, when storm bolt is cast, my hero gain 75 mana even if he is at max (just like mana siphon)

why it would fail?
_____________________________________________
_____________________________________________

Merged

Perhaps using Hashtables can solve it. I recall we can build a list of abilities mana cost with this and retrieve it whenever a spell is cast on the unit with the spell.

oh you guys already replied

I still have never used or manipulated hashtable -_-
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You don't need to be so hard on him =.=

How do you even know he's going to fail if he hasn't even tried it. No offense but your last post just sounds condescending and presumptuous.

I might have been over the top just then...
However, I know that he is going to fail because he said so himself.
He can save the data of a spell in a hashtable or array and then check the target etc etc etc.
However, you cannot know which spell actually hit first if there are more spells cast on the same target before the other projectile has landed (if you use spells like storm bolt, acid bomb, firebolt, etc)

But think of this... how can you negate the damage and effects if the spell was something like inferno?

You could remove the damage by using a DDS but then immolation would be op, equal as effects are applied no matter what.

Perhaps using Hashtables can solve it. I recall we can build a list of abilities mana cost with this and retrieve it whenever a spell is cast on the unit with the spell.

There is a better solution to find out the exact mana cost of an ability for each level.
This is by checking the mana consumed between the "Starts the effect of an ability" and the expire event of a 0 seconds timer that is created at that moment.
Then you have the mana cost.
But that is not the hardest thing to do.

His suggestion about Spell Shield is actually good but then there is a problem... when do you apply the shield?
You can indeed have a chance to create an invisible shield whenever he has taken spell damage... but then it is impossible to know what spell hit the unit so you can find out how much mana the unit should restore.

I would be glad to create a Spell System as I will make one for my new map too... still the question if he wants to use it.

The concept for increasing a unit's mana over the maximum is interesting and I will take a look at it as soon as I got the time.
 
Level 16
Joined
May 2, 2011
Messages
1,345
projectiles should not be much of a problem. I think the only two projectiles that can target heroes in the map are storm bolt and death coil (which mean im lucky XD)

ok I will do that mana checker (actually i remember a thread about that i red recently)

also, for mana more than max, i tried adding briliance aura abilty which has buff siphon mana, and then when i used siphon mana ability while i have the buff, game crashed

edit: , as for shadow strike, it is instantly blocked as soon as it is casted
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
ok I will do that mana checker (actually i remember a thread about that i red recently)
Kuch... kuch... "Using HP to cast spells" kuch...

also, for mana more than max, i tried adding briliance aura abilty which has buff siphon mana, and then when i used siphon mana ability while i have the buff, game crashed
That doesnt sound logical but the buff is not doing shit.
The exceed max mana stuff is hardcoded to the base ability ids of drain life/mana.
All abilities based of drain life and mana also have that as a base id so they als work with it.

The concept of drain mana as far as I have is hard to use and is not dynamic.
1. The mana is not immediately added as I order a dummy to cast drain mana on a unit.
2. The mana amount can not be modified but is preset. (Could be more abilities though or play with time.)

(Also there are more projectile abilities than storm bolt and death coil... Firebolt and Acid Bomb, I already mentioned... twice.
But you require all abilities... shockwave, impale, blizzard, inferno, immolation, disease cloud, drain life, posession, sleep, bash, frost nova, slow... where do I end?)
 
I don't see how you'll be able to control this since WC3 doesn't offer that much control over this. Sure there's a way however it isn't very useable.

Why not just raise max mana instead of current over max? It's easier and besides there's a max value before stuff goes negative or fatal's/bugs. That's around 2.2 billion due to the system Blizzard used. Same reason why the internet was broken for a short duration.
 
Status
Not open for further replies.
Top