More Necromancer command skeleton updates; renamed resourcefull to resourceful

This commit is contained in:
Lucca Faria Ferri 2023-01-30 10:56:44 -08:00
parent b6ddd67d01
commit 789b2192bd
4 changed files with 67 additions and 47 deletions

View File

@ -55,30 +55,30 @@ public class PowerfulCommand : CommandGroup
}
}
[CommandGroup("resourcefull", "Makes your character with full resource. Useful for testing.",
[CommandGroup("resourceful", "Makes your character with full resource. Useful for testing.",
Account.UserLevels.Tester)]
public class ResourcefullCommand : CommandGroup
public class ResourcefulCommand : CommandGroup
{
[DefaultCommand]
public string Resourcefull(string[] @params, BattleClient invokerClient)
public string Resourceful(string[] @params, BattleClient invokerClient)
{
if (invokerClient?.InGameClient?.Player is not { } player)
return "You must be in game to use this command.";
if (player.Attributes.FixedMap.Contains(FixedAttribute.Resourcefull))
if (player.Attributes.FixedMap.Contains(FixedAttribute.Resourceful))
{
player.Attributes.FixedMap.Remove(FixedAttribute.Resourcefull);
player.Attributes.FixedMap.Remove(FixedAttribute.Resourceful);
player.Attributes.BroadcastChangedIfRevealed();
return "You are no longer Resourcefull.";
return "You are no longer Resourceful.";
}
player.Attributes.FixedMap.Add(FixedAttribute.Resourcefull, (attributes) =>
player.Attributes.FixedMap.Add(FixedAttribute.Resourceful, (attributes) =>
{
attributes[GameAttribute.Resource_Cur, 1] = 100;
});
player.Attributes.BroadcastChangedIfRevealed();
return "You are full resource.";
return "You are now resourceful.";
}
}

View File

@ -9,7 +9,8 @@ namespace DiIiS_NA.GameServer.GSSystem.ObjectsSystem
Invulnerable,
Speed,
Powerful,
Resourcefull
Resourceful,
AttackSpeed
}
public class FixedMap

View File

@ -168,6 +168,7 @@ public class Player : Actor, IMessageConsumer, IUpdateable
public List<Actor> NecroSkeletons = new() { };
public bool ActiveSkeletons = false;
public Actor ActiveGolem = null;
public bool EnableGolem = false;
@ -189,13 +190,7 @@ public class Player : Actor, IMessageConsumer, IUpdateable
public int GearScore
{
get
{
if (Inventory == null)
return 0;
else
return Inventory.GetGearScore();
}
get => Inventory?.GetGearScore() ?? 0;
private set { }
}
@ -272,7 +267,7 @@ public class Player : Actor, IMessageConsumer, IUpdateable
}
/// <summary>
/// NPC currently interaced with
/// NPC currently interacted with
/// </summary>
public InteractiveNPC SelectedNPC { get; set; }
@ -448,14 +443,12 @@ public class Player : Actor, IMessageConsumer, IUpdateable
SetAttributesMovement();
SetAttributesMisc();
SetAttributesOther();
if (Inventory == null)
Inventory = new Inventory(this);
Inventory ??= new Inventory(this);
SetAttributesByItems(); //needs the Inventory
SetAttributesByItemProcs();
SetAttributesByGems();
SetAttributesByItemSets();
if (SkillSet == null)
SkillSet = new SkillSet(this, Toon.Class, Toon);
SkillSet ??= new SkillSet(this, Toon.Class, Toon);
SetAttributesByPassives(); //needs the SkillSet
SetAttributesByParagon();
SetNewAttributes();

View File

@ -21,6 +21,7 @@ using DiIiS_NA.GameServer.GSSystem.PlayerSystem;
using DiIiS_NA.GameServer.MessageSystem.Message.Definitions.Pet;
using DiIiS_NA.Core.Extensions;
using DiIiS_NA.GameServer.GSSystem.AISystem.Brains;
using DiIiS_NA.GameServer.GSSystem.ObjectsSystem;
namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations
{
@ -1990,37 +1991,43 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations
DamageType damageType = DamageType.Physical;
bool greaterDamage = false;
/*
* Enforcer: Reduces the active Essence cost to 25.
* Frenzy: Commanded skeletons go into a frenzy, gaining 25% increased attack speed as long as they attacked the Commanded target (in addition to damage bonus).
* Dark Mending: Skeletal minions will heal the Necromancer for 0.5% of total Life per hit while being Commanded (i.e. as long as the skill is activated).
* Freezing Grasp: Damage type is changed to Cold, and the target of Command is frozen for 3 seconds.
* Kill Command: Damage type changes to Poison, and Command activation will instead make each Skeleton explode, killing them and dealing 215% damage as Poison to enemies within 15 yards each. They will still rush to their target before exploding.
*/
bool enforcer = Rune_A > 0,
frenzy = Rune_B > 0,
darkMending = Rune_C > 0,
freezingGrasp = Rune_D > 0,
killCommand = Rune_E > 0;
// Enforcer
if (Rune_A > 0)
if (enforcer)
{
UsePrimaryResource(EvalTag(PowerKeys.ResourceCost) / 2);
UsePrimaryResource(25);
}
// Frenzy
else if (Rune_B > 0)
else
{
UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));
}
// Dark Mending
else if (Rune_C > 0)
if (darkMending)
{
((Player)User).AddPercentageHP(25f); // add per hit : TODO: Life per hit while being Commanded (i.e. as long as the skill is activated).
}
else if (freezingGrasp)
{
UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));
damageType = DamageType.Cold;
}
// Freezing Grasp
else if (Rune_D > 0)
else if (killCommand)
{
UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));
damageType = DamageType.Poison;
greaterDamage = true;
greaterDamage = true; // TODO: Implement Kill Command to Explode instead of attacking
}
else if (Rune_E > 0)
{
UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));
greaterDamage = true;
damageType = DamageType.Poison;
Logger.Warn("Rune E not implemented for Necromancer's Command Skeletons");
}
foreach (var skeleton in ((Player)User).NecroSkeletons)
{
//User.PlayEffectGroup(474172);
@ -2038,6 +2045,24 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations
skeleton.Hidden = false;
skeleton.PlayEffectGroup(474172);
// Commanded skeletons go into a frenzy, gaining 25% increased attack speed as long as they attacked the Commanded target (in addition to damage bonus).
if (frenzy)
{
if (!skeleton.Attributes.FixedMap.Contains(FixedAttribute.AttackSpeed))
{
var originalAttackSpeed = skeleton.Attributes[GameAttribute.Attacks_Per_Second];
skeleton.Attributes.FixedMap.Add(FixedAttribute.AttackSpeed, attr => attr[GameAttribute.Attacks_Per_Second] = originalAttackSpeed * 1.25f);
skeleton.Attributes.BroadcastChangedIfRevealed();
}
}
else
{
if (skeleton.Attributes.FixedMap.Contains(FixedAttribute.AttackSpeed))
{
skeleton.Attributes.FixedMap.Remove(FixedAttribute.AttackSpeed);
skeleton.Attributes.BroadcastChangedIfRevealed();
}
}
AttackPayload attack = new AttackPayload(this)
{
Target = Target
@ -2045,10 +2070,11 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations
attack.AddWeaponDamage(greaterDamage ? 2.15f : 1.0f, damageType);
attack.OnHit = hit =>
{
if (Rune_C > 0)
if (freezingGrasp)
{
if (!HasBuff<DebuffFrozen>(hit.Target))
{
hit.Target.PlayEffect(Effect.IcyEffect);
AddBuff(hit.Target, new DebuffFrozen(WaitSeconds(3.0f)));
}
}