summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-02-05 12:34:08 -0300
committerJesusaves <cpntb1@ymail.com>2020-02-05 12:34:08 -0300
commit5e50f368b069132dd76b9e1e37cf2bec4139a3fd (patch)
tree1a75b95c9e9f4abaffde8f959a44ecb698b21f5b /src
parent7991c7c91af27fdd65913695b285ee7c422d3665 (diff)
downloadevol-hercules-5e50f368b069132dd76b9e1e37cf2bec4139a3fd.tar.gz
evol-hercules-5e50f368b069132dd76b9e1e37cf2bec4139a3fd.tar.bz2
evol-hercules-5e50f368b069132dd76b9e1e37cf2bec4139a3fd.tar.xz
evol-hercules-5e50f368b069132dd76b9e1e37cf2bec4139a3fd.zip
New command: @setguildmaster <guild_master>
Ignores the “are you the guild master” check. Meant to be used by admins.
Diffstat (limited to 'src')
-rw-r--r--src/emap/atcommand.c34
-rw-r--r--src/emap/atcommand.h1
-rw-r--r--src/emap/init.c1
3 files changed, 36 insertions, 0 deletions
diff --git a/src/emap/atcommand.c b/src/emap/atcommand.c
index de35411..169378c 100644
--- a/src/emap/atcommand.c
+++ b/src/emap/atcommand.c
@@ -16,6 +16,7 @@
#include "common/timer.h"
#include "map/atcommand.h"
#include "map/clif.h"
+#include "map/guild.h"
#include "map/map.h"
#include "map/pet.h"
#include "map/pc.h"
@@ -376,4 +377,37 @@ ACMD0(tmw2item)
return true;
}
+/*==========================================
+ * @changegm by durf (changed by Lupus)
+ * Changes Master of your Guild to a specified guild member
+ *------------------------------------------*/
+ACMD0(tmw2changegm)
+{
+ struct guild *g;
+ struct map_session_data *pl_sd;
+
+ if (sd->status.guild_id == 0 || (g = sd->guild) == NULL) {
+ clif->message(fd, msg_fd(fd,1181)); // You need to be a Guild Master to use this command.
+ return false;
+ }
+
+ if (map->list[sd->bl.m].flag.guildlock || map->list[sd->bl.m].flag.gvg_castle) {
+ clif->message(fd, msg_fd(fd,1182)); // You cannot change guild leaders in this map.
+ return false;
+ }
+
+ if (!message[0]) {
+ clif->message(fd, msg_fd(fd,1183)); // Usage: @changegm <guild_member_name>
+ return false;
+ }
+
+ if ((pl_sd=map->nick2sd(message)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) {
+ clif->message(fd, msg_fd(fd,1184)); // Target character must be online and be a guild member.
+ return false;
+ }
+
+ guild->gm_change(sd->status.guild_id, pl_sd->status.char_id);
+ return true;
+}
+
diff --git a/src/emap/atcommand.h b/src/emap/atcommand.h
index eb3af35..6eb6896 100644
--- a/src/emap/atcommand.h
+++ b/src/emap/atcommand.h
@@ -44,5 +44,6 @@ ACMD4(tee);
ACMD4(getName);
ACMD0(refresh);
ACMD0(tmw2item);
+ACMD0(tmw2changegm);
#endif // EVOL_MAP_ATCOMMAND
diff --git a/src/emap/init.c b/src/emap/init.c
index dcb046b..5c5bf27 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -113,6 +113,7 @@ HPExport void plugin_init (void)
addAtcommand("getname", getName);
addAtcommand("refresh", refresh);
addAtcommand("item", tmw2item);
+ addAtcommand("setguildmaster", tmw2changegm);
addCPCommand("serverexit", serverExit);
addCPCommand("doevent", C_doevent);