Clean up and little fix =)

This commit is contained in:
iEvE 2023-01-21 13:29:40 +10:00 committed by pr701
parent 21e9d3daa7
commit 2d1302758f
5 changed files with 6 additions and 42 deletions

View File

@ -191,9 +191,6 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
}
else
{
//if ((this.Body as Minion).Master.World != (this.Body as Minion).World)
//this.Body.ChangeWorld((this.Body as Minion).Master.World, (this.Body as Minion).Master.Position);
var distToMaster = PowerMath.Distance2D(this.Body.Position, (this.Body as Minion).Master.Position);
if ((distToMaster > 8f) || (distToMaster < 3f))
{

View File

@ -1,4 +1,4 @@
//Blizzless Project 2022
//Blizzless Project 2022
using System;
//Blizzless Project 2022
using System.Collections.Generic;
@ -90,14 +90,6 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
this.Body.SNO == ActorSno._a4dun_garden_corruption_monster ||
this.Body.SNO == ActorSno._a4dun_garden_hellportal_pillar)
return;
//if(AttackedBy != null && TimeoutAttacked == null)
// TimeoutAttacked = new SecondsTickTimer(this.Body.World.Game, 3.0f);
//if (TimeoutAttacked != null)
// if (TimeoutAttacked.TimedOut)
// {
// TimeoutAttacked = null;
// AttackedBy = null;
// }
if (this.Body.SNO == ActorSno._belialvoiceover) //BelialVoiceover
return;
if (this.Body.Hidden == true)
@ -113,16 +105,13 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
if (!(tickCounter % 60 == 0)) return;
// this needed? /mdz
if (this.Body is NPC) return;
//preventing "phantom attacks"
if (!this.Body.Visible || this.Body.Dead) return;
if (this.Body.World.Game.Paused) return;
if (this.Body.Attributes[GameAttribute.Disabled]) return;
// check if in disabled state, if so cancel any action then do nothing
if (this.Body.Attributes[GameAttribute.Frozen] ||
this.Body.Attributes[GameAttribute.Stunned] ||
this.Body.Attributes[GameAttribute.Blind] ||
@ -162,16 +151,9 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
else
this.Feared = false;
// select and start executing a power if no active action
if (this.CurrentAction == null)// || this.CurrentAction is MoveToTargetWithPathfindAction)
if (this.CurrentAction == null)
{
/*if (this.CurrentAction != null)
{
this.CurrentAction.Cancel(tickCounter);
this.CurrentAction = null;
}*/
// do a little delay so groups of monsters don't all execute at once
if (_powerDelay == null)
_powerDelay = new SecondsTickTimer(this.Body.World.Game, 1.0f);
if (AttackedBy != null || this.Body.GetObjectsInRange<Player>(50f).Count != 0)
@ -187,7 +169,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
{
List<Actor> targets = new List<Actor>();
if (this.Body.Attributes[GameAttribute.Team_Override] == 1)// && !this.Body.Attributes[GameAttribute.Immune_To_Charm])
if (this.Body.Attributes[GameAttribute.Team_Override] == 1)
targets = this.Body.GetObjectsInRange<Monster>(60f)
.Where(p => !p.Dead)
.OrderBy((monster) => PowerMath.Distance2D(monster.Position, this.Body.Position))
@ -221,9 +203,8 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
if (targetDistance < attackRange + _target.ActorData.Cylinder.Ax2)
{
if (this.Body.WalkSpeed != 0)
this.Body.TranslateFacing(_target.Position, false); //columns and other non-walkable shit can't turn
this.Body.TranslateFacing(_target.Position, false);
//Logger.Trace("PowerAction to target");
this.CurrentAction = new PowerAction(this.Body, powerToUse, _target);
if (power is SummoningSkill)
@ -253,14 +234,7 @@ namespace DiIiS_NA.GameServer.GSSystem.AISystem.Brains
Logger.Trace("MoveToTargetWithPathfindAction to target");
this.CurrentAction = new MoveToTargetWithPathfindAction(
this.Body,
//(
_target,// + MovementHelpers.GetMovementPosition(
//new Vector3D(0, 0, 0),
//this.Body.WalkSpeed,
//MovementHelpers.GetFacingAngle(_target.Position, this.Body.Position),
//6
//)
//)
_target,
attackRange + _target.ActorData.Cylinder.Ax2,
powerToUse
);

View File

@ -341,7 +341,6 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
if (OverridedConv)
UpdateConversationList();
}
public void Consume(GameClient client, GameMessage message)
{
if (message is NPCSelectConversationMessage) OnSelectConversation(client.Player, message as NPCSelectConversationMessage);
@ -350,27 +349,22 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
if (message is CraftInteractionMessage) OnCraft(client.Player);
else return;
}
public virtual void OnCraft(Player player)
{
throw new NotImplementedException();
}
public virtual void OnInventory(Player player)
{
throw new NotImplementedException();
}
public virtual void OnInventory(Player player, HirelingInventoryMessage message)
{
throw new NotImplementedException();
}
public virtual void OnHire(Player player)
{
throw new NotImplementedException();
}
private void OnSelectConversation(Player player, NPCSelectConversationMessage message)
{
var conversation = Conversations.FirstOrDefault(conv => conv.ConversationSNO == message.ConversationSNO);

View File

@ -17,6 +17,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ActorSystem
{
this.Field2 = 0x9;
this.Field7 = 1;
this.Attributes[GameAttribute.TeamID] = 2;
this.Attributes[GameAttribute.Is_NPC] = true;
}
}

View File

@ -26,8 +26,6 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
public GSBackend(string BattletHost, int BattlePort)
{
this.BattleNetSocket = new WatsonTcpClient(BattletHost, BattlePort, this._senderServerConnected, this._senderServerDisconnected, this._senderMessageReceived, false);
//Logger.Info("Sender started at {0}:{1}", MooNetHost, MooNetPort);
//client.Send(Encoding.UTF8.GetBytes(userInput));
}