sahisahi

Member
I dont know why but mobs randomly drop the same loot multiplied x2, what could be causing this?


acdn.discordapp.com_attachments_434282790154928128_437010187312693271_unknown.png


The loot from the right was a mummy


Edit, ok theres my basecreature and lootpack

( im not using lootpacks to generate the loot thought)
so there must be something wrong in basecreature

Thanks for your help
 

Attachments

  • BaseCreature.cs
    194.7 KB · Views: 1
  • Lootpack.cs
    60.8 KB · Views: 2
Last edited:
Does it happen to you only when you are in a party of 2? Since I think there was a loot split for that. Or asked in another way. Does the loot actually dupe or is it half of the normal amount each stack?
 
Hello @PyrO


Players said they are not in party whenever it happens.

The gold stack is the SAME amount, for example if an etting drops a random potion and 68 gold

it drops 2 potions, and 2 stacks of 68 :S like in the pic i attached

and no, the stack is not half of the normal amount.

it drops 2 potions and 2 stacks of 68 gold :confused::confused::confused::confused::confused:

this is a big issue because ive noticed few players farming high end mobs just to get double drop

it happens RANDOMLY

How loot is generated? so i can try to debug it, this is driving me crazy xD
 
Last edited:
show BaseLootpack, KillInfo and KPTEventSink too.

in basecreature I see only gold multiplier, which work only if u wear: Ring - "Codicia" and Gloves - "Gauntescodicia"
Code:
 PlayerMobile p = ds.m_Mobile as PlayerMobile;
                            int mTotalgold = 0;
                          
                            if (c.Items.Count > 0)
                            {
                                var list2 = new List<Item>(c.Items);
                                foreach (Item item in list2)
                                {
                                    if ( item is Gold )
                                        mTotalgold += item.Amount;
                                }
                              
                                   int bonusgoldmultiplier = 0;
                                  
                               if ( killerx.Player && killerx.FindItemOnLayer(Layer.Ring) is Codicia )
                                    bonusgoldmultiplier +=1;
                                if ( killerx.Player && killerx.FindItemOnLayer(Layer.Gloves) is Guantescodicia )
                                    bonusgoldmultiplier +=1;
                                            
                                int HalfGold = (mTotalgold / 4);
                                if( bonusgoldmultiplier > 0 )
                                  HalfGold = ( HalfGold * bonusgoldmultiplier );
                                            
                               if( bonusgoldmultiplier > 0 )
                                {
                                    c.DropItem(new Gold(HalfGold));
                                     killerx.PlaySound( Utility.RandomList( 52, 55,53,54 ) );
                                    killerx.SendMessage(2548,"Debido a tu Avaricia obtienes {0} monedas de oro EXTRA", HalfGold.ToString("#,0")); // .ToString("#,0") places commas in the number
                                }
                            }
 
Last edited:
Im using runuo 2.2 in case it helps, thanks for caring, if i ever get a donation on my server (i highly doubt it) i can send part of it to both of you.

The expansion is set to None, so theres no luck or anything like that
[doublepost=1524318443][/doublepost]
show BaseLootpack, KillInfo and KPTEventSink too.

in basecreature I see only gold multiplier, which work only if u wear: Ring - "Codicia" and Gloves - "Gauntescodicia"
Code:
 PlayerMobile p = ds.m_Mobile as PlayerMobile;
                            int mTotalgold = 0;
                       
                            if (c.Items.Count > 0)
                            {
                                var list2 = new List<Item>(c.Items);
                                foreach (Item item in list2)
                                {
                                    if ( item is Gold )
                                        mTotalgold += item.Amount;
                                }
                           
                                   int bonusgoldmultiplier = 0;
                               
                               if ( killerx.Player && killerx.FindItemOnLayer(Layer.Ring) is Codicia )
                                    bonusgoldmultiplier +=1;
                                if ( killerx.Player && killerx.FindItemOnLayer(Layer.Gloves) is Guantescodicia )
                                    bonusgoldmultiplier +=1;
                                         
                                int HalfGold = (mTotalgold / 4);
                                if( bonusgoldmultiplier > 0 )
                                  HalfGold = ( HalfGold * bonusgoldmultiplier );
                                         
                               if( bonusgoldmultiplier > 0 )
                                {
                                    c.DropItem(new Gold(HalfGold));
                                     killerx.PlaySound( Utility.RandomList( 52, 55,53,54 ) );
                                    killerx.SendMessage(2548,"Debido a tu Avaricia obtienes {0} monedas de oro EXTRA", HalfGold.ToString("#,0")); // .ToString("#,0") places commas in the number
                                }
                            }

Yes i know , but those codicia items are not im game, players are not wearing them, plus they would only multiply gold
Anyway i will get rid of that code

heres KPTEVENTSINK

Code:
using System;
using System.Net;
using System.Net.Sockets;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Accounting;
using Server.Network;
using Server.Guilds;
using Server.Commands;


namespace Server
{
        public delegate void OnKilledByEventHandler( OnKilledByEventArgs e );

            public class OnKilledByEventArgs : EventArgs
            {
                private Mobile m_Killed;
                private Mobile m_KilledBy;

            public OnKilledByEventArgs(Mobile killed, Mobile killedBy)
            {
                    this.m_Killed = killed;
                    this.m_KilledBy = killedBy;
            }

                public Mobile Killed
                {
                    get
                    {
                        return this.m_Killed;
                    }
            }
                public Mobile KilledBy
                {
                    get
                    {
                        return this.m_KilledBy;
                    }
            }
        }

    public static class KPTEventSink
    {
        public static event OnKilledByEventHandler OnKilledBy;


        public static void InvokeOnKilledBy( OnKilledByEventArgs e )
        {

            if ( OnKilledBy != null )
                OnKilledBy( e );
        }
    }
}

Edit i attached the KPT system (is not in game) players are no carrying that item either and its like a point system, not sure it it would dupe loot items, but who knows
 

Attachments

  • Killinfo.cs
    1.5 KB · Views: 2
  • BsaeLootPackEntry.cs
    2.6 KB · Views: 1
  • killpt2.rar
    7.8 KB · Views: 1
Last edited:
Unfortunately, I don't see where the problem. Need go to deep in the other scripts, which called when creature is dies. Maybe it's in the base Mobile.cs or in Corpse.cs occurs, or at all somewhere else, for example in some of regions which also can fix death.
 
I even had to shutdown the server, and its a fresh server, so it didnt had the best start ever

i attach corpse.cs and mobile.cs, thank in advance, if need any other script just tell me
 

Attachments

  • Corpse.cs
    47.5 KB · Views: 2
  • Mobile.cs
    282.8 KB · Views: 2
Try call stacktrace for EyeOf... contstructor, who item dropped from mummy:
Code:
            try
            {
                using (System.IO.StreamWriter op = new System.IO.StreamWriter("dupeBug.log", true))
                {
                    op.WriteLine("# {0} {1}", DateTime.Now, System.Threading.Thread.CurrentThread.Name);
                    op.WriteLine(Environment.StackTrace);
                    op.WriteLine();
                    op.WriteLine();
                }
            }

            catch
            {
                Console.WriteLine("Error logging dupeBug.log update");
            }
[doublepost=1524319870][/doublepost]it will show you the order of method calls by which you can try to find the problem. Start your server in debug mode.
 
i have to add that inside the Eyeofnewt constructor right?



# 4/21/2018 4:32:50 PM Core Thread
at System.Environment.get_StackTrace()
at Server.Items.EyesOfNewt..ctor(Int32 amount) in c:\Scripts\Custom\Adds\Items\Reagents\EyesOfNewt.cs:line 26
at Server.Mobiles.Zombie.OnBeforeDeath() in c:\Scripts\Mobiles\Monsters\Humanoid\Melee\Zombie.cs:line 61
at Server.Mobile.Kill()
at Server.Mobile.Damage(Int32 amount, Mobile from, Boolean informMount)
at Server.Mobiles.BaseCreature.Damage(Int32 amount, Mobile from) in c:\\Scripts\Mobiles\BaseCreature.cs:line 1055
at Server.AOS.Damage(Mobile m, Mobile from, Int32 damage, Boolean ignoreArmor, Int32 phys, Int32 fire, Int32 cold, Int32 pois, Int32 nrgy, Int32 chaos, Int32 direct, Boolean keepAlive, Boolean archer) in c:\Scripts\Misc\AOS.cs:line 76
at Server.Items.BaseWeapon.OnHit(Mobile attacker, Mobile defender, Double damageBonus) in c:\Scripts\Items\Weapons\BaseWeapon.cs:line 2811
at Server.Items.BaseAxe.OnHit(Mobile attacker, Mobile defender, Double damageBonus) in c:\Scripts\Items\Weapons\Axes\BaseAxe.cs:line 68
at Server.Items.BaseWeapon.OnHit(Mobile attacker, Mobile defender) in c:\Scripts\Items\Weapons\BaseWeapon.cs:line 1590
at Server.Items.BaseWeapon.SwingDelayTimer.OnTick() in c:\Scripts\Items\Weapons\BaseWeapon.cs:line 1208
at Server.Timer.Slice()
at Server.Core.Main(String[] args)


