**edit:: i was jumping the gun by posting here as i was able to fix this by calling on the killer.Backpack for the container. No help needed!!
Learning c# more and more everyday :D

//

Hi all, the original creator of odyssey is no longer present in these forums, so i'm posting here for help with a function added by creator Djeryv.

The function Lootmutate is defined in containerfunctions.cs lines 1823 to 2034 (attached)

A few scripts calls this function and i've uploaded satyr.cs, which calls the function if the killer of the basemobile is a playermobile.

here's my error:

C#:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Server.Misc.ContainerFunctions.LootMutate(Mobile from, Int32 luckChance, Item item, Container box, Int32 level)
   at Server.Mobiles.Satyr.OnDeath(Container c)
   at Server.Mobile.Kill()
   at Server.Mobile.Damage(Int32 amount, Mobile from, Boolean informMount)
   at Server.Mobiles.BaseCreature.Damage(Int32 amount, Mobile from)
   at Server.Commands.Generic.KillCommand.Execute(CommandEventArgs e, Object obj)
   at Server.Commands.Generic.BaseCommandImplementor.RunCommand(Mobile from, Object obj, BaseCommand command, String[] args)
   at Server.Commands.Generic.SingleCommandImplementor.OnTarget(Mobile from, Object targeted, Object state)
   at Server.Mobile.SimpleStateTarget.OnTarget(Mobile from, Object targeted)
   at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
   at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
   at Server.Network.MessagePump.HandleReceive(NetState ns)
   at Server.Network.MessagePump.Slice()
   at Server.Core.Main(String[] args)

here is how satyr.cs calls the function:

Server.Misc.ContainerFunctions.LootMutate( killer, Server.LootPack.GetRegularLuckChance( killer ), item, null, 5 );

since there is "null" as containerbox in the line i thought this was the issue, however the containerfunctions.cs sets container value right away, so that shouldn't matter.
I know this is a custom script, but any help is really appreciated with this one.
 

Attachments

  • Satyr.cs
    8 KB · Views: 2
  • ContainerFunctions.cs
    136.1 KB · Views: 1
Last edited:
Back