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
➜ SMAUG coding
➜ How to check an area name?
How to check an area name?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Rash
United Kingdom (56 posts) Bio
|
Date
| Sun 07 Mar 2004 04:25 PM (UTC) |
Message
| Okay this may sound dumb but...
How do you check an area name in the code?
For example;
I want vassagos quest system to check area names to make sure it does NOT use limbo.are arena.are and a few others...
im not quite sure how to do it.
Rash | Top |
|
Posted by
| Nick Cash
USA (626 posts) Bio
|
Date
| Reply #1 on Sun 07 Mar 2004 07:11 PM (UTC) |
Message
| This is a rather simplistic view, but you'll get what I mean I think.
AREA_DATA *tarea;
for ( tarea = first_area; tarea; tarea = tarea->next )
{
if ( !str_cmp(tarea->filename,"limbo.are") )
{
generate_quest( again ); // Don't know the syntax :P
return;
}
if ( !str_cmp(tarea->filename,"arena.are") )
{
generate_quest( again ); // Don't know the syntax :P
return;
}
}
Of course you'll have to correct the generate_quest statements since I had no clue what the syntax for that is. Just add an extra if statement for each area. I think that will work, and at least give you something to to go off of. |
~Nick Cash
http://www.nick-cash.com | Top |
|
Posted by
| Nick Cash
USA (626 posts) Bio
|
Date
| Reply #2 on Sun 07 Mar 2004 07:24 PM (UTC) |
Message
| Hah, now that I think about it that really wouldn't work. The questmaster mob finds an object/mob randomly right? So looping through the areas wouldn't really do much..so that code isn't really doing anything, though it represents the right idea.
An if check some thing likes might work, and you'd need one per area:
Note: Suppose limbo's ranges were 10000 11000
-In the object quest code-
if (questitem->vnum >= 10000 && quesitem->vnum <= 11000 )
{
generate_quest( ch, questman );
return;
}
-In the mob quest code-
if (victim->vnum >= 10000 && victim->vnum <= 11000 )
{
generate_quest( ch, questman );
return;
}
Alternatively, instead of generating a new quest you could just use find_quest_mob and find_quest object respectively. |
~Nick Cash
http://www.nick-cash.com | 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.
11,636 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top