removed the codicia part, will add it back and see if it shows anything on the stacktrace thing
 
Last edited:
with the codicia part the log is the same, nothing different:


# 4/21/2018 4:49:00 PM Core Thread
at System.Environment.get_StackTrace()
at Server.Items.EyesOfNewt..ctor(Int32 amount) in c:\Scripts\Custom\Adds\Items\Reagents\EyesOfNewt.cs:line 26
at Server.Mobiles.Zombie.OnBeforeDeath() in c:\Scripts\Mobiles\Monsters\Humanoid\Melee\Zombie.cs:line 61
at Server.Mobile.Kill()
at Server.Mobile.Damage(Int32 amount, Mobile from, Boolean informMount)
at Server.Mobiles.BaseCreature.Damage(Int32 amount, Mobile from) in c:\Scripts\Mobiles\BaseCreature.cs:line 1055
at Server.AOS.Damage(Mobile m, Mobile from, Int32 damage, Boolean ignoreArmor, Int32 phys, Int32 fire, Int32 cold, Int32 pois, Int32 nrgy, Int32 chaos, Int32 direct, Boolean keepAlive, Boolean archer) in c:\Scripts\Misc\AOS.cs:line 76
at Server.Items.BaseWeapon.OnHit(Mobile attacker, Mobile defender, Double damageBonus) in c:\Scripts\Items\Weapons\BaseWeapon.cs:line 2811
at Server.Items.BaseAxe.OnHit(Mobile attacker, Mobile defender, Double damageBonus) in c:\Items\Weapons\Axes\BaseAxe.cs:line 68
at Server.Items.BaseWeapon.OnHit(Mobile attacker, Mobile defender) in c:\Scripts\Items\Weapons\BaseWeapon.cs:line 1590
at Server.Items.BaseWeapon.SwingDelayTimer.OnTick() in c:\Users\x\Desktop\09-04-2018 Testserver fixed - LOS\Scripts\Items\Weapons\BaseWeapon.cs:line 1208
at Server.Timer.Slice()
at Server.Core.Main(String[] args)

Zombie.cs


Code:
using Server.Items;

namespace Server.Mobiles
{
    [CorpseName( "a rotting corpse" )]
    public class Zombie : BaseCreature
    {
        [Constructable]
        public Zombie() : base( AIType.AI_SphereMelee, FightMode.Closest, 10, 1, 0.2, 0.4 )
        {
            Name = "Zombie";
            Body = 3;
            BaseSoundID = 471;

            SetStr( 46, 70 );
            SetDex( 31, 50 );
            SetInt( 26, 40 );

            SetHits( 308, 310 );

            SetDamage( 32, 37 );

            SetDamageType( ResistanceType.Physical, 100 );

            SetResistance( ResistanceType.Physical, 15, 20 );
            SetResistance( ResistanceType.Cold, 20, 30 );
            SetResistance( ResistanceType.Poison, 5, 10 );

            SetSkill( SkillName.MagicResist, 15.1, 40.0 );
            SetSkill( SkillName.Tactics, 35.1, 50.0 );
            SetSkill( SkillName.Wrestling, 35.1, 50.0 );

            Fame = 600;

            VirtualArmor = 18;
         
            switch ( Utility.Random( 10 ))
            {
                case 0: PackItem( new LeftArm() ); break;
                case 1: PackItem( new RightArm() ); break;
                case 2: PackItem( new Torso() ); break;
                case 3: PackItem( new Bone() ); break;
                case 4: PackItem( new RibCage() ); break;
                case 5: PackItem( new RibCage() ); break;
                case 6: PackItem( new BonePile() ); break;
                case 7: PackItem( new BonePile() ); break;
                case 8: PackItem( new BonePile() ); break;
                case 9: PackItem( new BonePile() ); break;
            }
        }

        public override void GenerateLoot()
        {
            PackGold(80,109);
        }

