Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import "std.zh"
- ////////////////////////////////////////////
- /// Bow, Arrow, and Quiver Bundle Pickup ///
- /// v0.2.1 - 9th July, 2015 ///
- /// By: ZoriaRPG ///
- ////////////////////////////////////////////
- // Script Arguments
- // D0: Number of starting arrows to give with this bow.
- // D1: Quiver to Give: Small Quiver ( 74 ), medium Quiver ( 75 ), Large Quiver ( 76 ), Magic Quiver ( 105 ) , or custom.
- // D2: Type of arrow to give with bow: Wooden ( 13 ), Silver ( 14 ), Gold ( 57 ), or custom.
- // D3: Sound Effect to play: Special Item ( 20 ), or custom.
- // D4: Message String ID to display (if any). None ( 0 ), or custom.
- // D5: Hold-Up Animation to use: None ( 0 ) , 1-Hand ( 1 ), 2-Hand ( 2 ) , 1-Hand-Water ( 3 ), 2-Hand-Water ( 4 ).
- // D6: Bow to give: Bow ( 15 ) , Longbow ( 68 ), or custom. This should match the item ID to which you attach this script!
- item script BowPickup
- {
- void run(int giveArrows, int quiver, int arrowType, int playSFX, int showMessage, int holdUp, int bowID)
- {
- int arrowsMax;
- if ( quiver && !Link->Item[quiver] )
- {
- Link->Item[quiver] = true;
- itemdata quiverIT = Game->LoadItemData(quiver);
- arrowsMax = quiverIT->Max;
- }
- if ( Game->MCounter[CR_ARROWS] < arrowsMax ) Game->MCounter[CR_ARROWS] = arrowsMax;
- if ( arrowType && !Link->Item[arrowType] ) Link->Item[arrowType] = true;
- if ( giveArrows ) Game->Counter[CR_ARROWS] += giveArrows;
- if ( giveArrows < 0 ) Game->Counter[CR_RUPEES] -= giveArrows;
- if ( playSFX ) Game->PlaySound(playSFX);
- if ( holdUp && bowID ) _Bow_HoldUpItem(bowID,holdUp);
- if ( showMessage ) Screen->Message(showMessage);
- }
- }
- import "ffcscript.zh"
- const int FFC_DELAYED_ITEM_MESSAGE = 1;
- item script BowPickupWithFFC{
- void run(int giveArrows, int quiver, int arrowType, int playSFX, int showMessage, int holdUp, int bowID){
- int arrowsMax;
- if ( quiver && !Link->Item[quiver] ) {
- Link->Item[quiver] = true;
- itemdata quiverIT = Game->LoadItemData(quiver);
- arrowsMax = quiverIT->Max;
- }
- if ( Game->MCounter[CR_ARROWS] < arrowsMax ) Game->MCounter[CR_ARROWS] = arrowsMax;
- if ( arrowType && !Link->Item[arrowType] ) Link->Item[arrowType] = true;
- if ( giveArrows ) Game->Counter[CR_ARROWS] += giveArrows;
- if ( giveArrows < 0 ) Game->Counter[CR_RUPEES] -= giveArrows;
- if ( playSFX ) Game->PlaySound(playSFX);
- if ( holdUp && bowID ) _Bow_HoldUpItem(bowID,holdUp);
- int args[1]={showMessage};
- if ( showMessage ) RunFFCScript(FFC_DELAYED_ITEM_MESSAGE,args);
- }
- }
- ffc script DelayedItemMessage{
- void run (int showMessage)
- {
- bool increased = false;
- bool playedMessage = false;
- while(true){
- if ( SBombMaxPlus && !increased )
- {
- increased = true;
- Game->MCounter[CR_SBOMBS] += SBombMaxPlus;
- Waitframes(1);
- }
- if ( showMessage && !playedMessage )
- {
- playedMessage = true;
- Screen->Message(showMessage);
- }
- if ( !SBombMaxPlus && !showMessage ) break;
- if ( increased && showMessage ) break;
- Waitframe();
- }
- }
- }
- //Global Constants and Functions
- //Item Hold-Up Constants
- const int ITM_HOLD1LAND = 1;
- const int ITM_HOLD2LAND = 2;
- const int ITM_HOLD1WATER = 3;
- const int ITM_HOLD2WATER = 4;
- //Global Function to force Link to hold up any item specified as itm, using animation specified by holdType.
- void _Bow_HoldUpItem(int itm, int holdType)
- {
- if ( holdType == ITM_HOLD1LAND )
- {
- Link->Action = LA_HOLD1LAND;
- Link->HeldItem = itm;
- }
- if ( holdType == ITM_HOLD2LAND )
- {
- Link->Action = LA_HOLD2LAND;
- Link->HeldItem = itm;
- }
- if ( holdType == ITM_HOLD1WATER )
- {
- Link->Action = LA_HOLD1WATER;
- Link->HeldItem = itm;
- }
- if ( holdType == ITM_HOLD2WATER )
- {
- Link->Action = LA_HOLD2WATER;
- Link->HeldItem = itm;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement