示例#1
0
        public static void LoadLootTemplates_Prospecting()
        {
            Log.outInfo(LogFilter.ServerLoading, "Loading prospecting loot templates...");

            uint oldMSTime = Time.GetMSTime();

            List<uint> lootIdSet;
            uint count = Prospecting.LoadAndCollectLootIds(out lootIdSet);

            // remove real entries and check existence loot
            var its = Global.ObjectMgr.GetItemTemplates();
            foreach (var pair in its)
            {
                if (!pair.Value.GetFlags().HasAnyFlag(ItemFlags.IsProspectable))
                    continue;

                if (lootIdSet.Contains(pair.Value.GetId()))
                    lootIdSet.Remove(pair.Value.GetId());
            }

            // output error for any still listed (not referenced from appropriate table) ids
            Prospecting.ReportUnusedIds(lootIdSet);

            if (count != 0)
                Log.outInfo(LogFilter.ServerLoading, "Loaded {0} prospecting loot templates in {1} ms", count, Time.GetMSTimeDiffToNow(oldMSTime));
            else
                Log.outError(LogFilter.ServerLoading, "Loaded 0 prospecting loot templates. DB table `prospecting_loot_template` is empty");
        }
示例#2
0
        public static void LoadLootTemplates_Reference()
        {
            Log.outInfo(LogFilter.ServerLoading, "Loading reference loot templates...");

            uint oldMSTime = Time.GetMSTime();

            List<uint> lootIdSet;
            Reference.LoadAndCollectLootIds(out lootIdSet);

            // check references and remove used
            Creature.CheckLootRefs(lootIdSet);
            Fishing.CheckLootRefs(lootIdSet);
            Gameobject.CheckLootRefs(lootIdSet);
            Items.CheckLootRefs(lootIdSet);
            Milling.CheckLootRefs(lootIdSet);
            Pickpocketing.CheckLootRefs(lootIdSet);
            Skinning.CheckLootRefs(lootIdSet);
            Disenchant.CheckLootRefs(lootIdSet);
            Prospecting.CheckLootRefs(lootIdSet);
            Mail.CheckLootRefs(lootIdSet);
            Reference.CheckLootRefs(lootIdSet);

            // output error for any still listed ids (not referenced from any loot table)
            Reference.ReportUnusedIds(lootIdSet);

            Log.outInfo(LogFilter.ServerLoading, "Loaded refence loot templates in {0} ms", Time.GetMSTimeDiffToNow(oldMSTime));
        }
示例#3
0
        public override void Run()
        {
            _lastTimeRunning = Others.Times;
            MovementManager.StopMove();
            Thread.Sleep(500);
            Tasks.MountTask.DismountMount();
            Logging.Write("Prospecting in progress");
            Timer timer = new Timer(15 * 60 * 1000);

            // Prospecting
            while (Prospecting.NeedRun(nManagerSetting.CurrentSetting.MineralsToProspect) && Products.Products.IsStarted &&
                   Usefuls.InGame &&
                   !ObjectManager.ObjectManager.Me.InCombat && !ObjectManager.ObjectManager.Me.IsDeadMe &&
                   !timer.IsReady)
            {
                Thread.Sleep(200);
                Prospecting.Pulse(nManagerSetting.CurrentSetting.MineralsToProspect);
                Thread.Sleep(750);
                while (ObjectManager.ObjectManager.Me.IsCast && Products.Products.IsStarted && Usefuls.InGame &&
                       !ObjectManager.ObjectManager.Me.InCombat && !ObjectManager.ObjectManager.Me.IsDeadMe &&
                       !timer.IsReady)
                {
                    Thread.Sleep(100);
                }

                Thread.Sleep(Others.Random(600, 1600) + Usefuls.Latency);
            }
        }
