• 🏆 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!

WoW Combat - Disabled stealth & mana loss

Status
Not open for further replies.
Level 5
Joined
Mar 27, 2008
Messages
107
hey =)

I'm creating a world of warcraft map and was wondering if there is any way you can make a trigger that makes u enter combat when u attack or getting attacked, so u cant use stealth and not loose rage?

If u havnt played world of warcraft i want something like this to happen:

A unit gets attacked or take damage, then he enters a combat, while in combat u cannot go in any invisibility and you do not loose mana (when ur not in combat u do loose mana). when this combat is over (the mob that was attacking u dies) you can use invisiblity and looses mana again.

thx in advance <3<3
 
Level 14
Joined
Apr 21, 2007
Messages
1,465
I believe this is fairly simple in Jass, however I'll try to make it in GUI.

Note: This may not be the best way, but untill I can think of something better it'll have to do.

Ok, first of you add a trigger that goes something like this:

Code:
Event- A unit is attacked
Condition - Unit being attacked equal to YOURHERO
Action - Set COMBATINDICATOR to 1

The COMBATINDICATOR should be a Real variable.

Now, once you have this you should add some more triggers regarding stealth:

Code:
Event - Unit - Begins casting an ability
Condition - Ability being cast equal to STEALTH
              - Triggering unit equal to YOURHERO
              - COMBATINDICATOR equal to 1
Action - Unit - create 1 SOMEGUY at position of YOURHERO
         - Unit - Issue Last created unit to Human - Priest Dispel YOURHERO

This is kind of dumb, but i can't think of a better way at this moment. Anyway SOMEGUY should be a dummy unit with the ability to dispell friendly units. He will be created at the position of your hero and will dispell him(make sure you remove the effect models so as not to see the actuall dispell), then after about a second or two you should add a line that will remove that unit:

Code:
Unit - Remove last created unit from the game

Now, regarding mana...hmm, well I think this would be the best way:

Code:
Event - Time - every 1 second
Condition - COMBATINDICATOR equal to 1
Action - Unit - Set mana of YOURHERO to (Percentage mana of YOURHERO + 2.00)%

This will give every second 2% of his total mana to your hero. Set this number to be equal to the number at which your hero is loosing his rage.


The final thing is to exit combat. I would suggest adding a trigger that goes like this:
Code:
Event - every 20 seconds
Condition - COMBATINDICATOR equal to 1
Action - set COMBATINDICATOR to 0

This will reset the combat indicator every 20 seconds which kind of gives you a few seconds in combat to use stealth, but well thats the best I got at this moment. The combatindicator will go back to 1 if the unit is still in combat as soon as he gets attacked.

Hope this helps.
 
Status
Not open for further replies.
Top