Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ matrix:
- cd ../..
- ./tools/checksql.sh
- compiler: gcc
env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug CC=gcc-6 --disable-manager --enable-Werror --enable-packetver=20191113 --enable-packetver-re --enable-buildbot" HPM="1"
env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug CC=gcc-6 --disable-manager --enable-Werror --enable-packetver=20191211 --enable-packetver-re --enable-buildbot" HPM="1"
addons:
apt:
sources:
Expand All @@ -60,7 +60,7 @@ matrix:
- libxml-sax-perl
- libxml-parser-perl
- compiler: clang
env: CONFIGURE_FLAGS="--enable-debug CC=clang-5.0 --enable-Werror --enable-packetver=20191113 --enable-packetver-re --enable-buildbot"
env: CONFIGURE_FLAGS="--enable-debug CC=clang-5.0 --enable-Werror --enable-packetver=20191211 --enable-packetver-re --enable-buildbot"
addons:
apt:
sources:
Expand All @@ -80,7 +80,7 @@ matrix:
- gdb
- clang-5.0
- compiler: clang
env: CONFIGURE_FLAGS="--enable-debug CC=clang-4.0 --enable-Werror --enable-packetver=20191113 --enable-packetver-re --enable-buildbot"
env: CONFIGURE_FLAGS="--enable-debug CC=clang-4.0 --enable-Werror --enable-packetver=20191211 --enable-packetver-re --enable-buildbot"
addons:
apt:
sources:
Expand Down Expand Up @@ -114,11 +114,11 @@ matrix:
- compiler: clang
env: CONFIGURE_FLAGS="--enable-debug --disable-renewal --enable-Werror --enable-buildbot"
- compiler: gcc
env: CONFIGURE_FLAGS="--enable-debug --enable-Werror --enable-packetver=20191113 --enable-packetver-re --enable-buildbot"
env: CONFIGURE_FLAGS="--enable-debug --enable-Werror --enable-packetver=20191211 --enable-packetver-re --enable-buildbot"
- compiler: gcc
env: CONFIGURE_FLAGS="--enable-debug --disable-renewal --enable-Werror --enable-buildbot"
- compiler: gcc
env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-5 --disable-manager --enable-Werror --enable-packetver=20191113 --enable-packetver-re --enable-buildbot"
env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-5 --disable-manager --enable-Werror --enable-packetver=20191211 --enable-packetver-re --enable-buildbot"
addons:
apt:
sources:
Expand All @@ -136,7 +136,7 @@ matrix:
- gdb
- gcc-5
- compiler: gcc
env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-6 --disable-manager --enable-Werror --enable-packetver=20191113 --enable-packetver-re --enable-buildbot"
env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-6 --disable-manager --enable-Werror --enable-packetver=20191211 --enable-packetver-re --enable-buildbot"
addons:
apt:
sources:
Expand All @@ -154,7 +154,7 @@ matrix:
- gdb
- gcc-6
- compiler: gcc
env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug CC=gcc-7 --disable-manager --enable-Werror --enable-packetver=20191113 --enable-packetver-re --enable-buildbot"
env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug CC=gcc-7 --disable-manager --enable-Werror --enable-packetver=20191211 --enable-packetver-re --enable-buildbot"
addons:
apt:
sources:
Expand All @@ -172,7 +172,7 @@ matrix:
- gdb
- gcc-7
- compiler: gcc
env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-8 --disable-manager --enable-Werror --enable-packetver=20191113 --enable-packetver-re --enable-buildbot"
env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-8 --disable-manager --enable-Werror --enable-packetver=20191211 --enable-packetver-re --enable-buildbot"
addons:
apt:
sources:
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/sh
# From configure.ac b3a11d273.
# From configure.ac 9bce92f63.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.
#
Expand Down
2 changes: 1 addition & 1 deletion doc/effect_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The following is a compiled list of visual and sound effects which the client
can produce. Each list entry contains a number and a short description of the
effect. You can produce these effects ingame by using the `@effect` atcommand.
It's also possible to attach effects to item/npc scripts by using the
`specialeffect()` script command.
`specialeffect()` or `specialeffectnum()` script commands.

ID | Constant Name | Description
--: | :----------------------------- | :----------------------------------
Expand Down
9 changes: 9 additions & 0 deletions doc/script_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6231,6 +6231,15 @@ Example usage:

---------------------------------------

*specialeffectnum(<effect number>, <num1>, <num2>{, <send_target>{, <unit id>{, <account id>}}})
*specialeffectnum(<effect number>, <num1>, <num2>{, <send_target>{, "<NPC Name>"{, <account id>}}})

