[Trigger] Quest Trig help..

Status
Not open for further replies.
Level 2
Joined
Feb 24, 2008
Messages
17
Hmmm I need help with a quest trigger...

What I want is they have to kill a number of units in order for the quest to be completed BUT! They then have to go back to the person they got the quest from and then talk to them to complete it! I don't understand how to increase for when they kill the specific unit. so like: 1/10-->2/10--->3/10 etc. But I can't get it to work.. haha... :hohum: so if anyone could help thank you!

(Also the quests startes are kinda confusing im usin a basic attack the unit to start the quest.. I want a click the hero While close to them! trigger for this.. Here is my curretn "Attack" start trigger
  • Quest2Real
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Targeted unit)) Equal to Frank Ferden (Male)
    • Actions
      • Game - Display to (All players) the text: Frank: Hello there ...
      • Quest - Create a Optional quest titled River Watcher with the description Slay 10 Murloc rive..., using icon path ReplaceableTextures\CommandButtons\BTNMurloc.blp
      • Set Quest1[1] = (Last created quest)
      • Quest - Display to (All players) the Quest Update message: New Quest! River Wa...
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at (Position of Frank Ferden (Male) 0117 <gen>) using Objects\RandomObject\RandomObject.mdl
      • Quest - Create a quest requirement for Quest1[1] with the description Kill 10 Murloc Rive...
      • Trigger - Turn off Quest2Real <gen>
Please help :xxd: ) thanks!
 
Level 5
Joined
Aug 16, 2007
Messages
149
hmm two triggers should do it. Following to count unit kills, after that to return to quest person.
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Murloc
    • Actions
      • Set UnitsKilled = (UnitsKilled + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UnitsKilled Equal to 10
        • Then - Actions
          • Quest - Display to Player Group - Player 1 (Red) the Quest Update message: You have killed 10 ...
          • Trigger - Turn on Untitled Trigger 002 <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Quest - Display to Player Group - Player 1 (Red) the Quest Update message: ((String((10 - UnitsKilled))) + more murlocs to go!)
  • Untitled Trigger 002
    • Events
      • Unit - A unit comes within 256.00 of Quest Giver
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UnitsKilled Equal to 10
        • Then - Actions
          • Quest - Enable (Last created quest)
          • Quest - Display to (All players) the Quest Discovered message: Kill 10 murlocs and...
        • Else - Actions
          • Quest - Display to (All players) the Quest Completed message: Thank you for killi...
          • Item - Create Reward at (Position of (Triggering unit))
          • Quest - Mark (Last created quest) as Completed
just change (Last created quest) to your quest and the condition to whatever you want where it says Murloc. And of course change the quest messages to what you want.
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
Here is a small example how how variables work.
Event
A guy eats taco.
Condition
Action
If, then, else Condition
If
Value of taco_left = 1 or more.
Then - Actions
Eat more tacos.
Set taco_left = taco_left - 1
Else - Actions
Buy more tacos.
Set taco_left = taco_left + 5

taco_left is an Integer variable which in this case tells how much taco(s) are left.


If you need any more help these instruction should lead you in the right direction.
Though the first trigger which gives, finishes quests and allow you to interact with the NPC is functional for multiplayer as well as singleplayer.
Don't get scared of all these triggers. Some of them are just to create some interactive between the NCP and the player.
To get this [(Player number of (Owner of (Killing unit)))] you need to set arrays(the amount of players) to the variables which are used in these triggers.
Count_Killed_Units is an integer variable with arrays.(the amount of players)
Quest_Pig_Hunt is also an integer variable with arrays.(the amount of players)
  • ReciveQuest
    • Events
      • Unit - A unit comes within 256.00 of Farmer'sQ
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] Equal to 0
        • Then - Actions
          • Quest - Display to (All players) the Quest Update message: (Hi, my farm is getting overrunned by some pigs. Could you help me get rid of them + ((Name of (Owner of (Entering unit))) + ?))
          • Set (Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] = (Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] Equal to 1
        • Then - Actions
          • Quest - Display to (All players) the Quest Update message: (Hi, have you killed those horrible pigs yet + ((Name of (Owner of (Entering unit))) + ?))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] Equal to 2
        • Then - Actions
          • Quest - Display to (All players) the Quest Update message: (((Thanks + (Name of (Owner of (Entering unit)))) + for getting ridd of those pigs for me. Here take this item.) + <Empty String>)
          • Set Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] = (Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] Equal to 3
        • Then - Actions
          • Quest - Display to (All players) the Quest Update message: Hi, there.
        • Else - Actions
AS you've seen, there are 4 stages in this trigger.
1: The entering player gets the quest by giving his variable (Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] the value 1.
2: When the player returns with the (Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] still with the value 1 the player gets to know that the quest isn't done yet.
3: When the player returns from finishing the quest he gets an item
4: Every time the player walks around the quest giver he says "Hi, there!"
First you need a trigger that counts how many quest units you've killed which will for fill the first trigger. It Should look simulare to this:

  • CountKilledUnit - Works in multiplayer
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • Quest_Pig_Hunt[(Player number of (Owner of (Killing unit)))] Equal to 1
          • (Unit-type of (Dying unit)) Equal to Pig
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Count_Killed_Units[(Player number of (Owner of (Killing unit)))] Less than 10
        • Then - Actions
          • Set Count_Killed_Units[(Player number of (Owner of (Killing unit)))] = (Count_Killed_Units[(Player number of (Owner of (Killing unit)))] + 1)
          • Game - Display to (All players) the text: (((Name of (Owner of (Killing unit))) + has killed ) + (String(Count_Killed_Units[(Player number of (Owner of (Killing unit)))])))
        • Else - Actions
          • Quest - Display to (All players) the Quest Update message: (((Name of (Owner of (Killing unit))) + has completed the quest and killed ) + (String(Count_Killed_Units[(Player number of (Owner of (Killing unit)))])))
          • Set (Quest_Pig_Hunt[(Player number of (Owner of (Killing Unit)))] = (Quest_Pig_Hunt[(Player number of (Owner of (Killing Unit)))] + 1)
This trigger gives the makes it possible for the player to complete the quest by setting (Quest_Pig_Hunt[(Player number of (Owner of (Killing Unit)))] to value 2 which tells the first trigger that you've completed the quest.
Enjoy.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
redmarine, whats up with your tacco ? you like tacco ? you always post that thing lol.

Anyway, if people can't think of that themselves (come on... set var = var - 1 ?) then they are probably too nubs (meaning another word but im not going to say un-nice things lol) to use the WE !
 
Status
Not open for further replies.
Top