Gambler Mod

Posted by Warsong on Thu 24 Apr 2003 03:18 AM — 10 posts, 32,913 views.

#0
Anyone have a working gambler mod for smaug? I have added the changes that are required but I am still missing something somewhere. The code compiles ok with no errors, but its still not quite right. I need to assign spec_gambler to the mob that is to be the gambler but that choice is not available. I pretty sure the problem lies in special.c so with that inj mind heres some code snips that I added:

DECLARE_SPEC_FUN( spec_gambler );

if ( !str_cmp( name, "spec_gambler" ) ) return spec_gambler;

if ( special == spec_gambler ) return "spec_gambler";

bool spec_gambler( CHAR_DATA *ch)
{
if (!IS_NPC(ch))
return FALSE;
else
return TRUE;
}

All the above code was added to the appropriate places in the special.c file as near as I can tell. Any help or direction would be greatly appreciated.
USA #1
By "but that choice is not available.." what do you mean?

If you have this:
if ( !str_cmp( name, "spec_gambler" ) ) return spec_gambler;

..In the appropriate spot, when you do 'mset gamblermob spec spec_gambler' the mud should have no problems setting the specfun for a mob.
#2
I use Areaedit for all my building right now. I have created a new mob called gambler and under the name tab towards the bottom there is a drop down menu for special fuctions. That is where the spec_gambler special function should appear right? Or is a Areaedit thing? My Areaedit is not registered so maybe that is the problem...

I tried to assign the spec_gambler using mset gambler spec spec_gambler and it said "no one like that in all the realms". I guess I need to go back to my code and look closer...
USA #3
Never used Areaedit so I don't know about that. But if it said 'no one like that in all the realms' it means it couldn't find your mob. Is 'gambler' the name of your mob?
Australia Forum Administrator #4
There is a section in the configuration file for those functions:


#SPECIAL

(none) 
Spec_breath_any	  
Spec_breath_acid
Spec_breath_fire	
Spec_breath_frost	
Spec_breath_gas
Spec_breath_lightning
Spec_cast_adept	  
Spec_cast_cleric	
Spec_cast_mage	  
Spec_cast_undead	
Spec_executioner	
Spec_fido		 
Spec_guard	
Spec_janitor
Spec_mayor	
Spec_poison	
Spec_thief	
End



You could add it to there. However the configuration file is not read for unregistered copies. You say you use the Area Editor for all your building. Perhaps it is time to register it? :)
#5
Registering areaedit would be nice, but it won't solve my problem. :)
#6
For the record all that needed to be done was add:

M 21005 spec_gambler

to the #SPECIALS section of the area file with the mob in it.
USA #7
Well, yea. That's doing the same thing as 'mset blah blah', but manually ;-)
Australia Forum Administrator #8
Quote:

I have created a new mob called gambler and under the name tab towards the bottom there is a drop down menu for special fuctions. That is where the spec_gambler special function should appear right?


My earlier suggestion might not have fixed all your problems, however it would have fixed that one.
#9
Don't get me wrong guys your tips pointed me in the right direction. :) Areaedit is by far the best editor I've seen and it is good to know how to use the mud shell for building. Specially since I have not even looked at the smaug codebase in a very long time. Thanks for your help.