Ejemplo n.º 1
0
        public override void OnLoad()
        {
            _Client.State = (int)eClientState.WorldEnter;

            if (!_Inited)
            {
                EvtInterface.Obj = this;
                EvtInterface.AddEventNotify("Playing", Save);
                EvtInterface.Start();

                ItmInterface.Load(CharMgr.GetItemChar(_Info.CharacterId));
                StsInterface.Load(CharMgr.GetCharacterInfoStats(_Info.CareerLine, _Value.Level));
                QtsInterface.Load(this._Info.Quests);
                TokInterface.Load(_Info.Toks);
                SocInterface.Load(_Info.Socials);
                AbtInterface.Load();
                StsInterface.ApplyStats();

                SetLevel(_Value.Level);
                SetRenownLevel(_Value.RenownRank);
                SetOffset((UInt16)(_Value.WorldX >> 12), (UInt16)(_Value.WorldY >> 12));
                _Inited = true;
            }

            base.OnLoad();

            StartInit();
        }
Ejemplo n.º 2
0
        public Dictionary <byte, UInt16> ApplyLevel()
        {
            Dictionary <byte, UInt16> Diff = new Dictionary <byte, ushort>();

            CharacterInfo_stats[] NewStats = CharMgr.GetCharacterInfoStats(_Info.CareerLine, _Value.Level);
            if (NewStats == null || NewStats.Length <= 0)
            {
                return(Diff);
            }

            foreach (CharacterInfo_stats Stat in NewStats)
            {
                UInt16 Base = StsInterface.GetBaseStat(Stat.StatId);

                if (Stat.StatValue > Base)
                {
                    Diff.Add(Stat.StatId, (ushort)(Stat.StatValue - Base));
                }

                StsInterface.SetBaseStat(Stat.StatId, Stat.StatValue);
            }

            StsInterface.ApplyStats();
            return(Diff);
        }
