summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-02-13 21:37:35 +0300
committerAndrei Karas <akaras@inbox.ru>2018-02-13 21:37:35 +0300
commit68c2ea30403890497b05cd0c8ce9d8197324efef (patch)
tree1cbcf302014e717862a0b880d6670b17397af2a4 /src
parenta72ce61cd2dd4981259a8b9a16801222b9775f08 (diff)
downloadplugin-68c2ea30403890497b05cd0c8ce9d8197324efef.tar.gz
plugin-68c2ea30403890497b05cd0c8ce9d8197324efef.tar.bz2
plugin-68c2ea30403890497b05cd0c8ce9d8197324efef.tar.xz
plugin-68c2ea30403890497b05cd0c8ce9d8197324efef.zip
Update for all players clan join/leave state.
Other players will see if player joined or left clan.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/emap/clan.c40
-rw-r--r--src/emap/clan.h15
-rw-r--r--src/emap/init.c4
4 files changed, 61 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 4c47003..68828fe 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -36,6 +36,8 @@ MAP_SRC = emap/atcommand.c \
emap/battle.h \
emap/battleground.c \
emap/battleground.h \
+ emap/clan.c \
+ emap/clan.h \
emap/clif.c \
emap/clif.h \
emap/config.c \
diff --git a/src/emap/clan.c b/src/emap/clan.c
new file mode 100644
index 0000000..299eb75
--- /dev/null
+++ b/src/emap/clan.c
@@ -0,0 +1,40 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 - 2015 Evol developers
+
+#include "common/hercules.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "common/HPMi.h"
+#include "common/memmgr.h"
+#include "common/mmo.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "map/clan.h"
+#include "map/pc.h"
+
+#include "emap/send.h"
+
+bool eclan_join_post(bool retVal,
+ struct map_session_data *sd,
+ int clan_id __attribute__ ((unused)))
+{
+ if (retVal == true && sd != NULL)
+ {
+ send_pc_info(&sd->bl, &sd->bl, AREA);
+ }
+ return retVal;
+}
+
+bool eclan_leave_post(bool retVal,
+ struct map_session_data *sd,
+ bool first __attribute__ ((unused)))
+{
+ if (retVal == true && sd != NULL)
+ {
+ send_pc_info(&sd->bl, &sd->bl, AREA);
+ }
+ return retVal;
+}
diff --git a/src/emap/clan.h b/src/emap/clan.h
new file mode 100644
index 0000000..d07b1bd
--- /dev/null
+++ b/src/emap/clan.h
@@ -0,0 +1,15 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 - 2015 Evol developers
+
+#ifndef EVOL_MAP_CLAN
+#define EVOL_MAP_CLAN
+
+bool eclan_join_post(bool retVal,
+ struct map_session_data *sd,
+ int clan_id);
+
+bool eclan_leave_post(bool retVal,
+ struct map_session_data *sd,
+ bool first);
+
+#endif // EVOL_MAP_CLAN
diff --git a/src/emap/init.c b/src/emap/init.c
index 28aabf8..3806aee 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -19,6 +19,7 @@
#include "map/channel.h"
#include "map/chat.h"
#include "map/chrif.h"
+#include "map/clan.h"
#include "map/clif.h"
#include "map/duel.h"
#include "map/elemental.h"
@@ -47,6 +48,7 @@
#include "emap/atcommand.h"
#include "emap/battle.h"
#include "emap/battleground.h"
+#include "emap/clan.h"
#include "emap/clif.h"
#include "emap/config.h"
#include "emap/console.h"
@@ -286,6 +288,8 @@ HPExport void plugin_init (void)
addHookPost(battle, calc_magic_attack, ebattle_calc_weapon_attack_post);
addHookPost(battle, calc_misc_attack, ebattle_calc_weapon_attack_post);
addHookPost(battle, check_arrows, ebattle_check_arrows_post);
+ addHookPost(clan, join, eclan_join_post);
+ addHookPost(clan, leave, eclan_leave_post);
addHookPost(clif, addcards, eclif_addcards_post);
addHookPost(clif, addcards2, eclif_addcards2_post);
addHookPost(clif, getareachar_unit, eclif_getareachar_unit_post);