Jump to content
  • 0

disable @changegm during woe


Question

6 answers to this question

Recommended Posts

Posted (edited)

Also to add: if you only need to disable guild creation on 1 map (like for an event),

you can use the guildlock mapflag. Mapflag#guildlock

This will block changes to guild: /guild, invite, leave, expel, add/delete Alliance/Opposition, @changegm and /breakguild.

Basically, add the mapflag guildlock in the WoE Castles o-O

Edited by Mysterious
Posted

^ but then the GM could just go back to town and @changegm

You could edit the source code (trunk/src/map/atcommand.c) and add a check "if WoE is on, don't allow @changegm".

Index: src/map/atcommand.c
===================================================================
--- src/map/atcommand.c	(revision 16159)
+++ src/map/atcommand.c	(working copy)
@@ -5694,6 +5694,12 @@
		return -1;
	}

+	if (agit_flag || agit2_flag)
+	{
+		clif_displaymessage(fd, "You can not change Guild Master during WoE.");
+		return -1;
+	}
+
	if( !message[0] ) {
		clif_displaymessage(fd, "Command usage: @changegm <guildmember name>");
		return -1;

Posted (edited)
/*==========================================
* @changegm by durf (changed by Lupus)
* Changes Master of your Guild to a specified guild member
*------------------------------------------*/
ACMD_FUNC(changegm)
{
   struct guild *g;
   struct map_session_data *pl_sd;
   nullpo_retr(-1, sd);

    if (agit_flag == 1) {
		    clif_displaymessage(fd, "You cannot use this command when woe is in progress.");
       return -1;
   }

   if (sd->status.guild_id == 0 || (g = guild_search(sd->status.guild_id)) == NULL || strcmp(g->master,sd->status.name))
   {
       clif_displaymessage(fd, "You need to be a Guild Master to use this command.");
       return -1;
   }

   if( map[sd->bl.m].flag.guildlock )
   {
       clif_displaymessage(fd, "You cannot change guild leaders on this map.");
       return -1;
   }

   if( !message[0] )
   {
       clif_displaymessage(fd, "Command usage: @changegm <guildmember name>");
       return -1;
   }

   if((pl_sd=map_nick2sd((char *) message)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) {
       clif_displaymessage(fd, "Target character must be online and be a guildmate.");
       return -1;
   }

   guild_gm_change(sd->status.guild_id, pl_sd);
   return 0;
}

Edited by quesoph

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...