Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Bing, Yandex

Members: 0
Guests: 14
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » Mpmset
Forum Rules | Mark all | Recent Posts

Mpmset
< Newer Topic :: Older Topic > Help please?

Pages:<< prev 1 next >>
Post is unread #1 Mar 5, 2005, 10:16 am
Go to the top of the page
Go to the bottom of the page

Celestria

GroupMembers
Posts28
JoinedFeb 24, 2005

Can someone help me?
I'm trying to add a command for mpmset to set clan and rank.
I'm not sure how to code it, I've tried and it just isn't working right. I don't get errors but it doesnt' work either.
I want the creation advance mob to set people's home town as a clan and rank as something generic so that the playerbase doesn't know your class by looking at the who. I have searched all over the net, all over other forums and some people have done the mpmset clan but don't provide the code or how they did it.
Any help would be greatly appreciated.
Thanks
Celestria
       
Post is unread #2 Mar 6, 2005, 11:53 am   Last edited Nov 24, 2007, 1:58 pm by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

This has not been tested - however it should do the trick:

   if( !str_cmp( arg2, "clan" ) )
   {
      CLAN_DATA *clan;

      if( IS_NPC( victim ) )
      {
         progbugf( ch, "%s", "MpMset: Attempting to set NPC clan" );
         return;
      }

      if( !arg3 || arg3[0] == '\0' )
      {
         /*
          * Crash bug fix, oops guess I should have caught this one :)
          * * But it was early in the morning :P --Shaddai 
          */
         if( victim->pcdata->clan == NULL )
            return;
         /*
          * Added a check on immortals so immortals don't take up
          * * any membership space. --Shaddai
          */
         if( !IS_IMMORTAL( victim ) )
         {
            --victim->pcdata->clan->members;
            if( victim->pcdata->clan->members pcdata->clan->members = 0;
            save_clan( victim->pcdata->clan );
         }
         STRFREE( victim->pcdata->clan_name );
         victim->pcdata->clan = NULL;
         return;
      }
      clan = get_clan( arg3 );
      if( !clan )
      {
         progbugf( ch, "%s", "MpMset: Attempting to set invalid player clan" );
         return;
      }
      if( victim->pcdata->clan != NULL && !IS_IMMORTAL( victim ) )
      {
         --victim->pcdata->clan->members;
         if( victim->pcdata->clan->members pcdata->clan->members = 0;
         save_clan( victim->pcdata->clan );
      }
      STRFREE( victim->pcdata->clan_name );
      victim->pcdata->clan_name = QUICKLINK( clan->name );
      victim->pcdata->clan = clan;
      if( !IS_IMMORTAL( victim ) )
      {
         ++victim->pcdata->clan->members;
         save_clan( victim->pcdata->clan );
      }
      return;
   }


Basically all it is is the same code from build.c, do_mset, modified to return the bug messages via the progbug function. You should be able to do something similar with the rank as well.
       
Post is unread #3 Mar 6, 2005, 12:01 pm
Go to the top of the page
Go to the bottom of the page

Celestria

GroupMembers
Posts28
JoinedFeb 24, 2005

Thank you!! *Beams*
I owe you big, and I really appreciate all your help, now I can stop banging my head against the wall.

Celestria
       
Pages:<< prev 1 next >>