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

mana bug

Status
Not open for further replies.

007

007

Level 6
Joined
May 3, 2009
Messages
175
i have a weird bug. a spell does not use mana when casted (although it costs 200 mana. i i dont enough enogh i also cant use it). does anyone know something about that?
 

007

007

Level 6
Joined
May 3, 2009
Messages
175
i made a spell in a map. when i test the map and i use this spell the spell works just the unit does not lose any mana. but the spell does cost 200 mana. it says there and also if the unit has less than 200 i cant use the spell.
 

007

007

Level 6
Joined
May 3, 2009
Messages
175
here i have a map. the paladin has the ability thunderbolt. if u use it the paladin is supposed to be teleported to the position of the target unit. in my map this spell is supposed to work only on one kind of units, they all belong to the same player thats why the condition for the trigger is owner of unit= player 2, so it should only wokr on the grunt in this case.


ah. i just realized, that, because the ability cant be used if the unit doesnt have enough mana, i can just make him lose mana with a trigger. but for that i need to know how to make the amount of lost mana be dependent of the level of the ability (with each level it costs less mana.
 

Attachments

  • test map.w3x
    14.1 KB · Views: 48
Last edited:
Level 14
Joined
Nov 18, 2007
Messages
1,084
I didn't check the test-map yet, but I have a guess why the spell doesn't cast any mana: setting the unit's position interrupts its orders which makes it unable to finish the spell. If you removed that line, the unit would probably use up mana, but then your spell won't work.

You could fix this by using SetUnitX and SetUnitY
If you're using GUI, you'll need to use custom script. Note that these functions takes a unit and a real, not a location.

An example of subtracting mana based on level of ability:
  • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) - (250.00 - (50.00 x (Real((Level of YourAbility for (Triggering unit)))))))
 

007

007

Level 6
Joined
May 3, 2009
Messages
175
oh your right! but ill just set the mana with the trigger you dont need to look at the map anymore. its just what u said.
 

007

007

Level 6
Joined
May 3, 2009
Messages
175
??? this is weird. yesterday it worked after i did what robohippo said. i didnt change anything but now nothing happens when i use the ability. ?



i also tried the test map again. there it works but i had the old problem again: he didnt use any mana! does the editor always do everything different??


i just tried random abilities in my map and none of them work? what has happened? not one ability seems to work (they also dont use mana or have to cooldown afterwards). what can have caused that?
 
Last edited:
Level 8
Joined
Jun 26, 2010
Messages
530
Probably you have a bad trigger. You have any triggered "when a unit start's the effect's of an ability"? If so, post here.
 
Level 8
Joined
Jun 26, 2010
Messages
530
yeah i have. is that the reason?

I only said it's possible. But it's not sure. That's why i asked you to post the triggers here, so we can look for possible reasons for that strange issue to be happening with you.

Altough i think @ wacik already gave you the solution. In case that doesn't helps you, post the triggers here.
 

007

007

Level 6
Joined
May 3, 2009
Messages
175
ah!! i found it! i forgot the condition in one trigger! sorry for bothering
 
Status
Not open for further replies.
Top