Necromancer.cs - command skeletons (done RuneA - RuneD, missing RuneC now). Needs further testing in regards to functionality, I think it's not freezing the target yet???
This commit is contained in:
parent
16ae7fd2b6
commit
1587c02f54
@ -3255,6 +3255,23 @@ public class Player : Actor, IMessageConsumer, IUpdateable
|
||||
|
||||
if (ActiveSkeletons)
|
||||
{
|
||||
if (Followers.All(s => s.Value != ActorSno._p6_necro_commandskeletons_a) && NecroSkeletons.Any())
|
||||
{
|
||||
foreach (var skel in NecroSkeletons)
|
||||
{
|
||||
try
|
||||
{
|
||||
InGameClient.SendMessage(new PetDetachMessage()
|
||||
{
|
||||
PetId = skel.GlobalID
|
||||
});
|
||||
World.Leave(skel);
|
||||
}
|
||||
catch{}
|
||||
}
|
||||
|
||||
NecroSkeletons.Clear();
|
||||
}
|
||||
while (NecroSkeletons.Count < 7)
|
||||
{
|
||||
var Skeleton = new NecromancerSkeleton_A(World, ActorSno._p6_necro_commandskeletons_a, this);
|
||||
|
||||
@ -17,6 +17,8 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using DiIiS_NA.GameServer.GSSystem.PlayerSystem;
|
||||
using DiIiS_NA.GameServer.MessageSystem.Message.Definitions.Pet;
|
||||
|
||||
namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations
|
||||
{
|
||||
@ -1983,14 +1985,42 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations
|
||||
User.PlayEffect(Effect.PlayEffectGroup, 466026);
|
||||
if (Target != null)
|
||||
{
|
||||
DamageType damageType = DamageType.Physical;
|
||||
bool greaterDamage = false;
|
||||
|
||||
// Enforcer
|
||||
if (Rune_A > 0)
|
||||
{
|
||||
}
|
||||
// Frenzy
|
||||
else if (Rune_B > 0)
|
||||
{
|
||||
UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));
|
||||
UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));
|
||||
}
|
||||
// Dark Mending
|
||||
else if (Rune_C > 0)
|
||||
{
|
||||
UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));
|
||||
damageType = DamageType.Cold;
|
||||
}
|
||||
// Freezing Grasp
|
||||
else if (Rune_D > 0)
|
||||
{
|
||||
UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));
|
||||
damageType = DamageType.Poison;
|
||||
}
|
||||
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 Skelet in (User as PlayerSystem.Player).NecroSkeletons)
|
||||
foreach (var skeleton in ((Player)User).NecroSkeletons)
|
||||
{
|
||||
//User.PlayEffectGroup(474172);
|
||||
ActorMover mover = new ActorMover(Skelet);
|
||||
ActorMover mover = new ActorMover(skeleton);
|
||||
mover.MoveArc(Target.Position, 6, -0.1f, new ACDTranslateArcMessage
|
||||
{
|
||||
//Field3 = 303110, // used for male barb leap, not needed?
|
||||
@ -1999,13 +2029,65 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem.Implementations
|
||||
Gravity = 0.6f,
|
||||
PowerSNO = PowerSNO
|
||||
});
|
||||
Skelet.Position = Target.Position;
|
||||
Skelet.PlayEffectGroup(474172);
|
||||
skeleton.Position = Target.Position;
|
||||
skeleton.SetVisible(true);
|
||||
skeleton.Hidden = false;
|
||||
skeleton.PlayEffectGroup(474172);
|
||||
|
||||
|
||||
WeaponDamage(Target, 0.50f, DamageType.Physical);
|
||||
AttackPayload attack = new AttackPayload(this)
|
||||
{
|
||||
Target = Target
|
||||
};
|
||||
attack.AddWeaponDamage(greaterDamage ? skeleton.Attributes[GameAttribute.Damage_Min, 0] * 2.15f : skeleton.Attributes[GameAttribute.Damage_Min, 0], damageType);
|
||||
attack.OnHit = hit =>
|
||||
{
|
||||
if (Rune_C > 0)
|
||||
{
|
||||
if (!HasBuff<DebuffFrozen>(hit.Target))
|
||||
{
|
||||
AddBuff(hit.Target, new DebuffFrozen(WaitSeconds(3.0f)));
|
||||
}
|
||||
}
|
||||
};
|
||||
attack.Apply();
|
||||
//AddBuff(Target, new DebuffStunned(WaitSeconds(0.3f)));
|
||||
}
|
||||
|
||||
// var player = (Player)User;
|
||||
// if (player.ActiveSkeletons)
|
||||
// {
|
||||
// while (player.NecroSkeletons.Count < 7)
|
||||
// {
|
||||
// var skeleton = new NecromancerSkeleton_A(World, ActorSno._p6_necro_commandskeletons_a, player);
|
||||
// skeleton.Brain.DeActivate();
|
||||
// skeleton.Scale = 1.2f;
|
||||
//
|
||||
// skeleton.EnterWorld(PowerContext.RandomDirection(player.Position, 3f, 8f));
|
||||
// player.NecroSkeletons.Add(skeleton);
|
||||
// /*this.InGameClient.SendMessage(new PetMessage()
|
||||
// {
|
||||
// Owner = this.PlayerIndex,
|
||||
// Index = this.CountFollowers(473147),
|
||||
// PetId = Skeleton.DynamicID(this),
|
||||
// Type = 70,
|
||||
// });
|
||||
// //*/
|
||||
// skeleton.Brain.Activate();
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// foreach (var skel in player.NecroSkeletons)
|
||||
// {
|
||||
// player.InGameClient.SendMessage(new PetDetachMessage()
|
||||
// {
|
||||
// PetId = skel.GlobalID
|
||||
// });
|
||||
// World.Leave(skel);
|
||||
// }
|
||||
//
|
||||
// player.NecroSkeletons.Clear();
|
||||
// }
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
|
||||
@ -109,34 +109,34 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem
|
||||
|
||||
public void GeneratePrimaryResource(float amount)
|
||||
{
|
||||
if (User is Player)
|
||||
if (User is Player player)
|
||||
{
|
||||
(User as Player).GeneratePrimaryResource(amount);
|
||||
player.GeneratePrimaryResource(amount);
|
||||
}
|
||||
}
|
||||
|
||||
public void UsePrimaryResource(float amount)
|
||||
{
|
||||
if (User is Player)
|
||||
if (User is Player player)
|
||||
{
|
||||
if (User.Attributes[GameAttribute.Free_Cast_All] != true)
|
||||
(User as Player).UsePrimaryResource(amount - User.Attributes[GameAttribute.Power_Resource_Reduction, PowerSNO]);
|
||||
if (player.Attributes[GameAttribute.Free_Cast_All] != true)
|
||||
player.UsePrimaryResource(amount - player.Attributes[GameAttribute.Power_Resource_Reduction, PowerSNO]);
|
||||
}
|
||||
}
|
||||
|
||||
public void GenerateSecondaryResource(float amount)
|
||||
{
|
||||
if (User is Player)
|
||||
if (User is Player player)
|
||||
{
|
||||
(User as Player).GenerateSecondaryResource(amount);
|
||||
player.GenerateSecondaryResource(amount);
|
||||
}
|
||||
}
|
||||
|
||||
public void UseSecondaryResource(float amount)
|
||||
{
|
||||
if (User is Player)
|
||||
if (User is Player player)
|
||||
{
|
||||
(User as Player).UseSecondaryResource(amount - User.Attributes[GameAttribute.Power_Resource_Reduction, PowerSNO]);
|
||||
player.UseSecondaryResource(amount - player.Attributes[GameAttribute.Power_Resource_Reduction, PowerSNO]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -275,7 +275,7 @@ namespace DiIiS_NA.GameServer.GSSystem.PowerSystem
|
||||
get
|
||||
{
|
||||
if (World.IsPvP)
|
||||
return (actor) => ((actor is Player && actor.GlobalID != User.GlobalID) || (actor is Minion && actor.GlobalID != User.GlobalID && (actor as Minion).Master.GlobalID != User.GlobalID));
|
||||
return (actor) => ((actor is Player && actor.GlobalID != User.GlobalID) || (actor is Minion minion && minion.GlobalID != User.GlobalID && minion.Master.GlobalID != User.GlobalID));
|
||||
else
|
||||
{
|
||||
if (User is Player || User is Minion || User is Hireling || (User is Monster && User.Attributes[GameAttribute.Team_Override] == 1) || User.SNO == ActorSno._pt_blacksmith_nonvendor || (User is Monster && User.Attributes[GameAttribute.Team_Override] == 1))
|
||||
|
||||
Loading…
Reference in New Issue
user.block.title