示例#4
0
 private void DoMillingInTown(Npc npc)
 {
     if ((!_magicMountMammoth && !_magicMountYak || npc.Type != Npc.NpcType.Repair && npc.Type != Npc.NpcType.Vendor) && nManagerSetting.CurrentSetting.OnlyUseMillingInTown &&
         nManagerSetting.CurrentSetting.ActivateAutoMilling &&
         nManagerSetting.CurrentSetting.HerbsToBeMilled.Count > 0)
     {
         if (Prospecting.NeedRun(nManagerSetting.CurrentSetting.HerbsToBeMilled))
         {
             MillingState millingState = new MillingState();
             millingState.Run();
         }
     }
 }
示例#5
0
 private void DoProspectingInTown(Npc npc)
 {
     if ((!_magicMountMammoth && !_magicMountYak || npc.Type != Npc.NpcType.Repair && npc.Type != Npc.NpcType.Vendor) &&
         nManagerSetting.CurrentSetting.OnlyUseProspectingInTown && nManagerSetting.CurrentSetting.ActivateAutoProspecting &&
         nManagerSetting.CurrentSetting.MineralsToProspect.Count > 0)
     {
         if (Prospecting.NeedRun(nManagerSetting.CurrentSetting.MineralsToProspect))
         {
             ProspectingState prospectingState = new ProspectingState();
             prospectingState.Run();
         }
     }
 }
