Link's Awakening Pieces of Power, Guardian Acorns
SubmittedDecember 14, 2016
Download Script Package
This script adds temporary buff items, based on The Legend of Zelda: Link's Awakening, to a Zelda Classic quest. The items, are as follows:
Piece of Power: Collect a set number of these to double attack power for a short time.
Guardian Acorn: Collect a set number of these to double defense for a set period of time.
Secret Shells: Collect a set number of these for a user-defined secret.
The header allows you to define the number collected, for a boost, and the duration easily using constants. It also includes the necessary item Pick-Up scripts, and all that you need to use the package. Detailed set-up instructions are in a plain text file, distributed with the package.
Script Setup Details
Link's Awakening Buff Items and Secret Shells Set-Up
PLEASE REFER TO THE EXAMPLE QUEST BEFORE USING.
1. Add tiles for the following:
Piece of Power
2. Add Sound Effects for each of the following:
Piece of Power Pick-Up
Guardian Acorn Pick-Up
Secret Shell Pick-Up
Sound to play when attack (sword power) is buffed by Pieces of Power.
Sound to play when defence (ring, armour) is buffed by Guardian Acorns
Sound to play when effect of Pieces of Power expires.
Sound to play when effect of Guardian Acorns expires.
Sound to play when unlocking a shell secret.
3. In the script file, assign the constants for sounds:
SFX_POWER_BOOSTED = ??; //Sound to play when Attack Buffed
SFX_SECRET_SHELL = ??; //Sound to play when unlocking shell secret.
SFX_GUARDIAN_DEF = ??; //Sound to play when Defence buffed.
SFX_NERF_POWER = ??; //Sound to play when Piece of Power buff expires.
SFX_NERF_DEF = ??; //Sound to play when Guardian Acorn buff expires.
4. In the script file, set-up your main conditions:
const int NEEDED_PIECES_OF_POWER = ?; //Number of Pieces of power needed for temporary boost.
//Default value: 3
const int NEEDED_ACORNS = ?; //Number of Acorns needed for temporary boost.
//Default value: 3
const int BUFF_TIME = 900; //Duration of boost, in frames. Default is 15 seconds.
//Default value: 900 (15 seconds).
5. If you DO NOT have global scripts for 'Active', 'OnContinue', 'OnExit', you may use the included
skeleton template scripts. Otherwise, for your GLOBAL ACTIVE SCRIPT, place the following function
calls BEFORE Waitdraw();
If you do not have a Waitdraw() instruction in your global active script, you add it in the infinite
( while (true) ) loop, before Waitframe();. Use the included example as a guide.
If you have either (or both) OnContinue, OnExit, add the following instructions to each of them, at
the very top of each:
Z4_ItemsAndTimers[DEF_TIMER] = 0;
Z4_ItemsAndTimers[POWER_TIMER] = 0;
Again, use the included examples as a guide for statement/instruction placement.
6. COMPILE, and assign scripts to slots.
If you have not previously done this:
Go to the ZQ menu, and select: Quest->Scripts->COmpile ZScript
Either add an import directive to your existing buffer, or use the import button to
copy the code of LinksAwakening.z to your buffer. If you do this, be sure to enable
' import "std.zh" ' at the very top, by removing the slashes.
You will see the compiler working. When it is finished, it will return 'Success'.
You will be prompted to assign scripts to slots.
Assign the global scripts Active, OnContinue, and OnExit to the slots with matching names.
Assign the item scripts to free slots.
You may export assembly code, if you desire.
7. Add the following items to the item editor:
Power (Damage Divisor): 1
Link Sprite Pal: 0
Piece of Power
Class: Custom Item Class 01, or whatever you wish to use.
Pick-Up Script: Piece of Power
Pick-Up Sound: Whatever you added for 'Piece of Power Pick-Up'
Class: Custom Item Class 02, or whatever you wish to use.
Pick-Up Script: GuardianAcorn
Pick-Up Sound: Whatever you added for 'Guardian Acorn Pick-Up'
Class: Custom Item Class 03, or whatever you wish to use.
Pick-Up Script: SecretShell
Pick-Up Sound: Whatever you added for 'Secret Shell Pick-Up'
NOTE THE ITEM NUMBER OF EACH
8. Add the following items to desired dropsets:
Piece of Power
Go back to the script, and set the constants for the following items, using the item numbers
that you noted in Step 7:
const int I_GREEN_RING = ???; //Item number of Green Ring. Default is 144.
const int I_PIECE_POWER = ???; //Item number of Piece of Power. Default is 145.
const int I_ACORN = ???; //Item number of Acorn. Default is 146.
const int I_SHELL = ???; //Item number of Secret Shell. Default is 147.
10. You are done, and ready to use the new items. Their use is automated by the global scripts, and
requires no further tinkering.
PLEASE REFER TO THE EXAMPLE QUEST IF YOU RUN INTO ANY STUMBLING POINTS.