summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c3
-rw-r--r--src/map/clif.c17
-rw-r--r--src/map/clif.h1
-rw-r--r--src/map/itemdb.h2
-rw-r--r--src/map/packets.h7
-rw-r--r--src/map/pc.c16
-rw-r--r--src/map/pc.h2
-rw-r--r--src/map/script.c41
-rw-r--r--src/map/status.c8
-rw-r--r--src/map/unit.c16
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc8
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc53
13 files changed, 167 insertions, 9 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index e223f698c..08119457d 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -8414,6 +8414,7 @@ ACMD(charcommands)
atcommand->commands_sub(sd, fd, COMMAND_CHARCOMMAND);
return true;
}
+
/* for new mounts */
ACMD(cashmount)
{
@@ -8425,7 +8426,7 @@ ACMD(cashmount)
clif->message(sd->fd,msg_fd(fd,1362)); // NOTICE: If you crash with mount your LUA is outdated.
if (!sd->sc.data[SC_ALL_RIDING]) {
clif->message(sd->fd,msg_fd(fd,1363)); // You have mounted.
- sc_start(NULL,&sd->bl,SC_ALL_RIDING,100,0,-1);
+ sc_start(NULL,&sd->bl,SC_ALL_RIDING,100,25,-1);
} else {
clif->message(sd->fd,msg_fd(fd,1364)); // You have released your mount.
status_change_end(&sd->bl, SC_ALL_RIDING, INVALID_TIMER);
diff --git a/src/map/clif.c b/src/map/clif.c
index 1cd18b68d..3b15265f7 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -11484,6 +11484,22 @@ void clif_parse_ItemIdentify(int fd,struct map_session_data *sd)
clif_menuskill_clear(sd);
}
+/// Identifying item with right-click (CZ_REQ_ONECLICK_ITEMIDENTIFY).
+/// 0A35 <index>.W
+void clif_parse_OneClick_ItemIdentify(int fd, struct map_session_data *sd)
+{
+ int cmd = RFIFOW(fd,0);
+ short idx = RFIFOW(fd, packet_db[cmd].pos[0]) - 2;
+ int n;
+
+ if (idx < 0 || idx >= MAX_INVENTORY || sd->inventory_data[idx] == NULL || sd->status.inventory[idx].nameid <= 0)
+ return;
+
+ if ((n = pc->have_magnifier(sd) ) != INDEX_NOT_FOUND &&
+ pc->delitem(sd, n, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER) == 0)
+ skill->identify(sd, idx);
+}
+
void clif_parse_SelectArrow(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Answer to arrow crafting item selection dialog (CZ_REQ_MAKINGARROW).
/// 01ae <name id>.W
@@ -19707,4 +19723,5 @@ void clif_defaults(void) {
clif->add_random_options = clif_add_random_options;
clif->pHotkeyRowShift = clif_parse_HotkeyRowShift;
clif->dressroom_open = clif_dressroom_open;
+ clif->pOneClick_ItemIdentify = clif_parse_OneClick_ItemIdentify;
}
diff --git a/src/map/clif.h b/src/map/clif.h
index 250689e90..3d43b064c 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -1338,6 +1338,7 @@ struct clif_interface {
void (*add_random_options) (unsigned char* buf, struct item* item);
void (*pHotkeyRowShift) (int fd, struct map_session_data *sd);
void (*dressroom_open) (struct map_session_data *sd, int view);
+ void (*pOneClick_ItemIdentify) (int fd,struct map_session_data *sd);
/* Cart Deco */
void(*selectcart) (struct map_session_data *sd);
void(*pSelectCart) (int fd, struct map_session_data *sd);
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index cde73f3b4..8a0ec389d 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -64,6 +64,7 @@ enum item_itemid {
ITEMID_BRANCH_OF_DEAD_TREE = 604,
ITEMID_ANODYNE = 605,
ITEMID_ALOEBERA = 606,
+ ITEMID_MAGNIFIER = 611,
ITEMID_POISON_BOTTLE = 678,
ITEMID_EMPTY_BOTTLE = 713,
ITEMID_EMPERIUM = 714,
@@ -136,6 +137,7 @@ enum item_itemid {
ITEMID_MAGIC_CASTLE = 12308,
ITEMID_BULGING_HEAD = 12309,
ITEMID_THICK_MANUAL50 = 12312,
+ ITEMID_NOVICE_MAGNIFIER = 12325,
ITEMID_ANCILLA = 12333,
ITEMID_REPAIR_A = 12392,
ITEMID_REPAIR_B = 12393,
diff --git a/src/map/packets.h b/src/map/packets.h
index 6174d76d2..0badd94f5 100644
--- a/src/map/packets.h
+++ b/src/map/packets.h
@@ -2910,9 +2910,10 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x08A8,26,clif->pFriendsListAdd,2);
packet(0x0817,5,clif->pHomMenu,2,4);
packet(0x0923,36,clif->pStoragePassword,0);
- packet(0x09e8,11,clif->pDull); // CZ_OPEN_MAILBOX
- packet(0x0a2e,6,clif->pDull); // TITLE
- packet(0x0a02,4); // ZC_DRESSROOM_OPEN
+ packet(0x09E8,11,clif->pDull); // CZ_OPEN_MAILBOX
+ packet(0x0A2E,6,clif->pDull); // TITLE
+ packet(0x0A02,4); // ZC_DRESSROOM_OPEN
+ packet(0x0A35,4,clif->pOneClick_ItemIdentify,2);
#endif
#if PACKETVER >= 20150805 // RagexeRE
diff --git a/src/map/pc.c b/src/map/pc.c
index 2dfd9519b..491584385 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -11479,6 +11479,20 @@ bool pc_db_checkid(unsigned int class_)
|| (class_ >= JOB_REBELLION && class_ < JOB_MAX );
}
+/**
+ * checks if player have any kind of magnifier in inventory
+ * @param sd map_session_data of Player
+ * @return index of magnifer, INDEX_NOT_FOUND if it is not found
+ */
+int pc_have_magnifier(struct map_session_data *sd)
+{
+ int n;
+ n = pc->search_inventory(sd, ITEMID_MAGNIFIER);
+ if (n == INDEX_NOT_FOUND)
+ n = pc->search_inventory(sd, ITEMID_NOVICE_MAGNIFIER);
+ return n;
+}
+
void do_final_pc(void) {
db_destroy(pc->itemcd_db);
pc->at_db->destroy(pc->at_db,pc->autotrade_final);
@@ -11846,4 +11860,6 @@ void pc_defaults(void) {
pc->check_job_name = pc_check_job_name;
pc->update_idle_time = pc_update_idle_time;
+
+ pc->have_magnifier = pc_have_magnifier;
}
diff --git a/src/map/pc.h b/src/map/pc.h
index 23b46a631..06bc5e5ae 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -1088,6 +1088,8 @@ END_ZEROED_BLOCK; /* End */
int (*check_job_name) (const char *name);
void (*update_idle_time) (struct map_session_data* sd, enum e_battle_config_idletime type);
+
+ int (*have_magnifier) (struct map_session_data *sd);
};
#ifdef HERCULES_CORE
diff --git a/src/map/script.c b/src/map/script.c
index 35a71868a..5a3d1507f 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -18490,7 +18490,7 @@ BUILDIN(setcashmount)
if (sd->sc.data[SC_ALL_RIDING])
status_change_end(&sd->bl, SC_ALL_RIDING, INVALID_TIMER);
else
- sc_start(NULL,&sd->bl, SC_ALL_RIDING, 100, 0, -1);
+ sc_start(NULL,&sd->bl, SC_ALL_RIDING, 100, 25, -1);
script_pushint(st,1);//in both cases, return 1.
}
return true;
@@ -20898,6 +20898,45 @@ void script_hardcoded_constants(void)
script->set_constant("BG_AREA_WOS",BG_AREA_WOS,false, false);
script->set_constant("BG_QUEUE",BG_QUEUE,false, false);
+ /* LOOK_ constants, use in setlook/changelook script commands */
+ script->set_constant("LOOK_BASE", LOOK_BASE, false, false);
+ script->set_constant("LOOK_HAIR", LOOK_HAIR, false, false);
+ script->set_constant("LOOK_WEAPON", LOOK_WEAPON, false, false);
+ script->set_constant("LOOK_HEAD_BOTTOM", LOOK_HEAD_BOTTOM, false, false);
+ script->set_constant("LOOK_HEAD_TOP", LOOK_HEAD_TOP, false, false);
+ script->set_constant("LOOK_HEAD_MID", LOOK_HEAD_MID, false, false);
+ script->set_constant("LOOK_HAIR_COLOR", LOOK_HAIR_COLOR, false, false);
+ script->set_constant("LOOK_CLOTHES_COLOR", LOOK_CLOTHES_COLOR, false, false);
+ script->set_constant("LOOK_SHIELD", LOOK_SHIELD, false, false);
+ script->set_constant("LOOK_SHOES", LOOK_SHOES, false, false);
+ script->set_constant("LOOK_BODY", LOOK_BODY, false, false);
+ script->set_constant("LOOK_FLOOR", LOOK_FLOOR, false, false);
+ script->set_constant("LOOK_ROBE", LOOK_ROBE, false, false);
+ script->set_constant("LOOK_BODY2", LOOK_BODY2, false, false);
+
+ /* Equip Position in Bits, use with *getiteminfo type 5, or @inventorylist_equip */
+ script->set_constant("EQP_HEAD_LOW", EQP_HEAD_LOW, false, false);
+ script->set_constant("EQP_HEAD_MID", EQP_HEAD_MID, false, false);
+ script->set_constant("EQP_HEAD_TOP", EQP_HEAD_TOP, false, false);
+ script->set_constant("EQP_HAND_R", EQP_HAND_R, false, false);
+ script->set_constant("EQP_HAND_L", EQP_HAND_L, false, false);
+ script->set_constant("EQP_ARMOR", EQP_ARMOR, false, false);
+ script->set_constant("EQP_SHOES", EQP_SHOES, false, false);
+ script->set_constant("EQP_GARMENT", EQP_GARMENT, false, false);
+ script->set_constant("EQP_ACC_L", EQP_ACC_L, false, false);
+ script->set_constant("EQP_ACC_R", EQP_ACC_R, false, false);
+ script->set_constant("EQP_COSTUME_HEAD_TOP", EQP_COSTUME_HEAD_TOP, false, false);
+ script->set_constant("EQP_COSTUME_HEAD_MID", EQP_COSTUME_HEAD_MID, false, false);
+ script->set_constant("EQP_COSTUME_HEAD_LOW", EQP_COSTUME_HEAD_LOW, false, false);
+ script->set_constant("EQP_COSTUME_GARMENT", EQP_COSTUME_GARMENT, false, false);
+ script->set_constant("EQP_AMMO", EQP_AMMO, false, false);
+ script->set_constant("EQP_SHADOW_ARMOR", EQP_SHADOW_ARMOR, false, false);
+ script->set_constant("EQP_SHADOW_WEAPON", EQP_SHADOW_WEAPON, false, false);
+ script->set_constant("EQP_SHADOW_SHIELD", EQP_SHADOW_SHIELD, false, false);
+ script->set_constant("EQP_SHADOW_SHOES", EQP_SHADOW_SHOES, false, false);
+ script->set_constant("EQP_SHADOW_ACC_R", EQP_SHADOW_ACC_R, false, false);
+ script->set_constant("EQP_SHADOW_ACC_L", EQP_SHADOW_ACC_L, false, false);
+
/* Renewal */
#ifdef RENEWAL
script->set_constant("RENEWAL", 1, false, false);
diff --git a/src/map/status.c b/src/map/status.c
index db8c0d6c5..879f10efb 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -5542,8 +5542,10 @@ unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc
if(sc->data[SC_FUSION]) {
val = 25;
} else if (sd) {
- if (pc_isridingpeco(sd) || pc_isridingdragon(sd) || sd->sc.data[SC_ALL_RIDING])
+ if (pc_isridingpeco(sd) || pc_isridingdragon(sd))
val = 25;//Same bonus
+ else if (sd->sc.data[SC_ALL_RIDING])
+ val = sd->sc.data[SC_ALL_RIDING]->val1;
else if (pc_isridingwug(sd))
val = 15 + 5 * pc->checkskill(sd, RA_WUGRIDER);
else if (pc_ismadogear(sd)) {
@@ -8981,8 +8983,8 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
tick_time = 3000; // [GodLesZ] tick time
break;
case SC_CLOAKINGEXCEED:
- val2 = ( val1 + 1 ) / 2; // Hits
- val3 = 90 + val1 * 10; // Walk speed
+ val2 = (val1 + 1) / 2; // Hits
+ val3 = (val1 - 1) * 10; // Walk speed
if (bl->type == BL_PC)
val4 |= battle_config.pc_cloak_check_type&7;
else
diff --git a/src/map/unit.c b/src/map/unit.c
index 26104e4e0..bea0913d2 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1976,6 +1976,7 @@ bool unit_can_reach_pos(struct block_list *bl,int x,int y, int easy)
bool unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range, int easy, short *x, short *y)
{
short dx,dy;
+ struct walkpath_data wpd;
nullpo_retr(false, bl);
nullpo_retr(false, tbl);
@@ -2005,7 +2006,20 @@ bool unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range,
if (x) *x = tbl->x-dx;
if (y) *y = tbl->y-dy;
- return path->search(NULL,bl,bl->m,bl->x,bl->y,tbl->x-dx,tbl->y-dy,easy,CELL_CHKNOREACH);
+
+ if (!path->search(&wpd,bl,bl->m,bl->x,bl->y,tbl->x-dx,tbl->y-dy,easy,CELL_CHKNOREACH))
+ return false;
+
+#ifdef OFFICIAL_WALKPATH
+ if( !path->search_long(NULL, bl, bl->m, bl->x, bl->y, tbl->x-dx, tbl->y-dy, CELL_CHKNOPASS) // Check if there is an obstacle between
+ && wpd.path_len > 14 // Official number of walkable cells is 14 if and only if there is an obstacle between. [malufett]
+ && (bl->type != BL_NPC) ) // If type is a NPC, please disregard.
+ return false;
+#endif
+
+ return true;
+
+
}
/*==========================================
* Calculates position of Pet/Mercenary/Homunculus/Elemental
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index e0c5a4df3..d909e9892 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -1848,6 +1848,8 @@ struct {
struct HPMHookPoint *HP_clif_pHotkeyRowShift_post;
struct HPMHookPoint *HP_clif_dressroom_open_pre;
struct HPMHookPoint *HP_clif_dressroom_open_post;
+ struct HPMHookPoint *HP_clif_pOneClick_ItemIdentify_pre;
+ struct HPMHookPoint *HP_clif_pOneClick_ItemIdentify_post;
struct HPMHookPoint *HP_clif_selectcart_pre;
struct HPMHookPoint *HP_clif_selectcart_post;
struct HPMHookPoint *HP_clif_pSelectCart_pre;
@@ -4322,6 +4324,8 @@ struct {
struct HPMHookPoint *HP_pc_check_job_name_post;
struct HPMHookPoint *HP_pc_update_idle_time_pre;
struct HPMHookPoint *HP_pc_update_idle_time_post;
+ struct HPMHookPoint *HP_pc_have_magnifier_pre;
+ struct HPMHookPoint *HP_pc_have_magnifier_post;
struct HPMHookPoint *HP_libpcre_compile_pre;
struct HPMHookPoint *HP_libpcre_compile_post;
struct HPMHookPoint *HP_libpcre_study_pre;
@@ -7689,6 +7693,8 @@ struct {
int HP_clif_pHotkeyRowShift_post;
int HP_clif_dressroom_open_pre;
int HP_clif_dressroom_open_post;
+ int HP_clif_pOneClick_ItemIdentify_pre;
+ int HP_clif_pOneClick_ItemIdentify_post;
int HP_clif_selectcart_pre;
int HP_clif_selectcart_post;
int HP_clif_pSelectCart_pre;
@@ -10163,6 +10169,8 @@ struct {
int HP_pc_check_job_name_post;
int HP_pc_update_idle_time_pre;
int HP_pc_update_idle_time_post;
+ int HP_pc_have_magnifier_pre;
+ int HP_pc_have_magnifier_post;
int HP_libpcre_compile_pre;
int HP_libpcre_compile_post;
int HP_libpcre_study_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 5bbad878a..db30c8c02 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -944,6 +944,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->add_random_options, HP_clif_add_random_options) },
{ HP_POP(clif->pHotkeyRowShift, HP_clif_pHotkeyRowShift) },
{ HP_POP(clif->dressroom_open, HP_clif_dressroom_open) },
+ { HP_POP(clif->pOneClick_ItemIdentify, HP_clif_pOneClick_ItemIdentify) },
{ HP_POP(clif->selectcart, HP_clif_selectcart) },
{ HP_POP(clif->pSelectCart, HP_clif_pSelectCart) },
/* cmdline */
@@ -2211,6 +2212,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pc->autotrade_final, HP_pc_autotrade_final) },
{ HP_POP(pc->check_job_name, HP_pc_check_job_name) },
{ HP_POP(pc->update_idle_time, HP_pc_update_idle_time) },
+ { HP_POP(pc->have_magnifier, HP_pc_have_magnifier) },
/* libpcre */
{ HP_POP(libpcre->compile, HP_libpcre_compile) },
{ HP_POP(libpcre->study, HP_libpcre_study) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 87d85cc6c..11bf66481 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -24067,6 +24067,32 @@ void HP_clif_dressroom_open(struct map_session_data *sd, int view) {
}
return;
}
+void HP_clif_pOneClick_ItemIdentify(int fd, struct map_session_data *sd) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_clif_pOneClick_ItemIdentify_pre ) {
+ void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pOneClick_ItemIdentify_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_clif_pOneClick_ItemIdentify_pre[hIndex].func;
+ preHookFunc(&fd, sd);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.pOneClick_ItemIdentify(fd, sd);
+ }
+ if( HPMHooks.count.HP_clif_pOneClick_ItemIdentify_post ) {
+ void (*postHookFunc) (int *fd, struct map_session_data *sd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pOneClick_ItemIdentify_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_clif_pOneClick_ItemIdentify_post[hIndex].func;
+ postHookFunc(&fd, sd);
+ }
+ }
+ return;
+}
void HP_clif_selectcart(struct map_session_data *sd) {
int hIndex = 0;
if( HPMHooks.count.HP_clif_selectcart_pre ) {
@@ -57623,6 +57649,33 @@ void HP_pc_update_idle_time(struct map_session_data *sd, enum e_battle_config_id
}
return;
}
+int HP_pc_have_magnifier(struct map_session_data *sd) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if( HPMHooks.count.HP_pc_have_magnifier_pre ) {
+ int (*preHookFunc) (struct map_session_data *sd);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_magnifier_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_pc_have_magnifier_pre[hIndex].func;
+ retVal___ = preHookFunc(sd);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.pc.have_magnifier(sd);
+ }
+ if( HPMHooks.count.HP_pc_have_magnifier_post ) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_magnifier_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_pc_have_magnifier_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd);
+ }
+ }
+ return retVal___;
+}
/* libpcre */
pcre* HP_libpcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr) {
int hIndex = 0;