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

Can anyone show me how to make a kill a unit quest ?

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2010
Messages
950
Just to give you a quick example of how i did some quests in one of my rpgs I'll post this here for you.

I did it quick to begin with and didnt remove unitgroup or playergroup leaks but im sure you know how to do that..

This is an example of you talking to 1 soldier and getting a job then completing the job and returning for your reward:

This is the text in the first transmission:
Hello starting hero. I have a job for you to do. To the |cff7777aaEast|r is a group of |cff7777aaHelpless Dreanei Guardians.|r Although I could send out some of the guards we need them positioned north. Go now and kill 20 of them.
  • Elite Guard 1
    • Events
      • Unit - A unit comes within 150.00 of Elite Guard 0371 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Trigger - Turn on Who pressed Esc <gen>
      • Unit - Pause all units
      • Cinematic - Turn cinematic mode On for (All players)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Picked player) to (Position of Elite Guard 0371 <gen>) with height 100.00 above the terrain over 0.00 seconds
      • Game - Display to (All players) for 12.00 seconds the text: Hello starting hero...
      • Cinematic - Send transmission to (All players) from Elite Guard 0371 <gen> named Knight:: Play No sound and display Hello starting hero.... Modify duration: Add 9.00 seconds and Don't wait
      • Wait 12.00 seconds
      • Unit - Unpause all units
      • Cinematic - Turn cinematic mode Off for (All players)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Reset camera for (Picked player) to standard game-view over 4.00 seconds
      • Set dreanei = 0
      • Trigger - Turn on Dreanei <gen>
      • Trigger - Turn off Who pressed Esc <gen>
      • Unit - Pause Elite Guard 0500 <gen>
      • Unit - Pause Elite Guard 0504 <gen>
This ones off until first one is triggered
  • Dreanei
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Helpless Dreanei Guardian
    • Actions
      • Set dreanei = (dreanei + 1)
      • Game - Display to (All players) the text: (Dreanei Killed: + (String(dreanei)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • dreanei Greater than or equal to 20
        • Then - Actions
          • Game - Display to (All players) the text: Return to the Elite...
          • Trigger - Turn off (This trigger)
          • Trigger - Turn on Elite Guard 2 <gen>
        • Else - Actions
  • Elite Guard 2
    • Events
      • Unit - A unit comes within 150.00 of Elite Guard 0371 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Trigger - Turn on Who pressed Esc <gen>
      • Unit - Pause all units
      • Cinematic - Turn cinematic mode On for (All players)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Picked player) to (Position of Elite Guard 0371 <gen>) with height 100.00 above the terrain over 0.00 seconds
      • Cinematic - Send transmission to (All players) from Elite Guard 0371 <gen> named Knight:: Play No sound and display Thanks, we should n.... Modify duration: Add 6.00 seconds and Don't wait
      • Wait 9.00 seconds
      • Unit - Unpause all units
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
            • Then - Actions
              • Hero - Add 150 experience to (Picked unit), Show level-up graphics
            • Else - Actions
      • Cinematic - Turn cinematic mode Off for (All players)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Reset camera for (Picked player) to standard game-view over 4.00 seconds
      • Trigger - Turn off Who pressed Esc <gen>
      • Unit - Pause Elite Guard 0500 <gen>
      • Unit - Pause Elite Guard 0504 <gen>
This is the text in that last transmission:
Thanks, we should now be able to move freely from here to the Desert without the dreanei in the way.
|cff7777aaReward : 150 xp (all heroes)|r

Hope I helped :)

Also theres other ways to do this that dont stop all players from doing stuff but this is a pretty typical way of doing things.. Also i has another trigger that is turned on when these are player to warn player not to press esc during them, they have 1 warning then if they keep pressing Esc they are kicked from the game, reason i did this is because the way i made the transmission if they pressed esc the spoken text would go away but the scene would keep talking with nothing to read, it was lame. That fixed the problem fast needless to say xD

(for your situation just give the reward or xp and/or gold to the owner of triggering unit that returned *not to all picked player* also i was lazy so didnt bother to clean the group leaks lol)
 
Level 16
Joined
Oct 17, 2009
Messages
1,580
sorry but thats not what i wanted but +rep for trying to help me.
What i wanted was this:
a unit buys a quest at a shop then the quest will appear at the quest tab but can only be completed by the owner of the buying unit.
 
