Alcsaar
Member
Curious how you guys would go about doing this. I considered adding an account tag whenever some one has kills >= 5 that would basically flag it as a murderer account and then add another check that just makes notoriety.murderer for accounts with that tag, but it seems liked a mediocre way to go about doing it, and I wouldn't know if I could properly remove the tag when their kills dropped below 5 again.
I'm guessing theres no easy way to check if ANY character on an account has kills >= 5?
I've played around with using tags with code like this:
It partially works - as in, it will set the tag properly - however, if I include that bottom portion where it checks for the tag, it causes a server crash when someone tries to log into their character.
Obviously I'm missing something - I'm a bit confused on how the whole target object even works in this scenario. It seemed simple enough but now I'm not so sure.
I'm guessing theres no easy way to check if ANY character on an account has kills >= 5?
I've played around with using tags with code like this:
Code:
Account account = ( Account ) target.Account;
if (target.Kills >= 5 || (target.Body.IsMonster && IsSummoned(target as BaseCreature) && !(target is BaseFamiliar) && !(target is ArcaneFey) && !(target is Golem)) || (target is BaseCreature && (((BaseCreature)target).AlwaysMurderer || ((BaseCreature)target).IsAnimatedDead)))
{
account.SetTag("Murderer", "Yes");
return Notoriety.Murderer;
}
if (account.GetTag("Murderer") == "Yes")
{
return Notoriety.Murderer;
}
It partially works - as in, it will set the tag properly - however, if I include that bottom portion where it checks for the tag, it causes a server crash when someone tries to log into their character.
Code:
RunUO Version 0.5, Build 6225.41352
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.42000
Time: 1/20/2017 2:47:02 PM
Mobiles: 2354
Items: 108029
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Misc.NotorietyHandlers.MobileNotoriety(Mobile source, IDamageable damageable)
at VitaNex.NotoUtility.MobileNotoriety(Mobile a, Mobile b)
at Server.Network.MobileIncoming..ctor(Mobile beholder, Mobile beheld) in c:\Users\John\Desktop\ServUO-master\Server\Network\Packets.cs:line 3861
at Server.Network.MobileIncoming.Create(NetState ns, Mobile beholder, Mobile beheld) in c:\Users\John\Desktop\ServUO-master\Server\Network\Packets.cs:line 3807
at Server.Mobile.SendEverything() in c:\Users\John\Desktop\ServUO-master\Server\Mobile.cs:line 7439
at Server.Mobile.set_Map(Map value) in c:\Users\John\Desktop\ServUO-master\Server\Mobile.cs:line 7565
at Server.Mobile.set_NetState(NetState value) in c:\Users\John\Desktop\ServUO-master\Server\Mobile.cs:line 8876
at Server.Network.PacketHandlers.PlayCharacter(NetState state, PacketReader pvSrc) in c:\Users\John\Desktop\ServUO-master\Server\Network\PacketHandlers.cs:line 2437
at Server.Network.MessagePump.HandleReceive(NetState ns) in c:\Users\John\Desktop\ServUO-master\Server\Network\MessagePump.cs:line 187
at Server.Network.MessagePump.Slice() in c:\Users\John\Desktop\ServUO-master\Server\Network\MessagePump.cs:line 121
at Server.Core.Main(String[] args) in c:\Users\John\Desktop\ServUO-master\Server\Main.cs:line 577
Obviously I'm missing something - I'm a bit confused on how the whole target object even works in this scenario. It seemed simple enough but now I'm not so sure.
Last edited: