Beispiel #1
0
        public void BuildAzirTurret()
        {
            Inibin inibin;

            if (!_rafManager.readInibin("DATA/Characters/" + Model + "/" + Model + ".inibin", out inibin))
            {
                _logger.LogCoreError("couldn't find turret stats for " + Model);
                return;
            }

            stats.HealthPoints.BaseValue       = inibin.getFloatValue("Data", "BaseHP");
            stats.CurrentHealth                = stats.HealthPoints.Total;
            stats.ManaPoints.BaseValue         = inibin.getFloatValue("Data", "BaseMP");
            stats.CurrentMana                  = stats.ManaPoints.Total;
            stats.AttackDamage.BaseValue       = inibin.getFloatValue("DATA", "BaseDamage");
            stats.Range.BaseValue              = TURRET_RANGE;
            stats.MoveSpeed.BaseValue          = inibin.getFloatValue("DATA", "MoveSpeed");
            stats.Armor.BaseValue              = inibin.getFloatValue("DATA", "Armor");
            stats.MagicResist.BaseValue        = inibin.getFloatValue("DATA", "SpellBlock");
            stats.HealthRegeneration.BaseValue = inibin.getFloatValue("DATA", "BaseStaticHPRegen");
            stats.ManaRegeneration.BaseValue   = inibin.getFloatValue("DATA", "BaseStaticMPRegen");
            stats.AttackSpeedFlat              = 0.625f / (1 + inibin.getFloatValue("DATA", "AttackDelayOffsetPercent"));

            stats.HealthPerLevel             = inibin.getFloatValue("DATA", "HPPerLevel");
            stats.ManaPerLevel               = inibin.getFloatValue("DATA", "MPPerLevel");
            stats.AdPerLevel                 = inibin.getFloatValue("DATA", "DamagePerLevel");
            stats.ArmorPerLevel              = inibin.getFloatValue("DATA", "ArmorPerLevel");
            stats.MagicResistPerLevel        = inibin.getFloatValue("DATA", "SpellBlockPerLevel");
            stats.HealthRegenerationPerLevel = inibin.getFloatValue("DATA", "HPRegenPerLevel");
            stats.ManaRegenerationPerLevel   = inibin.getFloatValue("DATA", "MPRegenPerLevel");
            stats.GrowthAttackSpeed          = inibin.getFloatValue("DATA", "AttackSpeedPerLevel");

            IsMelee         = inibin.getBoolValue("DATA", "IsMelee");
            CollisionRadius = inibin.getIntValue("DATA", "PathfindingCollisionRadius");

            Inibin autoAttack = _rafManager.GetAutoAttackData(Model);

            if (autoAttack != null)
            {
                AutoAttackDelay           = autoAttack.getFloatValue("SpellData", "castFrame") / 30.0f;
                AutoAttackProjectileSpeed = autoAttack.getFloatValue("SpellData", "MissileSpeed");
            }
        }
