as pro said , update deathflags properly about soul lock simply try to add it as flag for the pathfinding , aka if(plapla.flags.soullock) break or return without executing the pathfinding
about the first problem u can simply make 2 methods of CanAttack , Can'tAttack
add to the first that u can attack monsters , pole if it's war and if u r not polekeeper , whatever works for it and for can'tattack add pole while not war , add if ghost it can't attack
here is an example
Code:
public static bool CanAttack(Game.Entity attacker, Game.Entity attacked, Database.SpellInformation spell, bool melee)
{
if (spell != null)
if (spell.CanKill && attacker.EntityFlag == EntityFlag.Player && ServerBase.Constants.PKForbiddenMaps.Contains(attacker.Owner.Map.ID) && attacked.EntityFlag == EntityFlag.Player)
return false;
if (attacker.EntityFlag == EntityFlag.Player)
if (attacker.Owner.WatchingGroup != null)
return false;
if (attacked == null)
return false;
if (attacked.Dead)
{
attacker.AttackPacket = null;
return false;
}