From 6b226377c3e680f0af28b78e05d11ae1a4c12d61 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 5 Apr 2019 17:52:45 +0000 Subject: Grant Micksha 24 extra skills slots --- src/ecommon/init.c | 1 + tools/vars.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ecommon/init.c b/src/ecommon/init.c index 668fc11..c58de23 100644 --- a/src/ecommon/init.c +++ b/src/ecommon/init.c @@ -51,4 +51,5 @@ void common_online(void) checkVar(OLD_MAX_SKILL_DB, 1510); checkVar(MAX_EVOL_SKILLS, 22); checkVar(EVOL_FIRST_SKILL, 20000); + checkVar(MAX_SKILL_TREE, 110); } diff --git a/tools/vars.sh b/tools/vars.sh index dd417ca..42a507e 100755 --- a/tools/vars.sh +++ b/tools/vars.sh @@ -7,8 +7,9 @@ # MAX_EVOL_SKILLS 22 # EVOL_FIRST_SKILL 20000 # OLD_MAX_SKILL_DB 1510 +# MAX_SKILL_TREE 110 # can be used for custom skill id: 10016 - 10036 -export VARS=" -DOLD_MAX_SKILL_DB=1510 -DMAX_SKILL_DB=1532 -DMAX_SKILL_ID=20022 -DMAX_EVOL_SKILLS=22 -DEVOL_FIRST_SKILL=20000 -DSC_MAX=658 -DSI_MAX=971 -DMIN_PACKET_DB=0x63 -DMAX_PACKET_DB=0x7531" +export VARS=" -DOLD_MAX_SKILL_DB=1510 -DMAX_SKILL_DB=1532 -DMAX_SKILL_ID=20022 -DMAX_EVOL_SKILLS=22 -DEVOL_FIRST_SKILL=20000 -DMAX_SKILL_TREE=110 -DSC_MAX=658 -DSI_MAX=971 -DMIN_PACKET_DB=0x63 -DMAX_PACKET_DB=0x7531" export CPPFLAGS="${VARS}" -- cgit v1.2.3-70-g09d2 From f170e1cbb556b491a7ba7a74a26d19ab174752f0 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 5 Apr 2019 19:12:18 +0000 Subject: Implement sendMapMask() which sends a custom map mask only to a specified user. Remember to use getmapmask() before! --- src/emap/init.c | 1 + src/emap/script_buildins.c | 26 ++++++++++++++++++++++++++ src/emap/script_buildins.h | 1 + 3 files changed, 28 insertions(+) diff --git a/src/emap/init.c b/src/emap/init.c index 31656ef..d8a6d12 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -153,6 +153,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); diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c index e1c9123..93e9388 100644 --- a/src/emap/script_buildins.c +++ b/src/emap/script_buildins.c @@ -730,6 +730,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 a72a035..fab271e 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); -- cgit v1.2.3-70-g09d2 From 8f76b5e745322b637a02e9a45c996acebe95bc3e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 8 Apr 2019 19:56:08 +0300 Subject: Update from hercules --- src/emap/clif.c | 20 ++++++++++---------- src/emap/clif.h | 8 ++++---- src/emap/init.c | 2 +- src/emap/map.c | 2 +- src/emap/pc.c | 7 +++++++ 5 files changed, 23 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 .L .24B (ZC_ACK_REQNAME) /// 0195 .L .24B .24B .24B .24B (ZC_ACK_REQNAMEALL) /// 0A30 .L .24B .24B .24B .24B .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 d8a6d12..3c40f30 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -288,7 +288,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] -- cgit v1.2.3-70-g09d2