Beispiel #2
0
        public Monster(
            float x,
            float y,
            float facingX,
            float facingY,
            string model,
            string name,
            string spawnAnimation    = "",
            byte campId              = 0x01,
            byte campUnk             = 0x2A,
            float spawnAnimationTime = 0.0f,
            uint netId = 0
            ) : base(model, new Stats(), 40, x, y, 0, netId)
        {
            SetTeam(TeamId.TEAM_NEUTRAL);

            var teams = Enum.GetValues(typeof(TeamId)).Cast <TeamId>();

            foreach (var team in teams)
            {
                SetVisibleByTeam(team, true);
            }

            MoveOrder               = MoveOrder.MOVE_ORDER_MOVE;
            this.Facing             = new Vector2(facingX, facingY);
            this.Name               = name;
            this.SpawnAnimation     = spawnAnimation;
            this.CampId             = campId;
            this.CampUnk            = campUnk;
            this.SpawnAnimationTime = spawnAnimationTime;

            Inibin inibin;

            if (!_rafManager.readInibin("DATA/Characters/" + model + "/" + model + ".inibin", out inibin))
            {
                _logger.LogCoreError("couldn't find monster stats for " + model);
                return;
            }

            stats.HealthPoints.BaseValue       = inibin.getFloatValue("Data", "BaseHP");
            stats.CurrentHealth                = stats.HealthPoints.Total;
            stats.ManaPoints.BaseValue         = inibin.getFloatValue("Data", "BaseMP");
            stats.CurrentMana                  = stats.ManaPoints.Total;
            stats.AttackDamage.BaseValue       = inibin.getFloatValue("DATA", "BaseDamage");
            stats.Range.BaseValue              = inibin.getFloatValue("DATA", "AttackRange");
            stats.MoveSpeed.BaseValue          = inibin.getFloatValue("DATA", "MoveSpeed");
            stats.Armor.BaseValue              = inibin.getFloatValue("DATA", "Armor");
            stats.MagicResist.BaseValue        = inibin.getFloatValue("DATA", "SpellBlock");
            stats.HealthRegeneration.BaseValue = inibin.getFloatValue("DATA", "BaseStaticHPRegen");
            stats.ManaRegeneration.BaseValue   = inibin.getFloatValue("DATA", "BaseStaticMPRegen");
            stats.AttackSpeedFlat              = 0.625f / (1 + inibin.getFloatValue("DATA", "AttackDelayOffsetPercent"));

            stats.HealthPerLevel             = inibin.getFloatValue("DATA", "HPPerLevel");
            stats.ManaPerLevel               = inibin.getFloatValue("DATA", "MPPerLevel");
            stats.AdPerLevel                 = inibin.getFloatValue("DATA", "DamagePerLevel");
            stats.ArmorPerLevel              = inibin.getFloatValue("DATA", "ArmorPerLevel");
            stats.MagicResistPerLevel        = inibin.getFloatValue("DATA", "SpellBlockPerLevel");
            stats.HealthRegenerationPerLevel = inibin.getFloatValue("DATA", "HPRegenPerLevel");
            stats.ManaRegenerationPerLevel   = inibin.getFloatValue("DATA", "MPRegenPerLevel");
            stats.GrowthAttackSpeed          = inibin.getFloatValue("DATA", "AttackSpeedPerLevel");

            IsMelee         = inibin.getBoolValue("DATA", "IsMelee");
            CollisionRadius = inibin.getIntValue("DATA", "PathfindingCollisionRadius");

            var autoAttack = _rafManager.GetAutoAttackData(model);

            if (autoAttack == null)
            {
                _logger.LogCoreError("Couldn't find monster auto-attack data for {0}", model);
                return;
            }

            AutoAttackDelay           = autoAttack.getFloatValue("SpellData", "castFrame") / 30.0f;
            AutoAttackProjectileSpeed = autoAttack.getFloatValue("SpellData", "MissileSpeed");
        }
