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
➜ ROM
➜ Compiling the server
➜ ROM 2.4b6 Weapon check, skill
|
ROM 2.4b6 Weapon check, skill
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| GamerStudent101
(4 posts) Bio
|
| Date
| Thu 12 Jul 2007 03:55 AM (UTC) |
| Message
| Was working on a skill on ROM 2.4b6 called charge (follows same rules as backstab pretty much) but I want it to require a polearm type weapon now I see its got a check to see if the player is wearing a weapon.
if ( ( obj = get_eq_char( ch, WEAR_WIELD ) ) == NULL)
I was just wondering how would I make a check for the type of weapon. | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #1 on Thu 12 Jul 2007 04:04 AM (UTC) |
| Message
| | I believe that the backstab code does exactly this already -- check the part where it looks at the object value and writes out that you need a piercing or stabbing weapon. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | Top |
|
| Posted by
| GamerStudent101
(4 posts) Bio
|
| Date
| Reply #2 on Thu 12 Jul 2007 04:12 AM (UTC) |
| Message
| I dont see anything else checking for a weapon or a dam_type in the code. I also searched all the other skills in the game that I thought would require a certain weapon.
I believe though that its essentially just stock in skill/spell aspects.
Just incase I missed somthing.
if ( ( obj = get_eq_char( ch, WEAR_WIELD ) ) == NULL)
{
send_to_char( "You need to wield a weapon to backstab.\n\r", ch );
return;
}
if ( victim->hit < victim->max_hit / 3)
{
act( "$N is hurt and suspicious ... you can't sneak up.",
ch, NULL, victim, TO_CHAR );
return;
}
check_killer( ch, victim );
WAIT_STATE( ch, skill_table[gsn_backstab].beats );
if ( number_percent( ) < get_skill(ch,gsn_backstab)
|| ( get_skill(ch,gsn_backstab) >= 2 && !IS_AWAKE(victim) ) )
{
check_improve(ch,gsn_backstab,TRUE,1);
multi_hit( ch, victim, gsn_backstab );
}
else
{
check_improve(ch,gsn_backstab,FALSE,1);
damage( ch, victim, 0, gsn_backstab,DAM_NONE,TRUE);
}
return;
}
- Thx for the prompt reply | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #3 on Thu 12 Jul 2007 05:07 AM (UTC) |
| Message
| Oh... maybe it was changed after ROM.
In any case the damage type is not an actual data field of the object structure; it is one of the object values. To find out which one exactly, you should look at build.c and in there, at do_oset or something similar. There you should look for the code that handles setting the weapon's damage type.
It is possible that it won't be there because damage type is set using the numeric values. In that case, you should be able to find out which object value corresponds to which parameter in the help files; I think it's either help itemvalues or help objectvalues.
Also in the help values will you find the numeric value for the damage types, and if not, it'll be in the code for sure (in mud.h, perhaps). |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | 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.
16,267 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top