Age of Wonders II Heaven Julia with Gameplay background

Scenario Design
    Scripting Database

SHADOW MAGIC SCRIPTING
Scripting Database

Quests and Requests: an Example with Control Flags

by Talon-Thorn

DOWNLOAD: sample scenario file

Outline:
A simple scenario showing how to use the Request event, how to set up a custom Quest, and how to control various events using the Control Flag event.

Scripts:
The example scenario uses the Request event to start the player on a quest. The Quest event is then used to start the quest running (at that point it can not be refused). The AutoReward is turned off and the success and failure of the Quest is controled manually by setting up various events to simulate it. Control Flag events are included to prevent "success" events from occurring when the quest fails, and vice versa.

Setup:
See sample scenario file for details.

Details:


Quest Disabled - disable quest at start since it has not yet been given to player. Flag1 = true means Quest is done (or not started).
Activate: Once

Event: Control Flag
FlagID: 1
Active: True

Trigger: New Turn
Players: Marinus/Fangir

Conditions: None


Go to Swordsman
Activate: Once

Event: Show Message
Players: (trigger player)
Message: Go talk to the swordsman neaby to the East
Header: Go to Swordsman
Image: 30
Spirit: estNone

Trigger: Enter Area
Players: Marinus
XYL: {coordinates where Marinus spawns into the game}
Radius: 0
StopMovement: True

Conditions: None


Swordsman Request
Activate: Once

Event: Request
Players: (trigger player)
Message: Will you accept my quest? You will be rewarded with a mighty companion.
Header: Quest Offer
Image: 515
Spirit: estNone
RequestID: 1

Trigger: Enter Area
Players: Marinus
XYL: {coordinates where swordsman is located}
Radius: 1
StopMovement: True

Conditions: None


The Quest 1
Activate: Once

