import "std.zh" ///////////////////////////////////////////////// //Import mandatory script headers and packages.// ///////////////////////////////////////////////// import "ffcscript.zh" import "string.zh" import "ghost.zh" import "stdArguments_v6.9.8.zh" ///////////// /// MENUS /// ///////////// bool noMenu = false; import "gc_tango/tango.zh" import "gc_tango/tango/font/Matrix.zh" import "gc_tango/styles.zh" import "gc_tango/gc_menus.z" //////////////////////////////////////////////////////////////////// //Set up environment, Base Ints, Consts, Floats, Bools, Vars, etc.// //////////////////////////////////////////////////////////////////// bool LinkSeen; int DROP_ENEMY_ID = 0; int Drinks_Left; const int SFX_DRINK = 52; const int ThunderSFX = 73; const int NPC_SPECIALENEMY = 1; //The ID of your special enemy const int LW_EFFECT = 31; const int SFX_ERROR = 65; //In case you want an error SFX const int SFX_MAGICCHARGE = 62; const int SFX_LIGHTARROW = 1; const int SFX_GUN = 77; //Set to a bang SFX as desired. const int SFX_RELOAD = 84; //Set to a reload SFX as desired. const int lightColor = 134; //Color of the charging ring: CSet# * 16 + color# (from 0 to 15) const int WPS_NONE = 101; //Weapon sprite with an empty tile (for superlight arrow) const float ORBIT_SPEED = 2.5; const float ORBIT_RADIUS = 48; int f1 = 0; int f2 = 0; int rad = 0; int slower = 0; int bombs = 0; int r1 = 0; int r2 = 0; int slowera = 0; int ffcslot = 1; int usebombodo = 0; int ringTimer; int byrnaTimer; int bootsTimer; bool ownStaff; bool ownNightfall; bool ownSwordOfLight; bool cigarPickup; //const int ringShadowTile = 0; //Shadow tile for invisble Link //const int ringShadowCSet = 7; //CSet of this tile const int ringTimePerMP = 30; //How many frames 1 unit of MP lasts with the One Ring or Cape at 60F/s bool ringOn; const int byrnaTimePerMP = 60; //How many frames 1 unit of MP lasts with the Cane of Byrna at 60F/s bool byrnaOn; const int bootsTimePerMP = 100; //How many frames 1 unit of MP lasts with the Boots at 60F/s bool bootsOn; bool gogglesOn; int gogglesTimer; const int TIME_PER_MP = 15; //How many frames 1 unit of MP lasts items. const int SwimPaddle = 26; //Set to swimming paddle sound. bool isSwimming; int timerItem = 0; int timerValue = 0; // The id of the item used to create an lweapon. const int MISC_LWEAPON_ITEM = 0; //////////////////////////////////////////////////////////////// //// Global Variables // The item id of the last item Link has used. int LastItemUsed = 0; //////////////////////// /// BEGIN XP SCRIPTS /// //////////////////////// //================================================================== // ==== * INSTRUCTIONS * ==== //All items: Set their IDs in the I_ constants //Sound effects: Set the sounds in the SFX_ constants (0 disables the sound) //Settings: Read the descriptions of the EXP_ constants before editing //Treasure Hunter: Set the screen flag "General Purpose 1" on screens with chests //Meter: Read the descriptions of the EXP_METER_ constants before editing //=================================================================== const int I_FASTWALK = 17; //ID of the fast walk item const int I_LEADERSHIP = 17; //ID of the leadership item const int I_TREASUREHUNTER = 17; //ID of the treasure hunter item //const int CR_EXP = 9; //Counters for EXP and level (default 3 & 4) ///const int CR_LEVEL = 10; const int SFX_LEVEL = 32; //SFX to play when you level up (0 = disable) const int SFX_TREASURESCREEN = 27; //SFX to play when Treasure Hunter activates const int EXP_HP_RATIO = 1; //Enemy EXP value = HP divided by this //const int EXP_PER_LEVEL = 100; //Amount of EXP to level up //const int EXP_MAX_LEVEL = 20; //Highest possible level const int EXP_LEADERSHIPCHANCE = 10; //One in {this} chance to get +1 exp const int EXP_FASTWALKRATE = 5; //Every {this} frames, walk an extra pixel //const int EXP_METER_X = 50; //Starting coordinates of the EXP meter //const int EXP_METER_Y = -8; //Subscreen Y values are < 0; need to play around with this //const int EXP_METER_WIDTH = 8; //How wide the meter is //const int EXP_METER_LENGTH = 64; //How long the meter can get //const int EXP_METER_COLOR = 1; //Color = (CSet# * 16) + color within CSet from 0 to 15 const int SF_TREASURE = 0; //Which screen flag to check for treasure (default Script1) const int HP_DEAD = -999; //Enemy has been counted for EXP (don't touch) const int NPC_MISC_MAXHP = 0; //Which npc->Misc[] value to store HP in (don't touch) const int CR_HP = 8; //Sript 2 const int CR_MP = 9; //Script 3 const int CR_HP_MAX = 10; //Script 4 const int CR_MP_MAX = 11; //Script 5 const int CR_XP = 12; //Script 6 const int CR_LEVEL = 13; //Script 7 const int CR_LVL = 13; //Script 7 const int CR_XP_10K = 16; //Script 10 const int CR_MERKS = 20; //Script 14 const int CR_FREE_SPACE = 21; //Script 15 const int AmmoToLoad = 24; //Script 18 const int CR_STAT_MUSC = 25; //Script 19 const int CR_STAT_BODY = 26; //Script 20 const int CR_STAT_MIND = 27; //Script 21 const int CR_STAT_MYST = 28; //Script 22 const int CR_STAT_INFL = 29; //Script 23 const int CR_STAT_LUCK = 30; //Script 24 const int GunCounter = 31; //Script 25 int levelStrings[21] = { 59, 59, 59, 59, 60, 59, 59, 59, 59, 61, 59, 59, 59, 59, 59, 62, 59, 59, 59, 63, 85 }; int gainLevel; ////////////////////// /// END XP SCRIPTS /// ////////////////////// const int DRAW_OPAQUE = 128; const int DRAW_TRANSPARENT = 64; int healsfx = 39; //Sound effect to play when Link is healed int errorsfx = 65; //Sound effect to play when Link's HP is full or MP is empty const int WLS_LASERCOLOR = 181; //Color of the laser beam: [CSet# * 16] + [Color within CSet from 0 to 15] const int WLS_LASEROPACITY = 90; //128 = Opaque, 64 = Transparent const float WLS_LASERSIDEDAMAGE = 0.5; //Percent damage dealt by touching side of beam (0 = disable) //Dalek beam colour choices 98 - 147 - 182 //SHOP COnstants const int COLOR_TEXT = 10; const int COLOR_BG = 00; ////////////////////////////////////////////// /// Wallet and Money Constants & Variables /// ////////////////////////////////////////////// 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. int totalWalletSpace; int baseWalletSpace; int totalPocketSpace; int totalPocketAndWalletSpace; int CR_CUSTOM_WALLET_SIZE = 0; //const int CR_WALLETS = 0; //const int NO_FREE_SPACE = 0; int freePocketSpace; int freeWalletSpace; int freeSpace; int valueStored; int coinsize; //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_DSARI = 0; bool noFreeSpace = false; bool reduced; /////////////////////////////////////////////////////// /// Armour, Shield, and Sword Constants & Variables /// /////////////////////////////////////////////////////// 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; //ERROR - Unexpected Semicolon on next line. int NPC_SCRIPT_DEFENSE[1000]; bool WeaponCreated[40]; //////////////// /// Messages /// //////////////// bool playingMessage = false; /////////////////////////// /// SKill Check Globals /// /////////////////////////// int loreSkill; int loreSuccess = 0; //////////////////// /// Item GLobals /// //////////////////// //////////////////////////// ///Laser Sentry Constants/// //////////////////////////// const int SFX_ALARM = 67; //Error sound or sentry alert const int SFX_LASER = 61; //Laser fired const int LS_ATTRIB_ROTSPEED = 0; //Misc Attr 1 const int LS_ATTRIB_RADIUS = 1; //... 2 const int LS_ATTRIB_DELAY = 2; //... 3 const int LS_ATTRIB_COOLDOWN = 3; //... 4 const int LS_ATTRIB_LASERCOLOR = 4; //... 5 ////////////////////////////////////////// //Import global, item abnd FFC scripts./// ////////////////////////////////////////// //Scripts that have an comment with NYU are not yet used. Scripts that are just commented out are disabled and were for testing or for other people. ////////////////// //Global Scripts// ////////////////// //import "gc_global_base.z" //Has HPMP Counters and HPC, but not the staff or mirror code. //import "gc_global_working.z" //import "gc_global_testing.z" //Broken at present. Will cause game to crash on Frame-1 //import "gc_global_ghost.z" //Drains MP on Init until Ring or Staff are used. //import "gc_global_MM.z" //MoscowModder's revision of the global_working script. //import "gc_global_MM_ghost.z" //MoscowModder's revision of global plus Autoghost. //import "gc_global_MM_ghost_MP_items.z" //MoscowModder's revision of global plus Autoghost with MP items. //import "gc_global_MM_ghost_MP_items_trowel.z" //As above, plus Trowel scripts. //import "gc_global_MM_ghost_MP_items_trowel_v2.z" //Updated with SFX. //import "gc_global_MM_ghost_MP_items_trowel_v2.z" //Plus Solid FFCs - Do Not Use //import "gc_global_MM_ghost_MP_items_trowel_v2_xp.z" //Plus XP System //import "gc_global_MM_ghost_MP_items_trowel_v8_xp.z" //Plus XP System //import "gc_global_MM_ghost_MP_items_trowel_v11_xp.z" //Plus XP System //import "gc_global_MM_ghost_MP_items_trowel_v12_xp.z" //Plus FFC Triggers //import "gc_global_MM_ghost_MP_items_trowel_v14_xp.z" //Plus FFC Triggers //import "gc_global_16.z" //import "gc_global_17.z" //import "gc_global_18.z" //import "gc_global_19.z" //import "gc_global_20.z" //import "gc_global_22.z" //import "gc_global_23.z" //import "gc_global_29.z" import "gc_global_55_Menus.z" import "gc_std_extra_MM.zh" //MoscowModder's std.zh-extensions. //Enemies thqat break the hpmpcountrs script are Green Dragon Moldorm 10 Moldorm 20 digdogger Kid and BS Dodongo //////////////////////// //Item and FFC Scripts// //////////////////////// import "gc_calmen_NWS.z" import "gc_stazer_v2_NWS.z" import "gc_bolt_v8_NWS.z" import "gc_firearms_NWS.z" import "gc_jhkarr_NWS.z" import "gc_lightarrow_NWS.z" import "gc_tremor_NWS.z" import "gc_wand_item_2A_NWS.z" import "gc_arrow_NWS.z" import "gc_bolt_ffc_NWS.z" //import "gc_detonate_NWS.z" //Detonate NWS may be causing a glitch with NWS currentDamage. import "gc_generic_projectile_lweapon_NWS.z" import "gc_extendLW_NWS.z" import "gc_timestop.z" import "gc_key.z" import "gc_healing.z" import "gc_restoremp.z" import "gc_rupeegainloss.z" import "gc_sernaran_pickup.z" import "gc_increase_counter_max.z" import "gc_mcp_old.z" //import "gc_lightarrow.z" //import "gc_tremor.z" import "gc_detonate.z" //import "gc_bolt_v8.z" //import "gc_calmen.z" //import "gc_jhkarr.z" //import "gc_stazer_v2.z" //import "gc_bolt_ffc.z" //import "gc_wand_item_2A.z" //import "gc_generic_projectile_lweapon.z" import "gc_whip_FFC_VII.z" import "gc_protonpack.z" //import "gc_firearms.z" import "gc_beamos.z" import "gc_jumpblock_v1.z" import "gc_trowel.z" import "gc_mirror_new.z" import "gc_grimoire.z" import "gc_goggles_ffc.z" import "gc_gogglesitem.z" ///////////////////////////////////// /// Wallet & Pockets Item Scripts /// ///////////////////////////////////// item script moneyPickup{ void run(int coinsize, int coinvalue) { int walletFreeSpace = ( totalWalletSpace - 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{ void run (int capacity){ if ( capacity == 0 ) { walletsOwned += 1; } if ( capacity > 0 ){ Game->Counter[CR_CUSTOM_WALLET_SIZE] += capacity; //Can make different sized wallets noFreeSpace = false; } } } item script pickUpEatableShield { void run(){ bool hasShield = true; bool shieldMessage = false; } } item script pickUpEatableSword{ void run() { bool hasSword = true; bool swordMessage = false; } } item script pickUpEatableArmour{ void run(){ bool hasArmour = true; bool armourMessage = false; } } /////////////////////// //// THE DALEKS ///// /////////////////////// bool dalekLanding = false; //const int WLS_LASERCOLOR = 183; //Color of the laser beam: [CSet# * 16] + [Color within CSet from 0 to 15] //const int WLS_LASEROPACITY = 108; //128 = Opaque, 64 = Transparent // Dalek Colour 182, 1, 0, 0, 0, 90 //Dalek beam colour choices 98 - 147 - 182 - 183 //import "gc_dalek_v5.z" //import "gc_dalek_v6.z" // Working, but jittery Daleks - Dizzy, dizzy, dizzy Daleks. import "gc_dalek_v7.z" //Diabled turning in the script -- They can't functionj without it. Reverting to v6. ////////////////////////////// //// DALEK LASER SHIP GUN //// ////////////////////////////// //import "gc_lasersentry.z" //import "gc_lasersentry_v1.z" //import "gc_lasersentry_v2.z" //import "gc_lasersentry_v3.z" //import "gc_lasersentry_v4.z" //import "gc_lasersentry_v5.z" import "gc_lasersentry_v6.z" import "gc_spinFFC.z" import "gc_spinFFC2.z" //////////////////// /// SHOP SCRIPTS /// //////////////////// import "gc_shop.z" //////////////////// /// FFC SOLIDIDY /// //////////////////// //import "gc_solidify.z" //import "gc_solid_NPC.z" import "gc_solid_NPC_v3.z" import "gc_solid_FFC_for_enemies_only.z" ////////////////////////// ///// BOSSES ///// ////////////////////////// import "gc_Dragon.z" ////////////////////////// ///// FFC TRIGGERS ///// ////////////////////////// import "gc_itemtriggerFFC.z" import "gc_electricRemove.z" ///////////////////// /// Enemy Scripts /// ///////////////////// ///////////////////////////////////// /// Enemy Vulnerabilities /// /// Modified from: the Gibdo Burn /// /// Script by MoscowModder /// /// Combined with the FFC Trigger /// /// Script by: grayswandir /// ///////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////// /// Place on screen with an enemy, so that if it is killed by a specific type of weapon /// /// it spawms a different enemy. or produces a different effect. /// /// D0: Enemy Number of SOurce Enemy to Affect. /// /// D1: Enemy to Replace D0 with on Contact with Trigger. /// /// D2: Trigger - Positive Number for Specific Item Number; Negative Number of LW Type. /// ///////////////////////////////////////////////////////////////////////////////////////////// /// Place one FFC of this script on the screen for each enemy to affect by it. /// /// You can cascade this by setting the replacement enemy type as a source type in /// /// a second instance of this FFC. /// /// THis can be especially useful for spells: You can have enemies that are outwardly /// /// invincible, but are changed once affected by a spell or item. You can use the same /// /// sprite, or a variation of itl to reflect the change int he state of the enemy, or to /// /// make the change invisible to the player. /// ///////////////////////////////////////////////////////////////////////////////////////////// ffc script specialEnemyVulnerability{ void run(int enemy1, int enemy2, int trigger) { while(true){ for(int i = 1; i < Screen->NumNPCs(); i++){ //Check every enemy npc enem = Screen->LoadNPC(i); if(enem->ID == enemy1){ //If it's a the enemeny editor number of enemy1 for(int j = 1; j < Screen->NumLWeapons(); j++){ //Check every weapon lweapon weap = Screen->LoadLWeapon(j); if (weap->CollDetection && Collision(enem, weap)) { //if the LW touches the enemy, if (IsFromItem(weap, trigger)) { // If LW is from right item type. npc newEnem = CreateNPCAt(enemy2, enem->X, enem->Y); //Create the skeleton newEnem->HP = enem->HP; //Set its HP to gibdo's HP (optional; can remove this) Remove(enem); //Remove gibdo quietly } else if (IsFromItemClass(weap, -trigger)) { npc newEnem = CreateNPCAt(enemy2, enem->X, enem->Y); //Create the replacement enemy. newEnem->HP = enem->HP; //Set its HP to original enemy's HP (optional; can remove this) Remove(enem); //Remove original enemy quietly } } } } Waitframe(); } } } } item script playSound{ void run(int sfx){ Game->PlaySound(sfx); } } ///////////////////// /// WEAPON SYSTEM /// //////////////////// item script active{ void run(int weapon){ WeaponCreated[weapon] = true; } } item script SwordofLight_NWS { void run () { int currLevel = Game->Counter[CR_LEVEL]; int halfLevel = currLevel * 0.5; int itemdamage; int baseItemDamage = ( rollDie(10) + rollDie(10) + rollDie(10) ); int levelDamage = diePerLevel(4,0); int totalItemDamage = baseItemDamage + levelDamage; itemdamage = totalItemDamage + getMuscStat(); currentDamage = itemdamage; WSpierce = false; int baseLifeCost = rollDie(10); int lifeCost = rollDie(10) + rollDie(10) + rollDie(10); int lifeCostByLevel = halfLevel * lifeCost; int lifeDrainAmount = baseLifeCost + lifeCostByLevel; bool enoughLife; bool enoughMagic; int baseMagicCost = rollDie(10); int magicCost = rollDie(10) + rollDie(10) + rollDie(10) + rollDie(10); int magicCostByLevel = halfLevel * magicCost; int magicDrainAmount = baseMagicCost + magicCostByLevel; if ( magicDrainAmount < Game->Counter[CR_MAGIC] ) { enoughMagic = true; } if ( enoughMagic == true ) { Game->Counter[CR_MAGIC] -= magicDrainAmount; //Set this to -= magicDrainAmount when I am able to repace sword damage. } else { Game->PlaySound(SFX_ERROR); Game->Counter[CR_MAGIC] = 0; WeaponCreated[LW_SWORD] = true; Trace(currentDamage); } } } item script Bow_NWS { void run () { int currLevel = Game->Counter[CR_LEVEL]; int halfLevel = currLevel * 0.5; int itemdamage; int baseItemDamage = ( rollDie(10) + rollDie(10) + rollDie(10) ); int levelDamage = diePerLevel(4,0); int totalItemDamage = baseItemDamage + levelDamage; itemdamage = totalItemDamage + getMuscStat(); currentDamage = itemdamage; WSpierce = true; int baseLifeCost = rollDie(10); int lifeCost = rollDie(10) + rollDie(10) + rollDie(10); int lifeCostByLevel = halfLevel * lifeCost; int lifeDrainAmount = baseLifeCost + lifeCostByLevel; bool enoughLife; bool enoughMagic; int baseMagicCost = rollDie(10); int magicCost = rollDie(10) + rollDie(10) + rollDie(10) + rollDie(10); int magicCostByLevel = halfLevel * magicCost; int magicDrainAmount = baseMagicCost + magicCostByLevel; if ( magicDrainAmount < Game->Counter[CR_MAGIC] ) { enoughMagic = true; } if ( enoughMagic == true ) { Game->Counter[CR_MAGIC] -= magicDrainAmount; //Set this to -= magicDrainAmount when I am able to repace sword damage. } else { Game->PlaySound(SFX_ERROR); Game->Counter[CR_MAGIC] = 0; WeaponCreated[LW_ARROW] = true; Trace(currentDamage); } } } int currentDamage; int beamMultiplier = 0.5; bool WSpierce = false; item script Nightfall{ void run() { int currLevel = Game->Counter[CR_LEVEL]; int lifeCost = 15; int drainAmount = currLevel * lifeCost; Game->Counter[CR_LIFE] -= drainAmount; } } item script NightFallRolled { void run () { int currLevel = Game->Counter[CR_LEVEL]; int halfLevel = currLevel * 0.5; int itemdamage; int baseItemDamage = ( rollDie(10) + rollDie(10) + rollDie(10) ); int levelDamage = diePerLevel(4,0); int totalItemDamage = baseItemDamage + levelDamage; itemdamage = totalItemDamage + getMuscStat(); currentDamage = itemdamage; WSpierce = true; int baseLifeCost = rollDie(10); int lifeCost = rollDie(10) + rollDie(10) + rollDie(10); int lifeCostByLevel = halfLevel * lifeCost; int lifeDrainAmount = baseLifeCost + lifeCostByLevel; bool enoughLife; bool enoughMagic; int baseMagicCost = rollDie(10); int magicCost = rollDie(10) + rollDie(10) + rollDie(10) + rollDie(10) + rollDie(10) + rollDie(10); int magicCostByLevel = halfLevel * magicCost; int magicDrainAmount = baseMagicCost + magicCostByLevel; if ( magicDrainAmount < Game->Counter[CR_MAGIC] ) { enoughMagic = true; } if ( lifeDrainAmount < Game->Counter[CR_LIFE] ) { enoughLife = true; } if ( enoughLife== true && enoughMagic == true ) { Game->Counter[CR_MAGIC] -= magicDrainAmount; Game->Counter[CR_LIFE] -= lifeDrainAmount; //Set this to -= magicDrainAmount when I am able to repace sword damage. } else { Game->PlaySound(SFX_ERROR); Game->Counter[CR_MAGIC] = 0; Game->Counter[CR_LIFE] = 0; } } } item script steelSwordRolled { void run () { int currLevel = Game->Counter[CR_LEVEL]; int halfLevel = currLevel * 0.5; int itemdamage; //int baseItemDamage = ( rollDie(100) ); int levelDamage = diePerLevel(4,0); //int totalItemDamage = baseItemDamage; //itemdamage = totalItemDamage; currentDamage = rollDie(100); WSpierce = true; WeaponCreated[LW_SWORD] = true; //WeaponCreated[LW_BEAM] = true; } } item script roll1d6Sword { void run () { int currLevel = Game->Counter[CR_LEVEL]; int halfLevel = currLevel * 0.5; int itemdamage; itemdamage = ( rollDice(1,6) ); //int levelDamage = diePerLevel(4,0); //int totalItemDamage = baseItemDamage + levelDamage; //itemdamage = totalItemDamage + getMuscStat(); currentDamage = itemdamage; WSpierce = false; } } item script rollDiceSword { void run (int dice, int dieType) { int currLevel = Game->Counter[CR_LEVEL]; int halfLevel = currLevel * 0.5; int itemdamage; itemdamage = ( rollDice(dice,dieType) ); //int levelDamage = diePerLevel(4,0); //int totalItemDamage = baseItemDamage + levelDamage; //itemdamage = totalItemDamage + getMuscStat(); currentDamage = itemdamage; WSpierce = false; } } item script rollDiceIISword { void run (int dice, int dieType, int pierce) { int currLevel = Game->Counter[CR_LEVEL]; int halfLevel = currLevel * 0.5; int itemdamage; itemdamage = ( rollDiceII(dice,dieType) ); //int levelDamage = diePerLevel(4,0); //int totalItemDamage = baseItemDamage + levelDamage; //itemdamage = totalItemDamage + getMuscStat(); currentDamage = itemdamage; if ( pierce == 0 ) { WSpierce = false; } else if ( pierce > 0 ) { WSpierce = true; } } } //Swords Args //D0: diceToRoll, number of dice to roll for base damage. //D1: dieType, the base Die Type for weapon. //D2: byLevel, add scaling damage per level. //D3: useHalfLevel, use 1/2 level, instead of full level, for scaling damage. //D4: levelDie, die type to roll per level for scaling damage. //D5: dieCap, if rolling by level, the maximum number of additional dice to roll. //D6: pierce, 0 not piercing, 1 piercing. //D7: item script rollDiceIISword_Scaling { void run (int diceToRoll, int dieType, int byLevel, int useHalfLevel, int levelDie, int dieCap, int pierce) { int currLevel = Game->Counter[CR_LEVEL]; int baseDamage; int scaleDamage; int itemdamage; int modifier = 0; int scaleDice = 0; modifier = ( Game->Counter[CR_STAT_MUSC] * 0.5 ); if ( dieCap > 0 && currLevel > dieCap ) { currLevel = dieCap; } int halfLevel = ( currLevel * 0.5 ); if ( byLevel > 0 && useHalfLevel == 0 ) { scaleDice = currLevel; } if ( byLevel > 0 && useHalfLevel > 0 ) { scaleDice = halfLevel; } baseDamage = ( rollDiceII(diceToRoll,dieType) ); scaleDamage = ( rollDiceII(scaleDice,levelDie) ); itemdamage = ( baseDamage + scaleDamage + modifier ); //int levelDamage = diePerLevel(4,0); //int totalItemDamage = baseItemDamage + levelDamage; //itemdamage = totalItemDamage + getMuscStat(); currentDamage = itemdamage; WSpierce = false; } } item script rollDiceDWSword { void run (int dice, int dieType) { int currLevel = Game->Counter[CR_LEVEL]; int halfLevel = currLevel * 0.5; int itemdamage; itemdamage = ( rollDiceDW(dice,dieType) ); //int levelDamage = diePerLevel(4,0); //int totalItemDamage = baseItemDamage + levelDamage; //itemdamage = totalItemDamage + getMuscStat(); currentDamage = itemdamage; WSpierce = false; } } item script rollDiceAluCSword { void run (int dice, int dieType) { int currLevel = Game->Counter[CR_LEVEL]; int halfLevel = currLevel * 0.5; int itemdamage; itemdamage = ( RollDiceAlucard(dice,dieType) ); //int levelDamage = diePerLevel(4,0); //int totalItemDamage = baseItemDamage + levelDamage; //itemdamage = totalItemDamage + getMuscStat(); currentDamage = itemdamage; WSpierce = false; } } //Swords Args //D0: dieType, the base Die Type for weapon. //D1: diceToRoll, number of dice to roll for base damage. //D2: byLevel, add scaling damage per level. //D3: useHalfLevel, use 1/2 level, instead of full level, for scaling damage. //D4: levelDie, die type to roll per level for scaling damage. //D5: dieCap, if rolling by level, the maximum number of additional dice to roll. //D6: pierce, 0 not piercing, 1 piercing. //D7: item script NWS_SWORD_II { void run (int dieType, int diceToRoll, int byLevel, int useHalfLevel, int levelDie, int dieCap, int pierce) { int currLevel = Game->Counter[CR_LEVEL]; int halfLevel = currLevel * 0.5; int itemdamage; int scaleDice; if ( dieCap > 0 && currLevel > dieCap ) { currLevel = dieCap; if ( diceToRoll == 0 && byLevel > 0 && useHalfLevel == 0 ) { scaleDice = currLevel; } if ( diceToRoll == 0 && byLevel > 0 && useHalfLevel > 0 ) { scaleDice = halfLevel; } int stat = getMuscStat(); int modifier; if ( stat > 0 ) { modifier = ( getMuscStat() / 2 ); } else if ( stat == 0 ) { modifier = 1; } int baseItemDamage = ( rollDice(diceToRoll, dieType) ); int levelDamage = diePerLevel(levelDie,scaleDice); int totalItemDamage = baseItemDamage + levelDamage; itemdamage = totalItemDamage + modifier; currentDamage = itemdamage; if ( pierce == 0 ) { WSpierce = false; } else if ( pierce > 0 ) { WSpierce = true; } } } } item script SwordofLight { void run () { int currLevel = Game->Counter[CR_LEVEL]; int halfLevel = currLevel * 0.5; int baseLifeCost = rollDie(10); int lifeCost = rollDie(10) + rollDie(10) + rollDie(10); int lifeCostByLevel = halfLevel * lifeCost; int lifeDrainAmount = baseLifeCost + lifeCostByLevel; bool enoughLife; bool enoughMagic; int baseMagicCost = rollDie(10); int magicCost = rollDie(10) + rollDie(10) + rollDie(10) + rollDie(10); int magicCostByLevel = halfLevel * magicCost; int magicDrainAmount = baseMagicCost + magicCostByLevel; if ( magicDrainAmount < Game->Counter[CR_MAGIC] ) { enoughMagic = true; } if ( enoughMagic == true ) { Game->Counter[CR_MAGIC] -= magicDrainAmount; //Set this to -= magicDrainAmount when I am able to repace sword damage. } else { Game->PlaySound(SFX_ERROR); Game->Counter[CR_MAGIC] = 0; } } } item script swordOfLightPickup { void run(){ ownSwordOfLight = true; } } ffc script FFC_Enemy_Script_Defenses{ void run(int enemyID, int hp, int defenceItem, int defenceType){ npc ffcEnemy = CreateNPCAt(enemyID, this->X, this->Y); //Create enemyReplace at the FFC position. ffcEnemy->HP = hp; ffcEnemy->X = this->X; ffcEnemy->Y = this->Y; SET_SCRIPT_DEFENSE(defenceItem, enemyID, defenceType); while (true){ Waitframe(); } } } item script weaponmodarrow{ void run(int index){ lweapon arrow = Screen->CreateLWeapon(LW_ARROW); arrow->Misc[1] = rollDice(1,8); //movement stuff } } item script timerItem { void run(int itemNumber, int time){ timerItem = itemNumber; timerValue = time; cigarPickup = true; } } ffc script spawnEnemy{ void run(int enemyID, int hp){ npc ffcEnemy = CreateNPCAt(enemyID, this->X, this->Y); //Create enemyReplace at the FFC position. ffcEnemy->HP = hp; while (true){ ffcEnemy->X = this->X; ffcEnemy->Y = this->Y; Waitframe(); } } } /////////////////// /// GAME ENGINE /// /////////////////// import "gc_titleScreen_menu.z" import "gc_Dragon2.z" import "gc_changeTerrainFFC.z" ///ChangeTerrain Error on Line 239 Cannot cast from bool to float. import "gc_enemyChanger_v14.z" //EnemyChanger Error at Line 255. import "gc_brangKeyFFC_8.z" import "gc_regenerateHP.z" import "gc_sernaraniCheck.z" /// DigiVolve incomplete. Error at Line 25. //import "gc_digiVolve.z" //18th May, 2014 Additions: import "gc_rolledHP_MP_restore.z" import "gc_money2.z" //item scipt NightfallPickup { // void run(){ // ownNightfall = true; // } //} ////////////////////////// ///// GAME CREDITS ///// ////////////////////////// //CREDITS for Scripts (Aplhabetical) //Aevin -- SOme scripting ideas. //Alucard -- headers, and misc script improvements. //Gleeok -- For GetDigit //grayswandir -- For the FFC trigger script. //jsm116 -- General scripting assistance, and the extended (reach) LWeapon FC scripts. //MoscowModder -- One of the most amazing, and talented ZC Scripters out there. Aside from the obvious, he is responsible for the Daleks and other laser shootig enemies; plus the shop script, and the original XP engine. Doumo arigatou gozaimashita MM-san! //MasterManiac -- Contributor credits: Weapon Damage System, Scripted Subscreens, and general assistance. //Safith -- THis wonderful is responsible for Ghost.zh and pretty much for getting 2.50 finished. He also gave the initial information that I needed, to properly start this project, and created Tango, on which this game is destined to rely. We all love you mate! //tox_von for the Bombodos script //ZoriaRPG for making things work, making modifications, a few custom things, and combining it all in a way that functions, plus many of the scripts, new script functions, the new XP & RPG system in general, and overall game concept, story, and proper nouns. //Please let me know if I'm using your scripts. I will always give credit. //CREDITS for Gametesting //EddyTheOliveira for bugtesting & streaming v0,57r29A (April 2014) //MabusTheDark for game playtesting, and bug reports. //Miop - Initial concept teating. //Ryunaker - For EXTENSIVE gametesting, suggestions, contributions and support!