[Control command to control an npc

Michele

Citizen
Hy guys, ive this script (attached) for NPC controls by GM.

I try to install in servuo, no error, compile, but when i use command gm go into npc, but server crash.

Also i have this in crash log:

Server.Mobile.get_PropertyList() in C:\Users\JR\Downloads\Olam Server for Merge\Server\Mobile.cs:riga 9727

I dont understand what is: Jr\download\olam server for merge.......... i havent this folder... my folder on server is C:\users\desktop\olamserver

Here a log:

ServUO Version 0.5, Build 6650.29881
Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1
.NET Framework: 4.0.30319.42000
Time: 20/03/2018 19:55:36
Mobiles: 204
Items: 3345
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Mobiles.PlayerMobile.GetProperties(ObjectPropertyList list)
at Server.Mobile.get_PropertyList() in C:\Users\JR\Downloads\Olam Server for Merge\Server\Mobile.cs:line 9727
at Server.Mobile.InvalidateProperties() in C:\Users\JR\Downloads\Olam Server for Merge\Server\Mobile.cs:line 9754
at Server.Mobile.UpdateTotal(Item sender, TotalType type, Int32 delta) in C:\Users\JR\Downloads\Olam Server for Merge\Server\Mobile.cs:line 2574
at Server.Mobile.RemoveItem(Item item) in C:\Users\JR\Downloads\Olam Server for Merge\Server\Mobile.cs:line 6761
at Server.Mobile.AddItem(Item item) in C:\Users\JR\Downloads\Olam Server for Merge\Server\Mobile.cs:line 6703
at Server.Mobile.EquipItem(Item item) in C:\Users\JR\Downloads\Olam Server for Merge\Server\Mobile.cs:line 10971
at Server.Commands.ControlCommand.MoveEquip(Mobile from, Mobile to, Boolean fromBackpack)
at Server.Commands.ControlCommand.StartControl(Mobile from, Mobile target, Boolean stats, Boolean skills, Boolean items)
at Server.Commands.ControlCommand.InternalTarget.OnTarget(Mobile from, Object targeted)
at Server.Targeting.Target.Invoke(Mobile from, Object targeted) in C:\Users\JR\Downloads\Olam Server for Merge\Server\Targeting\Target.cs:line 278
at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc) in C:\Users\JR\Downloads\Olam Server for Merge\Server\Network\PacketHandlers.cs:line 1346
at Server.Network.MessagePump.HandleReceive(NetState ns) in C:\Users\JR\Downloads\Olam Server for Merge\Server\Network\MessagePump.cs:line 300
at Server.Network.MessagePump.Slice() in C:\Users\JR\Downloads\Olam Server for Merge\Server\Network\MessagePump.cs:line 121
at Server.Core.Main(String[] args) in C:\Users\JR\Downloads\Olam Server for Merge\Server\Main.cs:line 588

Clients:
- Count: 1


Ty if someone help, i realese script after fixing.

All credits to:
Quick_silver
for www.Welt-von-Midgrd.ch
 

Attachments

  • Control.cs
    19.3 KB · Views: 23
Last edited:

Juzzver

Citizen
The problem with your custom scripts that try to deduce the labels for non-existent parameters of NPC.
Change in PlayerMobile.cs

Code:
                if (((Account)this.Account).GetTag("Age of " + (this.RawName)) != null)
                    list.Add(String.Format("<BASEFONT COLOR=WHITE>{0}", "Age: " + ((Account)this.Account).GetTag("Age of " + (this.RawName))));
to:
Code:
            if (((Account)this.Account) != null)
                if (((Account)this.Account).GetTag("Age of " + (this.RawName)) != null)
                    list.Add(String.Format("<BASEFONT COLOR=WHITE>{0}", "Age: " + ((Account)this.Account).GetTag("Age of " + (this.RawName))));
 

tr1age

Citizen
Will this work on the latest repo? This is such an amazing feature for EM run events, surprised it didn't get bakes it into servuo!