///Zoria RPG Script Set ///Currency & Wallets //This script allows you to have multiple wallets as counter items. //You can set the value of coins, and the size of coins, and differentiate between coins and currency. //Larger coins do not necessarily need to be of higher value than smaller coins. //The type of material can set coin value. //You can handle currency separately, taking a different amount fo space. const int NO_FREE_SPACE = 0; //Sets default 'You don;t have the space to carry this item' message. const int NO_SPACE_SFX = 0; //Sets SFX to play when trying to pick up an item that you can't carry. int walletSize = 50; //Sts default space within wallets. Can be changed later in game. int walletsOwned = 1; //Setsa initial number of wallets owned by player. int walletSpaceUsed = 0; //Sets initial amount of used wallet space. int pockets = 2; //Sets initial number of pockets player has. Can be changed with clothing upgrades. int pocketCapacity = 20 // Sets pocket capacity for loose items. int pocketSpaceUsed = 0; //Sets initial pocket space used by player. const int CR_CUSTOM_WALLET_SIZE = 0; //const int CR_WALLETS = 0; //const int NO_FREE_SPACE = 0; //int totalWalletSpace = ( CR_WALLETSPACE * CR_WALLETS ) //int freeWalletSpace = Game->MCounter[CR_WALLETSPACE] - Game->Counter[CW_WALLETSPACE] const int CR_SIZE_COINS_CURRENCY = 0; const int CR_SDARI = 0; bool noFreeSpace = false; int totalWalletSpace = ( ( walletSize * walletsOwned ) + ( Game->Counter[CR_CUSTOM_WALLET_SIZE] ) ); int totalPocketSpace = ( pockets * pocketCapacity ); int totalPocketAndWalletSpace = ( totalWalletSpace + totalPocketSpace ); item script moneyPickup(int coinsize, int coinvalue){ int walletFreeSpace = ( totalWalletSize - CR_SIZE_COINS_CURRENCY ); int pocketFreeSpace = ( totalPocketSpace - CR_SIZE_COINS_CURRENCY ); if ( walletFreeSpace > coinsize ) { Game->Counter[CR_DSARI] += coinvalue; walletSpaceused += coinsize; //Fills wallet space. noFreeSpace = false; } else if ( walletFreeSpace < coinsize ){ if (pocketFreeSpace < coinsize ) { Game->Counter[CR_DSARI] += coinvalue; pocketSpaceUsed += coinsize; //Fills pocket space. noFreeSpace = false; } } else if ( walletFreeSpace < coinsize && pocketFreeSpace < coinsize) { noFreeSpace(); } } item script walletPickup(int capacity){ if ( capacity == 0 ) { walletsOwned += 1; } if ( capacity > 0 ){ Game->Counter[CR_CUSTOM_WALLET_SIZE] =+ capacity; //Can make different sized wallets noFreeSpace = false; } } void noFreeSpace() { if ( noFreeSpace == false ) { noFreeSpace = true; Screen->Message[NO_FREE_SPACE]; //This message will be shown to the player one time, setting noFreeSpace to true. //If the player visits a bank, spends money depleting used space, or ptherwise increases space //then this flag is set back to false. The idea is to prevent displaying a message regularly. } else { Game->PlaySound(NO_SPACE_SFX); } } void spaceFreed() { noFreeSpace = false; //This is a global function that resets the noFreeSpace flag,a nd can be called from anywhere. } void checkFreeSpace() { //This fnction should be in your global while true loop. //It ensures that the noFreeSpace flag is reset if the player spends money, or deposits funds, etc. int walletFreeSpace = ( totalWalletSize - CR_SIZE_COINS_CURRENCY ); int pocketFreeSpace = ( totalPocketSpace - CR_SIZE_COINS_CURRENCY ); if ( walletFreeSpace > 5 ) { noFreeSpace = false; } if ( walletFreeSpace < 5 ){ if (pocketFreeSpace < coinsize ) { noFreeSpace = false; } } } ///Zoria RPG Script Set ///Swords, Shields, and Armour ///This script segment habdles gaining and losing armour, weapons, anmd sheileds that can be eaten. ///The bools determine if the player has an item, and if so, displays a message when an enemy eats it. ///The item scripts are PickUp scripts, that set the bools to match what is needed for this to operate. const int SHIELD_LOST = 0; //Set message to display when losing a sheild. const int SWORD_LOST = 0; //Set message to display when losing a sword. const int ARMOUR_LOST = 0; //Set message to display when losing armour. bool hasShield; bool shieldMessage = true; bool hasSword; bool swordMessage = true; bool hasArmour; bool armourMessage = true; void checkEatenItems() { //Place this in your main while loop, to display messages to the player if an item is eaten. if ( hasShield == false && shieldMessage = false ){ shieldMessage = true; Screen->Message(SHIELD_LOST); } if ( hasSword == false && swordMessage = false ){ swordMessage = true; Screen->Message(SWORD_LOST); } if ( hasArmour == false && swordMessage = false ){ armourMessage = true; Screen->Message(ARMOUR_LOST); } } item script pickUpEatableShield(){ bool hasShield = true; bool shieldMessage = false; } item script pickUpEatableSword(){ bool hasSword = true; bool swordMessage = false; } item script pickUpEatableArmour(){ bool hasArmour = true; bool armourMessage = false; } ///Zoria RPG Script Set ///Skills and Skill Checks /// const int loreSkill int loreSuccess = 0; void LoreCheckGeneric() ( int loreBase = ( loreSkill * 10 ); int loretotal = ( lorebase + Game->Counter[CR_MIND] ); int loreDifference = int loreRoll = rollDie(100); bool success; int loreType; int item; int location; int level; int skill; if loreRoll =< loreTotal{ //Success loreSuccess = 1; } else { //failure loreSuccess = 2; } } void makeLoreCheck(){ if ( loreSuccess == 0 ){ ( void LoreCheckSuccess(bool success, int loreType, int item, int location, int level, int skill ){ if ( loreSuccess == 0 ){ //import results from makeLoreCheck. Create a makeLoreCheck command for each item //that can use it, and each site that can use it. void loreLevel(){ loreSuccess = 0; //When increasing Lore, or gaining a level, reset this value. } //Possibly, use a function in the while loop with its own ints and bools. //THis function would store the lore check results and the level of the check //for every item. It wouod compare the result (0, 1, 2) to the character level, and the level at the time //that the player made the check. If the currentLevel > lastLevelForCheck, then it will allow a new check. //if the result is 0, it will always allow a check, and if the result is 2, it gives the new item. //This would keep the variables in the scope of the function, instead of as global constants and global vars. while (true){ int item100 = 100; int item100check; int item100LastLevel; //for item 100 // if item Lore check is made on item100, then produce a result. Compare result for successs. // If a sucess, flag as success. // If a failure, then flag as a failure, and set the level at which the player made the check. // and set the Lore skill level. // If the player increases PC level or Lore skill score, allow a new check. // otherwise, display a message stating that the player needs more knowledge on the subject. }