Merge pull request #825 from eduardosmaniotto/feature/configurable-npc-buffs
feature: configurable npc buffs (cherry picked from commit 6a061fcad756e644dadf3721e84e3cce2a25bceb)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
namespace MUnique.OpenMU.Persistence.Initialization.VersionSeasonSix;
|
||||
|
||||
using MUnique.OpenMU.AttributeSystem;
|
||||
using MUnique.OpenMU.DataModel.Attributes;
|
||||
using MUnique.OpenMU.DataModel.Configuration;
|
||||
using MUnique.OpenMU.GameLogic.Attributes;
|
||||
using MUnique.OpenMU.GameLogic.MiniGames;
|
||||
@@ -119,6 +120,51 @@ internal partial class NpcInitialization : Version095d.NpcInitialization
|
||||
def.SetGuid(def.Number);
|
||||
}
|
||||
|
||||
// Elf Soldier Buff
|
||||
{
|
||||
var buffEffect = this.Context.CreateNew<MagicEffectDefinition>();
|
||||
this.GameConfiguration.MagicEffects.Add(buffEffect);
|
||||
buffEffect.Number = (short)MagicEffectNumber.ElfSoldierBuff;
|
||||
buffEffect.Name = "Elf Soldier Buff";
|
||||
buffEffect.InformObservers = true;
|
||||
buffEffect.StopByDeath = true;
|
||||
|
||||
// Duration: 60 minutes
|
||||
buffEffect.Duration = this.Context.CreateNew<PowerUpDefinitionValue>();
|
||||
buffEffect.Duration.ConstantValue.Value = 3600;
|
||||
|
||||
// Defense boost: 50 + (Level / 5)
|
||||
var defensePowerUp = this.Context.CreateNew<PowerUpDefinition>();
|
||||
defensePowerUp.TargetAttribute = Stats.DefenseFinal.GetPersistent(this.GameConfiguration);
|
||||
defensePowerUp.Boost = this.Context.CreateNew<PowerUpDefinitionValue>();
|
||||
defensePowerUp.Boost.ConstantValue.Value = 50;
|
||||
defensePowerUp.Boost.ConstantValue.AggregateType = AggregateType.AddFinal;
|
||||
var defensePerLevel = this.Context.CreateNew<AttributeRelationship>();
|
||||
defensePerLevel.InputAttribute = Stats.Level.GetPersistent(this.GameConfiguration);
|
||||
defensePerLevel.InputOperand = 1f / 5;
|
||||
defensePerLevel.InputOperator = InputOperator.Multiply;
|
||||
defensePowerUp.Boost.RelatedValues.Add(defensePerLevel);
|
||||
buffEffect.PowerUpDefinitions.Add(defensePowerUp);
|
||||
|
||||
// Damage boost: 45 + (Level / 3)
|
||||
var damagePowerUp = this.Context.CreateNew<PowerUpDefinition>();
|
||||
damagePowerUp.TargetAttribute = Stats.GreaterDamageBonus.GetPersistent(this.GameConfiguration);
|
||||
damagePowerUp.Boost = this.Context.CreateNew<PowerUpDefinitionValue>();
|
||||
damagePowerUp.Boost.ConstantValue.Value = 45;
|
||||
var damagePerLevel = this.Context.CreateNew<AttributeRelationship>();
|
||||
damagePerLevel.InputAttribute = Stats.Level.GetPersistent(this.GameConfiguration);
|
||||
damagePerLevel.InputOperand = 1f / 3;
|
||||
damagePerLevel.InputOperator = InputOperator.Multiply;
|
||||
damagePowerUp.Boost.RelatedValues.Add(damagePerLevel);
|
||||
buffEffect.PowerUpDefinitions.Add(damagePowerUp);
|
||||
|
||||
var elfSoldier = this.GameConfiguration.Monsters.First(m => m.Number == 257);
|
||||
var buff = this.Context.CreateNew<Buff>();
|
||||
buff.MagicEffectDefinition = buffEffect;
|
||||
buff.MaximumLevel = 220;
|
||||
elfSoldier.Buffs.Add(buff);
|
||||
}
|
||||
|
||||
{
|
||||
var def = this.Context.CreateNew<MonsterDefinition>();
|
||||
def.Number = 259;
|
||||
|
||||
Reference in New Issue
Block a user