Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register


This is a discussion on "Removal of the Holy Magic Symbols" in the Top Mud Sites MUD Coding forum :

I am trying to remove the need of the Holy Magic Symbols from my circle mud. But how can i make so that regardless if the spell has 1, 2, 3 or more words it should know where to end and find the "target" Many thanks ierodules /GoaX Mud...



You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our MUD community today!

If you have any problems with the registration process or your account login, please contact us.

If you are a registered member of the old TMS forums, please click here
Reply
 
LinkBack Thread Tools
Old 03-15-2004, 11:10 AM   #1
xanthic
New Member
 
Join Date: Dec 2003
Posts: 6
xanthic is on a distinguished road
I am trying to remove the need of the Holy Magic Symbols from my circle mud. But how can i make so that regardless if the spell has 1, 2, 3 or more words it should know where to end and find the "target"

Many thanks ierodules /GoaX Mud
xanthic is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-15-2004, 02:03 PM   #2
welcor
Member
 
Join Date: Apr 2002
Location: Aarhus, Denmark, Europe
Posts: 59
welcor is on a distinguished road
Send a message via ICQ to welcor
Though I've not done this myself, What you need to do is something along these lines.
Current setup:
do_cast uses strtok to find the abbreviated spell name between two ''s:
[code] /* get; blank, spell name, target name */
s = strtok(argument, "'");

if (s == NULL) {
send_to_char(ch, "Cast what where?\r\n");
return;
}
s = strtok(NULL, "'");
if (s == NULL) {
send_to_char(ch, "Spell names must be enclosed in the Holy Magic Symbols; '\r\n");
return;
}
t = strtok(NULL, "\0");

/* spellnum = search_block(s, spells, 0); */
spellnum = find_skill_num(s);

if ((spellnum < 1) || (spellnum > MAX_SPELLS)) {
send_to_char(ch, "Cast what?!?\r\n");
return;
}[/quote]

Try this on for size:

[code] skip_spaces(&argument);
if (!*argument) {
send_to_char(ch, "Cast what where?\r\n");
return;
}

spellnum = find_skill_num(argument);

if ((spellnum < 1) || (spellnum > MAX_SPELLS)) {
/*
* if we didn't find it, maybe the last word is a target name
* .. let's split this argument at the last space.
*/
t = strrchr(argument, ' ');
if (!t) {
send_to_char(ch, "Cast what?!?\r\n");
return;
}
t++ = '\0'; /* NULL-terminate argument */
spellnum = find_skill_num(argument);
if ((spellnum < 1) || (spellnum > MAX_SPELLS)) {
send_to_char(ch, "Cast what?!?\r\n");
return;
}
}
[/quote]

I hope this helps.
welcor is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Thread Tools


Removal of the Holy Magic Symbols - Similar Threads
Thread Thread Starter Forum Replies Last Post
More Subtle Magic NotL337 Advanced MUD Concepts 9 07-30-2006 01:59 AM
Holy Crap soljax Tavern of the Blue Hand 15 12-19-2003 12:00 AM
The Holy Grail- Free MU* Hosting Faye MUD Administration 2 08-27-2002 03:53 AM
candle magic Burr Advanced MUD Concepts 5 06-21-2002 09:50 PM
random magic Burr Advanced MUD Concepts 0 06-14-2002 02:09 PM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT -4. The time now is 09:08 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Style based on a design by Essilor
Copyright Top Mud Sites.com 2007