Level 13
Joined
Mar 24, 2010
Messages
950
I wasnt sure if you want it to be a multi unit kill mission or not, but if so its much easier than the middle trigger i send you. You just make a trigger that if that guy dies missions over.. etc.

  • Elite Guard 1
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • ((Buying unit) is A Hero) Equal to True
      • (Item-type of (Item being manipulated)) Equal to (your item)
    • Actions
      • Trigger - Turn off (This trigger)
      • Set Mission_1_Unit = (Buying unit)
      • Unit - Pause (Buying unit)
      • Cinematic - Turn cinematic mode On for (Player group((Owner of (Buying unit))))
      • Camera - Pan camera for (Owner of (Buying unit)) to (Position of (Triggering unit)) with height 100.00 above the terrain over 0.00 seconds
      • Game - Display to (All players) for 12.00 seconds the text: what u wanna say
      • Cinematic - Send transmission to (Player group((Owner of (Buying unit)))) from Elite Guard 0371 <gen> named Knight:: Play No sound and display Hello starting hero.... Modify duration: Add 9.00 seconds and Don't wait
      • Wait 12.00 seconds
      • Unit - Unpause (Buying unit)
      • Cinematic - Turn cinematic mode Off for (Player group((Owner of (Buying unit))))
      • Camera - Reset camera for (Owner of (Buying unit)) to standard game-view over 4.00 seconds
      • Set dreanei = 0
      • Trigger - Turn on Dreanei <gen>
