Register forum user name Search FAQ

Gammon Forum

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 ➜ Skill Renaming

Skill Renaming

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Tseris   (98 posts)  Bio
Date Sun 25 Jan 2009 11:04 PM (UTC)

Amended on Sun 25 Jan 2009 11:05 PM (UTC) by Tseris

Message
So one of the early things I want to do is rename and redescribe alot of the stock skills/spells, to give them my own flavor.

I started by changing mistwalk to shadowstep. I used windows search to find all examples of mistwalk, changed them and recompiled. But upon logging in, I still have mistwalk on my admin's skill list, and if I type 'mistwalk' or 'shadowstep' both commands return with a "Huh?".

Code changes:



in skills.c

void do_shadowstep( CHAR_DATA* ch, const char* argument)
{
   char arg[MAX_INPUT_LENGTH];
   CHAR_DATA *victim;
   bool allowday;

   set_char_color( AT_DGREEN, ch );
   if( IS_NPC( ch ) && IS_AFFECTED( ch, AFF_CHARM ) )
   {
      send_to_char( "You can't do that right now.\r\n", ch );
      return;
   }
   if( ch->mount )
   {
      send_to_char( "And scare your mount to death?\r\n", ch );
      return;
   }
   one_argument( argument, arg );
   if( arg[0] == '\0' )
   {
      send_to_char( "Who will be your victim?\r\n", ch );
      return;
   }
   WAIT_STATE( ch, skill_table[gsn_shadowstep]->beats );
   if( ( victim = get_char_world( ch, arg ) ) == NULL || victim == ch )
   {
      send_to_char( "You are unable to sense your victim.\r\n", ch );
      return;
   }
   if( IS_PKILL( ch ) && ch->pcdata->condition[COND_BLOODTHIRST] > 22 )
      allowday = TRUE;
   else
      allowday = FALSE;
   if( ( time_info.hour < 21 && time_info.hour > 5 && !allowday )
       || !victim->in_room
       || xIS_SET( victim->in_room->room_flags, ROOM_PRIVATE )
       || xIS_SET( victim->in_room->room_flags, ROOM_SOLITARY )
       || xIS_SET( victim->in_room->room_flags, ROOM_NO_ASTRAL )
       || xIS_SET( victim->in_room->room_flags, ROOM_DEATH )
       || xIS_SET( victim->in_room->room_flags, ROOM_PROTOTYPE )
       || xIS_SET( ch->in_room->room_flags, ROOM_NO_RECALL )
       || victim->level >= ch->level + 15
       || ( IS_NPC( victim ) && xIS_SET( victim->act, ACT_PROTOTYPE ) )
       || ( IS_NPC( victim ) && saves_spell_staff( ch->level, victim ) )
       || ( CAN_PKILL( victim ) && !IS_NPC( ch ) && !CAN_PKILL( ch ) )
       || !in_hard_range( ch, victim->in_room->area )
       || ( IS_SET( victim->in_room->area->flags, AFLAG_NOPKILL ) && IS_PKILL( ch ) ) )
   {
      send_to_char( "You are unable to sense your victim.\r\n", ch );
      learn_from_failure( ch, gsn_shadowstep );
      return;
   }
   /*
    * Subtract 22 extra bp for mist walk from 0500 to 2100 SB 
    */
   if( time_info.hour < 21 && time_info.hour > 5 && !IS_NPC( ch ) )
      gain_condition( ch, COND_BLOODTHIRST, -22 );
   act( AT_DGREEN, "Your surroundings blur as you assume a form of churning mist!", ch, NULL, NULL, TO_CHAR );
   act( AT_DGREEN, "$n dissolves into a cloud of glowing mist, then vanishes!", ch, NULL, NULL, TO_ROOM );
   learn_from_success( ch, gsn_shadowstep );
   char_from_room( ch );
   char_to_room( ch, victim->in_room );
   act( AT_DGREEN, "A cloud of glowing mist engulfs you, then withdraws to unveil $n!", ch, NULL, NULL, TO_ROOM );
   do_look( ch, "auto" );
   return;
}


in db.c

short gsn_shadowstep;

and 

ASSIGN_GSN( gsn_shadowstep, "shadowstep" );



in mud.h

DECLARE_DO_FUN( do_shadowstep );

and

extern short gsn_shadowstep;


in smaug.def

gsn_shadowstep @ 2333 DATA

and

do_shadowstep @ 2115


I then changed the skill name in the class list in Vampire.class and updated the helpfile. I could understand why it might not be working because my immort isnt a vampire with BP, but I cant explain why its still in my skills list and why both commands give me a "Huh?"


Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 25 Jan 2009 11:56 PM (UTC)
Message
In the system directory, grep or search for the skill in question. In skills.dat:


#SKILL       
Name         mistwalk~
Type         Skill
Info         0
Flags        0
Minpos       112
Mana         50
Rounds       12
Code         do_mistwalk
Dammsg       ~
Wearoff      !Mist Walk!~
Minlevel     31
End


You need to change them too. The Name part is what it matches against when you type a command in, thus the Huh? you are getting.

That maps the command "mistwalk" to the command handler "do_mistwalk".

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Tseris   (98 posts)  Bio
Date Reply #2 on Mon 26 Jan 2009 12:05 AM (UTC)
Message
Hrmm I wonder why the search didnt bring this up. I noticed it also didnt bring up the word in the helpfile or the class files. Seems odd since I did the search in the root directory, /smaugfuss, which all the other files are contained in.

At any rate, thanks a bunch.
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.


12,819 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.