Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, Yandex, Exalead, DotBot, Bing

Members: 0
Guests: 11
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » Equipment drop concept
Forum Rules | Mark all | Recent Posts

Equipment drop concept
< Newer Topic :: Older Topic > add more spice to dropped equipment

Pages:<< prev 1 next >>
Post is unread #1 Jan 8, 2010, 1:13 pm
Go to the top of the page
Go to the bottom of the page

Atami
Fledgling
GroupMembers
Posts5
JoinedJan 8, 2010

I would like to implement a slight spice-up to how armor and weapons are dropped by npc's on death. My idea is to have the items drop at different "tiers", each tier having an extra dice or an added 5% to the armor class.

something like this:
int random = number_range( 1, 100 );
if ( obj->item_type == ITEM_WIELD || obj->item_type == ITEM_MISSILE_WIELD )
   /* Drop Tier 3 */
   if ( random > 94 )
   {
      obj->value[1] += 2;
      obj->value[5] = 2;  /* Value 5 now used in identification spells to show Tier level */
   }
   /* Drop Tier 2 */
   if ( random > 70 && random < 95 )
   {
      obj->value[1] += 1;
      obj->value[5] = 1;
   }
}


I can't find for the life of me where NPC's equipment is thrown into it's corpse; so im unsure where to stick something like the above.

I would also like to extend this to equipment but im not sure how to check that the item dropped is a piece of equipment without writing out a giant ugly check.

Any suggestions are greatly appreciated :)
       
Post is unread #2 Jan 8, 2010, 2:44 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,868
JoinedJul 26, 2005


I can't find for the life of me where NPC's equipment is thrown into it's corpse; so im unsure where to stick something like the above.

take a look at make_corpse in makeobjs.c it is down towards the end. Just incase you didn't know (which you probably do, but if you didn't now you will), only the stuff that is inventory is dropped etc.... well unless you use death programs etc... You might want to take a look at instead making it so that when the object is created it gets the bonus, then the mobiles will utilize the bonuses as well.


I would also like to extend this to equipment but im not sure how to check that the item dropped is a piece of equipment without writing out a giant ugly check.

Well that varies depending on what you do want it to modify and what you don't. Typically equipment is anything that can be picked up and worn.
       
Post is unread #3 Jan 8, 2010, 3:42 pm
Go to the top of the page
Go to the bottom of the page

Atami
Fledgling
GroupMembers
Posts5
JoinedJan 8, 2010

Thanks, Remcon.
Ahh, I didn't think of make_corpse :rolleyes:

You might want to take a look at instead making it so that when the object is created it gets the bonus

By this do you mean when the mob is reset with the weapon?

As far as equipment, I mean that I'm unsure on how to check the dropped item isn't something like a potion/projectile/etc so it doesn't mess with values on objects it shouldn't (i.e. anything which isn't worn)


On a side note relative to this topic;
Another idea i may look into is some sort of 'drop table'; in which you can define a number of item vnums a mob has a chance to drop. It would have to list the vnums of the object along with their percentage change of dropping, then on make_corpse a function to stuff the corpse with the loot. This could also manage the Tiering of the weapons/armor too.
       
Post is unread #4 Jan 8, 2010, 4:19 pm
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

There is something like that already created in Remcon's LOP codebase which can be found here. He calls them mudwide resets. The system also allows random mobs that will reset at random places. The system is really easier to port over from lop to smaugfuss. I was able to do it no problem and I am as newbish as you can get, though I have come a long way with my coding skills thanks to Remcon and everyone else here who has helped me out.
       
Post is unread #5 Jan 8, 2010, 4:25 pm
Go to the top of the page
Go to the bottom of the page

Atami
Fledgling
GroupMembers
Posts5
JoinedJan 8, 2010

There is something like that already created in Remcon's LOP codebase

Ah, cool, thanks, i'll take a look into it.
       
Pages:<< prev 1 next >>