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

[Solved] Unit Type from Hashtable problem

Status
Not open for further replies.
Hello, can someone help me?

So I made a hunting quest system, and for some reason when I talk to the Rifleman (Trigger 'Hunter 1') it's not getting the UnitType[1] stored in the array, but when I talk to the Priest (Trigger 'Hunter 2') it is getting the UnitType[2] in the array. Can someone help me figure out the problem?

I also provided screenshots

Notes
• QR_HuntingTargetKillAmounts[] and QR_HuntingTargetKillAmount are disabled actions, so should not overwriting the unit type stored in the hashtable.
• I'll fix the point leaks later.


  • Quest Repeatable Register Targets Hunting
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set QF_Index = 1
      • Trigger - Run Quest Repeatable Register Targets Hunting 1 <gen> (ignoring conditions)
      • Game - Display to (All players) the text: (String(QR_HuntingTargetUnitTypeMax[QF_Index]))
      • -------- --------
      • Set QF_Index = 2
      • Trigger - Run Quest Repeatable Register Targets Hunting 2 <gen> (ignoring conditions)
      • Game - Display to (All players) the text: (String(QR_HuntingTargetUnitTypeMax[QF_Index]))
  • Quest Repeatable Hunter
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • Set QF_Index = 1
      • Trigger - Run Quest Repeatable Hunter 1 <gen> (checking conditions)
      • -------- --------
      • Set QF_Index = 2
      • Trigger - Run Quest Repeatable Hunter 2 <gen> (checking conditions)
  • Quest Repeatable Finish Hunting
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set QF_Index = 1
      • Trigger - Run Quest Repeatable Finish Hunting 1 <gen> (checking conditions)
      • -------- --------
      • Set QF_Index = 2
      • Trigger - Run Quest Repeatable Finish Hunting 2 <gen> (checking conditions)
  • Quest Repeatable Register Targets Hunting 1
    • Events
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set QR_HuntingHashtable[QF_Index] = (Last created hashtable)
      • -------- --------
      • Set QR_HuntingTargetUnitTypeMax[QF_Index] = 0
      • -------- --------
      • Set QR_HuntingTargetUnitTypeMax[QF_Index] = (QR_HuntingTargetUnitTypeMax[QF_Index] + 1)
      • Set QR_HuntingTargetUnitTypes[QR_HuntingTargetUnitTypeMax[QF_Index]] = Grunt
      • Set QR_HuntingTargetKillAmounts[QR_HuntingTargetUnitTypeMax[QF_Index]] = 6
      • Custom script: call SaveIntegerBJ( udg_QR_HuntingTargetUnitTypes[udg_QR_HuntingTargetUnitTypeMax[udg_QF_Index]], udg_QR_HuntingTargetUnitTypeMax[udg_QF_Index], udg_QF_Index, udg_QR_HuntingHashtable[udg_QF_Index] )
      • Hashtable - Save QR_HuntingTargetKillAmounts[QR_HuntingTargetUnitTypeMax[QF_Index]] as QR_HuntingTargetUnitTypeMax[QF_Index] of QF_Index in QR_HuntingHashtable[QF_Index]

  • Quest Repeatable Hunter 1
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Interact - Both (Chain Lightning - Neutral Hostile)
          • (Unit-type of (Target unit of ability being cast)) Equal to Rifleman
        • Then - Actions
          • Set QG_Person[1] = Global_MainHero
          • Set QG_Person[2] = (Target unit of ability being cast)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (QG_Person[2] is in QG_QuestUnitNotDoneGroup) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • QR_HuntingIsActive[QF_Index] Equal to False
                • Then - Actions
                  • -------- --------
                  • -------- Random generation does not work inside the cinematic as told by DSG --------
                  • Set QG_JobType = Hunting
                  • -------- --------
                  • Set QG_Randomizer = (Random integer number between 1 and QR_HuntingTargetUnitTypeMax[QF_Index])
                  • Custom script: set udg_QR_HuntingTargetUnitType[udg_QF_Index] = LoadIntegerBJ(udg_QG_Randomizer, udg_QF_Index, udg_QR_HuntingHashtable[udg_QF_Index])
                  • Game - Display to (All players) the text: (String(QG_Randomizer))
                  • Game - Display to (All players) the text: (String(QF_Index))
                  • Set QR_HuntingTargetKillAmount[QF_Index] = (Load QG_Randomizer of QF_Index from QR_HuntingHashtable[QF_Index])
                  • -------- --------
                  • Unit - Create 1 QR_HuntingTargetUnitType[QF_Index] for Neutral Passive at (Center of (Playable map area)) facing Default building facing degrees
                  • Set QR_HuntingTitle[QF_Index] = (QG_JobType + :) + (Name of (Last created unit))))
                  • Set QR_HuntingDescription[QF_Index] = (Kill atleast + ((String(QR_HuntingTargetKillAmount[QF_Index])) + ( of + (Name of (Last created unit)))))
                  • Unit - Remove (Last created unit) from the game
                  • -------- --------
                  • Cinematic - Turn cinematic mode On for (All players)
                  • Cinematic - Enable user control for (All players)
                  • Unit - Make QG_Person[1] face QG_Person[2] over 0.00 seconds
                  • Unit - Make QG_Person[2] face QG_Person[1] over 0.00 seconds
                  • Unit - Pause QG_Person[2]
                  • -------- --------
                  • -------- Conversation --------
                  • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
                  • Cinematic - Send transmission to (All players) from QG_Person[1] named (Name of QG_Person[1]): Play No sound and display I hear that you hav.... Modify duration: Set to 3.00 seconds and Wait
                  • -------- --------
                  • -------- Conversation --------
                  • Unit - Create 1 QR_HuntingTargetUnitType[QF_Index] for Neutral Passive at (Center of (Playable map area)) facing Default building facing degrees
                  • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
                  • Cinematic - Send transmission to (Player group(Player 1 (Red))) from QG_Person[2] named (Name of QG_Person[2]): Play No sound and display (Are you willing to hunt for some + ((Name of (Last created unit)) + ?)). Modify duration: Set to 6.00 seconds and Wait
                  • Unit - Remove (Last created unit) from the game
                  • -------- --------
                  • -------- Create dialog --------
                  • Dialog - Clear QG_QuestAcceptDialog
                  • Dialog - Change the title of QG_QuestAcceptDialog to QR_HuntingTitle[QF_Index]
                  • Dialog - Create a dialog button for QG_QuestAcceptDialog labelled Accept
                  • Set QG_QuestAcceptDialogButton[1] = (Last created dialog Button)
                  • Dialog - Create a dialog button for QG_QuestAcceptDialog labelled Ignore
                  • Set QG_QuestAcceptDialogButton[9] = (Last created dialog Button)
                  • Dialog - Show QG_QuestAcceptDialog for Player 1 (Red)
                  • Set QG_QuestDialogButtonClicked = 0
                  • Wait until (QG_QuestDialogButtonClicked Not equal to 0), checking every 0.10 seconds
                  • -------- --------
                  • -------- Here's where player picks whether he approves or disapproves the quest --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • QG_QuestDialogButtonClicked Equal to 1
                    • Then - Actions
                      • -------- --------
                      • Game - Display to (All players) the text: ([Quest Discovered - " + (QR_HuntingTitle[QF_Index] + "]))
                      • Quest - Create a Required quest titled QR_HuntingTitle[QF_Index] with the description |n, using icon path (Icon of Carry - Both (Channel - Load Corpse))
                      • Quest - Create a quest requirement for (Last created quest) with the description QR_HuntingDescription[QF_Index]
                      • Quest - Flash the quest dialog button
                      • Set QR_HuntingQuest[QF_Index] = (Last created quest)
                      • Set QR_HuntingIsActive[QF_Index] = True
                      • -------- --------
                      • Unit Group - Remove QG_Person[2] from QG_QuestUnitNotDoneGroup
                      • Unit Group - Add QG_Person[2] to QG_QuestUnitDoneGroup
                      • Unit - Remove Attachment Quest Indicator (Claws of Attack) from QG_Person[2]
                      • -------- --------
                      • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
                      • Cinematic - Send transmission to (All players) from QG_Person[1] named (Name of QG_Person[1]): Play No sound and display Got it.. Modify duration: Set to 2.00 seconds and Wait
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • QG_QuestDialogButtonClicked Equal to 9
                        • Then - Actions
                          • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
                          • Cinematic - Send transmission to (All players) from QG_Person[1] named (Name of QG_Person[1]): Play No sound and display Pass.. Modify duration: Set to 2.00 seconds and Wait
                        • Else - Actions
                  • Unit - Unpause QG_Person[2]
                  • Cinematic - Turn cinematic mode Off for (All players)
                • Else - Actions
                  • Game - Display to (All players) the text: [Quest given by thi...
            • Else - Actions
        • Else - Actions
  • Quest Repeatable Finish Hunting 1
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QR_HuntingIsActive[QF_Index] Equal to True
          • (Killing unit) Equal to Global_MainHero
          • (Unit-type of (Dying unit)) Equal to QR_HuntingTargetUnitType[QF_Index]
        • Then - Actions
          • Set QR_HuntingTargetCurrentKills[QF_Index] = (QR_HuntingTargetCurrentKills[QF_Index] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • QR_HuntingTargetCurrentKills[QF_Index] Greater than or equal to QR_HuntingTargetKillAmount[QF_Index]
            • Then - Actions
              • Game - Display to (All players) the text: ([Quest Completed - " + (QR_HuntingTitle[QF_Index] + "]))
              • Quest - Destroy QR_HuntingQuest[QF_Index]
              • -------- --------
              • Player - Add 600 to Player 1 (Red) Current gold
              • -------- --------
              • Set QR_HuntingIsActive[QF_Index] = False
              • Set QR_HuntingTargetUnitType[QF_Index] = No unit-type
              • Set QR_HuntingTargetCurrentKills[QF_Index] = 0
              • Set QR_HuntingTargetKillAmount[QF_Index] = 0
            • Else - Actions
        • Else - Actions
  • Quest Repeatable Register Targets Hunting 2
    • Events
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set QR_HuntingHashtable[QF_Index] = (Last created hashtable)
      • -------- --------
      • Set QR_HuntingTargetUnitTypeMax[QF_Index] = 0
      • -------- --------
      • Set QR_HuntingTargetUnitTypeMax[QF_Index] = (QR_HuntingTargetUnitTypeMax[QF_Index] + 1)
      • Set QR_HuntingTargetUnitTypes[QR_HuntingTargetUnitTypeMax[QF_Index]] = Shaman
      • Set QR_HuntingTargetKillAmounts[QR_HuntingTargetUnitTypeMax[QF_Index]] = 6
      • Custom script: call SaveIntegerBJ( udg_QR_HuntingTargetUnitTypes[udg_QR_HuntingTargetUnitTypeMax[udg_QF_Index]], udg_QR_HuntingTargetUnitTypeMax[udg_QF_Index], udg_QF_Index, udg_QR_HuntingHashtable[udg_QF_Index] )
      • Hashtable - Save QR_HuntingTargetKillAmounts[QR_HuntingTargetUnitTypeMax[QF_Index]] as QR_HuntingTargetUnitTypeMax[QF_Index] of QF_Index in QR_HuntingHashtable[QF_Index]

  • Quest Repeatable Hunter 2
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Interact - Both (Chain Lightning - Neutral Hostile)
          • (Unit-type of (Target unit of ability being cast)) Equal to Priest
        • Then - Actions
          • Set QG_Person[1] = Global_MainHero
          • Set QG_Person[2] = (Target unit of ability being cast)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (QG_Person[2] is in QG_QuestUnitNotDoneGroup) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • QR_HuntingIsActive[QF_Index] Equal to False
                • Then - Actions
                  • -------- --------
                  • -------- Random generation does not work inside the cinematic as told by DSG --------
                  • Set QG_JobType = Hunting
                  • -------- --------
                  • Set QG_Randomizer = (Random integer number between 1 and QR_HuntingTargetUnitTypeMax[QF_Index])
                  • Custom script: set udg_QR_HuntingTargetUnitType[udg_QF_Index] = LoadIntegerBJ(udg_QG_Randomizer, udg_QF_Index, udg_QR_HuntingHashtable[udg_QF_Index])
                  • Game - Display to (All players) the text: (String(QG_Randomizer))
                  • Game - Display to (All players) the text: (String(QF_Index))
                  • Set QR_HuntingTargetKillAmount[QF_Index] = (Load QG_Randomizer of QF_Index from QR_HuntingHashtable[QF_Index])
                  • -------- --------
                  • Unit - Create 1 QR_HuntingTargetUnitType[QF_Index] for Neutral Passive at (Center of (Playable map area)) facing Default building facing degrees
                  • Set QR_HuntingTitle[QF_Index] = (QG_JobType + :) + (Name of (Last created unit))))
                  • Set QR_HuntingDescription[QF_Index] = (Kill atleast + ((String(QR_HuntingTargetKillAmount[QF_Index])) + ( of + (Name of (Last created unit)))))
                  • Unit - Remove (Last created unit) from the game
                  • -------- --------
                  • Cinematic - Turn cinematic mode On for (All players)
                  • Cinematic - Enable user control for (All players)
                  • Unit - Make QG_Person[1] face QG_Person[2] over 0.00 seconds
                  • Unit - Make QG_Person[2] face QG_Person[1] over 0.00 seconds
                  • Unit - Pause QG_Person[2]
                  • -------- --------
                  • -------- Conversation --------
                  • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
                  • Cinematic - Send transmission to (All players) from QG_Person[1] named (Name of QG_Person[1]): Play No sound and display I hear that you hav.... Modify duration: Set to 3.00 seconds and Wait
                  • -------- --------
                  • -------- Conversation --------
                  • Unit - Create 1 QR_HuntingTargetUnitType[QF_Index] for Neutral Passive at (Center of (Playable map area)) facing Default building facing degrees
                  • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
                  • Cinematic - Send transmission to (Player group(Player 1 (Red))) from QG_Person[2] named (Name of QG_Person[2]): Play No sound and display (Are you willing to hunt for some + ((Name of (Last created unit)) + ?)). Modify duration: Set to 6.00 seconds and Wait
                  • Unit - Remove (Last created unit) from the game
                  • -------- --------
                  • -------- Create dialog --------
                  • Dialog - Clear QG_QuestAcceptDialog
                  • Dialog - Change the title of QG_QuestAcceptDialog to QR_HuntingTitle[QF_Index]
                  • Dialog - Create a dialog button for QG_QuestAcceptDialog labelled Accept
                  • Set QG_QuestAcceptDialogButton[1] = (Last created dialog Button)
                  • Dialog - Create a dialog button for QG_QuestAcceptDialog labelled Ignore
                  • Set QG_QuestAcceptDialogButton[9] = (Last created dialog Button)
                  • Dialog - Show QG_QuestAcceptDialog for Player 1 (Red)
                  • Set QG_QuestDialogButtonClicked = 0
                  • Wait until (QG_QuestDialogButtonClicked Not equal to 0), checking every 0.10 seconds
                  • -------- --------
                  • -------- Here's where player picks whether he approves or disapproves the quest --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • QG_QuestDialogButtonClicked Equal to 1
                    • Then - Actions
                      • -------- --------
                      • Game - Display to (All players) the text: ([Quest Discovered - " + (QR_HuntingTitle[QF_Index] + "]))
                      • Quest - Create a Required quest titled QR_HuntingTitle[QF_Index] with the description |n, using icon path (Icon of Carry - Both (Channel - Load Corpse))
                      • Quest - Create a quest requirement for (Last created quest) with the description QR_HuntingDescription[QF_Index]
                      • Quest - Flash the quest dialog button
                      • Set QR_HuntingQuest[QF_Index] = (Last created quest)
                      • Set QR_HuntingIsActive[QF_Index] = True
                      • -------- --------
                      • Unit Group - Remove QG_Person[2] from QG_QuestUnitNotDoneGroup
                      • Unit Group - Add QG_Person[2] to QG_QuestUnitDoneGroup
                      • Unit - Remove Attachment Quest Indicator (Claws of Attack) from QG_Person[2]
                      • -------- --------
                      • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
                      • Cinematic - Send transmission to (All players) from QG_Person[1] named (Name of QG_Person[1]): Play No sound and display Got it.. Modify duration: Set to 2.00 seconds and Wait
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • QG_QuestDialogButtonClicked Equal to 9
                        • Then - Actions
                          • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
                          • Cinematic - Send transmission to (All players) from QG_Person[1] named (Name of QG_Person[1]): Play No sound and display Pass.. Modify duration: Set to 2.00 seconds and Wait
                        • Else - Actions
                  • Unit - Unpause QG_Person[2]
                  • Cinematic - Turn cinematic mode Off for (All players)
                • Else - Actions
                  • Game - Display to (All players) the text: [Quest given by thi...
            • Else - Actions
        • Else - Actions
  • Quest Repeatable Finish Hunting 2
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QR_HuntingIsActive[QF_Index] Equal to True
          • (Killing unit) Equal to Global_MainHero
          • (Unit-type of (Dying unit)) Equal to QR_HuntingTargetUnitType[QF_Index]
        • Then - Actions
          • Set QR_HuntingTargetCurrentKills[QF_Index] = (QR_HuntingTargetCurrentKills[QF_Index] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • QR_HuntingTargetCurrentKills[QF_Index] Greater than or equal to QR_HuntingTargetKillAmount[QF_Index]
            • Then - Actions
              • Game - Display to (All players) the text: ([Quest Completed - " + (QR_HuntingTitle[QF_Index] + "]))
              • Quest - Destroy QR_HuntingQuest[QF_Index]
              • -------- --------
              • Player - Add 600 to Player 1 (Red) Current gold
              • -------- --------
              • Set QR_HuntingIsActive[QF_Index] = False
              • Set QR_HuntingTargetUnitType[QF_Index] = No unit-type
              • Set QR_HuntingTargetCurrentKills[QF_Index] = 0
              • Set QR_HuntingTargetKillAmount[QF_Index] = 0
            • Else - Actions
        • Else - Actions

Hunter 1 and Hunter 2 triggers are very similar triggers, the only difference is the condition 'Casting Unit = <Rifleman/Priest>'
 

Attachments

  • WC3ScrnShot_031020_005301_01.png
    WC3ScrnShot_031020_005301_01.png
    2.1 MB · Views: 36
  • WC3ScrnShot_031020_005316_02.png
    WC3ScrnShot_031020_005316_02.png
    2.1 MB · Views: 15
Last edited:
I actually fixed my problem by doing this instead. Thread now marked as Solved.


  • Quest Repeatable Register Targets Hunting
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set QF_Index = 0
      • -------- --------
      • -------- Index --------
      • Set QF_Index = 1
      • Hashtable - Create a hashtable
      • Set QR_HuntingHashtable[QF_Index] = (Last created hashtable)
      • -------- --------
      • Set QR_HuntingTargetUnitTypeMax[QF_Index] = 0
      • -------- --------
      • Set QR_HuntingTargetUnitTypeMax[QF_Index] = (QR_HuntingTargetUnitTypeMax[QF_Index] + 1)
      • Set QR_HuntingTargetUnitTypes[QR_HuntingTargetUnitTypeMax[QF_Index]] = Grunt
      • Set QR_HuntingTargetKillAmounts[QR_HuntingTargetUnitTypeMax[QF_Index]] = 6
      • Custom script: call SaveIntegerBJ( udg_QR_HuntingTargetUnitTypes[udg_QR_HuntingTargetUnitTypeMax[udg_QF_Index]], udg_QR_HuntingTargetUnitTypeMax[udg_QF_Index], udg_QF_Index, udg_QR_HuntingHashtable[udg_QF_Index] )
      • Hashtable - Save QR_HuntingTargetKillAmounts[QR_HuntingTargetUnitTypeMax[QF_Index]] as (QR_HuntingTargetUnitTypeMax[QF_Index] + 32) of QF_Index in QR_HuntingHashtable[QF_Index]
      • -------- --------
      • -------- Index --------
      • Set QF_Index = 2
      • Hashtable - Create a hashtable
      • Set QR_HuntingHashtable[QF_Index] = (Last created hashtable)
      • -------- --------
      • Set QR_HuntingTargetUnitTypeMax[QF_Index] = 0
      • -------- --------
      • Set QR_HuntingTargetUnitTypeMax[QF_Index] = (QR_HuntingTargetUnitTypeMax[QF_Index] + 1)
      • Set QR_HuntingTargetUnitTypes[QR_HuntingTargetUnitTypeMax[QF_Index]] = Shaman
      • Set QR_HuntingTargetKillAmounts[QR_HuntingTargetUnitTypeMax[QF_Index]] = 6
      • Custom script: call SaveIntegerBJ( udg_QR_HuntingTargetUnitTypes[udg_QR_HuntingTargetUnitTypeMax[udg_QF_Index]], udg_QR_HuntingTargetUnitTypeMax[udg_QF_Index], udg_QF_Index, udg_QR_HuntingHashtable[udg_QF_Index] )
      • Hashtable - Save QR_HuntingTargetKillAmounts[QR_HuntingTargetUnitTypeMax[QF_Index]] as (QR_HuntingTargetUnitTypeMax[QF_Index] + 32) of QF_Index in QR_HuntingHashtable[QF_Index]
  • Quest Repeatable Hunter
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • Set QF_Index = 0
      • -------- --------
      • -------- Change index depending on the unit --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Target unit of ability being cast)) Equal to Rifleman
        • Then - Actions
          • Set QF_Index = 1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Target unit of ability being cast)) Equal to Priest
            • Then - Actions
              • Set QF_Index = 2
            • Else - Actions
      • -------- --------
      • -------- Interact --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QF_Index Not equal to 0
          • (Ability being cast) Equal to Interact - Both (Chain Lightning - Neutral Hostile)
        • Then - Actions
          • Set QG_Person[1] = Global_MainHero
          • Set QG_Person[2] = (Target unit of ability being cast)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (QG_Person[2] is in QG_QuestUnitNotDoneGroup) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • QR_HuntingIsActive[QF_Index] Equal to False
                • Then - Actions
                  • -------- --------
                  • -------- Random generation does not work inside the cinematic as told by DSG --------
                  • Set QG_JobType = Hunting
                  • -------- --------
                  • Set QG_Randomizer = (Random integer number between 1 and QR_HuntingTargetUnitTypeMax[QF_Index])
                  • Custom script: set udg_QR_HuntingTargetUnitType[udg_QF_Index] = LoadIntegerBJ(udg_QG_Randomizer, udg_QF_Index, udg_QR_HuntingHashtable[udg_QF_Index])
                  • Set QR_HuntingTargetKillAmount[QF_Index] = (Load (QG_Randomizer + 32) of QF_Index from QR_HuntingHashtable[QF_Index])
                  • -------- --------
                  • Unit - Create 1 QR_HuntingTargetUnitType[QF_Index] for Neutral Passive at (Center of (Playable map area)) facing Default building facing degrees
                  • Set QR_HuntingTitle[QF_Index] = (QG_JobType + :) + (Name of (Last created unit))))
                  • Set QR_HuntingDescription[QF_Index] = (Kill atleast + ((String(QR_HuntingTargetKillAmount[QF_Index])) + ( of + (Name of (Last created unit)))))
                  • Unit - Remove (Last created unit) from the game
                  • -------- --------
                  • Cinematic - Turn cinematic mode On for (All players)
                  • Cinematic - Enable user control for (All players)
                  • Unit - Make QG_Person[1] face QG_Person[2] over 0.00 seconds
                  • Unit - Make QG_Person[2] face QG_Person[1] over 0.00 seconds
                  • Unit - Pause QG_Person[2]
                  • -------- --------
                  • -------- Conversation --------
                  • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
                  • Cinematic - Send transmission to (All players) from QG_Person[1] named (Name of QG_Person[1]): Play No sound and display I hear that you hav.... Modify duration: Set to 1.00 seconds and Wait
                  • -------- --------
                  • -------- Conversation --------
                  • Unit - Create 1 QR_HuntingTargetUnitType[QF_Index] for Neutral Passive at (Center of (Playable map area)) facing Default building facing degrees
                  • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
                  • Cinematic - Send transmission to (Player group(Player 1 (Red))) from QG_Person[2] named (Name of QG_Person[2]): Play No sound and display (Are you willing to hunt for some + ((Name of (Last created unit)) + ?)). Modify duration: Set to 1.00 seconds and Wait
                  • Unit - Remove (Last created unit) from the game
                  • -------- --------
                  • -------- Create dialog --------
                  • Dialog - Clear QG_QuestAcceptDialog
                  • Dialog - Change the title of QG_QuestAcceptDialog to QR_HuntingTitle[QF_Index]
                  • Dialog - Create a dialog button for QG_QuestAcceptDialog labelled Accept
                  • Set QG_QuestAcceptDialogButton[1] = (Last created dialog Button)
                  • Dialog - Create a dialog button for QG_QuestAcceptDialog labelled Ignore
                  • Set QG_QuestAcceptDialogButton[9] = (Last created dialog Button)
                  • Dialog - Show QG_QuestAcceptDialog for Player 1 (Red)
                  • Set QG_QuestDialogButtonClicked = 0
                  • Wait until (QG_QuestDialogButtonClicked Not equal to 0), checking every 0.10 seconds
                  • -------- --------
                  • -------- Here's where player picks whether he approves or disapproves the quest --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • QG_QuestDialogButtonClicked Equal to 1
                    • Then - Actions
                      • -------- --------
                      • Game - Display to (All players) the text: ([Quest Discovered - " + (QR_HuntingTitle[QF_Index] + "]))
                      • Quest - Create a Required quest titled QR_HuntingTitle[QF_Index] with the description |n, using icon path (Icon of Carry - Both (Channel - Load Corpse))
                      • Quest - Create a quest requirement for (Last created quest) with the description QR_HuntingDescription[QF_Index]
                      • Quest - Flash the quest dialog button
                      • Set QR_HuntingQuest[QF_Index] = (Last created quest)
                      • Set QR_HuntingIsActive[QF_Index] = True
                      • -------- --------
                      • Unit Group - Remove QG_Person[2] from QG_QuestUnitNotDoneGroup
                      • Unit Group - Add QG_Person[2] to QG_QuestUnitDoneGroup
                      • Unit - Remove Attachment Quest Indicator (Claws of Attack) from QG_Person[2]
                      • -------- --------
                      • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
                      • Cinematic - Send transmission to (All players) from QG_Person[1] named (Name of QG_Person[1]): Play No sound and display Got it.. Modify duration: Set to 2.00 seconds and Wait
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • QG_QuestDialogButtonClicked Equal to 9
                        • Then - Actions
                          • Cinematic - Flash a speech indicator for QG_Person[1] of color (100.00%, 100.00%, 0.00%) with 0.00% transparency
                          • Cinematic - Send transmission to (All players) from QG_Person[1] named (Name of QG_Person[1]): Play No sound and display Pass.. Modify duration: Set to 2.00 seconds and Wait
                        • Else - Actions
                  • Unit - Unpause QG_Person[2]
                  • Cinematic - Turn cinematic mode Off for (All players)
                • Else - Actions
                  • Game - Display to (All players) the text: [Quest given by thi...
            • Else - Actions
        • Else - Actions
  • Quest Repeatable Finish Hunting
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set QF_Index = 0
      • -------- --------
      • -------- Index --------
      • Set QF_Index = 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QR_HuntingIsActive[QF_Index] Equal to True
          • (Killing unit) Equal to Global_MainHero
          • (Unit-type of (Dying unit)) Equal to QR_HuntingTargetUnitType[QF_Index]
        • Then - Actions
          • Set QR_HuntingTargetCurrentKills[QF_Index] = (QR_HuntingTargetCurrentKills[QF_Index] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • QR_HuntingTargetCurrentKills[QF_Index] Greater than or equal to QR_HuntingTargetKillAmount[QF_Index]
            • Then - Actions
              • Game - Display to (All players) the text: ([Quest Completed - " + (QR_HuntingTitle[QF_Index] + "]))
              • Quest - Destroy QR_HuntingQuest[QF_Index]
              • -------- --------
              • Player - Add 600 to Player 1 (Red) Current gold
              • -------- --------
              • Set QR_HuntingIsActive[QF_Index] = False
              • Set QR_HuntingTargetUnitType[QF_Index] = No unit-type
              • Set QR_HuntingTargetCurrentKills[QF_Index] = 0
              • Set QR_HuntingTargetKillAmount[QF_Index] = 0
            • Else - Actions
        • Else - Actions
      • -------- --------
      • -------- Index --------
      • Set QF_Index = 2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QR_HuntingIsActive[QF_Index] Equal to True
          • (Killing unit) Equal to Global_MainHero
          • (Unit-type of (Dying unit)) Equal to QR_HuntingTargetUnitType[QF_Index]
        • Then - Actions
          • Set QR_HuntingTargetCurrentKills[QF_Index] = (QR_HuntingTargetCurrentKills[QF_Index] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • QR_HuntingTargetCurrentKills[QF_Index] Greater than or equal to QR_HuntingTargetKillAmount[QF_Index]
            • Then - Actions
              • Game - Display to (All players) the text: ([Quest Completed - " + (QR_HuntingTitle[QF_Index] + "]))
              • Quest - Destroy QR_HuntingQuest[QF_Index]
              • -------- --------
              • Player - Add 600 to Player 1 (Red) Current gold
              • -------- --------
              • Set QR_HuntingIsActive[QF_Index] = False
              • Set QR_HuntingTargetUnitType[QF_Index] = No unit-type
              • Set QR_HuntingTargetCurrentKills[QF_Index] = 0
              • Set QR_HuntingTargetKillAmount[QF_Index] = 0
            • Else - Actions
        • Else - Actions
 
Status
Not open for further replies.
Top