• 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 = rage

Status
Not open for further replies.
Level 1
Joined
Apr 30, 2013
Messages
4
Hi there folks, I'm attempting to make a custom hero class that uses his manna similar to Rage, where he has a set max manna of 100 which it cannot exceed no matter what (buff's, level up and increased int will not effect manna maximum). I want his intelligence to continue to increase because I want his mana regen to increase when he levels up.

I'm quite new to the editor let alone triggering but I had assumed that making a standard if-else like script would work (if hero mana > 100 then hero mana = 100), but I was mistaken.

I tried set it up with the event "Unit-Mana". With this event I have to choose a unit that is on the map then I can do the greater than 100. And that's the end of the event and I move on to the action which is "set unit mana" to 100.

This works perfectly, but only with the unit that I selected on the map when editing. If I were to make a new hero of the same type then the trigger doesn't work, and I can't delete the unit I selected when making the trigger either.

Basically my question is can I get this trigger to happen each time my custom hero is created? If not is there a way I can make his max mana stay at 100 without effecting any other stat? Thank you so much for any replies!
 
Level 1
Joined
Apr 30, 2013
Messages
4
Game constants

I've checked out the game constants and the only one that I've seen that seems to be able to do what I want is the "Hero Attribute - Mana Point bonus per intelligence". The only thing is if I were to change that then all Heroes would be affected unless I'm missing something. I would be very appreciative if you would be able to write it up or give me any pointers!

Like I said i'm very new to this whole thing (actually just started doing all this yesterday). My friends are making a custom campaign and they can't really understand how to do the triggering so they've kinda made me their scripting b*tch because I have a programming background lol.

With that said how would I make my hero into a variable?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
This works perfectly, but only with the unit that I selected on the map when editing. If I were to make a new hero of the same type then the trigger doesn't work, and I can't delete the unit I selected when making the trigger either.
You create the event when you create the unit. Under trigger action category there is a add event to trigger action.
 
Level 1
Joined
Apr 30, 2013
Messages
4
You create the event when you create the unit. Under trigger action category there is a add event to trigger action.

So I attempted to do this the only way I knew how to and that was with triggering units. So here is what I have (hopefully someone can show me what i'm doing wrong).

Event: nothing

Conditions:
(Unit-type of (triggering unit)) Equal to [custom hero]​

Actions:
Trigger - Add to (This trigger) the event (Unit - (Triggering unit)'s mana becomes Greater than 100.00)​
Unit - Set mana of (Triggering unit) to 100.00​

I made the event in the action like Dr. Super Good said (unless I did it wrong) yet when I get an item that increases int his mana still goes up. Any ideas or is this a hopeless task?
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
You will need 3 triggers for this. Look in the hidden tab.
TRIGGER 1
  • Map Ini
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to YOUR_HERO)) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Rage <gen> the event (Unit - (Picked unit)'s mana becomes Greater than 100.00)
This trigger fires when you load the map and it picks up your unit, if you placed that unit into the map through World Editor. Then it adds that hero as a triggering unit for the 3rd trigger.


TRIGGER 2
  • New Hero
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to YOUR_HERO
    • Actions
      • Trigger - Add to Rage <gen> the event (Unit - (Triggering unit)'s mana becomes Greater than 100.00)
This trigger does exactly the same what the first one did, but this one fires when you are already playing and someone creates that hero.


TRIGGER 3
  • Rage
    • Events
    • Conditions
    • Actions
      • Unit - Set mana of (Triggering unit) to 100.00
This final trigger's "event" is add by those 2 triggers before. Basically, whenever YOUR_HERO's mana is greater than 100, it will set mana to 100.


So what it does is:
Trigger 1 picks up pre-placed heroes (= placed by you in World Editor) and adds them as a triggering unit that fires the 3rd trigger
Trigger 2 picks up heroes created while playing the game and adds them to the 3rd trigger
Trigger 3 will set that hero's mana to 100 whenever hero has more than 100 mana


What you did wrong in your trigger is that there was no event to fire that trigger.
Each trigger is first fired when a specific event occurs (this you set in the Event field).
If certain additional conditions are also true (this is the condition field), then something happens (this is the action field).

Since you had no "Event" in the trigger to begin with, the trigger would not fire = nothing would happen
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Well, he wants intelligence to increase still
I want his intelligence to continue to increase because I want his mana regen to increase when he levels up.

However you may be here on something gorillabull - jim wants to increase mana regen. If that is so, then he could do it the other way around - instead of increasing intelligence to provide increased mana regen, he should set intelligence increment per level to 0 and instead use an item ability that increases mana regeneration (for example from Manastone). He would have to give it 10 levels and calculate how much mana regen should each level give.
Then, whenever hero levels up, he sets level of that ability to hero's level.

The only problem I see is when that hero picks up an item that gives bonus to intelligence.
That could be bypassed by setting starting intelligence to 100 for example and when hero picks an item up, he would have to decrease his intelligence attribute through triggers, so [base intelligence] + [intelligence from items] = 100.
 
Level 1
Joined
Apr 30, 2013
Messages
4
Yes!! Thank you so much Nichilus! Not only have you helped solve my problem but you've greatly helped me learn more about event triggering which was what I really wanted to get from this thread. Thank you also to everyone else that replied! The WC3 modding community is definitely awesome!

I do really like the idea about just increasing the mana regen with a manastone and keeping int at 1, that is definitely something I'm going to look into for the long run so the actual max mana stays 100, but for right now the triggers you gave me will work perfectly (due to the fact that for right now this hero/map is still in very young production and won't be ready for release for quite a while).

Again thanks a ton everyone, especially Nichilus! :xxd:
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
I do really like the idea about just increasing the mana regen with a manastone and keeping int at 1, that is definitely something I'm going to look into for the long run so the actual max mana stays 100
If you leave intelligence attribute at 1, players may be able to bypass the 100 mana limitation and increase their maximum mana - assuming your heroes will be able to pick up items.

The problem would be with items that increase Intelligence. If you look at any hero who wears any intelligence items, the number written by Intelligence attribute looks like this
Intelligence:
25 + 12

The problem is that you can change only base intelligence (the white number) through triggers and that number can not go below 1.

You would need to trigger that, so whenever warrior-hero picks up an item or drops it, the sum of his base and bonus intelligence would be equal to 100. I think that could be done via a trigger that fires when he picks/drops item and starts another trigger with a timer expiring in 0 seconds.
 
Status
Not open for further replies.
Top