示例#6
0
        public CharacterCharacteristicsInformations GetCharacterCharacteristics(Character character)
        {
            ulong expFloor     = ExperienceRecord.GetExperienceForLevel(character.Level).Player;
            ulong expNextFloor = ExperienceRecord.GetExperienceForNextLevel(character.Level).Player;

            CharacterCharacteristicsInformations informations = new CharacterCharacteristicsInformations()
            {
                actionPoints            = ActionPoints.GetBaseCharacteristic(),
                actionPointsCurrent     = ActionPoints.TotalInContext(),
                additionnalPoints       = 0,
                agility                 = Agility.GetBaseCharacteristic(),
                airDamageBonus          = AirDamageBonus.GetBaseCharacteristic(),
                airElementReduction     = AirReduction.GetBaseCharacteristic(),
                airElementResistPercent = AirResistPercent.GetBaseCharacteristic(),
                alignmentInfos          = character.Record.Alignment.GetActorExtendedAlignement(),
                allDamagesBonus         = AllDamagesBonus.GetBaseCharacteristic(),
                chance = Chance.GetBaseCharacteristic(),
                criticalDamageBonus          = CriticalDamageBonus.GetBaseCharacteristic(),
                criticalDamageReduction      = CriticalDamageReduction.GetBaseCharacteristic(),
                criticalHit                  = CriticalHit.GetBaseCharacteristic(),
                criticalHitWeapon            = CriticalHitWeapon,
                criticalMiss                 = Characteristic.Zero().GetBaseCharacteristic(),
                damagesBonusPercent          = DamagesBonusPercent.GetBaseCharacteristic(),
                dodgePALostProbability       = DodgePAProbability.GetBaseCharacteristic(),
                dodgePMLostProbability       = DodgePMProbability.GetBaseCharacteristic(),
                earthDamageBonus             = EarthDamageBonus.GetBaseCharacteristic(),
                earthElementReduction        = EarthReduction.GetBaseCharacteristic(),
                earthElementResistPercent    = EarthResistPercent.GetBaseCharacteristic(),
                pvpEarthElementReduction     = PvPEarthReduction.GetBaseCharacteristic(),
                pvpEarthElementResistPercent = PvPEarthResistPercent.GetBaseCharacteristic(),
                fireDamageBonus              = FireDamageBonus.GetBaseCharacteristic(),
                fireElementReduction         = FireReduction.GetBaseCharacteristic(),
                fireElementResistPercent     = FireResistPercent.GetBaseCharacteristic(),
                pvpFireElementReduction      = PvPFireReduction.GetBaseCharacteristic(),
                pvpFireElementResistPercent  = PvPFireResistPercent.GetBaseCharacteristic(),
                glyphBonusPercent            = GlyphBonusPercent.GetBaseCharacteristic(),
                healBonus                      = HealBonus.GetBaseCharacteristic(),
                initiative                     = new CharacterBaseCharacteristic((short)FormulasProvider.Instance.BaseInitiative(this), 0, Initiative.Total(), 0, 0),
                intelligence                   = Intelligence.GetBaseCharacteristic(),
                kamas                          = character.Record.Kamas,
                lifePoints                     = (uint)LifePoints,
                maxEnergyPoints                = MaxEnergyPoints,
                maxLifePoints                  = (uint)MaxLifePoints,
                movementPoints                 = MovementPoints.GetBaseCharacteristic(),
                movementPointsCurrent          = MovementPoints.TotalInContext(),
                PMAttack                       = PMAttack.GetBaseCharacteristic(),
                PAAttack                       = PAAttack.GetBaseCharacteristic(),
                pvpAirElementReduction         = PvPAirReduction.GetBaseCharacteristic(),
                pvpAirElementResistPercent     = PvPAirResistPercent.GetBaseCharacteristic(),
                pvpNeutralElementReduction     = PvPNeutralReduction.GetBaseCharacteristic(),
                pvpNeutralElementResistPercent = PvPNeutralResistPercent.GetBaseCharacteristic(),
                pvpWaterElementReduction       = PvPWaterReduction.GetBaseCharacteristic(),
                pvpWaterElementResistPercent   = PvPWaterResistPercent.GetBaseCharacteristic(),
                energyPoints                   = Energy,
                experience                     = character.Experience,
                experienceLevelFloor           = expFloor,
                experienceNextLevelFloor       = expNextFloor,
                neutralDamageBonus             = NeutralDamageBonus.GetBaseCharacteristic(),
                neutralElementReduction        = NeutralReduction.GetBaseCharacteristic(),
                neutralElementResistPercent    = NeutralResistPercent.GetBaseCharacteristic(),
                tackleEvade                    = TackleEvade.GetBaseCharacteristic(),
                tackleBlock                    = TackleBlock.GetBaseCharacteristic(),
                range                          = Range.GetBaseCharacteristic(),
                waterElementReduction          = WaterReduction.GetBaseCharacteristic(),
                waterDamageBonus               = WaterDamageBonus.GetBaseCharacteristic(),
                waterElementResistPercent      = WaterResistPercent.GetBaseCharacteristic(),
                reflect                        = Reflect.GetBaseCharacteristic(),
                permanentDamagePercent         = PermanentDamagePercent.GetBaseCharacteristic(),
                prospecting                    = Prospecting.GetBaseCharacteristic(),
                pushDamageBonus                = PushDamageBonus.GetBaseCharacteristic(),
                pushDamageReduction            = PushDamageReduction.GetBaseCharacteristic(),
                runeBonusPercent               = RuneBonusPercent.GetBaseCharacteristic(),
                spellModifications             = new CharacterSpellModification[0],
                spellsPoints                   = character.Record.SpellPoints,
                statsPoints                    = character.Record.StatsPoints,
                vitality                       = Vitality.GetBaseCharacteristic(),
                strength                       = Strength.GetBaseCharacteristic(),
                summonableCreaturesBoost       = SummonableCreaturesBoost.GetBaseCharacteristic(),
                trapBonus                      = TrapBonus.GetBaseCharacteristic(),
                trapBonusPercent               = TrapBonusPercent.GetBaseCharacteristic(),
                weaponDamagesBonusPercent      = WeaponDamagesBonusPercent.GetBaseCharacteristic(),
                wisdom                         = Wisdom.GetBaseCharacteristic(),
                probationTime                  = 0,
            };

            return(informations);
        }
