Is there a way to make probability of a MOB getting a weapon as loot to make loot ultra-rare? I.E. the mob will only have the item 10% of the time...
Random Items
Posted by Malti on Thu 27 Apr 2006 06:01 PM — 6 posts, 23,372 views.
You can do this with mudprogs on the death event. Just load the item if a rand() ifcheck is less than 10. It's not perfect -- the mob won't have the item until death. But it more or less works...
Forgive my ignorance, but i dont know how to do the if check. Is there a list of things you can if check?
There should be helpfiles named "help ifchecks" or something like that. If I remember correctly, there are 3: "ifchecks", "ifchecks2", "ifchecks3".
Your ifcheck would look something like:Note that I haven't written any mudprog for a while so I may have a few mistakes in there, but that's the general idea.
Your ifcheck would look something like:
if rand() < 10
mpoload vnum
endifif rand(10)
mpoload 9901 1
drop amulet
endifThis is the program I cam up with for random loot on the death_porg of a MOB. It does not work though, and I get wierd messages like "..it is out of your reach.." or "..but its under a pile of stuff..." that I never recieved before. Is there a way to put this in the corpse of the monster so that when it dies, the amulet is in the corpse if the rand condition is met?
Where are these messages appearing? They're typical of a bad mental state, that will give you funny messages like that. Normally, by oloading the object, it'll be in the mob's corpse to begin with, and you don't need to drop it.