• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Help with making boss.

Status
Not open for further replies.
Level 2
Joined
Jul 24, 2009
Messages
14
I am trying to make my boss disappear when he is half way dead and have units spawn. Then once i kill the units the boss will come back still half way dead
 

noj

noj

Level 4
Joined
Jan 16, 2006
Messages
89
you could always save the bosses hitpoints using a intiger variable, then when all the units are dead respawn the same unit type as the boss and set its hitpoints back to what the variable stored. (you should also save his mana if he uses magic)

or you could just move the unit to a hidden spot and move him back. (but his hitpoints would still regenerate.)
 
Level 4
Joined
Oct 30, 2009
Messages
34
Here is what I came up with (Using RoC WE)

Trigger 1 NOTE: I used knight and just typed out half his normal hp (400/800) Just use half your bosses hp.
  • Bosstest
    • Events
      • Unit - Knight 0001 <gen>'s life becomes Equal to 400.00
    • Conditions
    • Actions
      • Unit - Move (Attacked unit) instantly to (Center of MoveTo <gen>)
      • Unit - Create 3 Footman for Player 1 (Red) at (Random point in BossFight <gen>) facing Default building facing degrees
      • Trigger - Turn on MinionsDefeat <gen>
      • Trigger - Turn off (This trigger)
Trigger two this will move him back after the units are killed. This trigger is initially off
  • MinionsDefeat
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Footman
    • Actions
      • If ((Number of units in (Units in BossFight <gen> owned by Player 1 (Red))) Equal to 0) then do (Unit - Move Knight 0001 <gen> instantly to (Random point in BossFight <gen>)) else do (Do nothing)
      • Trigger - Turn off (This trigger)
Hope this helps. :D
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
If the unit is preplaced, you can use the even "unit's life becomes less than X". Use "hide unit" action. You should save the boss into a variable. Something like this:

  • Untitled Trigger 022
    • Events
      • Unit - Footman 0001 <gen>'s life becomes Less than 50.00
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Hide Boss_Unit
      • Set Temp_Loc_1 = (Center of Some Region <gen>)
      • Unit - Create 1 Footman for Player 1 (Red) at Temp_Loc_1 facing Default building facing degrees
      • Unit Group - Add (Last created unit) to Temp_Group_1
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
      • Trigger - Turn on (Untitled Trigger 024)
  • Untitled Trigger 024
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Unit Group - Remove (Triggering unit) from Temp_Group_1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Temp_Group_1 is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Unit - Unhide Boss_Unit
        • Else - Actions
This trigger is initially off.
 
Level 3
Joined
Apr 29, 2009
Messages
32
Using variable BossLoc (Point)
  • Events
    • Unit - A unit Is attacked
  • Conditions
    • (Unit-type of (Attacked unit)) Equal to Boss
    • (Integer((Life of (Attacked unit)))) Less than or equal to ((Integer((Max life of (Attacked unit)))) / 2)
  • Actions
    • Set BossLoc = (Position of (Attacked unit))
    • Unit - Create SpawnedUnits Peasant for Player # (Color) at BossLoc facing Default building facing degrees
    • Unit - Remove (Attacked unit) from the game
    • Trigger - Turn on BossFightSpawn <gen>
    • Trigger - Turn off (This trigger)
Using variable SpawnedUnits (Integer Initial Value = Amount of units you want) for 2nd trigger
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Unit
  • Actions
    • Set SpawnedUnits = (SpawnedUnits - 1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • SpawnedUnits Equal to 0
      • Then - Actions
        • Unit - Create 1 Boss for Player # (Color) at BossLoc facing Default building facing degrees
        • Unit - Set life of (Last created unit) to ((Max life of (Last created unit)) / 2.00)
      • Else - Actions
    • Custom script: call RemoveLocation(udg_BossLoc)
Hope it helps! Good luck!
 
Status
Not open for further replies.
Top