summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authormomacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-23 20:23:03 +0000
committermomacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-23 20:23:03 +0000
commit28df54873035f1ec11e8c60a6b218e318323b032 (patch)
tree6f2ceedac0b1d34e548b4e5bb6eecf84b4886743 /src/map/atcommand.c
parentdb2241eb1df2cb260298108536e846a6cf0cc5ee (diff)
downloadhercules-28df54873035f1ec11e8c60a6b218e318323b032.tar.gz
hercules-28df54873035f1ec11e8c60a6b218e318323b032.tar.bz2
hercules-28df54873035f1ec11e8c60a6b218e318323b032.tar.xz
hercules-28df54873035f1ec11e8c60a6b218e318323b032.zip
* Implemented @breakguild (tid:75159) and @hommutate (tid:74651).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17038 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 09960c203..a48fe17bc 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -3308,6 +3308,37 @@ ACMD_FUNC(guild)
return 0;
}
+ACMD_FUNC(breakguild)
+{
+ int ret = 0;
+ struct guild *g;
+ nullpo_retr(-1, sd);
+
+ if (sd->status.guild_id) { // Check if the player has a guild
+ g = guild_search(sd->status.guild_id); // Search the guild
+ if (g) { // Check if guild was found
+ if (sd->state.gmaster_flag) { // Check if player is guild master
+ ret = guild_break(sd, g->name); // Break guild
+ if (ret) { // Check if anything went wrong
+ return 0; // Guild was broken
+ } else {
+ return -1; // Something went wrong
+ }
+ } else { // Not guild master
+ clif_displaymessage(fd, msg_txt(1181)); // You need to be a Guild Master to use this command.
+ return -1;
+ }
+ } else { // Guild was not found. HOW?
+ clif_displaymessage(fd, msg_txt(252)); // You are not in a guild.
+ return -1;
+ }
+ } else { // Player does not have a guild
+ clif_displaymessage(fd, msg_txt(252)); // You are not in a guild.
+ return -1;
+ }
+ return 0;
+}
+
/*==========================================
*
*------------------------------------------*/
@@ -6879,6 +6910,33 @@ ACMD_FUNC(homevolution)
return 0;
}
+ACMD_FUNC(hommutate)
+{
+ int homun_id, m_class = 0, m_id;
+ nullpo_retr(-1, sd);
+
+ if (!merc_is_hom_active(sd->hd)) {
+ clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
+ return -1;
+ }
+
+ if (!message || !*message) {
+ homun_id = 6048 + (rnd() % 4);
+ } else {
+ homun_id = atoi(message);
+ }
+
+ m_class = hom_class2mapid(sd->hd->homunculus.class_);
+ m_id = hom_class2mapid(homun_id);
+
+ if (m_class != -1 && m_id != -1 && m_class&HOM_EVO && m_id&HOM_S && sd->hd->homunculus.level >= 99) {
+ hom_mutate(sd->hd, homun_id);
+ } else {
+ clif_emotion(&sd->hd->bl, E_SWT);
+ }
+ return 0;
+}
+
/*==========================================
* call choosen homunculus [orn]
*------------------------------------------*/
@@ -8844,6 +8902,7 @@ void atcommand_basecommands(void) {
ACMD_DEF(spiritball),
ACMD_DEF(party),
ACMD_DEF(guild),
+ ACMD_DEF(breakguild),
ACMD_DEF(agitstart),
ACMD_DEF(agitend),
ACMD_DEF(mapexit),
@@ -8974,6 +9033,7 @@ void atcommand_basecommands(void) {
ACMD_DEF(request),
ACMD_DEF(homlevel),
ACMD_DEF(homevolution),
+ ACMD_DEF(hommutate),
ACMD_DEF(makehomun),
ACMD_DEF(homfriendly),
ACMD_DEF(homhungry),