This script is based on the Tunic/Mail items from TLoZ: A Link to the Past.
What it does is that it reduces the amount of damage that Link takes from enemies by a set amount of hearts. If the result is less than a heart, it divides the amount of damage then. The item scripts MUST be used in the item's pickup slot or they won't work.
Level - Used to set the tunic to work.
D0 - The amount of damage, in full hearts, that you want to make the tunic reduce.
D1 - The divisor that the amount of damage gets divided by, if the first result is less than a heart. DO NOT LEAVE THIS AS 0!!!
D0 - Set this to the level of the highest-leveled tunic to remove them.
How to use:
Copy this code into your script file.
Put the line LttPMailRun(); into your main while-loop in your Slot_2 global script. Uncomment import "std.zh" if you don't have it imported already.
Compile the script.
Set the item's level, D0 and D1 variables in the item data and make sure to have the LttPMail item script assigned to it's pickup slot. Whatever you do, DO NOT LEAVE D1 AS 0!!! It is prefable to make it a Ring item, with it's damage divisor set to 1 regardless of level, so you can have it change Link's pallet.
(Optional) Make a new item, this time with the LttPMailRemover item script assigned to it's pickup slot and have D0 set to the highest leveled tunic there is in the quest, so that LttP_Tunic_Item_Activator gets reduced to 0. Give it to Link in order to remove it. It is also wise to remove each tunic item via script or DMap.
You should be all set! Just report any problems you have with it, if you have any at all.
This has been posted here to test this script before I send it into the script dropbox.
Edit: It appears that a complier error escaped me when I submitted it. Fixed .
Edited by Orin XD, 09 April 2012 - 02:59 AM.