Ejemplo n.º 3
0
        protected override void SetCreatureStats()
        {
            if (Owner.Info.CareerLine == (int)CareerLine.CAREERLINE_MAGUS)
            {
                StsInterface.Load(CharMgr.GetCharacterInfoStats((byte)CareerLine.CAREERLINE_MAGUS, Math.Min(Level, (byte)40)));
            }
            float armorMod = 1.0f, resistMod = 1.0f, woundsMod = 1f, itemWoundsMod = 0f;

            switch (Spawn.Proto.Model1)
            {
            // White Lion
            // War Lions
            case 132:
            case 133:
            case 134:
            case 135:
                StsInterface.Load(CharMgr.GetCharacterInfoStats((byte)CareerLine.CAREERLINE_WAR_LION, Math.Min(Level, (byte)40)));
                woundsMod                 = 1f;
                itemWoundsMod             = 1f;
                _weaponDamageContribution = WeaponDamageContribution.MainHand;
                break;

            // Beastmaster
            case 1156:     // War Manticore
            case 1086:     // Harpy
            case 1142:     // Giant Scorpion
            case 1272:     // Hydra
                StsInterface.Load(CharMgr.GetCharacterInfoStats((byte)CareerLine.CAREERLINE_WAR_MANTICORE, Math.Min(Level, (byte)40)));
                woundsMod                 = 1f;
                itemWoundsMod             = 1f;
                _weaponDamageContribution = WeaponDamageContribution.MainHand;
                break;

            // Squig
            case 136:
                StsInterface.Load(CharMgr.GetCharacterInfoStats((byte)CareerLine.CAREERLINE_SQUIG, Math.Min(Level, (byte)40)));
                armorMod                  = 2.0f;
                woundsMod                 = 1f;
                itemWoundsMod             = 0.5f;
                _weaponDamageContribution = WeaponDamageContribution.MainHand;
                break;

            // Horned Squig
            case 137:
                StsInterface.Load(CharMgr.GetCharacterInfoStats((byte)CareerLine.CAREERLINE_HORNED_SQUIG, Math.Min(Level, (byte)40)));
                armorMod                  = 2.0f;
                resistMod                 = 0.5f;
                woundsMod                 = 1f;
                itemWoundsMod             = 1f;
                _weaponDamageContribution = WeaponDamageContribution.MainAndRanged;
                break;

            // Spiked Squig
            case 138:
                StsInterface.Load(CharMgr.GetCharacterInfoStats((byte)CareerLine.CAREERLINE_SPIKED_SQUIG, Math.Min(Level, (byte)40)));
                woundsMod                 = 0.85f;
                itemWoundsMod             = 0.85f;
                _weaponDamageContribution = WeaponDamageContribution.Ranged;
                _ignoreZ = true;
                break;

            // Gas Squig
            case 139:
                StsInterface.Load(CharMgr.GetCharacterInfoStats((byte)CareerLine.CAREERLINE_GAS_SQUIG, Math.Min(Level, (byte)40)));
                woundsMod                 = 0.65f;
                itemWoundsMod             = 0.65f;
                _weaponDamageContribution = WeaponDamageContribution.Ranged;
                _ignoreZ = true;
                break;

            // Magus
            // Pink Horror
            case 141:
                woundsMod = 0.5f;
                _weaponDamageContribution = WeaponDamageContribution.MainHand;
                _weaponDamageFactor       = 0.7f;
                break;

            // Blue Horror
            case 142:
                armorMod  = 2f;
                woundsMod = 1f;
                _weaponDamageContribution = WeaponDamageContribution.MainHand;
                _weaponDamageFactor       = 0.85f;
                break;

            // Flamer
            case 143:
                armorMod  = 1.5f;
                woundsMod = 0.75f;
                _weaponDamageContribution = WeaponDamageContribution.MainHand;
                break;

            // Engineer
            // Gun Turret
            case 145:
                woundsMod = 0.5f;
                _weaponDamageContribution = WeaponDamageContribution.MainAndRanged;
                _weaponDamageFactor       = 0.7f;
                break;

            // Bombardment Turret
            case 146:
                armorMod  = 1.5f;
                woundsMod = 0.75f;
                _weaponDamageContribution = WeaponDamageContribution.MainAndRanged;
                _weaponDamageFactor       = 0.85f;
                break;

            // Flame Turret
            case 147:
                armorMod  = 2f;
                woundsMod = 1f;
                _weaponDamageContribution = WeaponDamageContribution.MainAndRanged;
                break;

            // This is to handle .setpet command, it sets the stats of Lion / Manticore
            default:
                StsInterface.Load(CharMgr.GetCharacterInfoStats((byte)CareerLine.CAREERLINE_WAR_MANTICORE, Math.Min(Level, (byte)40)));
                woundsMod                 = 1f;
                itemWoundsMod             = 1f;
                _weaponDamageContribution = WeaponDamageContribution.MainHand;
                break;
            }

            StsInterface.SetBaseStat(Stats.Wounds, (ushort)(Owner.StsInterface.GetCoreStat(Stats.Wounds) * woundsMod));

            StsInterface.AddItemBonusStat(Stats.Willpower, Owner.StsInterface.GetItemStat(Stats.Willpower));

            if (itemWoundsMod > 0f)
            {
                StsInterface.AddItemBonusStat(Stats.Wounds, (ushort)(Owner.StsInterface.GetItemStat(Stats.Wounds) * itemWoundsMod));
            }

            StsInterface.AddItemBonusStat(Stats.Initiative, Owner.StsInterface.GetItemStat(Stats.Initiative));

            StsInterface.AddItemBonusStat(Stats.Armor, (ushort)(Owner.StsInterface.GetItemStat(Stats.Armor) * armorMod));
            StsInterface.AddItemBonusStat(Stats.SpiritResistance, (ushort)(Owner.StsInterface.GetItemStat(Stats.SpiritResistance) * resistMod));
            StsInterface.AddItemBonusStat(Stats.ElementalResistance, (ushort)(Owner.StsInterface.GetItemStat(Stats.ElementalResistance) * resistMod));
            StsInterface.AddItemBonusStat(Stats.CorporealResistance, (ushort)(Owner.StsInterface.GetItemStat(Stats.CorporealResistance) * resistMod));

            StsInterface.ApplyStats();
        }