Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Results 1 to 2 of 2
  1. #1
    Graphics Guru

    Join Date
    Feb 2009
    Posts
    1,377
    Rep Power
    24
    Reputation
    382

    Post Starting Guild for the new Character


    Register to remove this ad
    If activated, when some player is created, this script will add the player to a guild.
    You'll need these options in your worldserver.conf file:

    Code:
    ###################################################################################################
    # STARTING GUILD
    #
    # These settings control the Starting Guild functionality
    #
    #    StartingGuild.Enable
    #        Description: Enables or Disables the Starting Guild functionality.
    #        Default:     0 - (Disabled)
    #                     1 - (Enabled)
    
    
    StartingGuild.Enable = 0
    
    
    #
    #    StartingGuild.GuildID
    #        Description: The identifier (ID) of the Guild. It must be an integer number
    #        Default:     1
    
    
    StartingGuild.GuildID = 1
    
    
    #
    ###################################################################################################
    Code:
    /*
    Made by: Erictemponi
    */
    
    #include "ScriptMgr.h"
    #include "Config.h"
    #include "Guild.h"
    #include "GuildMgr.h"
    
    class StartingGuildScript : public PlayerScript
    {
        public:
            StartingGuildScript() : PlayerScript("StartingGuildScript") { }
    
            // called when some player is created
            void OnCreate(Player* pPlayer)
            {
                if (sConfigMgr->GetBoolDefault("StartingGuild.Enable", false))
                {
                    uint32 guildID = sConfigMgr->GetIntDefault("StartingGuild.GuildID", 1);
                    Guild* targetGuild = sGuildMgr->GetGuildById(guildID);
                    if (targetGuild)
                    {
                        ObjectGuid playerGuid = pPlayer->GetGUID();
                        // player's guild membership checked in AddMember before add
                        CharacterDatabaseTransaction trans(nullptr);
                        targetGuild->AddMember(trans, playerGuid);
                    }
                }
            }
    };
    
    void AddSC_starting_guild()
    {
        new StartingGuildScript();
    }

    Credits:


    • LordPsyan old patch
    • Erictemponi for this newest one.

  2. #2
    Beginner

    Join Date
    Jan 2023
    Posts
    2
    Rep Power
    4
    Reputation
    1

    Register to remove this ad
    Is there a way to have multiple entries, 1 for each faction?

 

 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 09:20 PM.
Powered by vBulletin® Copyright ©2000-2026, Jelsoft Enterprises Ltd.
vBulletin Licensed to: MMOPro.org
vBulletin Skin By: PurevB.com