Tukaram

Member
Tukaram submitted a new resource:

Loot System - fully configurable loot addon

This was posted by KHzspeed at RunUO on 26SEP11. I am just sharing it because I like it :)

I found it when trying to figure out how to add loot to the existing lootpacks (I gave up when I found this). This a very cool system. Very minor edits to basecreature.cs. It does not interfere with the existing loot system, just runs alongside it.

It allows you to add any items you want to the loot system, but it affects ALL critters. The math is below, it is based on critter stats,...

Read more about this resource...
 
Great system.

I've been using it for a lot of things however I want to expand it.

So far I can get it to give multiple items based on region, however by chance know what the code would be to include magical properties?
 
Great system.

I've been using it for a lot of things however I want to expand it.

So far I can get it to give multiple items based on region, however by chance know what the code would be to include magical properties?

Was looking for a way to add all the anniversary gifts as rare drops in Trammel... kinda wanted to do it like the ToT drops... but I'll take this instead... I can do some minor scripting, but I think a fresh ToT system for the anniversary gifts may be over my head,. You say you got it to add by region? So certain dungeons? That would be cool. May I ask how?
 
Was looking for a way to add all the anniversary gifts as rare drops in Trammel... kinda wanted to do it like the ToT drops... but I'll take this instead... I can do some minor scripting, but I think a fresh ToT system for the anniversary gifts may be over my head,. You say you got it to add by region? So certain dungeons? That would be cool. May I ask how?

Apply the proper edits for regions... Try it your self and post your errors, That way the community can help you only way to learn is by trial and error!
 
Added this to the "Loot Validate" file... seems to work.

Code:
        private static bool CheckLocation(Mobile m)
        {
            Region r = m.Region;

            if (r.IsPartOf<Server.Regions.HouseRegion>() || Server.Multis.BaseBoat.FindBoatAt(m, m.Map) != null)
                return false;

            return (m.Map == Map.Trammel);
        }

Now I'm going from 1999 to current and recreating all the Anniversary Gifts... Just for something fun and nostalgic to collect. If I can manage it, they'll drop at random from mobs in Trammel, higher the fame the more often they'll drop... Still want to figure out how to make them drop in the players bag with a message, but I'll figure it out :)

Thanks for the advice.
 
As they say there are more then one way to skin a cat. Here is one way you can give that bag.

- When player or players kills enemy, attach an XML item to them and send them rewards gump.
- In rewards gump player must click collect rewards
- add a check in loginstats.cs to check for xml item upon login, if detected send gumo (in case they logout before collecting reward)
- Remove xml item when collecting reward and done.

Sure there is an easier way, I just like challenging myself. :)
 
So I'm trying to combine this with the In-game way to add Sovereigns script. I have no idea what I'm supposed to put in the LootList.cs for this. I know the item is a HeritageSovereign and I changed it to Regular Loot instead of Blessed. I'd also like to make them automatically drop into the players' backpack, like Scrolls of Power. Can anyone explain how to do this?
 
The way I did it (Definently not best practice) was inside BaseCreature.cs


switch(Utility.Random(20))
{
case 19: c.DropItem(new HeritageSovereign(5)); break;
}

I added that to the OnDeath() mechanic, which adds 5 sovereign drops to any mobile that runs BaseCreature OnDeath() (practically all of them)
 
That command just adds them to the enemy loot though, right? It doesn't put the sovereigns into your bag automatically?
 
That is correct. If you want to add it to your bag automatically, you'd have to write in an artifact drop type into the BaseCreature. I'm attaching one of my Base files that has artifact drop rate. Its about the only thing in the script, but you will need to add most of it to the BaseCreature.cs to make every creature (except ones that override artifact drop) drop Sovereigns as an artifact.
 

Attachments

  • BaseColdMob.cs
    4.4 KB · Views: 16
I appreciate the help you've provided, but I don't have a clue what I'm doing with that cs. I looked over it and I couldn't figure out which parts needed to go to BaseCreature, which parts needed to be altered, and which parts left out entirely. Is there anyway you could help me further? Sorry, I'm not great at coding, pretty basic actually. If you could tell me where (either line number or what's above) which parts need to go, I could probably work with that. If you need more details of what I'm wanting, the item I'm wanting to drop directly into players' bags is the sovereigns from the above script (HeritageSovereign.cs).
 
Oh wow I just noticed we are necroing an old post. I have no idea how to use the system in the above post, I thought you were asking for help in general. And unfortunately, adding items directly into backpack from ALL mobiles will require the changes to BaseCreature.cs, and I don't even know if they would work then (Having never tried myself). If you want, I can grab a new BaseCreature.cs, and attempt to do that and send you the file... or if anyone better at coding wants to give you a hand with a more elegant solution.
 
If you don't mind, you're the only one offering to help, so I'd appreciate anything you can do.
 
Here is a BaseCreature.cs that makes them drop Sovereigns into a players inventory on death. The formula for drop chance is on Line 300:
if (0.005 >= random)
return CreateArtifact(Sovereigns);

Change 0.005 to whatever chance you want it to be. 0.005 is .5% chance.

When you insert the new BaseCreature.cs it will pop up with 28 Warning(s) on Compile. You can ignore the warnings, or if you want to make them go away permanently, just modify the problematic classes to be override.