This triggers off to start with
  • Dreanei
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Helpless Dreanei Guardian
    • Actions
      • Set dreanei = (dreanei + 1)
      • Game - Display to (Player group((Owner of Mission_1_Unit))) the text: (Dreanei Killed: + (String(dreanei)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • dreanei Greater than or equal to 20
        • Then - Actions
          • Game - Display to (Player group((Owner of Mission_1_Unit))) the text: Return to the Elite...
          • Trigger - Turn off (This trigger)
          • Trigger - Turn on Elite Guard 2 <gen>
        • Else - Actions
This one is too
  • Elite Guard 2
    • Events
      • Unit - A unit comes within 150.00 of Elite Guard 0371 <gen>
    • Conditions
      • (Triggering unit) Equal to Mission_1_Unit
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Pause (Triggering unit)
      • Cinematic - Turn cinematic mode On for (Player group((Owner of (Triggering unit))))
      • Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) with height 100.00 above the terrain over 0.00 seconds
      • Cinematic - Send transmission to (Player group((Owner of (Triggering unit)))) from Elite Guard 0371 <gen> named Knight:: Play No sound and display Thanks, we should n.... Modify duration: Add 6.00 seconds and Don't wait
      • Wait 9.00 seconds
      • Unit - Unpause (Triggering unit)
      • -------- WHATEVER REWARD YOU WANNA GIVE FOR IT XP GOLD ETC.. --------
      • Hero - Add 150 experience to (Triggering unit), Show level-up graphics
      • Player - Add 250 to (Owner of (Triggering unit)) Current gold
      • Cinematic - Turn cinematic mode Off for (Player group((Owner of (Triggering unit))))
      • Camera - Reset camera for (Owner of (Triggering unit)) to standard game-view over 4.00 seconds
hope this is more what you wanted.. its for 1 player hero
 
Last edited:
Level 17
Joined
Jun 17, 2010
Messages
2,275
If you want the quests available to all and work for all players this might help

  • Scientists shopping list
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to |c0000ff00Scientists shopping list.|r - Repeatable
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ScientistsShoppinglistinuse Equal to 0.00
        • Then - Actions
          • Game - Display to (All players) the text: |c0000ff00Quest add...
          • Item - Remove (Item being manipulated)
          • Quest - Create a Optional quest titled Scientists Shopping... with the description Gather 5 Wolf brain..., using icon path ReplaceableTextures\CommandButtons\BTNPhoenixEgg.blp
          • Set ScientistsShoppinglist = (Last created quest)
          • Set ScientistsShoppinglistinuse = 1.00
          • Set ScientistsShoppingListcount = 5
        • Else - Actions
          • Item - Remove (Item being manipulated)
  • Scientists shoppinglist count
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to Snow Wolf
          • (Unit-type of (Dying unit)) Equal to Big Snow wolf
      • ScientistsShoppingListcount Greater than 0
      • (Owner of (Killing unit)) Not equal to Player 11 (Dark Green)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ScientistsShoppingListcount Greater than 1
        • Then - Actions
          • Set ScientistsShoppingListcount = (ScientistsShoppingListcount - 1)
          • Game - Display to (All players) the text: ((String(ScientistsShoppingListcount)) + Wolf brains left)
        • Else - Actions
          • Set ScientistsShoppingListcount = (ScientistsShoppingListcount - 1)
          • Game - Display to (All players) the text: |c00ffff00Quest com...
          • Set ScientistsShoppingListcomplete = 1.00
  • Scientists shoppinglist complete
    • Events
      • Unit - A unit comes within 200.00 of Erak the hunter 0081 <gen>
    • Conditions
      • ScientistsShoppingListcomplete Greater than or equal to 1.00
    • Actions
      • Quest - Destroy ScientistsShoppinglist
      • Game - Display to (All players) the text: |c0000ff00Scientist...
      • Player - Add 100 to Player 1 (Red) Current gold
      • Player - Add 100 to Player 2 (Blue) Current gold
      • Player - Add 100 to Player 3 (Teal) Current gold
      • Player - Add 100 to Player 4 (Purple) Current gold
      • Player - Add 100 to Player 5 (Yellow) Current gold
      • Player - Add 100 to Player 6 (Orange) Current gold
      • Player - Add 100 to Player 7 (Green) Current gold
      • Player - Add 100 to Player 8 (Pink) Current gold
      • Hero - Add 1000 experience to P1_Hero, Show level-up graphics
      • Hero - Add 1000 experience to P2_Hero, Show level-up graphics
      • Hero - Add 1000 experience to P3_Hero, Show level-up graphics
      • Hero - Add 1000 experience to P4_Hero, Show level-up graphics
      • Hero - Add 1000 experience to P5_Hero, Show level-up graphics
      • Hero - Add 1000 experience to P6_Hero, Show level-up graphics
      • Hero - Add 1000 experience to P7_Hero, Show level-up graphics
      • Hero - Add 1000 experience to P8_Hero, Show level-up graphics
      • Set ScientistsShoppingListcomplete = 0.00
      • Set ScientistsShoppinglistinuse = 0.00
You can change it any way you want this is just a way to help you

Edit: Oh btw the item acquired is the actually quest in the quest givers selling list
 
Level 16
Joined
Oct 17, 2009
Messages
1,580
ok both of you are correct but for bond after I bought the quest then my friend also bought the quest but my friend can't do the quest because i already have it, i need the quest to be doable by other players who bought it even at the same time. as for infinate when i bought the quest but he didn't he can still complete the quest, i need the quest to be only completed by the buying unit and doable by other players who bought it, at the same time.
if you still don't understand me try playing twilight's eve with your friends.
 
Level 17
Joined
Jun 17, 2010
Messages
2,275
Well if your willing to create a few variables. First make an array variable for all the players in the game. It will require a few multi actions.
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • PlayerVariable[1] Equal to 0.00
        • Owner of (Unit of item being manipulated) equal to Player 1
      • Then - Actions
        • Game - Display to Player 1 the text: |c0000ff00Quest add...
        • Item - Remove (Item being manipulated)
        • Quest - Create a Optional quest titled Scientists Shopping... with the description Gather 5 Wolf brain..., using icon path ReplaceableTextures\CommandButtons\BTNPhoenixEgg.blp
        • Set QuestVariable = (Last created quest)
        • Set PlayerVariable[1] = 1.00
        • Set QuestCount[1] = 5
        • Else - Actions
          • Item - Remove (Item being manipulated)
You have to recreate this for each player with an array +1 for the different players this should fix the choosing a quest and it being seperate. But you also have to change the other triggers to match this one with the arrays.
  • Owner of (Killing unit) equal to Player 1-10(or whatever players u have)
Is needed in the second one as seperate multi actions so just add that into the multi action in the second trigger and reproduce it for each player
Is need and youll need a new variable for the completion with an array and mutli actions in the 3rd to give the reward to only the completer. If you dont know what to change to array just post what you made so far with what i gave you and ill tell you what to change.
 
Level 13
Joined
Mar 24, 2010
Messages
950
  • Elite Guard 1
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • ((Buying unit) is A Hero) Equal to True
      • (Item-type of (Item being manipulated)) Equal to (your item)
      • Mission_1_Bool[(Player number of (Owner of (Buying unit)))] Equal to False
    • Actions
      • Trigger - Turn off (This trigger)
      • Set Mission_1_Bool[(Player number of (Owner of (Buying unit)))] Equal to True
      • Set Mission_1_Unit[(Player number of (Owner of (Buying unit)))] = (Buying unit)
      • Unit - Pause (Buying unit)
      • Cinematic - Turn cinematic mode On for (Player group((Owner of (Buying unit))))
      • Camera - Pan camera for (Owner of (Buying unit)) to (Position of (Triggering unit)) with height 100.00 above the terrain over 0.00 seconds
      • Game - Display to (All players) for 12.00 seconds the text: what u wanna say
      • Cinematic - Send transmission to (Player group((Owner of (Buying unit)))) from Elite Guard 0371 <gen> named Knight:: Play No sound and display Hello starting hero.... Modify duration: Add 9.00 seconds and Don't wait
      • Wait 12.00 seconds
      • Unit - Unpause (Buying unit)
      • Cinematic - Turn cinematic mode Off for (Player group((Owner of (Buying unit))))
      • Camera - Reset camera for (Owner of (Buying unit)) to standard game-view over 4.00 seconds
      • Set dreanei[(Player number of (Owner of (Buying unit)))] = 0
      • Trigger - Turn on (This trigger)
This triggers on to start with now
  • Dreanei
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Helpless Dreanei Guardian
      • Mission_1_Bool[(Player number of (Owner of (Killing unit)))] Equal to True
    • Actions
      • Set dreanei[(Player number of (Owner of (Killing unit)))] = (dreanei[(Player number of (Owner of (Killing unit)))] + 1)
      • Game - Display to (Player group((Owner of Mission_1_Unit[(Player number of (Owner of (Killing unit)))]))) the text: (Dreanei Killed: + (String(dreanei[(Player number of (Owner of (Killing unit)))])))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • dreanei[(Player number of (Owner of (Killing unit)))] Greater than or equal to 20
        • Then - Actions
          • Game - Display to (Player group((Owner of Mission_1_Unit[(Player number of (Owner of (Killing unit)))]))) the text: Return to the Elite...
        • Else - Actions
This one is on now too always
  • Elite Guard 2
    • Events
      • Unit - A unit comes within 150.00 of Elite Guard 0371 <gen>
    • Conditions
      • (Triggering unit) Equal to Mission_1_Unit
      • Mission_1_Bool[(Player number of (Owner of (Triggering unit)))] Equal to True
      • dreanei[(Player number of (Owner of (Triggering unit)))] Greater than or equal to 20
    • Actions
      • Set Mission_1_Bool[(Player number of (Owner of (Triggering unit)))] Equal to False
      • Unit - Pause (Triggering unit)
      • Cinematic - Turn cinematic mode On for (Player group((Owner of (Triggering unit))))
      • Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) with height 100.00 above the terrain over 0.00 seconds
      • Cinematic - Send transmission to (Player group((Owner of (Triggering unit)))) from Elite Guard 0371 <gen> named Knight:: Play No sound and display Thanks, we should n.... Modify duration: Add 6.00 seconds and Don't wait
      • Wait 9.00 seconds
      • Unit - Unpause (Triggering unit)
      • -------- WHATEVER REWARD YOU WANNA GIVE FOR IT XP GOLD ETC.. --------
      • Hero - Add 150 experience to (Triggering unit), Show level-up graphics
      • Player - Add 250 to (Owner of (Triggering unit)) Current gold
      • Cinematic - Turn cinematic mode Off for (Player group((Owner of (Triggering unit))))
      • Camera - Reset camera for (Owner of (Triggering unit)) to standard game-view over 4.00 seconds
I changed this real fast within this so if i made some mistakes its because i did it real quick just changing the text i had from my old post to fit better what you wanted. Hope its good now for ya
 
Status
Not open for further replies.
Top