//Gives the specified item with hold up animation and optional fanfare
//keep: Whether to actually give the item
//twoHand: Use 1 or 2 hand animation
//sfx: Whether to play item fanfare
void holdUpItem(int id, bool keep, bool twoHand, bool sfx)
{
if ( sfx )
Game->PlaySound(SFX_PICKUP);
if ( twoHand )
Link->Action = LA_HOLD2LAND;
else
Link->Action = LA_HOLD1LAND;
Link->HeldItem = id;
//Give the item and its counter effects
if(keep){
Link->Item[id] = true;
itemdata data = Game->LoadItemData(id);
//Increase capacity
if(data->MaxIncrement > 0 && data->Max > Game->MCounter[data->Counter]){
Game->MCounter[data->Counter] = Min(Game->MCounter[data->Counter]+data->MaxIncrement, data->Max);
}
//Increase count
if(data->Amount > 0)
Game->Counter[data->Counter] = Min(Game->Counter[data->Counter]+data->Amount, Game->MCounter[data->Counter]);
}
}
When giving Link an item that increases amount and uses the Drain Counter (Blue Rupee in this case), I don't get the correct counter increment. Giving a Blue Rupee through this appears to immediately max out Link's Rupee counter instead of gradually giving him 5 Rupees.
stdExtra.zh
Overview
Creator:
MoscowModder
Updated: 18 Mar 2015
Tags:
Library
Downloads: 242
|
View Script
Download Script (5.77 KB) |
Information
This library, stdExtra, is a collection of general-purpose constants, settings, and functions that can be used in a variety of different scripts.
Description Setup Reviews Comments
You can use this header by placing it in the same folder as ZQuest, then putting the following includes (once) at the top of your script file:
If you don't already have ffcscript.zh, you can get it here.
import "std.zh" import "stdExtra.zh" import "string.zh" import "ffcscript.zh"NOTE: This header contains a few (clearly-marked) settings constants at the top that you'll need to set for your quest.
If you don't already have ffcscript.zh, you can get it here.