Works same as specialeffect but also send effect numbers to client.
For PACKETVER >= 20191127 support two numbers (num1, num2).
For older packet versions only num1 supported.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any info on what num2 affects?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

num2 is high dword of num. Script engine not support int64, because this here num and num2. Inside packet its one int32 or one int64 depend on packet version


---------------------------------------

*removespecialeffect(<effect number>{, <send_target>{, <unit id>{, <account id>}}})
*removespecialeffect(<effect number>{, <send_target>{, "<NPC Name>"{, <account id>}}})

Expand Down
19 changes: 19 additions & 0 deletions src/common/packets/packets2019_len_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -4294,7 +4294,11 @@ packetLen(0x0af8, 11)
packetLen(0x0af9, 6)

// Packet: 0x0afa
#if PACKETVER >= 20191204
packetLen(0x0afa, 58)
#elif PACKETVER >= 20190109
packetLen(0x0afa, 54)
#endif

// Packet: 0x0afb
packetLen(0x0afb, -1)
Expand Down Expand Up @@ -4846,5 +4850,20 @@ packetLen(0x0b66, 25)
packetLen(0x0b67, 32)
#endif

// Packet: 0x0b68
#if PACKETVER >= 20191120
packetLen(0x0b68, 12)
#endif

// Packet: 0x0b69
#if PACKETVER >= 20191127
packetLen(0x0b69, 18)
#endif

// Packet: 0x0b6a
#if PACKETVER >= 20191204
packetLen(0x0b6a, -1)
#endif


#endif /* COMMON_PACKETS2019_LEN_MAIN_H */
19 changes: 19 additions & 0 deletions src/common/packets/packets2019_len_re.h
Original file line number Diff line number Diff line change
Expand Up @@ -4300,7 +4300,11 @@ packetLen(0x0af8, 11)
packetLen(0x0af9, 6)

// Packet: 0x0afa
#if PACKETVER >= 20191204
packetLen(0x0afa, 58)
#elif PACKETVER >= 20190109
packetLen(0x0afa, 54)
#endif

// Packet: 0x0afb
packetLen(0x0afb, -1)
Expand Down Expand Up @@ -4858,5 +4862,20 @@ packetLen(0x0b66, 25)
packetLen(0x0b67, 32)
#endif

// Packet: 0x0b68
#if PACKETVER >= 20191120
packetLen(0x0b68, 12)
#endif

// Packet: 0x0b69
#if PACKETVER >= 20191127
packetLen(0x0b69, 18)
#endif

// Packet: 0x0b6a
#if PACKETVER >= 20191204
packetLen(0x0b6a, -1)
#endif


#endif /* COMMON_PACKETS2019_LEN_RE_H */
19 changes: 19 additions & 0 deletions src/common/packets/packets2019_len_zero.h
Original file line number Diff line number Diff line change
Expand Up @@ -4294,7 +4294,11 @@ packetLen(0x0af8, 11)
packetLen(0x0af9, 6)

// Packet: 0x0afa
#if PACKETVER >= 20191204
packetLen(0x0afa, 58)
#elif PACKETVER >= 20190116
packetLen(0x0afa, 54)
#endif

// Packet: 0x0afb
packetLen(0x0afb, -1)
Expand Down Expand Up @@ -4830,5 +4834,20 @@ packetLen(0x0b66, 25)
packetLen(0x0b67, 32)
#endif

// Packet: 0x0b68
#if PACKETVER >= 20191127
packetLen(0x0b68, 12)
#endif

// Packet: 0x0b69
#if PACKETVER >= 20191127
packetLen(0x0b69, 18)
#endif

// Packet: 0x0b6a
#if PACKETVER >= 20191204
packetLen(0x0b6a, -1)
#endif


