TheCrystal
New Member
- Reaction score
- 36
I've been working on this trigger for two days, and I'm beggining to loose it, I can't take it much more.. Here it is.
This is on Map Init, less lines of code and easier to fix if I figure out later I make a typo.
So, that sets the Events.
Now, for the trigger itself.
Anyways, that's the whole trigger I've used recently. The last if/thens are to check if the event is either @hero, which it removes the ability after @hero.
The first two are to check if it's 'heroABILITY, it checks if it's either A, unlearned which it adds it and sets it to 1, and if it already has it it adds one level to it.
So, I test it, it adds the Useless Ability and the ability I want it to add, the ability is already level 3 though, which shouldn't happen. So, I then type @heroABILITY, The ability and the useless ability is removed. After a couple of removing and adding abilities, it only removes the Useless ability, and if I type @heroABILITY again it removes the ability. Then it happens again, all over again.
I don't get why it would do this, I've tried it numerous times differently.
I've also tried this action.
It adds the ability to level two, if I try to upgrade it it gets all weird, the ability only shows effects, targets all, and has 0 range, 0 cooldown..
Sometimes the same thing would happen, it adds it at level two and then it wont add it to the point it's all weird.
I started out using this one.
Can anyone suggest to me a action/series of actions to do this?
And can you actually Null the Ability Variable? This may solve the Useless Ability adding problem.
Edit: I'll ALSO explain the purpos of the ability.
1, player types 'heroflamestrike
2. It adds the Hero Ability Flamestrike, level 1.
ERROR: Instead, it adds the Hero Ability Flamestrike, level 3, aswell as the Useless Ability (attempt at nulling the ability)
This is on Map Init, less lines of code and easier to fix if I figure out later I make a typo.
Code:
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
Trigger - Add to HeroAbilityNames <gen> the event (Player - (Player((Integer A))) types a chat message containing 'hero as A substring)
Trigger - Add to HeroAbilityNames <gen> the event (Player - (Player((Integer A))) types a chat message containing @hero as A substring)
Now, for the trigger itself.
Code:
Actions
If ((Substring((Entered chat string), 6, (Length of (Entered chat string)))) Equal to acidbomb) then do (Set HeroAbilities = Acid Bomb) else do (Do nothing)
If ((Substring((Entered chat string), 6, (Length of (Entered chat string)))) Equal to avatar) then do (Set HeroAbilities = Avatar) else do (Do nothing)
[COLOR="Red"] Etc[/COLOR], It's a long trigger.
If ((Substring((Entered chat string), 6, (Length of (Entered chat string)))) Equal to trueshotaura) then do (Set HeroAbilities = Trueshot Aura) else do (Do nothing)
If ((Substring((Entered chat string), 6, (Length of (Entered chat string)))) Equal to unholyaura) then do (Set HeroAbilities = Unholy Aura) else do (Do nothing)
If ((Substring((Entered chat string), 6, (Length of (Entered chat string)))) Equal to vampiricaura) then do (Set HeroAbilities = Vampiric Aura) else do (Do nothing)
If ((Substring((Entered chat string), 6, (Length of (Entered chat string)))) Equal to vengeance) then do (Set HeroAbilities = Vengeance) else do (Do nothing)
If ((Substring((Entered chat string), 6, (Length of (Entered chat string)))) Equal to volcano) then do (Set HeroAbilities = Volcano) else do (Do nothing)
If ((Substring((Entered chat string), 6, (Length of (Entered chat string)))) Equal to voodoospirits) then do (Set HeroAbilities = Voodoo Spirits) else do (Do nothing)
If ((Substring((Entered chat string), 6, (Length of (Entered chat string)))) Equal to warstomp) then do (Set HeroAbilities = War Stomp) else do (Do nothing)
If ((Substring((Entered chat string), 6, (Length of (Entered chat string)))) Equal to wateryminion) then do (Set HeroAbilities = Watery Minion) else do (Do nothing)
If ((Substring((Entered chat string), 6, (Length of (Entered chat string)))) Equal to windwalk) then do (Set HeroAbilities = Wind Walk) else do (Do nothing)
If (HeroAbilities Equal to Useless Ability (Shade)) then do (Skip remaining actions) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of HeroAbilities for AAU) Equal to 0
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 1, 5)) Equal to 'hero
Then - Actions
Unit - Add HeroAbilities to AAU
Unit - Set level of HeroAbilities for AAU to 1
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of HeroAbilities for AAU) Less than or equal to 5
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 1, 5)) Equal to 'hero
Then - Actions
Unit - Set level of HeroAbilities for AAU to ((Level of HeroAbilities for AAU) + 1)
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 1, 5)) Equal to @hero
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of HeroAbilities for AAU) Greater than or equal to 1
Then - Actions
Unit - Remove HeroAbilities from AAU
Else - Actions
Else - Actions
Set HeroAbilities = Useless Ability (Shade)
Anyways, that's the whole trigger I've used recently. The last if/thens are to check if the event is either @hero, which it removes the ability after @hero.
The first two are to check if it's 'heroABILITY, it checks if it's either A, unlearned which it adds it and sets it to 1, and if it already has it it adds one level to it.
So, I test it, it adds the Useless Ability and the ability I want it to add, the ability is already level 3 though, which shouldn't happen. So, I then type @heroABILITY, The ability and the useless ability is removed. After a couple of removing and adding abilities, it only removes the Useless ability, and if I type @heroABILITY again it removes the ability. Then it happens again, all over again.
I don't get why it would do this, I've tried it numerous times differently.
I've also tried this action.
Code:
If (((Substring((Entered chat string), 1, 5)) Equal to 'hero) and ((Level of HeroAbilities for AAU) Equal to 0)) then do (Unit - Add HeroAbilities to AAU) else do (If (((Substring((Entered chat string), 1, 5)) Equal to 'hero) and ((Level of HeroAbilities for AAU) Not equal to 0)) then do (Unit - Set level of HeroAbilities for AAU to ((Level of HeroAbilities for AAU) + 1)) else do (Do nothing))
Code:
If ((Level of HeroAbilities for AAU) Greater than 0) then do (Unit - Set level of HeroAbilities for AAU to ((Level of HeroAbilities for AAU) + 1)) else do (If ((Level of HeroAbilities for AAU) Equal to 0) then do (Unit - Add HeroAbilities to AAU) else do (Do nothing))
Code:
If (((Level of HeroAbilities for AAU) Equal to 0) and ((Substring((Entered chat string), 1, 5)) Equal to 'hero)) then do (Unit - Add HeroAbilities to AAU) else do (If ((Level of HeroAbilities for AAU) Less than or equal to 5) then do (Unit - Set level of HeroAbilities for AAU to ((Level of HeroAbilities for AAU) + 1)) else do (If (((Substring((Entered chat string), 1, 5)) Equal to @hero) and ((Level of HeroAbilities from AAU) else Do (Do Nothing)
Can anyone suggest to me a action/series of actions to do this?
And can you actually Null the Ability Variable? This may solve the Useless Ability adding problem.
Edit: I'll ALSO explain the purpos of the ability.
1, player types 'heroflamestrike
2. It adds the Hero Ability Flamestrike, level 1.
ERROR: Instead, it adds the Hero Ability Flamestrike, level 3, aswell as the Useless Ability (attempt at nulling the ability)