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(); }