Beispiel #3
0
        public Champion(string model, uint playerId, RuneCollection runeList, uint netId = 0)
            : base(model, new Stats(), 30, 0, 0, 1200, netId)
        {
            this._playerId = playerId;
            this.RuneList  = runeList;

            Inventory = InventoryManager.CreateInventory(this);
            Shop      = Shop.CreateShop(this);

            stats.Gold = 475.0f;
            stats.GoldPerSecond.BaseValue = _game.Map.GetGoldPerSecond();
            stats.SetGeneratingGold(false);

            Inibin inibin;

            if (!_rafManager.readInibin("DATA/Characters/" + Model + "/" + Model + ".inibin", out inibin))
            {
                _logger.LogCoreError("couldn't find champion stats for " + Model);
                return;
            }

            stats.HealthPoints.BaseValue          = inibin.getFloatValue("Data", "BaseHP");
            stats.CurrentHealth                   = stats.HealthPoints.Total;
            stats.ManaPoints.BaseValue            = inibin.getFloatValue("Data", "BaseMP");
            stats.CurrentMana                     = stats.ManaPoints.Total;
            stats.AttackDamage.BaseValue          = inibin.getFloatValue("DATA", "BaseDamage");
            stats.Range.BaseValue                 = inibin.getFloatValue("DATA", "AttackRange");
            stats.MoveSpeed.BaseValue             = inibin.getFloatValue("DATA", "MoveSpeed");
            stats.Armor.BaseValue                 = inibin.getFloatValue("DATA", "Armor");
            stats.MagicResist.BaseValue           = inibin.getFloatValue("DATA", "SpellBlock");
            stats.HealthRegeneration.BaseValue    = inibin.getFloatValue("DATA", "BaseStaticHPRegen");
            stats.ManaRegeneration.BaseValue      = inibin.getFloatValue("DATA", "BaseStaticMPRegen");
            stats.AttackSpeedFlat                 = 0.625f / (1 + inibin.getFloatValue("DATA", "AttackDelayOffsetPercent"));
            stats.AttackSpeedMultiplier.BaseValue = 1.0f;

            stats.HealthPerLevel             = inibin.getFloatValue("DATA", "HPPerLevel");
            stats.ManaPerLevel               = inibin.getFloatValue("DATA", "MPPerLevel");
            stats.AdPerLevel                 = inibin.getFloatValue("DATA", "DamagePerLevel");
            stats.ArmorPerLevel              = inibin.getFloatValue("DATA", "ArmorPerLevel");
            stats.MagicResistPerLevel        = inibin.getFloatValue("DATA", "SpellBlockPerLevel");
            stats.HealthRegenerationPerLevel = inibin.getFloatValue("DATA", "HPRegenPerLevel");
            stats.ManaRegenerationPerLevel   = inibin.getFloatValue("DATA", "MPRegenPerLevel");
            stats.GrowthAttackSpeed          = inibin.getFloatValue("DATA", "AttackSpeedPerLevel");

            Spells = new List <Spell>();
            Spells.Add(new Spell(this, inibin.getStringValue("Data", "Spell1"), 0));
            Spells.Add(new Spell(this, inibin.getStringValue("Data", "Spell2"), 1));
            Spells.Add(new Spell(this, inibin.getStringValue("Data", "Spell3"), 2));
            Spells.Add(new Spell(this, inibin.getStringValue("Data", "Spell4"), 3));
            Spells.Add(new Spell(this, "SummonerHeal", 4));
            Spells.Add(new Spell(this, "SummonerFlash", 5));
            Spells.Add(new Spell(this, "Recall", 13));

            IsMelee         = inibin.getBoolValue("DATA", "IsMelee");
            CollisionRadius = inibin.getIntValue("DATA", "PathfindingCollisionRadius");

            var autoAttack = _rafManager.GetAutoAttackData(Model);

            if (autoAttack != null)
            {
                AutoAttackDelay           = autoAttack.getFloatValue("SpellData", "castFrame") / 30.0f;
                AutoAttackProjectileSpeed = autoAttack.getFloatValue("SpellData", "MissileSpeed");
            }

            LoadLua();
        }
