[Trigger] Help Quest trigger!

Level 2
Joined
Feb 24, 2008
Messages
17
Hi everyone.. I was looking for a lil help on this quest trigger... It s a kill this many units kind of quest... I got the killing to record.. But it does not display how many they killed... Like 1/10 so on... here is my trigger:
  • Quest2Killing
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Murloc River Dweller
      • (Owner of (Dying unit)) Equal to Player 12 (Brown)
    • 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
          • Game - Display to (All players) the text: ((Name of (Dying unit)) + ((String(10)) + (String((1 + 1)))))
          • Quest - Display to (All players) the Quest Update message: You have slayin 10 ...
          • Trigger - Turn on Quest2Complete <gen>
          • Trigger - Turn off Quest2Killing <gen>
        • Else - Actions
          • Do nothing
That is the actual recording trigger... Here is the starting
  • Quest2Real
    • Events
      • Unit - Frank Ferden (Male) 0117 <gen> Is selected
    • Conditions
      • (Unit-type of (Picked unit)) Equal to Frank Ferden (Male)
    • Actions
      • Unit Group - Pick every unit in (Units within 35.00 of (Position of Frank Ferden (Male) 0117 <gen>)) and do (Actions)
        • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Picked unit)) Equal to Frank Ferden (Male)
        • Then - 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)
          • Special Effect - Destroy Questmark
          • Quest - Display to (All players) the Quest Update message: New Quest! River Wa...
          • Special Effect - Create a special effect attached to the overhead 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...
          • Set QuestmarkReturn = (Last created special effect)
          • Trigger - Turn on Quest2Killing <gen>
          • Trigger - Turn off Quest2Real <gen>
        • Else - Actions
And here's the finish...
  • Quest2Complete
    • Events
      • Unit - A unit comes within 35.00 of Frank Ferden (Male) 0117 <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UnitsKilled Equal to 10
        • Then - Actions
          • Quest - Display to (All players) the Quest Completed message: Frank: Thank you fo...
          • 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
          • Player Group - Pick every player in (All players) and do (Hero - Add 250 experience to (Triggering unit), Show level-up graphics)
          • Trigger - Turn off (This trigger)
        • Else - Actions
If anyone could help :p thank you!
 
Level 19
Joined
Aug 16, 2007
Messages
871
I think you should make your Quest2Killing trigger in this way:

  • Quest2Killing
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
      • Set UnitsKilled = (UnitsKilled + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UnitsKilled Greater than or equal to 10
        • Then - Actions
          • Quest - Display to (All players) the Quest Update message: You have killed 10 ...
          • Trigger - Turn on (Quest2Complete)
          • Trigger - Turn off (Quest2Killing)
        • Else - Actions
          • Game - Display to (All players) for 3.00 seconds the text: (|cffffcc00 + ((Name of (Triggering unit)) + (|r Killed: + ((String(UnitsKilled)) + /10))))
I hope this helped :)
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
This is perhaps too much but this works as well as the others do.
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.
 
Top