Increment hero skills without leveling up

Vroomfondel

New Member
Reaction score
0
I'm trying to make a map, where instead of gaining experience and leveling up to get skills like normal, you have to defeat certain bosses.

Whenever a player kills a boss, they get to choose 1 of the 5 skills their hero has, and then it adds a level to each skill already had. This way the player has to choose which skill they want to reach level 5 and which to reach 4, 3, etc.

The part that gives them the first skill is not finished, but is at a functional stage.

Code:
IncrementAbilities
    Events
        Unit - A unit enters AbilityZone <gen>
    Conditions
    Actions
        For each (Integer A) from 1 to spawnlastboss, do (Actions)
            Loop - Actions
-------------------------
Ability A
    Events
        Unit - A unit enters AbilityTake1 <gen>
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Triggering unit)) Equal to Footman
            Then - Actions
                Unit - Add Acid Bomb to (Triggering unit)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Triggering unit)) Equal to Knight
            Then - Actions
                Unit - Add Animate Dead to (Triggering unit)
            Else - Actions

I'll just substitute the correct units and abilities when they are made. For testing, I disable the "is a hero" condition.



One other problem I'm having is making a variation on the pheonix egg ability for heroes. every part of it works right except the hero doesnt revive at the end.
Code:
Pheonix egg
    Events
        Unit - A unit owned by Player 1 (Red) Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Set HeroDeathSpot[0] = (Position of (Dying unit))
        Set HeroPC[0] = (Dying unit)
        Unit - Create 1 Hero Egg for Player 1 (Red) at (Position of (Dying unit)) facing Default building facing degrees
        Set HeroEgg[0] = (Last created unit)
        Set x = 10
        Wait 10.00 seconds
        Trigger - Run Pheonix egg finish <gen> (checking conditions)
------------------------
Pheonix egg finish
    Events
    Conditions
        (HeroEgg[0] is alive) Equal to True
    Actions
        Unit - Remove HeroEgg[0] from the game
        Hero - Instantly revive HeroPC[0] at HeroDeathSpot[0], Show revival graphics

I plan on making a custom ability that will just skip straight to the finish. Just a dummy spell tied to a trigger that says "Trigger - Run Pheonix egg finish <gen> (ignoring conditions)"
 
Z

Zell

Guest
As you create the Heroes for them, set each to Unit_PXHero (replace X by their player number). Then just set up you conditions (beat the boss or whatever) and set the skill they select to level up to some skill variable like Skill_Selected, and have this:
Code:
Actions    
    Unit - Set level of Skill_Selected for (Unit_PXHero) to ((Level of Skill_Selected for (Unit_PXHero)) + 1)

I can't see why your second trigger won't work... looks good to me. Nevertheless, I'd shorten it to:
Code:
Events
    Unit - A unit owned by Player 1 (Red) Dies
Conditions
    ((Triggering unit) is A Hero) Equal to True
Actions
    Set HeroDeathSpot[0] = (Position of (Dying unit))
    Set HeroPC[0] = (Dying unit)
    Unit - Create 1 Hero Egg for Player 1 (Red) at (Position of (Dying unit)) facing Default building facing degrees
    Set HeroEgg[0] = (Last created unit)
    Wait 10.00 seconds
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            (HeroEgg[0] is alive) Equal to True
        Then - Actions
            Unit - Remove HeroEgg[0] from the game
            Hero - Instantly revive HeroPC[0] at HeroDeathSpot[0], Show revival graphics
       Else - Actions
I doubt it fixes the problem, but it makes it neater =P
 

Vroomfondel

New Member
Reaction score
0
Thanks, that first bit worked great.

For the second part, I had it in two triggers so I could skip the wait if I wanted, though it doesn't work either way....one or two.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top