Edit - Its not letting me upload it to ServUO. Do you have Discord Szass?
 
Hi Tukaram,
Glad you are enjoying the system, and brought it to ServUO. This is KHz from Runuo btw.

There is one piece I have that goes with this system from Runuo that I don't see packaged with this release.
A Gumball machine that releases toy-capsules containing artifacts pertaining to the Loot system.

Change to your desired currency, and cost. (Typeof(*your Item Here*),*cost*))
if ( pack != null && pack.ConsumeTotal( typeof( Gold ), 60000 ))
{
from.SendMessage( 0x35, "You recieve a plastic Artifact Capsule" );
from.AddToBackpack( new ArtifactCapsule ());
}
 

Attachments

  • ArtiGumball Machine.zip
    1.6 KB · Views: 18
Hello to everyone. i have a big problem


Server Crash Report
===================

ServUO Version 0.5, Build 8431.36311
Operating System: Microsoft Windows NT 10.0.17763.0
.NET Framework: 4.0.30319.42000
Time: 5.02.2023 07:21:37
Mobiles: 43848
Items: 232376
Exception:
System.IndexOutOfRangeException: Dizin, dizi sınırlarının dışındaydı.
konum: Server.ArtifactList.RandomArtifact() C:\Users\Administrator\Desktop\UltimateUOServuo57 son\UltimateUOServuo57 son\ServUO Pub57\Scripts\Custom\LootSystem\Loot System\LootList.cs içinde: satır 68
konum: Server.Mobiles.ArtifactValidate.GiveArtifact(BaseCreature bc) C:\Users\Administrator\Desktop\UltimateUOServuo57 son\UltimateUOServuo57 son\ServUO Pub57\Scripts\Custom\LootSystem\Loot System\LootValidate.cs içinde: satır 38
konum: Server.Mobiles.BaseCreature.OnBeforeDeath() C:\Users\Administrator\Desktop\UltimateUOServuo57 son\UltimateUOServuo57 son\ServUO Pub57\Scripts\Mobiles\Normal\BaseCreature.cs içinde: satır 6664
konum: Server.Mobiles.BaseChampion.OnBeforeDeath() C:\Users\Administrator\Desktop\UltimateUOServuo57 son\UltimateUOServuo57 son\ServUO Pub57\Scripts\Mobiles\Bosses\BaseChampion.cs içinde: satır 250
konum: Server.Mobiles.Neira.OnBeforeDeath() C:\Users\Administrator\Desktop\UltimateUOServuo57 son\UltimateUOServuo57 son\ServUO Pub57\Scripts\Mobiles\Bosses\Neira.cs içinde: satır 197
konum: Server.Mobile.Kill()
konum: Server.Mobile.Damage(Int32 amount, Mobile from, Boolean informMount, Boolean checkDisrupt)
konum: Server.Mobiles.BaseCreature.Damage(Int32 amount, Mobile from, Boolean informMount, Boolean checkDisrupt) C:\Users\Administrator\Desktop\UltimateUOServuo57 son\UltimateUOServuo57 son\ServUO Pub57\Scripts\Mobiles\Normal\BaseCreature.cs içinde: satır 2035
konum: Server.AOS.Damage(IDamageable damageable, Mobile from, Int32 damage, Boolean ignoreArmor, Int32 phys, Int32 fire, Int32 cold, Int32 pois, Int32 nrgy, Int32 chaos, Int32 direct, Boolean keepAlive, DamageType type) C:\Users\Administrator\Desktop\UltimateUOServuo57 son\UltimateUOServuo57 son\ServUO Pub57\Scripts\Misc\AOS.cs içinde: satır 382
konum: Server.Items.BaseWeapon.OnHit(Mobile attacker, IDamageable damageable, Double damageBonus) C:\Users\Administrator\Desktop\UltimateUOServuo57 son\UltimateUOServuo57 son\ServUO Pub57\Scripts\Items\Equipment\Weapons\BaseWeapon.cs içinde: satır 2697
konum: Server.Items.BaseSword.OnHit(Mobile attacker, IDamageable damageable, Double damageBonus) C:\Users\Administrator\Desktop\UltimateUOServuo57 son\UltimateUOServuo57 son\ServUO Pub57\Scripts\Items\Equipment\Weapons\BaseSword.cs içinde: satır 62
konum: Server.Items.BaseWeapon.OnSwing(Mobile attacker, IDamageable damageable, Double damageBonus) C:\Users\Administrator\Desktop\UltimateUOServuo57 son\UltimateUOServuo57 son\ServUO Pub57\Scripts\Items\Equipment\Weapons\BaseWeapon.cs içinde: satır 1709
konum: Server.Items.BaseWeapon.OnSwing(Mobile attacker, IDamageable damageable) C:\Users\Administrator\Desktop\UltimateUOServuo57 son\UltimateUOServuo57 son\ServUO Pub57\Scripts\Items\Equipment\Weapons\BaseWeapon.cs içinde: satır 1654
konum: Server.Mobile.CombatTimer.OnTick()
konum: Server.Timer.Slice()
konum: Server.Core.Main(String[] args)


I am having this crash intermittently not only in neira but also in all other creatures. Sorry for my bad English, I'm translating.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back