Event: Show Message
Players: (trigger player)
Spirit: estNone
Message: Go towards the tower to the South and capture the mine. When you complete this task you will receive your reward. Be careful that you do nothing else until you have captured the mine.
MissionDescription: The Swordsman's Quest
MissionDays: -1 (Set to -1 to prevent a day-limited quest)
QuestName: Swordsman's Quest
QuestID: 1
AutoReward: False
QuestXYL: {coordinates of tower} (Display will center on this location if player clicks on the quest's "center" button)
Difficulty: qdAverage
Popup: True
PopupHeader: The Quest

Trigger: Request Reply
Players: Marinus
RequestID: 1
Reply: rrYes (triggered when player responds "Yes" to Request #1)

Conditions: None


The Quest 2 - enable quest events (Flag 1 = False, quest not done)
Activate: Once

Event: Control Flag
FlagID: 1
Active: True

Trigger: Request Reply (Note taht this trigger matches "The Quest 1" trigger.)
Players: Marinus
RequestID: 1
Reply: rrYes (triggered when player responds "Yes" to Request #1)

Conditions: None


QuestReward 1
Activate: Once

Event: Show Message
Players: (trigger player)
Message: CONGRADULATIONS! Your reward is given!
Header: Quest Completed!
Image: 742
Spirit: estNone

Trigger: Flag Structure
Players: Marinus
StructureID: 3 (Income Structure) - a mine.

Conditions:
AND NOT Flagged1

Condition Flagged1
Type: Flagged
FlagID: 1


QuestReward 2
Activate: Once

Event: Spawn Units
Player: Marinus
Units:
XYL: {location adjacent to mine ID3}
Behavior: subNone

Trigger: Flag Structure
Players: Marinus
StructureID: 3 (Income Structure) - a mine.

Conditions:
AND NOT Flagged1

Condition Flagged1
Type: Flagged
FlagID: 1


Quest Failed 1 - event defining custom quest failure
Activate: Once

Event: Quest Control
Action: qcFailed
QuestID: 1

Trigger: Flag Structure
Players: Marinus
StructureID: 2 (WatchTower)

Conditions:
AND NOT Flagged1

Condition Flagged1
Type: Flagged
FlagID: 1


Quest Failed 2 - event defining custom quest failure
Activate: Once

Event: Show Message
Players: (trigger player)
Message: I told you to do nothing else until you had completed my task. By capturing the tower before capturing the mine you have failed my quest.
Header: Quest Failed
Image: 427
Spirit: estNone

Trigger: Flag Structure - note that this trigger matches the "Quest Failed 1" trigger
Players: Marinus
StructureID: 2 (WatchTower)

Conditions:
AND NOT Flagged1

Condition Flagged1
Type: Flagged
FlagID: 1


Quest Failed 3 - event defining custom quest failure
Activate: Once

Event: Play FX
FXType: eftFireworksFire
FXFileName: -
XYL: {location of mine ID3}
CenterView: True
Delay: 0 (no wait for FX to start)
Number: 6 (six fireworks will go off)
NumberDelay: 300 (.3 seconds between each firework, total 1.8 seconds for FX)
WiatTime: 600 (wait .6 seconds before allowing movement or the next event to occur. This will allow two fireworks to go off before the FX for the "raze mine" event occurs.)

Trigger: Flag Structure - note that this trigger matches the "Quest Failed 1" trigger
Players: Marinus
StructureID: 2 (WatchTower)

Conditions:
AND NOT Flagged1

Condition Flagged1
Type: Flagged
FlagID: 1


Quest Failed 4 - event defining custom quest failure
Activate: Once

Event: Raze Structure
StructureID: 3 (Income Structure) - mine ID3

Trigger: Flag Structure - note that this trigger matches the "Quest Failed 1" trigger
Players: Marinus
StructureID: 2 (WatchTower)

Conditions:
AND NOT Flagged1

Condition Flagged1
Type: Flagged
FlagID: 1


Quest Done 1 - turn off quest to prevent further event triggering. This event must be places following all quest results events.
Activate: Once

Event: Control Flag
FlagID: 1
Active: True

Trigger: Flag Structure
Players: Marinus
StructureID: 3 (Income Structure) - a mine.


Quest Done 2 - turn off quest to prevent further event triggering. This event must be places following all quest results events.
Activate: Once

Event: Control Flag
FlagID: 1
Active: True

Trigger: Flag Structure
Players: Marinus
StructureID: 2 (WatchTower)

Conditions: None


Quest Done 3 - turn off quest to prevent further event triggering. This event must be places following all quest results events.
Activate: Once

Event: Control Flag
FlagID: 1
Active: True

Trigger: Request Reply
Players: Marinus
RequestID: 1
Reply: rrNo (triggered when player responds "No" to Request #1)

Conditions: None


Request Refused 1
Activate: Once

Event: Show Message
Players: (trigger player)
Message: A curse be upon you for not accepting my quest!!
Header: You Are Cursed!
Image: 282
Spirit: estNone

Trigger: Request Reply
Players: Marinus
RequestID: 1
Reply: rrNo (triggered when player responds "No" to Request #1)

Conditions: None


Request Refused 2
Activate: Once

Event: Kill Unit - remove NPC who offered the quest
UnitID: 73 (Human Infantry)
Source: Independents

Trigger: Request Reply - Note that this trigger matches "Request Refused 1" trigger.
Players: Marinus
RequestID: 1
Reply: rrNo (triggered when player responds "No" to Request #1)

Conditions: None


Request Refused 3
Activate: Once

Event: Play FX
FXType: eftFireworksDeath
FXFileName: -
XYL: {location of swordsman}
CenterView: True
Delay: 0 (no wait for FX to start)
Number: 12 (six fireworks will go off)
NumberDelay: 100 (.1 seconds between each firework, total 1.2 seconds for FX)
WiatTime: 600 (wait .6 seconds, half of the FX, before allowing movement or the next event to occur. This will allow 6 fireworks to go off before the spawn unit event occurs.)

Trigger: Request Reply - Note that this trigger matches "Request Refused 1" trigger.
Players: Marinus
RequestID: 1
Reply: rrNo (triggered when player responds "No" to Request #1)

Conditions: None


Request Refused 4
Activate: Once

Event: Spawn Units - a nasty monster spawns to kill the wizard
Player: Independents
Units:
XYL: {location where swordsman used to be}
Behavior: subBerserk - will attack any units within range regardless of chance of success in battle

Trigger: Request Reply - Note that this trigger matches "Request Refused 1" trigger.
Players: Marinus
RequestID: 1
Reply: rrNo (triggered when player responds "No" to Request #1)

Conditions: None




Back to Event Scripting Resource Database Menu



BACK TO SCENARIO DESIGN MAIN MENU

HG Logo

Headlines

» AoW1 Summer 2008 Mapmaking Tournament

» Interview Kirky Picardo

» Scenario update

» The making of...

» A new PBEM Singles Champion is crowned - Swolte!!

Poll

What unit most resembles you?

Halfling peasant

Undead Vampire

Human Knight

Tigran Prowler

Orcish Warlord

Archon Saint

Dwarven Engineer

Chaos Spawn

Results :: Other Polls

Age of Wonders

Looking for info about the original AoW?
Visit AoW Heaven!

AoWH Logo

HeavenGames Sites

» Main Portal

» Age of Empires

» Age of Empires 3

» Age of Kings

» Age of Mythology

» Age of Wonders

» Age of Wonders 2

» Battle for Middle Earth 2

» Caesar 3

» Caesar 4

» Children of the Nile

» Dungeon Siege

» Empire at War

» Empire Earth

» Emperor: RotMK

» Medieval 2: Total War

» Pharaoh

» Rise & Fall: CaW

» Rise of Legends

» Rise of Nations

» Rome: Total War

» Stronghold

» Stronghold 2

» SW: Galactic Battlegrounds

» Zeus