summaryrefslogtreecommitdiff
path: root/src/emap
diff options
context:
space:
mode:
Diffstat (limited to 'src/emap')
-rw-r--r--src/emap/clif.c20
-rw-r--r--src/emap/clif.h8
-rw-r--r--src/emap/init.c3
-rw-r--r--src/emap/map.c2
-rw-r--r--src/emap/pc.c7
-rw-r--r--src/emap/script_buildins.c26
-rw-r--r--src/emap/script_buildins.h1
7 files changed, 51 insertions, 16 deletions
diff --git a/src/emap/clif.c b/src/emap/clif.c
index d0d3cde..53d9a29 100644
--- a/src/emap/clif.c
+++ b/src/emap/clif.c
@@ -149,7 +149,7 @@ void eclif_quest_add(TBL_PC *sd,
hookStop();
}
-// legacy eclif_charnameack_legacy start
+// legacy eclif_blname_ack_legacy start
// clientVersion <= 24
//
@@ -189,7 +189,7 @@ struct packet_reqnameall_legacy_ack {
/// 0095 <id>.L <char name>.24B (ZC_ACK_REQNAME)
/// 0195 <id>.L <char name>.24B <party name>.24B <guild name>.24B <position name>.24B (ZC_ACK_REQNAMEALL)
/// 0A30 <id>.L <char name>.24B <party name>.24B <guild name>.24B <position name>.24B <title id>.L (ZC_ACK_REQNAMEALL2)
-static void eclif_charnameack_legacy(int fd, struct block_list *bl)
+static void eclif_blname_ack_legacy(int fd, struct block_list *bl)
{
struct packet_reqnameall_legacy_ack packet;
memset(&packet, 0, sizeof(struct packet_reqnameall_legacy_ack));
@@ -312,7 +312,7 @@ static void eclif_charnameack_legacy(int fd, struct block_list *bl)
memcpy(packet.name, BL_UCCAST(BL_ELEM, bl)->db->name, NAME_LENGTH);
break;
default:
- ShowError("clif_charnameack: bad type %u(%d)\n", bl->type, bl->id);
+ ShowError("clif_blname_ack: bad type %u(%d)\n", bl->type, bl->id);
return;
}
@@ -388,12 +388,12 @@ static void eclif_charnameupdate_legacy(struct map_session_data *ssd)
//
// clientVersion <= 24
-// legacy eclif_charnameack_legacy end
+// legacy eclif_blname_ack_legacy end
-void eclif_charnameack_pre(int *fdPtr,
- struct block_list **blPtr)
+void eclif_blname_ack_pre(int *fdPtr,
+ struct block_list **blPtr)
{
- eclif_charnameack_pre_sub(fdPtr, blPtr);
+ eclif_blname_ack_pre_sub(fdPtr, blPtr);
if (hookStopped())
return;
@@ -402,13 +402,13 @@ void eclif_charnameack_pre(int *fdPtr,
return;
if (data->clientVersion <= 24)
{
- eclif_charnameack_legacy(*fdPtr, *blPtr);
+ eclif_blname_ack_legacy(*fdPtr, *blPtr);
hookStop();
}
}
-void eclif_charnameack_pre_sub(int *fdPtr,
- struct block_list **blPtr)
+void eclif_blname_ack_pre_sub(int *fdPtr,
+ struct block_list **blPtr)
{
struct block_list *bl = *blPtr;
if (!bl)
diff --git a/src/emap/clif.h b/src/emap/clif.h
index 3a563fd..1c602d8 100644
--- a/src/emap/clif.h
+++ b/src/emap/clif.h
@@ -9,10 +9,10 @@ void eclif_quest_add(TBL_PC *sd,
struct quest *qd);
void eclif_quest_add_pre(TBL_PC **sdPtr,
struct quest **qdPtr);
-void eclif_charnameack_pre(int *fdPtr,
- struct block_list **blPtr);
-void eclif_charnameack_pre_sub(int *fdPtr,
- struct block_list **blPtr);
+void eclif_blname_ack_pre(int *fdPtr,
+ struct block_list **blPtr);
+void eclif_blname_ack_pre_sub(int *fdPtr,
+ struct block_list **blPtr);
void eclif_charnameupdate_pre(struct map_session_data **ssdPtr);
void eclif_getareachar_unit_post(TBL_PC *sd,
struct block_list *bl);
diff --git a/src/emap/init.c b/src/emap/init.c
index 5e014d0..deabd84 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -154,6 +154,7 @@ HPExport void plugin_init (void)
addScriptCommand("npcwalkto", "ii", npcWalkTo);
addScriptCommand("rif", "is*", rif);
addScriptCommand("setmapmask", "si", setMapMask);
+ addScriptCommand("sendmapmask", "i*", sendMapMask);
addScriptCommand("addmapmask", "si", addMapMask);
addScriptCommand("removemapmask", "si", removeMapMask);
addScriptCommand("getmapmask", "s", getMapMask);
@@ -297,7 +298,7 @@ HPExport void plugin_init (void)
addHookPre(npc, unload, enpc_unload_pre);
addHookPre(clif, quest_send_list, eclif_quest_send_list_pre);
addHookPre(clif, quest_add, eclif_quest_add_pre);
- addHookPre(clif, charnameack, eclif_charnameack_pre);
+ addHookPre(clif, blname_ack, eclif_blname_ack_pre);
addHookPre(clif, charnameupdate, eclif_charnameupdate_pre);
addHookPre(clif, getareachar_item, eclif_getareachar_item_pre);
addHookPre(clif, dropflooritem, eclif_dropflooritem_pre);
diff --git a/src/emap/map.c b/src/emap/map.c
index cfbffef..9b38045 100644
--- a/src/emap/map.c
+++ b/src/emap/map.c
@@ -614,7 +614,7 @@ void map_alwaysVisible_send(TBL_PC *sd)
continue;
}
clif->set_unit_idle(&npc->bl, sd, SELF);
- clif->charnameack(sd->fd, &npc->bl);
+ clif->blname_ack(sd->fd, &npc->bl);
}
}
diff --git a/src/emap/pc.c b/src/emap/pc.c
index 9149e1e..ec45cdc 100644
--- a/src/emap/pc.c
+++ b/src/emap/pc.c
@@ -940,6 +940,13 @@ int epc_jobchange(struct map_session_data *sd,
if (sd->disguise != -1)
pc->disguise(sd, -1);
+ // Fix atcommand @jobchange when the player changing from 3rd job having alternate body style into non-3rd job, crashing the client
+// if (pc->has_second_costume(sd) == false) {
+// sd->status.body = 0;
+// sd->vd.body_style = 0;
+// clif->changelook(&sd->bl, LOOK_BODY2, sd->vd.body_style);
+// }
+
status->set_viewdata(&sd->bl, class);
send_changelook2(sd, &sd->bl, sd->bl.id, LOOK_BASE, sd->vd.class, 0, NULL, 0, AREA);
// clif->changelook(&sd->bl, LOOK_BASE, sd->vd.class); // move sprite update to prevent client crashes with incompatible equipment [Valaris]
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index 4b41e0a..5e86a22 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -732,6 +732,32 @@ BUILDIN(setMapMask)
return true;
}
+// sendMapMask(mask{, "player name"})
+BUILDIN(sendMapMask)
+{
+ const int val = script_getnum(st, 2);
+
+ struct map_session_data *sd = NULL;
+ if (script_hasdata(st, 3) && script_isstringtype(st, 3))
+ {
+ sd = script->nick2sd(st, script_getstr(st, 3));
+ }
+ else
+ {
+ sd = script->rid2sd(st);
+ }
+
+ if (sd == NULL)
+ {
+ ShowWarning("player not attached\n");
+ script->reportsrc(st);
+ return false;
+ }
+
+ send_mapmask(sd->fd, val);
+ return true;
+}
+
BUILDIN(getMapMask)
{
const char *const mapName = script_getstr(st, 2);
diff --git a/src/emap/script_buildins.h b/src/emap/script_buildins.h
index 6d4b6e9..b93b302 100644
--- a/src/emap/script_buildins.h
+++ b/src/emap/script_buildins.h
@@ -29,6 +29,7 @@ BUILDIN(setq);
BUILDIN(setNpcDir);
BUILDIN(rif);
BUILDIN(setMapMask);
+BUILDIN(sendMapMask);
BUILDIN(getMapMask);
BUILDIN(addMapMask);
BUILDIN(removeMapMask);