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 ➜ now on to my next Exp problem

now on to my next Exp problem

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


Posted by Ithildin   USA  (262 posts)  Bio
Date Sun 22 Feb 2004 04:53 AM (UTC)
Message
Thanks to Greven for my first Exp problem. now here is my second. i've changed the whole exp system around. i need much less than normal. to level it's (level*70)+ expbase. so now every time my character levels, he only needs 70 more xp to level again. i want the exp counter to set back to 0 after you level. example.

i have 2,630 xp of 2700

i get 75 xp on a kill and i level.

so now i have 5 xp of 2770

any ideas?
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #1 on Sun 22 Feb 2004 04:57 AM (UTC)

Amended on Sun 22 Feb 2004 04:59 AM (UTC) by Ithildin

Message
here's where i think i should be:


/* xp cap to prevent any one event from giving enuf xp to */
    /* gain more than one level - FB */
    modgain = UMIN(modgain,
    	exp_level(ch, ch->level+2) - exp_level(ch, ch->level+1));

    ch->exp = UMAX( 0, ch->exp + modgain );

    if (NOT_AUTHED(ch) && ch->exp >= exp_level(ch, ch->level+1))
    {
	send_to_char("You can not ascend to a higher level until you are authorized.\n\r", ch);
	ch->exp = (exp_level(ch, (ch->level+1)) - 1);
	return;
    }

while ( ch->level < LEVEL_AVATAR && ch->exp >= exp_level(ch, ch->level+1))
    {
	set_char_color( AT_WHITE + AT_BLINK, ch );
	ch_printf( ch, "You have now obtained experience level %d!\n\r", ++ch->level );
	advance_level( ch );
    }



i'm guessin i'll need something that would reset the exp back to 0 but also give the overflow of xp on top of that.
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #2 on Sun 22 Feb 2004 05:35 AM (UTC)
Message
i had to restart my comp. but i'm gonna try this.

while ( ch->level < LEVEL_AVATAR && ch->exp >= exp_level(ch, ch->level+1))
    {
	set_char_color( AT_WHITE + AT_BLINK, ch );
	ch_printf( ch, "You have now obtained experience level %d!\n\r", ++ch->level );
	advance_level( ch );
       ch->exp = ( 0 );   <------there    
}


see if that works.
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #3 on Sun 22 Feb 2004 05:50 AM (UTC)
Message
ok, that's an easy little fix. it doesn't bring the extra xp over to the new level, but it resets it to 0.


now another EXP thing.

i get 12 xp for the kill on a perfect match, but with the damage bonus, i total like 70 xp. i want to take out the damage bonus and just make it to where i could get about 70-100 xp on a perfect match con. my xp min is 0 xp max is 180. i'm not really sure on where to look on this one. but i'll go look a few.
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #4 on Sun 22 Feb 2004 06:16 AM (UTC)
Message
i'm guessin this is somewhere that i need to look.
it's under int xp_compute


xp	  = (get_exp_worth( victim )
    	  *  URANGE( 0, (victim->level - gchlev) + 10, 13 )) / 10;



i tried changing the 10 at the end to 5 to see if anything would happen. didn't see anything. here's this as well


/*
 * Calculate roughly how much experience a character is worth
 */
int get_exp_worth( CHAR_DATA *ch )
{
    int exp;

    exp = ch->level * ch->level * ch->level * 5;
    exp += ch->max_hit;
    exp -= (ch->armor-50) * 2;
    exp += ( ch->barenumdie * ch->baresizedie + GET_DAMROLL(ch) ) * 50;
    exp += GET_HITROLL(ch) * ch->level * 10;
    if ( IS_AFFECTED(ch, AFF_SANCTUARY) )
      exp += exp * 1.5;
    if ( IS_AFFECTED(ch, AFF_FIRESHIELD) )
      exp += exp * 1.2;
    if ( IS_AFFECTED(ch, AFF_SHOCKSHIELD) )
      exp += exp * 1.2;
    exp = URANGE( MIN_EXP_WORTH, exp, MAX_EXP_WORTH );

    return exp;
}

sh_int get_exp_base( CHAR_DATA *ch )
{
    if ( IS_NPC(ch) )
      return 1000;
    return class_table[ch->class]->exp_base;
}


so i'm thinkin it's in there. and i'm probably lookin right over it. it's 1 am here so probably.

thanks for any help. i think i'm headin to bed and i'll finish this tomorrow.
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #5 on Mon 23 Feb 2004 02:12 AM (UTC)
Message
I still haven't been able to figure out what's all going on. I'm going to look at it a little bit more later tonite. anyone have any thoughts?
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.


17,307 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.