#endif /* COMMON_PACKETS2019_LEN_ZERO_H */
4 changes: 4 additions & 0 deletions src/common/packetsstatic_len.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#define DEFINE_PACKET_ID(name, id) \
enum { HEADER_##name = id };

#define CHECK_PACKET_HEADER(name, id) \
STATIC_ASSERT((int32)(PACKET_LEN_##id) == -1 || sizeof(struct PACKET_##name) == \
(size_t)PACKET_LEN_##id, "Wrong size PACKET_"#name); \

#define packetLen(id, len) PACKET_LEN_##id = (len),
enum packet_lengths {
#include "common/packets_len.h"
Expand Down
50 changes: 39 additions & 11 deletions src/map/clif.c
Original file line number Diff line number Diff line change
Expand Up @@ -9087,21 +9087,44 @@ static void clif_specialeffect_single(struct block_list *bl, int type, int fd)
/// @see doc/effect_list.txt
/// num data:
/// effect-dependent value
static void clif_specialeffect_value(struct block_list *bl, int effect_id, int num, send_target target)
{
uint8 buf[14];

WBUFW(buf,0) = 0x284;
WBUFL(buf,2) = bl->id;
WBUFL(buf,6) = effect_id;
WBUFL(buf,10) = num;
static void clif_specialeffect_value(struct block_list *bl, int effect_id, uint64 num, send_target target)
{
#if PACKETVER_MAIN_NUM >= 20060911 || PACKETVER_AD_NUM >= 20060911 || PACKETVER_SAK_NUM >= 20060911 || defined(PACKETVER_RE) || defined(PACKETVER_ZERO)
struct PACKET_ZC_NOTIFY_EFFECT3 packet;
packet.packetType = HEADER_ZC_NOTIFY_EFFECT3;
packet.aid = bl->id;
packet.effectId = effect_id;
#if PACKETVER >= 20191127
packet.num = num;
#else
packet.num = (uint32)num;
#endif

clif->send(buf, packet_len(0x284), bl, target);
clif->send(&packet, sizeof(struct PACKET_ZC_NOTIFY_EFFECT3), bl, target);

if (clif->isdisguised(bl)) {
WBUFL(buf,2) = -bl->id;
clif->send(buf, packet_len(0x284), bl, SELF);
packet.aid = -bl->id;
clif->send(&packet, sizeof(struct PACKET_ZC_NOTIFY_EFFECT3), bl, SELF);
}
#endif
}

static void clif_specialeffect_value_single(struct block_list *bl, int effect_id, uint64 num, int fd)
{
#if PACKETVER_MAIN_NUM >= 20060911 || defined(PACKETVER_RE) || defined(PACKETVER_ZERO)
WFIFOHEAD(fd, sizeof(struct PACKET_ZC_NOTIFY_EFFECT3));

struct PACKET_ZC_NOTIFY_EFFECT3 *packet = WFIFOP(fd, 0);
packet->packetType = HEADER_ZC_NOTIFY_EFFECT3;
packet->aid = bl->id;
packet->effectId = effect_id;
#if PACKETVER >= 20191127
packet->num = num;
#else
packet->num = (uint32)num;
#endif
WFIFOSET(fd, sizeof(struct PACKET_ZC_NOTIFY_EFFECT3));
#endif
}

/// Remove special effects (ZC_REMOVE_EFFECT).
Expand Down Expand Up @@ -9315,6 +9338,8 @@ static void clif_refresh(struct map_session_data *sd)

mail->clear(sd);

clif->loadConfirm(sd);

if (clif->isdisguised(&sd->bl)) {/* refresh-da */
short disguise = sd->disguise;
pc->disguise(sd, -1);
Expand Down Expand Up @@ -19960,6 +19985,7 @@ static void clif_parse_dull(int fd, struct map_session_data *sd)
static void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
static void clif_parse_CashShopOpen(int fd, struct map_session_data *sd)
{
#if PACKETVER >= 20100824
if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd))
return;

Expand All @@ -19973,6 +19999,7 @@ static void clif_parse_CashShopOpen(int fd, struct map_session_data *sd)
WFIFOL(fd, 2) = sd->cashPoints; //[Ryuuzaki] - switched positions to reflect proper values
WFIFOL(fd, 6) = sd->kafraPoints;
WFIFOSET(fd, 10);
#endif
}

static void clif_parse_CashShopClose(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
Expand Down Expand Up @@ -24064,6 +24091,7 @@ void clif_defaults(void)
clif->specialeffect = clif_specialeffect;
clif->specialeffect_single = clif_specialeffect_single;
clif->specialeffect_value = clif_specialeffect_value;
clif->specialeffect_value_single = clif_specialeffect_value_single;
clif->removeSpecialEffect = clif_removeSpecialEffect;
clif->removeSpecialEffect_single = clif_removeSpecialEffect_single;
clif->millenniumshield = clif_millenniumshield;
Expand Down
3 changes: 2 additions & 1 deletion src/map/clif.h
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,8 @@ struct clif_interface {
void (*weather) (int16 m);
void (*specialeffect) (struct block_list* bl, int type, enum send_target target);
void (*specialeffect_single) (struct block_list* bl, int type, int fd);
void (*specialeffect_value) (struct block_list* bl, int effect_id, int num, send_target target);
void (*specialeffect_value) (struct block_list* bl, int effect_id, uint64 num, send_target target);
void (*specialeffect_value_single) (struct block_list *bl, int effect_id, uint64 num, int fd);
void (*removeSpecialEffect) (struct block_list *bl, int effectId, enum send_target target);
void (*removeSpecialEffect_single) (struct block_list *bl, int effectId, struct block_list *targetBl);
void (*millenniumshield) (struct block_list *bl, short shields );
Expand Down
Loading