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

Help with a unit ranking system

Status
Not open for further replies.
Level 4
Joined
Dec 3, 2012
Messages
51
Hi,

I am trying to modify defskull's Simple Rank System v1.2.

Basically what I want is a system that allows individual units to rank up to a new unit type after a certain number of kills. For instance, after an archer kills 10 units she is now a ranger (new unit type). However, I was want the trigger to be dependent on an upgrade, so that if you don't have it the unit can't level up. What I have so far levels up the unit but ignores my tech condition. Any thoughts on how to make this trigger work the way I described? The trigger needs to be MUI and any player with the unit+upgrade should be able to use it.

Thanks


Below is an example of defskull's Simple Rank System v1.2, where a footman can rank to a knight after 5 kills, but he needs iron forged swords lvl 3. However, as it is now he ranks without the upgrade.


  • RS Register New Unit
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Set RankUnit = (Triggering unit)
      • Custom script: set udg_RankKey = GetHandleId(udg_RankUnit)
      • Set RankUnitKill = 0
      • Hashtable - Save RankUnitKill as (Key UnitKill) of RankKey in RankHashtable
  • RS Setup Copy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- CONFIGURABLES --------
      • -------- LISTS OF RANKS --------
      • Set Rank[1] = Elite Warrior
      • -------- KILL REQUIRED PER RANK --------
      • Set RankKillRequired[1] = 5
      • -------- END OF CONFIGURABLES --------
      • Hashtable - Create a hashtable
      • Set RankHashtable = (Last created hashtable)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Footman)) and do (Actions)
        • Loop - Actions
          • Set RankUnit = (Picked unit)
          • Custom script: set udg_RankKey = GetHandleId(udg_RankUnit)
          • Set RankUnitKill = 0
          • Hashtable - Save RankUnitKill as (Key UnitKill) of RankKey in RankHashtable

  • RS Event Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Killing unit)) Equal to Footman
          • (Current research level of Iron Forged Swords for (Owner of (Killing unit))) Equal to 3
    • Actions
      • Set RankUnit = (Killing unit)
      • Custom script: set udg_RankKey = GetHandleId(udg_RankUnit)
      • Set RankUnitKill = (Load (Key UnitKill) of RankKey from RankHashtable)
      • Hashtable - Save (RankUnitKill + 1) as (Key UnitKill) of RankKey in RankHashtable
      • Set RankUnitKill = (RankUnitKill + 1)
      • For each (Integer LoopingInteger) from 1 to MaxRank, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RankUnitKill Equal to RankKillRequired[LoopingInteger]
            • Then - Actions
              • Unit Group - Add RankUnit to RankGroup
              • Set TempLoc = (Position of RankUnit)
              • Custom script: if GetLocalPlayer() == GetOwningPlayer(udg_RankUnit) then
              • Custom script: endif
              • Unit - Replace (Killing unit) with a Knight using The old unit's relative life and mana
              • Special Effect - Create a special effect at TempLoc using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
              • Custom script: call RemoveLocation(udg_TempLoc)
            • Else - Actions
 
Status
Not open for further replies.
Top