| 05-16-2005, 11:10 PM | #1 |
Weee. Yet another trigger question asked by yours truly :p Anyways, basically I replaced the lumber with "Talent Points." Every 5 levels you get one talent point. The trigger: Code:
Talent Points Every 5 Levels
Events
Unit - A unit Gains a level
Conditions
Actions
-------- -------------------------------------------------------------------------Level 005------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 5
Talent_Points[(Integer A)] Equal to 0
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 010------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 10
Talent_Points[(Integer A)] Equal to 1
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 015------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 15
Talent_Points[(Integer A)] Equal to 2
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 020------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 20
Talent_Points[(Integer A)] Equal to 3
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 025------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 25
Talent_Points[(Integer A)] Equal to 4
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 030------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 30
Talent_Points[(Integer A)] Equal to 5
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 035------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 35
Talent_Points[(Integer A)] Equal to 6
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 040------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 40
Talent_Points[(Integer A)] Equal to 7
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 045------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 45
Talent_Points[(Integer A)] Equal to 8
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 050------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 50
Talent_Points[(Integer A)] Equal to 9
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 055------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 55
Talent_Points[(Integer A)] Equal to 10
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 060------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 60
Talent_Points[(Integer A)] Equal to 11
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 065------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 65
Talent_Points[(Integer A)] Equal to 12
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 070------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 70
Talent_Points[(Integer A)] Equal to 13
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 075------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 75
Talent_Points[(Integer A)] Equal to 14
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 080------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 80
Talent_Points[(Integer A)] Equal to 15
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 085------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 85
Talent_Points[(Integer A)] Equal to 16
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 090------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 90
Talent_Points[(Integer A)] Equal to 17
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 095------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 95
Talent_Points[(Integer A)] Equal to 18
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 100------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 100
Talent_Points[(Integer A)] Equal to 19
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 105------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 105
Talent_Points[(Integer A)] Equal to 20
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 110------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 110
Talent_Points[(Integer A)] Equal to 21
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 115------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 115
Talent_Points[(Integer A)] Equal to 22
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 120------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 120
Talent_Points[(Integer A)] Equal to 23
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 125------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 125
Talent_Points[(Integer A)] Equal to 24
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 130------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 130
Talent_Points[(Integer A)] Equal to 25
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 135------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 135
Talent_Points[(Integer A)] Equal to 26
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 140------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 140
Talent_Points[(Integer A)] Equal to 27
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 145------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 145
Talent_Points[(Integer A)] Equal to 28
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing
-------- -------------------------------------------------------------------------Level 150------------------------------------------------------------------------- --------
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Hero level of (Leveling Hero)) Greater than or equal to 150
Talent_Points[(Integer A)] Equal to 29
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothingThis is the most efficient way I could think of how to do this. Well, this system works fine, IF it is just for ONE hero. The thing is, you can switch to be up to 18 different heros. It saves the lv of the preceding class, so, if you want to switch back, your same lv/skills are saved. Well, the way this trigger is set up limits it TO ONE HERO. The reason I did "is greater then 5" on hero levels besides "equal to" is because there is quests that give exp after completing and sometimes you can jump from lets say lv 4 to lv 6, skipping right over the "equal to lv 5 mark." How can I change this for all hero's played and make it save whatever it was, besides making an array FOR each hero type and doing this trigger like 18 times over. Anyone? |
| 05-16-2005, 11:44 PM | #2 |
Aaaaahhhh, my eyes, they burn, buurrnnnn! So much copy and pasting when you could just have done this: Code:
Events
Unit - A unit Gains a level
Conditions
Actions
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
(Hero level of (Leveling Hero)) Greater than or equal to (5 + (Talent_Points[(Integer A)] * 5))
Then - Actions
Set Talent_Points[(Integer A)] = (Talent_Points[(Integer A)] + 1)
Player - Add 1 to Players[(Integer A)] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing |
| 05-17-2005, 03:42 AM | #3 |
Hehehehe. Ok, I don't understand every function thar, but when you wake up, I'm sure you would love to explain it to me :p And, would the thing for mass heros change this trigger? If not, I can implement it in now, I will wait for conformation first :p |
| 05-17-2005, 06:27 AM | #4 |
or even better, Code:
Events
Unit - A unit Gains a level
Conditions
Actions
Set index = Player number of (owner of (Leveling Hero) )
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
( (Hero level of (Leveling Hero)) Mod 5 ) equal to 0
index is less than 7
Then - Actions
Player - Add 1 to Players[index] Current lumber
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothingbye bye loop and bye bye talent points array... unless u really want to keep it, then go ahead, but mod is a nice function also anitarfs and mine work for all heros... dunno why he said otherwise |
| 05-17-2005, 07:43 AM | #5 |
Use multidimension Hero for TalentPoints[ Player Index * 18 + Hero Index ] Code:
Talent Points Every 5 Levels
Events
Unit - A unit Gains a level
Conditions
Actions
// Get Hero Index for Leveling Hero and store it in HeroIdx
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Leveling Hero)) Equal to Players[(Integer A)]
(Hero level of (Leveling Hero))/5 equal to Talent_Points[(Integer A)*18 + HeroIdx] + 1
Then - Actions
Set Talent_Points[(Integer A)*18 + HeroIdx] = (Talent_Points[(Integer A)*18 + HeroIdx] + 1)
Player - Set Players[(Integer A)] Current lumber to Talent_Points[(Integer A)*18 + HeroIdx]
Game - Display to (Owner of (Leveling Hero)), at offset (0.00, 0.00) the text: |c00eaea00You have ...
Else - Actions
Do nothing |
| 05-17-2005, 08:16 AM | #6 |
Raptor--, the mod is a great function for this kind of stuff, unfortunately, the "unit gains a level" event will fire only once even if a hero gains more levels at the same time, so the hero level can jump from 4 to 6 and then such a trigger won't award any talent points. Jackyquah has a good idea, however, it isn't as simple as that because Zero stores the talent points of a hero in lumber, which is player-specific, not unit-specific (the variable is just used to store how many talent points a hero gained, not how many he has at the moment). So, you would need another variable array to store how many points the hero had when you swapped him with another one so when you swap him back, you get only that many lumber that you had when you swaped before, even if the other hero in the meantime accumulated much more. |
| 05-17-2005, 07:22 PM | #7 | |
Quote:
are you sure? thats a REALLY stupid way for that event to work if so... it should really generate a new event each time and throw it onto the stack or whatever it uses to deal with events |
| 05-30-2005, 12:02 AM | #8 |
I havn't had net to check on anything, but, I do STILL need this system to work correctly :p And yes anitarf, you do understand what I need to be done :p Can you help me get a system working for this plz :) |
| 05-30-2005, 06:52 AM | #9 |
I would like to know more about how your hero switching works. I suppose you already have a system that stores which level the hero is on different classes and which skills he has. If I knew how that works, I could come up with a nice and simple solution. |
| 05-30-2005, 07:01 PM | #10 |
Ok, I can't give you the exact code right now due to I am at work :( Basically, the first 6 classes (tier 1) can be used by all heros. The tier 2 can only be used by the specified class and same with tier 3. So, basically the trigger says: Unit uses an item Item = warrior training unit manipulating item not equal to warrior If warrior(varaible array) equal to no unit then create one warrior If warrior(variable array) has a unit allready set to it then move hero manipulating item and move variable hero to location. That is the general set up. Does this help at all? |
| 05-30-2005, 11:49 PM | #11 |
Lalala. Ok. That's a bit unefficient, but I'll work with it. Right now, you already have a unit variable array for each hero-type there is, like, in your example, warrior[], which stores the warriors for each player. Now make a new variable called warriorTPoints[] or something like that. Then, make a variable like that for each other hero class you have. Yeah, it's a lot of new variables, but I don't feel like telling you how to rework the whole system to have less of them, and you probably don't feel like reworking the whole system anyway. Now, whenever you swap your hero (from warrior to, let's say, archer, if you have an archer, I don't know, just an example), first you store your warrior to the variable warrior[(owner of (triggering unit))], and then store the player's current lumber to warriorTPoints[(owner of (triggering unit))]. Then set the player's lumber to be equal to archerTPoints[(owner of (triggering unit))] and then move the archer. So, let's say you had 2 talent points on the archer and then you swapped to warrior. Your lumber was set to 0 (because the warior was newly created and didn't have any TPs yet). Then you gain 5 talent points with the warrior and spend 2 of them. You have 3 lumber left. Now you swap back to archer. The game stores the data that you had 3 lumber with him, and then loads that the archer had 2 TPs, setting your lumber to 2. So, for the active hero, the talent points are stored in the player's lumber, and for the non-active heroes, the TPs are stored in a variable. You can avoid having more variables if you don't use unit custom values for anything yet. If that's the case, you can store the TPs of a hero to that hero's custom value instead of a special variable when swapping them. |
| 06-01-2005, 06:27 AM | #12 |
Duh... Why didn't I think of something like this, sigh :o I GOT MY NET BACK FINALLY!!!! WOOO HOOOOO!! Thx btw :) |
| 06-02-2005, 01:16 PM | #13 |
Like I said before, Actually you can avoid/ reduce using much array and costum unit, by emulate one dimmension to multidimmension. so You only need two array ( 1 Unit array, 1 integer array) Hero[ PlayerIdx*18 + HeroIndex ] TalentPoint[ PlayerIdx*18 + HeroIdx ] = to stored Talent point gained by each type hero. TalentPoint[ 18*12 + PlayerIdx*18 + HeroIdx ] = to stored remaining Talent point each type hero number 18 indicate the number of Hero Type. number 12 indicate the number of player. HeroIdx = indicate Index type hero example (heroIdx==1 => warrior, 2 => archer, 3 => ... ) |
