• 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.

Changing heros

Status
Not open for further replies.
Level 4
Joined
Sep 27, 2009
Messages
119
  • Change Data:
    • Events:
      • Unit - A unit Gains a Level
    • Conditions:
    • Actions:
      • If (All Conditions are Ture) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Owner of (Leveling Hero)) Equal to Player 1 (Red)
          • Level of (Leveling Unit) Equal to (Desired Level)
        • Then - Actions:
          • Set Strength [1] = Strength of (Leveling Hero) (Exclude bonuses)
          • Set Agility [1] = Agility of (Leveling Hero) (Exclude bonuses)
          • Set Intelligence [1] = Intelligence of (Leveling Hero) (Exclude bonuses)
          • Unit - Replace (Leveling Hero) with (Your Unit) using the old unit's relaitve life and mana
        • Else - Actions:
          • Do Nothing
 
Level 15
Joined
Aug 11, 2009
Messages
1,606
I would use something like this:
  • INIT Define Heros
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Hero_Morph_Array[1] = Paladin
      • Set Hero_Morph_Array[2] = Archmage
      • Set Hero_Morph_Array[3] = Mountain King
      • Set Hero_Morph_Array[4] = Blood Mage
      • Set Hero_Morph_Array[5] = Keeper of the Grove
      • Set Hero_Morph_Array[6] = Priestess of the Moon
      • Set Hero_Morph_Array[7] = Demon Hunter
      • Set Hero_Morph_Array[8] = Warden

  • Hero Levels Up
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Hero level of (Triggering unit)) mod 2) Equal to 0
    • Actions
      • Custom script: local integer HLOOP
      • Custom script: set HLOOP=1
      • Custom script: loop
      • Custom script: exitwhen HLOOP > 7
      • Custom script: if ( GetUnitTypeId(GetLevelingUnit()) == udg_Hero_Morph_Array[HLOOP] ) then
      • For each (Integer B) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Item_Morph_Array[(Integer B)] = (Item carried by (Triggering unit) in slot (Integer B))
      • Unit - Hide (Triggering unit)
      • Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + has leveled up! A new hero will be spawned.)
      • Custom script: call CreateNUnitsAtLocFacingLocBJ( 1, udg_Hero_Morph_Array[( HLOOP + 1 )], GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()) )
      • Trigger - Turn off (This trigger)
      • Hero - Set (Last created unit) Hero-level to (Hero level of (Triggering unit)), Show level-up graphics
      • Trigger - Turn on (This trigger)
      • For each (Integer B) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Give Item_Morph_Array[(Integer B)] to (Last created unit)
      • Unit - Remove (Triggering unit) from the game
      • Custom script: set HLOOP = 100
      • Custom script: endif
      • Custom script: set HLOOP = HLOOP + 1
      • Custom script: endloop
 
I would use something like this:
  • INIT Define Heros
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Hero_Morph_Array[1] = Paladin
      • Set Hero_Morph_Array[2] = Archmage
      • Set Hero_Morph_Array[3] = Mountain King
      • Set Hero_Morph_Array[4] = Blood Mage
      • Set Hero_Morph_Array[5] = Keeper of the Grove
      • Set Hero_Morph_Array[6] = Priestess of the Moon
      • Set Hero_Morph_Array[7] = Demon Hunter
      • Set Hero_Morph_Array[8] = Warden

  • Hero Levels Up
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Hero level of (Triggering unit)) mod 2) Equal to 0
    • Actions
      • Custom script: local integer HLOOP
      • Custom script: set HLOOP=1
      • Custom script: loop
      • Custom script: exitwhen HLOOP > 7
      • Custom script: if ( GetUnitTypeId(GetLevelingUnit()) == udg_Hero_Morph_Array[HLOOP] ) then
      • For each (Integer B) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Item_Morph_Array[(Integer B)] = (Item carried by (Triggering unit) in slot (Integer B))
      • Unit - Hide (Triggering unit)
      • Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + has leveled up! A new hero will be spawned.)
      • Custom script: call CreateNUnitsAtLocFacingLocBJ( 1, udg_Hero_Morph_Array[( HLOOP + 1 )], GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()) )
      • Trigger - Turn off (This trigger)
      • Hero - Set (Last created unit) Hero-level to (Hero level of (Triggering unit)), Show level-up graphics
      • Trigger - Turn on (This trigger)
      • For each (Integer B) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Give Item_Morph_Array[(Integer B)] to (Last created unit)
      • Unit - Remove (Triggering unit) from the game
      • Custom script: set HLOOP = 100
      • Custom script: endif
      • Custom script: set HLOOP = HLOOP + 1
      • Custom script: endloop

because you use the condition HeroLevel Mod2 = 0 this will only work for levels of even numbers right? and this system will need items but I guess its good...
 
Status
Not open for further replies.
Top