Results 1 to 3 of 3
  1. #1
    Luminescentz's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Location
    Chicago
    Posts
    15
    Reputation
    17
    Thanks
    451

    The whole MainMovie

    Code:
    // Action script...
    
    // [onClipEvent of sprite 163 in frame 1]
    onClipEvent (load)
    {
        function IsClipLoaded(clip)
        {
            if (clip == undefined)
            {
                return (true);
            } // end if
            var _loc1 = clip.getBytesTotal();
            var _loc3 = clip.getBytesLoaded();
            return (_loc1 > 4 && _loc3 >= _loc1);
        } // End of the function
        function LoadInitialTown()
        {
            var _loc2 = _root.player;
            var _loc3 = _loc2.strTown.toLowerCase();
            if (_loc3 == "limbo.swf" || _loc3 == "limbo")
            {
                if (_root.intGameMode == 0)
                {
                    _loc2.strTown = _root.func.GString("file-limbo");
                }
                else
                {
                    _loc2.strTown = "wf-eventhorizon.swf";
                } // end else if
            }
            else if (_loc3 == "jail")
            {
                _loc2.strTown = _root.func.GString("file-jail");
            }
            else if (_loc3 == "w")
            {
                _loc2.strTown = _root.func.GString("file-alteon");
            }
            else
            {
                _loc2.strTown = _root.func.GString("file-defaulttown");
            } // end else if
            _loc2.strTownOriginal = _loc2.strTown;
            _root.town._visible = true;
            if (_root.strAutoAd == "yes" && _loc3 != "w" && _root.func.Zero(_loc2.intDailyAds) == 0 && _loc2.intLevel > 2 && _loc2.intCharType < 2)
            {
                var _loc4 = _root.func.GString("file-ballyhoo");
                _root.func.LoadTownFile(_loc4, false);
            }
            else
            {
                _root.func.LoadTownFile(_loc2.strTown, false);
            } // end else if
        } // End of the function
        function LoadTownFile(fn, bSetHomeTown)
        {
            unloadMovieNum(1);
            unloadMovieNum(2);
            if (fn.substr(0, 7) == "string:")
            {
                fn = fn.substr(7, 50);
                fn = _root.func.GString(fn);
            } // end if
            _root.town.loadMovie("towns/" + fn);
            if (bSetHomeTown == true)
            {
                _root.player.strTown = fn;
            } // end if
        } // End of the function
        function StartFightingEngine()
        {
            bInitiativeWasDetermined = false;
            _root.func.InitMonster();
            _root.func.InitPlayer();
            if (_root.player.strPet != "none" && _root.player.strPet != "")
            {
                _root.func.DoPetIntro();
            } // end if
            if (_root.player.strGuest != "none" && _root.player.strGuest != "")
            {
                _root.guest._visible = true;
                _root.guest.gotoAndPlay("Intro");
            } // end if
        } // End of the function
        function CalculateBattleEndTime(intDivider)
        {
            _root.func.intTime_BattleEnd = _root.func.intTime_BattleStart + 15000 / intDivider + Math.abs(_root.func.intBattleStretch);
            if (getTimer() - _root.func.intTime_BattleStart < 9000)
            {
                _root.func.intBattleStretch = _root.func.intBattleStretch + 222;
            } // end if
        } // End of the function
        function GetTimeBattleEnd()
        {
            return (_root.func.intTime_BattleEnd);
        } // End of the function
        function StartRound()
        {
            ++_root.player.intCounterTotalRounds;
            ++_root.player.intCounterCurrentRound;
            _root.p.StartRound();
            _root.p.shield.StartRound();
            _root.miscitem.StartRound();
            _root.pet.StartRound();
            _root.guest.StartRound();
            _root.p.weapon.StartRound();
            _root.m.StartRound();
            _root.stat.StartRound();
        } // End of the function
        function EndRound()
        {
            _root.p.EndRound();
            _root.p.shield.EndRound();
            _root.miscitem.EndRound();
            _root.pet.EndRound();
            _root.guest.EndRound();
            _root.p.weapon.EndRound();
            _root.m.EndRound();
            _root.stat.EndRound();
        } // End of the function
        function TurnPlayer()
        {
            ++_root.player.intCounterCurrentTurn;
            _root.func.PlayerRegenerateSP();
            _root.player.intSpellCost = 0;
            _root.player.intSpellCostHP = 0;
            _root.player.intSpellCostSP = 0;
            _root.p.StartPlayerTurn();
            _root.p.shield.StartPlayerTurn();
            _root.miscitem.StartPlayerTurn();
            _root.pet.StartPlayerTurn();
            _root.guest.StartPlayerTurn();
            _root.p.weapon.StartPlayerTurn();
            objAllowPlayerTurn = new Object();
            objAllowPlayerTurn.bitAllowTurn = true;
            _root.stat.StartTurnPlayer(objAllowPlayerTurn);
            if (objAllowPlayerTurn.bitAllowTurn)
            {
                delete objAllowPlayerTurn;
                _root.playerMenuOptions.InitAttackMenu();
                return (true);
            }
            else
            {
                delete objAllowPlayerTurn;
                _root.gotoAndPlay("AfterPlayerTurn");
                return (false);
            } // end else if
        } // End of the function
        function EndTurnPlayer()
        {
            _root.p.EndPlayerTurn();
            _root.p.shield.EndPlayerTurn();
            _root.miscitem.EndPlayerTurn();
            _root.pet.EndPlayerTurn();
            _root.guest.EndPlayerTurn();
            _root.p.weapon.EndPlayerTurn();
            objEndPlayerTurn = new Object();
            objEndPlayerTurn.bitEndTurn = true;
            _root.stat.EndTurnPlayer(objEndPlayerTurn);
            bitResult = objEndPlayerTurn.bitEndTurn;
            delete objEndPlayerTurn;
            return (bitResult);
        } // End of the function
        function TurnMisc()
        {
            if (_root.player.intActiveMisc < 0)
            {
                _root.gotoAndPlay("AfterMiscTurn");
                return (false);
            }
            else
            {
                objMiscTurn = new Object();
                objMiscTurn.bitTakeTurn = true;
                _root.stat.StartTurnMisc(objMiscTurn);
                if (!objMiscTurn.bitTakeTurn)
                {
                    delete objMiscTurn;
                    _root.gotoAndPlay("AfterMiscTurn");
                    return (false);
                }
                else
                {
                    delete objMiscTurn;
                    if (_root.miscitem.DoCombatTurn() != true)
                    {
                        _root.gotoAndPlay("AfterMiscTurn");
                        return (false);
                    }
                    else
                    {
                        return (true);
                    } // end else if
                } // end else if
            } // end else if
        } // End of the function
        function EndTurnMisc()
        {
            objEndMiscTurn = new Object();
            objEndMiscTurn.bitEndTurn = true;
            _root.stat.EndTurnMisc(objEndMiscTurn);
            bitResult = objEndMiscTurn.bitEndTurn;
            delete objEndMiscTurn;
            return (bitResult);
        } // End of the function
        function TurnGuest()
        {
            if (_root.player.strGuest != "none" && _root.player.strGuest != "")
            {
                objGuestTurn = new Object();
                objGuestTurn.bitTakeTurn = true;
                _root.stat.StartTurnGuest(objGuestTurn);
                bitResult = objGuestTurn.bitTakeTurn;
                delete objGuestTurn;
                if (bitResult)
                {
                    _root.guest.gotoAndPlay("AI");
                    return (true);
                }
                else
                {
                    _root.gotoAndPlay("AfterGuestTurn");
                    return (false);
                } // end else if
            }
            else
            {
                _root.gotoAndPlay("AfterGuestTurn");
                return (false);
            } // end else if
        } // End of the function
        function EndTurnGuest()
        {
            objEndGuestTurn = new Object();
            objEndGuestTurn.bitEndTurn = true;
            _root.stat.EndTurnGuest(objEndGuestTurn);
            bitResult = objEndGuestTurn.bitEndTurn;
            delete objEndGuestTurn;
            return (bitResult);
        } // End of the function
        function TurnPet()
        {
            if (_root.player.strPet != "none" && _root.player.strPet != "" && _root.strPetAction == "attack")
            {
                objPetTurn = new Object();
                objPetTurn.bitTakeTurn = true;
                _root.stat.StartTurnPet(objPetTurn);
                bitResult = objPetTurn.bitTakeTurn;
                delete objPetTurn;
                if (bitResult)
                {
                    _root.pet.gotoAndPlay("AI");
                    return (true);
                }
                else
                {
                    _root.gotoAndPlay("AfterPetTurn");
                    return (false);
                } // end else if
            }
            else
            {
                _root.gotoAndPlay("AfterPetTurn");
                return (false);
            } // end else if
        } // End of the function
        function EndTurnPet()
        {
            objEndPetTurn = new Object();
            objEndPetTurn.bitEndTurn = true;
            _root.stat.EndTurnPet(objEndPetTurn);
            bitResult = objEndPetTurn.bitEndTurn;
            delete objEndPetTurn;
            return (bitResult);
        } // End of the function
        function TurnMonster()
        {
            ++_root.monster.intCounterCurrentTurn;
            _root.monster.intCounterCurrentRound = root.monster.intCounterCurrentTurn;
            _root.m.StartMonsterTurn();
            objAllowMonsterTurn = new Object();
            objAllowMonsterTurn.bitAllowTurn = true;
            _root.stat.StartTurnMonster(objAllowMonsterTurn);
            var _loc2 = objAllowMonsterTurn.bitAllowTurn;
            delete objAllowMonsterTurn;
            if (_root.intMonsterFrozen > 0)
            {
                --_root.intMonsterFrozen;
                if (_root.intMonsterFrozen == 0)
                {
                    _root.func.UnFreezeMonster();
                    _loc2 = _loc2 && true;
                }
                else
                {
                    _loc2 = false;
                } // end else if
            }
            else if (_root.intMonsterParalyzed > 0)
            {
                --_root.intMonsterParalyzed;
                if (_root.intMonsterParalyzed == 0)
                {
                    _root.func.UnParalyzeMonster();
                    _loc2 = _loc2 && true;
                }
                else
                {
                    _loc2 = false;
                } // end else if
            } // end else if
            if (_loc2)
            {
                _root.m.gotoAndPlay("AI");
                return (true);
            }
            else
            {
                _root.gotoAndPlay("AfterMonsterTurn");
                return (false);
            } // end else if
        } // End of the function
        function EndTurnMonster()
        {
            _root.m.EndMonsterTurn();
            objEndMonsterTurn = new Object();
            objEndMonsterTurn.bitEndTurn = true;
            _root.stat.EndTurnMonster(objEndMonsterTurn);
            bitResult = objEndMonsterTurn.bitEndTurn;
            delete objEndMonsterTurn;
            return (bitResult);
        } // End of the function
        function ShouldPlayMonsterIdle()
        {
            objShouldPlayMonsterIdle = new Object();
            objShouldPlayMonsterIdle.shouldIdle = true;
            _root.stat.ShouldMonsterIdle(objShouldPlayMonsterIdle);
            bitResult = objShouldPlayMonsterIdle.shouldIdle;
            delete objShouldPlayMonsterIdle;
            return (bitResult && _root.func.Zero(_root.intMonsterFrozen) <= 0 && _root.func.Zero(_root.intMonsterParalyzed) <= 0);
        } // End of the function
        function BattleWin()
        {
            _root.func.CalculateBattleEndTime(1);
            _root.soundfx.Noise("victory");
            _root.func.BuildVictoryMsg();
        } // End of the function
        function BattleLose()
        {
            _root.func.CalculateBattleEndTime(2);
            _root.soundfx.Noise("failure");
            if (_root.player.intHP <= 0)
            {
                _root.strDefeatMsg = _root.lang[10];
            }
            else
            {
                _root.strDefeatMsg = _root.lang[9];
            } // end else if
        } // End of the function
        function BattleCleanUp()
        {
            ++_root.player.intCounterTotalBattles;
            _root.player.intCounterCurrentRound = 0;
            _root.monster.intCounterCurrentRound = 0;
            _root.quest.HideGuest();
            _root.quest.HidePet();
            _root.func.UnloadMisc();
            unloadMovie(_root.background);
            -34;
            _root.m.loaded = false;
            _root.m._visible = false;
            _root.m.gotoAndStop("Ready");
            _root.p._visible = false;
            _root.p.gotoAndStop("Ready");
            _root.ProfileMonster._visible = false;
            _root.ProfileMonster.gotoAndStop("Init");
            _root.ProfilePlayer.gotoAndStop("Init");
            _root.gotoAndStop("Ready");
        } // End of the function
        function LoadTown()
        {
            _root.func.BattleCleanUp();
            if (_level1 == undefined && _level100 == undefined)
            {
                _root.town.play();
            } // end if
        } // End of the function
        function DiedInBattle()
        {
            _root.func.BattleCleanUp();
            _root.player.intSP = 0;
            _root.player.intMP = 0;
            if (_root.town.DiedInBattle != undefined)
            {
                _root.town.DiedInBattle();
            }
            else if (_root.walk.DiedInBattle != undefined)
            {
                _root.walk.DiedInBattle();
            }
            else if (_root.intGameMode == 0)
            {
                _root.func.LoadTownFile(_root.func.GString("file-death"));
            }
            else
            {
                _root.func.LoadTownFile(_root.func.GString("file-deathWF"));
            } // end else if
        } // End of the function
        function FledBattle()
        {
            _root.func.BattleCleanUp();
            if (_root.user.strResolution == "cancel")
            {
                _root.func.LoadTownFile(_root.player.strTown);
                return;
            } // end if
            if (_root.town.FledBattle != undefined)
            {
                _root.town.FledBattle();
            }
            else if (_root.walk.FledBattle != undefined)
            {
                _root.walk.FledBattle();
            }
            else
            {
                _root.func.LoadTownFile(_root.player.strTown);
            } // end else if
        } // End of the function
        function WonBattle()
        {
            _root.func.BattleCleanUp();
            if (_root.town.WonBattle != undefined)
            {
                _root.town.WonBattle();
            }
            else if (_root.walk.WonBattle != undefined)
            {
                _root.walk.WonBattle();
            }
            else
            {
                _root.town.play();
            } // end else if
        } // End of the function
        function PlayerLeveledUp()
        {
            var _loc2 = _root.player;
            _root.player.intLeveledUp = 0;
            _loc2.intLevel = _loc2.intLevel + 1;
            _root.strVictoryMSG = _root.lang[15] + _loc2.intLevel;
            _root.func.SetupPlayer();
            _root.func.CalculateNeededExp();
            _root.func.UpdateStatusBars();
            _root.gotoAndPlay("LevelUp");
        } // End of the function
        function SetupPlayer()
        {
            var _loc2 = _root.player;
            _root.func.RecalculateBase();
            _loc2.intHP = _loc2.intBaseHP;
            _loc2.intMP = _loc2.intBaseMP;
            _root.func.UpdateStatusBars();
        } // End of the function
        function RecalculateBase()
        {
            var _loc2 = _root.player;
            _loc2.intBaseHP = 100 + _loc2.intLevel * 5;
            _loc2.intBaseMP = 100 + _loc2.intLevel * 5;
            _loc2.intBaseSP = 50 + _loc2.intLevel * 5;
            _loc2.intBaseHP = Math****und(_loc2.intBaseHP + _loc2.intBaseHP * _loc2.intEND / 100);
            _loc2.intBaseMP = Math****und(_loc2.intBaseMP + _loc2.intBaseMP * _loc2.intINT / 100);
            _root.func.UpdateStatusBars();
        } // End of the function
        function PrepareLoadedCharacter()
        {
            var _loc2 = _root.player;
            _root.user.strCharacterName = _loc2.strCharacterName;
            _loc2.head._xscale = 100;
            _loc2.head._yscale = 100;
            _root.background._visible = false;
            _root.func.ConvertData("player");
            _loc2.intSpellCost = 0;
            _loc2.intSpellCostHP = 0;
            _loc2.intSpellCostSP = 0;
            _loc2.intSP = 0;
            _loc2.intFlee = 20;
            _loc2.strFlee = "(" + _loc2.intFlee + ")";
            _loc2.intQueuedFlees = 0;
            _loc2.intQueuedCancels = 0;
            _root.player.objSessionData = new Object();
            _root.player.objSessionData.charID = _root.player.idLore_Characters;
            _root.player.charge = _root.player.objSessionData;
            _loc2.intCounterTotalBattles = 0;
            _loc2.intCounterTotalRounds = 0;
            _loc2.intCounterCurrentRound = 0;
            _loc2.intCounter******it = 0;
            _loc2.intCounterTotalMiss = 0;
            _loc2.intCounterTotalDamageFIRE = 0;
            _loc2.intCounterTotalDamageWATER = 0;
            _loc2.intCounterTotalDamageICE = 0;
            _loc2.intCounterTotalDamageWIND = 0;
            _loc2.intCounterTotalDamageEARTH = 0;
            _loc2.intCounterTotalDamageENERGY = 0;
            _loc2.intCounterTotalDamageLIGHT = 0;
            _loc2.intCounterTotalDamageDARKNESS = 0;
            _loc2.intCounterTotalDamageMELEE = 0;
            _loc2.intCounterTotalDamageRANGED = 0;
            _loc2.intCounterTotalDamageMAGIC = 0;
            _loc2.intCounterTotalDamagePET = 0;
            _loc2.intCounterTotalDamageGUEST = 0;
            _root.func.MAX_CHARACTER_LEVEL = _loc2.intMaxCharLevel;
            _loc2.intPotionPurple = 3;
            -35;
            var _loc3 = _root.func.Bounds(_loc2.intCharType, 1, 5);
            if (_root.intGameMode == 1)
            {
                _loc3 = _loc3 + (2 + _loc2.intCharType);
            } // end if
            _root.quest.MAX_POTIONS_HP = 20 + 5 * _loc3;
            _root.quest.MAX_POTIONS_MP = 20 + 5 * _loc3;
            _root.quest.STARTING_POTIONS = _loc3;
            _loc2.intRefillPotionHP = _loc3;
            _loc2.intRefillPotionMP = _loc3;
            _root.quest.RefillPotionHP();
            _root.quest.RefillPotionMP();
            _root.func.SetupNoneShield();
            _root.quest.InitQuestData();
            _root.func.SetupNonePet();
            _root.func.SetupNoneMisc();
            _root.func.SetupNoneSpell();
            _root.func.ClearInvalidInventory();
            arrLoginEquipNums = GetLoginEquipmentNums();
            _root.player.intActiveShield = arrLoginEquipNums[2];
            _root.player.intActiveArmor = arrLoginEquipNums[0];
            _root.player.intActiveWeapon = arrLoginEquipNums[1];
            _root.func.SetDefaultNoDropArmor();
            _root.func.SetDefaultNoDropShield();
            _root.func.SetDefaultNoDropWeapon();
            _root.func.SetActiveWeapon();
            _root.func.SetActiveArmor();
            _root.func.SetActiveShield();
            _root.func.SetActivePet();
            _loc2.strMiscName = "None";
            _loc2.intMiscFIRE = 0;
            _loc2.intMiscWATER = 0;
            _loc2.intMiscICE = 0;
            _loc2.intMiscWIND = 0;
            _loc2.intMiscEARTH = 0;
            _loc2.intMiscENERGY = 0;
            _loc2.intMiscLIGHT = 0;
            _loc2.intMiscDARKNESS = 0;
            _loc2.intMiscVOID = 0;
            _loc2.intMiscHEAL = 0;
            _loc2.intMiscHARM = 0;
            _loc2.intMiscMELEE = 0;
            _loc2.intMiscRANGED = 0;
            _loc2.intMiscMAGIC = 0;
            _loc2.intBasePotions = _loc2.intCharType;
            _root.func.SetupPlayer();
            _root.func.CalculateNeededExp();
            _root.func.RecalculateAttributes();
            _loc2.head.loadMovie("heads/" + _loc2.strFaceFrontFileName);
            _root.p.loadMovie("armors/" + _loc2.strArmorFileName);
            if (_root.player.intNewGuardian == 1)
            {
                _root.newguardian.HitTracking();
            } // end if
            _root.gotoAndPlay("LoadExtras");
        } // End of the function
        function GetLoginEquipmentNums()
        {
            rp = _root.player;
            intSavedEquipment1 = _root.quest.GetQuestValue(0, 42);
            intSavedEquipment2 = _root.quest.GetQuestValue(0, 43);
            intSavedEquipmentHash = intSavedEquipment1 * 36 + intSavedEquipment2;
            intArmorNo = Math.floor(intSavedEquipmentHash / 81);
            intWeaponNo = Math.floor((intSavedEquipmentHash - intArmorNo * 81) / 9);
            intShieldNo = intSavedEquipmentHash - intArmorNo * 81 - intWeaponNo * 9;
            if (intArmorNo == 0 || intArmorNo > rp.intArmorsNum || intArmorNo > MAX_SLOTS || isNaN(intArmorNo) || rp["strArmorDescription" + intArmorNo] == "z-token item" || !_root.func.CharacterIsGuardian())
            {
                intArmorNo = 1;
            } // end if
            if (intWeaponNo == 0 || intWeaponNo > rp.intWeaponsNum || intWeaponNo > MAX_SLOTS || isNaN(intWeaponNo) || rp["strWeaponDescription" + intWeaponNo] == "z-token item" || !_root.func.CharacterIsGuardian())
            {
                intWeaponNo = 1;
            } // end if
            if (intShieldNo > rp.intShieldsNum || isNaN(intShieldNo) || intShieldNo > MAX_SLOTS || rp["strShieldDescription" + intShieldNo] == "z-token item" || !_root.func.CharacterIsGuardian())
            {
                intShieldNo = 0;
            } // end if
            return ([intArmorNo, intWeaponNo, intShieldNo]);
        } // End of the function
        function SetLoginEquipmentNums(arrEquipNums)
        {
            rp = _root.player;
            intArmorNo = arrEquipNums[0];
            intWeaponNo = arrEquipNums[1];
            intShieldNo = arrEquipNums[2];
            if (!_root.func.CharacterIsGuardian())
            {
                return (false);
            } // end if
            if (intArmorNo > rp.intArmorsNum || intArmorNo > MAX_SLOTS || isNaN(intArmorNo) || rp["strArmorDescription" + intArmorNo] == "z-token item" || intArmorNo < 0)
            {
                return (false);
            } // end if
            if (intWeaponNo > rp.intWeaponsNum || intWeaponNo > MAX_SLOTS || isNaN(intWeaponNo) || rp["strWeaponDescription" + intWeaponNo] == "z-token item" || intWeaponNo < 0)
            {
                return (false);
            } // end if
            if (intShieldNo > rp.intShieldsNum || intShieldNo > MAX_SLOTS || isNaN(intShieldNo) || rp["strShieldDescription" + intShieldNo] == "z-token item" || intShieldNo < 0)
            {
                return (false);
            } // end if
            intHashNo = intArmorNo * 81 + intWeaponNo * 9 + intShieldNo;
            intSaveEquipment1 = Math.floor(intHashNo / 36);
            intSaveEquipment2 = intHashNo - intSaveEquipment1 * 36;
            _root.quest.SetQuestValue(0, 42, intSaveEquipment1);
            _root.quest.SetQuestValue(0, 43, intSaveEquipment2);
            _root.quest.SaveQuestData(0);
            _root.msg.Show("Succes");
            return (true);
        } // End of the function
        function SetDefaultNoDropShield()
        {
            var _loc2 = _root.player;
            objDefaultNoDropShield = new Object();
            if (_loc2.idLore_Shields1 == undefined)
            {
                return;
            } // end if
            objDefaultNoDropShield.idLore_Shields1 = _loc2.idLore_Shields1;
            objDefaultNoDropShield.strShieldName1 = _loc2.strShieldName1;
            objDefaultNoDropShield.strShieldDescription1 = _loc2.strShieldDescription1;
            objDefaultNoDropShield.intShieldLevel1 = _loc2.intShieldLevel1;
            objDefaultNoDropShield.strShieldFileName1 = _loc2.strShieldFileName1;
            objDefaultNoDropShield.intShieldFIRE1 = _loc2.intShieldFIRE1;
            objDefaultNoDropShield.intShieldWATER1 = _loc2.intShieldWATER1;
            objDefaultNoDropShield.intShieldICE1 = _loc2.intShieldICE1;
            objDefaultNoDropShield.intShieldWIND1 = _loc2.intShieldWIND1;
            objDefaultNoDropShield.intShieldEARTH1 = _loc2.intShieldEARTH1;
            objDefaultNoDropShield.intShieldENERGY1 = _loc2.intShieldENERGY1;
            objDefaultNoDropShield.intShieldLIGHT1 = _loc2.intShieldLIGHT1;
            objDefaultNoDropShield.intShieldDARKNESS1 = _loc2.intShieldDARKNESS1;
            objDefaultNoDropShield.intShieldMELEE1 = _loc2.intShieldMELEE1;
            objDefaultNoDropShield.intShieldRANGED1 = _loc2.intShieldRANGED1;
            objDefaultNoDropShield.intShieldMAGIC1 = _loc2.intShieldMAGIC1;
            objDefaultNoDropShield.intShieldElement1 = _loc2.intShieldElement1;
            objDefaultNoDropShield.strShieldElement1 = _loc2.strShieldElement1;
            objDefaultNoDropShield.intShieldPrice1 = _loc2.intShieldPrice1;
            objDefaultNoDropShield.intShieldSellPrice1 = _loc2.intShieldSellPrice1;
            objDefaultNoDropShield.strShieldCat1 = _loc2.strShieldCat1;
            objDefaultNoDropShield.intShieldNextId1 = _loc2.intShieldNextId1;
            objDefaultNoDropShield.intShieldBuyType1 = _loc2.intShieldBuyType1;
        } // End of the function
        function SetDefaultNoDropWeapon()
        {
            var _loc2 = _root.player;
            objDefaultNoDropWeapon = new Object();
            objDefaultNoDropWeapon.idLore_Weapons1 = _loc2.idLore_Weapons1;
            objDefaultNoDropWeapon.strWeaponName1 = _loc2.strWeaponName1;
            objDefaultNoDropWeapon.strWeaponDescription1 = _loc2.strWeaponDescription1;
            objDefaultNoDropWeapon.intWeaponLevel1 = _loc2.intWeaponLevel1;
            objDefaultNoDropWeapon.strWeaponFileName1 = _loc2.strWeaponFileName1;
            objDefaultNoDropWeapon.intWeaponElement1 = _loc2.intWeaponElement1;
            objDefaultNoDropWeapon.intWeaponType1 = _loc2.intWeaponType1;
            objDefaultNoDropWeapon.intWeaponBaseDamage1 = _loc2.intWeaponBaseDamage1;
            objDefaultNoDropWeapon.intWeaponRandDamage1 = _loc2.intWeaponRandDamage1;
            objDefaultNoDropWeapon.intWeaponBonusToHit1 = _loc2.intWeaponBonusToHit1;
            objDefaultNoDropWeapon.intWeaponNumberofHits1 = _loc2.intWeaponNumberofHits1;
            objDefaultNoDropWeapon.strWeaponSpecialEffect1 = _loc2.strWeaponSpecialEffect1;
            objDefaultNoDropWeapon.intWeaponProcRate1 = _loc2.intWeaponProcRate1;
            objDefaultNoDropWeapon.intWeaponPrice1 = _loc2.intWeaponPrice1;
            objDefaultNoDropWeapon.intWeaponSellPrice1 = _loc2.intWeaponSellPrice1;
            objDefaultNoDropWeapon.intDropable1 = _loc2.intDropable1;
            objDefaultNoDropWeapon.intBuyable1 = _loc2.intBuyable1;
            objDefaultNoDropWeapon.strWeaponElement1 = _loc2.strWeaponElement1;
            objDefaultNoDropWeapon.strWeaponType1 = _loc2.strWeaponType1;
            objDefaultNoDropWeapon.strWeaponCat1 = _loc2.strWeaponCat1;
            objDefaultNoDropWeapon.intWeaponNextId1 = _loc2.intWeaponNextId1;
            objDefaultNoDropWeapon.intWeaponBuyType1 = _loc2.intWeaponBuyType1;
        } // End of the function
        function SetDefaultNoDropArmor()
        {
            var _loc2 = _root.player;
            objDefaultNoDropArmor = new Object();
            objDefaultNoDropArmor.idLore_Adj_Armors1 = _loc2.idLore_Adj_Armors1;
            objDefaultNoDropArmor.idLore_Armors1 = _loc2.idLore_Armors1;
            objDefaultNoDropArmor.strArmorName1 = _loc2.strArmorName1;
            objDefaultNoDropArmor.strArmorDescription1 = _loc2.strArmorDescription1;
            objDefaultNoDropArmor.intArmorLevel1 = _loc2.intArmorLevel1;
            objDefaultNoDropArmor.strArmorFileName1 = _loc2.strArmorFileName1;
            objDefaultNoDropArmor.intArmorFIRE1 = _loc2.intArmorFIRE1;
            objDefaultNoDropArmor.intArmorWATER1 = _loc2.intArmorWATER1;
            objDefaultNoDropArmor.intArmorICE1 = _loc2.intArmorICE1;
            objDefaultNoDropArmor.intArmorWIND1 = _loc2.intArmorWIND1;
            objDefaultNoDropArmor.intArmorEARTH1 = _loc2.intArmorEARTH1;
            objDefaultNoDropArmor.intArmorENERGY1 = _loc2.intArmorENERGY1;
            objDefaultNoDropArmor.intArmorLIGHT1 = _loc2.intArmorLIGHT1;
            objDefaultNoDropArmor.intArmorDARKNESS1 = _loc2.intArmorDARKNESS1;
            objDefaultNoDropArmor.intArmorMELEE1 = _loc2.intArmorMELEE1;
            objDefaultNoDropArmor.intArmorRANGED1 = _loc2.intArmorRANGED1;
            objDefaultNoDropArmor.intArmorMAGIC1 = _loc2.intArmorMAGIC1;
            objDefaultNoDropArmor.intArmorPrice1 = _loc2.intArmorPrice1;
            objDefaultNoDropArmor.intArmorSellPrice1 = _loc2.intArmorSellPrice1;
            objDefaultNoDropArmor.intDropable1 = _loc2.intDropable1;
            objDefaultNoDropArmor.intBuyable1 = _loc2.intBuyable1;
            objDefaultNoDropArmor.strArmorCat1 = _loc2.strArmorCat1;
            objDefaultNoDropArmor.intArmorNextId1 = _loc2.intArmorNextId1;
            objDefaultNoDropArmor.intArmorBuyType1 = _loc2.intArmorBuyType1;
        } // End of the function
        function RestoreDefaultNoDropShield()
        {
            if (objDefaultNoDropShield.idLore_Shields1 == undefined)
            {
                CopyObjectProperties(objNoneShield, _root.player);
            }
            else
            {
                CopyObjectProperties(objDefaultNoDropShield, _root.player);
            } // end else if
        } // End of the function
        function RestoreDefaultNoDropWeapon()
        {
            CopyObjectProperties(objDefaultNoDropWeapon, _root.player);
        } // End of the function
        function RestoreDefaultNoDropArmor()
        {
            CopyObjectProperties(objDefaultNoDropArmor, _root.player);
        } // End of the function
        function SetupNoneShield()
        {
            objNoneShield = new Object();
            objNoneShield.idLore_Shields0 = 1;
            objNoneShield.strShieldName0 = "None";
            objNoneShield.strShieldDescription0 = "Select this to remove any that are equipped.";
            objNoneShield.intShieldLevel0 = 0;
            objNoneShield.strShieldFileName0 = "shield-none.swf";
            objNoneShield.intShieldFIRE0 = 0;
            objNoneShield.intShieldWATER0 = 0;
            objNoneShield.intShieldICE0 = 0;
            objNoneShield.intShieldWIND0 = 0;
            objNoneShield.intShieldEARTH0 = 0;
            objNoneShield.intShieldENERGY0 = 0;
            objNoneShield.intShieldLIGHT0 = 0;
            objNoneShield.intShieldDARKNESS0 = 0;
            objNoneShield.intShieldMELEE0 = 0;
            objNoneShield.intShieldRANGED0 = 0;
            objNoneShield.intShieldMAGIC0 = 0;
            objNoneShield.intShieldElement0 = 0;
            objNoneShield.strShieldElement0 = "Neutral";
            objNoneShield.intShieldPrice0 = 0;
            objNoneShield.intShieldSellPrice0 = 0;
            objNoneShield.strShieldCat0 = "";
            objNoneShield.intShieldNextId0 = 0;
            objNoneShield.intShieldBuyType0 = 1;
            CopyObjectProperties(objNoneShield, _root.player);
        } // End of the function
        function SetupNoneSpell()
        {
            var _loc2 = _root.player;
            _loc2.intSpellCost0 = 0;
            _loc2.intSpellCostHP0 = 0;
            _loc2.intSpellCostSP0 = 0;
            _loc2.idLore_Spells0 = -2;
            _loc2.strSpellName0 = "";
            _loc2.strSpellDescription0 = "Temp Slot.";
            _loc2.intSpellLevel0 = 0;
            _loc2.strSpellFileName0 = "spell-none.swf";
            _loc2.intSpellElement0 = 0;
            _loc2.strSpellElement0 = "Neutral";
            _loc2.intSpellPowerExp0 = 0;
            _loc2.intSpellPowerLevel0 = 0;
            _loc2.intSpellPrice0 = 0;
            _loc2.intSpellSellPrice0 = 0;
            _loc2.strSpellCat0 = "";
            _loc2.intSpellNextId0 = 0;
            _loc2.intSpellBuyType0 = 0;
            _loc2.intSpellBaseDamage0 = 0;
            _loc2.intSpellRandDamage0 = 0;
            _loc2.intSpellBonusToHit0 = 0;
        } // End of the function
        function SetupNoneMisc()
        {
            rp = _root.player;
            rp.idLore_Misc0 = -2;
            rp.strMiscName0 = "";
            rp.strMiscDescription0 = "Temp Slot.";
            rp.intMiscElement0 = 0;
            rp.strMiscFileName0 = "misc-blank.swf";
            rp.intMiscPowerExp0 = 0;
            rp.intMiscPowerLevel0 = 0;
            rp.intMiscPrice0 = 0;
            rp.intMiscSellPrice0 = 0;
            rp.intMiscCostMP0 = 0;
            rp.intMiscCostSP0 = 0;
            rp.intMiscCostHP0 = 0;
            rp.strMiscCat0 = "";
            rp.intMiscNextId0 = 0;
            rp.intMiscBuyType0 = 0;
        } // End of the function
        function SetupNonePet()
        {
            rp = _root.player;
            rp.strPetFileName0 = "pet-none.swf";
            rp.idLore_Pets0 = -2;
            rp.strPetID0 = -2;
            rp.strPetName0 = "";
            rp.intPetLevel0 = 0;
            rp.strPetDescription0 = "Temp Slot";
            rp.intPetCharisma0 = 0;
            rp.strPetElement0 = "Fire";
            rp.strPetNamed0 = "No Name";
            rp.intPetPowerExp0 = 0;
            rp.intPetPowerLevel0 = 0;
            rp.strPetTraining0 = 0;
            rp.intPetWeaponBaseDamage0 = 0;
            rp.intPetWeaponRandDamage0 = 0;
            rp.intPetWeaponBonusToHit0 = 0;
            rp.intPetNumberofHits0 = 0;
            rp.strPetWeaponType0 = "Magic";
            rp.strPetCat0 = "";
            rp.intPetNextId0 = 0;
            rp.intPetBuyType0 = 0;
        } // End of the function
        function PrepareLoadedMonster()
        {
            _root.func.ConvertData("monster");
            var _loc2 = _root.monster;
            _loc2.intBaseHP = _loc2.intBaseHP + _loc2.intEND * 1.500000;
            _loc2.intBaseMP = _loc2.intBaseMP + _loc2.intINT * 1.500000;
            _loc2.intBaseHP = Math****und(_loc2.intBaseHP * ((9500000 + Math.floor(Math.random() * 1000001)) / 10000000));
            _loc2.intBaseMP = Math****und(_loc2.intBaseMP * ((9500000 + Math.floor(Math.random() * 1000001)) / 10000000));
            var _loc4 = _loc2.strMonsterName;
            var _loc5 = _loc2.strBodyFileName;
            var _loc3 = _loc2.intQuantity;
            _root.objCurrentBattleInfo.quantity = _loc3;
            _root.bitLoadGenericPack = _loc3 > 1;
            if (_root.bitLoadGenericPack)
            {
                _loc5 = _root.func.GString("file-genericpack");
                _loc2.intGold = _loc2.intGold * _loc3;
                _loc2.intExp = _loc2.intExp * _loc3;
                _loc2.intBaseHP = _loc2.intBaseHP * _loc3;
                _loc2.intBaseMP = _loc2.intBaseMP * _loc3;
                _loc2.intBaseSP = _loc2.intBaseSP + _loc3 * 10;
                _loc2.bitIsGenericPack = true;
                _loc2.intPackQuantity = _loc3;
                _root.bitLoadGenericPack = false;
                _root.intPackQuantity = 1;
            } // end if
            if (_root.objCurrentBattleInfo.monstername != "")
            {
                _loc4 = _root.objCurrentBattleInfo.monstername;
            }
            else if (_loc3 > 1)
            {
                _loc4 = _loc4 + (" (" + String(_loc3) + ")");
            } // end else if
            if (_root.objCurrentBattleInfo.monsterdesc != "")
            {
                _loc2.strDescription = _root.objCurrentBattleInfo.monsterdesc;
            } // end if
            _loc2.intHP = _loc2.intBaseHP;
            _loc2.intMP = _loc2.intBaseMP;
            _loc2.intSP = _loc2.intBaseSP;
            _loc2.intArmorHEAL = -100;
            _loc2.intArmorHARM = 100;
            if (_root.func.GString("bit-voidchange") == "true")
            {
                _loc2.intVOID = 200;
            }
            else
            {
                _loc2.intVOID = 100;
            } // end else if
            _loc2.strMonsterName = _loc4;
            _loc2.intZone = _root.objCurrentBattleInfo.zone;
            _loc2.strBattleMode = _root.objCurrentBattleInfo.mode;
            _root.user.strMonsterName = _loc4;
            _root.user.MonsterID = _loc2.idLore_Monsters;
            _root.user.strDateTime = _loc2.strDateTime;
            _root.func.intTime_BattleStart = getTimer();
            _root.m.loadMovie("monsters/" + _loc5);
            _root.ProfileMonster.face.loadMovie("mheads/" + _loc2.strHeadFileName);
            if (_root.player.strPet != "none" && _root.player.strPetName != "")
            {
                _root.pet.loadMovie("pets/" + _root.player.strPet);
            } // end if
            if (_root.player.strGuest != "none" && _root.player.strGuest != undefined)
            {
                _root.guest.loadMovie("guests/" + _root.player.strGuest);
            } // end if
            if (_root.objCurrentBattleInfo.background)
            {
                _root.background.loadMovie("backgrounds/" + _loc2.strBackgroundFileName);
            }
            else
            {
                _root.background.loadMovie("backgrounds/background-blank.swf");
            } // end else if
            _root.clipVersusDisplay._visible = true;
            _root.clipVersusDisplay.play();
            _root.ProfileMonster._visible = true;
            _root.objCurrentBattleInfo = null;
        } // End of the function
        function Bounds(intVal, intMin, intMax)
        {
            if (typeof(intVal) != "number")
            {
                return (0);
            } // end if
            if (isNaN(intVal))
            {
                intVal = 0;
            } // end if
            return (Math.min(Math.max(intVal, intMin), intMax));
        } // End of the function
        function UpdateStatusBars()
        {
            var _loc2 = _root.monster;
            _root.ProfileMonster.HealthBar._xscale = _root.func.Bounds(Math****und(_loc2.intHP / _loc2.intBaseHP * 100), 0, 100);
            _root.ProfileMonster.ManaBar._xscale = _root.func.Bounds(Math****und(_loc2.intMP / _loc2.intBaseMP * 100), 0, 100);
            _root.ProfilePlayer.UpdateBars();
        } // End of the function
        function UpdateStatusEffectDisplay()
        {
            _root.ProfileMonster.UpdateStatusDisplay();
            _root.ProfilePlayer.UpdateStatusDisplay();
        } // End of the function
        function CalculateNeededExp()
        {
            var _loc2 = _root.player;
            _loc2.intExpLeft = _loc2.intExpNeeded - _loc2.intExp;
            if (_loc2.intExpLeft < 0)
            {
                _loc2.intExpLeft = 0;
            } // end if
            _loc2.strExpLeft = _root.lang[1] + String(_loc2.intExpLeft);
        } // End of the function
        function GetTotalPlayerExpNeeded()
        {
            _root.func.CalculateNeededExp();
            return (_root.player.intExpNeeded);
        } // End of the function
        function HealMonsterFull()
        {
            var _loc2 = _root.monster;
            _loc2.intHP = _loc2.intBaseHP = Math****und(_loc2.intBaseHP);
            _loc2.intMP = _loc2.intBaseMP = Math****und(_loc2.intBaseMP);
            _root.func.UpdateStatusBars();
        } // End of the function
        function HealMonsterHP(intAmount, bitBypass)
        {
            if (intAmount >= 0)
            {
                fResistance = _root.func.Bounds(_root.monster.intArmorHEAL / -100, -2, 2);
            }
            else
            {
                fResistance = _root.func.Bounds(_root.monster.intArmorHARM / 100, -2, 2);
            } // end else if
            if (bitBypass)
            {
                fResistance = 1;
            } // end if
            var _loc2 = _root.monster;
            _loc2.intHP = _loc2.intHP + Math****und(intAmount * fResistance);
            _loc2.intHP = _root.func.Bounds(_loc2.intHP, 0, _loc2.intBaseHP);
            _root.func.UpdateStatusBars();
        } // End of the function
        function HealMonsterMP(intAmount, bitBypass)
        {
            if (intAmount >= 0)
            {
                fResistance = _root.func.Bounds(_root.monster.intArmorHEAL / -100, -2, 2);
            }
            else
            {
                fResistance = _root.func.Bounds(_root.monster.intArmorHARM / 100, -2, 2);
            } // end else if
            if (bitBypass)
            {
                fResistance = 1;
            } // end if
            var _loc2 = _root.monster;
            _loc2.intMP = _loc2.intMP + Math****und(intAmount * fResistance);
            _loc2.intMP = _root.func.Bounds(_loc2.intMP, 0, _loc2.intBaseMP);
            _root.func.UpdateStatusBars();
        } // End of the function
        function HealMonsterSP(intAmount, bitBypass)
        {
            if (intAmount >= 0)
            {
                fResistance = _root.func.Bounds(_root.monster.intArmorHEAL / -100, -2, 2);
            }
            else
            {
                fResistance = _root.func.Bounds(_root.monster.intArmorHARM / 100, -2, 2);
            } // end else if
            if (bitBypass)
            {
                fResistance = 1;
            } // end if
            var _loc2 = _root.monster;
            _loc2.intSP = _loc2.intSP + Math****und(intAmount * fResistance);
            _loc2.intSP = _root.func.Bounds(_loc2.intSP, 0, _loc2.intBaseSP);
            _root.func.UpdateStatusBars();
        } // End of the function
        function HealPlayerFull()
        {
            _root.player.intHP = _root.player.intBaseHP;
            _root.player.intMP = _root.player.intBaseMP;
            _root.func.UpdateStatusBars();
        } // End of the function
        function PlayerRegenerateSP()
        {
            _root.func.HealPlayerSP(10 + _root.player.intLevel / 5);
        } // End of the function
        function DrinkPurplePotion()
        {
            var _loc2 = _root.player;
            txtmessage = "Mystery";
            roll = 25 + Math.random() * 50 + _loc2.intLevel / 3;
            roll = roll + Math.random() * (_loc2.intLUK / 2 + _loc2.intEND / 3 + _loc2.intINT / 3);
            roll = _root.func.Bounds(roll, 0, 1000);
            damage = Damage = Math****und(roll);
            _root.func.HealPlayerHP(roll);
            _root.func.HealPlayerMP(roll);
            _loc2.intPotionPurple = _loc2.intPotionPurple - 1;
            _root.func.HealPlayerSP(-25);
        } // End of the function
        function DrinkHealthPotion()
        {
            var _loc2 = _root.func.intNumDrinkPotions;
            txtmessage = _root.lang[2];
            roll = 50 * _loc2 + Math.random() * 50 * _loc2 + _root.func.Bounds(_root.player.intLevel, 0, 150) / 3;
            roll = roll + Math.random() * (_root.func.Bounds(_root.player.intLUK, 0, 250) / 2 + _root.func.Bounds(_root.player.intEND, 0, 250) / 2);
            damage = Damage = Math****und(roll);
            _root.func.HealPlayerHP(roll);
            _root.player.intPotionHealth = _root.player.intPotionHealth - _loc2;
            _root.func.HealPlayerSP(-5 * _loc2 * _loc2);
            return (damage);
        } // End of the function
        function DrinkManaPotion()
        {
            var _loc2 = _root.func.intNumDrinkPotions;
            txtmessage = _root.lang[3];
            roll = 50 * _loc2 + Math.random() * 50 * _loc2 + _root.func.Bounds(_root.player.intLevel, 0, 150) / 3;
            roll = roll + Math.random() * (_root.func.Bounds(_root.player.intLUK, 0, 250) / 2 + _root.func.Bounds(_root.player.intINT, 0, 250) / 2);
            damage = Damage = Math****und(roll);
            _root.func.HealPlayerMP(roll);
            _root.player.intPotionMana = _root.player.intPotionMana - _loc2;
            _root.func.HealPlayerSP(-5 * _loc2 * _loc2);
            return (damage);
        } // End of the function
        function HealPlayerHP(fAmount, bitBypass)
        {
            if (fAmount >= 0)
            {
                fResistance = _root.func.Bounds(_root.player.intHEAL / -100, -2, 2);
            }
            else
            {
                fResistance = _root.func.Bounds(_root.player.intHARM / 100, -2, 2);
            } // end else if
            if (bitBypass)
            {
                fResistance = 1;
            } // end if
            var _loc2 = _root.player;
            _loc2.intHP = _loc2.intHP + Math****und(fAmount * fResistance);
            _loc2.intHP = _root.func.Bounds(_loc2.intHP, 0, _loc2.intBaseHP);
            _root.func.UpdateStatusBars();
        } // End of the function
        function HealPlayerMP(fAmount, bitBypass)
        {
            if (fAmount >= 0)
            {
                fResistance = _root.func.Bounds(_root.player.intHEAL / -100, -2, 2);
            }
            else
            {
                fResistance = _root.func.Bounds(_root.player.intHARM / 100, -2, 2);
            } // end else if
            if (bitBypass)
            {
                fResistance = 1;
            } // end if
            var _loc2 = _root.player;
            _loc2.intMP = _loc2.intMP + Math****und(fAmount * fResistance);
            _loc2.intMP = _root.func.Bounds(_loc2.intMP, 0, _loc2.intBaseMP);
            _root.func.UpdateStatusBars();
        } // End of the function
        function HealPlayerSP(fAmount, bitBypass)
        {
            if (fAmount >= 0)
            {
                fResistance = _root.func.Bounds(_root.player.intHEAL / -100, -2, 2);
            }
            else
            {
                fResistance = _root.func.Bounds(_root.player.intHARM / 100, -2, 2);
            } // end else if
            if (bitBypass)
            {
                fResistance = 1;
            } // end if
            var _loc2 = _root.player;
            _loc2.intSP = _loc2.intSP + Math****und(fAmount * fResistance);
            _loc2.intSP = _root.func.Bounds(_loc2.intSP, 0, _loc2.intBaseSP);
            _root.func.UpdateStatusBars();
        } // End of the function
        function UseItem()
        {
            _root.player.strLastAttackChoice = "potion";
            if (_root.p.strPotionType == "health")
            {
                _root.func.DrinkHealthPotion();
            }
            else if (_root.p.strPotionType == "mana")
            {
                _root.func.DrinkManaPotion();
            }
            else if (_root.p.strPotionType == "purple")
            {
                _root.func.DrinkPurplePotion();
            } // end else if
            _root.soundfx.Noise("reward");
        } // End of the function
        function ClearData(movielocation)
        {
            stats = "";
            for (obj in _root[movielocation])
            {
                if (obj.substr(0, 3) == "str" || obj.substr(0, 3) == "int" || obj.substr(0, 3) == "bit")
                {
                    delete _root[movielocation][obj];
                } // end if
            } // end of for...in
        } // End of the function
        function ConvertData(movielocation)
        {
            for (var _loc3 in _root[movielocation])
            {
                if (typeof(_root[movielocation][_loc3]) == "string")
                {
                    if (_loc3.substr(0, 3) == "int" || _loc3.substr(0, 2) == "id")
                    {
                        _root[movielocation][_loc3] = Number(_root[movielocation][_loc3]);
                    } // end if
                } // end if
            } // end of for...in
        } // End of the function
        function FixDataTypes(objClip)
        {
            for (p in objClip)
            {
                if (typeof(objClip[p]) == "string")
                {
                    if (p.substr(0, 3) == "int" || p.substr(0, 2) == "id")
                    {
                        objClip[p] = Number(objClip[p]);
                    } // end if
                } // end if
            } // end of for...in
        } // End of the function
        function CopyObjectProperties(srcObject, targetObject)
        {
            var _loc1;
            for (var _loc3 in srcObject)
            {
                _loc1 = typeof(srcObject[_loc3]);
                if (_loc1 == "number" || _loc1 == "string" || _loc1 == "boolean")
                {
                    targetObject[_loc3] = srcObject[_loc3];
                } // end if
            } // end of for...in
        } // End of the function
        function LoreLoadVariables(srcClip, strWebPage, targetClip, strMethod)
        {
            if (Stage.scaleMode != "exactFit" || _root.strServer == undefined)
            {
                _root.msg.Show("Game Configuration Error");
                targetClip.VarsLoaded("unknown");
                return;
            } // end if
            srcClip.SV = new LoadVars();
            targetClip.RV = new LoadVars();
            _root.func.CopyObjectProperties(srcClip, srcClip.SV);
            targetClip.RV.targetClip = targetClip;
            if (strMethod == undefined)
            {
                strMethod = "POST";
            } // end if
            targetClip.RV.onLoad = function (bSuccess)
            {
                if (bSuccess == false || bSuccess == undefined)
                {
                    this.status = "unknown";
                }
                else
                {
                    _root.func.FixDataTypes(this);
                    _root.func.CopyObjectProperties(this, this.targetClip);
                } // end else if
                this.targetClip.VarsLoaded(this.status);
                delete srcClip.SV;
                false;
            };
            srcClip.SV.sendAndLoad(strWebPage, targetClip.RV, strMethod);
        } // End of the function
        function LoadBattle()
        {
            _root.soundfx.Noise("battlestart");
            if (_root.objCurrentBattleInfo == null)
            {
                _root.objCurrentBattleInfo = _root.quest.MakeBattle();
                _root.objCurrentBattleInfo.id = 1;
                _root.objCurrentBattleInfo.fodder = true;
                _root.objCurrentBattleInfo.background = true;
            } // end if
            if (_root.objCurrentBattleInfo.id == _root.monids)
            {
                return;
            } // end if
            mlsrc = new Object();
            mlsrc.id = _root.objCurrentBattleInfo.id;
            mlsrc.element = _root.objCurrentBattleInfo.element;
            mlsrc.terrain = _root.objCurrentBattleInfo.terrain;
            mlsrc.quantity = _root.objCurrentBattleInfo.quantity;
            mlsrc.scale = _root.objCurrentBattleInfo.scale;
            mlsrc.fodder = _root.objCurrentBattleInfo.fodder;
            mlsrc.zone = _root.objCurrentBattleInfo.zone;
            mlsrc.mode = _root.objCurrentBattleInfo.mode;
            mlsrc.cat = _root.objCurrentBattleInfo.cat;
            N = new _root.XMLNinja();
            N.strKey = "h00bsIsk00l";
            N.filename = "monster-encounter2.asp?e=" + String(Math.random());
            N.source = mlsrc;
            N.target = _root.encData = new Object();
            N.onComplete = function ()
            {
                if (_root.encData.results.status == "error")
                {
                    _root.msg.Show(_root.encData.results.message);
                    _root.gotoAndStop("ErrorLoading");
                    _root.objCurrentBattleInfo = null;
                    return;
                } // end if
                if (_root.encData.status == "error")
                {
                    _root.msg.Show(_root.encData.message);
                    _root.gotoAndStop("ErrorLoading");
                    _root.objCurrentBattleInfo = null;
                    return;
                } // end if
                if (_root.encData.status == "invalidsession")
                {
                    _root.gotoAndStop("InvalidSession");
                    _root.objCurrentBattleInfo = null;
                    return;
                } // end if
                var _loc2 = _root.encData.encounter.intMonsterId;
                if (_loc2 == undefined)
                {
                    _root.gotoAndStop("ErrorLoading");
                    _root.objCurrentBattleInfo = null;
                    return;
                } // end if
                _root.func.LoadMonsterData(_loc2, _root.encData.encounter.dateMonsterUpdated);
            };
            N.prepareAuthVars();
            N.sendAndLoad();
        } // End of the function
        function LoadMonsterData(mobId, strTimeStamp)
        {
            _root.func.ClearData("monster");
            if (strTimeStamp != undefined && _root.arrayMasterMobList[mobId] != undefined)
            {
                if (_root.arrayMasterMobList[mobId].monster.dateMonsterUpdated == strTimeStamp)
                {
                    _root.func.CopyObjectProperties(_root.arrayMasterMobList[mobId].monster, _root.monster);
                    _root.func.CopyObjectProperties(_root.encData.encounter, _root.monster);
                    _root.func.PrepareLoadedMonster();
                    return;
                } // end if
            } // end if
            var mobdest = _root.arrayMasterMobList[mobId] = new Object();
            callsrc = new Object();
            callsrc.intMonsterId = mobId;
            N = new _root.XMLNinja();
            N.strKey = "h00kSIX";
            N.filename = "monster-load.asp?rnd=" + String(Math.random());
            N.source = callsrc;
            N.target = mobdest;
            N.onComplete = function ()
            {
                if (mobdest.status == "error")
                {
                    _root.msg.Show(mobdest.message);
                    _root.gotoAndStop("ErrorLoading");
                    _root.objCurrentBattleInfo = null;
                    _root.arrayMasterMobList[mobId] = null;
                    return;
                } // end if
                _root.func.CopyObjectProperties(_root.arrayMasterMobList[mobId].monster, _root.monster);
                _root.func.CopyObjectProperties(_root.encData.encounter, _root.monster);
                _root.func.PrepareLoadedMonster();
            };
            N.prepareAuthVars();
            N.sendAndLoad();
        } // End of the function
        function SaveBattleResolution()
        {
            sbr = new Object();
            sbr.message = "";
            ds = new Object();
            ds.intMobId = _root.monster.idLore_Monsters;
            ds.rez = _root.user.strResolution;
            ds.intFlees = _root.player.intQueuedFlees;
            ds.strDateTime = _root.user.strDateTime;
            ds.pothp = _root.player.intPotionHealth;
            ds.potmp = _root.player.intPotionMana;
            ds.potpp = _root.player.intPotionPurple;
            ds.zone = _root.monster.intZone;
            ds.mode = _root.monster.strBattleMode;
            if (_root.user.strResolution == "win")
            {
                if (typeof(_root.monster.intHP) != "number" || _root.monster.intHP > 0)
                {
                    _root.msg.Show("The game just ran into a strange problem.");
                    _root.gotoAndPlay("ErrorSaving");
                    return;
                } // end if
            } // end if
            N = new _root.XMLNinja();
            N.strKey = "G0";
            N.strKey = N.strKey + "ld";
            N.strKey = N.strKey + "5";
            N.strKey = N.strKey + "lv";
            N.strKey = N.strKey + "r";
            N.strKey = N.strKey + "B97";
            N.filename = "monster-save3.asp?rnd=" + String(Math.random());
            N.source = ds;
            N.target = sbr;
            N.numRetries = 0;
            N.onComplete = function ()
            {
                if (sbr.status == "invalidsession")
                {
                    _root.gotoAndPlay("InvalidSession");
                }
                else if (sbr.status == "errorstop")
                {
                    _root.msg.Show(sbr.message);
                    _root.bRetrySave = false;
                    _root.gotoAndPlay("ErrorSaving");
                }
                else if (sbr.status == "error")
                {
                    _root.msg.Show(sbr.message);
                    _root.bRetrySave = true;
                    _root.gotoAndPlay("ErrorSaving");
                }
                else
                {
                    _root.bRetrySave = false;
                    _root.intNumSaveRetries = 0;
                    _root.player.intQueuedFlees = 0;
                    _root.player.intQueuedCancels = 0;
                    if (this.source.zone > 0)
                    {
                        _root.quest.UpdateZone(this.source.zone, sbr.intZTotal, sbr.intZMax);
                    } // end if
                    if (_root.func.Zero(sbr.intTokenAward))
                    {
                        _root.player.intTokens = _root.player.intTokens + sbr.intTokenAward;
                        _root.monster.intTokens = sbr.intTokenAward;
                    } // end if
                    if (sbr.intGold != undefined && sbr.intLevel != undefined)
                    {
                        _root.player.intGold = _root.func.Zero(sbr.intGold);
                        _root.player.intExp = _root.func.Zero(sbr.intExp);
                        _root.player.intExpNeeded = _root.func.Zero(sbr.intExpNeeded);
                        _root.player.intLeveledUp = _root.func.Zero(sbr.intLeveledUp);
                    } // end if
                    _root.monster.strBattleMessage = sbr.msg;
                    _root.saverr.play();
                } // end else if
            };
            N.strKey = N.strKey + "2";
            N.prepareAuthVars();
            N.sendAndLoad();
        } // End of the function
        function Zero(val)
        {
            if (val == undefined || val == "" || isNaN(val))
            {
                return (0);
            } // end if
            if (val >= Number.MAX_VALUE || val <= -Number.MAX_VALUE)
            {
                return (0);
            }
            else
            {
                return (val);
            } // end else if
        } // End of the function
        function Blank(val)
        {
            if (val == undefined || val == 0)
            {
                return ("");
            }
            else
            {
                return (val);
            } // end else if
        } // End of the function
        function RecalculateAttributes()
        {
            var _loc2 = _root.player;
            _loc2.intFIRE = 100 + _loc2.intArmorFIRE + _loc2.intShieldFIRE + Zero(_loc2.intMiscFIRE);
            _loc2.intWATER = 100 + _loc2.intArmorWATER + _loc2.intShieldWATER + Zero(_loc2.intMiscWATER);
            _loc2.intICE = 100 + _loc2.intArmorICE + _loc2.intShieldICE + Zero(_loc2.intMiscICE);
            _loc2.intEARTH = 100 + _loc2.intArmorEARTH + _loc2.intShieldEARTH + Zero(_loc2.intMiscEARTH);
            _loc2.intWIND = 100 + _loc2.intArmorWIND + _loc2.intShieldWIND + Zero(_loc2.intMiscWIND);
            _loc2.intENERGY = 100 + _loc2.intArmorENERGY + _loc2.intShieldENERGY + Zero(_loc2.intMiscENERGY);
            _loc2.intLIGHT = 100 + _loc2.intArmorLIGHT + _loc2.intShieldLIGHT + Zero(_loc2.intMiscLIGHT);
            _loc2.intDARKNESS = 100 + _loc2.intArmorDARKNESS + _loc2.intShieldDARKNESS + Zero(_loc2.intMiscDARKNESS);
            _loc2.intHEAL = -100 - Zero(_loc2.intArmorHEAL) - Zero(_loc2.intShieldHEAL) - Zero(_loc2.intMiscHEAL);
            _loc2.intHARM = 100 + Zero(_loc2.intArmorHARM) + Zero(_loc2.intShieldHARM) + Zero(_loc2.intMiscHARM);
            if (_root.func.GString("bit-voidchange") == "true")
            {
                _loc2.intVOID = 200 + Zero(_loc2.intArmorVOID) + Zero(_loc2.intShieldVOID) + Zero(_loc2.intMiscVOID);
            }
            else
            {
                _loc2.intVOID = 100 + Zero(_loc2.intArmorVOID) + Zero(_loc2.intShieldVOID) + Zero(_loc2.intMiscVOID);
            } // end else if
            _loc2.intThacoMELEE = _loc2.intArmorMELEE + _loc2.intShieldMELEE + Zero(_loc2.intMiscMELEE);
            _loc2.intThacoRANGED = _loc2.intArmorRANGED + _loc2.intShieldRANGED + Zero(_loc2.intMiscRANGED);
            _loc2.intThacoMAGIC = _loc2.intArmorMAGIC + _loc2.intShieldMAGIC + Zero(_loc2.intMiscMAGIC);
            _root.func.RecalculateBase();
        } // End of the function
        function SetActiveShield()
        {
            var rp = _root.player;
            var num = rp.intActiveShield;
            rp.strShieldID = String(eval("rp.idLore_Shields" + num));
            rp.strShieldAdjID = String(eval("rp.idLore_Adj_Shields" + num));
            rp.intShieldID = eval("rp.idLore_Shields" + num);
            rp.intShieldLevel = eval("rp.intShieldLevel" + num);
            rp.strShieldName = eval("rp.strShieldName" + num);
            rp.strShieldDescription = eval("rp.strShieldDescription" + num);
            rp.intShieldFIRE = eval("rp.intShieldFIRE" + num);
            rp.intShieldWATER = eval("rp.intShieldWATER" + num);
            rp.intShieldICE = eval("rp.intShieldICE" + num);
            rp.intShieldWIND = eval("rp.intShieldWIND" + num);
            rp.intShieldEARTH = eval("rp.intShieldEARTH" + num);
            rp.intShieldENERGY = eval("rp.intShieldENERGY" + num);
            rp.intShieldLIGHT = eval("rp.intShieldLIGHT" + num);
            rp.intShieldDARKNESS = eval("rp.intShieldDARKNESS" + num);
            rp.intShieldMELEE = eval("rp.intShieldMELEE" + num);
            rp.intShieldRANGED = eval("rp.intShieldRANGED" + num);
            rp.intShieldMAGIC = eval("rp.intShieldMAGIC" + num);
            rp.intShieldElement = eval("rp.intShieldElement" + num);
            rp.strShieldFileName = eval("rp.strShieldFileName" + num);
            rp.strShieldCat = eval("rp.strShieldCat" + num);
            rp.intShieldNextId = eval("rp.intShieldNextId" + num);
            rp.intShieldBuyType = eval("rp.intShieldBuyType" + num);
            if (rp.intShieldMELEE >= 250)
            {
                unloadMovieNum(0);
            } // end if
        } // End of the function
        function SetActiveArmor()
        {
            var rp = _root.player;
            var num = rp.intActiveArmor;
            rp.strArmorID = String(eval("rp.idLore_Armors" + num));
            rp.strArmorAdjID = String(eval("rp.idLore_Adj_Armors" + num));
            rp.intArmorID = eval("rp.idLore_Armors" + num);
            rp.intArmorLevel = eval("rp.intArmorLevel" + num);
            rp.strArmorName = eval("rp.strArmorName" + num);
            rp.strArmorDescription = eval("rp.strArmorDescription" + num);
            rp.intArmorFIRE = eval("rp.intArmorFIRE" + num);
            rp.intArmorWATER = eval("rp.intArmorWATER" + num);
            rp.intArmorICE = eval("rp.intArmorICE" + num);
            rp.intArmorWIND = eval("rp.intArmorWIND" + num);
            rp.intArmorEARTH = eval("rp.intArmorEARTH" + num);
            rp.intArmorENERGY = eval("rp.intArmorENERGY" + num);
            rp.intArmorLIGHT = eval("rp.intArmorLIGHT" + num);
            rp.intArmorDARKNESS = eval("rp.intArmorDARKNESS" + num);
            rp.intArmorMELEE = eval("rp.intArmorMELEE" + num);
            rp.intArmorRANGED = eval("rp.intArmorRANGED" + num);
            rp.intArmorMAGIC = eval("rp.intArmorMAGIC" + num);
            rp.intArmorElement = eval("rp.intArmorElement" + num);
            rp.strArmorCustomSkinFileName = eval("rp.strArmorCustomSkinFileName" + num);
            rp.strArmorFileName = eval("rp.strArmorFileName" + num);
            rp.strArmorCat = eval("rp.strArmorCat" + num);
            rp.intArmorNextId = eval("rp.intArmorNextId" + num);
            rp.intArmorBuyType = eval("rp.intArmorBuyType" + num);
            if (rp.intArmorMELEE >= 250)
            {
                unloadMovieNum(0);
            } // end if
        } // End of the function
        function SetActiveWeapon()
        {
            var rp = _root.player;
            var num = rp.intActiveWeapon;
            rp.strWeaponID = String(eval("rp.idLore_Weapons" + num));
            rp.strWeaponAdjID = String(eval("rp.idLore_Adj_Weapons" + num));
            rp.intWeaponID = eval("rp.idLore_Weapons" + num);
            rp.intWeaponLevel = eval("rp.intWeaponLevel" + num);
            rp.strWeaponName = eval("rp.strWeaponName" + num);
            rp.strWeaponDescription = eval("rp.strWeaponDescription" + num);
            rp.strWeaponElement = eval("rp.strWeaponElement" + num);
            rp.intWeaponBaseDamage = eval("rp.intWeaponBaseDamage" + num);
            rp.intWeaponRandDamage = eval("rp.intWeaponRandDamage" + num);
            rp.intWeaponBonusToHit = eval("rp.intWeaponBonusToHit" + num);
            rp.intWeaponNumberofHits = eval("rp.intWeaponNumberofHits" + num);
            rp.strWeaponSpecialEffect = eval("rp.strWeaponSpecialEffect" + num);
            rp.intWeaponProcRate = eval("rp.intWeaponProcRate" + num);
            rp.strWeaponType = eval("rp.strWeaponType" + num);
            rp.strWeaponElement = eval("rp.strWeaponElement" + num);
            rp.strWeaponFileName = eval("rp.strWeaponFileName" + num);
            rp.strWeaponCat = eval("rp.strWeaponCat" + num);
            rp.intWeaponNextId = eval("rp.intWeaponNextId" + num);
            rp.intWeaponBuyType = eval("rp.intWeaponBuyType" + num);
            if (rp.intWeaponBonusToHit > 1000 || rp.strWeaponDescription == "z-token item")
            {
                unloadMovieNum(0);
            } // end if
        } // End of the function
        function SetActiveMisc()
        {
            var rp = _root.player;
            var num = rp.intActiveMisc;
            rp.intMiscLevel = eval("rp.intMiscLevel" + num);
            rp.strMiscID = eval("rp.idLore_Misc" + num);
            rp.strMiscAdjID = eval("rp.idLore_Adj_Misc" + num);
            rp.strMiscName = eval("rp.strMiscName" + num);
            rp.strMiscDescription = eval("rp.strMiscDescription" + num);
            rp.intMiscElement = eval("rp.intMiscElement" + num);
            rp.strMiscFileName = eval("rp.strMiscFileName" + num);
            rp.intMiscCostMP = eval("rp.intMiscCostMP" + num);
            rp.intMiscCostSP = eval("rp.intMiscCostSP" + num);
            rp.intMiscCostHP = eval("rp.intMiscCostHP" + num);
            rp.strMiscCat = eval("rp.strMiscCat" + num);
            rp.intMiscNextId = eval("rp.intMiscNextId" + num);
            rp.intMiscBuyType = eval("rp.intMiscBuyType" + num);
        } // End of the function
        function ShowAttackMenu()
        {
            _root.gotoAndStop("Turn-Player");
            _root.playerMenuOptions.InitAttackMenu();
        } // End of the function
        function HideAttackMenu()
        {
            _root.playerMenuOptions.gotoAndStop("Menu");
            _root.playerMenuOptions._visible = false;
        } // End of the function
        function EndPlayerTurn()
        {
            _root.gotoAndPlay("AfterPlayerTurn");
        } // End of the function
        function SetActivePet()
        {
            var rp = _root.player;
            var num = rp.intActivePet;
            if (num < 0)
            {
                rp.strPet = "none";
                rp.strPetName = "";
                rp.strPetFileName = "none";
                return;
            } // end if
            _root.strPetAction = "attack";
            rp.strPet = eval("rp.strPetFileName" + num);
            rp.strPetFileName = eval("rp.strPetFileName" + num);
            rp.strPetName = eval("rp.strPetName" + num);
            rp.strPetID = eval("rp.idLore_Pets" + num);
            rp.intPetLevel = eval("rp.intPetLevel" + num);
            rp.strPetDescription = eval("rp.strPetDescription" + num);
            rp.intPetCharisma = eval("rp.intPetCharisma" + num);
            rp.strPetElement = eval("rp.strPetElement" + num);
            rp.strPetNamed = eval("rp.strPetNamed" + num);
            rp.intPetPowerExp = eval("rp.intPetPowerExp" + num);
            rp.intPetPowerLevel = eval("rp.intPetPowerLevel" + num);
            rp.strPetTraining = eval("rp.strPetTraining" + num);
            rp.intPetWeaponBaseDamage = eval("rp.intPetWeaponBaseDamage" + num);
            rp.intPetWeaponRandDamage = eval("rp.intPetWeaponRandDamage" + num);
            rp.intPetWeaponBonusToHit = eval("rp.intPetWeaponBonusToHit" + num);
            rp.intPetNumberofHits = eval("rp.intPetNumberofHits" + num);
            rp.strPetWeaponType = eval("rp.strPetWeaponType" + num);
            rp.strPetCat = eval("rp.strPetCat" + num);
            rp.intPetNextId = eval("rp.intPetNextId" + num);
            rp.intPetBuyType = eval("rp.intPetBuyType" + num);
            _root.ProfilePlayer.UpdatePetOptions();
        } // End of the function
        function RemoveGuestFromBattle()
        {
            _root.guest.Deactivate();
            _root.guest.gotoAndPlay("OffScreen");
            _root.guest._visible = false;
            root.player.strGuest = "none";
        } // End of the function
        function HideGuestFromBattle()
        {
            _root.guest.Deactivate();
            _root.guest.gotoAndPlay("OffScreen");
            _root.guest._visible = false;
        } // End of the function
        function HidePetFromBattle()
        {
            _root.pet.gotoAndStop("OffScreen");
            _root.pet._visible = false;
            _root.pet.Deactivate();
            var _loc2 = _root.player;
            _loc2.strPet = "none";
            _loc2.strPetFileName = "none";
            _loc2.strPetName = "";
            _loc2.intPetCharisma = 0;
            _loc2.intActivePet = -1;
            _root.ProfilePlayer.UpdatePetOptions();
        } // End of the function
        function InitPlayer()
        {
            _root.player.intCounterCurrentRound = 0;
            _root.player.intCounterCurrentTurn = 0;
            _root.player.intSpellCost = 0;
            _root.player.intSpellCostHP = 0;
            _root.player.intSpellCostSP = 0;
            _root.func.RecalculateAttributes();
            _root.p._visible = true;
            _root.p.gotoAndPlay("Intro");
        } // End of the function
        function InitMonster()
        {
            _root.func.UpdateStatusBars();
            _root.monster.intCounterCurrentTurn = 0;
            _root.monster.intCounterCurrentRound = _root.monster.intCounterCurrentTurn;
            _root.m._visible = true;
            _root.m.gotoAndPlay("Intro");
        } // End of the function
        function DetermineInitiative(intSafetyFrame)
        {
            if (bInitiativeWasDetermined)
            {
                return;
            } // end if
            if (typeof(_root.monster.intHP) != "number")
            {
                _root.gotoAndPlay(intSafetyFrame);
            }
            else if (_root.monster.intHP < 25)
            {
                _root.monster.intHP = 25;
                _root.gotoAndPlay(intSafetyFrame);
            }
            else if (_root.m.DoPackIntro != undefined && _root.m.status != "idle")
            {
                _root.gotoAndPlay(intSafetyFrame);
            }
            else
            {
                var _loc2 = new Object();
                _loc2.str = _root.func.Bounds(_root.monster.intSTR, -500, 500);
                _loc2.dex = _root.func.Bounds(_root.monster.intDEX, -500, 500);
                _loc2.int = _root.func.Bounds(_root.monster.intINT, -500, 500);
                _loc2.end = _root.func.Bounds(_root.monster.intEND, -500, 500);
                _loc2.cha = _root.func.Bounds(_root.monster.intCHA, -500, 500);
                _loc2.luk = _root.func.Bounds(_root.monster.intLUK, -500, 500);
                _loc2.none = 0;
                _root.stat.AffectStatsMonster(_loc2, -500, 500, "none", "monster");
                var _loc3 = new Object();
                _loc3.str = _root.func.Bounds(_root.player.intSTR, -95, 264);
                _loc3.dex = _root.func.Bounds(_root.player.intDEX, -95, 264);
                _loc3.int = _root.func.Bounds(_root.player.intINT, -95, 264);
                _loc3.end = _root.func.Bounds(_root.player.intEND, -95, 264);
                _loc3.cha = _root.func.Bounds(_root.player.intCHA, -95, 264);
                _loc3.luk = _root.func.Bounds(_root.player.intLUK, -95, 264);
                _loc3.none = 0;
                _root.stat.AffectStatsPlayer(_loc3, -95, 264, "none", "player");
                var _loc6 = _root.func.Bounds(Math.floor(Math.random() * 100 + 1) + _loc2.luk + _root.func.Zero(_root.stat.MonsterInitiativeModifier()), -1000, 1000);
                var _loc5 = _root.func.Bounds(Math.floor(Math.random() * 100 + 1) + _loc3.luk + _root.func.Zero(_root.stat.PlayerInitiativeModifier()), -100, 340);
                if (_loc6 == _loc5)
                {
                    var _loc4 = [-1, 1];
                    intMonsterInitiave = intMonsterInitiave + _loc4[Math.floor(Math.random() * _loc4.length)];
                } // end if
                if (_loc5 > _loc6)
                {
                    _root.strInitiative = "Player";
                }
                else
                {
                    _root.strInitiative = "Monster";
                } // end else if
                _root.func.BattleStart(_root.strInitiative);
                false;
                false;
                bInitiativeWasDetermined = true;
                _root.gotoAndPlay("InitiativeDone");
            } // end else if
        } // End of the function
        function BattleStart(strInitiativeWonBy)
        {
            _root.p.StartBattle(strInitiativeWonBy);
            _root.p.shield.StartBattle(strInitiativeWonBy);
            _root.miscitem.StartBattle(strInitiativeWonBy);
            _root.pet.StartBattle(strInitiativeWonBy);
            _root.guest.StartBattle(strInitiativeWonBy);
            _root.p.weapon.StartBattle(strInitiativeWonBy);
            _root.m.StartBattle(strInitiativeWonBy);
            _root.stat.StartBattle(strInitiativeWonBy);
        } // End of the function
        function BattleEnd(strVictor)
        {
            _root.p.EndBattle(strVictor);
            _root.p.shield.EndBattle(strVictor);
            _root.miscitem.EndBattle(strVictor);
            _root.pet.EndBattle(strVictor);
            _root.guest.EndBattle(strVictor);
            _root.p.weapon.EndBattle(strVictor);
            _root.m.EndBattle(strVictor);
            _root.stat.EndBattle(strVictor);
        } // End of the function
        function CheckCombatants()
        {
            var _loc2 = _root.player;
            if (_loc2.intHP <= 0)
            {
                _root.p.gotoAndPlay("Die");
                if (_root.m.PickNewActive == undefined)
                {
                    _root.m.gotoAndPlay("Idle");
                } // end if
                _root.gotoAndPlay("BattleLose");
            }
            else if (_root.monster.intHP <= 0 && typeof(_root.monster.intHP) == "number")
            {
                if (_root.intMonsterFrozen > 0)
                {
                    _root.func.UnFreezeMonster();
                } // end if
                if (_root.intMonsterParalyzed > 0)
                {
                    _root.func.UnParalyzeMonster();
                } // end if
                _root.m.gotoAndPlay("Die");
                _root.gotoAndPlay("BattleWin");
            }
            else if (!ShouldPlayMonsterIdle())
            {
                _root.m.gotoAndStop("Idle");
                _root.m.FreezeAnimation();
            } // end else if
        } // End of the function
        function EffectMonster(tohit, tohitbonus, randdamage, basedamage, element, stat)
        {
            var _loc2 = "";
            _root.func.Attack("monster", "other", _loc2, tohit, tohitbonus, randdamage, basedamage, element, stat);
        } // End of the function
        function AttackMonster()
        {
            _objAttack = _root.func.GetPlayerAttackInfo();
            _objAttack.Attack();
        } // End of the function
        function EffectPlayer(tohit, tohitbonus, randdamage, basedamage, element, stat)
        {
            attackType = _root.monster.strWeaponType;
            _root.func.Attack("player", "monster", attackType, tohit, tohitbonus, randdamage, basedamage, element, stat);
        } // End of the function
        function AttackPlayer()
        {
            _objAttack = _root.func.GetMonsterAttackInfo();
            _objAttack.Attack();
        } // End of the function
        function Attack(strTarget, strThis, strWeaponType, tohit, tohitbonus, randdamage, basedamage, element, stat)
        {
            objA = new _root.func.AttackInfo();
            objA.attacker = strThis;
            objA.defender = strTarget;
            objA.weapontype = strWeaponType;
            objA.element = element;
            objA.tohit = tohit;
            objA.tohitbonus = tohitbonus;
            objA.basedamage = basedamage;
            objA.randdamage = randdamage;
            objA.stat = stat;
            objA.statpercent = 100;
            objA.usestatbth = true;
            objA.Attack();
        } // End of the function
        function AttackInfo()
        {

  2. #2
    Luminescentz's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Location
    Chicago
    Posts
    15
    Reputation
    17
    Thanks
    451
    Code:
            this.name = "none";
            this.tag = "none";
            this.counter = 0;
            this.cstat = 0;
            this.weapontype = "Melee";
            this.element = "Fire";
            this.tohit = 0;
            this.tohitbonus = 0;
            this.basedamage = 0;
            this.randdamage = 0;
            this.stat = "intHP";
            this.attacker = "";
            this.defender = "";
            this.success = false;
            this.playsound = true;
            this.statpercent = 0;
            this.usestatbth = false;
            this.statoverride = new Array("none", "none", "none", "none", "none", "none");
            this.statoverridden = false;
            this.statbthoverride = new Array("none", "none", "none", "none", "none", "none");
            this.statbthoverridden = false;
            this.statdivisors = new Array(16, 16, 20, 15, 10, 40);
            this.statdamagepenalty = false;
            this.statdamageboost = false;
            this.statdamageboostoverride = false;
            this.statdamagepenaltyoverride = false;
            this.critstat = "luk";
            this.critchance = 0;
            this.critdivisor = 2;
            this.playtargetanimation = true;
        } // End of the function
        function GetMonsterAttackInfo()
        {
            objInfo = new _root.func.AttackInfo();
            var _loc2 = _root.monster;
            objInfo.name = _loc2.strMonsterName;
            objInfo.weapontype = _loc2.strWeaponType;
            objInfo.element = _loc2.strWeaponElement;
            objInfo.tohitbonus = _root.func.Bounds(_loc2.intWeaponBonusToHit, -50, 1000);
            objInfo.basedamage = _root.func.Bounds(_loc2.intWeaponBaseDamage, 0, 250);
            objInfo.randdamage = _root.func.Bounds(_loc2.intWeaponRandDamage, 0, 500);
            objInfo.attacker = "monster";
            objInfo.defender = "player";
            objInfo.statpercent = 100;
            objInfo.usestatbth = true;
            objInfo.critchance = 10;
            return (objInfo);
        } // End of the function
        function GetPlayerAttackInfo()
        {
            objInfo = new _root.func.AttackInfo();
            var _loc2 = _root.player;
            objInfo.name = _loc2.strWeaponName;
            objInfo.weapontype = _loc2.strWeaponType;
            objInfo.element = _loc2.strWeaponElement;
            objInfo.tohitbonus = _root.func.Bounds(_loc2.intWeaponBonusToHit, -50, 75);
            objInfo.basedamage = _root.func.Bounds(_loc2.intWeaponBaseDamage, -25, 50);
            objInfo.randdamage = _root.func.Bounds(_loc2.intWeaponRandDamage, -25, 75);
            objInfo.attacker = "player";
            objInfo.defender = "monster";
            objInfo.statpercent = 100;
            objInfo.usestatbth = true;
            objInfo.critchance = 10;
            return (objInfo);
        } // End of the function
        function GetSpecialAttackInfo()
        {
            objInfo = new _root.func.AttackInfo();
            var _loc2 = _root.player;
            objInfo.name = _loc2.strWeaponName;
            objInfo.weapontype = _loc2.strWeaponType;
            objInfo.element = _loc2.strWeaponElement;
            objInfo.tohitbonus = _root.func.Bounds(_loc2.intWeaponBonusToHit, -50, 75);
            objInfo.basedamage = _root.func.Bounds(_loc2.intWeaponBaseDamage, -25, 50);
            objInfo.randdamage = _root.func.Bounds(_loc2.intWeaponRandDamage, -25, 75);
            objInfo.attacker = "special";
            objInfo.defender = "monster";
            if (_root.func.GString("bit-specialchange") == "true")
            {
                objInfo.statpercent = 100;
                objInfo.critchance = 10;
            }
            else
            {
                objInfo.statpercent = 0;
                objInfo.critchance = 0;
            } // end else if
            objInfo.usestatbth = false;
            return (objInfo);
        } // End of the function
        function GetOtherAttackInfo()
        {
            objInfo = new _root.func.AttackInfo();
            var _loc2 = _root.player;
            objInfo.attacker = "other";
            objInfo.defender = "monster";
            objInfo.statpercent = 0;
            objInfo.critchance = 0;
            objInfo.usestatbth = false;
            return (objInfo);
        } // End of the function
        function GetPetAttackInfo()
        {
            objInfo = new _root.func.AttackInfo();
            var _loc2 = _root.player;
            objInfo.powerlevel = _loc2.intPetPowerLevel;
            objInfo.training = _loc2.strPetTraining;
            objInfo.weapontype = _loc2.strPetWeaponType;
            objInfo.element = _loc2.strPetElement;
            objInfo.tohitbonus = _root.func.Bounds(_loc2.intPetWeaponBonusToHit, -25, 500);
            objInfo.basedamage = _root.func.Bounds(_loc2.intPetWeaponBaseDamage, 0, 75);
            objInfo.randdamage = _root.func.Bounds(_loc2.intPetWeaponRandDamage, 0, 100);
            objInfo.attacker = "pet";
            objInfo.defender = "monster";
            objInfo.statpercent = 100;
            objInfo.usestatbth = true;
            return (objInfo);
        } // End of the function
        function GetGuestAttackInfo()
        {
            objInfo = new _root.func.AttackInfo();
            objInfo.weapontype = _root.guest.strWeaponType;
            objInfo.element = _root.guest.strWeaponElement;
            objInfo.tohitbonus = _root.func.Bounds(_root.guest.intWeaponBonusToHit, -25, 500);
            objInfo.basedamage = _root.func.Bounds(_root.guest.intWeaponBaseDamage, 0, 75);
            objInfo.randdamage = _root.func.Bounds(_root.guest.intWeaponRandDamage, 0, 100);
            objInfo.attacker = "guest";
            objInfo.defender = "monster";
            objInfo.statpercent = 100;
            objInfo.usestatbth = true;
            return (objInfo);
        } // End of the function
        function GetSpellAttackInfo()
        {
            var _loc2 = _root.player;
            objInfo = new _root.func.AttackInfo();
            objInfo.weapontype = "Magic";
            objInfo.attacker = "spell";
            objInfo.defender = "monster";
            objInfo.statpercent = 100;
            objInfo.name = _root.spell.strSpellName;
            objInfo.tohitbonus = _root.func.Bounds(_loc2.intSpellBonusToHit, -25, 500);
            objInfo.basedamage = _root.func.Bounds(_loc2.intSpellBaseDamage, -500, 1000);
            objInfo.randdamage = _root.func.Bounds(_loc2.intSpellRandDamage, -500, 2000);
            objInfo.usestatbth = true;
            objInfo.critchance = 10;
            return (objInfo);
        } // End of the function
        function ResolveAttack(info, bPredict)
        {
            if (info.cstat >= 2)
            {
                return;
            } // end if
            if (bPredict)
            {
                info.ispredict = true;
            }
            else
            {
                info.ispredict = false;
            } // end else if
            var _loc8;
            var _loc7;
            var _loc15;
            var _loc18;
            var _loc11;
            var _loc17;
            var _loc6;
            var _loc10;
            var _loc16;
            var _loc12;
            var _loc13;
            var _loc14;
            if (!bPredict)
            {
                _root.func.strCurrentAttackStat = info.stat;
                _root.func.strCurrentAttackElement = info.element;
            } // end if
            if (!bPredict)
            {
                _loc10 = info.element.toUpperCase();
            } // end if
            info.strUpperElementName = info.element.toUpperCase();
            var _loc4 = new Object();
            _loc4.str = _root.func.Bounds(_root.monster.intSTR, -500, 500);
            _loc4.dex = _root.func.Bounds(_root.monster.intDEX, -500, 500);
            _loc4.int = _root.func.Bounds(_root.monster.intINT, -500, 500);
            _loc4.end = _root.func.Bounds(_root.monster.intEND, -500, 500);
            _loc4.cha = _root.func.Bounds(_root.monster.intCHA, -500, 500);
            _loc4.luk = _root.func.Bounds(_root.monster.intLUK, -500, 500);
            _loc4.none = 0;
            if (!bPredict)
            {
                _root.stat.AffectStatsMonster(_loc4, -500, 500, info.attacker, info.defender);
            } // end if
            _root.func.AuditStats();
            var _loc5 = new Object();
            _loc5.str = _root.func.Bounds(_root.player.intSTR, -95, 264);
            _loc5.dex = _root.func.Bounds(_root.player.intDEX, -95, 264);
            _loc5.int = _root.func.Bounds(_root.player.intINT, -95, 264);
            _loc5.end = _root.func.Bounds(_root.player.intEND, -95, 264);
            _loc5.cha = _root.func.Bounds(_root.player.intCHA, -95, 264);
            _loc5.luk = _root.func.Bounds(_root.player.intLUK, -95, 264);
            _loc5.none = 0;
            if (!bPredict)
            {
                _root.stat.AffectStatsPlayer(_loc5, -95, 264, info.attacker, info.defender);
            } // end if
            if (info.stat == "intHP")
            {
                info.maxstat = "intBaseHP";
            }
            else if (info.stat == "intMP")
            {
                info.maxstat = "intBaseMP";
            }
            else if (info.stat == "intSP")
            {
                info.maxstat = "intBaseSP";
            } // end else if
            if (info.defender == "monster")
            {
                _loc8 = _root.m;
                _loc7 = _root.monster;
                if (!bPredict)
                {
                    _root.player.element = info.element;
                    _root.player.strDisplayWeaponType = TitleCase(info.weapontype);
                } // end if
                info.intTargetDefenseBonus = _loc4.dex / 10 + _loc4.luk / 20;
                info.intElementDefensePercentage = _root.monster["intArmor" + info.strUpperElementName];
                if (info.intElementDefensePercentage < 0)
                {
                    info.bDodgeAI = true;
                    info.intTargetDefenseBonus = info.intTargetDefenseBonus * -1;
                } // end if
            }
            else if (info.defender == "player")
            {
                _loc8 = _root.p;
                _loc7 = _root.player;
                if (!bPredict)
                {
                    _root.monster.element = info.element;
                    _root.monster.strDisplayWeaponType = TitleCase(info.weapontype);
                } // end if
                info.intTargetDefenseBonus = _loc5.dex / 10 + _loc5.luk / 20;
                info.intElementDefensePercentage = _root.player["int" + info.strUpperElementName];
                if (info.intElementDefensePercentage < 0)
                {
                    info.bDodgeAI = true;
                    info.intTargetDefenseBonus = info.intTargetDefenseBonus * -1;
                } // end if
            }
            else
            {
                _root.msg.Show("Combat Error! Invalid Target");
                return (false);
            } // end else if
            intStat1Divisor = _root.func.Bounds(info.statdivisors[0], 8, 100);
            intStat2Divisor = _root.func.Bounds(info.statdivisors[1], 8, 100);
            intStat3Divisor = _root.func.Bounds(info.statdivisors[2], 8, 100);
            intStat4Divisor = _root.func.Bounds(info.statdivisors[3], 8, 100);
            intStat5Divisor = _root.func.Bounds(info.statdivisors[4], 8, 100);
            intStat6Divisor = _root.func.Bounds(info.statdivisors[5], 8, 100);
            intMaxBonusStats = 6;
            strAcceptableOverrides = "str,dex,luk,cha,int,end,none";
            stat1 = "none";
            stat2 = "none";
            stat3 = "none";
            stat4 = "none";
            stat5 = "none";
            stat6 = "none";
            stat1BtH = "none";
            stat2BtH = "none";
            stat3BtH = "none";
            stat4BtH = "none";
            stat5BtH = "none";
            stat6BtH = "none";
            intStat1Bonus = 0;
            intStat2Bonus = 0;
            intStat3Bonus = 0;
            intStat4Bonus = 0;
            intStat5Bonus = 0;
            intStat6Bonus = 0;
            intStat1BonusBtH = 0;
            intStat2BonusBtH = 0;
            intStat3BonusBtH = 0;
            intStat4BonusBtH = 0;
            intStat5BonusBtH = 0;
            intStat6BonusBtH = 0;
            _loc6 = info.weapontype.toLowerCase();
            if (info.attacker == "monster")
            {
                statsFrom = _loc4;
            }
            else if (info.attacker == "guest" || info.attacker == "pet" || info.attacker == "player" || info.attacker == "special" || info.attacker == "spell" || info.attacker == "other")
            {
                statsFrom = _loc5;
            } // end else if
            if (info.statoverridden)
            {
                for (i = 0; i < intMaxBonusStats; i++)
                {
                    if (i < info.statoverride.length)
                    {
                        info.statoverride[i] = info.statoverride[i].toLowerCase();
                        if (strAcceptableOverrides.indexOf(info.statoverride[i]) == -1)
                        {
                            info.statoverride[i] = "none";
                        } // end if
                        continue;
                    } // end if
                    info.statoverride[i] = "none";
                } // end of for
                stat1 = info.statoverride[0];
                stat2 = info.statoverride[1];
                stat3 = info.statoverride[2];
                stat4 = info.statoverride[3];
                stat5 = info.statoverride[4];
                stat6 = info.statoverride[5];
            }
            else if (info.attacker == "monster" || info.attacker == "player" || info.attacker == "spell" || info.attacker == "other")
            {
                if (_loc6 == "melee")
                {
                    stat1 = "str";
                    stat2 = "str";
                    stat3 = "none";
                    stat4 = "none";
                    stat5 = "none";
                    stat6 = "none";
                } // end if
                if (_loc6 == "ranged")
                {
                    stat1 = "none";
                    stat2 = "none";
                    stat3 = "none";
                    stat4 = "none";
                    stat5 = "str";
                    stat6 = "dex";
                } // end if
                if (_loc6 == "magic")
                {
                    stat1 = "int";
                    stat2 = "int";
                    stat3 = "none";
                    stat4 = "none";
                    stat5 = "none";
                    stat6 = "none";
                } // end if
            }
            else if (info.attacker == "pet" || info.attacker == "guest")
            {
                stat1 = "none";
                stat2 = "none";
                stat3 = "none";
                stat4 = "cha";
                stat5 = "none";
                stat6 = "none";
            }
            else if (info.attacker == "special")
            {
                stat1 = "none";
                stat2 = "none";
                stat3 = "none";
                stat4 = "none";
                stat5 = "none";
                stat6 = "none";
            }
            else if (info.attacker == "other")
            {
                stat1 = "none";
                stat2 = "none";
                stat3 = "none";
                stat4 = "none";
                stat5 = "none";
                stat6 = "none";
            } // end else if
            intStat1Bonus = _root.func.Zero(statsFrom[stat1] / intStat1Divisor);
            intStat2Bonus = _root.func.Zero(statsFrom[stat2] / intStat2Divisor);
            intStat3Bonus = _root.func.Zero(statsFrom[stat3] / intStat3Divisor);
            intStat4Bonus = _root.func.Zero(statsFrom[stat4] / intStat4Divisor);
            intStat5Bonus = _root.func.Zero(statsFrom[stat5] / intStat5Divisor);
            intStat6Bonus = _root.func.Zero(statsFrom[stat6] / intStat6Divisor);
            intStatDamageBonus = intStat1Bonus + intStat2Bonus + intStat3Bonus + intStat4Bonus + intStat5Bonus + intStat6Bonus;
            if (_root.func.GString("bit-spellchange") == "true")
            {
                if (info.attacker == "spell" && (!info.statdamageboostoverride || info.statdamageboost) || info.statdamageboostoverride && info.statdamageboost)
                {
                    intStatDamageBonus = intStatDamageBonus * 2;
                } // end if
                if (((info.attacker == "player" || info.attacker == "special") && _loc6 == "magic" || info.attacker == "spell" && _loc6 != "magic") && (!info.statdamagepenaltyoverride || info.statdamagepenalty) || info.statdamagepenaltyoverride && info.statdamagepenalty)
                {
                    intStatDamageBonus = intStatDamageBonus * 0.750000;
                } // end if
            }
            else if ((info.attacker == "player" || info.attacker == "special") && _loc6 == "magic")
            {
                info.statpercent = info.statpercent * 0.750000;
            } // end else if
            info.intStatDamageBonus = intStatDamageBonus * info.statpercent / 100;
            if (info.statbthoverridden)
            {
                for (i = 0; i < intMaxBonusStats; i++)
                {
                    if (i < info.statbthoverride.length)
                    {
                        info.statbthoverride[i] = info.statbthoverride[i].toLowerCase();
                        if (strAcceptableOverrides.indexOf(info.statbthoverride[i]) == -1)
                        {
                            info.statbthoverride[i] = "none";
                        } // end if
                        continue;
                    } // end if
                    info.statbthoverride[i] = "none";
                } // end of for
                stat1BtH = info.statbthoverride[0];
                stat2BtH = info.statbthoverride[1];
                stat3BtH = info.statbthoverride[2];
                stat4BtH = info.statbthoverride[3];
                stat5BtH = info.statbthoverride[4];
                stat6BtH = info.statbthoverride[5];
            }
            else if (info.attacker == "monster" || info.attacker == "player" || info.attacker == "special" || info.attacker == "spell" || info.attacker == "other")
            {
                if (_loc6 == "melee")
                {
                    stat1BtH = "str";
                    stat2BtH = "dex";
                    stat3BtH = "luk";
                    stat4BtH = "none";
                    stat5BtH = "none";
                    stat6BtH = "none";
                } // end if
                if (_loc6 == "ranged")
                {
                    stat1BtH = "dex";
                    stat2BtH = "dex";
                    stat3BtH = "luk";
                    stat4BtH = "none";
                    stat5BtH = "none";
                    stat6BtH = "none";
                } // end if
                if (_loc6 == "magic")
                {
                    stat1BtH = "int";
                    stat2BtH = "dex";
                    stat3BtH = "luk";
                    stat4BtH = "none";
                    stat5BtH = "none";
                    stat6BtH = "none";
                } // end if
            }
            else if (info.attacker == "pet" || info.attacker == "guest")
            {
                stat1BtH = "none";
                stat2BtH = "none";
                stat3BtH = "cha";
                stat4BtH = "cha";
                stat5BtH = "none";
                stat6BtH = "none";
            }
            else if (info.attacker == "other")
            {
                stat1BtH = "none";
                stat2BtH = "none";
                stat3BtH = "none";
                stat4BtH = "none";
                stat5BtH = "none";
                stat6BtH = "none";
            }
            else if (info.attacker == "special")
            {
                stat1BtH = "none";
                stat2BtH = "none";
                stat3BtH = "none";
                stat4BtH = "none";
                stat5BtH = "none";
                stat6BtH = "none";
            } // end else if
            intStat1BonusBtH = _root.func.Zero(statsFrom[stat1BtH] / intStat1Divisor);
            intStat2BonusBtH = _root.func.Zero(statsFrom[stat2BtH] / intStat2Divisor);
            intStat3BonusBtH = _root.func.Zero(statsFrom[stat3BtH] / intStat3Divisor);
            intStat4BonusBtH = _root.func.Zero(statsFrom[stat4BtH] / intStat4Divisor);
            intStat5BonusBtH = _root.func.Zero(statsFrom[stat5BtH] / intStat5Divisor);
            intStat6BonusBtH = _root.func.Zero(statsFrom[stat6BtH] / intStat6Divisor);
            info.intStatToHitBonus = intStat1BonusBtH + intStat2BonusBtH + intStat3BonusBtH + intStat4BonusBtH + intStat5BonusBtH + intStat6BonusBtH;
            if (!info.usestatbth)
            {
                info.intStatToHitBonus = 0;
            } // end if
            if (strAcceptableOverrides.indexOf(info.critstat) == -1)
            {
                info.critstat = "none";
            } // end if
            info.critdivisor = _root.func.Bounds(info.critdivisor, 1, 4);
            info.intFinalAttackBonus = Math****und(info.tohitbonus) + Math****und(info.intStatToHitBonus);
            info.intFinalDefenseValue = Math****und(info.tohit) + Math****und(info.intTargetDefenseBonus);
            info.intToHitRoll = Math.floor(Math.random() * 100) + 1;
            if (!bPredict)
            {
                _root.stat.AffectHitAttack(info);
            } // end if
            info.hitPercent = Math.min(Math.max(0, (100 + _root.func.Bounds(_root.func.Zero(info.intFinalAttackBonus), -150, 150) - _root.func.Bounds(_root.func.Zero(info.intFinalDefenseValue), -150, 2000)) / 100), 1);
            if (info.intToHitRoll + _root.func.Bounds(_root.func.Zero(info.intFinalAttackBonus), -150, 150) > _root.func.Bounds(_root.func.Zero(info.intFinalDefenseValue), -150, 2000) || bPredict)
            {
                info.fRandomR1 = Math.random() / 2;
                info.fRandomR2 = Math.random() / 2;
                if (bPredict)
                {
                    info.fRandomR1 = 0.250000;
                    info.fRandomR2 = 0.250000;
                } // end if
                info.fStatR1 = info.fRandomR1;
                info.fStatR2 = info.fRandomR2;
                info.intCritRoll = Math.floor(Math.random() * 1000) + 1;
                info.intCritThreshold = 1000 - info.critchance * 10;
                info.intCritDamageBonus = _root.func.Zero(statsFrom[info.critstat] / info.critdivisor) * info.statpercent / 100;
                info.intCritDamageBonus = _root.func.Zero(statsFrom[info.critstat] / info.critdivisor) * info.statpercent / 100;
                if (!bPredict)
                {
                    if (info.intCritRoll > info.intCritThreshold && info.intCritDamageBonus != 0)
                    {
                        info.intCriticalMultipler = 1;
                    }
                    else
                    {
                        info.intCriticalMultipler = 0;
                    } // end else if
                }
                else
                {
                    info.intCriticalMultipler = Math.min(Math.max(1 * (info.intCritThreshold / 1000), 0), 1);
                } // end else if
                if (!bPredict)
                {
                    _root.stat.AffectDamageAttack(info);
                } // end if
                info.damage = _root.func.Bounds(info.basedamage, -3500, 3500);
                info.damage = info.damage + _root.func.Bounds(info.fRandomR1 * info.randdamage + info.fStatR1 * info.intStatDamageBonus + info.fStatR1 * info.intCritDamageBonus * info.intCriticalMultipler, -1750, 1750);
                info.damage = info.damage + _root.func.Bounds(info.fRandomR2 * info.randdamage + info.fStatR2 * info.intStatDamageBonus + info.fStatR2 * info.intCritDamageBonus * info.intCriticalMultipler, -1750, 1750);
                if (info.intElementDefensePercentage == undefined)
                {
                    info.intElementDefensePercentage = 100;
                } // end if
                info.intElementDefensePercentage = _root.func.Bounds(info.intElementDefensePercentage, -200, 200);
                info.damage = _root.func.Bounds(_root.func.Zero(Math****und(info.damage * info.intElementDefensePercentage * 0.010000)), -7000, 7000);
                if (typeof(_root.monster.intHP) != "number" && info.defender == "monster")
                {
                    info.damage = 0;
                    if (!bPredict)
                    {
                        damage = Damage = info.damage;
                        if (info.defender == "player")
                        {
                            _root.monster.lastattackdamage = info.damage;
                        }
                        else if (info.defender == "monster")
                        {
                            _root.player.lastattackdamage = info.damage;
                        } // end if
                    } // end else if
                    info.success = false;
                    info.realdamage = 0;
                }
                else
                {
                    info.success = true;
                    if (!bPredict)
                    {
                        damage = Damage = info.damage;
                        if (info.defender == "player")
                        {
                            _root.monster.lastattackdamage = info.damage;
                        }
                        else if (info.defender == "monster")
                        {
                            _root.player.lastattackdamage = info.damage;
                        } // end if
                    } // end else if
                    info.intCurValue = _loc7[info.stat];
                    info.intNewValue = info.intCurValue - info.damage;
                    if (info.intNewValue < 0)
                    {
                        info.intNewValue = 0;
                    } // end if
                    if (info.maxstat != undefined && info.intNewValue > _loc7[info.maxstat])
                    {
                        info.intNewValue = _loc7[info.maxstat];
                    } // end if
                    info.realdamage = info.intCurValue - info.intNewValue;
                } // end else if
            }
            else
            {
                info.damage = 0;
                if (!bPredict)
                {
                    if (info.defender == "player")
                    {
                        _root.monster.lastattackdamage = info.damage;
                    }
                    else if (info.defender == "monster")
                    {
                        _root.player.lastattackdamage = info.damage;
                    } // end if
                } // end else if
                info.success = false;
                info.realdamage = 0;
            } // end else if
            if (!bPredict)
            {
                info.BeforeResolve();
            } // end if
            if ((typeof(info.intNewValue) != "number" || typeof(info.intCurValue) != "number" || info.intNewValue != info.intCurValue - info.realdamage || info.intCurValue < _loc7[info.stat] || Math.abs(info.realdamage) > 7500) && info.defender == "monster" && info.success == true)
            {
                info.damage = 0;
                if (!bPredict)
                {
                    damage = Damage = info.damage;
                    if (info.defender == "player")
                    {
                        _root.monster.lastattackdamage = info.damage;
                    }
                    else if (info.defender == "monster")
                    {
                        _root.player.lastattackdamage = info.damage;
                    } // end if
                } // end else if
                info.success = false;
                info.realdamage = 0;
            } // end if
            if (!bPredict)
            {
                damage = Damage = info.damage;
                if (info.defender == "player")
                {
                    _root.monster.lastattackdamage = info.damage;
                }
                else if (info.defender == "monster")
                {
                    _root.player.lastattackdamage = info.damage;
                } // end else if
                if (info.success)
                {
                    if (info.attacker == "player" || info.attacker == "special" || info.attacker == "spell")
                    {
                        _root.player["intCounterTotalDamage" + info.element.toUpperCase()] = _root.player["intCounterTotalDamage" + info.element.toUpperCase()] + info.damage;
                        _root.player["intCounterTotalDamage" + info.weapontype.toUpperCase()] = _root.player["intCounterTotalDamage" + info.weapontype.toUpperCase()] + info.damage;
                        _root.player.intCounter******it = _root.player.intCounter******it + 1;
                    }
                    else if (info.attacker == "pet")
                    {
                        _root.player.intCounterTotalDamagePet = _root.player.intCounterTotalDamagePet + info.damage;
                    }
                    else if (info.attacker == "guest")
                    {
                        _root.player.intCounterTotalDamageGuest = _root.player.intCounterTotalDamageGuest + info.damage;
                    } // end else if
                    _loc7[info.stat] = info.intNewValue;
                    _loc8.Hit(info);
                    _root.func.bitLuckyAttack = info.intCriticalMultipler == 1;
                    if (info.defender == "player")
                    {
                        _root.monster.lastattacklucky = _root.func.bitLuckyAttack;
                    }
                    else if (info.defender == "monster")
                    {
                        _root.player.lastattacklucky = _root.func.bitLuckyAttack;
                    } // end else if
                    if (info.playtargetanimation)
                    {
                        _loc8.gotoAndPlay("Hit");
                    }
                    else
                    {
                        _root.hitwatcher.ShowHit(info.defender);
                    } // end else if
                    if (info.playsound)
                    {
                        var _loc9;
                        if (_root.func.bitLuckyAttack)
                        {
                            _loc9 = 101;
                        }
                        else
                        {
                            _loc9 = ((info.fRandomR1 + info.fStatR1) / 2 + (info.fRandomR2 + info.fStatR2) / 2) * 100;
                        } // end else if
                        _root.func.GenericElementSoundEffect(info.element, _loc9);
                    } // end if
                }
                else
                {
                    if (info.attacker == "player")
                    {
                        _root.player.intCounterTotalMiss = _root.player.intCounterTotalMiss + 1;
                    } // end if
                    _loc8.Miss(info);
                    if (info.playtargetanimation)
                    {
                        _loc8.gotoAndPlay("Block");
                    }
                    else
                    {
                        _root.hitwatcher.ShowMiss(info.defender);
                    } // end else if
                    _root.soundfx.Noise("block");
                } // end else if
                _root.func.intActualAttackDamage = info.realdamage;
                info.AfterResolve();
                _root.func.HealMonsterHP(0);
                _root.func.HealPlayerHP(0);
                _root.func.HealPlayerMP(0);
                _root.func.HealPlayerSP(0);
                _root.func.HealMonsterMP(0);
                _root.func.HealMonsterSP(0);
                _root.func.UpdateStatusBars();
            } // end if
            ++info.cstat;
            false;
            false;
        } // End of the function
        function PredictAttack(realinfo)
        {
            info = new Object();
            _root.func.CopyObjectProperties(realinfo, info);
            ResolveAttack(info, true);
            info.intEstimatedDamage = info.damage * info.hitPercent;
            return (info);
        } // End of the function
        function GenericElementSoundEffect(strSoundName, intPercent)
        {
            if (strSoundName == "ElementX" || strSoundName == "Void" || strSoundName == "Harm")
            {
                strSoundName = "fire";
            } // end if
            if (intPercent < 60)
            {
                _root.soundfx.Noise(strSoundName + "0");
            }
            else if (intPercent < 101)
            {
                _root.soundfx.Noise(strSoundName + "1");
            }
            else
            {
                _root.soundfx.Noise(strSoundName + "2");
            } // end else if
        } // End of the function
        function CastSpell()
        {
        } // End of the function
        function CanUseClassAbility(intSpellCost, intSpellCostHP, intSpellCostSP, intSpellCostCharge, strChargeCounterName, strSpellElement, intSpellLevel, bitAllowSuicide, bitBypassLimitsHP, bitBypassLimitsMP, bitBypassLimitsSP)
        {
            rp = _root.player;
            var _loc2 = new Object();
            _loc2.intSpellCost = intSpellCost;
            _loc2.intSpellCostHP = intSpellCostHP;
            _loc2.intSpellCostSP = intSpellCostSP;
            _loc2.intSpellLevel = intSpellLevel;
            _loc2.intSpellCostCharge = intSpellCostCharge;
            _loc2.strChargeCounterName = strChargeCounterName;
            _loc2.intSpellElement = strSpellElement;
            _loc2.bitCantCastSpell = false;
            _loc2.bitMayCastSpell = true;
            _loc2.bitAllowSuicide = bitAllowSuicide;
            _loc2.bitBypassLimitsHP = bitBypassLimitsHP;
            _loc2.bitBypassLimitsMP = bitBypassLimitsMP;
            _loc2.bitBypassLimitsSP = bitBypassLimitsSP;
            _root.stat.CanCastSpellPlayer(_loc2);
            intCharge = _root.player.objSessionData[strChargeCounterName];
            if (intCharge == undefined)
            {
                intCharge = 0;
            } // end if
            if (!objSpell.bitCantCastSpell)
            {
                if ((rp.intHP > _loc2.intSpellCostHP || rp.intHP == _loc2.intSpellCostHP && objSpell.bitAllowSuicide) && rp.intMP >= _loc2.intSpellCost && rp.intSP >= _loc2.intSpellCostSP && _root.player.objSessionData[_loc2.strChargeCounterName] >= _loc2.intSpellCostCharge)
                {
                    _loc2.bitMayCastSpell = _loc2.bitMayCastSpell && true;
                }
                else if ((rp.intHP > _loc2.intSpellCostHP || _loc2.bitBypassLimitsHP) && (rp.intMP >= _loc2.intSpellCost || _loc2.bitBypassLimitsMP) && (rp.intSP >= _loc2.intSpellCostSP || _loc2.bitBypassLimitsSP) && _root.player.objSessionData[_loc2.strChargeCounterName] >= _loc2.intSpellCostCharge)
                {
                    _loc2.bitMayCastSpell = _loc2.bitMayCastSpell && true;
                }
                else
                {
                    _loc2.bitMayCastSpell = _loc2.bitMayCastSpell && false;
                } // end else if
            }
            else
            {
                _loc2.bitMayCastSpell = _loc2.bitMayCastSpell && false;
            } // end else if
            return (_loc2);
        } // End of the function
        function UseClassAbility(intSpellCost, intSpellCostHP, intSpellCostSP, strSpellElement, intSpellLevel, bitAllowSuicide, bitBypassLimitsHP, bitBypassLimitsMP, bitBypassLimitsSP)
        {
            rp = _root.player;
            var _loc2 = new Object();
            _loc2.intSpellCost = intSpellCost;
            _loc2.intSpellCostHP = intSpellCostHP;
            _loc2.intSpellCostSP = intSpellCostSP;
            _loc2.intSpellLevel = intSpellLevel;
            _loc2.intSpellElement = strSpellElement;
            _loc2.intSpellCostCharge = intSpellCostCharge;
            _loc2.strChargeCounterName = strChargeCounterName;
            _loc2.bitCantCastSpell = false;
            _loc2.bitMayCastSpell = true;
            _loc2.bitAllowSuicide = bitAllowSuicide;
            _loc2.bitBypassLimitsHP = bitBypassLimitsHP;
            _loc2.bitBypassLimitsMP = bitBypassLimitsMP;
            _loc2.bitBypassLimitsSP = bitBypassLimitsSP;
            intCharge = _root.player.objSessionData[strChargeCounterName];
            if (intCharge == undefined)
            {
                intCharge = 0;
            } // end if
            _root.stat.CastSpellPlayer(_loc2);
            if (!_loc2.bitCantCastSpell)
            {
                if ((rp.intHP > _loc2.intSpellCostHP || rp.intHP == _loc2.intSpellCostHP && _loc2.bitAllowSuicide) && rp.intMP >= _loc2.intSpellCost && rp.intSP >= _loc2.intSpellCostSP && intCharge >= _loc2.intSpellCostCharge)
                {
                    _root.func.HealPlayerHP(-_loc2.intSpellCostHP);
                    _root.func.HealPlayerMP(-_loc2.intSpellCost);
                    _root.func.HealPlayerSP(-_loc2.intSpellCostSP);
                    _root.player.objSessionData[strChargeCounterName] = _root.player.objSessionData[strChargeCounterName] - intSpellCostCharge;
                    _loc2.bitMayCastSpell = _loc2.bitMayCastSpell && true;
                }
                else if ((rp.intHP > _loc2.intSpellCostHP || _loc2.bitBypassLimitsHP) && (rp.intMP >= _loc2.intSpellCost || _loc2.bitBypassLimitsMP) && (rp.intSP >= _loc2.intSpellCostSP || objSpell.bitBypassLimitsSP) && intCharge >= _loc2.intSpellCostCharge)
                {
                    _root.player.objSessionData[strChargeCounterName] = _root.player.objSessionData[strChargeCounterName] - intSpellCostCharge;
                    _root.func.HealPlayerHP(-_loc2.intSpellCostHP);
                    _root.func.HealPlayerMP(-_loc2.intSpellCost);
                    _root.func.HealPlayerSP(-_loc2.intSpellCostSP);
                    _loc2.bitMayCastSpell = _loc2.bitMayCastSpell && false;
                }
                else
                {
                    _loc2.bitMayCastSpell = _loc2.bitMayCastSpell && false;
                } // end else if
            }
            else
            {
                _loc2.bitMayCastSpell = _loc2.bitMayCastSpell && false;
            } // end else if
            return (_loc2);
        } // End of the function
        function CanCastMagicSpell(snum, bitUseMP, bitUseHP, bitUseSP, bitAllowSuicide, bitBypassLimitsHP, bitBypassLimitsMP, bitBypassLimitsSP)
        {
            rp = _root.player;
            var objSpell = new Object();
            objSpell.snum = snum;
            objSpell.bitUseMP = bitUseMP;
            objSpell.bitUseHP = bitUseHP;
            objSpell.bitUseSP = bitUseSP;
            objSpell.intSpellCost = eval("rp.intSpellCost" + snum);
            objSpell.intSpellCostHP = _root.func.Zero(eval("rp.intSpellCostHP" + snum));
            objSpell.intSpellCostSP = _root.func.Zero(eval("rp.intSpellCostSP" + snum));
            objSpell.intSpellId = eval("rp.idLore_Spells" + snum);
            objSpell.idLore_Spells = eval("rp.idLore_Spells" + snum);
            objSpell.strSpellName = eval("rp.strSpellName" + snum);
            objSpell.strSpellDescription = eval("rp.strSpellDescription" + snum);
            objSpell.intSpellLevel = eval("rp.intSpellLevel" + snum);
            objSpell.strSpellFileName = eval("rp.strSpellFileName" + snum);
            objSpell.intSpellElement = eval("rp.intSpellElement" + snum);
            objSpell.intSpellAdjId = eval("rp.idLore_Adj_Spells" + snum);
            objSpell.idLore_Adj_Spells = eval("rp.idLore_Adj_Spells" + snum);
            objSpell.intSpellPowerExp = eval("rp.intSpellPowerExp" + snum);
            objSpell.intSpellPowerLevel = eval("rp.intSpellPowerLevel" + snum);
            objSpell.intSpellBaseDamage = eval("rp.intSpellBaseDamage" + snum);
            objSpell.intSpellRandDamage = eval("rp.intSpellRandDamage" + snum);
            objSpell.intSpellBonusToHit = eval("rp.intSpellBonusToHit" + snum);
            objSpell.bitCantCastSpell = false;
            objSpell.bitMayCastSpell = true;
            objSpell.bitAllowSuicide = bitAllowSuicide;
            objSpell.bitBypassLimitsHP = bitBypassLimitsHP;
            objSpell.bitBypassLimitsMP = bitBypassLimitsMP;
            objSpell.bitBypassLimitsSP = bitBypassLimitsSP;
            _root.stat.CanCastSpellPlayer(objSpell);
            if (!objSpell.bitCantCastSpell)
            {
                if ((!objSpell.bitUseHP || (rp.intHP > objSpell.intSpellCostHP || rp.intHP == objSpell.intSpellCostHP && objSpell.bitAllowSuicide)) && (!objSpell.bitUseMP || rp.intMP >= objSpell.intSpellCost) && (!objSpell.bitUseSP || rp.intSP >= objSpell.intSpellCostSP))
                {
                    objSpell.bitMayCastSpell = objSpell.bitMayCastSpell && true;
                }
                else if ((!objSpell.bitUseHP || rp.intHP > objSpell.intSpellCostHP || objSpell.bitBypassLimitsHP) && (!objSpell.bitUseMP || rp.intMP >= objSpell.intSpellCost || objSpell.bitBypassLimitsMP) && (!objSpell.bitUseSP || rp.intSP >= objSpell.intSpellCostSP || objSpell.bitBypassLimitsSP))
                {
                    objSpell.bitMayCastSpell = objSpell.bitMayCastSpell && true;
                }
                else
                {
                    objSpell.bitMayCastSpell = objSpell.bitMayCastSpell && false;
                } // end else if
            }
            else
            {
                objSpell.bitMayCastSpell = objSpell.bitMayCastSpell && false;
            } // end else if
            return (objSpell);
        } // End of the function
        function CastMagicSpell(snum, bitUseMP, bitUseHP, bitUseSP, bitAllowSuicide, bitBypassLimitsHP, bitBypassLimitsMP, bitBypassLimitsSP)
        {
            rp = _root.player;
            if (bitUseHP == undefined)
            {
                bitUseHP = true;
            } // end if
            if (bitUseSP == undefined)
            {
                bitUseSP = true;
            } // end if
            if (bitAllowSuicide == undefined)
            {
                bitAllowSuicide = false;
            } // end if
            if (bitBypassLimitsHP == undefined)
            {
                bitBypassLimitsHP = false;
            } // end if
            if (bitBypassLimitsMP == undefined)
            {
                bitBypassLimitsMP = false;
            } // end if
            if (bitBypassLimitsSP == undefined)
            {
                bitBypassLimitsSP = false;
            } // end if
            var rp = _root.player;
            var objSpell = new Object();
            objSpell.snum = snum;
            objSpell.bitUseMP = bitUseMP;
            objSpell.bitUseHP = bitUseHP;
            objSpell.bitUseSP = bitUseSP;
            objSpell.intSpellCost = eval("rp.intSpellCost" + snum);
            objSpell.intSpellCostHP = _root.func.Zero(eval("rp.intSpellCostHP" + snum));
            objSpell.intSpellCostSP = _root.func.Zero(eval("rp.intSpellCostSP" + snum));
            objSpell.intSpellId = eval("rp.idLore_Spells" + snum);
            objSpell.idLore_Spells = eval("rp.idLore_Spells" + snum);
            objSpell.strSpellName = eval("rp.strSpellName" + snum);
            objSpell.strSpellDescription = eval("rp.strSpellDescription" + snum);
            objSpell.intSpellLevel = eval("rp.intSpellLevel" + snum);
            objSpell.strSpellFileName = eval("rp.strSpellFileName" + snum);
            objSpell.intSpellElement = eval("rp.intSpellElement" + snum);
            objSpell.intSpellAdjId = eval("rp.idLore_Adj_Spells" + snum);
            objSpell.idLore_Adj_Spells = eval("rp.idLore_Adj_Spells" + snum);
            objSpell.intSpellPowerExp = eval("rp.intSpellPowerExp" + snum);
            objSpell.intSpellPowerLevel = eval("rp.intSpellPowerLevel" + snum);
            objSpell.intSpellBaseDamage = eval("rp.intSpellBaseDamage" + snum);
            objSpell.intSpellRandDamage = eval("rp.intSpellRandDamage" + snum);
            objSpell.intSpellBonusToHit = eval("rp.intSpellBonusToHit" + snum);
            objSpell.bitCantCastSpell = false;
            objSpell.bitMayCastSpell = true;
            objSpell.bitAllowSuicide = bitAllowSuicide;
            objSpell.bitBypassLimitsHP = bitBypassLimitsHP;
            objSpell.bitBypassLimitsMP = bitBypassLimitsMP;
            objSpell.bitBypassLimitsSP = bitBypassLimitsSP;
            _root.stat.CastSpellPlayer(objSpell);
            if (!objSpell.bitCantCastSpell)
            {
                if ((!objSpell.bitUseHP || (rp.intHP > objSpell.intSpellCostHP || rp.intHP == objSpell.intSpellCostHP && objSpell.bitAllowSuicide)) && (!objSpell.bitUseMP || rp.intMP >= objSpell.intSpellCost) && (objSpell.bitUseSP || rp.intSP >= objSpell.intSpellCostSP))
                {
                    if (objSpell.bitUseHP)
                    {
                        _root.func.HealPlayerHP(-objSpell.intSpellCostHP);
                    } // end if
                    if (objSpell.bitUseMP)
                    {
                        _root.func.HealPlayerMP(-objSpell.intSpellCost);
                    } // end if
                    if (objSpell.bitUseSP)
                    {
                        _root.func.HealPlayerSP(-objSpell.intSpellCostSP);
                    } // end if
                    if (objSpell.bitMayCastSpell)
                    {
                        _root.func.CopyObjectProperties(objSpell, rp);
                        _root.player.strLastAttackChoice = "spell";
                        _root.soundfx.Noise("magic");
                        _root.spell.loadMovie("spells/" + rp.strSpellFileName);
                        _root.p.gotoAndPlay("Cast");
                        _root.play();
                        return;
                    } // end if
                }
                else if ((!objSpell.bitUseHP || rp.intHP > objSpell.intSpellCostHP || objSpell.bitBypassLimitsHP) && (objSpell.bitUseMP || rp.intMP >= objSpell.intSpellCost || objSpell.bitBypassLimitsMP) && (objSpell.bitUseSP || rp.intSP >= objSpell.intSpellCostSP || objSpell.bitBypassLimitsSP))
                {
                    if (objSpell.bitUseHP)
                    {
                        _root.func.HealPlayerHP(-objSpell.intSpellCostHP);
                    } // end if
                    if (objSpell.bitUseMP)
                    {
                        _root.func.HealPlayerMP(-objSpell.intSpellCost);
                    } // end if
                    if (objSpell.bitUseSP)
                    {
                        _root.func.HealPlayerSP(-objSpell.intSpellCostSP);
                    } // end if
                    _root.func.CopyObjectProperties(objSpell, rp);
                    _root.player.strLastAttackChoice = "spell";
                } // end else if
                _root.spell.loadMovie("spells/spell-none.swf");
                _root.p.gotoAndPlay("Cast");
                _root.play();
            }
            else
            {
                _root.spell.loadMovie("spells/spell-none.swf");
                _root.p.gotoAndPlay("Cast");
                _root.play();
            } // end else if
        } // End of the function
        function CastSpellFilename(ss)
        {
            var _loc2 = _root.player;
            _loc2.strSpellFileName = ss;
            _loc2.intSpellId = 0;
            _loc2.intSpellCost = 0;
            _loc2.strSpellName = "Magic Spell";
            _loc2.intSpellPowerLevel = 0;
            _loc2.intSpellElement = 0;
            _root.spell.loadMovie("spells/" + ss);
        } // End of the function
        function CancelEncounter()
        {
            _root.player.strLastAttackChoice = "cancel";
            _root.player.intFlee = _root.player.intFlee - 1;
            _root.player.strFlee = "(" + _root.player.intFlee + ")";
            _root.user.strResolution = "cancel";
            ++_root.player.intQueuedCancels;
            _root.gotoAndPlay("BattleLose");
        } // End of the function
        function FleeEncounter()
        {
            _root.player.strLastAttackChoice = "flee";
            _root.user.strResolution = "flee";
            ++_root.player.intQueuedFlees;
            _root.func.HealPlayerSP(-_root.func.Bounds(_root.monster.intSP, 0, 150));
            if (_root.intMonsterFrozen > 0)
            {
                _root.func.UnFreezeMonster();
            } // end if
            if (_root.intMonsterParalyzed > 0)
            {
                _root.func.UnParalyzeMonster();
            } // end if
            _root.gotoAndPlay("BattleLose");
        } // End of the function
        function ClearInvalidInventory()
        {
            var _loc2;
            var _loc3 = _root.player;
            for (var _loc2 = _loc3.intWeaponsNum + 1; _loc2 <= MAX_SLOTS; ++_loc2)
            {
                _loc3["strWeaponName" + _loc2] = "";
            } // end of for
            for (var _loc2 = _loc3.intArmorsNum + 1; _loc2 <= MAX_SLOTS; ++_loc2)
            {
                _loc3["strArmorName" + _loc2] = "";
            } // end of for
            for (var _loc2 = _loc3.intShieldsNum + 1; _loc2 <= MAX_SLOTS; ++_loc2)
            {
                _loc3["strShieldName" + _loc2] = "";
            } // end of for
            for (var _loc2 = _loc3.intSpellsNum + 1; _loc2 <= MAX_SLOTS; ++_loc2)
            {
                _loc3["strSpellName" + _loc2] = "";
            } // end of for
            for (var _loc2 = _loc3.intPetsNum + 1; _loc2 <= MAX_SLOTS; ++_loc2)
            {
                _loc3["strPetName" + _loc2] = "";
                _loc3["strPet" + _loc2] = "none";
            } // end of for
            for (var _loc2 = _loc3.intMiscNum + 1; _loc2 <= MAX_SLOTS; ++_loc2)
            {
                _loc3["strMiscName" + _loc2] = "";
            } // end of for
        } // End of the function
        function UnloadMisc()
        {
            _root.miscitem._visible = false;
            _root.miscitem.Deactivate();
            _root.miscitem.unloadMovie();
            _root.player.intActiveMisc = -1;
            _root.player.strMiscName = "None";
        } // End of the function
        function CharSetAt(strString, intPos, strChar)
        {
            var _loc1;
            var _loc2;
            var _loc4;
            var _loc3;
            _loc1 = strString;
            _loc3 = _loc1.length;
            _loc2 = _loc1.substring(0, intPos);
            _loc4 = _loc1.substring(intPos + 1, _loc3);
            _loc1 = _loc2 + strChar + _loc4;
            return (_loc1);
        } // End of the function
        function GetFaceColor(Obj, intFaceColor)
        {
            var _loc3;
            if (Obj._parent._name == "clipOwnerInfo" || Obj._parent._parent._name == "clipOwnerInfo" || Obj._parent._parent._name == "clipOwnerInfo" || Obj._parent._parent._parent._name == "clipOwnerInfo")
            {
                _loc3 = _root.town.dataHouse.owner.strFaceColors;
            }
            else
            {
                _loc3 = _root.player.strFaceColors;
            } // end else if
            return (_loc3.split(",")[intFaceColor]);
        } // End of the function
        function SetColor(Obj, intFaceColor)
        {
            var _loc3 = new Color(Obj);
            var _loc2 = _root.func.GetFaceColor(Obj, intFaceColor);
            if (_loc2 != null && _loc2 != "")
            {
                _loc3.setRGB(_loc2);
            } // end if
        } // End of the function
        function EquipArmorNum(intNum)
        {
            _root.p.shield.Deactivate();
            _root.p.weapon.Deactivate();
            _root.p.Deactivate();
            _root.player.intActiveArmor = intNum;
            _root.func.SetActiveArmor();
            _root.func.RecalculateAttributes();
            _root.p.loadMovie("armors/" + _root.player.strArmorFileName);
        } // End of the function
        function EquipWeaponNum(intNum)
        {
            _root.p.weapon.Deactivate();
            _root.player.intActiveWeapon = intNum;
            _root.func.SetActiveWeapon();
            _root.p.WeaponLoading(intNum);
            _root.p.weapon.loadMovie("weapons/" + _root.player.strWeaponFileName);
        } // End of the function
        function EquipShieldNum(intNum)
        {
            _root.p.shield.Deactivate();
            _root.player.intActiveShield = intNum;
            _root.func.SetActiveShield();
            _root.func.RecalculateAttributes();
            _root.p.ShieldLoading(intNum);
            _root.p.shield.loadMovie("shields/" + _root.player.strShieldFileName);
        } // End of the function
        function EquipMiscNum(intNum, nMana, nSkill, nHealth)
        {
            if (nMana > 0)
            {
                if (nMana > _root.player.intMP)
                {
                    return;
                } // end if
                _root.func.HealPlayerMP(-nMana);
            } // end if
            if (nSkill > 0)
            {
                if (nSkill > _root.player.intSP)
                {
                    return;
                } // end if
                _root.func.HealPlayerSP(-nSkill);
            } // end if
            if (nHealth > 0)
            {
                if (nHealth > _root.player.intHP)
                {
                    return;
                } // end if
                _root.func.HealPlayerHP(-nHealth);
            } // end if
            _root.miscitem.Deactivate();
            _root.player.strLastAttackChoice = "misc";
            _root.player.intActiveMisc = intNum;
            _root.func.SetActiveMisc();
            _root.miscitem._visible = true;
            _root.soundfx.Noise("magic");
            _root.p.MiscLoading(intNum);
            _root.miscitem.loadMovie("misc/" + (eval("_root.player.strMiscFileName" + intNum)));
        } // End of the function
        function EquipPetNum(intNum)
        {
            _root.pet.Deactivate();
            if (_root.player.intPetsNum == -3)
            {
                _root.player.strPet = "none";
                _root.pet._visible = false;
                return;
            } // end if
            if (_root.player.intPetsNum < intNum)
            {
                return;
            } // end if
            _root.player.intActivePet = intNum;
            _root.func.SetActivePet();
            _root.p.PetLoading(intNum);
            _root.pet.loadMovie("pets/" + (eval("_root.player.strPetFileName" + intNum)));
        } // End of the function
        function EnableAllCombatActions()
        {
            _root.bitAttackEnabled = true;
            _root.bitSpellsEnabled = true;
            _root.bitPotionsEnabled = true;
            _root.bitMiscsEnabled = true;
            _root.bitWeaponsEnabled = true;
            _root.bitShieldsEnabled = true;
            _root.bitArmorEnabled = true;
            _root.bitGuestsEnabled = true;
            _root.bitPetsEnabled = true;
            _root.bitFleeEnabled = true;
            _root.bitClassMenuEnabled = true;
        } // End of the function
        function FreezeMonster(intTurns)
        {
            var _loc2 = _root.monster;
            if (_root.func.MatchMonsterCategory("nofreeze") || _loc2.strWeaponElement == "Ice" || _loc2.intArmorICE < 100)
            {
                _root.msg.Show(_root.lang[4], 4);
                return;
            } // end if
            if (_root.intMonsterParalyzed > 0 || Math.random() * 400 < _loc2.intEND)
            {
                _root.msg.Show(_root.lang[5], 4);
                return;
            } // end if
            if (_root.intMonsterFrozen <= 0)
            {
                var _loc4 = new Color(_root.m);
                var _loc3 = new Object();
                _loc3 = {ra: "100", rb: "-75", ga: "100", gb: "-50", ba: "100", bb: "150", aa: "65", ab: "0"};
                _loc4.setTransform(_loc3);
                _loc2.intArmorFIRE_saved = null;
                if (_loc2.intArmorFIRE < 200)
                {
                    _loc2.intArmorFIRE_saved = _loc2.intArmorFIRE;
                    _loc2.intArmorFIRE = 200;
                } // end if
            } // end if
            _root.ProfileMonster.SetEffectDesc("Frozen!");
            _root.intMonsterFrozen = 1 + Number(intTurns);
            _root.m.gotoAndStop("Idle");
            _root.m.OnFreezeAnimation();
            _root.m.FreezeAnimation();
        } // End of the function
        function UnFreezeMonster()
        {
            var _loc2 = _root.monster;
            _root.intMonsterFrozen = 0;
            _root.func.RestoreColor(_root.m);
            if (_loc2.intArmorFIRE_saved != null)
            {
                _loc2.intArmorFIRE = _loc2.intArmorFIRE_saved;
                _loc2.intArmorFIRE_saved = null;
            } // end if
            _root.ProfileMonster.SetEffectDesc("");
            _root.m.gotoAndPlay("Idle");
            _root.m.UnFreezeAnimation();
        } // End of the function
        function RestoreColor(clip)
        {
            var _loc2 = new Color(clip);
            var _loc1 = new Object();
            _loc1 = {ra: "100", rb: "0", ga: "100", gb: "0", ba: "100", bb: "0", aa: "100", ab: "0"};
            _loc2.setTransform(_loc1);
        } // End of the function
        function ParalyzeMonster(intTurns)
        {
            var _loc2 = _root.monster;
            if (_root.func.MatchMonsterCategory("noparalyze"))
            {
                _root.msg.Show(_root.lang[6], 4);
                return;
            } // end if
            if (_root.intMonsterFrozen > 0 || Math.random() * 250 < _loc2.intEND)
            {
                _root.msg.Show(_root.lang[7], 4);
                return;
            } // end if
            _root.ProfileMonster.SetEffectDesc("Paralyzed!");
            _root.intMonsterParalyzed = 1 + Number(intTurns);
            _root.m.gotoAndStop("Idle");
            _root.m.OnFreezeAnimation();
            _root.m.FreezeAnimation();
        } // End of the function
        function UnParalyzeMonster()
        {
            _root.ProfileMonster.SetEffectDesc("");
            _root.intMonsterParalyzed = 0;
            _root.m.gotoAndPlay("Idle");
            _root.m.UnFreezeAnimation();
        } // End of the function
        function ResetAffectedMonster()
        {
            intMonsterFrozen = intPlayerFrozen = 0;
            intMonsterParalyzed = intPlayerParalyzed = 0;
            _root.func.RestoreColor(_root.m);
            _root.func.RestoreColor(_root.p);
        } // End of the function
        function DoPetIntro()
        {
            _root.pet._visible = true;
            _root.pet.gotoAndPlay("Intro");
            var _loc2 = _root.player;
            if (_loc2.strPet != _loc2.strPetFileName)
            {
                _loc2.intPetCharisma = 25;
                _loc2.strPetFileName = _loc2.strPet;
                _loc2.strPetName = "Stray Pet";
                _loc2.strPetNamed = "My Stray Pet";
                _loc2.intPetPowerExp = 0;
                _loc2.intPetPowerLevel = 0;
                _loc2.strPetTraining = "";
            } // end if
        } // End of the function
        function ArmorDoneLoading(armor)
        {
            if (_root.func.intCountArmorLoad > 400 || _root.func.IsClipLoaded(armor) && _root.func.IsClipLoaded(armor.head) && _root.func.IsClipLoaded(armor.weapon) && _root.func.IsClipLoaded(armor.shield))
            {
                armor.loaded = true;
                armor.readyweapon = true;
                armor.readyface = true;
                armor.readyshield = true;
                _root.func.intCountArmorLoad = 0;
                return (true);
            }
            else
            {
                ++_root.func.intCountArmorLoad;
                return (false);
            } // end else if
        } // End of the function
        function UseManaAI(monster, intSpellCost, strMagic, strNormal)
        {
            if (_root.monster.intMP >= intSpellCost)
            {
                roll = Math.floor(Math.random() * 3);
                if (roll < 2)
                {
                    _root.monster.intMP = _root.monster.intMP - intSpellCost;
                    _root.func.UpdateStatusBars();
                    monster.gotoAndPlay(strMagic);
                }
                else
                {
                    monster.gotoAndPlay(strNormal);
                } // end else if
            }
            else
            {
                monster.gotoAndPlay(strNormal);
            } // end else if
        } // End of the function
        function MonsterCanCastMagicSpell(monster, intMPCost, intSPCost, intHPCost, intSpellLevel, intSpellElement, bitAllowSuicide)
        {
            rm = _root.monster;
            var _loc2 = new Object();
            _loc2.intSpellCost = intMPCost;
            _loc2.intSpellCostHP = intHPCost;
            _loc2.intSpellCostSP = intSPCost;
            _loc2.intSpellLevel = intSpellLevel;
            _loc2.intSpellElement = intSpellElement;
            _loc2.bitCantCastSpell = false;
            _loc2.bitMayCastSpell = true;
            _loc2.bitAllowSuicide = bitAllowSuicide;
            _loc2.bitBypassLimitsHP = false;
            _loc2.bitBypassLimitsMP = false;
            _loc2.bitBypassLimitsSP = false;
            _root.stat.CanCastSpellMonster(_loc2);
            if (!_loc2.bitCantCastSpell)
            {
                if ((rm.intHP > _loc2.intSpellCostHP || rm.intHP == _loc2.intSpellCostHP && _loc2.bitAllowSuicide) && rm.intMP >= _loc2.intSpellCost && rm.intSP >= _loc2.intSpellCostSP)
                {
                    _loc2.bitMayCastSpell = _loc2.bitMayCastSpell && true;
                }
                else if ((rm.intHP > _loc2.intSpellCostHP || _loc2.bitBypassLimitsHP) && (rm.intMP >= _loc2.intSpellCost || _loc2.bitBypassLimitsMP) && (rm.intSP >= _loc2.intSpellCostSP || _loc2.bitBypassLimitsSP))
                {
                    _loc2.bitMayCastSpell = _loc2.bitMayCastSpell && true;
                }
                else
                {
                    _loc2.bitMayCastSpell = _loc2.bitMayCastSpell && false;
                } // end else if
            }
            else
            {
                _loc2.bitMayCastSpell = _loc2.bitMayCastSpell && false;
            } // end else if
            return (_loc2);
        } // End of the function
        function MonsterCastMagicSpell(monster, intMPCost, intSPCost, intHPCost, intSpellLevel, intSpellElement, bitAllowSuicide, strMagic, strFail)
        {
            rm = _root.monster;
            var _loc2 = new Object();
            _loc2.intSpellCost = intMPCost;
            _loc2.intSpellCostHP = intHPCost;
            _loc2.intSpellCostSP = intSPCost;
            _loc2.intSpellLevel = intSpellLevel;
            _loc2.intSpellElement = intSpellElement;
            _loc2.bitCantCastSpell = false;
            _loc2.bitMayCastSpell = true;
            _loc2.bitAllowSuicide = bitAllowSuicide;
            _loc2.bitBypassLimitsHP = false;
            _loc2.bitBypassLimitsMP = false;
            _loc2.bitBypassLimitsSP = false;
            _root.stat.CastSpellMonster(_loc2);
            if (!_loc2.bitCantCastSpell)
            {
                if ((rm.intHP > _loc2.intSpellCostHP || rm.intHP == _loc2.intSpellCostHP && _loc2.bitAllowSuicide) && rm.intMP >= _loc2.intSpellCost && rm.intSP >= _loc2.intSpellCostSP)
                {
                    _root.func.HealMonsterHP(-_loc2.intSpellCostHP);
                    _root.func.HealMonsterMP(-_loc2.intSpellCost);
                    _root.func.HealMonsterSP(-_loc2.intSpellCostSP);
                    if (_loc2.bitMayCastSpell)
                    {
                        monster.gotoAndPlay(strMagic);
                        return;
                    } // end if
                }
                else if ((rm.intHP > _loc2.intSpellCostHP || _loc2.bitBypassLimitsHP) && (rm.intMP >= _loc2.intSpellCost || _loc2.bitBypassLimitsMP) && (rm.intSP >= _loc2.intSpellCostSP || _loc2.bitBypassLimitsSP))
                {
                    _root.func.HealMonsterHP(-_loc2.intSpellCostHP);
                    _root.func.HealMonsterMP(-_loc2.intSpellCost);
                    _root.func.HealMonsterSP(-_loc2.intSpellCostSP);
                } // end if
            } // end else if
            if (strFail == undefined)
            {
                monster.gotoAndPlay("Idle");
                _root.play();
            }
            else
            {
                monster.gotoAndPlay(strFail);
            } // end else if
        } // End of the function
        function CalcPetAttack(intExtraAttackPercent)
        {
            var _loc2 = _root.player;
            var _loc3 = (_loc2.intPetCharisma - _loc2.intCHA) / 2 + 33;
            var _loc4 = Math.random() * 100 + intExtraAttackPercent;
            return (_loc4 > _loc3);
        } // End of the function
        function CalcGuestAttack(intExtraAttackPercent)
        {
            var _loc2 = 33 - _root.func.Bounds(_root.player.intCHA, 0, 250) / 2;
            var _loc3 = Math.random() * 100 + intExtraAttackPercent;
            return (_loc3 > _loc2);
        } // End of the function
        function ClickAttackButton()
        {
            if (_root.p.status.toLowerCase() != "idle")
            {
                return;
            } // end if
            _root.func.HideAttackMenu();
            _root.player.strLastAttackChoice = "attack";
            if (_root.player.strWeaponSpecialEffect == "none")
            {
                _root.p.gotoAndPlay("Attack");
                _root.play();
            }
            else
            {
                roll = Math.floor(Math.random() * 100) + 1;
                if (roll <= _root.player.intWeaponProcRate)
                {
                    _root.p.gotoAndPlay("Cast");
                    _root.p.weapon.gotoAndPlay(_root.player.strWeaponSpecialEffect);
                    _root.play();
                }
                else
                {
                    _root.p.gotoAndPlay("Attack");
                    _root.play();
                } // end else if
            } // end else if
        } // End of the function
        function AuditStats()
        {
            var _loc2 = _root.player;
            var _loc3 = _loc2.intSTR + _loc2.intDEX + _loc2.intINT + _loc2.intCHA + _loc2.intEND + _loc2.intLUK;
            if (_loc3 >= 3000)
            {
                unloadMovieNum(0);
            } // end if
        } // End of the function
        function BuildVictoryMsg()
        {
            var _loc3 = _root.ProfileMonster.strMonsterState;
            if (_loc3 != undefined && _loc3.length > 0 && _loc3.indexOf("ighting") > 0)
            {
                unloadMovieNum(0);
            } // end if
            var _loc2;
            var _loc4;
            var _loc5;
            var _loc6;
            _loc2 = "";
            _loc4 = _root.monster.intExp;
            _root.func.InspectGuardianData();
            if (_root.player.intLevel < _root.func.MAX_CHARACTER_LEVEL)
            {
                if (_root.player.intCharType > 2)
                {
                    _loc5 = Math****und(_loc4 / 1.100000);
                    _loc6 = _loc4 - _loc5;
                    _loc2 = "+ " + _loc5 + " " + _root.lang.XP + "\n";
                    _loc2 = _loc2 + ("+ " + _loc6 + " " + _root.lang.XP + "\n");
                }
                else
                {
                    _loc2 = "+ " + _loc4 + " " + _root.lang.XP + "\n";
                } // end if
            } // end else if
            _loc2 = _loc2 + ("+ " + _root.monster.intGold + " " + _root.lang.GOLD + "\n");
            _root.strVictoryMSG = "Battle Rewards:\n\n" + _loc2;
        } // End of the function
        function PlayerIsGuardian()
        {
            return (_root.func.CharacterIsGuardian());
        } // End of the function
        function CharacterIsGuardian()
        {
            _root.func.InspectGuardianData();
            return (_root.player.intCharType > 1 && _root.player.intAccessLevel >= 20);
        } // End of the function
        function UserIsGuardian()
        {
            _root.func.InspectGuardianData();
            return (_root.player.intAccessLevel >= 20);
        } // End of the function
        function CharacterIsXGuardian()
        {
            _root.func.InspectGuardianData();
            return (_root.player.intCharType == 3 && _root.player.intAccessLevel >= 20);
        } // End of the function
        function MonsterIsDragonKind()
        {
            return (MatchMonsterCategory("dragon", "drakel", "lizard", "velociraider"));
        } // End of the function
        function MatchMonsterElement(args)
        {
            var _loc3;
            var _loc4;
            var _loc5;
            _loc4 = arguments.length;
            if (_loc4 < 1)
            {
                return;
            } // end if
            _loc5 = _root.monster.strWeaponElement.toLowerCase();
            for (var _loc3 = 0; _loc3 < _loc4; ++_loc3)
            {
                if (_loc5.indexOf(arguments[_loc3].toLowerCase()) != -1)
                {
                    return (true);
                } // end if
            } // end of for
            return (false);
        } // End of the function
        function MatchMonsterName(args)
        {
            var _loc4;
            var _loc3;
            var _loc5;
            _loc4 = arguments.length;
            if (_loc4 < 1)
            {
                return;
            } // end if
            _loc5 = _root.monster.strMonsterName.toLowerCase();
            for (var _loc3 = 0; _loc3 < _loc4; ++_loc3)
            {
                if (_loc5.indexOf(arguments[_loc3].toLowerCase()) != -1)
                {
                    return (true);
                } // end if
            } // end of for
            return (false);
        } // End of the function
        function MatchMonsterCategory(args)
        {
            var _loc4;
            var _loc3;
            var _loc5;
            _loc4 = arguments.length;
            if (_loc4 < 1)
            {
                return;
            } // end if
            _loc5 = _root.monster.strExtraData.toLowerCase();
            for (var _loc3 = 0; _loc3 < _loc4; ++_loc3)
            {
                if (_loc5.indexOf(arguments[_loc3].toLowerCase()) != -1)
                {
                    return (true);
                } // end if
            } // end of for
            return (false);
        } // End of the function
        function MatchStrings(strSource, strArgs)

  3. #3
    Luminescentz's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Location
    Chicago
    Posts
    15
    Reputation
    17
    Thanks
    451
    Code:
    {
            var _loc3;
            var _loc4;
            var _loc2;
            _loc3 = arguments.length;
            if (_loc3 < 2)
            {
                return;
            } // end if
            _loc4 = strSource.toLowerCase();
            for (var _loc2 = 1; _loc2 < _loc3; ++_loc2)
            {
                if (_loc4.indexOf(arguments[_loc2].toLowerCase()) != -1)
                {
                    return (true);
                } // end if
            } // end of for
            return (false);
        } // End of the function
        function LoadUserPreferences()
        {
            _root.user.strUserName = "";
            _root.user.strPassword = "";
            _root.bitSpellRowEnabled = false;
            _root.bitOptionSoundOn = true;
            _root.bitSaveName = false;
            _root.bitSavePassword = false;
            _root.bitShowFrameRate = false;
            var _loc2;
            _loc2 = _root.preferences.data.bitOptionSoundOn;
            if (_loc2 != undefined)
            {
                _root.bitOptionSoundOn = Boolean(_loc2);
            } // end if
            _loc2 = _root.preferences.data.bitOptionMusicOn;
            if (_loc2 != undefined)
            {
                _root.bitOptionMusicOn = Boolean(_loc2);
            } // end if
            _loc2 = _root.preferences.data.bitSpellRowEnabled;
            if (_loc2 != undefined)
            {
                _root.bitSpellRowEnabled = Boolean(_loc2);
            } // end if
            _loc2 = _root.preferences.data.bitShowFrameRate;
            if (_loc2 != undefined)
            {
                _root.bitShowFrameRate = Boolean(_loc2);
            } // end if
            _loc2 = _root.preferences.data.bitAutoQuality;
            if (_loc2 != undefined)
            {
                _root.bitAutoQuality = Boolean(_loc2);
            } // end if
            _loc2 = _root.preferences.data.bitSaveName;
            if (_loc2 != undefined)
            {
                _root.bitSaveName = Boolean(_loc2);
                _root.bitExistingPrefs = true;
            } // end if
            if (_root.bitSaveName)
            {
                _loc2 = _root.preferences.data.strUserName;
                if (_loc2 != undefined)
                {
                    _root.user.strUserName = String(_loc2);
                } // end if
            } // end if
            _loc2 = _root.preferences.data.bitSavePassword;
            if (_loc2 != undefined)
            {
                _root.bitSavePassword = _loc2;
            } // end if
            if (_root.bitSavePassword)
            {
                _loc2 = _root.preferences.data.strPassword;
                if (_loc2 != undefined)
                {
                    _root.user.strPassword = String(_loc2);
                } // end if
            } // end if
        } // End of the function
        function SaveUserPreferences()
        {
            _root.preferences.data.bitSaveName = _root.bitSaveName;
            _root.preferences.data.bitSavePassword = _root.bitSavePassword;
            _root.preferences.data.bitShowFrameRate = _root.bitShowFrameRate;
            _root.preferences.data.bitSpellRowEnabled = _root.bitSpellRowEnabled;
            _root.preferences.data.bitOptionSoundOn = _root.bitOptionSoundOn;
            _root.preferences.data.bitAutoQuality = _root.bitAutoQuality;
            if (_root.bitSaveName)
            {
                _root.preferences.data.strUserName = _root.user.strUserName;
            }
            else
            {
                _root.preferences.data.strUserName = "";
            } // end else if
            if (_root.bitSavePassword)
            {
                _root.preferences.data.strPassword = _root.user.strPassword;
            }
            else
            {
                _root.preferences.data.strPassword = "";
            } // end else if
            _root.preferences.flush();
        } // End of the function
        function LoadGlobalStringsList()
        {
            _root.bStringListLoaded = false;
            _root.cmdStringsList = new Object();
            _root.cmdStringsList.strLastUpdate = _root.dataStringList.strLastUpdate;
            Nj = new _root.XMLNinja();
            Nj.strKey = "swiSsche3se";
            Nj.filename = "strings-load.asp?rnd=" + String(Math.random());
            Nj.source = _root.cmdStringsList;
            Nj.target = _root.dataStringList;
            Nj.onComplete = function ()
            {
                if (_root.dataStringList.status != "error")
                {
                    _root.bStringListLoaded = true;
                    if (_root.dataStringList.status == "empty")
                    {
                        _root.dataStringList.status = "ready";
                    } // end if
                } // end if
                delete _root.cmdStringsList;
                delete Nj;
            };
            Nj.sendAndLoad();
        } // End of the function
        function GString(arg)
        {
            var _loc5;
            var _loc2;
            var _loc3;
            _loc3 = _root.dataStringList.string;
            _loc5 = _loc3.length;
            if (typeof(arg) == "number")
            {
                for (var _loc2 = 0; _loc2 < _loc5; ++_loc2)
                {
                    if (arg == _loc3[_loc2].intId)
                    {
                        return (_loc3[_loc2].strStringValue);
                    } // end if
                } // end of for
            }
            else
            {
                arg = arg.toLowerCase();
                for (var _loc2 = 0; _loc2 < _loc5; ++_loc2)
                {
                    if (arg == _loc3[_loc2].strStringCaption.toLowerCase())
                    {
                        return (_loc3[_loc2].strStringValue);
                    } // end if
                } // end of for
            } // end else if
        } // End of the function
        function TitleCase(strString)
        {
            strString = strString.toLowerCase();
            var _loc3 = strString.substring(0, 1).toUpperCase();
            return (_root.func.CharSetAt(strString, 0, _loc3));
        } // End of the function
        function ArrayPick(arr)
        {
            if (arr.length == undefined)
            {
                return (0);
            } // end if
            return (arr[Math.floor(Math.random() * arr.length)]);
        } // End of the function
        function ArrayShuffle(arr)
        {
            if (arr.length == undefined || arr.length < 2)
            {
                return;
            } // end if
            var _loc3;
            var _loc2;
            for (var _loc2 = 0; _loc2 < arr.length * 4; ++_loc2)
            {
                a = Math.floor(Math.random() * arr.length);
                b = Math.floor(Math.random() * arr.length);
                _loc3 = arr[a];
                arr[a] = arr[b];
                arr[b] = _loc3;
            } // end of for
        } // End of the function
        function IsShopSafe()
        {
            return (_level1 == undefined && _level2 == undefined && _level100 == undefined);
        } // End of the function
        function InspectGuardianData()
        {
            if (typeof(_root.player.intCharType) == "string")
            {
                _root.player.intCharType = 1;
            } // end if
            if (typeof(_root.player.intAccessLevel) == "string")
            {
                _root.player.intAccessLevel = 0;
            } // end if
        } // End of the function
        function SetGraphicsQuality(strQ)
        {
            _root._quality = strQ;
            _root.strBattleQuality = strQ;
            _root.ProfilePlayer.optionsQuality.gotoAndPlay(1);
        } // End of the function
        function AutoSetQuality(intFPS)
        {
            var _loc3 = 5;
            var _loc2 = 30 + _root.player.intCounterCurrentRound * 10;
            if (_root._quality == "HIGH")
            {
                if (intFPS < 9)
                {
                    ++intQAdjustLower;
                } // end if
                if (intQAdjustLower > _loc3)
                {
                    _root.func.SetGraphicsQuality("MEDIUM");
                    intQAdjustLower = 0;
                } // end if
            }
            else if (_root._quality == "MEDIUM")
            {
                if (intFPS < 9)
                {
                    ++intQAdjustLower;
                } // end if
                if (intFPS > 11)
                {
                    ++intQAdjustHigher;
                } // end if
                if (intQAdjustLower > _loc3)
                {
                    _root.func.SetGraphicsQuality("LOW");
                    intQAdjustLower = 0;
                } // end if
                if (intQAdjustHigher > _loc2 || intQAdjustHigher > 8 && _root.status == "ready")
                {
                    _root.func.SetGraphicsQuality("HIGH");
                    intQAdjustHigher = 0;
                } // end if
            }
            else
            {
                if (intFPS > 11)
                {
                    ++intQAdjustHigher;
                } // end if
                if (intQAdjustHigher > _loc2 || intQAdjustHigher > 4 && _root.status == "ready")
                {
                    _root.func.SetGraphicsQuality("MEDIUM");
                    intQAdjustHigher = 0;
                } // end else if
            } // end else if
        } // End of the function
        function MessageLog(m)
        {
        } // End of the function
        function VerifyDisplayData(clip)
        {
            rp = _root.player;
            if (clip != undefined)
            {
                clip.play();
            } // end if
        } // End of the function
        function SeedRand(s)
        {
            this.seed = s;
        } // End of the function
        function SaveBuildingUpgrade()
        {
            _root.func.cmdUpgrade = new Object();
            _root.func.cmdUpgrade.intBuildId = _root.player.intBuildingId;
            _root.func.cmdUpgrade.intBuildPlot = _root.player.intPlotId;
            _root.func.cmdUpgrade.intExtraNum = 0;
            N = new _root.XMLNinja();
            N.filename = "house-estate-upgrade.asp";
            N.source = _root.func.cmdUpgrade;
            N.target = _root.func.cmdUpgrade;
            N.onComplete = function ()
            {
                if (_root.func.cmdUpgrade.status == "error")
                {
                    _root.msg.Show("Error Upgrading Building", 4);
                } // end if
                _root.town.play();
            };
            N.prepareAuthVars();
            N.sendAndLoad();
        } // End of the function
        var GAME_VERSION = 36.020000;
        var MAX_SLOTS = 8;
        var MAX_CHARACTER_LEVEL;
        var roll;
        var damage;
        var Damage;
        var strCurrentAttackStat = "intHP";
        var intActualAttackDamage = 0;
        var strCurrentAttackElement = "Fire";
        var intTime_BattleStart = 0;
        var intBattleStretch = 0;
        var intTime_BattleEnd = 0;
        var bitLuckyAttack = false;
        var objDefaultNoDropWeapon;
        var objDefaultNoDropShield;
        var objDefaultNoDropArmor;
        var objNoneShield;
        var bInitiativeWasDetermined = false;
        AttackInfo.prototype.ApplyCombatBonuses = function ()
        {
            _root.town.CombatBonus(this);
            _root.walk.CombatBonus(this);
            _root.background.CombatBonus(this);
            _root.pet.CombatBonus(this);
            _root.guest.CombatBonus(this);
            _root.m.CombatBonus(this);
            _root.p.CombatBonus(this);
            _root.p.weapon.CombatBonus(this);
            _root.p.shield.CombatBonus(this);
            _root.miscitem.CombatBonus(this);
            _root.p.head.CombatBonus(this);
            _root.spell.CombatBonus(this);
            _root.effects.CombatBonus(this);
            _root.CombatBonus(this);
            _root.stat.CombatBonus(this);
        };
        AttackInfo.prototype.AfterResolve = function ()
        {
            _root.town.AfterAttack(this);
            _root.walk.AfterAttack(this);
            _root.background.AfterAttack(this);
            _root.pet.AfterAttack(this);
            _root.guest.AfterAttack(this);
            _root.m.AfterAttack(this);
            _root.p.AfterAttack(this);
            _root.p.weapon.AfterAttack(this);
            _root.p.shield.AfterAttack(this);
            _root.miscitem.AfterAttack(this);
            _root.p.head.AfterAttack(this);
            _root.spell.AfterAttack(this);
            _root.effects.AfterAttack(this);
            _root.AfterAttack(this);
            _root.stat.AfterAttack(this);
        };
        AttackInfo.prototype.BeforeResolve = function ()
        {
            _root.town.BeforeAttack(this);
            _root.walk.BeforeAttack(this);
            _root.background.BeforeAttack(this);
            _root.pet.BeforeAttack(this);
            _root.guest.BeforeAttack(this);
            _root.m.BeforeAttack(this);
            _root.p.BeforeAttack(this);
            _root.p.weapon.BeforeAttack(this);
            _root.p.shield.BeforeAttack(this);
            _root.miscitem.BeforeAttack(this);
            _root.p.head.BeforeAttack(this);
            _root.spell.BeforeAttack(this);
            _root.effects.BeforeAttack(this);
            _root.BeforeAttack(this);
            _root.stat.BeforeAttack(this);
        };
        AttackInfo.prototype.Estimate = function ()
        {
            this.attacker = this.attacker.toLowerCase();
            this.defender = this.defender.toLowerCase();
            if (this.weapontype != "")
            {
                if (this.defender == "player")
                {
                    this.tohit = eval("_root.player.intThaco" + this.weapontype.toUpperCase());
                }
                else if (this.defender == "monster")
                {
                    this.tohit = eval("_root.monster.intArmor" + this.weapontype.toUpperCase());
                } // end if
            } // end else if
            if (this.tohit == undefined)
            {
                this.tohit = 100;
            } // end if
            this.EstimatedAttack = _root.func.PredictAttack(this);
        };
        AttackInfo.prototype.Attack = function ()
        {
            this.attacker = this.attacker.toLowerCase();
            this.defender = this.defender.toLowerCase();
            this.ApplyCombatBonuses();
            if (this.weapontype != "")
            {
                if (this.defender == "player")
                {
                    this.tohit = eval("_root.player.intThaco" + this.weapontype.toUpperCase());
                }
                else if (this.defender == "monster")
                {
                    this.tohit = eval("_root.monster.intArmor" + this.weapontype.toUpperCase());
                } // end if
            } // end else if
            if (this.tohit == undefined)
            {
                this.tohit = 100;
            } // end if
            _root.func.ResolveAttack(this);
        };
        var intCountArmorLoad = 0;
        var intQAdjustLower;
        var intQAdjustHigher;
        intQAdjustLower = 0;
        intQAdjustHigher = 0;
        SeedRand.prototype.gen = function ()
        {
            return (this.seed = this.seed * 16807 % 2147483647);
        };
        SeedRand.prototype.nextInt = function ()
        {
            return (this.gen());
        };
        SeedRand.prototype.nextDouble = function ()
        {
            return (this.gen() / 2147483647);
        };
        SeedRand.prototype.nextIntRange = function (min, max)
        {
            min = min - 0.499900;
            max = max + 0.499900;
            return (Math****und(min + (max - min) * this.nextDouble()));
        };
        SeedRand.prototype.SeedRand.nextDoubleRange = function (min, max)
        {
            return (min + (max - min) * this.nextDouble());
        };
    }
    
    // [onClipEvent of sprite 169 in frame 1]
    onClipEvent (load)
    {
        var CID;
        var strSessionId;
        var intLevel;
        var strMonsterName;
        var MonsterID;
        var strResolution;
        var intUserId;
        var strUserName;
        var strPassword;
        var charid;
    }
    
    // [onClipEvent of sprite 163 in frame 1]
    onClipEvent (load)
    {
        function HitTracking()
        {
            this.createEmptyMovieClip("m1", 2);
            m1.loadMovie("http://server.cpmstar.com/action.aspx?advertiserid=9&gif=1");
            this.createEmptyMovieClip("m2", 3);
            m2.loadMovie("http://www.battleon.com/clickupgrade.asp");
            this.createEmptyMovieClip("m3", 4);
            m3.loadMovie("http://stats.adbrite.com/stats/stats.gif?_cpid=conversion&_uid=130893");
        } // End of the function
        function SignupFirstLoginTracking()
        {
            this.createEmptyMovieClip("m4", 5);
            m4.loadMovie("http://server.cpmstar.com/action.aspx?advertiserid=78&gif=1");
        } // End of the function
    }
    
    // [onClipEvent of sprite 171 in frame 1]
    onClipEvent (load)
    {
        function InitQuestData()
        {
            var _loc2 = _root.player;
            _loc2.arrayQuestData = new Array(_loc2.strQuest, _loc2.strQuest2);
            _root.quest.InitAlignment();
        } // End of the function
        function GetQuestValue(intSetNum, intQuestNum)
        {
            var _loc1 = GetQuestData(intSetNum, intQuestNum);
            return (parseInt(_loc1, 36));
        } // End of the function
        function SetQuestValue(intSetNum, intQuestNum, intValue)
        {
            var _loc1 = intValue.toString(36);
            SetQuestData(intSetNum, intQuestNum, _loc1);
        } // End of the function
        function GetQuestData(intSetNum, intQuestNum)
        {
            var _loc2 = _root.player.arrayQuestData[intSetNum];
            return (_loc2.charAt(intQuestNum));
        } // End of the function
        function SetQuestData(intSetNum, intQuestNum, strCharValue)
        {
            var _loc3;
            var _loc2;
            _loc3 = String(strCharValue);
            if (_loc3.length != 1)
            {
                return;
            } // end if
            _loc2 = _root.player.arrayQuestData[intSetNum];
            _loc2 = _root.func.CharSetAt(_loc2, intQuestNum, _loc3);
            _root.player.arrayQuestData[intSetNum] = _loc2;
        } // End of the function
        function SaveQuestData(intSetNum)
        {
            _root.quest.strQuest = _root.player.arrayQuestData[intSetNum];
            _root.quest.intQuestSetNum = intSetNum;
            _root.quest.status = "saving";
            _root.quest.SaveQuestDataVars();
        } // End of the function
        function SaveQuestDataVars()
        {
            V = new LoadVars();
            V.charid = _root.user.charid;
            V.strUserName = _root.user.strUserName;
            V.strPassword = _root.user.strPassword;
            V.strQuest = _root.quest.strQuest;
            V.intQuestSetNum = _root.quest.intQuestSetNum;
            V.onLoad = function (bSuccess)
            {
                var _loc3 = _root.quest;
                if (!bSuccess)
                {
                    if (_loc3.numRetries < 3)
                    {
                        ++_loc3.numRetries;
                        _loc3.status = "retry";
                        _loc3.SaveQuestDataVars();
                    }
                    else
                    {
                        _loc3.status = "web-error";
                        _loc3.numRetries = 0;
                    } // end else if
                }
                else if (this.status == "success")
                {
                    _loc3.status = "success";
                    _loc3.numRetries = 0;
                }
                else
                {
                    _loc3.status = "game-error";
                    _loc3.numRetries = 0;
                } // end else if
            };
            V.sendAndLoad("SaveQuestData2.asp?rnd=" + String(Math.random()), V, "POST");
        } // End of the function
        function ShowPlayerIntro()
        {
            _root.p._visible = true;
            _root.p.gotoAndPlay("Intro");
        } // End of the function
        function HidePlayer()
        {
            _root.p._visible = false;
            _root.p.gotoAndStop("Ready");
        } // End of the function
        function ShowPlayerIdle()
        {
            _root.p._visible = true;
            _root.p.gotoAndPlay("Idle");
        } // End of the function
        function ShowPlayer(strLabel)
        {
            _root.p._visible = true;
            if (strLabel != "")
            {
                _root.p.gotoAndPlay(strLabel);
            } // end if
        } // End of the function
        function ReturnToTown()
        {
            HidePlayer();
            _root.func.LoadTownFile(_root.player.strTown);
        } // End of the function
        function HideGuest()
        {
            _root.guest.gotoAndPlay("OffScreen");
            _root.guest._visible = false;
        } // End of the function
        function HidePet()
        {
            _root.pet.gotoAndPlay("OffScreen");
            _root.pet._visible = false;
        } // End of the function
        function RemoveGuest()
        {
            _root.guest.gotoAndPlay("OffScreen");
            _root.guest._visible = false;
            root.player.strGuest = "none";
        } // End of the function
        function MonsterEncounter(intMonsterId, intQuantity, bUseMonsterBackground, intElementId)
        {
            var _loc2 = _root.quest.MakeBattle();
            _loc2.id = intMonsterId;
            if (intQuantity != undefined)
            {
                _loc2.quantity = intQuantity;
            } // end if
            if (bUseMonsterBackground != undefined)
            {
                _loc2.background = bUseMonsterBackground;
            } // end if
            if (intElementId != undefined)
            {
                _loc2.element = intElementId;
            } // end if
            var _loc3 = _root.strSpecialMonsterName;
            if (_loc3 != undefined && _loc3 != "")
            {
                _loc2.monstername = _loc3;
                _root.strSpecialMonsterName = "";
            } // end if
            _loc3 = _root.strSpecialMonsterDesc;
            if (_loc3 != undefined && _loc3 != "")
            {
                _loc2.monsterdesc = _loc3;
                _root.strSpecialMonsterDesc = "";
            } // end if
            _loc2.Battle();
        } // End of the function
        function GivePotionHP(intNum)
        {
            var _loc2 = _root.player;
            _loc2.intPotionHealth = _root.func.Bounds(_loc2.intPotionHealth + Math.floor(Number(intNum)), 0, _root.quest.MAX_POTIONS_HP);
        } // End of the function
        function GivePotionMP(intNum)
        {
            var _loc2 = _root.player;
            _loc2.intPotionMana = _root.func.Bounds(_loc2.intPotionMana + Math.floor(Number(intNum)), 0, _root.quest.MAX_POTIONS_MP);
        } // End of the function
        function GivePotionPurple(intNum)
        {
            var _loc2 = _root.player;
            _loc2.intPotionPurple = _root.func.Bounds(_loc2.intPotionPurple + Math.floor(Number(intNum)), 0, 50);
        } // End of the function
        function RefillPotionHP()
        {
            var _loc2 = _root.player;
            _loc2.intPotionHealth = Math.max(_loc2.intPotionHealth, _loc2.intRefillPotionHP);
        } // End of the function
        function RefillPotionMP()
        {
            var _loc2 = _root.player;
            _loc2.intPotionMana = Math.max(_loc2.intPotionMana, _loc2.intRefillPotionMP);
        } // End of the function
        function BattleInfo()
        {
            this.id = 0;
            this.element = 0;
            this.terrain = "";
            this.quantity = 1;
            this.background = false;
            this.scale = false;
            this.fodder = false;
            this.monstername = "";
            this.monsterdesc = "";
            this.zone = 0;
            this.mode = "";
            this.cat = "";
        } // End of the function
        function MakeBattle()
        {
            return (new _root.quest.BattleInfo());
        } // End of the function
        function LoadTownFile(strTownFileName, bSetHomeTown)
        {
            _root.func.LoadTownFile(strTownFileName, bSetHomeTown);
        } // End of the function
        function UpdateZone(intZone, intCount, intMax)
        {
            if (_root.zones[intZone] == undefined)
            {
                _root.zones[intZone] = new Object();
            } // end if
            _root.zones[intZone].intCount = Number(intCount);
            _root.zones[intZone].intMax = Number(intMax);
        } // End of the function
        function LoadZone(intZone, target)
        {
            if (_root.zones[intZone] == undefined)
            {
                _root.zones[intZone] = new Object();
            } // end if
            LZ = new LoadVars();
            LZ.zone = intZone;
            LZ.onLoad = function (bSuccess)
            {
                if (this.status == "success")
                {
                    _root.zones[intZone].intCount = Number(this.intCount);
                    _root.zones[intZone].intMax = Number(this.intMax);
                } // end if
                _root.town.play();
            };
            LZ.sendAndLoad("loadzone.asp", LZ, "POST");
        } // End of the function
        var MAX_POTIONS_HP;
        var MAX_POTIONS_MP;
        _root.zones = new Array();
        BattleInfo.prototype.Battle = function ()
        {
            if (this.scale && this.id < 1)
            {
                this.scale = false;
            } // end if
            this.quantity = _root.func.Bounds(this.quantity, 1, 4);
            this.element = _root.func.Bounds(this.element, 0, 8);
            _root.MonsterId = this.id;
            _root.bitLoadGenericPack = this.quantity > 1;
            _root.intPackQuantity = this.quantity;
            if (this.background)
            {
                _root.town.encounterbackground = "yes";
            }
            else
            {
                _root.town.encounterbackground = "no";
            } // end else if
            _root.objCurrentBattleInfo = this;
            _root.gotoAndPlay("RandomEncounter");
        };
    }
    
    // [onClipEvent of sprite 417 in frame 9]
    onClipEvent (load)
    {
        function VarsLoaded(strStatus)
        {
            if (_root.login.action == "loadchar")
            {
                if (strStatus == "error")
                {
                    _root.login.gotoAndStop("WebError");
                    _root.msg.Show(_root.player.msg);
                    return;
                } // end if
                if (strStatus == "unknown")
                {
                    _root.login.gotoAndStop("Error");
                    return;
                } // end if
                if (strStatus == "success")
                {
                    _root.login.action = "done";
                    _root.func.PrepareLoadedCharacter();
                } // end if
            } // end if
            if (_root.player.actiontype == "loadequipment")
            {
                if (strStatus == "success")
                {
                    _root.func.ConvertData("player");
                    _root.func.ClearInvalidInventory();
                    arrLoginEquipNums = _root.func.GetLoginEquipmentNums();
                    _root.player.intActiveWeapon = arrLoginEquipNums[1];
                    _root.func.SetActiveWeapon();
                    _root.player.intActiveShield = arrLoginEquipNums[2];
                    _root.func.SetActiveShield();
                    _root.func.EquipArmorNum(arrLoginEquipNums[0]);
                    _root.func.EquipPetNum(1);
                    _root.func.UnloadMisc();
                }
                else
                {
                    _root.msg.Show("Error refreshing equipment list");
                } // end else if
                _root.player.actiontype = "loadequipmentdone";
                _root.shop.DoneRefreshingEquipment();
            } // end if
        } // End of the function
    }
    
    // [onClipEvent of sprite 462 in frame 51]
    onClipEvent (load)
    {
        this._visible = false;
    }
    
    // [onClipEvent of sprite 505 in frame 94]
    onClipEvent (construct)
    {
        attacker = "monster";
    }
    
    // [onClipEvent of sprite 505 in frame 94]
    onClipEvent (construct)
    {
        attacker = "player";
    }
    
    // [onClipEvent of sprite 462 in frame 94]
    onClipEvent (load)
    {
        this._visible = _root.bitShowFrameRate;
    }
    
    // [onClipEvent of sprite 508 in frame 94]
    onClipEvent (construct)
    {
        attacker = "monster";
    }
    
    // [onClipEvent of sprite 508 in frame 94]
    onClipEvent (construct)
    {
        attacker = "player";
    }
    
    // [Action in Frame 1]
    _accProps = new Object();
    _accProps.silent = true;
    
    // [Action in Frame 2]
    if (_root.strLanguage == "english" || _root.strLanguage == "")
    {
        _root.lang = new Array();
        lang.XP = "XP";
        lang.GOLD = "GOLD";
        lang.TOKENS = "TOKENS";
        lang[0] = "blank";
        lang[1] = "Need ";
        lang[2] = "Health";
        lang[3] = "Mana";
        lang[4] = "Your foe is immune to freeze effects!";
        lang[5] = "Your foe resists the freezing attack!";
        lang[6] = "Your foe is immune to paralyzing attacks!";
        lang[7] = "Your foe resists the paralyzing attack!";
        lang[8] = "Found ";
        lang[9] = "You run from the battle.";
        lang[10] = "You have been defeated!";
        lang[11] = "There has been an error while saving the battle outcome.\n\nThe game server may be running slow right now, and failed to respond in time.";
        lang[12] = "Sorry! There was an error while loading the battle data.\n\nThe game server may be running very slow right now. Click Next to return to town.";
        lang[13] = "The Blue Scroll of Doom";
        lang[14] = "The game has detected that you are playing in more than one browser window using the same character.\n\nPlease close this browser session and continue playing in the other window.  Or close all browsers and login again from the home page.";
        lang[15] = "You are now level ";
        lang[16] = "Element Modifier";
        lang[17] = "Combat Defense";
        lang[18] = "Attributes";
        lang[19] = "Information";
        lang[20] = "Equipment";
        lang[21] = "Description";
        lang[22] = "Today\'s adventure will place you against powerful foes and challenging quests!  Please enter your login information.";
        lang[23] = "Please go back and re-enter your login information.  Your username and password will be in the email that was sent to you when you created your account.";
        lang[24] = "Account not found!";
        lang[25] = "Wrong Password!";
        lang[26] = "You are currently not able to log into the server.  Please read the web page that just opened for more information.";
        lang[27] = "An unknown error has occurred while processing the login.\n\nThe game database may be offline or having problems.  There could also be a web communiction problem between your computer and the game web server.\n\nTry going back and log in again.";
        lang[28] = "Processing Error";
        lang[29] = "A web page error has occurred while processing the login.\n\nThe game database may be down or the web server is very busy right now. \n\nThere could also be a communiction problem between your computer and the game web server.\n\nTry going back and log in again.";
        lang[30] = "Password:";
        lang[31] = "Username:";
        lang[32] = "Are you sure you want to erase this character? It will be gone forever if you enter your password and say yes.";
        lang[33] = "Delete Character";
        lang[34] = "Welcome!";
        lang[35] = "Are you sure you want to retreat from this battle?\n\nMonster Flee Cost: ";
        lang[36] = "You do not have enough skill points (SP) to run from the battle yet.\n\nMonster Flee Cost: ";
        _root.lang.statNames = new Array("Strength", "Dexterity", "Intellect", "Endurance", "Charisma", "Luck");
        _root.lang.statAbbrev = new Array("STR", "DEX", "INT", "END", "CHR", "LUK");
        _root.lang.attackNames = new Array("Melee", "Ranged", "Magic");
        _root.lang.elementNames = new Array("Void", "Fire", "Water", "Earth", "Ice", "Wind", "Energy", "Light", "Darkness");
        _root.lang.attackMenu = new Array("Attack", "Spells", "Items", "Weapons", "Shields", "Armor", "Pets", "Cancel", "Flee", "Armor Skills", "Guests", "Skills & Techs", "Gauntlets", "Battlesuits", "Battlesuit Skills");
    }
    else if (_root.strLanguage == "deutsche")
    {
        _root.lang = new Array();
        lang.XP = "XP";
        lang.GOLD = "GOLD";
        lang.TOKENS = "TOKENS";
        lang[0] = "blank";
        lang[1] = "Need ";
        lang[2] = "Health";
        lang[3] = "Mana";
        lang[4] = "Your foe is immune to freeze effects!";
        lang[5] = "Your foe resists the freezing attack!";
        lang[6] = "Your foe is immune to paralyzing attacks!";
        lang[7] = "Your foe resists the paralyzing attack!";
        lang[8] = "Found ";
        lang[9] = "You run from the battle.";
        lang[10] = "You have been defeated!";
        lang[11] = "There has been an error while saving the battle outcome.\n\nThe game server may be running slow right now, and failed to respond in time.";
        lang[12] = "Sorry! There was an error while loading the battle data.\n\nThe game server may be running very slow right now. Click Next to return to town.";
        lang[13] = "The Blue Scroll of Doom";
        lang[14] = "The game has detected that you are playing in more than one browser window using the same character.\n\nPlease close this browser session and continue playing in the other window.  Or close all browsers and login again from the home page.";
        lang[15] = "You are now level ";
        lang[16] = "Elements";
        lang[17] = "Kampfverteidigung";
        lang[18] = "Attribute";
        lang[19] = "Informationen";
        lang[20] = "Ausrüstung";
        lang[21] = "Beschreibung";
        lang[22] = "Today\'s adventure will place you against powerful monsters and challenging quests!  Please enter your login information.";
        lang[23] = "Please go back and re-enter your login information.  Your Benutzername and Passwort will be in the email that was sent to you when you created your account.";
        lang[24] = "Konto nicht gefunden!";
        lang[25] = "Falsches Passwort";
        lang[26] = "You are currently not able to log into the server.  Please read the web page that just opened for more information.";
        lang[27] = "An unknown error has occurred while processing the login.\n\nThe game database may be offline or having problems.  There could also be a web communiction problem between your computer and the game web server.\n\nTry going back and log in again.";
        lang[28] = "Processing Error";
        lang[29] = "A web page error has occurred while processing the login.\n\nThe game database may be down or the web server is very busy right now. \n\nThere could also be a communiction problem between your computer and the game web server.\n\nTry going back and log in again.";
        lang[30] = "Passwort:";
        lang[31] = "Benutzername:";
        lang[32] = "Are you sure you want to erase this character? It will be gone forever if you enter your passwort and say yes.";
        lang[33] = "Löschung Charakter:";
        lang[34] = "Willkommen!";
        lang[35] = "Are you sure you want to Fliehen from this battle?\n\nMonster Fliehen Cost: ";
        lang[36] = "You do not have enough skill points (SP) to run from the battle yet.\n\nMonster Fliehen Cost: ";
        _root.lang.statNames = new Array("Stärke", "Geschick", "Intellekt", "Ausdauer", "Charisma", "Glück");
        _root.lang.statAbbrev = new Array("STR", "GES", "INT", "ASD", "CHR", "GLK");
        _root.lang.attackNames = new Array("Nahkampf", "Fernkampf", "Magie");
        _root.lang.elementNames = new Array("Lücke", "Feuer", "Wasser", "Erde", "Eis", "Wind", "Energie", "Licht", "Dunkelheit");
        _root.lang.attackMenu = new Array("Angriff", "Zaubern", "Gegenstände", "Waffen", "Schilde", "Rüstung", "Haustiere", "Abbrechen", "Fliehen", "Armor Skills", "Skills & Techs", "Gauntlets", "Battlesuits", "Battlesuit Skills");
    } // end else if
    _root.XMLNinja = function ()
    {
        this.strName = "Ninja!";
        this.objSourceXML = new XML();
        this.objSourceXML.ignoreWhite = true;
        this.objReturnXML = new XML();
        this.objReturnXML.ignoreWhite = true;
        this.source = {};
        this.target = {};
        this.createNew = false;
        this.filename = "nowhere.asp";
        this.strDebug = "";
        this.bTotalEncryption = true;
        this.strKey = "ZorbakOwnsYou";
        this.onComplete = function ()
        {
            this.strDebug = this.strDebug + ("ninja: status=" + this.target.status + "\n");
        };
    };
    _root.XMLNinja.prototype.onLoad = function (bSuccess)
    {
        this.strDebug = this.strDebug + "ninja: onLoad handler\n";
        if (bSuccess)
        {
            if (this.firstChild.nodeName == "ninja3")
            {
                var _loc4 = _root.Decrypt3(this.firstChild.firstChild.nodeValue, this.ninja.strKey + "NJA");
                var _loc3 = new XML(_loc4);
                this.ninja.target = _loc3.XMLtoObject(_loc3.firstChild, this.ninja.target);
            }
            else if (this.firstChild.nodeName == "ninja2")
            {
                _loc4 = _root.Decrypt2(this.firstChild.firstChild.nodeValue, this.ninja.strKey);
                _loc3 = new XML(_loc4);
                this.ninja.target = _loc3.XMLtoObject(_loc3.firstChild, this.ninja.target);
            }
            else
            {
                this.ninja.target = this.XMLtoObject(this.firstChild, this.ninja.target);
            } // end else if
            this.ninja.onComplete();
        }
        else
        {
            this.ninja.target.status = "error";
            this.ninja.target.message = "Connection to Game Server Failed";
            this.ninja.onComplete();
        } // end else if
    };
    _root.XMLNinja.prototype.load = function ()
    {
        this.strDebug = this.strDebug + "ninja: Loading Data\n";
        if (this.createNew)
        {
            this.target = new Object();
        } // end if
        this.objReturnXML = new XML();
        this.objReturnXML.ignoreWhite = true;
        this.objReturnXML.ninja = this;
        this.objReturnXML.onLoad = this.onLoad;
        this.objReturnXML.load(this.filename);
    };
    _root.XMLNinja.prototype.prepareAuthVars = function ()
    {
        if (this.source == undefined)
        {
            return;
        } // end if
        this.source.intCharacterId = _root.player.idLore_Characters;
        this.source.intUserId = _root.user.intUserId;
        this.source.strPassword = _root.user.strPassword;
        this.source.strSessionId = _root.user.strSessionId;
    };
    _root.XMLNinja.prototype.sendAndLoad = function ()
    {
        this.strDebug = this.strDebug + "ninja: Sending/Loading Data\n";
        if (this.createNew)
        {
            this.target = new Object();
        } // end if
        if (this.bTotalEncryption == true)
        {
            var _loc5;
            var _loc6;
            var _loc3;
            var _loc4;
            _loc5 = new XML();
            _loc6 = _loc5.ObjectToXml(this.source, "flash", false);
            _loc3 = _root.Encrypt3(_loc6.toString(), this.strKey + "NJA");
            this.objSourceXML = new XML("<ninja3>");
            this.objSourceXML.ignoreWhite = true;
            _loc4 = this.objSourceXML.createTextNode(_loc3);
            this.objSourceXML.firstChild.appendChild(_loc4);
        }
        else
        {
            _loc5 = new XML();
            this.objSourceXML = _loc5.ObjectToXml(this.source, "flash", true);
        } // end else if
        this.objReturnXML = new XML();
        this.objReturnXML.ignoreWhite = true;
        this.objReturnXML.ninja = this;
        this.objReturnXML.onLoad = this.onLoad;
        this.objSourceXML.sendAndLoad(this.filename, this.objReturnXML);
    };
    XML.prototype.ObjectToXml = function (obj, _xml, bEncryptValues)
    {
        var _loc6;
        var _loc4;
        var _loc5;
        var _loc8;
        _xml = new XML("<" + _xml + ">");
        for (var _loc10 in obj)
        {
            _loc6 = typeof(obj[_loc10]);
            if (_loc6 == "function")
            {
                continue;
            } // end if
            if (_loc6 == "object")
            {
                var _loc7 = _xml.ObjectToXml(obj[_loc10], _loc10);
                _xml.firstChild.appendChild(_loc7);
                continue;
            } // end if
            _loc4 = _xml.createElement(_loc10);
            if (bEncryptValues)
            {
                _loc4.attributes.enc = "1";
                _loc8 = _root.Encrypt1(String(obj[_loc10]));
                _loc5 = _xml.createTextNode(_loc8);
            }
            else
            {
                _loc5 = _xml.createTextNode(String(obj[_loc10]));
            } // end else if
            _loc4.appendChild(_loc5);
            _xml.firstChild.appendChild(_loc4);
        } // end of for...in
        return (_xml);
    };
    XML.prototype.XMLtoObject = function (xObj, obj)
    {
        var _loc10;
        var _loc7;
        var _loc4;
        var _loc5;
        var _loc9;
        var _loc8;
        var _loc13;
        var _loc11;
        var _loc12;
        if (xObj == null)
        {
            xObj = this;
        } // end if
        if (obj == null)
        {
            obj = {};
        } // end if
        for (var _loc10 in xObj.attributes)
        {
            obj[_loc10] = xObj.attributes[_loc10];
        } // end of for...in
        _loc12 = xObj.nodeName;
        _loc11 = "string";
        if (_loc12.substr(0, 3).toLowerCase() == "int")
        {
            _loc11 = "number";
        } // end if
        if (_loc12.substr(0, 2).toLowerCase() == "id")
        {
            _loc11 = "number";
        } // end if
        if (xObj.childNodes.length == 0)
        {
            if (_loc11 == "string")
            {
                obj = "";
            }
            else
            {
                obj = 0;
            } // end if
        } // end else if
        for (var _loc7 in xObj.childNodes)
        {
            _loc5 = xObj.childNodes[_loc7].nodeName;
            _loc9 = xObj.childNodes[_loc7].nodeType;
            _loc8 = xObj.childNodes[_loc7].nodeValue;
            if (_loc9 == 3)
            {
                if (obj.enc == "1")
                {
                    _loc8 = _root.Decrypt1(_loc8);
                } // end if
                if (obj.array == "1")
                {
                    obj = String(_loc8).split(",");
                    if (_loc11 == "string")
                    {
                        for (var _loc4 in obj)
                        {
                            obj[_loc4] = String(obj[_loc4]);
                        } // end of for...in
                    }
                    else
                    {
                        for (var _loc4 in obj)
                        {
                            obj[_loc4] = Number(obj[_loc4]);
                        } // end of for...in
                    } // end else if
                }
                else if (_loc11 == "string")
                {
                    obj = String(_loc8);
                }
                else
                {
                    obj = Number(_loc8);
                } // end else if
            } // end else if
            if (_loc9 == 1 && _loc5 != null)
            {
                if (obj[_loc5] == null)
                {
                    obj[_loc5] = this.XMLtoObject(xObj.childNodes[_loc7], {});
                }
                else if (obj[_loc5]._type != "array")
                {
                    obj[_loc5] = [obj[_loc5]];
                    obj[_loc5]._type = "array";
                } // end else if
                if (obj[_loc5]._type == "array")
                {
                    obj[_loc5].unshift(this.XMLtoObject(xObj.childNodes[_loc7], {}));
                } // end if
            } // end if
        } // end of for...in
        return (obj);
    };
    _root.Encrypt3 = function (theText, strK)
    {
        var _loc3;
        var _loc1;
        var _loc8;
        var _loc2;
        var _loc4;
        var _loc5;
        _loc3 = new String();
        _loc4 = theText.length;
        _loc5 = strK.length;
        for (var _loc1 = 0; _loc1 < _loc4; ++_loc1)
        {
            _loc2 = strK.charCodeAt(_loc1 % _loc5);
            _loc3 = _loc3 + (theText.charCodeAt(_loc1) + _loc2).toString(32);
        } // end of for
        return (_loc3);
    };
    _root.Encrypt2 = function (theText, strK)
    {
        var _loc4;
        var _loc1;
        var _loc2;
        var _loc3;
        var _loc5;
        var _loc6;
        _loc4 = new String();
        _loc5 = theText.length;
        _loc6 = strK.length;
        for (var _loc1 = 0; _loc1 < _loc5; ++_loc1)
        {
            _loc2 = Math.floor(Math.random() * 66) + 33;
            _loc3 = strK.charCodeAt(_loc1 % _loc6);
            _loc4 = _loc4 + ((theText.charCodeAt(_loc1) + _loc2 + _loc3).toString(30) + _loc2.toString(30));
        } // end of for
        return (_loc4);
    };
    _root.Decrypt3 = function (theText, strK)
    {
        var _loc4;
        var _loc1;
        var _loc5;
        var _loc6;
        var _loc3;
        var _loc2;
        var _loc9;
        _loc4 = new String();
        _loc5 = theText.length;
        _loc6 = strK.length;
        for (var _loc1 = 0; _loc1 < _loc5; _loc1 = _loc1 + 2)
        {
            _loc3 = parseInt(theText.substr(_loc1, 2), 32);
            _loc2 = strK.charCodeAt(_loc1 / 2 % _loc6);
            _loc4 = _loc4 + String.fromCharCode(_loc3 - _loc2);
        } // end of for
        return (_loc4);
    };
    _root.Decrypt2 = function (theText, strK)
    {
        var _loc6;
        var _loc1;
        var _loc7;
        var _loc8;
        var _loc5;
        var _loc4;
        var _loc2;
        _loc6 = new String();
        _loc7 = theText.length;
        _loc8 = strK.length;
        for (var _loc1 = 0; _loc1 < _loc7; _loc1 = _loc1 + 4)
        {
            _loc5 = parseInt(theText.substr(_loc1, 2), 30);
            _loc4 = parseInt(theText.substr(_loc1 + 2, 2), 30);
            _loc2 = strK.charCodeAt(_loc1 / 4 % _loc8);
            _loc6 = _loc6 + String.fromCharCode(_loc5 - _loc4 - _loc2);
        } // end of for
        return (_loc6);
    };
    _root.Encrypt1 = function (theText)
    {
        var _loc3;
        var _loc1;
        var _loc2;
        var _loc4;
        _loc3 = new String();
        _loc4 = theText.length;
        for (var _loc1 = 0; _loc1 < _loc4; ++_loc1)
        {
            _loc2 = Math.floor(Math.random() * 66) + 36;
            _loc3 = _loc3 + ((theText.charCodeAt(_loc1) + _loc2).toString(27) + _loc2.toString(27));
        } // end of for
        return (_loc3);
    };
    _root.Decrypt1 = function (theText)
    {
        var _loc5;
        var _loc1;
        var _loc6;
        var _loc4;
        var _loc3;
        _loc5 = new String();
        _loc6 = theText.length;
        for (var _loc1 = 0; _loc1 < _loc6; _loc1 = _loc1 + 4)
        {
            _loc4 = parseInt(theText.substr(_loc1, 2), 27);
            _loc3 = parseInt(theText.substr(_loc1 + 2, 2), 27);
            _loc5 = _loc5 + String.fromCharCode(_loc4 - _loc3);
        } // end of for
        return (_loc5);
    };
    System.security.allowDomain("aq.battleon.com");
    System.security.allowDomain("guardian.battleon.com");
    System.security.allowDomain("portal.battleon.com");
    _root.status = "init";
    _root.quest._visible = false;
    _root.user._visible = false;
    _root.soundfx._visible = false;
    System.useCodepage = true;
    Stage.showMenu = false;
    var strBattleQuality = "HIGH";
    setProperty("", _quality, strBattleQuality);
    var arrayMasterMobList = new Array();
    var objCurrentBattleInfo = null;
    var strInitiative = "Monster";
    var intMonsterFrozen = 0;
    var intPlayerFrozen = 0;
    var intMonsterParalyzed = 0;
    var intPlayerParalyzed = 0;
    var loggedinstatus = "init";
    var bRetrySave = false;
    var intNumSaveRetries = 0;
    var bitSoundEnabled = false;
    var bitMusicEnabled = false;
    var bitShopEnabled = false;
    var bitAdViewerLoaded = false;
    var bitShowAdvertisements = false;
    var bitShowingAd = false;
    var intAdTimer = 0;
    var intAdCounter = 0;
    var intBattleCounter = 0;
    var cmdStringsList;
    var dataStringList;
    var bStringListLoaded;
    dataStringList = new Object();
    dataStringList.status = "empty";
    dataStringList.strLastUpdate = "";
    
    // [Action in Frame 3]
    _root.func._visible = false;
    var bitSpellRowEnabled;
    var bitOptionSoundOn;
    var bitOptionMusicOn;
    var bitSaveName = false;
    var bitSavePassword = false;
    var bitShowFrameRate = false;
    var intUserLanguage = 0;
    var bitAutoQuality = false;
    var bitExistingPrefs = false;
    var preferences = SharedObject.getLocal("lore", "/");
    _root.func.LoadUserPreferences();
    if (_root.intGameMode == undefined)
    {
        _root.intGameMode = 0;
        _root.strGameMode = "AQ";
    } // end if
    
    // [Action in Frame 9]
    _root.ProfilePlayer = _root.player;
    _root.ProfileMonster = _root.monster;
    _root.ProfilePlayer._visible = false;
    _root.ProfileMonster._visible = false;
    _root.objAdViewer._visible = false;
    _root.clipAdInfoText._visible = false;
    _root.status = "loading";
    
    // [Action in Frame 20]
    stop ();
    
    // [Action in Frame 29]
    var rp = _root.player;
    _root.m._visible = false;
    _root.p._visible = false;
    _root.miscitem._visible = false;
    _root.background._visible = false;
    _root.ProfilePlayer._visible = false;
    _root.ProfileMonster._visible = false;
    _root.spell._visible = false;
    _root.town._visible = false;
    _root.walk.visible = false;
    _root.guest._visible = false;
    _root.pet._visible = false;
    _root.strPetAction = "attack";
    _root.shop._visible = false;
    _root.playerMenuOptions._visible = false;
    _root.intCID = Math.floor(Math.random() * 1000) + 3000;
    _root.user.strSessionId = String(_root.intCID);
    _root.intCharID = _root.user.intCharID;
    _root.loggedinstatus = "start";
    _root.status = "start";
    _root.login._visible = true;
    if (_root.intGameMode == 1)
    {
        _root.login.loadMovie("engine/LoginWFv4.swf");
    }
    else
    {
        _root.login.loadMovie("engine/LoginAQv4.swf");
    } // end else if
    stop ();
    
    // [Action in Frame 35]
    _root.locker._visible = false;
    _root.func.LoadGlobalStringsList();
    stop ();
    
    // [Action in Frame 36]
    if (!bitShopEnabled)
    {
        _root.shop.loadMovie("engine/" + _root.func.GString("file-shop"));
    } // end if
    if (!bitSoundEnabled)
    {
        if (_root.intGameMode == 0)
        {
            _root.soundfx.loadMovie("engine/" + _root.func.GString("file-noise"));
        }
        else
        {
            _root.soundfx.loadMovie("engine/WF-noise3.swf");
        } // end if
    } // end else if
    _root.stat.loadMovie("engine/" + _root.func.GString("file-status"));
    if (_root.intGameMode == 1)
    {
        _root.playerMenuOptions.loadMovie("engine/menu-attack-WF2.swf");
    }
    else
    {
        _root.playerMenuOptions.loadMovie("engine/" + _root.func.GString("file-attackmenu"));
    } // end else if
    
    // [Action in Frame 41]
    stop ();
    
    // [Action in Frame 42]
    _root.stat._visible = false;
    _root.soundfx._visible = false;
    _root.shop._visible = false;
    _root.spacer._visible = false;
    _root.ProfilePlayer._visible = true;
    _root.playerMenuOptions._visible = false;
    play ();
    
    // [Action in Frame 45]
    _root.func.LoadInitialTown();
    gotoAndStop("Ready");
    
    // [Action in Frame 51]
    _root.func.EnableAllCombatActions();
    _root.func.ResetAffectedMonster();
    _root.ProfilePlayer.gotoAndStop("Init");
    _root.loggedinstatus = "ready";
    _root.status = "ready";
    stop ();
    
    // [Action in Frame 58]
    clipVersusDisplay._visible = false;
    _root.func.LoadBattle();
    _root.func.AuditStats();
    _root.status = "battle";
    stop ();
    
    // [Action in Frame 63]
    gotoAndPlay(FightingEngine);
    
    // [Action in Frame 68]
    stop ();
    
    // [Action in Frame 69]
    _root.func.StartFightingEngine();
    stop ();
    
    // [Action in Frame 78]
    _root.func.DetermineInitiative(70);
    
    // [Action in Frame 79]
    
    // [Action in Frame 81]
    
    // [Action in Frame 94]
    _root.func.StartRound();
    
    // [Action in Frame 95]
    gotoAndPlay("Turn-" + strInitiative);
    
    // [Action in Frame 97]
    stop ();
    
    // [Action in Frame 98]
    if (_root.func.TurnPlayer())
    {
        stop ();
    } // end if
    
    // [Action in Frame 99]
    _root.playerMenuOptions._visible = false;
    stop ();
    
    // [Action in Frame 100]
    
    // [Action in Frame 103]
    if (_root.m.status == "block" && _root.func.ShouldPlayMonsterIdle())
    {
        _root.m.play();
    } // end if
    bAnotherPlayerTurn = !_root.func.EndTurnPlayer();
    _root.func.CheckCombatants();
    
    // [Action in Frame 104]
    if (bAnotherPlayerTurn)
    {
        gotoAndPlay(Turn-Player);
    }
    else
    {
        gotoAndPlay(Turn-Misc);
    } // end else if
    
    // [Action in Frame 107]
    if (_root.func.TurnMisc())
    {
        stop ();
    } // end if
    
    // [Action in Frame 108]
    
    // [Action in Frame 110]
    if (_root.m.status == "block" && _root.func.ShouldPlayMonsterIdle())
    {
        _root.m.play();
    } // end if
    bAnotherMiscTurn = !_root.func.EndTurnMisc();
    _root.func.CheckCombatants();
    
    // [Action in Frame 111]
    if (bAnotherMiscTurn)
    {
        gotoAndPlay(Turn-Misc);
    }
    else
    {
        gotoAndPlay(Turn-Guest);
    } // end else if
    
    // [Action in Frame 114]
    if (_root.func.TurnGuest())
    {
        stop ();
    } // end if
    
    // [Action in Frame 115]
    
    // [Action in Frame 118]
    if (_root.m.status == "block" && _root.func.ShouldPlayMonsterIdle())
    {
        _root.m.play();
    } // end if
    bAnotherGuestTurn = !_root.func.EndTurnGuest();
    _root.func.CheckCombatants();
    
    // [Action in Frame 119]
    if (bAnotherGuestTurn)
    {
        gotoAndPlay(Turn-Guest);
    }
    else
    {
        gotoAndPlay(Turn-Pet);
    } // end else if
    
    // [Action in Frame 122]
    if (_root.func.TurnPet())
    {
        stop ();
    } // end if
    
    // [Action in Frame 123]
    
    // [Action in Frame 126]
    if (_root.m.status == "block" && _root.func.ShouldPlayMonsterIdle())
    {
        _root.m.play();
    } // end if
    bAnotherPetTurn = !_root.func.EndTurnPet();
    _root.func.CheckCombatants();
    
    // [Action in Frame 127]
    if (bAnotherPetTurn)
    {
        gotoAndPlay(Turn-Pet);
    }
    else if (strInitiative == "Player")
    {
        gotoAndPlay(Turn-Monster);
    }
    else
    {
        gotoAndPlay(Round-End);
    } // end else if
    
    // [Action in Frame 130]
    if (_root.func.TurnMonster())
    {
        stop ();
    } // end if
    
    // [Action in Frame 131]
    _root.func.CheckCombatants();
    
    // [Action in Frame 134]
    
    // [Action in Frame 135]
    if (_root.m.numAlive > 1)
    {
        _root.m.gotoAndPlay("AI");
        stop ();
    }
    else
    {
        gotoAndPlay(AfterMonsterTurn);
    } // end else if
    
    // [Action in Frame 136]
    
    // [Action in Frame 138]
    bAnotherMonsterTurn = !_root.func.EndTurnMonster();
    _root.func.CheckCombatants();
    
    // [Action in Frame 139]
    if (bAnotherMonsterTurn)
    {
        gotoAndPlay(Turn-Monster);
    }
    else if (strInitiative == "Monster")
    {
        gotoAndPlay(Turn-Player);
    }
    else
    {
        gotoAndPlay(Round-End);
    } // end else if
    
    // [Action in Frame 142]
    stop ();
    
    // [Action in Frame 143]
    _root.func.EndRound();
    _root.func.CheckCombatants();
    
    // [Action in Frame 144]
    gotoAndPlay(Round-Start);
    
    // [Action in Frame 146]
    stop ();
    
    // [Action in Frame 147]
    
    // [Action in Frame 148]
    _root.func.BattleEnd("Player");
    _root.func.UpdateStatusBars();
    _root.func.BattleWin();
    _root.status = "win";
    _root.saverr.gotoAndPlay("BattleWin");
    stop ();
    
    // [Action in Frame 155]
    
    // [Action in Frame 156]
    _root.func.BattleEnd("Monster");
    _root.func.BattleLose();
    _root.status = "lose";
    _root.saverr.gotoAndPlay("BattleLose");
    stop ();
    
    // [Action in Frame 164]
    _root.soundfx.Noise("levelup");
    _root.status = "levelup";
    
    // [Action in Frame 173]
    stop ();
    
    // [Action in Frame 174]
    _root.func.WonBattle();
    
    // [Action in Frame 175]
    stop ();
    
    // [Action in Frame 178]
    _root.func.intBattleStretch = _root.func.intBattleStretch + 300;
    strBlueTitle = lang[13];
    strBlueMSG = lang[11];
    btnRetry._visible = _root.bRetrySave && intNumSaveRetries < 2;
    stop ();
    
    // [Action in Frame 179]
    if (_root.player.intHP <= 0)
    {
        _root.func.DiedInBattle();
    }
    else
    {
        _root.intNumSaveRetries = 0;
        _root.func.WonBattle();
    } // end else if
    
    // [Action in Frame 184]
    unloadMovieNum(0);
    
    // [Action in Frame 185]
    _root.func.intBattleStretch = _root.func.intBattleStretch + 300;
    strBlueTitle = lang[13];
    strBlueMSG = lang[12];
    stop ();
    
    // [Action in Frame 186]
    _root.user.strResolution = "flee";
    _root.func.FledBattle();
    
    // [Action in Frame 190]
    strDupeBrowser = lang[14];
    stop ();
    
    // [Action in Frame 191]
    gotoAndStop("InvalidSession");
    Hope this helps those who want to make their own trainer & those who want to find new functions.

Similar Threads

  1. Replies: 5
    Last Post: 07-28-2009, 01:50 AM
  2. Happy First Anniversary Soldiers! EARLY FOR THE WHOLE ONTH OF JULY
    By mattheb0y in forum Combat Arms Hacks & Cheats
    Replies: 4
    Last Post: 06-25-2009, 02:29 AM
  3. The whole Story of Fetish By: Fetish
    By Ban Stick in forum General
    Replies: 12
    Last Post: 09-05-2008, 09:34 PM
  4. Idea to improve the whole MPGH experience.
    By noregrets187 in forum Suggestions, Requests & Help
    Replies: 12
    Last Post: 08-20-2008, 09:26 PM
  5. Okay i got the whole hacking thing,packets?
    By radnomguywfq3 in forum General Game Hacking
    Replies: 2
    Last Post: 01-09-2007, 07:01 PM