Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Development
Nov 28, 2018, 10:10 am
By Keirath
First Immortal
Oct 12, 2018, 12:02 pm
By GatewaySysop
Bug in do_climb( )
Jun 5, 2018, 5:31 pm
By joeyfogas
question on overland code
May 31, 2018, 10:03 am
By joeyfogas
KaVir's Protocol Snip
May 15, 2018, 7:57 pm
By joeyfogas
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, DotBot, Sogou

Members: 0
Guests: 15
Stats
Files
Topics
Posts
Members
Newest Member
481
3,740
19,397
640
KieraZajac
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWR FUSS » check_skill is passing wrong ...
Forum Rules | Mark all | Recent Posts

check_skill is passing wrong level values to spell_funs
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Mar 1, 2006, 8:38 pm   Last edited Mar 1, 2006, 8:51 pm by Halcyon
Go to the top of the page
Go to the bottom of the page

Halcyon
Magician
GroupMembers
Posts187
JoinedApr 12, 2005

Why does check_skill pass ch->top_level to spell_funs? Is it just me, or does that not seem right? I would think it should be passing a player's levels in the skill's assigned guild. It seems a little silly to pass top_level, when top_level could be 100 if the player has 100 engineering levels, but they'd still get a sneak that lasts 2300 rds, despite the fact they've only got 5 smuggling levels.

Hopefully this will be considered a bugfix, but in any case, here's the changes for anyone interested:

Edit: On second thought, let's make sure guild is valid before we pass it, just in case. :D

In skills.c, in function check_skill, find:

bool check_skill( CHAR_DATA * ch, char *command, char *argument )
{
   int sn;
   int first = gsn_first_skill;
   int top = gsn_first_weapon - 1;
   struct timeval time_used;
   int mana;


Directly below that, declare:

   int level;


Further down, find the following:

      if( mana )
      {
         ch->mana -= mana;
      }
      start_timer( &time_used );
      retcode = ( *skill_table[sn]->spell_fun ) ( sn, ch->top_level, ch, vo );
      end_timer( &time_used );
      update_userec( &time_used, &skill_table[sn]->userec );

      if( retcode == rCHAR_DIED || retcode == rERROR )
         return TRUE;


Replace that with:

      if( mana )
      {
         ch->mana -= mana;
      }
      start_timer( &time_used );
	  level = ( ( IS_NPC( ch ) || skill_table[sn]->guild < COMBAT_ABILITY
		  || skill_table[sn]->guild > FORCE_ABILITY ) ? ch->top_level 
		  : ch->skill_level[skill_table[sn]->guild] );
      retcode = ( *skill_table[sn]->spell_fun ) ( sn, level, ch, vo );
      end_timer( &time_used );
      update_userec( &time_used, &skill_table[sn]->userec );

      if( retcode == rCHAR_DIED || retcode == rERROR )
         return TRUE;


There... Now they'll roll 115 rds like they should. :D
       
Pages:<< prev 1 next >>