Beispiel #4
0
        public Spell(Champion owner, string spellName, byte slot)
        {
            this.Owner            = owner;
            this._spellName       = spellName;
            this.Slot             = slot;
            this.Level            = 0;
            this.Flags            = 0;
            this.ProjectileFlags  = 0;
            this.CastTime         = 0.0f;
            this.ProjectileSpeed  = 2000.0f;
            this._currentCastTime = 0.0f;
            NoCooldown            = _game.Config.CooldownsDisabled;
            NoManacost            = _game.Config.ManaCostsDisabled;

            Inibin inibin;

            _scriptEngine = new LuaScriptEngine();

            LoadLua(_scriptEngine);

            if (slot > 3)
            {
                if (!_rafManager.readInibin("DATA/Spells/" + spellName + ".inibin", out inibin))
                {
                    return;
                }

                // Generate cooldown values for each level of the spell
                for (var i = 0; i < cooldown.Length; ++i)
                {
                    cooldown[i] = inibin.GetValue <float>("SpellData", "Cooldown");
                }

                return;
            }

            if (!_rafManager.readInibin("DATA/Spells/" + spellName + ".inibin", out inibin))
            {
                if (!_rafManager.readInibin("DATA/Characters/" + owner.Model + "/Spells/" + spellName + ".inibin", out inibin))
                {
                    if (!_rafManager.readInibin("DATA/Characters/" + owner.Model + "/" + spellName + ".inibin", out inibin))
                    {
                        _logger.LogCoreError("Couldn't find spell stats for " + spellName);
                        return;
                    }
                }
            }

            // Generate cooldown values for each level of the spell
            for (var i = 0; i < cooldown.Length; ++i)
            {
                cooldown[i] = inibin.GetValue <float>("SpellData", "Cooldown" + (i + 1));
            }

            for (var i = 0; i < cost.Length; ++i)
            {
                cost[i] = inibin.GetValue <float>("SpellData", "ManaCost" + (i + 1));
            }

            for (var i = 0; i < _castRange.Length; ++i)
            {
                _castRange[i] = inibin.GetValue <float>("SpellData", "CastRange" + (i + 1));
            }

            CastTime = ((1.0f + inibin.GetValue <float>("SpellData", "DelayCastOffsetPercent"))) / 2.0f;

            Flags           = inibin.GetValue <int>("SpellData", "Flags");
            ProjectileSpeed = inibin.GetValue <float>("SpellData", "MissileSpeed");
            for (var i = 0; true; i++)
            {
                if (inibin.GetValue <object>("SpellData", "Coefficient" + i) == null)
                {
                    break;
                }

                var coeffValue = inibin.GetValue <float>("SpellData", "Coefficient" + i);
                Coefficient[i] = coeffValue;
                i++;
            }
            LineWidth     = inibin.GetValue <float>("SpellData", "LineWidth");
            hitEffectName = inibin.GetValue <string>("SpellData", "HitEffectName");

            for (var i = 0; true; i++)
            {
                string key = "Effect" + (0 + i) + "Level0Amount";
                if (inibin.GetValue <object>("SpellData", key) == null)
                {
                    break;
                }


                List <float> effectValues = new List <float>();
                for (var j = 0; j < 6; ++j)
                {
                    key = "Effect" + (0 + i) + "Level" + (0 + j) + "Amount";
                    effectValues.Add(inibin.GetValue <float>("SpellData", key));
                }

                effects.Add(effectValues);
                ++i;
            }

            _targetType = (float)Math.Floor(inibin.GetValue <float>("SpellData", "TargettingType") + 0.5f);


            // This is starting to get ugly. How many more names / paths to go ?
            if (!_rafManager.readInibin("DATA/Spells/" + spellName + "Missile.inibin", out inibin))
            {
                if (!_rafManager.readInibin("DATA/Spells/" + spellName + "Mis.inibin", out inibin))
                {
                    if (!_rafManager.readInibin("DATA/Characters/" + owner.Model + "/Spells/" + spellName + "Missile.inibin", out inibin))
                    {
                        if (!_rafManager.readInibin("DATA/Characters/" + owner.Model + "/" + spellName + "Missile.inibin", out inibin))
                        {
                            if (!_rafManager.readInibin("DATA/Characters/" + owner.Model + "/Spells/" + spellName + "Mis.inibin", out inibin))
                            {
                                if (!_rafManager.readInibin("DATA/Characters/" + owner.Model + "/" + spellName + "Mis.inibin", out inibin))
                                {
                                    return;
                                }
                            }
                        }
                    }
                }
            }

            hitEffectName   = inibin.GetValue <string>("SpellData", "HitEffectName");
            ProjectileSpeed = inibin.GetValue <float>("SpellData", "MissileSpeed");
            ProjectileFlags = inibin.GetValue <int>("SpellData", "Flags");
            ReloadLua();
        }