        public override bool OnBeforeDeath()
        {
              if( Utility.RandomDouble() <= 0.06 )
            {         
            AddItem(new EyesOfNewt(Utility.RandomMinMax(2, 6))); 
            }
             if (Utility.RandomDouble() <= 0.01)
            {
            switch ( Utility.Random(6) )
             {
                case 0: PackItem( new escuetocuello() ); break;
                case 1: PackItem( new escuetacasco() ); break;
                case 2: PackItem( new escuetoguantes() ); break;
                case 3: PackItem( new escuetopeto() ); break;
                case 4: PackItem( new escuetolegs() ); break;
                case 5: PackItem( new escuetabrazos() ); break;
             
             }
            }
            if (Utility.RandomDouble() <= 0.002)
            {
              AddItem(new bagescriba());
            }
            if ( Utility.Random( 400 ) == 1 )
            {
               AddItem(new Treasureball() );
             }
             if ( Utility.Random( 101 ) == 1 )
            {
               AddItem(new Bagofpotionsmenor() );
             }
             if ( Utility.Random( 101 ) == 1 )
            {
               AddItem(new BagOfScrollspvpmenor() );
             }
             //bolsa armadura roca negra///

         
        //    }
              // AddItem(new skillDeed( Utility.Random( 54 ),Utility.RandomMinMax(10, 20 )));
           //  }
          if ( Utility.Random( 495 ) == 1 )
            {
               AddItem(new skillDeed( Utility.Random( 54 ),Utility.RandomMinMax(1, 3 )));
             }

            /*if( Utility.RandomDouble() <= 0.03 )
            {         
            AddItem(new RandomAccWeap(Utility.RandomMinMax(3, 5))); 
            }*/
            if( Utility.RandomDouble() <= 0.005 )
            {
            switch ( Utility.Random(2) )
             {
            case 0: PackItem( new Bastondetamer() ); break;
            case 1: PackItem( new Martillodeherrero() ); break;
            }
            /*if ( Utility.Random(955) == 1 )
            {
            switch ( Utility.Random(15) )
             {
                case 0: PackItem( new CapeoftheTamer() ); break;
                case 1: PackItem( new SandalsoftheTamer() ); break;
                case 2: PackItem( new ApronoftheTamer() ); break;
                case 3: PackItem( new TamingShroud() ); break;
                case 4: PackItem( new Bandanatamer() ); break;
                case 5: PackItem( new Pantalonestamer() ); break;
                case 6: PackItem( new Monedaantigua(2) ); break; 
                case 7: PackItem(new ArmsofExpertSmithy() ); break;
                case 8: PackItem(new SashExpertSmithy() ); break;
                case 9: PackItem(new CapofExpertSmithy() ); break;
                case 10: PackItem(new GlovesofExpertSmithy() ); break;
                case 11: PackItem(new GorgetofExpertSmithy() ); break;
                case 12: PackItem(new LegsofExpertSmithy() ); break;
                case 13: PackItem(new TunicofExpertSmithy() ); break;
                 case 14: PackItem(new Ropatailor() ); break;
            }
     
          }*/
            }
          return base.OnBeforeDeath();
     
        }
     
        public override bool BleedImmune{ get{ return true; } }
        public override Poison PoisonImmune{ get{ return Poison.Regular; } }

        public Zombie( Serial serial ) : base( serial )
        {
        }

        public override OppositionGroup OppositionGroup
        {
            get{ return OppositionGroup.FeyAndUndead; }
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );
            writer.Write( 0 );
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();
        }
    }
}

Ive killed more than 1000 creatures and it didnt happened yet
 
You mean not duped items ?

Yes no duped items

right now i added a 100% drop rate to eyesofnewt so it will always generate the log

will keep killig until the dupe bug happens then will post here the log, hopefully it shows you something
 
No, i have rummage disabled,generated loot items are duped , same size stack amounts if a monster drop 42 gold it drops 2 stacks of 42 :confused:

every item just appears x2 weird!!

and it happens randomly, very strange

Have been killing for 2 hours, still no duped items
[doublepost=1524338496][/doublepost]@Juzzver could it be
Code:
c.AssignInstancedLoot();
in corpse.cs?
 
Last edited:
Perhaps, but it is necessary to reproduce an error to be sure of it then it is possible and to debug this method.
 
You are assigning a counter with base 1 to the "instanced" portion, and using one with base 0 in the "List Attackers" portion.

So with 1 attacker killing the mob, it should be producing double items every time due to instancing for attacker 0 and 1.

NM - I just realized this was from a year ago.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back