示例#7
0
 public override void Serialize(IDataWriter writer)
 {
     writer.WriteVarUhLong(Experience);
     writer.WriteVarUhLong(ExperienceLevelFloor);
     writer.WriteVarUhLong(ExperienceNextLevelFloor);
     writer.WriteVarUhLong(ExperienceBonusLimit);
     writer.WriteVarUhLong(Kamas);
     writer.WriteVarUhShort(StatsPoints);
     writer.WriteVarUhShort(AdditionnalPoints);
     writer.WriteVarUhShort(SpellsPoints);
     AlignmentInfos.Serialize(writer);
     writer.WriteVarUhInt(LifePoints);
     writer.WriteVarUhInt(MaxLifePoints);
     writer.WriteVarUhShort(EnergyPoints);
     writer.WriteVarUhShort(MaxEnergyPoints);
     writer.WriteVarShort(ActionPointsCurrent);
     writer.WriteVarShort(MovementPointsCurrent);
     Initiative.Serialize(writer);
     Prospecting.Serialize(writer);
     ActionPoints.Serialize(writer);
     MovementPoints.Serialize(writer);
     Strength.Serialize(writer);
     Vitality.Serialize(writer);
     Wisdom.Serialize(writer);
     Chance.Serialize(writer);
     Agility.Serialize(writer);
     Intelligence.Serialize(writer);
     Range.Serialize(writer);
     SummonableCreaturesBoost.Serialize(writer);
     Reflect.Serialize(writer);
     CriticalHit.Serialize(writer);
     writer.WriteVarUhShort(CriticalHitWeapon);
     CriticalMiss.Serialize(writer);
     HealBonus.Serialize(writer);
     AllDamagesBonus.Serialize(writer);
     WeaponDamagesBonusPercent.Serialize(writer);
     DamagesBonusPercent.Serialize(writer);
     TrapBonus.Serialize(writer);
     TrapBonusPercent.Serialize(writer);
     GlyphBonusPercent.Serialize(writer);
     RuneBonusPercent.Serialize(writer);
     PermanentDamagePercent.Serialize(writer);
     TackleBlock.Serialize(writer);
     TackleEvade.Serialize(writer);
     PAAttack.Serialize(writer);
     PMAttack.Serialize(writer);
     PushDamageBonus.Serialize(writer);
     CriticalDamageBonus.Serialize(writer);
     NeutralDamageBonus.Serialize(writer);
     EarthDamageBonus.Serialize(writer);
     WaterDamageBonus.Serialize(writer);
     AirDamageBonus.Serialize(writer);
     FireDamageBonus.Serialize(writer);
     DodgePALostProbability.Serialize(writer);
     DodgePMLostProbability.Serialize(writer);
     NeutralElementResistPercent.Serialize(writer);
     EarthElementResistPercent.Serialize(writer);
     WaterElementResistPercent.Serialize(writer);
     AirElementResistPercent.Serialize(writer);
     FireElementResistPercent.Serialize(writer);
     NeutralElementReduction.Serialize(writer);
     EarthElementReduction.Serialize(writer);
     WaterElementReduction.Serialize(writer);
     AirElementReduction.Serialize(writer);
     FireElementReduction.Serialize(writer);
     PushDamageReduction.Serialize(writer);
     CriticalDamageReduction.Serialize(writer);
     PvpNeutralElementResistPercent.Serialize(writer);
     PvpEarthElementResistPercent.Serialize(writer);
     PvpWaterElementResistPercent.Serialize(writer);
     PvpAirElementResistPercent.Serialize(writer);
     PvpFireElementResistPercent.Serialize(writer);
     PvpNeutralElementReduction.Serialize(writer);
     PvpEarthElementReduction.Serialize(writer);
     PvpWaterElementReduction.Serialize(writer);
     PvpAirElementReduction.Serialize(writer);
     PvpFireElementReduction.Serialize(writer);
     MeleeDamageDonePercent.Serialize(writer);
     MeleeDamageReceivedPercent.Serialize(writer);
     RangedDamageDonePercent.Serialize(writer);
     RangedDamageReceivedPercent.Serialize(writer);
     WeaponDamageDonePercent.Serialize(writer);
     WeaponDamageReceivedPercent.Serialize(writer);
     SpellDamageDonePercent.Serialize(writer);
     SpellDamageReceivedPercent.Serialize(writer);
     writer.WriteShort((short)SpellModifications.Count);
     foreach (var x in SpellModifications)
     {
         x.Serialize(writer);
     }
     writer.WriteInt(ProbationTime);
 }