Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ Running the server
➜ Trouble with object levels
Trouble with object levels
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Kelsid
USA (35 posts) Bio
|
Date
| Sun 30 Sep 2001 02:41 PM (UTC) |
Message
| Im experiencing some troubles with the levels associated with objects...(ex. Weapons to be bought in shops).I cant seem to find the object level fot an object within the area file, no find any reference on what determines the level. I can reset a value manually using the oset command, However, the value is reset upon restart. If anyone can help with this problem... it would be appreciated. |
-Kelsid | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Mon 01 Oct 2001 02:04 AM (UTC) |
Message
| I believe this behaviour is by design, to stop levels having objects of inappropriate power in them.
Thus, the level of an object is calculated randomly at runtime (not from the area file) depending on the area's level range. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Kelsid
USA (35 posts) Bio
|
Date
| Reply #2 on Mon 01 Oct 2001 06:33 AM (UTC) |
Message
| Ok... I was doing a little digging in the help files... and realize in Weapondamage... that for weapons... the level is randomly determined based on the amount of damage it is capable of doing.. or at least to that affect.
WEAPONDAMAGE
The damage a weapon does depends on the values you set when you make the object. Value1 refers to the number of die used, and Value2 refers to the number of sides on the die used. (Example: Val1=5, Val2=4 - generates a damage range of 5-20 (ave 13). If no values are specified, the MUD will generate the appropriate damage done by the weapon based on its level.
This table is intended to use as a guideline when generating damage for weapons, it's based on the numbers the MUD generates;
Level | Ave Damage Level | Ave Damage
------+---------------- ------+----------------
1 | 1 - 6 (3) 30 | 8 - 30 (19)
5 | 2 - 10 (6) 35 | 11 - 32 (21)
10 | 5 - 13 (9) 40 | 12 - 38 (25)
15 | 5 - 17 (11) 45 | 14 - 41 (27)
20 | 6 - 22 (14) 50 | 15 - 43 (29)
25 | 10 - 24 (17)
Ok... now assuming that this information is accurate. Where should I go about altering or omitting this? I realize that this is no easy task, and actually should be posted with the compiling questions (as I know it will take a recomplile). But if anyone could please point me in the right direction... it would help alot.
Specificly what Im trying to do is to create an object... say a claidmore. The damage Id like it to represent is 1d10. I want it however to be available for 2nd level characters to buy at the local store. according to this chart, It would make it at least level 5, hence the youngings could not purchase it. Idealily Id like to omit this system completely and bind the level of the weapon to the object in an area file. (So I can manully set every object just like a normal flag value). Like I said... I know its going to require some altering to the code, I just would like some ideas on where to start.
Thanks alot |
-Kelsid | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #3 on Mon 01 Oct 2001 11:16 PM (UTC) |
Message
| In reset.c there is a function "generate_itemlevel" that seems to generate the levels - I would change that.
Also you would need to store your level in the area file somewhere. Probably make it so that if the level is zero it does what it currently does, but if not, takes the supplied value. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Kelsid
USA (35 posts) Bio
|
Date
| Reply #4 on Tue 02 Oct 2001 03:07 PM (UTC) Amended on Sun 07 Oct 2001 12:53 AM (UTC) by Nick Gammon
|
Message
| Thanks Nick!!,
I removed all of the cases associated with generate_objectlevel (with the exception of the default 0) in reset.c... then I started my quest to find how to bind olevel (which seems to be the varible for the object level) to an area file. I ended up with two files grub.c and mpxset.c, I decided on the latter... mpxset.c after lookin through the file.. I made some alterations that seemed to make sense... I want to bind olevel to value5 within the area file.
This is the relevant code:
switch( obj->item_type )
{
case ITEM_WEAPON:
if ( !str_cmp( arg2, "weapontype" ) )
{
int x;
value = -1;
for ( x = 0; x < sizeof( attack_table ) / sizeof( attack_table[0] ); x++ )
if ( !str_cmp( arg3, attack_table[x] ) )
value = x;
if ( value < 0 )
{
progbug("MpOset: Invalid weapon type", ch);
return;
}
tmp = 3;
break;
}
if ( !str_cmp( arg2, "condition" ) ) tmp = 0;
if ( !str_cmp( arg2, "olevel" ) ) tmp = 5;
break;
case ITEM_ARMOR:
if ( !str_cmp( arg2, "condition" ) ) tmp = 3;
if ( !str_cmp( arg2, "ac" ) ) tmp = 1;
if ( !str_cmp( arg2, "olevel" ) ) tmp = 5;
break;
case ITEM_SALVE:
if ( !str_cmp( arg2, "slevel" ) ) tmp = 0;
if ( !str_cmp( arg2, "maxdoses" ) ) tmp = 1;
if ( !str_cmp( arg2, "doses" ) ) tmp = 2;
if ( !str_cmp( arg2, "delay" ) ) tmp = 3;
if ( !str_cmp( arg2, "spell1" ) ) tmp = 4;
if ( !str_cmp( arg2, "spell2" ) ) tmp = 5;
if ( tmp >=4 && tmp <= 5 ) value = skill_lookup(arg3);
break;
case ITEM_SCROLL:
if ( !str_cmp( arg2, "olevel" ) ) tmp = 5;
break;
case ITEM_POTION:
if ( !str_cmp( arg2, "olevel" ) ) tmp = 5;
break;
case ITEM_PILL:
if ( !str_cmp( arg2, "slevel" ) ) tmp = 0;
if ( !str_cmp( arg2, "spell1" ) ) tmp = 1;
if ( !str_cmp( arg2, "spell2" ) ) tmp = 2;
if ( !str_cmp( arg2, "spell3" ) ) tmp = 3;
if ( !str_cmp( arg2, "olevel" ) ) tmp = 5;
if ( tmp >=1 && tmp <= 3 ) value = skill_lookup(arg3);
break;
case ITEM_STAFF:
if ( !str_cmp( arg2, "olevel" ) ) tmp = 5;
break;
case ITEM_WAND:
if ( !str_cmp( arg2, "slevel" ) ) tmp = 0;
if ( !str_cmp( arg2, "spell" ) )
{
tmp = 3;
value = skill_lookup(arg3);
}
if ( !str_cmp( arg2, "maxcharges" ) ) tmp = 1;
if ( !str_cmp( arg2, "charges" ) ) tmp = 2;
if ( !str_cmp( arg2, "olevel" ) ) tmp = 5;
break;
I added the lines with "olevel" in them.
Anyways... after a recompile, My shopkeepers sell everything at level 0 (Which makes sense because that is the default). However... the value5 value in the object has no effect on the level. Im wondering if I need to override the default olevel listed in reset.c somehow.... If you have any thoughts on this matter, please tell me what im doing wrong :). In any case, thanks for pointing me in the right direction.
|
-Kelsid | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #5 on Sun 07 Oct 2001 12:57 AM (UTC) |
Message
| I added the [code] tag to your post to make the code more readable. :)
I think the problem is that place you have added it. It is in function do_mposet which I think will only apply to the mob program "mposet". I doubt grub.c is correct either.
I would look for another place to add the changes. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Rok
(41 posts) Bio
|
Date
| Reply #6 on Tue 16 Oct 2001 04:57 AM (UTC) |
Message
| I'm not quite sure what you are trying to do, but if you are trying to do what I did, and that is to remove the level all together then I can help, just leave a message and I'll post what I put, but I don't think that is what you are trying to do and I don't want to feel more stupid then I already do by posting something you don't need. |
The always thankful
~ROK~
(~Hey you~) | Top |
|
Posted by
| Kelsid
USA (35 posts) Bio
|
Date
| Reply #7 on Tue 16 Oct 2001 07:36 PM (UTC) |
Message
| Thanks Rok,
But actually.. what I did was assigned a value (value5) as the objects level. Its stored in the area file. This way I set what levels I want the objects to have. So... I can limit what players can buy (Until they reach that level that is). If anyone wants the code I came up with just let me know.
-Kelsid |
-Kelsid | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
21,269 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top