Dethtim3

Member
Hello everybody i want to apologise in advanced for such a noob question but i cant for the life of me figure out how to add my own custom currency to monster drops if some one can point me in the right direction it would be much appreciated keep in mind im new thanks guys
 
Hello everybody i want to apologise in advanced for such a noob question but i cant for the life of me figure out how to add my own custom currency to monster drops if some one can point me in the right direction it would be much appreciated keep in mind im new thanks guys

If you want to add it to all monster drops, go to GenerateLoot method in BaseCreature.cs and add the currency in there.
Otherwise if you want specific groups of mobs you can make if statements there like this...

Code:
if (this is Skeleton || this is Ghoul || this is Wraith)
{
PackItem(new NewCurrency(Utility.RandomMinMax(5,10);
}

or you put them in each individual monsters respective class inside of GenerateLoot() method override.

Lastly, you can create a new array of objects together if you want diff items dropped or various amounts dropped for each array, for example.

Code:
public Type[] UndeadMonsters { get; private set; }

Artifacts = new[]
            {
                typeof(Skeleton), typeof(Ghoul), typeof(Wraith), typeof(Lich),
                typeof(LichLord), typeof(AncientLich), typeof(BoneMagi)
            };

and use that to check in the same method in BaseCreature and compare that to any type in that list, and if it is, then pack the currency amounts like above.
 
Ahhhh ok i see how your doing it so i downloaded a loot system that runs alongside the original look system and have added it in there plus the system download came with a read me file to help fix the basecreature.cs i Changed what needed to be fixed but am still not recieving my custom currency from drops these are my files
[doublepost=1483458053][/doublepost]This will also come in handy forgot to add on thread above. this is the loot system i used with the readme file
 

Attachments

  • LootList.cs
    1.4 KB · Views: 32
  • BaseCreature.cs
    216.2 KB · Views: 25
  • [ServUO.com]-Loot System.zip
    2 KB · Views: 31
Can you add your custom currency to a player (i.e. add gold 1000, add currency 1000)?
Depending on how you have your currency constructed, that could also be preventing it from being "visible" as loot. In my experience, I have seen custom currency appear as loot, but invisible (unless you use area interface on the corpse). The itemID is valid, the hue is what it's supposed to be, and it is set to be visible, but you can't see it.
 
I think he means are you trying to add the currency as "Physical Loot"? like how gold is on monsters? Or are you trying to make it a property in the code on a player? Like when this monster dies, award the player 100 currency (you dont actually see it, but people can access it with custom store scripts later on)

Im assuming you mean its the first one I was talking about. Typically the reason you cannot see it is because of a bad ItemID. You can literally copy the Silver.cs file and rename it and then add different colors and names to it and it can server as your other currency if you want. Thats probably the easiest way. It already handles the changing ID's if its stacking or the noise it makes when u drop it in a bag.
 
  • Like
Reactions: Zsu
yes i want it like regular currency so i went with coping the silver.cs and change to my currency but i get this error
 

Attachments

  • Capture.PNG
    Capture.PNG
    130.9 KB · Views: 43
yes i want it like regular currency so i went with coping the silver.cs and change to my currency but i get this error
First of all, it will be like 4344328432483x better if you used visual studio because then youll be able to see what errors are going on before hand.

Your likely getting an error because you have 2 classes with the same name. You dont need to remove the silver.cs, just copy and past it and then change all references from Silver to ReaperCoin. Including the class name, constructor, and serial method. You also can remove all references to factions in the using statements as well.

Also, change the namespace Server.Factions to Server.Items
 
The real erroer here though is because of the old ReaperToken class. They both are now named ReaperToken therefor it is telling you that there is an conflict.

Either rename or remove (rename would be safer) the old one besides chaning the namespace like Punkte said
 
Thanks all of you for your time it works as intended now ....just getting into all of this have alot more to learn haha
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back