summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/pre-re/skill_db.conf18
-rw-r--r--db/re/skill_db.conf18
-rw-r--r--src/map/clif.c31
-rw-r--r--src/map/clif.h1
-rw-r--r--src/map/packets_struct.h13
-rw-r--r--src/map/skill.c6
-rw-r--r--src/map/skill.h1
7 files changed, 88 insertions, 0 deletions
diff --git a/db/pre-re/skill_db.conf b/db/pre-re/skill_db.conf
index 80527b4f6..06c06dd16 100644
--- a/db/pre-re/skill_db.conf
+++ b/db/pre-re/skill_db.conf
@@ -73,6 +73,7 @@
Works like skill SA_FREECAST, allow move and attack with reduced speed.
FreeCastNormal: true/false (boolean, defaults to false)
Works like FreeCastReduced, but not reduce speed.
+ ShowSkillScale: true/false (boolean, defaults to false)
}
AttackType: "Attack Type" (string, defaults to "None")
Types: "None", "Weapon", "Magic" or "Misc"
@@ -16551,6 +16552,7 @@ skill_db: (
SkillInfo: {
NPC: true
IgnoreLandProtector: true
+ ShowSkillScale: true
}
AttackType: "Weapon"
DamageType: {
@@ -16698,6 +16700,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -16758,6 +16761,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
AttackType: "Weapon"
DamageType: {
@@ -16777,6 +16781,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
AttackType: "Weapon"
DamageType: {
@@ -16797,6 +16802,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -16828,6 +16834,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -16859,6 +16866,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -16890,6 +16898,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -16921,6 +16930,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -16952,6 +16962,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -16983,6 +16994,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
AttackType: "Magic"
Element: "Ele_Fire"
@@ -17006,6 +17018,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
AttackType: "Magic"
Element: "Ele_Dark"
@@ -17069,6 +17082,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -17174,6 +17188,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -17205,6 +17220,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -17236,6 +17252,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
AttackType: "Weapon"
DamageType: {
@@ -17265,6 +17282,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
diff --git a/db/re/skill_db.conf b/db/re/skill_db.conf
index 2a59785fa..815442fd9 100644
--- a/db/re/skill_db.conf
+++ b/db/re/skill_db.conf
@@ -73,6 +73,7 @@
Works like skill SA_FREECAST, allow move and attack with reduced speed.
FreeCastNormal: true/false (boolean, defaults to false)
Works like FreeCastReduced, but not reduce speed.
+ ShowSkillScale: true/false (boolean, defaults to false)
}
AttackType: "Attack Type" (string, defaults to "None")
Types: "None", "Weapon", "Magic" or "Misc"
@@ -17009,6 +17010,7 @@ skill_db: (
SkillInfo: {
NPC: true
IgnoreLandProtector: true
+ ShowSkillScale: true
}
AttackType: "Weapon"
DamageType: {
@@ -17156,6 +17158,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -17216,6 +17219,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
AttackType: "Weapon"
DamageType: {
@@ -17235,6 +17239,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
AttackType: "Weapon"
DamageType: {
@@ -17255,6 +17260,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -17286,6 +17292,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -17317,6 +17324,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -17348,6 +17356,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -17379,6 +17388,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -17410,6 +17420,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -17441,6 +17452,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
AttackType: "Magic"
Element: "Ele_Fire"
@@ -17464,6 +17476,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
AttackType: "Magic"
Element: "Ele_Dark"
@@ -17527,6 +17540,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -17632,6 +17646,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -17663,6 +17678,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
@@ -17694,6 +17710,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
AttackType: "Weapon"
DamageType: {
@@ -17723,6 +17740,7 @@ skill_db: (
}
SkillInfo: {
NPC: true
+ ShowSkillScale: true
}
DamageType: {
NoDamage: true
diff --git a/src/map/clif.c b/src/map/clif.c
index 4bf3cdf94..95a2d8f5d 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -5068,6 +5068,10 @@ void clif_useskill(struct block_list* bl, int src_id, int dst_id, int dst_x, int
} else {
clif->send(buf,packet_len(cmd), bl, AREA);
}
+#if PACKETVER >= 20151223
+ if ((skill->get_inf2(skill_id) & INF2_SHOW_SKILL_SCALE) != 0)
+ clif->skill_scale(bl, src_id, bl->x, bl->y, skill_id, skill_lv, casttime);
+#endif
}
/// Notifies clients in area, that an object canceled casting (ZC_DISPEL).
@@ -19860,6 +19864,32 @@ void clif_parse_rodex_cancel_write_mail(int fd, struct map_session_data *sd)
rodex->clean(sd, 1);
}
+void clif_skill_scale(struct block_list *bl, int src_id, int x, int y, uint16 skill_id, uint16 skill_lv, int casttime)
+{
+#if PACKETVER >= 20151223
+ struct PACKET_ZC_SKILL_SCALE p;
+
+ p.PacketType = skillscale;
+ p.AID = src_id;
+ p.skill_id = skill_id;
+ p.skill_lv = skill_lv;
+ p.x = x;
+ p.y = y;
+ p.casttime = casttime;
+
+ if (clif->isdisguised(bl)) {
+ clif->send(&p, sizeof(p), bl, AREA_WOS);
+ p.AID = -src_id;
+ clif->send(&p, sizeof(p), bl, SELF);
+ } else {
+ clif->send(&p, sizeof(p), bl, AREA);
+ }
+#else
+ ShowWarning("clif_skill_scale: showing skill scale available only for clients >= 20151223.");
+ return;
+#endif
+}
+
/*==========================================
* Main client packet processing function
*------------------------------------------*/
@@ -20929,4 +20959,5 @@ void clif_defaults(void) {
clif->rodex_request_items = clif_rodex_request_items;
clif->rodex_icon = clif_rodex_icon;
clif->rodex_send_mails_all = clif_rodex_send_mails_all;
+ clif->skill_scale = clif_skill_scale;
}
diff --git a/src/map/clif.h b/src/map/clif.h
index 851c823ea..112db3dec 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -1395,6 +1395,7 @@ struct clif_interface {
void (*pRodexRequestItems) (int fd, struct map_session_data *sd);
void (*rodex_request_items) (struct map_session_data *sd, int8 opentype, int64 mail_id, int8 result);
void (*rodex_icon) (int fd, bool show);
+ void (*skill_scale) (struct block_list *bl, int src_id, int x, int y, uint16 skill_id, uint16 skill_lv, int casttime);
};
#ifdef HERCULES_CORE
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 03b555e2b..e1395e949 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -330,6 +330,9 @@ enum packet_headers {
#else // PACKETVER >= 20160316
rodexcheckplayer = 0x0A51,
#endif
+#if PACKETVER >= 20151223
+ skillscale = 0xA41,
+#endif
};
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
@@ -1478,6 +1481,16 @@ struct PACKET_ZC_ACK_ITEM_FROM_MAIL {
int8 result;
} __attribute__((packed));
+struct PACKET_ZC_SKILL_SCALE {
+ int16 PacketType;
+ uint32 AID;
+ int16 skill_id;
+ int16 skill_lv;
+ int16 x;
+ int16 y;
+ uint32 casttime;
+} __attribute__((packed));
+
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
#pragma pack(pop)
#endif // not NetBSD < 6 / Solaris
diff --git a/src/map/skill.c b/src/map/skill.c
index 1b7d40e83..d20178a34 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -20030,6 +20030,12 @@ void skill_validate_skillinfo(struct config_setting_t *conf, struct s_skill_db *
} else {
sk->inf2 &= ~INF2_FREE_CAST_REDUCED;
}
+ } else if (strcmpi(type, "ShowSkillScale") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_SHOW_SKILL_SCALE;
+ } else {
+ sk->inf2 &= ~INF2_SHOW_SKILL_SCALE;
+ }
} else if (strcmpi(type, "None") != 0) {
skilldb_invalid_error(type, config_setting_name(t), sk->nameid);
}
diff --git a/src/map/skill.h b/src/map/skill.h
index fa95a1a99..a0591de74 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -119,6 +119,7 @@ enum e_skill_inf2 {
INF2_CHORUS_SKILL = 0x04000, // Chorus skill
INF2_FREE_CAST_NORMAL = 0x08000,
INF2_FREE_CAST_REDUCED = 0x10000,
+ INF2_SHOW_SKILL_SCALE = 0x20000,
};