Login
User Name:

Password:



Register

Forgot your password?
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
SWRFUSS 1.4
Author: Various
Submitted by: Samson
Users Online
There are currently no members online.

Members: 0
Guests: 20
Stats
Files
Topics
Posts
Members
Newest Member
488
3,788
19,631
595
Khonsu

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » General » Smaug Snippets » Soulfeed
Forum Rules | Mark all | Recent Posts

Soulfeed
< Newer Topic :: Older Topic > level your weapon to do more dam

Pages:<< prev 1 next >>
Post is unread #1 Sep 5, 2016 10:08 pm   Last edited Sep 5, 2016 10:12 pm by joeyfogas
Go to the top of the page
Go to the bottom of the page

joeyfogas
Apprentice
GroupMembers
Posts78
JoinedAug 28, 2016

 
Soul Feed:

I don't require credit for this, but if you want to show me 
some gratitude, then you can drop by my game to check it out
 once it's open to the public. I will register with 
mudconnector and every other site I can find. The game will
 be called: ALYCE: Shattered Wonderland.


This was created on a modified SMAUGFUSS 1.9 code. It should
 be relatively easy to change to suit your codebase.


This snippet is for a feature I like to call "soulfeed". 
What soulfeed does, is it lets you level your weapon up to 
level 4 by using souls you get by killing your victims.  
Based on the soul level of your weapon, you can cause 
additional damage to your prey.  Any formulas in here, feel
 free to change to suit your MUD and your needs.  This is 
simply how I have it.  OK... let's get started!!



1. Let's create the soulfeed function

anywhere in act_info.c with the other void do_ functions, place this code:

void do_soulfeed( CHAR_DATA* ch, const char* )
{
 OBJ_DATA *obj = get_eq_char( ch, WEAR_WIELD );

  if( obj == NULL  )
   {
      send_to_char( "You must be holding the weapon you wish to feed.\r\n", ch );
      return;
   }
  if( obj != NULL && ( obj->value[4] >= 4 ))
   {
      send_to_char( "You have fed this weapon as much as you can.\r\n", ch );
      return;
   }
  if( obj!= NULL && ( obj->value[4] <= 3 ))
   {

        if ( ch->pcdata->souls <= 1999)
        {
                send_to_char( "You do not have the souls! You need 2000 to level your weapon.\r\n", ch );
                return;
        }
        else
        obj->value[4] += 1;
        ch->pcdata->souls -= 2000;
      send_to_char( "The souls of the vanquished fuse into this weapon.\r\n", ch );
      return;
   }


}




2.  Open mud.h

in struct pc_data add this:

int souls; /*this is for the souls you collect */


3. open save.c

in the void fwrite_char bit of code, find the lines


   fprintf( fp, "Practice     %d\n", ch->practice );
   fprintf( fp, "SavingThrows %d %d %d %d %d\n",
            ch->saving_poison_death, ch->saving_wand, ch->saving_para_petri, ch->saving_breath, ch->saving_spell_staff );
   fprintf( fp, "Alignment    %d\n", ch->alignment );
   fprintf( fp, "Glory        %d\n", ch->pcdata->quest_curr );
   fprintf( fp, "MGlory       %d\n", ch->pcdata->quest_accum );

and below them place

   fprintf( fp, "Souls        %d\n", ch->pcdata->souls );




next find the section of code for void fread_char and locate this bit of code:

          }
            break;

         case 'S':
            KEY( "Sex", ch->sex, fread_number( fp ) );
            KEY( "ShortDescr", ch->short_descr, fread_string( fp ) );


directly below that, place this:


            KEY( "Souls", ch->pcdata->souls, fread_number( fp ) );


4. Open fight.c and look for:

      case POS_DEAD:
         if( dt >= 0 && dt < num_skills )
         {
            SKILLTYPE *skill = skill_table[dt];

            if( skill->die_char && skill->die_char[0] != '\0' )
               act( AT_DEAD, skill->die_char, ch, NULL, victim, TO_CHAR );
            if( skill->die_vict && skill->die_vict[0] != '\0' )
               act( AT_DEAD, skill->die_vict, ch, NULL, victim, TO_VICT );
            if( skill->die_room && skill->die_room[0] != '\0' )
               act( AT_DEAD, skill->die_room, ch, NULL, victim, TO_NOTVICT );
         }
         act( AT_DEAD, "$n is DEAD!!", victim, 0, 0, TO_ROOM );


directly below that put:

      pager_printf (ch, "&RYou collect %d souls from your victim!&D\r\n", (victim->level * get_curr_lck(ch)));
				/* this is where you can change things to suit your needs */




next in group_gain find:

      if( gch->level - lch->level < -8 )
      {
         send_to_char( "You are too low for this group.\r\n", gch );
         continue;
      }

      xp = ( int )( xp_compute( gch, victim ) * 0.1765 ) / members;
      if( !gch->fighting )
         xp /= 2;
      gch->alignment = align_compute( gch, victim );


and directly below that put:

        ch->pcdata->souls += (victim->level * get_curr_lck(ch));
		/* again, change this to suit your game if you dont like the formula */




next find:

   if( dt == gsn_backstab )
      maxdam = ch->level * 80;
   else
      maxdam = ch->level * 40;


directly below that put:

//soul fed weapons bonus
//Thanks to Nick Gammon for cleaning this up for me
 OBJ_DATA *obj = get_eq_char( ch, WEAR_WIELD );

   if(  obj == NULL || ( obj->value[4] == 0))
        dam = dam;
   if(  obj != NULL && ( obj->value[4] == 1))
        dam = (dam * 1.5);
   if(  obj != NULL && ( obj->value[4] == 2))
        dam = (dam * 2);
   if(  obj != NULL && ( obj->value[4] == 3))
        dam = (dam * 2.5);
   if(  obj != NULL && ( obj->value[4] == 4))
        dam = (dam * 3);





5. open magic.c

find the spell_identify and look for case ITEM_WEAPON and add this RIGHT before the break

            ch_printf( ch, "&RThe soul level of this weapon is: %d&W\r\n", obj->value[4]);


6. open player.c

add this somewhere in your score sheet:


pager_printf (ch, "&WSouls Collected: &R%d&D\r\n", ch->pcdata->souls);



7. in act_wiz.c in the function do_ostat place this inside it anywhere you wish along with the other info:

   ch_printf( ch, "&CSoul level: &w%d\r\n  ", obj->value[4]);




make clean
recompile

change your itemvalues help file to reflect that v4 on weapons is for soul levels and you are done.  Contrats!


feel free to leave feedback

Post is unread #2 Sep 5, 2016 10:24 pm   
Go to the top of the page
Go to the bottom of the page

joeyfogas
Apprentice
GroupMembers
Posts78
JoinedAug 28, 2016

 
sorry had to edit it.. posted the pre-version... it's good now :)

Pages:<< prev 1 next >>