summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c1780
-rw-r--r--src/map/battle.c66
-rw-r--r--src/map/battleground.c14
-rw-r--r--src/map/buyingstore.c66
-rw-r--r--src/map/chat.c54
-rw-r--r--src/map/chrif.c50
-rw-r--r--src/map/clif.c1177
-rw-r--r--src/map/clif.h911
-rw-r--r--src/map/duel.c26
-rw-r--r--src/map/elemental.c18
-rw-r--r--src/map/guild.c160
-rw-r--r--src/map/homunculus.c108
-rw-r--r--src/map/instance.c12
-rw-r--r--src/map/intif.c64
-rw-r--r--src/map/mail.c12
-rw-r--r--src/map/map.c71
-rw-r--r--src/map/mercenary.c16
-rw-r--r--src/map/mob.c46
-rw-r--r--src/map/npc.c66
-rw-r--r--src/map/party.c110
-rw-r--r--src/map/pc.c531
-rw-r--r--src/map/pet.c78
-rw-r--r--src/map/quest.c18
-rw-r--r--src/map/script.c230
-rw-r--r--src/map/searchstore.c34
-rw-r--r--src/map/skill.c1606
-rw-r--r--src/map/status.c278
-rw-r--r--src/map/storage.c46
-rw-r--r--src/map/trade.c90
-rw-r--r--src/map/unit.c98
-rw-r--r--src/map/vending.c32
31 files changed, 4084 insertions, 3784 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 096d7a4b9..a585e6cc8 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -219,21 +219,21 @@ ACMD_FUNC(send)
{
int i;
for (i = 900; i <= 903; ++i)
- clif_displaymessage(fd, msg_txt(i));
+ clif->displaymessage(fd, msg_txt(i));
return -1;
}
#define PARSE_ERROR(error,p) \
{\
- clif_displaymessage(fd, (error));\
+ clif->displaymessage(fd, (error));\
sprintf(atcmd_output, ">%s", (p));\
- clif_displaymessage(fd, atcmd_output);\
+ clif->displaymessage(fd, atcmd_output);\
}
//define PARSE_ERROR
#define CHECK_EOS(p) \
if(*(p) == 0){\
- clif_displaymessage(fd, "Unexpected end of string");\
+ clif->displaymessage(fd, "Unexpected end of string");\
return -1;\
}
//define CHECK_EOS
@@ -259,7 +259,7 @@ ACMD_FUNC(send)
if(len)
{// show packet length
sprintf(atcmd_output, msg_txt(904), type, packet_db[sd->packet_ver][type].len); // Packet 0x%x length: %d
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
@@ -268,7 +268,7 @@ ACMD_FUNC(send)
if(len == 0)
{// unknown packet - ERROR
sprintf(atcmd_output, msg_txt(905), type); // Unknown packet: 0x%x
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return -1;
} else if(len == -1)
{// dynamic packet
@@ -425,11 +425,11 @@ ACMD_FUNC(send)
WFIFOSET(fd,len);
}
} else {
- clif_displaymessage(fd, msg_txt(259)); // Invalid packet
+ clif->displaymessage(fd, msg_txt(259)); // Invalid packet
return -1;
}
sprintf (atcmd_output, msg_txt(258), type, type); // Sent packet 0x%x (%d)
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
#undef PARSE_ERROR
#undef CHECK_EOS
@@ -455,7 +455,7 @@ ACMD_FUNC(mapmove)
(sscanf(message, "%15s %hd %hd", map_name, &x, &y) < 3 &&
sscanf(message, "%15[^,],%hd,%hd", map_name, &x, &y) < 1)) {
- clif_displaymessage(fd, msg_txt(909)); // Please enter a map (usage: @warp/@rura/@mapmove <mapname> <x> <y>).
+ clif->displaymessage(fd, msg_txt(909)); // Please enter a map (usage: @warp/@rura/@mapmove <mapname> <x> <y>).
return -1;
}
@@ -464,30 +464,30 @@ ACMD_FUNC(mapmove)
m = map_mapindex2mapid(mapindex);
if (!mapindex) { // m < 0 means on different server! [Kevin]
- clif_displaymessage(fd, msg_txt(1)); // Map not found.
+ clif->displaymessage(fd, msg_txt(1)); // Map not found.
return -1;
}
if ((x || y) && map_getcell(m, x, y, CELL_CHKNOPASS))
{ //This is to prevent the pc_setpos call from printing an error.
- clif_displaymessage(fd, msg_txt(2));
+ clif->displaymessage(fd, msg_txt(2));
if (!map_search_freecell(NULL, m, &x, &y, 10, 10, 1))
x = y = 0; //Invalid cell, use random spot.
}
if (map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
- clif_displaymessage(fd, msg_txt(247));
+ clif->displaymessage(fd, msg_txt(247));
return -1;
}
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
- clif_displaymessage(fd, msg_txt(248));
+ clif->displaymessage(fd, msg_txt(248));
return -1;
}
if (pc_setpos(sd, mapindex, x, y, CLR_TELEPORT) != 0) {
- clif_displaymessage(fd, msg_txt(1)); // Map not found.
+ clif->displaymessage(fd, msg_txt(1)); // Map not found.
return -1;
}
- clif_displaymessage(fd, msg_txt(0)); // Warped.
+ clif->displaymessage(fd, msg_txt(0)); // Warped.
return 0;
}
@@ -502,7 +502,7 @@ ACMD_FUNC(where)
memset(atcmd_player_name, '\0', sizeof atcmd_player_name);
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
- clif_displaymessage(fd, msg_txt(910)); // Please enter a player name (usage: @where <char name>).
+ clif->displaymessage(fd, msg_txt(910)); // Please enter a player name (usage: @where <char name>).
return -1;
}
@@ -511,12 +511,12 @@ ACMD_FUNC(where)
strncmp(pl_sd->status.name, atcmd_player_name, NAME_LENGTH) != 0 ||
(pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && pc_get_group_level(pl_sd) > pc_get_group_level(sd) && !pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID))
) {
- clif_displaymessage(fd, msg_txt(3)); // Character not found.
+ clif->displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
snprintf(atcmd_output, sizeof atcmd_output, "%s %s %d %d", pl_sd->status.name, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
@@ -531,37 +531,37 @@ ACMD_FUNC(jumpto)
nullpo_retr(-1, sd);
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(911)); // Please enter a player name (usage: @jumpto/@warpto/@goto <char name/ID>).
+ clif->displaymessage(fd, msg_txt(911)); // Please enter a player name (usage: @jumpto/@warpto/@goto <char name/ID>).
return -1;
}
if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL)
{
- clif_displaymessage(fd, msg_txt(3)); // Character not found.
+ clif->displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
{
- clif_displaymessage(fd, msg_txt(247)); // You are not authorized to warp to this map.
+ clif->displaymessage(fd, msg_txt(247)); // You are not authorized to warp to this map.
return -1;
}
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
{
- clif_displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map.
+ clif->displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map.
return -1;
}
if( pc_isdead(sd) )
{
- clif_displaymessage(fd, msg_txt(664));
+ clif->displaymessage(fd, msg_txt(664));
return -1;
}
pc_setpos(sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
sprintf(atcmd_output, msg_txt(4), pl_sd->status.name); // Jumped to %s
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
@@ -580,26 +580,26 @@ ACMD_FUNC(jump)
sscanf(message, "%hd %hd", &x, &y);
if (map[sd->bl.m].flag.noteleport && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
- clif_displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map.
+ clif->displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map.
return -1;
}
if( pc_isdead(sd) )
{
- clif_displaymessage(fd, msg_txt(664));
+ clif->displaymessage(fd, msg_txt(664));
return -1;
}
if ((x || y) && map_getcell(sd->bl.m, x, y, CELL_CHKNOPASS))
{ //This is to prevent the pc_setpos call from printing an error.
- clif_displaymessage(fd, msg_txt(2));
+ clif->displaymessage(fd, msg_txt(2));
if (!map_search_freecell(NULL, sd->bl.m, &x, &y, 10, 10, 1))
x = y = 0; //Invalid cell, use random spot.
}
pc_setpos(sd, sd->mapindex, x, y, CLR_TELEPORT);
sprintf(atcmd_output, msg_txt(5), sd->bl.x, sd->bl.y); // Jumped to %d %d
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
@@ -679,7 +679,7 @@ ACMD_FUNC(who)
break;
}
}
- clif_displaymessage(fd, StringBuf_Value(&buf));
+ clif->displaymessage(fd, StringBuf_Value(&buf));
StringBuf_Clear(&buf);
count++;
}
@@ -701,7 +701,7 @@ ACMD_FUNC(who)
else
StringBuf_Printf(&buf, msg_txt(56), count, map[map_id].name); // %d players found in map '%s'.
}
- clif_displaymessage(fd, StringBuf_Value(&buf));
+ clif->displaymessage(fd, StringBuf_Value(&buf));
StringBuf_Destroy(&buf);
return 0;
}
@@ -754,7 +754,7 @@ ACMD_FUNC(whogm)
if (pl_sd->sc.option & OPTION_INVISIBLE)
continue;
sprintf(atcmd_output, msg_txt(913), pl_sd->status.name); // Name: %s (GM)
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
count++;
continue;
}
@@ -762,12 +762,12 @@ ACMD_FUNC(whogm)
sprintf(atcmd_output, msg_txt(914), // Name: %s (GM:%d) | Location: %s %d %d
pl_sd->status.name, pl_level,
mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(915), // BLvl: %d | Job: %s (Lvl: %d)
pl_sd->status.base_level,
job_name(pl_sd->status.class_), pl_sd->status.job_level);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
p = party_search(pl_sd->status.party_id);
g = guild_search(pl_sd->status.guild_id);
@@ -775,18 +775,18 @@ ACMD_FUNC(whogm)
sprintf(atcmd_output,msg_txt(916), // Party: '%s' | Guild: '%s'
p?p->party.name:msg_txt(917), g?g->name:msg_txt(917)); // None.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
count++;
}
mapit_free(iter);
if (count == 0)
- clif_displaymessage(fd, msg_txt(150)); // No GM found.
+ clif->displaymessage(fd, msg_txt(150)); // No GM found.
else if (count == 1)
- clif_displaymessage(fd, msg_txt(151)); // 1 GM found.
+ clif->displaymessage(fd, msg_txt(151)); // 1 GM found.
else {
sprintf(atcmd_output, msg_txt(152), count); // %d GMs found.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
return 0;
@@ -805,7 +805,7 @@ ACMD_FUNC(save)
chrif_save(sd,0);
- clif_displaymessage(fd, msg_txt(6)); // Your save point has been changed.
+ clif->displaymessage(fd, msg_txt(6)); // Your save point has been changed.
return 0;
}
@@ -821,16 +821,16 @@ ACMD_FUNC(load)
m = map_mapindex2mapid(sd->status.save_point.map);
if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
- clif_displaymessage(fd, msg_txt(249)); // You are not authorized to warp to your save map.
+ clif->displaymessage(fd, msg_txt(249)); // You are not authorized to warp to your save map.
return -1;
}
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
- clif_displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map.
+ clif->displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map.
return -1;
}
pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_OUTSIGHT);
- clif_displaymessage(fd, msg_txt(7)); // Warping to save point..
+ clif->displaymessage(fd, msg_txt(7)); // Warping to save point..
return 0;
}
@@ -848,13 +848,13 @@ ACMD_FUNC(speed)
if (!message || !*message || sscanf(message, "%d", &speed) < 1) {
sprintf(atcmd_output, msg_txt(918), MIN_WALK_SPEED, MAX_WALK_SPEED); // Please enter a speed value (usage: @speed <%d-%d>).
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return -1;
}
sd->base_status.speed = cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED);
status_calc_bl(&sd->bl, SCB_SPEED);
- clif_displaymessage(fd, msg_txt(8)); // Speed changed.
+ clif->displaymessage(fd, msg_txt(8)); // Speed changed.
return 0;
}
@@ -870,11 +870,11 @@ ACMD_FUNC(storage)
if (storage_storageopen(sd) == 1)
{ //Already open.
- clif_displaymessage(fd, msg_txt(250));
+ clif->displaymessage(fd, msg_txt(250));
return -1;
}
- clif_displaymessage(fd, msg_txt(919)); // Storage opened.
+ clif->displaymessage(fd, msg_txt(919)); // Storage opened.
return 0;
}
@@ -888,7 +888,7 @@ ACMD_FUNC(guildstorage)
nullpo_retr(-1, sd);
if (!sd->status.guild_id) {
- clif_displaymessage(fd, msg_txt(252));
+ clif->displaymessage(fd, msg_txt(252));
return -1;
}
@@ -896,17 +896,17 @@ ACMD_FUNC(guildstorage)
return -1;
if (sd->state.storage_flag == 1) {
- clif_displaymessage(fd, msg_txt(250));
+ clif->displaymessage(fd, msg_txt(250));
return -1;
}
if (sd->state.storage_flag == 2) {
- clif_displaymessage(fd, msg_txt(251));
+ clif->displaymessage(fd, msg_txt(251));
return -1;
}
storage_guild_storageopen(sd);
- clif_displaymessage(fd, msg_txt(920)); // Guild storage opened.
+ clif->displaymessage(fd, msg_txt(920)); // Guild storage opened.
return 0;
}
@@ -926,11 +926,11 @@ ACMD_FUNC(option)
text = atcommand_help_string( command );
// notify the user of the requirement to enter an option
- clif_displaymessage(fd, msg_txt(921)); // Please enter at least one option.
+ clif->displaymessage(fd, msg_txt(921)); // Please enter at least one option.
if( text )
{// send the help text associated with this command
- clif_displaymessage( fd, text );
+ clif->displaymessage( fd, text );
}
return -1;
@@ -940,7 +940,7 @@ ACMD_FUNC(option)
sd->sc.opt2 = param2;
pc_setoption(sd, param3);
- clif_displaymessage(fd, msg_txt(9)); // Options changed.
+ clif->displaymessage(fd, msg_txt(9)); // Options changed.
return 0;
}
@@ -957,7 +957,7 @@ ACMD_FUNC(hide)
status_set_viewdata(&sd->bl, sd->disguise);
else
status_set_viewdata(&sd->bl, sd->status.class_);
- clif_displaymessage(fd, msg_txt(10)); // Invisible: Off
+ clif->displaymessage(fd, msg_txt(10)); // Invisible: Off
// increment the number of pvp players on the map
map[sd->bl.m].users_pvp++;
@@ -967,11 +967,11 @@ ACMD_FUNC(hide)
sd->pvp_timer = add_timer( gettick() + 200, pc_calc_pvprank_timer, sd->bl.id, 0 );
}
//bugreport:2266
- map_foreachinmovearea(clif_insight, &sd->bl, AREA_SIZE, sd->bl.x, sd->bl.y, BL_ALL, &sd->bl);
+ map_foreachinmovearea(clif->insight, &sd->bl, AREA_SIZE, sd->bl.x, sd->bl.y, BL_ALL, &sd->bl);
} else {
sd->sc.option |= OPTION_INVISIBLE;
sd->vd.class_ = INVISIBLE_CLASS;
- clif_displaymessage(fd, msg_txt(11)); // Invisible: On
+ clif->displaymessage(fd, msg_txt(11)); // Invisible: On
// decrement the number of pvp players on the map
map[sd->bl.m].users_pvp--;
@@ -982,7 +982,7 @@ ACMD_FUNC(hide)
sd->pvp_timer = INVALID_TIMER;
}
}
- clif_changeoption(&sd->bl);
+ clif->changeoption(&sd->bl);
return 0;
}
@@ -1011,7 +1011,7 @@ ACMD_FUNC(jobchange)
if (!found) {
text = atcommand_help_string(command);
if (text)
- clif_displaymessage(fd, text);
+ clif->displaymessage(fd, text);
return -1;
}
}
@@ -1020,21 +1020,21 @@ ACMD_FUNC(jobchange)
|| job == JOB_LORD_KNIGHT2 || job == JOB_PALADIN2 || job == JOB_BABY_KNIGHT2 || job == JOB_BABY_CRUSADER2 || job == JOB_STAR_GLADIATOR2
|| (job >= JOB_RUNE_KNIGHT2 && job <= JOB_MECHANIC_T2) || (job >= JOB_BABY_RUNE2 && job <= JOB_BABY_MECHANIC2)
) // Deny direct transformation into dummy jobs
- {clif_displaymessage(fd, msg_txt(923)); //"You can not change to this job by command."
+ {clif->displaymessage(fd, msg_txt(923)); //"You can not change to this job by command."
return 0;}
if (pcdb_checkid(job))
{
if (pc_jobchange(sd, job, upper) == 0)
- clif_displaymessage(fd, msg_txt(12)); // Your job has been changed.
+ clif->displaymessage(fd, msg_txt(12)); // Your job has been changed.
else {
- clif_displaymessage(fd, msg_txt(155)); // You are unable to change your job.
+ clif->displaymessage(fd, msg_txt(155)); // You are unable to change your job.
return -1;
}
} else {
text = atcommand_help_string(command);
if (text)
- clif_displaymessage(fd, text);
+ clif->displaymessage(fd, text);
return -1;
}
@@ -1048,9 +1048,9 @@ ACMD_FUNC(kill)
{
nullpo_retr(-1, sd);
status_kill(&sd->bl);
- clif_displaymessage(sd->fd, msg_txt(13)); // A pity! You've died.
+ clif->displaymessage(sd->fd, msg_txt(13)); // A pity! You've died.
if (fd != sd->fd)
- clif_displaymessage(fd, msg_txt(14)); // Character killed.
+ clif->displaymessage(fd, msg_txt(14)); // Character killed.
return 0;
}
@@ -1062,11 +1062,11 @@ ACMD_FUNC(alive)
nullpo_retr(-1, sd);
if (!status_revive(&sd->bl, 100, 100))
{
- clif_displaymessage(fd, msg_txt(667));
+ clif->displaymessage(fd, msg_txt(667));
return -1;
}
- clif_skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);
- clif_displaymessage(fd, msg_txt(16)); // You've been revived! It's a miracle!
+ clif->skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);
+ clif->displaymessage(fd, msg_txt(16)); // You've been revived! It's a miracle!
return 0;
}
@@ -1082,23 +1082,23 @@ ACMD_FUNC(kami)
if(*(command + 5) != 'c' && *(command + 5) != 'C') {
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(980)); // Please enter a message (usage: @kami <message>).
+ clif->displaymessage(fd, msg_txt(980)); // Please enter a message (usage: @kami <message>).
return -1;
}
sscanf(message, "%199[^\n]", atcmd_output);
if (strstr(command, "l") != NULL)
- clif_broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, 0, ALL_SAMEMAP);
+ clif->broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, 0, ALL_SAMEMAP);
else
intif_broadcast(atcmd_output, strlen(atcmd_output) + 1, (*(command + 5) == 'b' || *(command + 5) == 'B') ? 0x10 : 0);
} else {
if(!message || !*message || (sscanf(message, "%lx %199[^\n]", &color, atcmd_output) < 2)) {
- clif_displaymessage(fd, msg_txt(981)); // Please enter color and message (usage: @kamic <color> <message>).
+ clif->displaymessage(fd, msg_txt(981)); // Please enter color and message (usage: @kamic <color> <message>).
return -1;
}
if(color > 0xFFFFFF) {
- clif_displaymessage(fd, msg_txt(982)); // Invalid color.
+ clif->displaymessage(fd, msg_txt(982)); // Invalid color.
return -1;
}
intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0);
@@ -1122,24 +1122,24 @@ ACMD_FUNC(heal)
if ( hp == 0 && sp == 0 ) {
if (!status_percent_heal(&sd->bl, 100, 100))
- clif_displaymessage(fd, msg_txt(157)); // HP and SP have already been recovered.
+ clif->displaymessage(fd, msg_txt(157)); // HP and SP have already been recovered.
else
- clif_displaymessage(fd, msg_txt(17)); // HP, SP recovered.
+ clif->displaymessage(fd, msg_txt(17)); // HP, SP recovered.
return 0;
}
if ( hp > 0 && sp >= 0 ) {
if(!status_heal(&sd->bl, hp, sp, 0))
- clif_displaymessage(fd, msg_txt(157)); // HP and SP are already with the good value.
+ clif->displaymessage(fd, msg_txt(157)); // HP and SP are already with the good value.
else
- clif_displaymessage(fd, msg_txt(17)); // HP, SP recovered.
+ clif->displaymessage(fd, msg_txt(17)); // HP, SP recovered.
return 0;
}
if ( hp < 0 && sp <= 0 ) {
status_damage(NULL, &sd->bl, -hp, -sp, 0, 0);
- clif_damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, 4, 0);
- clif_displaymessage(fd, msg_txt(156)); // HP or/and SP modified.
+ clif->damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, 4, 0);
+ clif->displaymessage(fd, msg_txt(156)); // HP or/and SP modified.
return 0;
}
@@ -1149,7 +1149,7 @@ ACMD_FUNC(heal)
status_heal(&sd->bl, hp, 0, 0);
else {
status_damage(NULL, &sd->bl, -hp, 0, 0, 0);
- clif_damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, 4, 0);
+ clif->damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, 4, 0);
}
}
@@ -1160,7 +1160,7 @@ ACMD_FUNC(heal)
status_damage(NULL, &sd->bl, 0, -sp, 0, 0);
}
- clif_displaymessage(fd, msg_txt(156)); // HP or/and SP modified.
+ clif->displaymessage(fd, msg_txt(156)); // HP or/and SP modified.
return 0;
}
@@ -1182,7 +1182,7 @@ ACMD_FUNC(item)
sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 &&
sscanf(message, "%99s %d", item_name, &number) < 1
)) {
- clif_displaymessage(fd, msg_txt(983)); // Please enter an item name or ID (usage: @item <item name/ID> <quantity>).
+ clif->displaymessage(fd, msg_txt(983)); // Please enter an item name or ID (usage: @item <item name/ID> <quantity>).
return -1;
}
@@ -1192,7 +1192,7 @@ ACMD_FUNC(item)
if ((item_data = itemdb_searchname(item_name)) == NULL &&
(item_data = itemdb_exists(atoi(item_name))) == NULL)
{
- clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name.
+ clif->displaymessage(fd, msg_txt(19)); // Invalid item ID or name.
return -1;
}
@@ -1210,12 +1210,12 @@ ACMD_FUNC(item)
item_tmp.identify = 1;
if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND)))
- clif_additem(sd, 0, 0, flag);
+ clif->additem(sd, 0, 0, flag);
}
}
if (flag == 0)
- clif_displaymessage(fd, msg_txt(18)); // Item created.
+ clif->displaymessage(fd, msg_txt(18)); // Item created.
return 0;
}
@@ -1238,8 +1238,8 @@ ACMD_FUNC(item2)
sscanf(message, "\"%99[^\"]\" %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 &&
sscanf(message, "%99s %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9
)) {
- clif_displaymessage(fd, msg_txt(984)); // Please enter all parameters (usage: @item2 <item name/ID> <quantity>
- clif_displaymessage(fd, msg_txt(985)); // <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4>).
+ clif->displaymessage(fd, msg_txt(984)); // Please enter all parameters (usage: @item2 <item name/ID> <quantity>
+ clif->displaymessage(fd, msg_txt(985)); // <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4>).
return -1;
}
@@ -1283,13 +1283,13 @@ ACMD_FUNC(item2)
item_tmp.card[2] = c3;
item_tmp.card[3] = c4;
if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND)))
- clif_additem(sd, 0, 0, flag);
+ clif->additem(sd, 0, 0, flag);
}
if (flag == 0)
- clif_displaymessage(fd, msg_txt(18)); // Item created.
+ clif->displaymessage(fd, msg_txt(18)); // Item created.
} else {
- clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name.
+ clif->displaymessage(fd, msg_txt(19)); // Invalid item ID or name.
return -1;
}
@@ -1309,7 +1309,7 @@ ACMD_FUNC(itemreset)
pc_delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_COMMAND);
}
}
- clif_displaymessage(fd, msg_txt(20)); // All of your items have been removed.
+ clif->displaymessage(fd, msg_txt(20)); // All of your items have been removed.
return 0;
}
@@ -1324,13 +1324,13 @@ ACMD_FUNC(baselevelup)
level = atoi(message);
if (!message || !*message || !level) {
- clif_displaymessage(fd, msg_txt(986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup <number of levels>).
+ clif->displaymessage(fd, msg_txt(986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup <number of levels>).
return -1;
}
if (level > 0) {
if (sd->status.base_level >= pc_maxbaselv(sd)) { // check for max level by Valaris
- clif_displaymessage(fd, msg_txt(47)); // Base level can't go any higher.
+ clif->displaymessage(fd, msg_txt(47)); // Base level can't go any higher.
return -1;
} // End Addition
if ((unsigned int)level > pc_maxbaselv(sd) || (unsigned int)level > pc_maxbaselv(sd) - sd->status.base_level) // fix positiv overflow
@@ -1341,11 +1341,11 @@ ACMD_FUNC(baselevelup)
sd->status.status_point += status_point;
sd->status.base_level += (unsigned int)level;
status_percent_heal(&sd->bl, 100, 100);
- clif_misceffect(&sd->bl, 0);
- clif_displaymessage(fd, msg_txt(21)); // Base level raised.
+ clif->misceffect(&sd->bl, 0);
+ clif->displaymessage(fd, msg_txt(21)); // Base level raised.
} else {
if (sd->status.base_level == 1) {
- clif_displaymessage(fd, msg_txt(158)); // Base level can't go any lower.
+ clif->displaymessage(fd, msg_txt(158)); // Base level can't go any lower.
return -1;
}
level*=-1;
@@ -1360,13 +1360,13 @@ ACMD_FUNC(baselevelup)
else
sd->status.status_point -= status_point;
sd->status.base_level -= (unsigned int)level;
- clif_displaymessage(fd, msg_txt(22)); // Base level lowered.
+ clif->displaymessage(fd, msg_txt(22)); // Base level lowered.
}
sd->status.base_exp = 0;
- clif_updatestatus(sd, SP_STATUSPOINT);
- clif_updatestatus(sd, SP_BASELEVEL);
- clif_updatestatus(sd, SP_BASEEXP);
- clif_updatestatus(sd, SP_NEXTBASEEXP);
+ clif->updatestatus(sd, SP_STATUSPOINT);
+ clif->updatestatus(sd, SP_BASELEVEL);
+ clif->updatestatus(sd, SP_BASEEXP);
+ clif->updatestatus(sd, SP_NEXTBASEEXP);
status_calc_pc(sd, 0);
pc_baselevelchanged(sd);
if(sd->status.party_id)
@@ -1385,23 +1385,23 @@ ACMD_FUNC(joblevelup)
level = atoi(message);
if (!message || !*message || !level) {
- clif_displaymessage(fd, msg_txt(987)); // Please enter a level adjustment (usage: @joblvup/@jlevel/@joblvlup <number of levels>).
+ clif->displaymessage(fd, msg_txt(987)); // Please enter a level adjustment (usage: @joblvup/@jlevel/@joblvlup <number of levels>).
return -1;
}
if (level > 0) {
if (sd->status.job_level >= pc_maxjoblv(sd)) {
- clif_displaymessage(fd, msg_txt(23)); // Job level can't go any higher.
+ clif->displaymessage(fd, msg_txt(23)); // Job level can't go any higher.
return -1;
}
if ((unsigned int)level > pc_maxjoblv(sd) || (unsigned int)level > pc_maxjoblv(sd) - sd->status.job_level) // fix positiv overflow
level = pc_maxjoblv(sd) - sd->status.job_level;
sd->status.job_level += (unsigned int)level;
sd->status.skill_point += level;
- clif_misceffect(&sd->bl, 1);
- clif_displaymessage(fd, msg_txt(24)); // Job level raised.
+ clif->misceffect(&sd->bl, 1);
+ clif->displaymessage(fd, msg_txt(24)); // Job level raised.
} else {
if (sd->status.job_level == 1) {
- clif_displaymessage(fd, msg_txt(159)); // Job level can't go any lower.
+ clif->displaymessage(fd, msg_txt(159)); // Job level can't go any lower.
return -1;
}
level *=-1;
@@ -1414,13 +1414,13 @@ ACMD_FUNC(joblevelup)
sd->status.skill_point = 0;
else
sd->status.skill_point -= level;
- clif_displaymessage(fd, msg_txt(25)); // Job level lowered.
+ clif->displaymessage(fd, msg_txt(25)); // Job level lowered.
}
sd->status.job_exp = 0;
- clif_updatestatus(sd, SP_JOBLEVEL);
- clif_updatestatus(sd, SP_JOBEXP);
- clif_updatestatus(sd, SP_NEXTJOBEXP);
- clif_updatestatus(sd, SP_SKILLPOINT);
+ clif->updatestatus(sd, SP_JOBLEVEL);
+ clif->updatestatus(sd, SP_JOBEXP);
+ clif->updatestatus(sd, SP_NEXTJOBEXP);
+ clif->updatestatus(sd, SP_SKILLPOINT);
status_calc_pc(sd, 0);
return 0;
@@ -1440,7 +1440,7 @@ ACMD_FUNC(help)
help = config_lookup(&atcommand_config, "help");
if (help == NULL) {
- clif_displaymessage(fd, msg_txt(27)); // "Commands help is not available."
+ clif->displaymessage(fd, msg_txt(27)); // "Commands help is not available."
return -1;
}
@@ -1454,20 +1454,20 @@ ACMD_FUNC(help)
if (!pc_can_use_command(sd, command_name, COMMAND_ATCOMMAND)) {
sprintf(atcmd_output, msg_txt(153), message); // "%s is Unknown Command"
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
atcommand_get_suggestions(sd, command_name, true);
return -1;
}
if (!config_setting_lookup_string(help, command_name, &text)) {
sprintf(atcmd_output, msg_txt(988), atcommand_symbol, command_name); // There is no help for %c%s.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
atcommand_get_suggestions(sd, command_name, true);
return -1;
}
sprintf(atcmd_output, msg_txt(989), atcommand_symbol, command_name); // Help for command %c%s:
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
{ // Display aliases
DBIterator* iter;
@@ -1488,12 +1488,12 @@ ACMD_FUNC(help)
}
dbi_destroy(iter);
if (has_aliases)
- clif_displaymessage(fd, StringBuf_Value(&buf));
+ clif->displaymessage(fd, StringBuf_Value(&buf));
StringBuf_Destroy(&buf);
}
// Display help contents
- clif_displaymessage(fd, text);
+ clif->displaymessage(fd, text);
return 0;
}
@@ -1516,7 +1516,7 @@ static int atcommand_stopattack(struct block_list *bl,va_list ap)
static int atcommand_pvpoff_sub(struct block_list *bl,va_list ap)
{
TBL_PC* sd = (TBL_PC*)bl;
- clif_pvpset(sd, 0, 0, 2);
+ clif->pvpset(sd, 0, 0, 2);
if (sd->pvp_timer != INVALID_TIMER) {
delete_timer(sd->pvp_timer, pc_calc_pvprank_timer);
sd->pvp_timer = INVALID_TIMER;
@@ -1529,17 +1529,17 @@ ACMD_FUNC(pvpoff)
nullpo_retr(-1, sd);
if (!map[sd->bl.m].flag.pvp) {
- clif_displaymessage(fd, msg_txt(160)); // PvP is already Off.
+ clif->displaymessage(fd, msg_txt(160)); // PvP is already Off.
return -1;
}
map[sd->bl.m].flag.pvp = 0;
if (!battle_config.pk_mode)
- clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING);
+ clif->map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING);
map_foreachinmap(atcommand_pvpoff_sub,sd->bl.m, BL_PC);
map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0);
- clif_displaymessage(fd, msg_txt(31)); // PvP: Off.
+ clif->displaymessage(fd, msg_txt(31)); // PvP: Off.
return 0;
}
@@ -1565,7 +1565,7 @@ ACMD_FUNC(pvpon)
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.pvp) {
- clif_displaymessage(fd, msg_txt(161)); // PvP is already On.
+ clif->displaymessage(fd, msg_txt(161)); // PvP is already On.
return -1;
}
@@ -1573,11 +1573,11 @@ ACMD_FUNC(pvpon)
if (!battle_config.pk_mode)
{// display pvp circle and rank
- clif_map_property_mapall(sd->bl.m, MAPPROPERTY_FREEPVPZONE);
+ clif->map_property_mapall(sd->bl.m, MAPPROPERTY_FREEPVPZONE);
map_foreachinmap(atcommand_pvpon_sub,sd->bl.m, BL_PC);
}
- clif_displaymessage(fd, msg_txt(32)); // PvP: On.
+ clif->displaymessage(fd, msg_txt(32)); // PvP: On.
return 0;
}
@@ -1590,14 +1590,14 @@ ACMD_FUNC(gvgoff)
nullpo_retr(-1, sd);
if (!map[sd->bl.m].flag.gvg) {
- clif_displaymessage(fd, msg_txt(162)); // GvG is already Off.
+ clif->displaymessage(fd, msg_txt(162)); // GvG is already Off.
return -1;
}
map[sd->bl.m].flag.gvg = 0;
- clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING);
+ clif->map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING);
map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0);
- clif_displaymessage(fd, msg_txt(33)); // GvG: Off.
+ clif->displaymessage(fd, msg_txt(33)); // GvG: Off.
return 0;
}
@@ -1610,13 +1610,13 @@ ACMD_FUNC(gvgon)
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.gvg) {
- clif_displaymessage(fd, msg_txt(163)); // GvG is already On.
+ clif->displaymessage(fd, msg_txt(163)); // GvG is already On.
return -1;
}
map[sd->bl.m].flag.gvg = 1;
- clif_map_property_mapall(sd->bl.m, MAPPROPERTY_AGITZONE);
- clif_displaymessage(fd, msg_txt(34)); // GvG: On.
+ clif->map_property_mapall(sd->bl.m, MAPPROPERTY_AGITZONE);
+ clif->displaymessage(fd, msg_txt(34)); // GvG: On.
return 0;
}
@@ -1634,7 +1634,7 @@ ACMD_FUNC(model)
if (!message || !*message || sscanf(message, "%d %d %d", &hair_style, &hair_color, &cloth_color) < 1) {
sprintf(atcmd_output, msg_txt(991), // Please enter at least one value (usage: @model <hair ID: %d-%d> <hair color: %d-%d> <clothes color: %d-%d>).
MIN_HAIR_STYLE, MAX_HAIR_STYLE, MIN_HAIR_COLOR, MAX_HAIR_COLOR, MIN_CLOTH_COLOR, MAX_CLOTH_COLOR);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return -1;
}
@@ -1644,9 +1644,9 @@ ACMD_FUNC(model)
pc_changelook(sd, LOOK_HAIR, hair_style);
pc_changelook(sd, LOOK_HAIR_COLOR, hair_color);
pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color);
- clif_displaymessage(fd, msg_txt(36)); // Appearence changed.
+ clif->displaymessage(fd, msg_txt(36)); // Appearence changed.
} else {
- clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
+ clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified.
return -1;
}
@@ -1665,15 +1665,15 @@ ACMD_FUNC(dye)
if (!message || !*message || sscanf(message, "%d", &cloth_color) < 1) {
sprintf(atcmd_output, msg_txt(992), MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); // Please enter a clothes color (usage: @dye/@ccolor <clothes color: %d-%d>).
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return -1;
}
if (cloth_color >= MIN_CLOTH_COLOR && cloth_color <= MAX_CLOTH_COLOR) {
pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color);
- clif_displaymessage(fd, msg_txt(36)); // Appearence changed.
+ clif->displaymessage(fd, msg_txt(36)); // Appearence changed.
} else {
- clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
+ clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified.
return -1;
}
@@ -1692,15 +1692,15 @@ ACMD_FUNC(hair_style)
if (!message || !*message || sscanf(message, "%d", &hair_style) < 1) {
sprintf(atcmd_output, msg_txt(993), MIN_HAIR_STYLE, MAX_HAIR_STYLE); // Please enter a hair style (usage: @hairstyle/@hstyle <hair ID: %d-%d>).
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return -1;
}
if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE) {
pc_changelook(sd, LOOK_HAIR, hair_style);
- clif_displaymessage(fd, msg_txt(36)); // Appearence changed.
+ clif->displaymessage(fd, msg_txt(36)); // Appearence changed.
} else {
- clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
+ clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified.
return -1;
}
@@ -1719,15 +1719,15 @@ ACMD_FUNC(hair_color)
if (!message || !*message || sscanf(message, "%d", &hair_color) < 1) {
sprintf(atcmd_output, msg_txt(994), MIN_HAIR_COLOR, MAX_HAIR_COLOR); // Please enter a hair color (usage: @haircolor/@hcolor <hair color: %d-%d>).
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return -1;
}
if (hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR) {
pc_changelook(sd, LOOK_HAIR_COLOR, hair_color);
- clif_displaymessage(fd, msg_txt(36)); // Appearence changed.
+ clif->displaymessage(fd, msg_txt(36)); // Appearence changed.
} else {
- clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
+ clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified.
return -1;
}
@@ -1793,7 +1793,7 @@ ACMD_FUNC(go)
nullpo_retr(-1, sd);
if( map[sd->bl.m].flag.nogo && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE) ) {
- clif_displaymessage(sd->fd,msg_txt(995)); // You cannot use @go on this map.
+ clif->displaymessage(sd->fd,msg_txt(995)); // You cannot use @go on this map.
return 0;
}
@@ -1810,11 +1810,11 @@ ACMD_FUNC(go)
// attempt to find the text help string
text = atcommand_help_string( command );
- clif_displaymessage(fd, msg_txt(38)); // Invalid location number, or name.
+ clif->displaymessage(fd, msg_txt(38)); // Invalid location number, or name.
if( text )
{// send the text to the client
- clif_displaymessage( fd, text );
+ clif->displaymessage( fd, text );
}
return -1;
@@ -1913,21 +1913,21 @@ ACMD_FUNC(go)
{
m = map_mapname2mapid(data[town].map);
if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
- clif_displaymessage(fd, msg_txt(247));
+ clif->displaymessage(fd, msg_txt(247));
return -1;
}
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
- clif_displaymessage(fd, msg_txt(248));
+ clif->displaymessage(fd, msg_txt(248));
return -1;
}
if (pc_setpos(sd, mapindex_name2id(data[town].map), data[town].x, data[town].y, CLR_TELEPORT) == 0) {
- clif_displaymessage(fd, msg_txt(0)); // Warped.
+ clif->displaymessage(fd, msg_txt(0)); // Warped.
} else {
- clif_displaymessage(fd, msg_txt(1)); // Map not found.
+ clif->displaymessage(fd, msg_txt(1)); // Map not found.
return -1;
}
} else { // if you arrive here, you have an error in town variable when reading of names
- clif_displaymessage(fd, msg_txt(38)); // Invalid location number or name.
+ clif->displaymessage(fd, msg_txt(38)); // Invalid location number or name.
return -1;
}
@@ -1955,7 +1955,7 @@ ACMD_FUNC(monster)
memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(80)); // Give the display name or monster name/id please.
+ clif->displaymessage(fd, msg_txt(80)); // Give the display name or monster name/id please.
return -1;
}
if (sscanf(message, "\"%23[^\"]\" %23s %d", name, monster, &number) > 1 ||
@@ -1971,7 +1971,7 @@ ACMD_FUNC(monster)
//As before, name may be already filled.
name[0] = '\0';
} else {
- clif_displaymessage(fd, msg_txt(80)); // Give a display name and monster name/id please.
+ clif->displaymessage(fd, msg_txt(80)); // Give a display name and monster name/id please.
return -1;
}
@@ -1979,12 +1979,12 @@ ACMD_FUNC(monster)
mob_id = mobdb_checkid(atoi(monster));
if (mob_id == 0) {
- clif_displaymessage(fd, msg_txt(40)); // Invalid monster ID or name.
+ clif->displaymessage(fd, msg_txt(40)); // Invalid monster ID or name.
return -1;
}
if (mob_id == MOBID_EMPERIUM) {
- clif_displaymessage(fd, msg_txt(83)); // Monster 'Emperium' cannot be spawned.
+ clif->displaymessage(fd, msg_txt(83)); // Monster 'Emperium' cannot be spawned.
return -1;
}
@@ -2018,13 +2018,13 @@ ACMD_FUNC(monster)
if (count != 0)
if (number == count)
- clif_displaymessage(fd, msg_txt(39)); // All monster summoned!
+ clif->displaymessage(fd, msg_txt(39)); // All monster summoned!
else {
sprintf(atcmd_output, msg_txt(240), count); // %d monster(s) summoned!
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
else {
- clif_displaymessage(fd, msg_txt(40)); // Invalid monster ID or name.
+ clif->displaymessage(fd, msg_txt(40)); // Invalid monster ID or name.
return -1;
}
@@ -2071,7 +2071,7 @@ ACMD_FUNC(killmonster)
map_foreachinmap(atkillmonster_sub, map_id, BL_MOB, -drop_flag);
- clif_displaymessage(fd, msg_txt(165)); // All monsters killed!
+ clif->displaymessage(fd, msg_txt(165)); // All monsters killed!
return 0;
}
@@ -2088,27 +2088,27 @@ ACMD_FUNC(refine)
memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%d %d", &position, &refine) < 2) {
- clif_displaymessage(fd, msg_txt(996)); // Please enter a position and an amount (usage: @refine <equip position> <+/- amount>).
+ clif->displaymessage(fd, msg_txt(996)); // Please enter a position and an amount (usage: @refine <equip position> <+/- amount>).
sprintf(atcmd_output, msg_txt(997), EQP_HEAD_LOW); // %d: Lower Headgear
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(998), EQP_HAND_R); // %d: Right Hand
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(999), EQP_GARMENT); // %d: Garment
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(1000), EQP_ACC_L); // %d: Left Accessory
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(1001), EQP_ARMOR); // %d: Body Armor
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(1002), EQP_HAND_L); // %d: Left Hand
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(1003), EQP_SHOES); // %d: Shoes
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(1004), EQP_ACC_R); // %d: Right Accessory
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(1005), EQP_HEAD_TOP); // %d: Top Headgear
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(1006), EQP_HEAD_MID); // %d: Mid Headgear
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return -1;
}
@@ -2133,22 +2133,22 @@ ACMD_FUNC(refine)
sd->status.inventory[i].refine = final_refine;
current_position = sd->status.inventory[i].equip;
pc_unequipitem(sd, i, 3);
- clif_refine(fd, 0, i, sd->status.inventory[i].refine);
- clif_delitem(sd, i, 1, 3);
- clif_additem(sd, i, 1, 0);
+ clif->refine(fd, 0, i, sd->status.inventory[i].refine);
+ clif->delitem(sd, i, 1, 3);
+ clif->additem(sd, i, 1, 0);
pc_equipitem(sd, i, current_position);
- clif_misceffect(&sd->bl, 3);
+ clif->misceffect(&sd->bl, 3);
count++;
}
}
if (count == 0)
- clif_displaymessage(fd, msg_txt(166)); // No item has been refined.
+ clif->displaymessage(fd, msg_txt(166)); // No item has been refined.
else if (count == 1)
- clif_displaymessage(fd, msg_txt(167)); // 1 item has been refined.
+ clif->displaymessage(fd, msg_txt(167)); // 1 item has been refined.
else {
sprintf(atcmd_output, msg_txt(168), count); // %d items have been refined.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
return 0;
@@ -2172,13 +2172,13 @@ ACMD_FUNC(produce)
sscanf(message, "\"%99[^\"]\" %d %d", item_name, &attribute, &star) < 1 &&
sscanf(message, "%99s %d %d", item_name, &attribute, &star) < 1
)) {
- clif_displaymessage(fd, msg_txt(1007)); // Please enter at least one item name/ID (usage: @produce <equip name/ID> <element> <# of very's>).
+ clif->displaymessage(fd, msg_txt(1007)); // Please enter at least one item name/ID (usage: @produce <equip name/ID> <element> <# of very's>).
return -1;
}
if ( (item_data = itemdb_searchname(item_name)) == NULL &&
(item_data = itemdb_exists(atoi(item_name))) == NULL ) {
- clif_displaymessage(fd, msg_txt(170)); //This item is not an equipment.
+ clif->displaymessage(fd, msg_txt(170)); //This item is not an equipment.
return -1;
}
@@ -2199,14 +2199,14 @@ ACMD_FUNC(produce)
((star*5) << 8) + attribute:0;
tmp_item.card[2] = GetWord(sd->status.char_id, 0);
tmp_item.card[3] = GetWord(sd->status.char_id, 1);
- clif_produceeffect(sd, 0, item_id);
- clif_misceffect(&sd->bl, 3);
+ clif->produce_effect(sd, 0, item_id);
+ clif->misceffect(&sd->bl, 3);
if ((flag = pc_additem(sd, &tmp_item, 1, LOG_TYPE_COMMAND)))
- clif_additem(sd, 0, 0, flag);
+ clif->additem(sd, 0, 0, flag);
} else {
sprintf(atcmd_output, msg_txt(169), item_id, item_data->name); // The item (%d: '%s') is not equipable.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return -1;
}
@@ -2226,14 +2226,14 @@ ACMD_FUNC(memo)
if( !message || !*message || sscanf(message, "%d", &position) < 1 )
{
int i;
- clif_displaymessage(sd->fd, msg_txt(668));
+ clif->displaymessage(sd->fd, msg_txt(668));
for( i = 0; i < MAX_MEMOPOINTS; i++ )
{
if( sd->status.memo_point[i].map )
sprintf(atcmd_output, "%d - %s (%d,%d)", i, mapindex_id2name(sd->status.memo_point[i].map), sd->status.memo_point[i].x, sd->status.memo_point[i].y);
else
sprintf(atcmd_output, msg_txt(171), i); // %d - void
- clif_displaymessage(sd->fd, atcmd_output);
+ clif->displaymessage(sd->fd, atcmd_output);
}
return 0;
}
@@ -2241,7 +2241,7 @@ ACMD_FUNC(memo)
if( position < 0 || position >= MAX_MEMOPOINTS )
{
sprintf(atcmd_output, msg_txt(1008), 0, MAX_MEMOPOINTS-1); // Please enter a valid position (usage: @memo <memo_position:%d-%d>).
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return -1;
}
@@ -2268,7 +2268,7 @@ ACMD_FUNC(gat)
map_getcell(sd->bl.m, sd->bl.x + 1, sd->bl.y + y, CELL_GETTYPE),
map_getcell(sd->bl.m, sd->bl.x + 2, sd->bl.y + y, CELL_GETTYPE));
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
return 0;
@@ -2283,13 +2283,13 @@ ACMD_FUNC(displaystatus)
nullpo_retr(-1, sd);
if (!message || !*message || (i = sscanf(message, "%d %d %d %d %d %d", &type, &flag, &tick, &val1, &val2, &val3)) < 1) {
- clif_displaymessage(fd, msg_txt(1009)); // Please enter a status type/flag (usage: @displaystatus <status type> <flag> <tick> {<val1> {<val2> {<val3>}}}).
+ clif->displaymessage(fd, msg_txt(1009)); // Please enter a status type/flag (usage: @displaystatus <status type> <flag> <tick> {<val1> {<val2> {<val3>}}}).
return -1;
}
if (i < 2) flag = 1;
if (i < 3) tick = 0;
- clif_status_change(&sd->bl, type, flag, tick, val1, val2, val3);
+ clif->status_change(&sd->bl, type, flag, tick, val1, val2, val3);
return 0;
}
@@ -2303,7 +2303,7 @@ ACMD_FUNC(statuspoint)
unsigned int new_status_point;
if (!message || !*message || (point = atoi(message)) == 0) {
- clif_displaymessage(fd, msg_txt(1010)); // Please enter a number (usage: @stpoint <number of points>).
+ clif->displaymessage(fd, msg_txt(1010)); // Please enter a number (usage: @stpoint <number of points>).
return -1;
}
@@ -2329,13 +2329,13 @@ ACMD_FUNC(statuspoint)
if (new_status_point != sd->status.status_point) {
sd->status.status_point = new_status_point;
- clif_updatestatus(sd, SP_STATUSPOINT);
- clif_displaymessage(fd, msg_txt(174)); // Number of status points changed.
+ clif->updatestatus(sd, SP_STATUSPOINT);
+ clif->displaymessage(fd, msg_txt(174)); // Number of status points changed.
} else {
if (point < 0)
- clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
+ clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
else
- clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value.
+ clif->displaymessage(fd, msg_txt(149)); // Unable to increase the number/value.
return -1;
}
@@ -2352,7 +2352,7 @@ ACMD_FUNC(skillpoint)
nullpo_retr(-1, sd);
if (!message || !*message || (point = atoi(message)) == 0) {
- clif_displaymessage(fd, msg_txt(1011)); // Please enter a number (usage: @skpoint <number of points>).
+ clif->displaymessage(fd, msg_txt(1011)); // Please enter a number (usage: @skpoint <number of points>).
return -1;
}
@@ -2378,13 +2378,13 @@ ACMD_FUNC(skillpoint)
if (new_skill_point != sd->status.skill_point) {
sd->status.skill_point = new_skill_point;
- clif_updatestatus(sd, SP_SKILLPOINT);
- clif_displaymessage(fd, msg_txt(175)); // Number of skill points changed.
+ clif->updatestatus(sd, SP_SKILLPOINT);
+ clif->displaymessage(fd, msg_txt(175)); // Number of skill points changed.
} else {
if (point < 0)
- clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
+ clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
else
- clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value.
+ clif->displaymessage(fd, msg_txt(149)); // Unable to increase the number/value.
return -1;
}
@@ -2400,20 +2400,20 @@ ACMD_FUNC(zeny)
nullpo_retr(-1, sd);
if (!message || !*message || (zeny = atoi(message)) == 0) {
- clif_displaymessage(fd, msg_txt(1012)); // Please enter an amount (usage: @zeny <amount>).
+ clif->displaymessage(fd, msg_txt(1012)); // Please enter an amount (usage: @zeny <amount>).
return -1;
}
if(zeny > 0){
if((ret=pc_getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL)) == 1)
- clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value.
+ clif->displaymessage(fd, msg_txt(149)); // Unable to increase the number/value.
}
else {
if( sd->status.zeny < -zeny ) zeny = -sd->status.zeny;
if((ret=pc_payzeny(sd,-zeny,LOG_TYPE_COMMAND,NULL)) == 1)
- clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
+ clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
}
- if(!ret) clif_displaymessage(fd, msg_txt(176)); //ret=0 mean cmd success
+ if(!ret) clif->displaymessage(fd, msg_txt(176)); //ret=0 mean cmd success
return 0;
}
@@ -2431,14 +2431,14 @@ ACMD_FUNC(param)
memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) {
- clif_displaymessage(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>).
+ clif->displaymessage(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>).
return -1;
}
ARR_FIND( 0, ARRAYLENGTH(param), i, strcmpi(command+1, param[i]) == 0 );
if( i == ARRAYLENGTH(param) || i > MAX_STATUS_TYPE) { // normally impossible...
- clif_displaymessage(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>).
+ clif->displaymessage(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>).
return -1;
}
@@ -2464,15 +2464,15 @@ ACMD_FUNC(param)
if (new_value != *status[i]) {
*status[i] = new_value;
- clif_updatestatus(sd, SP_STR + i);
- clif_updatestatus(sd, SP_USTR + i);
+ clif->updatestatus(sd, SP_STR + i);
+ clif->updatestatus(sd, SP_USTR + i);
status_calc_pc(sd, 0);
- clif_displaymessage(fd, msg_txt(42)); // Stat changed.
+ clif->displaymessage(fd, msg_txt(42)); // Stat changed.
} else {
if (value < 0)
- clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
+ clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
else
- clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value.
+ clif->displaymessage(fd, msg_txt(149)); // Unable to increase the number/value.
return -1;
}
@@ -2518,20 +2518,20 @@ ACMD_FUNC(stat_all)
if (new_value != (int)*status[index]) {
*status[index] = new_value;
- clif_updatestatus(sd, SP_STR + index);
- clif_updatestatus(sd, SP_USTR + index);
+ clif->updatestatus(sd, SP_STR + index);
+ clif->updatestatus(sd, SP_USTR + index);
count++;
}
}
if (count > 0) { // if at least 1 stat modified
status_calc_pc(sd, 0);
- clif_displaymessage(fd, msg_txt(84)); // All stats changed!
+ clif->displaymessage(fd, msg_txt(84)); // All stats changed!
} else {
if (value < 0)
- clif_displaymessage(fd, msg_txt(177)); // You cannot decrease that stat anymore.
+ clif->displaymessage(fd, msg_txt(177)); // You cannot decrease that stat anymore.
else
- clif_displaymessage(fd, msg_txt(178)); // You cannot increase that stat anymore.
+ clif->displaymessage(fd, msg_txt(178)); // You cannot increase that stat anymore.
return -1;
}
@@ -2549,16 +2549,16 @@ ACMD_FUNC(guildlevelup)
nullpo_retr(-1, sd);
if (!message || !*message || sscanf(message, "%d", &level) < 1 || level == 0) {
- clif_displaymessage(fd, msg_txt(1014)); // Please enter a valid level (usage: @guildlvup/@guildlvlup <# of levels>).
+ clif->displaymessage(fd, msg_txt(1014)); // Please enter a valid level (usage: @guildlvup/@guildlvlup <# of levels>).
return -1;
}
if (sd->status.guild_id <= 0 || (guild_info = guild_search(sd->status.guild_id)) == NULL) {
- clif_displaymessage(fd, msg_txt(43)); // You're not in a guild.
+ clif->displaymessage(fd, msg_txt(43)); // You're not in a guild.
return -1;
}
//if (strcmp(sd->status.name, guild_info->master) != 0) {
- // clif_displaymessage(fd, msg_txt(44)); // You're not the master of your guild.
+ // clif->displaymessage(fd, msg_txt(44)); // You're not the master of your guild.
// return -1;
//}
@@ -2570,9 +2570,9 @@ ACMD_FUNC(guildlevelup)
if (added_level != 0) {
intif_guild_change_basicinfo(guild_info->guild_id, GBI_GUILDLV, &added_level, sizeof(added_level));
- clif_displaymessage(fd, msg_txt(179)); // Guild level changed.
+ clif->displaymessage(fd, msg_txt(179)); // Guild level changed.
} else {
- clif_displaymessage(fd, msg_txt(45)); // Guild level change failed.
+ clif->displaymessage(fd, msg_txt(45)); // Guild level change failed.
return -1;
}
@@ -2589,7 +2589,7 @@ ACMD_FUNC(makeegg)
nullpo_retr(-1, sd);
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1015)); // Please enter a monster/egg name/ID (usage: @makeegg <pet>).
+ clif->displaymessage(fd, msg_txt(1015)); // Please enter a monster/egg name/ID (usage: @makeegg <pet>).
return -1;
}
@@ -2612,7 +2612,7 @@ ACMD_FUNC(makeegg)
(short)pet_db[pet_id].EggID, 0, (short)pet_db[pet_id].intimate,
100, 0, 1, pet_db[pet_id].jname);
} else {
- clif_displaymessage(fd, msg_txt(180)); // The monster/egg name/id doesn't exist.
+ clif->displaymessage(fd, msg_txt(180)); // The monster/egg name/id doesn't exist.
return -1;
}
@@ -2626,9 +2626,9 @@ ACMD_FUNC(hatch)
{
nullpo_retr(-1, sd);
if (sd->status.pet_id <= 0)
- clif_sendegg(sd);
+ clif->sendegg(sd);
else {
- clif_displaymessage(fd, msg_txt(181)); // You already have a pet.
+ clif->displaymessage(fd, msg_txt(181)); // You already have a pet.
return -1;
}
@@ -2645,30 +2645,30 @@ ACMD_FUNC(petfriendly)
nullpo_retr(-1, sd);
if (!message || !*message || (friendly = atoi(message)) < 0) {
- clif_displaymessage(fd, msg_txt(1016)); // Please enter a valid value (usage: @petfriendly <0-1000>).
+ clif->displaymessage(fd, msg_txt(1016)); // Please enter a valid value (usage: @petfriendly <0-1000>).
return -1;
}
pd = sd->pd;
if (!pd) {
- clif_displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet.
+ clif->displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet.
return -1;
}
if (friendly < 0 || friendly > 1000)
{
- clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
+ clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified.
return -1;
}
if (friendly == pd->pet.intimate) {
- clif_displaymessage(fd, msg_txt(183)); // Pet intimacy is already at maximum.
+ clif->displaymessage(fd, msg_txt(183)); // Pet intimacy is already at maximum.
return -1;
}
pet_set_intimate(pd, friendly);
- clif_send_petstatus(sd);
- clif_displaymessage(fd, msg_txt(182)); // Pet intimacy changed.
+ clif->send_petstatus(sd);
+ clif->displaymessage(fd, msg_txt(182)); // Pet intimacy changed.
return 0;
}
@@ -2682,27 +2682,27 @@ ACMD_FUNC(pethungry)
nullpo_retr(-1, sd);
if (!message || !*message || (hungry = atoi(message)) < 0) {
- clif_displaymessage(fd, msg_txt(1017)); // Please enter a valid number (usage: @pethungry <0-100>).
+ clif->displaymessage(fd, msg_txt(1017)); // Please enter a valid number (usage: @pethungry <0-100>).
return -1;
}
pd = sd->pd;
if (!sd->status.pet_id || !pd) {
- clif_displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet.
+ clif->displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet.
return -1;
}
if (hungry < 0 || hungry > 100) {
- clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
+ clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified.
return -1;
}
if (hungry == pd->pet.hungry) {
- clif_displaymessage(fd, msg_txt(186)); // Pet hunger is already at maximum.
+ clif->displaymessage(fd, msg_txt(186)); // Pet hunger is already at maximum.
return -1;
}
pd->pet.hungry = hungry;
- clif_send_petstatus(sd);
- clif_displaymessage(fd, msg_txt(185)); // Pet hunger changed.
+ clif->send_petstatus(sd);
+ clif->displaymessage(fd, msg_txt(185)); // Pet hunger changed.
return 0;
}
@@ -2715,19 +2715,19 @@ ACMD_FUNC(petrename)
struct pet_data *pd;
nullpo_retr(-1, sd);
if (!sd->status.pet_id || !sd->pd) {
- clif_displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet.
+ clif->displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet.
return -1;
}
pd = sd->pd;
if (!pd->pet.rename_flag) {
- clif_displaymessage(fd, msg_txt(188)); // You can already rename your pet.
+ clif->displaymessage(fd, msg_txt(188)); // You can already rename your pet.
return -1;
}
pd->pet.rename_flag = 0;
intif_save_petdata(sd->status.account_id, &pd->pet);
- clif_send_petstatus(sd);
- clif_displaymessage(fd, msg_txt(187)); // You can now rename your pet.
+ clif->send_petstatus(sd);
+ clif->displaymessage(fd, msg_txt(187)); // You can now rename your pet.
return 0;
}
@@ -2741,28 +2741,28 @@ ACMD_FUNC(recall) {
nullpo_retr(-1, sd);
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1018)); // Please enter a player name (usage: @recall <char name/ID>).
+ clif->displaymessage(fd, msg_txt(1018)); // Please enter a player name (usage: @recall <char name/ID>).
return -1;
}
if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL)
{
- clif_displaymessage(fd, msg_txt(3)); // Character not found.
+ clif->displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
{
- clif_displaymessage(fd, msg_txt(81)); // Your GM level doesn't authorize you to preform this action on the specified player.
+ clif->displaymessage(fd, msg_txt(81)); // Your GM level doesn't authorize you to preform this action on the specified player.
return -1;
}
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
- clif_displaymessage(fd, msg_txt(1019)); // You are not authorized to warp someone to this map.
+ clif->displaymessage(fd, msg_txt(1019)); // You are not authorized to warp someone to this map.
return -1;
}
if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
- clif_displaymessage(fd, msg_txt(1020)); // You are not authorized to warp this player from their map.
+ clif->displaymessage(fd, msg_txt(1020)); // You are not authorized to warp this player from their map.
return -1;
}
if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y) {
@@ -2770,7 +2770,7 @@ ACMD_FUNC(recall) {
}
pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);
sprintf(atcmd_output, msg_txt(46), pl_sd->status.name); // %s recalled!
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
@@ -2786,12 +2786,12 @@ ACMD_FUNC(char_block)
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
- clif_displaymessage(fd, msg_txt(1021)); // Please enter a player name (usage: @charblock/@block <char name>).
+ clif->displaymessage(fd, msg_txt(1021)); // Please enter a player name (usage: @charblock/@block <char name>).
return -1;
}
chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 1, 0, 0, 0, 0, 0, 0); // type: 1 - block
- clif_displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it.
+ clif->displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it.
return 0;
}
@@ -2823,7 +2823,7 @@ ACMD_FUNC(char_ban)
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%255s %23[^\n]", atcmd_output, atcmd_player_name) < 2) {
- clif_displaymessage(fd, msg_txt(1022)); // Please enter ban time and a player name (usage: @charban/@ban/@banish/@charbanish <time> <char name>).
+ clif->displaymessage(fd, msg_txt(1022)); // Please enter ban time and a player name (usage: @charban/@ban/@banish/@charbanish <time> <char name>).
return -1;
}
@@ -2867,7 +2867,7 @@ ACMD_FUNC(char_ban)
}
}
if (year == 0 && month == 0 && day == 0 && hour == 0 && minute == 0 && second == 0) {
- clif_displaymessage(fd, msg_txt(85)); // Invalid time for ban command.
+ clif->displaymessage(fd, msg_txt(85)); // Invalid time for ban command.
return -1;
}
/**
@@ -2883,12 +2883,12 @@ ACMD_FUNC(char_ban)
tmtime->tm_sec = tmtime->tm_sec + second;
timestamp = mktime(tmtime);
if( timestamp <= time(NULL) && !pc_can_use_command(sd, "unban", COMMAND_ATCOMMAND) ) {
- clif_displaymessage(fd,msg_txt(1023)); // You are not allowed to reduce the length of a ban.
+ clif->displaymessage(fd,msg_txt(1023)); // You are not allowed to reduce the length of a ban.
return -1;
}
chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 2, year, month, day, hour, minute, second); // type: 2 - ban
- clif_displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it.
+ clif->displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it.
return 0;
}
@@ -2903,13 +2903,13 @@ ACMD_FUNC(char_unblock)
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
- clif_displaymessage(fd, msg_txt(1024)); // Please enter a player name (usage: @charunblock <char name>).
+ clif->displaymessage(fd, msg_txt(1024)); // Please enter a player name (usage: @charunblock <char name>).
return -1;
}
// send answer to login server via char-server
chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 3, 0, 0, 0, 0, 0, 0); // type: 3 - unblock
- clif_displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it.
+ clif->displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it.
return 0;
}
@@ -2924,13 +2924,13 @@ ACMD_FUNC(char_unban)
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
- clif_displaymessage(fd, msg_txt(1025)); // Please enter a player name (usage: @charunban <char name>).
+ clif->displaymessage(fd, msg_txt(1025)); // Please enter a player name (usage: @charunban <char name>).
return -1;
}
// send answer to login server via char-server
chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 4, 0, 0, 0, 0, 0, 0); // type: 4 - unban
- clif_displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it.
+ clif->displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it.
return 0;
}
@@ -2945,7 +2945,7 @@ ACMD_FUNC(night)
if (night_flag != 1) {
map_night_timer(night_timer_tid, 0, 0, 1);
} else {
- clif_displaymessage(fd, msg_txt(89)); // Night mode is already enabled.
+ clif->displaymessage(fd, msg_txt(89)); // Night mode is already enabled.
return -1;
}
@@ -2962,7 +2962,7 @@ ACMD_FUNC(day)
if (night_flag != 0) {
map_day_timer(day_timer_tid, 0, 0, 1);
} else {
- clif_displaymessage(fd, msg_txt(90)); // Day mode is already enabled.
+ clif->displaymessage(fd, msg_txt(90)); // Day mode is already enabled.
return -1;
}
@@ -2985,13 +2985,13 @@ ACMD_FUNC(doom)
if (pl_sd->fd != fd && pc_get_group_level(sd) >= pc_get_group_level(pl_sd))
{
status_kill(&pl_sd->bl);
- clif_specialeffect(&pl_sd->bl,450,AREA);
- clif_displaymessage(pl_sd->fd, msg_txt(61)); // The holy messenger has given judgement.
+ clif->specialeffect(&pl_sd->bl,450,AREA);
+ clif->displaymessage(pl_sd->fd, msg_txt(61)); // The holy messenger has given judgement.
}
}
mapit_free(iter);
- clif_displaymessage(fd, msg_txt(62)); // Judgement was made.
+ clif->displaymessage(fd, msg_txt(62)); // Judgement was made.
return 0;
}
@@ -3012,13 +3012,13 @@ ACMD_FUNC(doommap)
if (pl_sd->fd != fd && sd->bl.m == pl_sd->bl.m && pc_get_group_level(sd) >= pc_get_group_level(pl_sd))
{
status_kill(&pl_sd->bl);
- clif_specialeffect(&pl_sd->bl,450,AREA);
- clif_displaymessage(pl_sd->fd, msg_txt(61)); // The holy messenger has given judgement.
+ clif->specialeffect(&pl_sd->bl,450,AREA);
+ clif->displaymessage(pl_sd->fd, msg_txt(61)); // The holy messenger has given judgement.
}
}
mapit_free(iter);
- clif_displaymessage(fd, msg_txt(62)); // Judgement was made.
+ clif->displaymessage(fd, msg_txt(62)); // Judgement was made.
return 0;
}
@@ -3030,8 +3030,8 @@ static void atcommand_raise_sub(struct map_session_data* sd) {
status_revive(&sd->bl, 100, 100);
- clif_skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);
- clif_displaymessage(sd->fd, msg_txt(63)); // Mercy has been shown.
+ clif->skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);
+ clif->displaymessage(sd->fd, msg_txt(63)); // Mercy has been shown.
}
/*==========================================
@@ -3050,7 +3050,7 @@ ACMD_FUNC(raise)
atcommand_raise_sub(pl_sd);
mapit_free(iter);
- clif_displaymessage(fd, msg_txt(64)); // Mercy has been granted.
+ clif->displaymessage(fd, msg_txt(64)); // Mercy has been granted.
return 0;
}
@@ -3071,7 +3071,7 @@ ACMD_FUNC(raisemap)
atcommand_raise_sub(pl_sd);
mapit_free(iter);
- clif_displaymessage(fd, msg_txt(64)); // Mercy has been granted.
+ clif->displaymessage(fd, msg_txt(64)); // Mercy has been granted.
return 0;
}
@@ -3087,23 +3087,23 @@ ACMD_FUNC(kick)
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1026)); // Please enter a player name (usage: @kick <char name/ID>).
+ clif->displaymessage(fd, msg_txt(1026)); // Please enter a player name (usage: @kick <char name/ID>).
return -1;
}
if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL)
{
- clif_displaymessage(fd, msg_txt(3)); // Character not found.
+ clif->displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
{
- clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
+ clif->displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
return -1;
}
- clif_GM_kick(sd, pl_sd);
+ clif->GM_kick(sd, pl_sd);
return 0;
}
@@ -3122,12 +3122,12 @@ ACMD_FUNC(kickall)
{
if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can kick only lower or same gm level
if (sd->status.account_id != pl_sd->status.account_id)
- clif_GM_kick(NULL, pl_sd);
+ clif->GM_kick(NULL, pl_sd);
}
}
mapit_free(iter);
- clif_displaymessage(fd, msg_txt(195)); // All players have been kicked!
+ clif->displaymessage(fd, msg_txt(195)); // All players have been kicked!
return 0;
}
@@ -3140,8 +3140,8 @@ ACMD_FUNC(allskill)
nullpo_retr(-1, sd);
pc_allskillup(sd); // all skills
sd->status.skill_point = 0; // 0 skill points
- clif_updatestatus(sd, SP_SKILLPOINT); // update
- clif_displaymessage(fd, msg_txt(76)); // All skills have been added to your skill tree.
+ clif->updatestatus(sd, SP_SKILLPOINT); // update
+ clif->displaymessage(fd, msg_txt(76)); // All skills have been added to your skill tree.
return 0;
}
@@ -3162,30 +3162,30 @@ ACMD_FUNC(questskill)
text = atcommand_help_string( command );
// send the error message as always
- clif_displaymessage(fd, msg_txt(1027)); // Please enter a quest skill number.
+ clif->displaymessage(fd, msg_txt(1027)); // Please enter a quest skill number.
if( text )
{// send the skill ID list associated with this command
- clif_displaymessage( fd, text );
+ clif->displaymessage( fd, text );
}
return -1;
}
if (skill_id >= MAX_SKILL_DB) {
- clif_displaymessage(fd, msg_txt(198)); // This skill number doesn't exist.
+ clif->displaymessage(fd, msg_txt(198)); // This skill number doesn't exist.
return -1;
}
if (!(skill->get_inf2(skill_id) & INF2_QUEST_SKILL)) {
- clif_displaymessage(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill.
+ clif->displaymessage(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill.
return -1;
}
if (pc_checkskill(sd, skill_id) > 0) {
- clif_displaymessage(fd, msg_txt(196)); // You already have this quest skill.
+ clif->displaymessage(fd, msg_txt(196)); // You already have this quest skill.
return -1;
}
pc_skill(sd, skill_id, 1, 0);
- clif_displaymessage(fd, msg_txt(70)); // You have learned the skill.
+ clif->displaymessage(fd, msg_txt(70)); // You have learned the skill.
return 0;
}
@@ -3206,32 +3206,32 @@ ACMD_FUNC(lostskill)
text = atcommand_help_string( command );
// send the error message as always
- clif_displaymessage(fd, msg_txt(1027)); // Please enter a quest skill number.
+ clif->displaymessage(fd, msg_txt(1027)); // Please enter a quest skill number.
if( text )
{// send the skill ID list associated with this command
- clif_displaymessage( fd, text );
+ clif->displaymessage( fd, text );
}
return -1;
}
if (skill_id >= MAX_SKILL) {
- clif_displaymessage(fd, msg_txt(198)); // This skill number doesn't exist.
+ clif->displaymessage(fd, msg_txt(198)); // This skill number doesn't exist.
return -1;
}
if (!(skill->get_inf2(skill_id) & INF2_QUEST_SKILL)) {
- clif_displaymessage(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill.
+ clif->displaymessage(fd, msg_txt(197)); // This skill number doesn't exist or isn't a quest skill.
return -1;
}
if (pc_checkskill(sd, skill_id) == 0) {
- clif_displaymessage(fd, msg_txt(201)); // You don't have this quest skill.
+ clif->displaymessage(fd, msg_txt(201)); // You don't have this quest skill.
return -1;
}
sd->status.skill[skill_id].lv = 0;
sd->status.skill[skill_id].flag = 0;
- clif_deleteskill(sd,skill_id);
- clif_displaymessage(fd, msg_txt(71)); // You have forgotten the skill.
+ clif->deleteskill(sd,skill_id);
+ clif->displaymessage(fd, msg_txt(71)); // You have forgotten the skill.
return 0;
}
@@ -3251,14 +3251,14 @@ ACMD_FUNC(spiritball)
{
char msg[CHAT_SIZE_MAX];
safesnprintf(msg, sizeof(msg), msg_txt(1028), max_spiritballs); // Please enter a party name (usage: @party <party_name>).
- clif_displaymessage(fd, msg);
+ clif->displaymessage(fd, msg);
return -1;
}
if( sd->spiritball > 0 )
pc_delspiritball(sd, sd->spiritball, 1);
sd->spiritball = number;
- clif_spiritball(&sd->bl);
+ clif->spiritball(&sd->bl);
// no message, player can look the difference
return 0;
@@ -3275,7 +3275,7 @@ ACMD_FUNC(party)
memset(party, '\0', sizeof(party));
if (!message || !*message || sscanf(message, "%23[^\n]", party) < 1) {
- clif_displaymessage(fd, msg_txt(1029)); // Please enter a party name (usage: @party <party_name>).
+ clif->displaymessage(fd, msg_txt(1029)); // Please enter a party name (usage: @party <party_name>).
return -1;
}
@@ -3296,7 +3296,7 @@ ACMD_FUNC(guild)
memset(guild, '\0', sizeof(guild));
if (!message || !*message || sscanf(message, "%23[^\n]", guild) < 1) {
- clif_displaymessage(fd, msg_txt(1030)); // Please enter a guild name (usage: @guild <guild_name>).
+ clif->displaymessage(fd, msg_txt(1030)); // Please enter a guild name (usage: @guild <guild_name>).
return -1;
}
@@ -3325,15 +3325,15 @@ ACMD_FUNC(breakguild)
return -1; // Something went wrong
}
} else { // Not guild master
- clif_displaymessage(fd, msg_txt(1181)); // You need to be a Guild Master to use this command.
+ clif->displaymessage(fd, msg_txt(1181)); // You need to be a Guild Master to use this command.
return -1;
}
} else { // Guild was not found. HOW?
- clif_displaymessage(fd, msg_txt(252)); // You are not in a guild.
+ clif->displaymessage(fd, msg_txt(252)); // You are not in a guild.
return -1;
}
} else { // Player does not have a guild
- clif_displaymessage(fd, msg_txt(252)); // You are not in a guild.
+ clif->displaymessage(fd, msg_txt(252)); // You are not in a guild.
return -1;
}
return 0;
@@ -3346,13 +3346,13 @@ ACMD_FUNC(agitstart)
{
nullpo_retr(-1, sd);
if (agit_flag == 1) {
- clif_displaymessage(fd, msg_txt(73)); // War of Emperium is currently in progress.
+ clif->displaymessage(fd, msg_txt(73)); // War of Emperium is currently in progress.
return -1;
}
agit_flag = 1;
guild_agit_start();
- clif_displaymessage(fd, msg_txt(72)); // War of Emperium has been initiated.
+ clif->displaymessage(fd, msg_txt(72)); // War of Emperium has been initiated.
return 0;
}
@@ -3364,13 +3364,13 @@ ACMD_FUNC(agitstart2)
{
nullpo_retr(-1, sd);
if (agit2_flag == 1) {
- clif_displaymessage(fd, msg_txt(404)); // "War of Emperium SE is currently in progress."
+ clif->displaymessage(fd, msg_txt(404)); // "War of Emperium SE is currently in progress."
return -1;
}
agit2_flag = 1;
guild_agit2_start();
- clif_displaymessage(fd, msg_txt(403)); // "War of Emperium SE has been initiated."
+ clif->displaymessage(fd, msg_txt(403)); // "War of Emperium SE has been initiated."
return 0;
}
@@ -3382,13 +3382,13 @@ ACMD_FUNC(agitend)
{
nullpo_retr(-1, sd);
if (agit_flag == 0) {
- clif_displaymessage(fd, msg_txt(75)); // War of Emperium is currently not in progress.
+ clif->displaymessage(fd, msg_txt(75)); // War of Emperium is currently not in progress.
return -1;
}
agit_flag = 0;
guild_agit_end();
- clif_displaymessage(fd, msg_txt(74)); // War of Emperium has been ended.
+ clif->displaymessage(fd, msg_txt(74)); // War of Emperium has been ended.
return 0;
}
@@ -3400,13 +3400,13 @@ ACMD_FUNC(agitend2)
{
nullpo_retr(-1, sd);
if (agit2_flag == 0) {
- clif_displaymessage(fd, msg_txt(406)); // "War of Emperium SE is currently not in progress."
+ clif->displaymessage(fd, msg_txt(406)); // "War of Emperium SE is currently not in progress."
return -1;
}
agit2_flag = 0;
guild_agit2_end();
- clif_displaymessage(fd, msg_txt(405)); // "War of Emperium SE has been ended."
+ clif->displaymessage(fd, msg_txt(405)); // "War of Emperium SE has been ended."
return 0;
}
@@ -3436,24 +3436,24 @@ ACMD_FUNC(idsearch)
memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%99s", item_name) < 0) {
- clif_displaymessage(fd, msg_txt(1031)); // Please enter part of an item name (usage: @idsearch <part_of_item_name>).
+ clif->displaymessage(fd, msg_txt(1031)); // Please enter part of an item name (usage: @idsearch <part_of_item_name>).
return -1;
}
sprintf(atcmd_output, msg_txt(77), item_name); // The reference result of '%s' (name: id):
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
match = itemdb_searchname_array(item_array, MAX_SEARCH, item_name);
if (match > MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, match);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
match = MAX_SEARCH;
}
for(i = 0; i < match; i++) {
sprintf(atcmd_output, msg_txt(78), item_array[i]->jname, item_array[i]->nameid); // %s: %d
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
sprintf(atcmd_output, msg_txt(79), match); // It is %d affair above.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
@@ -3471,7 +3471,7 @@ ACMD_FUNC(recallall)
memset(atcmd_output, '\0', sizeof(atcmd_output));
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
- clif_displaymessage(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map.
+ clif->displaymessage(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map.
return -1;
}
@@ -3496,10 +3496,10 @@ ACMD_FUNC(recallall)
}
mapit_free(iter);
- clif_displaymessage(fd, msg_txt(92)); // All characters recalled!
+ clif->displaymessage(fd, msg_txt(92)); // All characters recalled!
if (count) {
sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
return 0;
@@ -3521,19 +3521,19 @@ ACMD_FUNC(guildrecall)
memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
- clif_displaymessage(fd, msg_txt(1034)); // Please enter a guild name/ID (usage: @guildrecall <guild_name/ID>).
+ clif->displaymessage(fd, msg_txt(1034)); // Please enter a guild name/ID (usage: @guildrecall <guild_name/ID>).
return -1;
}
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
- clif_displaymessage(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map.
+ clif->displaymessage(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map.
return -1;
}
if ((g = guild_searchname(guild_name)) == NULL && // name first to avoid error when name begin with a number
(g = guild_search(atoi(message))) == NULL)
{
- clif_displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
+ clif->displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
return -1;
}
@@ -3555,10 +3555,10 @@ ACMD_FUNC(guildrecall)
mapit_free(iter);
sprintf(atcmd_output, msg_txt(93), g->name); // All online characters of the %s guild have been recalled to your position.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
if (count) {
sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
return 0;
@@ -3580,19 +3580,19 @@ ACMD_FUNC(partyrecall)
memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%23[^\n]", party_name) < 1) {
- clif_displaymessage(fd, msg_txt(1035)); // Please enter a party name/ID (usage: @partyrecall <party_name/ID>).
+ clif->displaymessage(fd, msg_txt(1035)); // Please enter a party name/ID (usage: @partyrecall <party_name/ID>).
return -1;
}
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
- clif_displaymessage(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map.
+ clif->displaymessage(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map.
return -1;
}
if ((p = party_searchname(party_name)) == NULL && // name first to avoid error when name begin with a number
(p = party_search(atoi(message))) == NULL)
{
- clif_displaymessage(fd, msg_txt(96)); // Incorrect name or ID, or no one from the party is online.
+ clif->displaymessage(fd, msg_txt(96)); // Incorrect name or ID, or no one from the party is online.
return -1;
}
@@ -3614,10 +3614,10 @@ ACMD_FUNC(partyrecall)
mapit_free(iter);
sprintf(atcmd_output, msg_txt(95), p->party.name); // All online characters of the %s party have been recalled to your position.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
if (count) {
sprintf(atcmd_output, msg_txt(1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
return 0;
@@ -3630,7 +3630,7 @@ ACMD_FUNC(reloaditemdb)
{
nullpo_retr(-1, sd);
itemdb_reload();
- clif_displaymessage(fd, msg_txt(97)); // Item database has been reloaded.
+ clif->displaymessage(fd, msg_txt(97)); // Item database has been reloaded.
return 0;
}
@@ -3647,7 +3647,7 @@ ACMD_FUNC(reloadmobdb)
read_mercenarydb();
read_mercenary_skilldb();
reload_elementaldb();
- clif_displaymessage(fd, msg_txt(98)); // Monster database has been reloaded.
+ clif->displaymessage(fd, msg_txt(98)); // Monster database has been reloaded.
return 0;
}
@@ -3662,7 +3662,7 @@ ACMD_FUNC(reloadskilldb)
merc_skill_reload();
reload_elemental_skilldb();
read_mercenary_skilldb();
- clif_displaymessage(fd, msg_txt(99)); // Skill database has been reloaded.
+ clif->displaymessage(fd, msg_txt(99)); // Skill database has been reloaded.
return 0;
}
@@ -3675,14 +3675,14 @@ ACMD_FUNC(reloadatcommand) {
config_t run_test;
if (conf_read_file(&run_test, "conf/groups.conf")) {
- clif_displaymessage(fd, msg_txt(1036)); // Error reading groups.conf, reload failed.
+ clif->displaymessage(fd, msg_txt(1036)); // Error reading groups.conf, reload failed.
return -1;
}
config_destroy(&run_test);
if (conf_read_file(&run_test, ATCOMMAND_CONF_FILENAME)) {
- clif_displaymessage(fd, msg_txt(1037)); // Error reading atcommand.conf, reload failed.
+ clif->displaymessage(fd, msg_txt(1037)); // Error reading atcommand.conf, reload failed.
return -1;
}
@@ -3690,7 +3690,7 @@ ACMD_FUNC(reloadatcommand) {
atcommand_doload();
pc_groups_reload();
- clif_displaymessage(fd, msg_txt(254));
+ clif->displaymessage(fd, msg_txt(254));
return 0;
}
/*==========================================
@@ -3738,7 +3738,7 @@ ACMD_FUNC(reloadbattleconf)
mob_reload(); //Needed as well so rate changes take effect.
chrif_ragsrvinfo(battle_config.base_exp_rate, battle_config.job_exp_rate, battle_config.item_rate_common);
}
- clif_displaymessage(fd, msg_txt(255));
+ clif->displaymessage(fd, msg_txt(255));
return 0;
}
/*==========================================
@@ -3747,7 +3747,7 @@ ACMD_FUNC(reloadbattleconf)
ACMD_FUNC(reloadstatusdb)
{
status_readdb();
- clif_displaymessage(fd, msg_txt(256));
+ clif->displaymessage(fd, msg_txt(256));
return 0;
}
/*==========================================
@@ -3756,7 +3756,7 @@ ACMD_FUNC(reloadstatusdb)
ACMD_FUNC(reloadpcdb)
{
pc_readdb();
- clif_displaymessage(fd, msg_txt(257));
+ clif->displaymessage(fd, msg_txt(257));
return 0;
}
@@ -3766,7 +3766,7 @@ ACMD_FUNC(reloadpcdb)
ACMD_FUNC(reloadmotd)
{
pc_read_motd();
- clif_displaymessage(fd, msg_txt(268));
+ clif->displaymessage(fd, msg_txt(268));
return 0;
}
@@ -3784,7 +3784,7 @@ ACMD_FUNC(reloadscript)
script_reload();
npc_reload();
- clif_displaymessage(fd, msg_txt(100)); // Scripts have been reloaded.
+ clif->displaymessage(fd, msg_txt(100)); // Scripts have been reloaded.
return 0;
}
@@ -3817,7 +3817,7 @@ ACMD_FUNC(mapinfo) {
sscanf(message, "%d %23[^\n]", &list, mapname);
if (list < 0 || list > 3) {
- clif_displaymessage(fd, msg_txt(1038)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>).
+ clif->displaymessage(fd, msg_txt(1038)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>).
return -1;
}
@@ -3829,12 +3829,12 @@ ACMD_FUNC(mapinfo) {
}
if (m_id < 0) {
- clif_displaymessage(fd, msg_txt(1)); // Map not found.
+ clif->displaymessage(fd, msg_txt(1)); // Map not found.
return -1;
}
m_index = mapindex_name2id(mapname); //This one shouldn't fail since the previous seek did not.
- clif_displaymessage(fd, msg_txt(1039)); // ------ Map Info ------
+ clif->displaymessage(fd, msg_txt(1039)); // ------ Map Info ------
// count chats (for initial message)
chat_num = 0;
@@ -3850,18 +3850,18 @@ ACMD_FUNC(mapinfo) {
mapit_free(iter);
sprintf(atcmd_output, msg_txt(1040), mapname, map[m_id].zone->name, map[m_id].users, map[m_id].npc_num, chat_num, vend_num); // Map: %s (Zone:%s) | Players: %d | NPCs: %d | Chats: %d | Vendings: %d
- clif_displaymessage(fd, atcmd_output);
- clif_displaymessage(fd, msg_txt(1041)); // ------ Map Flags ------
+ clif->displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, msg_txt(1041)); // ------ Map Flags ------
if (map[m_id].flag.town)
- clif_displaymessage(fd, msg_txt(1042)); // Town Map
+ clif->displaymessage(fd, msg_txt(1042)); // Town Map
if (battle_config.autotrade_mapflag == map[m_id].flag.autotrade)
- clif_displaymessage(fd, msg_txt(1043)); // Autotrade Enabled
+ clif->displaymessage(fd, msg_txt(1043)); // Autotrade Enabled
else
- clif_displaymessage(fd, msg_txt(1044)); // Autotrade Disabled
+ clif->displaymessage(fd, msg_txt(1044)); // Autotrade Disabled
if (map[m_id].flag.battleground)
- clif_displaymessage(fd, msg_txt(1045)); // Battlegrounds ON
+ clif->displaymessage(fd, msg_txt(1045)); // Battlegrounds ON
strcpy(atcmd_output,msg_txt(1046)); // PvP Flags:
if (map[m_id].flag.pvp)
@@ -3874,7 +3874,7 @@ ACMD_FUNC(mapinfo) {
strcat(atcmd_output, msg_txt(1050)); // NightmareDrop |
if (map[m_id].flag.pvp_nocalcrank)
strcat(atcmd_output, msg_txt(1051)); // NoCalcRank |
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
strcpy(atcmd_output,msg_txt(1052)); // GvG Flags:
if (map[m_id].flag.gvg)
@@ -3885,7 +3885,7 @@ ACMD_FUNC(mapinfo) {
strcat(atcmd_output, msg_txt(1055)); // GvG Castle |
if (map[m_id].flag.gvg_noparty)
strcat(atcmd_output, msg_txt(1056)); // NoParty |
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
strcpy(atcmd_output,msg_txt(1057)); // Teleport Flags:
if (map[m_id].flag.noteleport)
@@ -3902,23 +3902,23 @@ ACMD_FUNC(mapinfo) {
strcat(atcmd_output, msg_txt(1063)); // NoGo |
if (map[m_id].flag.nomemo)
strcat(atcmd_output, msg_txt(1064)); // NoMemo |
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(1065), // No Exp Penalty: %s | No Zeny Penalty: %s
(map[m_id].flag.noexppenalty) ? msg_txt(1066) : msg_txt(1067), (map[m_id].flag.nozenypenalty) ? msg_txt(1066) : msg_txt(1067)); // On / Off
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
if (map[m_id].flag.nosave) {
if (!map[m_id].save.map)
- clif_displaymessage(fd, msg_txt(1068)); // No Save (Return to last Save Point)
+ clif->displaymessage(fd, msg_txt(1068)); // No Save (Return to last Save Point)
else if (map[m_id].save.x == -1 || map[m_id].save.y == -1 ) {
sprintf(atcmd_output, msg_txt(1069), mapindex_id2name(map[m_id].save.map)); // No Save, Save Point: %s,Random
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
else {
sprintf(atcmd_output, msg_txt(1070), // No Save, Save Point: %s,%d,%d
mapindex_id2name(map[m_id].save.map),map[m_id].save.x,map[m_id].save.y);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
}
@@ -3939,7 +3939,7 @@ ACMD_FUNC(mapinfo) {
strcat(atcmd_output, msg_txt(1078)); // Leaves |
if (map[m_id].flag.nightenabled)
strcat(atcmd_output, msg_txt(1080)); // Displays Night |
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
strcpy(atcmd_output,msg_txt(1081)); // Other Flags:
if (map[m_id].flag.nobranch)
@@ -3958,7 +3958,7 @@ ACMD_FUNC(mapinfo) {
strcat(atcmd_output, msg_txt(1088)); // AllowKS |
if (map[m_id].flag.reset)
strcat(atcmd_output, msg_txt(1089)); // Reset |
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
strcpy(atcmd_output,msg_txt(1090)); // Other Flags:
if (map[m_id].nocommand)
@@ -3975,27 +3975,27 @@ ACMD_FUNC(mapinfo) {
strcat(atcmd_output, msg_txt(1096)); // PartyLock |
if (map[m_id].flag.guildlock)
strcat(atcmd_output, msg_txt(1097)); // GuildLock |
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
switch (list) {
case 0:
// Do nothing. It's list 0, no additional display.
break;
case 1:
- clif_displaymessage(fd, msg_txt(1098)); // ----- Players in Map -----
+ clif->displaymessage(fd, msg_txt(1098)); // ----- Players in Map -----
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
{
if (pl_sd->mapindex == m_index) {
sprintf(atcmd_output, msg_txt(1099), // Player '%s' (session #%d) | Location: %d,%d
pl_sd->status.name, pl_sd->fd, pl_sd->bl.x, pl_sd->bl.y);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
}
mapit_free(iter);
break;
case 2:
- clif_displaymessage(fd, msg_txt(1100)); // ----- NPCs in Map -----
+ clif->displaymessage(fd, msg_txt(1100)); // ----- NPCs in Map -----
for (i = 0; i < map[m_id].npc_num;)
{
nd = map[m_id].npc[i];
@@ -4017,11 +4017,11 @@ ACMD_FUNC(mapinfo) {
else
sprintf(atcmd_output, msg_txt(1112), // NPC %d: %s::%s | Direction: %s | Sprite: %d | Location: %d %d
++i, nd->name, nd->exname, direction, nd->class_, nd->bl.x, nd->bl.y);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
break;
case 3:
- clif_displaymessage(fd, msg_txt(1113)); // ----- Chats in Map -----
+ clif->displaymessage(fd, msg_txt(1113)); // ----- Chats in Map -----
iter = mapit_getallusers();
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
{
@@ -4031,16 +4031,16 @@ ACMD_FUNC(mapinfo) {
{
sprintf(atcmd_output, msg_txt(1114), // Chat: %s | Player: %s | Location: %d %d
cd->title, pl_sd->status.name, cd->bl.x, cd->bl.y);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(1115), // Users: %d/%d | Password: %s | Public: %s
cd->users, cd->limit, cd->pass, (cd->pub) ? msg_txt(1116) : msg_txt(1117)); // Yes / No
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
}
mapit_free(iter);
break;
default: // normally impossible to arrive here
- clif_displaymessage(fd, msg_txt(1118)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>).
+ clif->displaymessage(fd, msg_txt(1118)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>).
return -1;
break;
}
@@ -4056,36 +4056,36 @@ ACMD_FUNC(mount_peco)
nullpo_retr(-1, sd);
if (sd->disguise) {
- clif_displaymessage(fd, msg_txt(212)); // Cannot mount while in disguise.
+ clif->displaymessage(fd, msg_txt(212)); // Cannot mount while in disguise.
return -1;
}
if( (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT && pc_checkskill(sd,RK_DRAGONTRAINING) > 0 ) {
if( !(sd->sc.option&OPTION_DRAGON1) ) {
- clif_displaymessage(sd->fd,msg_txt(1119)); // You have mounted your Dragon.
+ clif->displaymessage(sd->fd,msg_txt(1119)); // You have mounted your Dragon.
pc_setoption(sd, sd->sc.option|OPTION_DRAGON1);
} else {
- clif_displaymessage(sd->fd,msg_txt(1120)); // You have released your Dragon.
+ clif->displaymessage(sd->fd,msg_txt(1120)); // You have released your Dragon.
pc_setoption(sd, sd->sc.option&~OPTION_DRAGON1);
}
return 0;
}
if( (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER && pc_checkskill(sd,RA_WUGRIDER) > 0 ) {
if( !pc_isridingwug(sd) ) {
- clif_displaymessage(sd->fd,msg_txt(1121)); // You have mounted your Warg.
+ clif->displaymessage(sd->fd,msg_txt(1121)); // You have mounted your Warg.
pc_setoption(sd, sd->sc.option|OPTION_WUGRIDER);
} else {
- clif_displaymessage(sd->fd,msg_txt(1122)); // You have released your Warg.
+ clif->displaymessage(sd->fd,msg_txt(1122)); // You have released your Warg.
pc_setoption(sd, sd->sc.option&~OPTION_WUGRIDER);
}
return 0;
}
if( (sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC ) {
if( !pc_ismadogear(sd) ) {
- clif_displaymessage(sd->fd,msg_txt(1123)); // You have mounted your Mado Gear.
+ clif->displaymessage(sd->fd,msg_txt(1123)); // You have mounted your Mado Gear.
pc_setoption(sd, sd->sc.option|OPTION_MADOGEAR);
} else {
- clif_displaymessage(sd->fd,msg_txt(1124)); // You have released your Mado Gear.
+ clif->displaymessage(sd->fd,msg_txt(1124)); // You have released your Mado Gear.
pc_setoption(sd, sd->sc.option&~OPTION_MADOGEAR);
}
return 0;
@@ -4093,15 +4093,15 @@ ACMD_FUNC(mount_peco)
if (!pc_isriding(sd)) { // if actually no peco
if (!pc_checkskill(sd, KN_RIDING)) {
- clif_displaymessage(fd, msg_txt(213)); // You can not mount a Peco Peco with your current job.
+ clif->displaymessage(fd, msg_txt(213)); // You can not mount a Peco Peco with your current job.
return -1;
}
pc_setoption(sd, sd->sc.option | OPTION_RIDING);
- clif_displaymessage(fd, msg_txt(102)); // You have mounted a Peco Peco.
+ clif->displaymessage(fd, msg_txt(102)); // You have mounted a Peco Peco.
} else {//Dismount
pc_setoption(sd, sd->sc.option & ~OPTION_RIDING);
- clif_displaymessage(fd, msg_txt(214)); // You have released your Peco Peco.
+ clif->displaymessage(fd, msg_txt(214)); // You have released your Peco Peco.
}
return 0;
@@ -4121,11 +4121,11 @@ ACMD_FUNC(guildspy)
if (!enable_spy)
{
- clif_displaymessage(fd, msg_txt(1125)); // The mapserver has spy command support disabled.
+ clif->displaymessage(fd, msg_txt(1125)); // The mapserver has spy command support disabled.
return -1;
}
if (!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
- clif_displaymessage(fd, msg_txt(1126)); // Please enter a guild name/ID (usage: @guildspy <guild_name/ID>).
+ clif->displaymessage(fd, msg_txt(1126)); // Please enter a guild name/ID (usage: @guildspy <guild_name/ID>).
return -1;
}
@@ -4134,14 +4134,14 @@ ACMD_FUNC(guildspy)
if (sd->guildspy == g->guild_id) {
sd->guildspy = 0;
sprintf(atcmd_output, msg_txt(103), g->name); // No longer spying on the %s guild.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
} else {
sd->guildspy = g->guild_id;
sprintf(atcmd_output, msg_txt(104), g->name); // Spying on the %s guild.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
} else {
- clif_displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the specified guild is online.
+ clif->displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the specified guild is online.
return -1;
}
@@ -4162,12 +4162,12 @@ ACMD_FUNC(partyspy)
if (!enable_spy)
{
- clif_displaymessage(fd, msg_txt(1125)); // The mapserver has spy command support disabled.
+ clif->displaymessage(fd, msg_txt(1125)); // The mapserver has spy command support disabled.
return -1;
}
if (!message || !*message || sscanf(message, "%23[^\n]", party_name) < 1) {
- clif_displaymessage(fd, msg_txt(1127)); // Please enter a party name/ID (usage: @partyspy <party_name/ID>).
+ clif->displaymessage(fd, msg_txt(1127)); // Please enter a party name/ID (usage: @partyspy <party_name/ID>).
return -1;
}
@@ -4176,14 +4176,14 @@ ACMD_FUNC(partyspy)
if (sd->partyspy == p->party.party_id) {
sd->partyspy = 0;
sprintf(atcmd_output, msg_txt(105), p->party.name); // No longer spying on the %s party.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
} else {
sd->partyspy = p->party.party_id;
sprintf(atcmd_output, msg_txt(106), p->party.name); // Spying on the %s party.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
} else {
- clif_displaymessage(fd, msg_txt(96)); // Incorrect name/ID, or no one from the specified party is online.
+ clif->displaymessage(fd, msg_txt(96)); // Incorrect name/ID, or no one from the specified party is online.
return -1;
}
@@ -4202,17 +4202,17 @@ ACMD_FUNC(repairall)
for (i = 0; i < MAX_INVENTORY; i++) {
if (sd->status.inventory[i].nameid && sd->status.inventory[i].attribute == 1) {
sd->status.inventory[i].attribute = 0;
- clif_produceeffect(sd, 0, sd->status.inventory[i].nameid);
+ clif->produce_effect(sd, 0, sd->status.inventory[i].nameid);
count++;
}
}
if (count > 0) {
- clif_misceffect(&sd->bl, 3);
- clif_equiplist(sd);
- clif_displaymessage(fd, msg_txt(107)); // All items have been repaired.
+ clif->misceffect(&sd->bl, 3);
+ clif->equiplist(sd);
+ clif->displaymessage(fd, msg_txt(107)); // All items have been repaired.
} else {
- clif_displaymessage(fd, msg_txt(108)); // No item need to be repaired.
+ clif->displaymessage(fd, msg_txt(108)); // No item need to be repaired.
return -1;
}
@@ -4230,20 +4230,20 @@ ACMD_FUNC(nuke)
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
- clif_displaymessage(fd, msg_txt(1128)); // Please enter a player name (usage: @nuke <char name>).
+ clif->displaymessage(fd, msg_txt(1128)); // Please enter a player name (usage: @nuke <char name>).
return -1;
}
if ((pl_sd = map_nick2sd(atcmd_player_name)) != NULL) {
if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can kill only lower or same GM level
skill->castend_nodamage_id(&pl_sd->bl, &pl_sd->bl, NPC_SELFDESTRUCTION, 99, gettick(), 0);
- clif_displaymessage(fd, msg_txt(109)); // Player has been nuked!
+ clif->displaymessage(fd, msg_txt(109)); // Player has been nuked!
} else {
- clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
+ clif->displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
return -1;
}
} else {
- clif_displaymessage(fd, msg_txt(3)); // Character not found.
+ clif->displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
@@ -4263,17 +4263,17 @@ ACMD_FUNC(tonpc)
memset(npcname, 0, sizeof(npcname));
if (!message || !*message || sscanf(message, "%23[^\n]", npcname) < 1) {
- clif_displaymessage(fd, msg_txt(1129)); // Please enter a NPC name (usage: @tonpc <NPC_name>).
+ clif->displaymessage(fd, msg_txt(1129)); // Please enter a NPC name (usage: @tonpc <NPC_name>).
return -1;
}
if ((nd = npc_name2id(npcname)) != NULL) {
if (pc_setpos(sd, map_id2index(nd->bl.m), nd->bl.x, nd->bl.y, CLR_TELEPORT) == 0)
- clif_displaymessage(fd, msg_txt(0)); // Warped.
+ clif->displaymessage(fd, msg_txt(0)); // Warped.
else
return -1;
} else {
- clif_displaymessage(fd, msg_txt(111)); // This NPC doesn't exist.
+ clif->displaymessage(fd, msg_txt(111)); // This NPC doesn't exist.
return -1;
}
@@ -4291,15 +4291,15 @@ ACMD_FUNC(shownpc)
memset(NPCname, '\0', sizeof(NPCname));
if (!message || !*message || sscanf(message, "%23[^\n]", NPCname) < 1) {
- clif_displaymessage(fd, msg_txt(1130)); // Please enter a NPC name (usage: @enablenpc <NPC_name>).
+ clif->displaymessage(fd, msg_txt(1130)); // Please enter a NPC name (usage: @enablenpc <NPC_name>).
return -1;
}
if (npc_name2id(NPCname) != NULL) {
npc_enable(NPCname, 1);
- clif_displaymessage(fd, msg_txt(110)); // Npc Enabled.
+ clif->displaymessage(fd, msg_txt(110)); // Npc Enabled.
} else {
- clif_displaymessage(fd, msg_txt(111)); // This NPC doesn't exist.
+ clif->displaymessage(fd, msg_txt(111)); // This NPC doesn't exist.
return -1;
}
@@ -4317,17 +4317,17 @@ ACMD_FUNC(hidenpc)
memset(NPCname, '\0', sizeof(NPCname));
if (!message || !*message || sscanf(message, "%23[^\n]", NPCname) < 1) {
- clif_displaymessage(fd, msg_txt(1131)); // Please enter a NPC name (usage: @hidenpc <NPC_name>).
+ clif->displaymessage(fd, msg_txt(1131)); // Please enter a NPC name (usage: @hidenpc <NPC_name>).
return -1;
}
if (npc_name2id(NPCname) == NULL) {
- clif_displaymessage(fd, msg_txt(111)); // This NPC doesn't exist.
+ clif->displaymessage(fd, msg_txt(111)); // This NPC doesn't exist.
return -1;
}
npc_enable(NPCname, 0);
- clif_displaymessage(fd, msg_txt(112)); // Npc Disabled.
+ clif->displaymessage(fd, msg_txt(112)); // Npc Disabled.
return 0;
}
@@ -4336,13 +4336,13 @@ ACMD_FUNC(loadnpc)
FILE *fp;
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1132)); // Please enter a script file name (usage: @loadnpc <file name>).
+ clif->displaymessage(fd, msg_txt(1132)); // Please enter a script file name (usage: @loadnpc <file name>).
return -1;
}
// check if script file exists
if ((fp = fopen(message, "r")) == NULL) {
- clif_displaymessage(fd, msg_txt(261));
+ clif->displaymessage(fd, msg_txt(261));
return -1;
}
fclose(fp);
@@ -4352,7 +4352,7 @@ ACMD_FUNC(loadnpc)
npc_parsesrcfile(message,true);
npc_read_event_script();
- clif_displaymessage(fd, msg_txt(262));
+ clif->displaymessage(fd, msg_txt(262));
return 0;
}
@@ -4366,19 +4366,19 @@ ACMD_FUNC(unloadnpc)
memset(NPCname, '\0', sizeof(NPCname));
if (!message || !*message || sscanf(message, "%24[^\n]", NPCname) < 1) {
- clif_displaymessage(fd, msg_txt(1133)); // Please enter a NPC name (usage: @npcoff <NPC_name>).
+ clif->displaymessage(fd, msg_txt(1133)); // Please enter a NPC name (usage: @npcoff <NPC_name>).
return -1;
}
if ((nd = npc_name2id(NPCname)) == NULL) {
- clif_displaymessage(fd, msg_txt(111)); // This NPC doesn't exist.
+ clif->displaymessage(fd, msg_txt(111)); // This NPC doesn't exist.
return -1;
}
npc_unload_duplicates(nd);
npc_unload(nd,true);
npc_read_event_script();
- clif_displaymessage(fd, msg_txt(112)); // Npc Disabled.
+ clif->displaymessage(fd, msg_txt(112)); // Npc Disabled.
return 0;
}
@@ -4440,54 +4440,54 @@ ACMD_FUNC(servertime)
datetime = localtime(&time_server); // convert seconds in structure
// like sprintf, but only for date/time (Sunday, November 02 2003 15:12:52)
strftime(temp, sizeof(temp)-1, msg_txt(230), datetime); // Server time (normal time): %A, %B %d %Y %X.
- clif_displaymessage(fd, temp);
+ clif->displaymessage(fd, temp);
if (battle_config.night_duration == 0 && battle_config.day_duration == 0) {
if (night_flag == 0)
- clif_displaymessage(fd, msg_txt(231)); // Game time: The game is in permanent daylight.
+ clif->displaymessage(fd, msg_txt(231)); // Game time: The game is in permanent daylight.
else
- clif_displaymessage(fd, msg_txt(232)); // Game time: The game is in permanent night.
+ clif->displaymessage(fd, msg_txt(232)); // Game time: The game is in permanent night.
} else if (battle_config.night_duration == 0)
if (night_flag == 1) { // we start with night
timer_data = get_timer(day_timer_tid);
sprintf(temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in night for %s.
- clif_displaymessage(fd, temp);
- clif_displaymessage(fd, msg_txt(234)); // Game time: After, the game will be in permanent daylight.
+ clif->displaymessage(fd, temp);
+ clif->displaymessage(fd, msg_txt(234)); // Game time: After, the game will be in permanent daylight.
} else
- clif_displaymessage(fd, msg_txt(231)); // Game time: The game is in permanent daylight.
+ clif->displaymessage(fd, msg_txt(231)); // Game time: The game is in permanent daylight.
else if (battle_config.day_duration == 0)
if (night_flag == 0) { // we start with day
timer_data = get_timer(night_timer_tid);
sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s.
- clif_displaymessage(fd, temp);
- clif_displaymessage(fd, msg_txt(236)); // Game time: After, the game will be in permanent night.
+ clif->displaymessage(fd, temp);
+ clif->displaymessage(fd, msg_txt(236)); // Game time: After, the game will be in permanent night.
} else
- clif_displaymessage(fd, msg_txt(232)); // Game time: The game is in permanent night.
+ clif->displaymessage(fd, msg_txt(232)); // Game time: The game is in permanent night.
else {
if (night_flag == 0) {
timer_data = get_timer(night_timer_tid);
timer_data2 = get_timer(day_timer_tid);
sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s.
- clif_displaymessage(fd, temp);
+ clif->displaymessage(fd, temp);
if (DIFF_TICK(timer_data->tick, timer_data2->tick) > 0)
sprintf(temp, msg_txt(237), txt_time(DIFF_TICK(timer_data->interval,DIFF_TICK(timer_data->tick,timer_data2->tick)) / 1000)); // Game time: After, the game will be in night for %s.
else
sprintf(temp, msg_txt(237), txt_time(DIFF_TICK(timer_data2->tick,timer_data->tick)/1000)); // Game time: After, the game will be in night for %s.
- clif_displaymessage(fd, temp);
+ clif->displaymessage(fd, temp);
sprintf(temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s.
- clif_displaymessage(fd, temp);
+ clif->displaymessage(fd, temp);
} else {
timer_data = get_timer(day_timer_tid);
timer_data2 = get_timer(night_timer_tid);
sprintf(temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,gettick()) / 1000)); // Game time: The game is actualy in night for %s.
- clif_displaymessage(fd, temp);
+ clif->displaymessage(fd, temp);
if (DIFF_TICK(timer_data->tick,timer_data2->tick) > 0)
sprintf(temp, msg_txt(239), txt_time((timer_data->interval - DIFF_TICK(timer_data->tick, timer_data2->tick)) / 1000)); // Game time: After, the game will be in daylight for %s.
else
sprintf(temp, msg_txt(239), txt_time(DIFF_TICK(timer_data2->tick, timer_data->tick) / 1000)); // Game time: After, the game will be in daylight for %s.
- clif_displaymessage(fd, temp);
+ clif->displaymessage(fd, temp);
sprintf(temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s.
- clif_displaymessage(fd, temp);
+ clif->displaymessage(fd, temp);
}
}
@@ -4536,24 +4536,24 @@ ACMD_FUNC(jail)
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
- clif_displaymessage(fd, msg_txt(1134)); // Please enter a player name (usage: @jail <char_name>).
+ clif->displaymessage(fd, msg_txt(1134)); // Please enter a player name (usage: @jail <char_name>).
return -1;
}
if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) {
- clif_displaymessage(fd, msg_txt(3)); // Character not found.
+ clif->displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
if (pc_get_group_level(sd) < pc_get_group_level(pl_sd))
{ // you can jail only lower or same GM
- clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
+ clif->displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
return -1;
}
if (pl_sd->sc.data[SC_JAILED])
{
- clif_displaymessage(fd, msg_txt(118)); // Player warped in jails.
+ clif->displaymessage(fd, msg_txt(118)); // Player warped in jails.
return -1;
}
@@ -4572,8 +4572,8 @@ ACMD_FUNC(jail)
//Duration of INT_MAX to specify infinity.
sc_start4(&pl_sd->bl,SC_JAILED,100,INT_MAX,m_index,x,y,1000);
- clif_displaymessage(pl_sd->fd, msg_txt(117)); // GM has send you in jails.
- clif_displaymessage(fd, msg_txt(118)); // Player warped in jails.
+ clif->displaymessage(pl_sd->fd, msg_txt(117)); // GM has send you in jails.
+ clif->displaymessage(fd, msg_txt(118)); // Player warped in jails.
return 0;
}
@@ -4588,31 +4588,31 @@ ACMD_FUNC(unjail)
memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
- clif_displaymessage(fd, msg_txt(1135)); // Please enter a player name (usage: @unjail/@discharge <char_name>).
+ clif->displaymessage(fd, msg_txt(1135)); // Please enter a player name (usage: @unjail/@discharge <char_name>).
return -1;
}
if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) {
- clif_displaymessage(fd, msg_txt(3)); // Character not found.
+ clif->displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
if (pc_get_group_level(sd) < pc_get_group_level(pl_sd)) { // you can jail only lower or same GM
- clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
+ clif->displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
return -1;
}
if (!pl_sd->sc.data[SC_JAILED])
{
- clif_displaymessage(fd, msg_txt(119)); // This player is not in jails.
+ clif->displaymessage(fd, msg_txt(119)); // This player is not in jails.
return -1;
}
//Reset jail time to 1 sec.
sc_start(&pl_sd->bl,SC_JAILED,100,1,1000);
- clif_displaymessage(pl_sd->fd, msg_txt(120)); // A GM has discharged you from jail.
- clif_displaymessage(fd, msg_txt(121)); // Player unjailed.
+ clif->displaymessage(pl_sd->fd, msg_txt(120)); // A GM has discharged you from jail.
+ clif->displaymessage(fd, msg_txt(121)); // Player unjailed.
return 0;
}
@@ -4626,7 +4626,7 @@ ACMD_FUNC(jailfor)
nullpo_retr(-1, sd);
if (!message || !*message || sscanf(message, "%255s %23[^\n]",atcmd_output,atcmd_player_name) < 2) {
- clif_displaymessage(fd, msg_txt(400)); //Usage: @jailfor <time> <character name>
+ clif->displaymessage(fd, msg_txt(400)); //Usage: @jailfor <time> <character name>
return -1;
}
@@ -4668,24 +4668,24 @@ ACMD_FUNC(jailfor)
}
if (year == 0 && month == 0 && day == 0 && hour == 0 && minute == 0) {
- clif_displaymessage(fd, msg_txt(1136)); // Invalid time for jail command.
+ clif->displaymessage(fd, msg_txt(1136)); // Invalid time for jail command.
return -1;
}
if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) {
- clif_displaymessage(fd, msg_txt(3)); // Character not found.
+ clif->displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
if (pc_get_group_level(pl_sd) > pc_get_group_level(sd)) {
- clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
+ clif->displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
return -1;
}
jailtime = year*12*30*24*60 + month*30*24*60 + day*24*60 + hour*60 + minute; //In minutes
if(jailtime==0) {
- clif_displaymessage(fd, msg_txt(1136)); // Invalid time for jail command.
+ clif->displaymessage(fd, msg_txt(1136)); // Invalid time for jail command.
return -1;
}
@@ -4696,17 +4696,17 @@ ACMD_FUNC(jailfor)
jailtime += pl_sd->sc.data[SC_JAILED]->val1;
if (jailtime <= 0) {
jailtime = 0;
- clif_displaymessage(pl_sd->fd, msg_txt(120)); // GM has discharge you.
- clif_displaymessage(fd, msg_txt(121)); // Player unjailed
+ clif->displaymessage(pl_sd->fd, msg_txt(120)); // GM has discharge you.
+ clif->displaymessage(fd, msg_txt(121)); // Player unjailed
} else {
get_jail_time(jailtime,&year,&month,&day,&hour,&minute);
sprintf(atcmd_output,msg_txt(402),msg_txt(1137),year,month,day,hour,minute); //%s in jail for %d years, %d months, %d days, %d hours and %d minutes
- clif_displaymessage(pl_sd->fd, atcmd_output);
+ clif->displaymessage(pl_sd->fd, atcmd_output);
sprintf(atcmd_output,msg_txt(402),msg_txt(1138),year,month,day,hour,minute); //This player is now in jail for %d years, %d months, %d days, %d hours and %d minutes
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
} else if (jailtime < 0) {
- clif_displaymessage(fd, msg_txt(1136));
+ clif->displaymessage(fd, msg_txt(1136));
return -1;
}
@@ -4736,17 +4736,17 @@ ACMD_FUNC(jailtime)
nullpo_retr(-1, sd);
if (!sd->sc.data[SC_JAILED]) {
- clif_displaymessage(fd, msg_txt(1139)); // You are not in jail.
+ clif->displaymessage(fd, msg_txt(1139)); // You are not in jail.
return -1;
}
if (sd->sc.data[SC_JAILED]->val1 == INT_MAX) {
- clif_displaymessage(fd, msg_txt(1140)); // You have been jailed indefinitely.
+ clif->displaymessage(fd, msg_txt(1140)); // You have been jailed indefinitely.
return 0;
}
if (sd->sc.data[SC_JAILED]->val1 <= 0) { // Was not jailed with @jailfor (maybe @jail? or warped there? or got recalled?)
- clif_displaymessage(fd, msg_txt(1141)); // You have been jailed for an unknown amount of time.
+ clif->displaymessage(fd, msg_txt(1141)); // You have been jailed for an unknown amount of time.
return -1;
}
@@ -4754,7 +4754,7 @@ ACMD_FUNC(jailtime)
get_jail_time(sd->sc.data[SC_JAILED]->val1,&year,&month,&day,&hour,&minute);
sprintf(atcmd_output,msg_txt(402),msg_txt(1142),year,month,day,hour,minute); // You will remain in jail for %d years, %d months, %d days, %d hours and %d minutes
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
@@ -4768,7 +4768,7 @@ ACMD_FUNC(disguise)
nullpo_retr(-1, sd);
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1143)); // Please enter a Monster/NPC name/ID (usage: @disguise <name/ID>).
+ clif->displaymessage(fd, msg_txt(1143)); // Please enter a Monster/NPC name/ID (usage: @disguise <name/ID>).
return -1;
}
@@ -4787,18 +4787,18 @@ ACMD_FUNC(disguise)
if (id == 0)
{
- clif_displaymessage(fd, msg_txt(123)); // Invalid Monster/NPC name/ID specified.
+ clif->displaymessage(fd, msg_txt(123)); // Invalid Monster/NPC name/ID specified.
return -1;
}
if(pc_isriding(sd))
{
- clif_displaymessage(fd, msg_txt(1144)); // Character cannot be disguised while mounted.
+ clif->displaymessage(fd, msg_txt(1144)); // Character cannot be disguised while mounted.
return -1;
}
pc_disguise(sd, id);
- clif_displaymessage(fd, msg_txt(122)); // Disguise applied.
+ clif->displaymessage(fd, msg_txt(122)); // Disguise applied.
return 0;
}
@@ -4814,7 +4814,7 @@ ACMD_FUNC(disguiseall)
nullpo_retr(-1, sd);
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1145)); // Please enter a Monster/NPC name/ID (usage: @disguiseall <name/ID>).
+ clif->displaymessage(fd, msg_txt(1145)); // Please enter a Monster/NPC name/ID (usage: @disguiseall <name/ID>).
return -1;
}
@@ -4822,7 +4822,7 @@ ACMD_FUNC(disguiseall)
mob_id = atoi(message);
if (!mobdb_checkid(mob_id) && !npcdb_checkid(mob_id)) { //if mob or npc...
- clif_displaymessage(fd, msg_txt(123)); // Monster/NPC name/id not found.
+ clif->displaymessage(fd, msg_txt(123)); // Monster/NPC name/id not found.
return -1;
}
@@ -4831,7 +4831,7 @@ ACMD_FUNC(disguiseall)
pc_disguise(pl_sd, mob_id);
mapit_free(iter);
- clif_displaymessage(fd, msg_txt(122)); // Disguise applied.
+ clif->displaymessage(fd, msg_txt(122)); // Disguise applied.
return 0;
}
@@ -4849,7 +4849,7 @@ ACMD_FUNC(disguiseguild)
memset(guild, '\0', sizeof(guild));
if( !message || !*message || sscanf(message, "%23[^,], %23[^\r\n]", monster, guild) < 2 ) {
- clif_displaymessage(fd, msg_txt(1146)); // Please enter a mob name/ID and guild name/ID (usage: @disguiseguild <mob name/ID>, <guild name/ID>).
+ clif->displaymessage(fd, msg_txt(1146)); // Please enter a mob name/ID and guild name/ID (usage: @disguiseguild <mob name/ID>, <guild name/ID>).
return -1;
}
@@ -4865,12 +4865,12 @@ ACMD_FUNC(disguiseguild)
}
if( id == 0 ) {
- clif_displaymessage(fd, msg_txt(123)); // Monster/NPC name/id hasn't been found.
+ clif->displaymessage(fd, msg_txt(123)); // Monster/NPC name/id hasn't been found.
return -1;
}
if( (g = guild_searchname(guild)) == NULL && (g = guild_search(atoi(guild))) == NULL ) {
- clif_displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
+ clif->displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
return -1;
}
@@ -4878,7 +4878,7 @@ ACMD_FUNC(disguiseguild)
if( (pl_sd = g->member[i].sd) && !pc_isriding(pl_sd) )
pc_disguise(pl_sd, id);
- clif_displaymessage(fd, msg_txt(122)); // Disguise applied.
+ clif->displaymessage(fd, msg_txt(122)); // Disguise applied.
return 0;
}
@@ -4891,9 +4891,9 @@ ACMD_FUNC(undisguise)
nullpo_retr(-1, sd);
if (sd->disguise) {
pc_disguise(sd, 0);
- clif_displaymessage(fd, msg_txt(124)); // Undisguise applied.
+ clif->displaymessage(fd, msg_txt(124)); // Undisguise applied.
} else {
- clif_displaymessage(fd, msg_txt(125)); // You're not disguised.
+ clif->displaymessage(fd, msg_txt(125)); // You're not disguised.
return -1;
}
@@ -4915,7 +4915,7 @@ ACMD_FUNC(undisguiseall)
pc_disguise(pl_sd, 0);
mapit_free(iter);
- clif_displaymessage(fd, msg_txt(124)); // Undisguise applied.
+ clif->displaymessage(fd, msg_txt(124)); // Undisguise applied.
return 0;
}
@@ -4934,12 +4934,12 @@ ACMD_FUNC(undisguiseguild)
memset(guild_name, '\0', sizeof(guild_name));
if(!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
- clif_displaymessage(fd, msg_txt(1147)); // Please enter guild name/ID (usage: @undisguiseguild <guild name/ID>).
+ clif->displaymessage(fd, msg_txt(1147)); // Please enter guild name/ID (usage: @undisguiseguild <guild name/ID>).
return -1;
}
if( (g = guild_searchname(guild_name)) == NULL && (g = guild_search(atoi(message))) == NULL ) {
- clif_displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
+ clif->displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
return -1;
}
@@ -4947,7 +4947,7 @@ ACMD_FUNC(undisguiseguild)
if( (pl_sd = g->member[i].sd) && pl_sd->disguise )
pc_disguise(pl_sd, 0);
- clif_displaymessage(fd, msg_txt(124)); // Undisguise applied.
+ clif->displaymessage(fd, msg_txt(124)); // Undisguise applied.
return 0;
}
@@ -4971,7 +4971,7 @@ ACMD_FUNC(exp)
nextj = sd->status.job_exp*100.0/nextj;
sprintf(output, msg_txt(1148), sd->status.base_level, nextb, sd->status.job_level, nextj); // Base Level: %d (%.3f%%) | Job Level: %d (%.3f%%)
- clif_displaymessage(fd, output);
+ clif->displaymessage(fd, output);
return 0;
}
@@ -4986,7 +4986,7 @@ ACMD_FUNC(broadcast)
memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1149)); // Please enter a message (usage: @broadcast <message>).
+ clif->displaymessage(fd, msg_txt(1149)); // Please enter a message (usage: @broadcast <message>).
return -1;
}
@@ -5006,13 +5006,13 @@ ACMD_FUNC(localbroadcast)
memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1150)); // Please enter a message (usage: @localbroadcast <message>).
+ clif->displaymessage(fd, msg_txt(1150)); // Please enter a message (usage: @localbroadcast <message>).
return -1;
}
sprintf(atcmd_output, "%s: %s", sd->status.name, message);
- clif_broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, 0, ALL_SAMEMAP);
+ clif->broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, 0, ALL_SAMEMAP);
return 0;
}
@@ -5030,26 +5030,26 @@ ACMD_FUNC(email)
memset(new_email, '\0', sizeof(new_email));
if (!message || !*message || sscanf(message, "%99s %99s", actual_email, new_email) < 2) {
- clif_displaymessage(fd, msg_txt(1151)); // Please enter 2 emails (usage: @email <actual@email> <new@email>).
+ clif->displaymessage(fd, msg_txt(1151)); // Please enter 2 emails (usage: @email <actual@email> <new@email>).
return -1;
}
if (e_mail_check(actual_email) == 0) {
- clif_displaymessage(fd, msg_txt(144)); // Invalid actual email. If you have default e-mail, give a@a.com.
+ clif->displaymessage(fd, msg_txt(144)); // Invalid actual email. If you have default e-mail, give a@a.com.
return -1;
} else if (e_mail_check(new_email) == 0) {
- clif_displaymessage(fd, msg_txt(145)); // Invalid new email. Please enter a real e-mail.
+ clif->displaymessage(fd, msg_txt(145)); // Invalid new email. Please enter a real e-mail.
return -1;
} else if (strcmpi(new_email, "a@a.com") == 0) {
- clif_displaymessage(fd, msg_txt(146)); // New email must be a real e-mail.
+ clif->displaymessage(fd, msg_txt(146)); // New email must be a real e-mail.
return -1;
} else if (strcmpi(actual_email, new_email) == 0) {
- clif_displaymessage(fd, msg_txt(147)); // New email must be different of the actual e-mail.
+ clif->displaymessage(fd, msg_txt(147)); // New email must be different of the actual e-mail.
return -1;
}
chrif_changeemail(sd->status.account_id, actual_email, new_email);
- clif_displaymessage(fd, msg_txt(148)); // Information sended to login-server via char-server.
+ clif->displaymessage(fd, msg_txt(148)); // Information sended to login-server via char-server.
return 0;
}
@@ -5062,12 +5062,12 @@ ACMD_FUNC(effect)
nullpo_retr(-1, sd);
if (!message || !*message || sscanf(message, "%d", &type) < 1) {
- clif_displaymessage(fd, msg_txt(1152)); // Please enter an effect number (usage: @effect <effect number>).
+ clif->displaymessage(fd, msg_txt(1152)); // Please enter an effect number (usage: @effect <effect number>).
return -1;
}
- clif_specialeffect(&sd->bl, type, (send_target)flag);
- clif_displaymessage(fd, msg_txt(229)); // Your effect has changed.
+ clif->specialeffect(&sd->bl, type, (send_target)flag);
+ clif->displaymessage(fd, msg_txt(229)); // Your effect has changed.
return 0;
}
@@ -5081,9 +5081,9 @@ ACMD_FUNC(killer)
sd->state.killer = !sd->state.killer;
if(sd->state.killer)
- clif_displaymessage(fd, msg_txt(241));
+ clif->displaymessage(fd, msg_txt(241));
else {
- clif_displaymessage(fd, msg_txt(292));
+ clif->displaymessage(fd, msg_txt(292));
pc_stop_attack(sd);
}
return 0;
@@ -5099,9 +5099,9 @@ ACMD_FUNC(killable)
sd->state.killable = !sd->state.killable;
if(sd->state.killable)
- clif_displaymessage(fd, msg_txt(242));
+ clif->displaymessage(fd, msg_txt(242));
else {
- clif_displaymessage(fd, msg_txt(288));
+ clif->displaymessage(fd, msg_txt(288));
map_foreachinrange(atcommand_stopattack,&sd->bl, AREA_SIZE, BL_CHAR, sd->bl.id);
}
return 0;
@@ -5115,7 +5115,7 @@ ACMD_FUNC(skillon)
{
nullpo_retr(-1, sd);
map[sd->bl.m].flag.noskill = 0;
- clif_displaymessage(fd, msg_txt(244));
+ clif->displaymessage(fd, msg_txt(244));
return 0;
}
@@ -5127,7 +5127,7 @@ ACMD_FUNC(skilloff)
{
nullpo_retr(-1, sd);
map[sd->bl.m].flag.noskill = 1;
- clif_displaymessage(fd, msg_txt(243));
+ clif->displaymessage(fd, msg_txt(243));
return 0;
}
@@ -5143,28 +5143,28 @@ ACMD_FUNC(npcmove)
memset(atcmd_player_name, '\0', sizeof atcmd_player_name);
if (!message || !*message || sscanf(message, "%d %d %23[^\n]", &x, &y, atcmd_player_name) < 3) {
- clif_displaymessage(fd, msg_txt(1153)); // Usage: @npcmove <X> <Y> <npc_name>
+ clif->displaymessage(fd, msg_txt(1153)); // Usage: @npcmove <X> <Y> <npc_name>
return -1;
}
if ((nd = npc_name2id(atcmd_player_name)) == NULL)
{
- clif_displaymessage(fd, msg_txt(111)); // This NPC doesn't exist.
+ clif->displaymessage(fd, msg_txt(111)); // This NPC doesn't exist.
return -1;
}
if ((m=nd->bl.m) < 0 || nd->bl.prev == NULL)
{
- clif_displaymessage(fd, msg_txt(1154)); // NPC is not on this map.
+ clif->displaymessage(fd, msg_txt(1154)); // NPC is not on this map.
return -1; //Not on a map.
}
x = cap_value(x, 0, map[m].xs-1);
y = cap_value(y, 0, map[m].ys-1);
- map_foreachinrange(clif_outsight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl);
+ map_foreachinrange(clif->outsight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl);
map_moveblock(&nd->bl, x, y, gettick());
- map_foreachinrange(clif_insight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl);
- clif_displaymessage(fd, msg_txt(1155)); // NPC moved.
+ map_foreachinrange(clif->insight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl);
+ clif->displaymessage(fd, msg_txt(1155)); // NPC moved.
return 0;
}
@@ -5184,7 +5184,7 @@ ACMD_FUNC(addwarp)
memset(warpname, '\0', sizeof(warpname));
if (!message || !*message || sscanf(message, "%31s %d %d %23[^\n]", mapname, &x, &y, warpname) < 4) {
- clif_displaymessage(fd, msg_txt(1156)); // Usage: @addwarp <mapname> <X> <Y> <npc name>
+ clif->displaymessage(fd, msg_txt(1156)); // Usage: @addwarp <mapname> <X> <Y> <npc name>
return -1;
}
@@ -5192,7 +5192,7 @@ ACMD_FUNC(addwarp)
if( m == 0 )
{
sprintf(atcmd_output, msg_txt(1157), mapname); // Unknown map '%s'.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return -1;
}
@@ -5201,7 +5201,7 @@ ACMD_FUNC(addwarp)
return -1;
sprintf(atcmd_output, msg_txt(1158), nd->exname); // New warp NPC '%s' created.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
@@ -5219,22 +5219,22 @@ ACMD_FUNC(follow)
return -1;
pc_stop_following (sd);
- clif_displaymessage(fd, msg_txt(1159)); // Follow mode OFF.
+ clif->displaymessage(fd, msg_txt(1159)); // Follow mode OFF.
return 0;
}
if ( (pl_sd = map_nick2sd((char *)message)) == NULL )
{
- clif_displaymessage(fd, msg_txt(3)); // Character not found.
+ clif->displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
if (sd->followtarget == pl_sd->bl.id) {
pc_stop_following (sd);
- clif_displaymessage(fd, msg_txt(1159)); // Follow mode OFF.
+ clif->displaymessage(fd, msg_txt(1159)); // Follow mode OFF.
} else {
pc_follow(sd, pl_sd->bl.id);
- clif_displaymessage(fd, msg_txt(1160)); // Follow mode ON.
+ clif->displaymessage(fd, msg_txt(1160)); // Follow mode ON.
}
return 0;
@@ -5271,7 +5271,7 @@ ACMD_FUNC(storeall)
if (sd->state.storage_flag != 1)
{ //Open storage.
if( storage_storageopen(sd) == 1 ) {
- clif_displaymessage(fd, msg_txt(1161)); // You currently cannot open your storage.
+ clif->displaymessage(fd, msg_txt(1161)); // You currently cannot open your storage.
return -1;
}
}
@@ -5285,7 +5285,7 @@ ACMD_FUNC(storeall)
}
storage_storageclose(sd);
- clif_displaymessage(fd, msg_txt(1162)); // All items stored.
+ clif->displaymessage(fd, msg_txt(1162)); // All items stored.
return 0;
}
@@ -5295,7 +5295,7 @@ ACMD_FUNC(clearstorage)
nullpo_retr(-1, sd);
if (sd->state.storage_flag == 1) {
- clif_displaymessage(fd, msg_txt(250));
+ clif->displaymessage(fd, msg_txt(250));
return -1;
}
@@ -5305,7 +5305,7 @@ ACMD_FUNC(clearstorage)
}
storage_storageclose(sd);
- clif_displaymessage(fd, msg_txt(1394)); // Your storage was cleaned.
+ clif->displaymessage(fd, msg_txt(1394)); // Your storage was cleaned.
return 0;
}
@@ -5319,17 +5319,17 @@ ACMD_FUNC(cleargstorage)
g = guild_search(sd->status.guild_id);
if (g == NULL) {
- clif_displaymessage(fd, msg_txt(43));
+ clif->displaymessage(fd, msg_txt(43));
return -1;
}
if (sd->state.storage_flag == 1) {
- clif_displaymessage(fd, msg_txt(250));
+ clif->displaymessage(fd, msg_txt(250));
return -1;
}
if (sd->state.storage_flag == 2) {
- clif_displaymessage(fd, msg_txt(251));
+ clif->displaymessage(fd, msg_txt(251));
return -1;
}
@@ -5346,7 +5346,7 @@ ACMD_FUNC(cleargstorage)
storage_guild_storageclose(sd);
gstorage->lock = 0; // Cleaning done, release lock
- clif_displaymessage(fd, msg_txt(1395)); // Your guild storage was cleaned.
+ clif->displaymessage(fd, msg_txt(1395)); // Your guild storage was cleaned.
return 0;
}
@@ -5356,7 +5356,7 @@ ACMD_FUNC(clearcart)
nullpo_retr(-1, sd);
if (pc_iscarton(sd) == 0) {
- clif_displaymessage(fd, msg_txt(1396)); // You do not have a cart to be cleaned.
+ clif->displaymessage(fd, msg_txt(1396)); // You do not have a cart to be cleaned.
return -1;
}
@@ -5368,10 +5368,10 @@ ACMD_FUNC(clearcart)
if(sd->status.cart[i].nameid > 0)
pc_cart_delitem(sd, i, sd->status.cart[i].amount, 1, LOG_TYPE_OTHER);
- clif_clearcart(fd);
- clif_updatestatus(sd,SP_CARTINFO);
+ clif->clearcart(fd);
+ clif->updatestatus(sd,SP_CARTINFO);
- clif_displaymessage(fd, msg_txt(1397)); // Your cart was cleaned.
+ clif->displaymessage(fd, msg_txt(1397)); // Your cart was cleaned.
return 0;
}
@@ -5391,7 +5391,7 @@ ACMD_FUNC(skillid) {
nullpo_retr(-1, sd);
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1163)); // Please enter a skill name to look up (usage: @skillid <skill name>).
+ clif->displaymessage(fd, msg_txt(1163)); // Please enter a skill name to look up (usage: @skillid <skill name>).
return -1;
}
@@ -5403,7 +5403,7 @@ ACMD_FUNC(skillid) {
idx = skill->get_index(db_data2i(data));
if (strnicmp(key.str, message, skillen) == 0 || strnicmp(skill_db[idx].desc, message, skillen) == 0) {
sprintf(atcmd_output, msg_txt(1164), db_data2i(data), skill_db[idx].desc, key.str); // skill %d: %s (%s)
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
} else if ( found < MAX_SKILLID_PARTIAL_RESULTS && ( stristr(key.str,message) || stristr(skill_db[idx].desc,message) ) ) {
snprintf(partials[found++], MAX_SKILLID_PARTIAL_RESULTS_LEN, msg_txt(1164), db_data2i(data), skill_db[idx].desc, key.str);
}
@@ -5413,11 +5413,11 @@ ACMD_FUNC(skillid) {
if( found ) {
sprintf(atcmd_output, msg_txt(1398), found); // -- Displaying first %d partial matches
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
for(i = 0; i < found; i++) { /* partials */
- clif_displaymessage(fd, partials[i]);
+ clif->displaymessage(fd, partials[i]);
}
return 0;
@@ -5437,19 +5437,19 @@ ACMD_FUNC(useskill)
nullpo_retr(-1, sd);
if(!message || !*message || sscanf(message, "%hu %hu %23[^\n]", &skill_id, &skill_lv, target) != 3) {
- clif_displaymessage(fd, msg_txt(1165)); // Usage: @useskill <skill ID> <skill level> <target>
+ clif->displaymessage(fd, msg_txt(1165)); // Usage: @useskill <skill ID> <skill level> <target>
return -1;
}
if(!strcmp(target,"self")) pl_sd = sd; //quick keyword
else if ( (pl_sd = map_nick2sd(target)) == NULL ){
- clif_displaymessage(fd, msg_txt(3)); // Character not found.
+ clif->displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
{
- clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
+ clif->displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
return -1;
}
@@ -5482,14 +5482,14 @@ ACMD_FUNC(displayskill)
if (!message || !*message || sscanf(message, "%hu %hu", &skill_id, &skill_lv) < 1)
{
- clif_displaymessage(fd, msg_txt(1166)); // Usage: @displayskill <skill ID> {<skill level>}
+ clif->displaymessage(fd, msg_txt(1166)); // Usage: @displayskill <skill ID> {<skill level>}
return -1;
}
status = status_get_status_data(&sd->bl);
tick = gettick();
- clif_skill_damage(&sd->bl,&sd->bl, tick, status->amotion, status->dmotion, 1, 1, skill_id, skill_lv, 5);
- clif_skill_nodamage(&sd->bl, &sd->bl, skill_id, skill_lv, 1);
- clif_skill_poseffect(&sd->bl, skill_id, skill_lv, sd->bl.x, sd->bl.y, tick);
+ clif->skill_damage(&sd->bl,&sd->bl, tick, status->amotion, status->dmotion, 1, 1, skill_id, skill_lv, 5);
+ clif->skill_nodamage(&sd->bl, &sd->bl, skill_id, skill_lv, 1);
+ clif->skill_poseffect(&sd->bl, skill_id, skill_lv, sd->bl.x, sd->bl.y, tick);
return 0;
}
@@ -5507,13 +5507,13 @@ ACMD_FUNC(skilltree)
nullpo_retr(-1, sd);
if(!message || !*message || sscanf(message, "%hu %23[^\r\n]", &skill_id, target) != 2) {
- clif_displaymessage(fd, msg_txt(1167)); // Usage: @skilltree <skill ID> <target>
+ clif->displaymessage(fd, msg_txt(1167)); // Usage: @skilltree <skill ID> <target>
return -1;
}
if ( (pl_sd = map_nick2sd(target)) == NULL )
{
- clif_displaymessage(fd, msg_txt(3)); // Character not found.
+ clif->displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
@@ -5521,12 +5521,12 @@ ACMD_FUNC(skilltree)
c = pc_mapid2jobid(c, pl_sd->status.sex);
sprintf(atcmd_output, msg_txt(1168), job_name(c), pc_checkskill(pl_sd, NV_BASIC)); // Player is using %s skill tree (%d basic points).
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
ARR_FIND( 0, MAX_SKILL_TREE, j, skill_tree[c][j].id == 0 || skill_tree[c][j].id == skill_id );
if( j == MAX_SKILL_TREE || skill_tree[c][j].id == 0 )
{
- clif_displaymessage(fd, msg_txt(1169)); // The player cannot use that skill.
+ clif->displaymessage(fd, msg_txt(1169)); // The player cannot use that skill.
return 0;
}
@@ -5538,12 +5538,12 @@ ACMD_FUNC(skilltree)
if( ent->need[j].id && pc_checkskill(sd,ent->need[j].id) < ent->need[j].lv)
{
sprintf(atcmd_output, msg_txt(1170), ent->need[j].lv, skill_db[ent->need[j].id].desc); // Player requires level %d of skill %s.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
meets = 0;
}
}
if (meets == 1) {
- clif_displaymessage(fd, msg_txt(1171)); // The player meets all the requirements for that skill.
+ clif->displaymessage(fd, msg_txt(1171)); // The player meets all the requirements for that skill.
}
return 0;
@@ -5564,7 +5564,7 @@ void getring (struct map_session_data* sd)
item_tmp.card[3] = sd->status.partner_id >> 16;
if((flag = pc_additem(sd,&item_tmp,1,LOG_TYPE_COMMAND))) {
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
@@ -5581,24 +5581,24 @@ ACMD_FUNC(marry)
nullpo_retr(-1, sd);
if (!message || !*message || sscanf(message, "%23s", player_name) != 1) {
- clif_displaymessage(fd, msg_txt(1172)); // Usage: @marry <char name>
+ clif->displaymessage(fd, msg_txt(1172)); // Usage: @marry <char name>
return -1;
}
if ((pl_sd = map_nick2sd(player_name)) == NULL) {
- clif_displaymessage(fd, msg_txt(3));
+ clif->displaymessage(fd, msg_txt(3));
return -1;
}
if (pc_marriage(sd, pl_sd) == 0) {
- clif_displaymessage(fd, msg_txt(1173)); // They are married... wish them well.
- clif_wedding_effect(&pl_sd->bl); //wedding effect and music [Lupus]
+ clif->displaymessage(fd, msg_txt(1173)); // They are married... wish them well.
+ clif->wedding_effect(&pl_sd->bl); //wedding effect and music [Lupus]
getring(sd); // Auto-give named rings (Aru)
getring(pl_sd);
return 0;
}
- clif_displaymessage(fd, msg_txt(1174)); // The two cannot wed because one is either a baby or already married.
+ clif->displaymessage(fd, msg_txt(1174)); // The two cannot wed because one is either a baby or already married.
return -1;
}
@@ -5612,12 +5612,12 @@ ACMD_FUNC(divorce)
if (pc_divorce(sd) != 0) {
sprintf(atcmd_output, msg_txt(1175), sd->status.name); // '%s' is not married.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return -1;
}
sprintf(atcmd_output, msg_txt(1176), sd->status.name); // '%s' and his/her partner are now divorced.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
@@ -5630,8 +5630,8 @@ ACMD_FUNC(changelook)
int pos[7] = { LOOK_HEAD_TOP,LOOK_HEAD_MID,LOOK_HEAD_BOTTOM,LOOK_WEAPON,LOOK_SHIELD,LOOK_SHOES,LOOK_ROBE };
if((i = sscanf(message, "%d %d", &j, &k)) < 1) {
- clif_displaymessage(fd, msg_txt(1177)); // Usage: @changelook {<position>} <view id>
- clif_displaymessage(fd, msg_txt(1178)); // Position: 1-Top 2-Middle 3-Bottom 4-Weapon 5-Shield 6-Shoes 7-Robe
+ clif->displaymessage(fd, msg_txt(1177)); // Usage: @changelook {<position>} <view id>
+ clif->displaymessage(fd, msg_txt(1178)); // Position: 1-Top 2-Middle 3-Bottom 4-Weapon 5-Shield 6-Shoes 7-Robe
return -1;
} else if ( i == 2 ) {
if (j < 1 || j > 7)
@@ -5642,7 +5642,7 @@ ACMD_FUNC(changelook)
j = LOOK_HEAD_TOP;
}
- clif_changelook(&sd->bl,j,k);
+ clif->changelook(&sd->bl,j,k);
return 0;
}
@@ -5656,17 +5656,17 @@ ACMD_FUNC(autotrade)
nullpo_retr(-1, sd);
if( map[sd->bl.m].flag.autotrade != battle_config.autotrade_mapflag ) {
- clif_displaymessage(fd, msg_txt(1179)); // Autotrade is not allowed on this map.
+ clif->displaymessage(fd, msg_txt(1179)); // Autotrade is not allowed on this map.
return -1;
}
if( pc_isdead(sd) ) {
- clif_displaymessage(fd, msg_txt(1180)); // You cannot autotrade when dead.
+ clif->displaymessage(fd, msg_txt(1180)); // You cannot autotrade when dead.
return -1;
}
if( !sd->state.vending && !sd->state.buyingstore ) { //check if player is vending or buying
- clif_displaymessage(fd, msg_txt(549)); // "You should have a shop open to use @autotrade."
+ clif->displaymessage(fd, msg_txt(549)); // "You should have a shop open to use @autotrade."
return -1;
}
@@ -5675,7 +5675,7 @@ ACMD_FUNC(autotrade)
int timeout = atoi(message);
status_change_start(&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0);
}
- clif_authfail_fd(sd->fd, 15);
+ clif->authfail_fd(sd->fd, 15);
return 0;
}
@@ -5691,22 +5691,22 @@ ACMD_FUNC(changegm)
nullpo_retr(-1, sd);
if (sd->status.guild_id == 0 || (g = guild_search(sd->status.guild_id)) == NULL || strcmp(g->master,sd->status.name)) {
- clif_displaymessage(fd, msg_txt(1181)); // You need to be a Guild Master to use this command.
+ clif->displaymessage(fd, msg_txt(1181)); // You need to be a Guild Master to use this command.
return -1;
}
if( map[sd->bl.m].flag.guildlock || map[sd->bl.m].flag.gvg_castle ) {
- clif_displaymessage(fd, msg_txt(1182)); // You cannot change guild leaders on this map.
+ clif->displaymessage(fd, msg_txt(1182)); // You cannot change guild leaders on this map.
return -1;
}
if( !message[0] ) {
- clif_displaymessage(fd, msg_txt(1183)); // Usage: @changegm <guild_member_name>
+ clif->displaymessage(fd, msg_txt(1183)); // Usage: @changegm <guild_member_name>
return -1;
}
if((pl_sd=map_nick2sd((char *) message)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) {
- clif_displaymessage(fd, msg_txt(1184)); // Target character must be online and be a guild member.
+ clif->displaymessage(fd, msg_txt(1184)); // Target character must be online and be a guild member.
return -1;
}
@@ -5724,7 +5724,7 @@ ACMD_FUNC(changeleader)
if( !message[0] )
{
- clif_displaymessage(fd, msg_txt(1185)); // Usage: @changeleader <party_member_name>
+ clif->displaymessage(fd, msg_txt(1185)); // Usage: @changeleader <party_member_name>
return -1;
}
@@ -5746,7 +5746,7 @@ ACMD_FUNC(partyoption)
if (sd->status.party_id == 0 || (p = party_search(sd->status.party_id)) == NULL)
{
- clif_displaymessage(fd, msg_txt(282));
+ clif->displaymessage(fd, msg_txt(282));
return -1;
}
@@ -5756,13 +5756,13 @@ ACMD_FUNC(partyoption)
if (!p->party.member[mi].leader)
{
- clif_displaymessage(fd, msg_txt(282));
+ clif->displaymessage(fd, msg_txt(282));
return -1;
}
if(!message || !*message || sscanf(message, "%15s %15s", w1, w2) < 2)
{
- clif_displaymessage(fd, msg_txt(1186)); // Usage: @partyoption <pickup share: yes/no> <item distribution: yes/no>
+ clif->displaymessage(fd, msg_txt(1186)); // Usage: @partyoption <pickup share: yes/no> <item distribution: yes/no>
return -1;
}
@@ -5772,7 +5772,7 @@ ACMD_FUNC(partyoption)
if (option != p->party.item)
party_changeoption(sd, p->party.exp, option);
else
- clif_displaymessage(fd, msg_txt(286));
+ clif->displaymessage(fd, msg_txt(286));
return 0;
}
@@ -5803,9 +5803,9 @@ ACMD_FUNC(autoloot)
sd->state.autoloot = rate;
if (sd->state.autoloot) {
snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1187),((double)sd->state.autoloot)/100.); // Autolooting items with drop rates of %0.02f%% and below.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}else
- clif_displaymessage(fd, msg_txt(1188)); // Autoloot is now off.
+ clif->displaymessage(fd, msg_txt(1188)); // Autoloot is now off.
return 0;
}
@@ -5838,7 +5838,7 @@ ACMD_FUNC(autolootitem)
item_data = itemdb_searchname(message);
if (!item_data) {
// No items founds in the DB with Id or Name
- clif_displaymessage(fd, msg_txt(1189)); // Item not found.
+ clif->displaymessage(fd, msg_txt(1189)); // Item not found.
return -1;
}
}
@@ -5847,28 +5847,28 @@ ACMD_FUNC(autolootitem)
case 1:
ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == item_data->nameid);
if (i != AUTOLOOTITEM_SIZE) {
- clif_displaymessage(fd, msg_txt(1190)); // You're already autolooting this item.
+ clif->displaymessage(fd, msg_txt(1190)); // You're already autolooting this item.
return -1;
}
ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == 0);
if (i == AUTOLOOTITEM_SIZE) {
- clif_displaymessage(fd, msg_txt(1191)); // Your autolootitem list is full. Remove some items first with @autolootid -<item name or ID>.
+ clif->displaymessage(fd, msg_txt(1191)); // Your autolootitem list is full. Remove some items first with @autolootid -<item name or ID>.
return -1;
}
sd->state.autolootid[i] = item_data->nameid; // Autoloot Activated
sprintf(atcmd_output, msg_txt(1192), item_data->name, item_data->jname, item_data->nameid); // Autolooting item: '%s'/'%s' {%d}
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sd->state.autolooting = 1;
break;
case 2:
ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == item_data->nameid);
if (i == AUTOLOOTITEM_SIZE) {
- clif_displaymessage(fd, msg_txt(1193)); // You're currently not autolooting this item.
+ clif->displaymessage(fd, msg_txt(1193)); // You're currently not autolooting this item.
return -1;
}
sd->state.autolootid[i] = 0;
sprintf(atcmd_output, msg_txt(1194), item_data->name, item_data->jname, item_data->nameid); // Removed item: '%s'/'%s' {%d} from your autolootitem list.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] != 0);
if (i == AUTOLOOTITEM_SIZE) {
sd->state.autolooting = 0;
@@ -5876,14 +5876,14 @@ ACMD_FUNC(autolootitem)
break;
case 3:
sprintf(atcmd_output, msg_txt(1195), AUTOLOOTITEM_SIZE); // You can have %d items on your autolootitem list.
- clif_displaymessage(fd, atcmd_output);
- clif_displaymessage(fd, msg_txt(1196)); // To add an item to the list, use "@alootid +<item name or ID>". To remove an item, use "@alootid -<item name or ID>".
- clif_displaymessage(fd, msg_txt(1197)); // "@alootid reset" will clear your autolootitem list.
+ clif->displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, msg_txt(1196)); // To add an item to the list, use "@alootid +<item name or ID>". To remove an item, use "@alootid -<item name or ID>".
+ clif->displaymessage(fd, msg_txt(1197)); // "@alootid reset" will clear your autolootitem list.
ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] != 0);
if (i == AUTOLOOTITEM_SIZE) {
- clif_displaymessage(fd, msg_txt(1198)); // Your autolootitem list is empty.
+ clif->displaymessage(fd, msg_txt(1198)); // Your autolootitem list is empty.
} else {
- clif_displaymessage(fd, msg_txt(1199)); // Items on your autolootitem list:
+ clif->displaymessage(fd, msg_txt(1199)); // Items on your autolootitem list:
for(i = 0; i < AUTOLOOTITEM_SIZE; i++)
{
if (sd->state.autolootid[i] == 0)
@@ -5893,13 +5893,13 @@ ACMD_FUNC(autolootitem)
continue;
}
sprintf(atcmd_output, "'%s'/'%s' {%d}", item_data->name, item_data->jname, item_data->nameid);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
}
break;
case 4:
memset(sd->state.autolootid, 0, sizeof(sd->state.autolootid));
- clif_displaymessage(fd, msg_txt(1200)); // Your autolootitem list has been reset.
+ clif->displaymessage(fd, msg_txt(1200)); // Your autolootitem list has been reset.
sd->state.autolooting = 0;
break;
}
@@ -5916,12 +5916,12 @@ ACMD_FUNC(autolootitem)
// nullpo_retr(-1, sd);
// if (map[sd->bl.m].flag.rain) {
// map[sd->bl.m].flag.rain=0;
-// clif_weather(sd->bl.m);
-// clif_displaymessage(fd, msg_txt(1201)); // The rain has stopped.
+// clif->weather(sd->bl.m);
+// clif->displaymessage(fd, msg_txt(1201)); // The rain has stopped.
// } else {
// map[sd->bl.m].flag.rain=1;
-// clif_weather(sd->bl.m);
-// clif_displaymessage(fd, msg_txt(1202)); // It has started to rain.
+// clif->weather(sd->bl.m);
+// clif->displaymessage(fd, msg_txt(1202)); // It has started to rain.
// }
// return 0;
//}
@@ -5934,12 +5934,12 @@ ACMD_FUNC(snow)
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.snow) {
map[sd->bl.m].flag.snow=0;
- clif_weather(sd->bl.m);
- clif_displaymessage(fd, msg_txt(1203)); // Snow has stopped falling.
+ clif->weather(sd->bl.m);
+ clif->displaymessage(fd, msg_txt(1203)); // Snow has stopped falling.
} else {
map[sd->bl.m].flag.snow=1;
- clif_weather(sd->bl.m);
- clif_displaymessage(fd, msg_txt(1204)); // It has started to snow.
+ clif->weather(sd->bl.m);
+ clif->displaymessage(fd, msg_txt(1204)); // It has started to snow.
}
return 0;
@@ -5953,12 +5953,12 @@ ACMD_FUNC(sakura)
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.sakura) {
map[sd->bl.m].flag.sakura=0;
- clif_weather(sd->bl.m);
- clif_displaymessage(fd, msg_txt(1205)); // Cherry tree leaves no longer fall.
+ clif->weather(sd->bl.m);
+ clif->displaymessage(fd, msg_txt(1205)); // Cherry tree leaves no longer fall.
} else {
map[sd->bl.m].flag.sakura=1;
- clif_weather(sd->bl.m);
- clif_displaymessage(fd, msg_txt(1206)); // Cherry tree leaves have begun to fall.
+ clif->weather(sd->bl.m);
+ clif->displaymessage(fd, msg_txt(1206)); // Cherry tree leaves have begun to fall.
}
return 0;
}
@@ -5971,12 +5971,12 @@ ACMD_FUNC(clouds)
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.clouds) {
map[sd->bl.m].flag.clouds=0;
- clif_weather(sd->bl.m);
- clif_displaymessage(fd, msg_txt(1207)); // The clouds has disappear.
+ clif->weather(sd->bl.m);
+ clif->displaymessage(fd, msg_txt(1207)); // The clouds has disappear.
} else {
map[sd->bl.m].flag.clouds=1;
- clif_weather(sd->bl.m);
- clif_displaymessage(fd, msg_txt(1208)); // Clouds appear.
+ clif->weather(sd->bl.m);
+ clif->displaymessage(fd, msg_txt(1208)); // Clouds appear.
}
return 0;
@@ -5990,12 +5990,12 @@ ACMD_FUNC(clouds2)
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.clouds2) {
map[sd->bl.m].flag.clouds2=0;
- clif_weather(sd->bl.m);
- clif_displaymessage(fd, msg_txt(1209)); // The alternative clouds disappear.
+ clif->weather(sd->bl.m);
+ clif->displaymessage(fd, msg_txt(1209)); // The alternative clouds disappear.
} else {
map[sd->bl.m].flag.clouds2=1;
- clif_weather(sd->bl.m);
- clif_displaymessage(fd, msg_txt(1210)); // Alternative clouds appear.
+ clif->weather(sd->bl.m);
+ clif->displaymessage(fd, msg_txt(1210)); // Alternative clouds appear.
}
return 0;
@@ -6009,12 +6009,12 @@ ACMD_FUNC(fog)
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.fog) {
map[sd->bl.m].flag.fog=0;
- clif_weather(sd->bl.m);
- clif_displaymessage(fd, msg_txt(1211)); // The fog has gone.
+ clif->weather(sd->bl.m);
+ clif->displaymessage(fd, msg_txt(1211)); // The fog has gone.
} else {
map[sd->bl.m].flag.fog=1;
- clif_weather(sd->bl.m);
- clif_displaymessage(fd, msg_txt(1212)); // Fog hangs over.
+ clif->weather(sd->bl.m);
+ clif->displaymessage(fd, msg_txt(1212)); // Fog hangs over.
}
return 0;
}
@@ -6027,12 +6027,12 @@ ACMD_FUNC(leaves)
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.leaves) {
map[sd->bl.m].flag.leaves=0;
- clif_weather(sd->bl.m);
- clif_displaymessage(fd, msg_txt(1213)); // Leaves no longer fall.
+ clif->weather(sd->bl.m);
+ clif->displaymessage(fd, msg_txt(1213)); // Leaves no longer fall.
} else {
map[sd->bl.m].flag.leaves=1;
- clif_weather(sd->bl.m);
- clif_displaymessage(fd, msg_txt(1214)); // Fallen leaves fall.
+ clif->weather(sd->bl.m);
+ clif->displaymessage(fd, msg_txt(1214)); // Fallen leaves fall.
}
return 0;
@@ -6046,12 +6046,12 @@ ACMD_FUNC(fireworks)
nullpo_retr(-1, sd);
if (map[sd->bl.m].flag.fireworks) {
map[sd->bl.m].flag.fireworks=0;
- clif_weather(sd->bl.m);
- clif_displaymessage(fd, msg_txt(1215)); // Fireworks have ended.
+ clif->weather(sd->bl.m);
+ clif->displaymessage(fd, msg_txt(1215)); // Fireworks have ended.
} else {
map[sd->bl.m].flag.fireworks=1;
- clif_weather(sd->bl.m);
- clif_displaymessage(fd, msg_txt(1216)); // Fireworks have launched.
+ clif->weather(sd->bl.m);
+ clif->displaymessage(fd, msg_txt(1216)); // Fireworks have launched.
}
return 0;
@@ -6074,8 +6074,8 @@ ACMD_FUNC(clearweather)
map[sd->bl.m].flag.fog=0;
map[sd->bl.m].flag.fireworks=0;
map[sd->bl.m].flag.leaves=0;
- clif_weather(sd->bl.m);
- clif_displaymessage(fd, msg_txt(291));
+ clif->weather(sd->bl.m);
+ clif->displaymessage(fd, msg_txt(291));
return 0;
}
@@ -6090,14 +6090,14 @@ ACMD_FUNC(sound)
memset(sound_file, '\0', sizeof(sound_file));
if(!message || !*message || sscanf(message, "%99[^\n]", sound_file) < 1) {
- clif_displaymessage(fd, msg_txt(1217)); // Please enter a sound filename (usage: @sound <filename>).
+ clif->displaymessage(fd, msg_txt(1217)); // Please enter a sound filename (usage: @sound <filename>).
return -1;
}
if(strstr(sound_file, ".wav") == NULL)
strcat(sound_file, ".wav");
- clif_soundeffectall(&sd->bl, sound_file, 0, AREA);
+ clif->soundeffectall(&sd->bl, sound_file, 0, AREA);
return 0;
}
@@ -6115,7 +6115,7 @@ ACMD_FUNC(mobsearch)
nullpo_retr(-1, sd);
if (!message || !*message || sscanf(message, "%99[^\n]", mob_name) < 1) {
- clif_displaymessage(fd, msg_txt(1218)); // Please enter a monster name (usage: @mobsearch <monster name>).
+ clif->displaymessage(fd, msg_txt(1218)); // Please enter a monster name (usage: @mobsearch <monster name>).
return -1;
}
@@ -6123,7 +6123,7 @@ ACMD_FUNC(mobsearch)
mob_id = mobdb_searchname(mob_name);
if(mob_id > 0 && mobdb_checkid(mob_id) == 0){
snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1219),mob_name); // Invalid mob ID %s!
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return -1;
}
if(mob_id == atoi(mob_name) && mob_db(mob_id)->jname)
@@ -6131,7 +6131,7 @@ ACMD_FUNC(mobsearch)
// strcpy(mob_name,mob_db(mob_id)->name); // --en--
snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1220), mob_name, mapindex_id2name(sd->mapindex)); // Mob Search... %s %s
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
it = mapit_geteachmob();
for(;;)
@@ -6150,7 +6150,7 @@ ACMD_FUNC(mobsearch)
snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%3d:%3d] %s", number, md->bl.x, md->bl.y, md->name);
else
snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%s] %s", number, "dead", md->name);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
mapit_free(it);
@@ -6172,7 +6172,7 @@ static int atcommand_cleanfloor_sub(struct block_list *bl, va_list ap)
ACMD_FUNC(cleanmap)
{
map_foreachinmap(atcommand_cleanfloor_sub, sd->bl.m, BL_ITEM);
- clif_displaymessage(fd, msg_txt(1221)); // All dropped items have been cleaned up.
+ clif->displaymessage(fd, msg_txt(1221)); // All dropped items have been cleaned up.
return 0;
}
@@ -6190,7 +6190,7 @@ ACMD_FUNC(cleanarea)
map_foreachinarea(atcommand_cleanfloor_sub, sd->bl.m, x0, y0, x1, y1, BL_ITEM);
}
- clif_displaymessage(fd, msg_txt(1221)); // All dropped items have been cleaned up.
+ clif->displaymessage(fd, msg_txt(1221)); // All dropped items have been cleaned up.
return 0;
}
@@ -6212,27 +6212,27 @@ ACMD_FUNC(npctalk)
if(!ifcolor) {
if (!message || !*message || sscanf(message, "%23[^,], %99[^\n]", name, mes) < 2) {
- clif_displaymessage(fd, msg_txt(1222)); // Please enter the correct parameters (usage: @npctalk <npc name>, <message>).
+ clif->displaymessage(fd, msg_txt(1222)); // Please enter the correct parameters (usage: @npctalk <npc name>, <message>).
return -1;
}
}
else {
if (!message || !*message || sscanf(message, "%lx %23[^,], %99[^\n]", &color, name, mes) < 3) {
- clif_displaymessage(fd, msg_txt(1223)); // Please enter the correct parameters (usage: @npctalkc <color> <npc name>, <message>).
+ clif->displaymessage(fd, msg_txt(1223)); // Please enter the correct parameters (usage: @npctalkc <color> <npc name>, <message>).
return -1;
}
}
if (!(nd = npc_name2id(name))) {
- clif_displaymessage(fd, msg_txt(111)); // This NPC doesn't exist
+ clif->displaymessage(fd, msg_txt(111)); // This NPC doesn't exist
return -1;
}
strtok(name, "#"); // discard extra name identifier if present
snprintf(temp, sizeof(temp), "%s : %s", name, mes);
- if(ifcolor) clif_messagecolor(&nd->bl,color,temp);
- else clif_message(&nd->bl, temp);
+ if(ifcolor) clif->messagecolor(&nd->bl,color,temp);
+ else clif->message(&nd->bl, temp);
return 0;
}
@@ -6252,7 +6252,7 @@ ACMD_FUNC(pettalk)
if(!sd->status.pet_id || !(pd=sd->pd))
{
- clif_displaymessage(fd, msg_txt(184));
+ clif->displaymessage(fd, msg_txt(184));
return -1;
}
@@ -6262,7 +6262,7 @@ ACMD_FUNC(pettalk)
return -1;
if (!message || !*message || sscanf(message, "%99[^\n]", mes) < 1) {
- clif_displaymessage(fd, msg_txt(1224)); // Please enter a message (usage: @pettalk <message>).
+ clif->displaymessage(fd, msg_txt(1224)); // Please enter a message (usage: @pettalk <message>).
return -1;
}
@@ -6290,13 +6290,13 @@ ACMD_FUNC(pettalk)
}
sd->emotionlasttime = time(NULL);
- clif_emotion(&pd->bl, i);
+ clif->emotion(&pd->bl, i);
return 0;
}
}
snprintf(temp, sizeof temp ,"%s : %s", pd->pet.name, mes);
- clif_message(&pd->bl, temp);
+ clif->message(&pd->bl, temp);
return 0;
}
@@ -6337,12 +6337,12 @@ ACMD_FUNC(users)
continue;// empty
safesnprintf(buf, sizeof(buf), "%s: %d (%.2f%%)", mapindex_id2name(i), users[i], (float)(100.0f*users[i]/users_all));
- clif_displaymessage(sd->fd, buf);
+ clif->displaymessage(sd->fd, buf);
}
// display overall count
safesnprintf(buf, sizeof(buf), "all: %d", users_all);
- clif_displaymessage(sd->fd, buf);
+ clif->displaymessage(sd->fd, buf);
return 0;
}
@@ -6355,7 +6355,7 @@ ACMD_FUNC(reset)
pc_resetstate(sd);
pc_resetskill(sd,1);
sprintf(atcmd_output, msg_txt(208), sd->status.name); // '%s' skill and stats points reseted!
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
@@ -6374,7 +6374,7 @@ ACMD_FUNC(summon)
if (!message || !*message || sscanf(message, "%23s %d", name, &duration) < 1)
{
- clif_displaymessage(fd, msg_txt(1225)); // Please enter a monster name (usage: @summon <monster name> {duration}).
+ clif->displaymessage(fd, msg_txt(1225)); // Please enter a monster name (usage: @summon <monster name> {duration}).
return -1;
}
@@ -6387,7 +6387,7 @@ ACMD_FUNC(summon)
mob_id = mobdb_searchname(name);
if(mob_id == 0 || mobdb_checkid(mob_id) == 0)
{
- clif_displaymessage(fd, msg_txt(40)); // Invalid monster ID or name.
+ clif->displaymessage(fd, msg_txt(40)); // Invalid monster ID or name.
return -1;
}
@@ -6399,11 +6399,11 @@ ACMD_FUNC(summon)
md->master_id=sd->bl.id;
md->special_state.ai=1;
md->deletetimer=add_timer(tick+(duration*60000),mob_timer_delete,md->bl.id,0);
- clif_specialeffect(&md->bl,344,AREA);
+ clif->specialeffect(&md->bl,344,AREA);
mob_spawn(md);
sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000);
- clif_skill_poseffect(&sd->bl,AM_CALLHOMUN,1,md->bl.x,md->bl.y,tick);
- clif_displaymessage(fd, msg_txt(39)); // All monster summoned!
+ clif->skill_poseffect(&sd->bl,AM_CALLHOMUN,1,md->bl.x,md->bl.y,tick);
+ clif->displaymessage(fd, msg_txt(39)); // All monster summoned!
return 0;
}
@@ -6419,19 +6419,19 @@ ACMD_FUNC(adjgroup)
nullpo_retr(-1, sd);
if (!message || !*message || sscanf(message, "%d", &new_group) != 1) {
- clif_displaymessage(fd, msg_txt(1226)); // Usage: @adjgroup <group_id>
+ clif->displaymessage(fd, msg_txt(1226)); // Usage: @adjgroup <group_id>
return -1;
}
if (!pc_group_exists(new_group)) {
- clif_displaymessage(fd, msg_txt(1227)); // Specified group does not exist.
+ clif->displaymessage(fd, msg_txt(1227)); // Specified group does not exist.
return -1;
}
sd->group_id = new_group;
pc_group_pc_load(sd);/* update cache */
- clif_displaymessage(fd, msg_txt(1228)); // Group changed successfully.
- clif_displaymessage(sd->fd, msg_txt(1229)); // Your group has changed.
+ clif->displaymessage(fd, msg_txt(1228)); // Group changed successfully.
+ clif->displaymessage(sd->fd, msg_txt(1229)); // Your group has changed.
return 0;
}
@@ -6445,13 +6445,13 @@ ACMD_FUNC(trade)
nullpo_retr(-1, sd);
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1230)); // Please enter a player name (usage: @trade <char name>).
+ clif->displaymessage(fd, msg_txt(1230)); // Please enter a player name (usage: @trade <char name>).
return -1;
}
if ( (pl_sd = map_nick2sd((char *)message)) == NULL )
{
- clif_displaymessage(fd, msg_txt(3)); // Character not found.
+ clif->displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
@@ -6469,16 +6469,16 @@ ACMD_FUNC(setbattleflag)
nullpo_retr(-1, sd);
if (!message || !*message || sscanf(message, "%127s %127s", flag, value) != 2) {
- clif_displaymessage(fd, msg_txt(1231)); // Usage: @setbattleflag <flag> <value>
+ clif->displaymessage(fd, msg_txt(1231)); // Usage: @setbattleflag <flag> <value>
return -1;
}
if (battle->config_set_value(flag, value) == 0) {
- clif_displaymessage(fd, msg_txt(1232)); // Unknown battle_config flag.
+ clif->displaymessage(fd, msg_txt(1232)); // Unknown battle_config flag.
return -1;
}
- clif_displaymessage(fd, msg_txt(1233)); // Set battle_config as requested.
+ clif->displaymessage(fd, msg_txt(1233)); // Set battle_config as requested.
return 0;
}
@@ -6492,24 +6492,24 @@ ACMD_FUNC(unmute)
nullpo_retr(-1, sd);
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1234)); // Please enter a player name (usage: @unmute <char name>).
+ clif->displaymessage(fd, msg_txt(1234)); // Please enter a player name (usage: @unmute <char name>).
return -1;
}
if ( (pl_sd = map_nick2sd((char *)message)) == NULL )
{
- clif_displaymessage(fd, msg_txt(3)); // Character not found.
+ clif->displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
if(!pl_sd->sc.data[SC_NOCHAT]) {
- clif_displaymessage(sd->fd,msg_txt(1235)); // Player is not muted.
+ clif->displaymessage(sd->fd,msg_txt(1235)); // Player is not muted.
return -1;
}
pl_sd->status.manner = 0;
status_change_end(&pl_sd->bl, SC_NOCHAT, INVALID_TIMER);
- clif_displaymessage(sd->fd,msg_txt(1236)); // Player unmuted.
+ clif->displaymessage(sd->fd,msg_txt(1236)); // Player unmuted.
return 0;
}
@@ -6532,7 +6532,7 @@ ACMD_FUNC(uptime)
seconds -= (seconds/minute>0)?(seconds/minute)*minute:0;
snprintf(atcmd_output, sizeof(atcmd_output), msg_txt(245), days, hours, minutes, seconds);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
@@ -6563,24 +6563,24 @@ ACMD_FUNC(mute)
nullpo_retr(-1, sd);
if (!message || !*message || sscanf(message, "%d %23[^\n]", &manner, atcmd_player_name) < 1) {
- clif_displaymessage(fd, msg_txt(1237)); // Usage: @mute <time> <char name>
+ clif->displaymessage(fd, msg_txt(1237)); // Usage: @mute <time> <char name>
return -1;
}
if ( (pl_sd = map_nick2sd(atcmd_player_name)) == NULL )
{
- clif_displaymessage(fd, msg_txt(3)); // Character not found.
+ clif->displaymessage(fd, msg_txt(3)); // Character not found.
return -1;
}
if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) )
{
- clif_displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
+ clif->displaymessage(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player.
return -1;
}
- clif_manner_message(sd, 0);
- clif_manner_message(pl_sd, 5);
+ clif->manner_message(sd, 0);
+ clif->manner_message(pl_sd, 5);
if( pl_sd->status.manner < manner ) {
pl_sd->status.manner -= manner;
@@ -6590,7 +6590,7 @@ ACMD_FUNC(mute)
status_change_end(&pl_sd->bl, SC_NOCHAT, INVALID_TIMER);
}
- clif_GM_silence(sd, pl_sd, (manner > 0 ? 1 : 0));
+ clif->GM_silence(sd, pl_sd, (manner > 0 ? 1 : 0));
return 0;
}
@@ -6601,7 +6601,7 @@ ACMD_FUNC(mute)
ACMD_FUNC(refresh)
{
nullpo_retr(-1, sd);
- clif_refresh(sd);
+ clif->refresh(sd);
return 0;
}
@@ -6613,7 +6613,7 @@ ACMD_FUNC(refreshall)
iter = mapit_getallusers();
for (iter_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); iter_sd = (TBL_PC*)mapit_next(iter))
- clif_refresh(iter_sd);
+ clif->refresh(iter_sd);
mapit_free(iter);
return 0;
}
@@ -6634,9 +6634,9 @@ ACMD_FUNC(identify)
}
}
if (num > 0) {
- clif_item_identify_list(sd);
+ clif->item_identify_list(sd);
} else {
- clif_displaymessage(fd,msg_txt(1238)); // There are no items to appraise.
+ clif->displaymessage(fd,msg_txt(1238)); // There are no items to appraise.
}
return 0;
}
@@ -6688,7 +6688,7 @@ ACMD_FUNC(misceffect)
return -1;
if (sscanf(message, "%d", &effect) < 1)
return -1;
- clif_misceffect(&sd->bl,effect);
+ clif->misceffect(&sd->bl,effect);
return 0;
}
@@ -6722,7 +6722,7 @@ ACMD_FUNC(mobinfo)
memset(atcmd_output2, '\0', sizeof(atcmd_output2));
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1239)); // Please enter a monster name/ID (usage: @mobinfo <monster_name_or_monster_ID>).
+ clif->displaymessage(fd, msg_txt(1239)); // Please enter a monster name/ID (usage: @mobinfo <monster_name_or_monster_ID>).
return -1;
}
@@ -6735,13 +6735,13 @@ ACMD_FUNC(mobinfo)
count = mobdb_searchname_array(mob_array, MAX_SEARCH, message);
if (!count) {
- clif_displaymessage(fd, msg_txt(40)); // Invalid monster ID or name.
+ clif->displaymessage(fd, msg_txt(40)); // Invalid monster ID or name.
return -1;
}
if (count > MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
count = MAX_SEARCH;
}
for (k = 0; k < count; k++) {
@@ -6752,21 +6752,21 @@ ACMD_FUNC(mobinfo)
sprintf(atcmd_output, msg_txt(1240), mob->name, mob->jname, mob->sprite, mob->vd.class_); // MVP Monster: '%s'/'%s'/'%s' (%d)
else
sprintf(atcmd_output, msg_txt(1241), mob->name, mob->jname, mob->sprite, mob->vd.class_); // Monster: '%s'/'%s'/'%s' (%d)
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(1242), mob->lv, mob->status.max_hp, mob->base_exp, mob->job_exp,MOB_HIT(mob), MOB_FLEE(mob)); // Lv:%d HP:%d Base EXP:%u Job EXP:%u HIT:%d FLEE:%d
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(1243), // DEF:%d MDEF:%d STR:%d AGI:%d VIT:%d INT:%d DEX:%d LUK:%d
mob->status.def, mob->status.mdef,mob->status.str, mob->status.agi,
mob->status.vit, mob->status.int_, mob->status.dex, mob->status.luk);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(1244), // ATK:%d~%d Range:%d~%d~%d Size:%s Race: %s Element: %s (Lv:%d)
mob->status.rhw.atk, mob->status.rhw.atk2, mob->status.rhw.range,
mob->range2 , mob->range3, msize[mob->status.size],
mrace[mob->status.race], melement[mob->status.def_ele], mob->status.ele_lv);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
// drops
- clif_displaymessage(fd, msg_txt(1245)); // Drops:
+ clif->displaymessage(fd, msg_txt(1245)); // Drops:
strcpy(atcmd_output, " ");
j = 0;
for (i = 0; i < MAX_MOB_DROP; i++) {
@@ -6781,18 +6781,18 @@ ACMD_FUNC(mobinfo)
sprintf(atcmd_output2, " - %s %02.02f%%", item_data->jname, (float)droprate / 100);
strcat(atcmd_output, atcmd_output2);
if (++j % 3 == 0) {
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
strcpy(atcmd_output, " ");
}
}
if (j == 0)
- clif_displaymessage(fd, msg_txt(1246)); // This monster has no drops.
+ clif->displaymessage(fd, msg_txt(1246)); // This monster has no drops.
else if (j % 3 != 0)
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
// mvp
if (mob->mexp) {
sprintf(atcmd_output, msg_txt(1247), mob->mexp); // MVP Bonus EXP:%u
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
strcpy(atcmd_output, msg_txt(1248)); // MVP Items:
j = 0;
for (i = 0; i < MAX_MVP_DROP; i++) {
@@ -6808,9 +6808,9 @@ ACMD_FUNC(mobinfo)
}
}
if (j == 0)
- clif_displaymessage(fd, msg_txt(1249)); // This monster has no MVP prizes.
+ clif->displaymessage(fd, msg_txt(1249)); // This monster has no MVP prizes.
else
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
}
return 0;
@@ -6836,12 +6836,12 @@ ACMD_FUNC(showmobs)
mob_id = mobdb_searchname(mob_name);
if(mob_id > 0 && mobdb_checkid(mob_id) == 0){
snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1250),mob_name); // Invalid mob id %s!
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
if(mob_db(mob_id)->status.mode&MD_BOSS && !pc_has_permission(sd, PC_PERM_SHOW_BOSS)){ // If player group does not have access to boss mobs.
- clif_displaymessage(fd, msg_txt(1251)); // Can't show boss mobs!
+ clif->displaymessage(fd, msg_txt(1251)); // Can't show boss mobs!
return 0;
}
@@ -6851,7 +6851,7 @@ ACMD_FUNC(showmobs)
snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1252), // Mob Search... %s %s
mob_name, mapindex_id2name(sd->mapindex));
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
it = mapit_geteachmob();
for(;;)
@@ -6870,7 +6870,7 @@ ACMD_FUNC(showmobs)
continue; // hide mobs waiting for respawn
++number;
- clif_viewpoint(sd, 1, 0, md->bl.x, md->bl.y, number, 0xFFFFFF);
+ clif->viewpoint(sd, 1, 0, md->bl.x, md->bl.y, number, 0xFFFFFF);
}
mapit_free(it);
@@ -6888,12 +6888,12 @@ ACMD_FUNC(homlevel)
nullpo_retr(-1, sd);
if ( !message || !*message || ( level = atoi(message) ) < 1 ) {
- clif_displaymessage(fd, msg_txt(1253)); // Please enter a level adjustment (usage: @homlevel <number of levels>).
+ clif->displaymessage(fd, msg_txt(1253)); // Please enter a level adjustment (usage: @homlevel <number of levels>).
return -1;
}
if ( !merc_is_hom_active(sd->hd) ) {
- clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
+ clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
return -1;
}
@@ -6908,7 +6908,7 @@ ACMD_FUNC(homlevel)
status_calc_homunculus(hd,0);
status_percent_heal(&hd->bl, 100, 100);
- clif_specialeffect(&hd->bl,568,AREA);
+ clif->specialeffect(&hd->bl,568,AREA);
return 0;
}
@@ -6920,15 +6920,15 @@ ACMD_FUNC(homevolution)
nullpo_retr(-1, sd);
if ( !merc_is_hom_active(sd->hd) ) {
- clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
+ clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
return -1;
}
if ( !merc_hom_evolution(sd->hd) ) {
- clif_displaymessage(fd, msg_txt(1255)); // Your homunculus doesn't evolve.
+ clif->displaymessage(fd, msg_txt(1255)); // Your homunculus doesn't evolve.
return -1;
}
- clif_homskillinfoblock(sd);
+ clif->homskillinfoblock(sd);
return 0;
}
@@ -6938,7 +6938,7 @@ ACMD_FUNC(hommutate)
nullpo_retr(-1, sd);
if (!merc_is_hom_active(sd->hd)) {
- clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
+ clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
return -1;
}
@@ -6954,7 +6954,7 @@ ACMD_FUNC(hommutate)
if (m_class != -1 && m_id != -1 && m_class&HOM_EVO && m_id&HOM_S && sd->hd->homunculus.level >= 99) {
hom_mutate(sd->hd, homun_id);
} else {
- clif_emotion(&sd->hd->bl, E_SWT);
+ clif->emotion(&sd->hd->bl, E_SWT);
}
return 0;
}
@@ -6968,19 +6968,19 @@ ACMD_FUNC(makehomun)
nullpo_retr(-1, sd);
if ( sd->status.hom_id ) {
- clif_displaymessage(fd, msg_txt(450));
+ clif->displaymessage(fd, msg_txt(450));
return -1;
}
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1256)); // Please enter a homunculus ID (usage: @makehomun <homunculus id>).
+ clif->displaymessage(fd, msg_txt(1256)); // Please enter a homunculus ID (usage: @makehomun <homunculus id>).
return -1;
}
homunid = atoi(message);
if( homunid < HM_CLASS_BASE || homunid > HM_CLASS_BASE + MAX_HOMUNCULUS_CLASS - 1 )
{
- clif_displaymessage(fd, msg_txt(1257)); // Invalid Homunculus ID.
+ clif->displaymessage(fd, msg_txt(1257)); // Invalid Homunculus ID.
return -1;
}
@@ -6998,12 +6998,12 @@ ACMD_FUNC(homfriendly)
nullpo_retr(-1, sd);
if ( !merc_is_hom_active(sd->hd) ) {
- clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
+ clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
return -1;
}
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1258)); // Please enter a friendly value (usage: @homfriendly <friendly value [0-1000]>).
+ clif->displaymessage(fd, msg_txt(1258)); // Please enter a friendly value (usage: @homfriendly <friendly value [0-1000]>).
return -1;
}
@@ -7011,7 +7011,7 @@ ACMD_FUNC(homfriendly)
friendly = cap_value(friendly, 0, 1000);
sd->hd->homunculus.intimacy = friendly * 100 ;
- clif_send_homdata(sd,SP_INTIMATE,friendly);
+ clif->send_homdata(sd,SP_INTIMATE,friendly);
return 0;
}
@@ -7025,12 +7025,12 @@ ACMD_FUNC(homhungry)
nullpo_retr(-1, sd);
if ( !merc_is_hom_active(sd->hd) ) {
- clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
+ clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
return -1;
}
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1259)); // Please enter a hunger value (usage: @homhungry <hunger value [0-100]>).
+ clif->displaymessage(fd, msg_txt(1259)); // Please enter a hunger value (usage: @homhungry <hunger value [0-100]>).
return -1;
}
@@ -7038,7 +7038,7 @@ ACMD_FUNC(homhungry)
hungry = cap_value(hungry, 0, 100);
sd->hd->homunculus.hunger = hungry;
- clif_send_homdata(sd,SP_HUNGRY,hungry);
+ clif->send_homdata(sd,SP_HUNGRY,hungry);
return 0;
}
@@ -7063,17 +7063,17 @@ ACMD_FUNC(homtalk)
return -1;
if ( !merc_is_hom_active(sd->hd) ) {
- clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
+ clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
return -1;
}
if (!message || !*message || sscanf(message, "%99[^\n]", mes) < 1) {
- clif_displaymessage(fd, msg_txt(1260)); // Please enter a message (usage: @homtalk <message>).
+ clif->displaymessage(fd, msg_txt(1260)); // Please enter a message (usage: @homtalk <message>).
return -1;
}
snprintf(temp, sizeof temp ,"%s : %s", sd->hd->homunculus.name, mes);
- clif_message(&sd->hd->bl, temp);
+ clif->message(&sd->hd->bl, temp);
return 0;
}
@@ -7088,31 +7088,31 @@ ACMD_FUNC(hominfo)
nullpo_retr(-1, sd);
if ( !merc_is_hom_active(sd->hd) ) {
- clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
+ clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
return -1;
}
hd = sd->hd;
status = status_get_status_data(&hd->bl);
- clif_displaymessage(fd, msg_txt(1261)); // Homunculus stats:
+ clif->displaymessage(fd, msg_txt(1261)); // Homunculus stats:
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1262), // HP: %d/%d - SP: %d/%d
status->hp, status->max_hp, status->sp, status->max_sp);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1263), // ATK: %d - MATK: %d~%d
status->rhw.atk2 +status->batk, status->matk_min, status->matk_max);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1264), // Hungry: %d - Intimacy: %u
hd->homunculus.hunger, hd->homunculus.intimacy/100);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
snprintf(atcmd_output, sizeof(atcmd_output) ,
msg_txt(1265), // Stats: Str %d / Agi %d / Vit %d / Int %d / Dex %d / Luk %d
status->str, status->agi, status->vit,
status->int_, status->dex, status->luk);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
@@ -7127,7 +7127,7 @@ ACMD_FUNC(homstats)
nullpo_retr(-1, sd);
if ( !merc_is_hom_active(sd->hd) ) {
- clif_displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
+ clif->displaymessage(fd, msg_txt(1254)); // You do not have a homunculus.
return -1;
}
@@ -7139,49 +7139,49 @@ ACMD_FUNC(homstats)
snprintf(atcmd_output, sizeof(atcmd_output) ,
msg_txt(1266), lv, db->name); // Homunculus growth stats (Lv %d %s):
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
lv--; //Since the first increase is at level 2.
evo = (hom->class_ == db->evo_class);
min = db->base.HP +lv*db->gmin.HP +(evo?db->emin.HP:0);
max = db->base.HP +lv*db->gmax.HP +(evo?db->emax.HP:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1267), hom->max_hp, min, max); // Max HP: %d (%d~%d)
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
min = db->base.SP +lv*db->gmin.SP +(evo?db->emin.SP:0);
max = db->base.SP +lv*db->gmax.SP +(evo?db->emax.SP:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1268), hom->max_sp, min, max); // Max SP: %d (%d~%d)
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
min = db->base.str +lv*(db->gmin.str/10) +(evo?db->emin.str:0);
max = db->base.str +lv*(db->gmax.str/10) +(evo?db->emax.str:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1269), hom->str/10, min, max); // Str: %d (%d~%d)
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
min = db->base.agi +lv*(db->gmin.agi/10) +(evo?db->emin.agi:0);
max = db->base.agi +lv*(db->gmax.agi/10) +(evo?db->emax.agi:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1270), hom->agi/10, min, max); // Agi: %d (%d~%d)
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
min = db->base.vit +lv*(db->gmin.vit/10) +(evo?db->emin.vit:0);
max = db->base.vit +lv*(db->gmax.vit/10) +(evo?db->emax.vit:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1271), hom->vit/10, min, max); // Vit: %d (%d~%d)
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
min = db->base.int_ +lv*(db->gmin.int_/10) +(evo?db->emin.int_:0);
max = db->base.int_ +lv*(db->gmax.int_/10) +(evo?db->emax.int_:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1272), hom->int_/10, min, max); // Int: %d (%d~%d)
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
min = db->base.dex +lv*(db->gmin.dex/10) +(evo?db->emin.dex:0);
max = db->base.dex +lv*(db->gmax.dex/10) +(evo?db->emax.dex:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1273), hom->dex/10, min, max); // Dex: %d (%d~%d)
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
min = db->base.luk +lv*(db->gmin.luk/10) +(evo?db->emin.luk:0);
max = db->base.luk +lv*(db->gmax.luk/10) +(evo?db->emax.luk:0);;
snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(1274), hom->luk/10, min, max); // Luk: %d (%d~%d)
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
@@ -7196,7 +7196,7 @@ ACMD_FUNC(homshuffle)
if(!merc_hom_shuffle(sd->hd))
return -1;
- clif_displaymessage(sd->fd, msg_txt(1275)); // Homunculus stats altered.
+ clif->displaymessage(sd->fd, msg_txt(1275)); // Homunculus stats altered.
atcommand_homstats(fd, sd, command, message); //Print out the new stats
return 0;
}
@@ -7211,20 +7211,20 @@ ACMD_FUNC(iteminfo)
int i, count = 1;
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1276)); // Please enter an item name/ID (usage: @ii/@iteminfo <item name/ID>).
+ clif->displaymessage(fd, msg_txt(1276)); // Please enter an item name/ID (usage: @ii/@iteminfo <item name/ID>).
return -1;
}
if ((item_array[0] = itemdb_exists(atoi(message))) == NULL)
count = itemdb_searchname_array(item_array, MAX_SEARCH, message);
if (!count) {
- clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name.
+ clif->displaymessage(fd, msg_txt(19)); // Invalid item ID or name.
return -1;
}
if (count > MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); // Displaying first %d out of %d matches
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
count = MAX_SEARCH;
}
for (i = 0; i < count; i++) {
@@ -7234,10 +7234,10 @@ ACMD_FUNC(iteminfo)
itemdb_typename(item_data->type),
(item_data->script==NULL)? msg_txt(1278) : msg_txt(1279) // None / With script
);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(1280), item_data->value_buy, item_data->value_sell, item_data->weight/10. ); // NPC Buy:%dz, Sell:%dz | Weight: %.1f
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
if (item_data->maxchance == -1)
strcpy(atcmd_output, msg_txt(1281)); // - Available in the shops only.
@@ -7245,7 +7245,7 @@ ACMD_FUNC(iteminfo)
sprintf(atcmd_output, msg_txt(1282), (float)item_data->maxchance / 100 ); // - Maximal monsters drop chance: %02.02f%%
else
strcpy(atcmd_output, msg_txt(1283)); // - Monsters don't drop this item.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
return 0;
@@ -7260,38 +7260,38 @@ ACMD_FUNC(whodrops)
int i,j, count = 1;
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1284)); // Please enter item name/ID (usage: @whodrops <item name/ID>).
+ clif->displaymessage(fd, msg_txt(1284)); // Please enter item name/ID (usage: @whodrops <item name/ID>).
return -1;
}
if ((item_array[0] = itemdb_exists(atoi(message))) == NULL)
count = itemdb_searchname_array(item_array, MAX_SEARCH, message);
if (!count) {
- clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name.
+ clif->displaymessage(fd, msg_txt(19)); // Invalid item ID or name.
return -1;
}
if (count > MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); // Displaying first %d out of %d matches
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
count = MAX_SEARCH;
}
for (i = 0; i < count; i++) {
item_data = item_array[i];
sprintf(atcmd_output, msg_txt(1285), item_data->jname,item_data->slot); // Item: '%s'[%d]
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
if (item_data->mob[0].chance == 0) {
strcpy(atcmd_output, msg_txt(1286)); // - Item is not dropped by mobs.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
} else {
sprintf(atcmd_output, msg_txt(1287), MAX_SEARCH); // - Common mobs with highest drop chance (only max %d are listed):
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
for (j=0; j < MAX_SEARCH && item_data->mob[j].chance > 0; j++)
{
sprintf(atcmd_output, "- %s (%02.02f%%)", mob_db(item_data->mob[j].id)->jname, item_data->mob[j].chance/100.);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
}
}
@@ -7305,7 +7305,7 @@ ACMD_FUNC(whereis)
int i, j, k;
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1288)); // Please enter a monster name/ID (usage: @whereis <monster_name_or_monster_ID>).
+ clif->displaymessage(fd, msg_txt(1288)); // Please enter a monster name/ID (usage: @whereis <monster_name_or_monster_ID>).
return -1;
}
@@ -7318,29 +7318,29 @@ ACMD_FUNC(whereis)
count = mobdb_searchname_array(mob_array, MAX_SEARCH, message);
if (!count) {
- clif_displaymessage(fd, msg_txt(40)); // Invalid monster ID or name.
+ clif->displaymessage(fd, msg_txt(40)); // Invalid monster ID or name.
return -1;
}
if (count > MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
count = MAX_SEARCH;
}
for (k = 0; k < count; k++) {
mob = mob_array[k];
snprintf(atcmd_output, sizeof atcmd_output, msg_txt(1289), mob->jname); // %s spawns in:
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
for (i = 0; i < ARRAYLENGTH(mob->spawn) && mob->spawn[i].qty; i++)
{
j = map_mapindex2mapid(mob->spawn[i].mapindex);
if (j < 0) continue;
snprintf(atcmd_output, sizeof atcmd_output, "%s (%d)", map[j].name, mob->spawn[i].qty);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
if (i == 0)
- clif_displaymessage(fd, msg_txt(1290)); // This monster does not spawn normally.
+ clif->displaymessage(fd, msg_txt(1290)); // This monster does not spawn normally.
}
return 0;
@@ -7352,9 +7352,9 @@ ACMD_FUNC(version)
if ((revision = get_svn_revision()) != 0) {
sprintf(atcmd_output,msg_txt(1295),revision); // rAthena Version SVN r%s
- clif_displaymessage(fd,atcmd_output);
+ clif->displaymessage(fd,atcmd_output);
} else
- clif_displaymessage(fd,msg_txt(1296)); // Cannot determine SVN revision.
+ clif->displaymessage(fd,msg_txt(1296)); // Cannot determine SVN revision.
return 0;
}
@@ -7389,7 +7389,7 @@ ACMD_FUNC(mutearea)
nullpo_ret(sd);
if (!message || !*message) {
- clif_displaymessage(fd, msg_txt(1297)); // Please enter a time in minutes (usage: @mutearea/@stfu <time in minutes>).
+ clif->displaymessage(fd, msg_txt(1297)); // Please enter a time in minutes (usage: @mutearea/@stfu <time in minutes>).
return -1;
}
@@ -7412,16 +7412,16 @@ ACMD_FUNC(rates)
snprintf(buf, CHAT_SIZE_MAX, msg_txt(1298), // Experience rates: Base %.2fx / Job %.2fx
battle_config.base_exp_rate/100., battle_config.job_exp_rate/100.);
- clif_displaymessage(fd, buf);
+ clif->displaymessage(fd, buf);
snprintf(buf, CHAT_SIZE_MAX, msg_txt(1299), // Normal Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx
battle_config.item_rate_common/100., battle_config.item_rate_heal/100., battle_config.item_rate_use/100., battle_config.item_rate_equip/100., battle_config.item_rate_card/100.);
- clif_displaymessage(fd, buf);
+ clif->displaymessage(fd, buf);
snprintf(buf, CHAT_SIZE_MAX, msg_txt(1300), // Boss Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx
battle_config.item_rate_common_boss/100., battle_config.item_rate_heal_boss/100., battle_config.item_rate_use_boss/100., battle_config.item_rate_equip_boss/100., battle_config.item_rate_card_boss/100.);
- clif_displaymessage(fd, buf);
+ clif->displaymessage(fd, buf);
snprintf(buf, CHAT_SIZE_MAX, msg_txt(1301), // Other Drop Rates: MvP %.2fx / Card-Based %.2fx / Treasure %.2fx
battle_config.item_rate_mvp/100., battle_config.item_rate_adddrop/100., battle_config.item_rate_treasure/100.);
- clif_displaymessage(fd, buf);
+ clif->displaymessage(fd, buf);
return 0;
}
@@ -7444,12 +7444,12 @@ ACMD_FUNC(me)
return -1;
if (!message || !*message || sscanf(message, "%199[^\n]", tempmes) < 0) {
- clif_displaymessage(fd, msg_txt(1302)); // Please enter a message (usage: @me <message>).
+ clif->displaymessage(fd, msg_txt(1302)); // Please enter a message (usage: @me <message>).
return -1;
}
sprintf(atcmd_output, msg_txt(270), sd->status.name, tempmes); // *%s %s*
- clif_disp_overhead(sd, atcmd_output);
+ clif->disp_overhead(sd, atcmd_output);
return 0;
@@ -7473,11 +7473,11 @@ ACMD_FUNC(size)
sd->state.size = size;
if( size == SZ_MEDIUM )
- clif_specialeffect(&sd->bl,420,AREA);
+ clif->specialeffect(&sd->bl,420,AREA);
else if( size == SZ_BIG )
- clif_specialeffect(&sd->bl,422,AREA);
+ clif->specialeffect(&sd->bl,422,AREA);
- clif_displaymessage(fd, msg_txt(1303)); // Size change applied.
+ clif->displaymessage(fd, msg_txt(1303)); // Size change applied.
return 0;
}
@@ -7500,14 +7500,14 @@ ACMD_FUNC(sizeall)
pl_sd->state.size = size;
if( size == SZ_MEDIUM )
- clif_specialeffect(&pl_sd->bl,420,AREA);
+ clif->specialeffect(&pl_sd->bl,420,AREA);
else if( size == SZ_BIG )
- clif_specialeffect(&pl_sd->bl,422,AREA);
+ clif->specialeffect(&pl_sd->bl,422,AREA);
}
}
mapit_free(iter);
- clif_displaymessage(fd, msg_txt(1303)); // Size change applied.
+ clif->displaymessage(fd, msg_txt(1303)); // Size change applied.
return 0;
}
@@ -7522,12 +7522,12 @@ ACMD_FUNC(sizeguild)
memset(guild, '\0', sizeof(guild));
if( !message || !*message || sscanf(message, "%d %23[^\n]", &size, guild) < 2 ) {
- clif_displaymessage(fd, msg_txt(1304)); // Please enter guild name/ID (usage: @sizeguild <size> <guild name/ID>).
+ clif->displaymessage(fd, msg_txt(1304)); // Please enter guild name/ID (usage: @sizeguild <size> <guild name/ID>).
return -1;
}
if( (g = guild_searchname(guild)) == NULL && (g = guild_search(atoi(guild))) == NULL ) {
- clif_displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
+ clif->displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online.
return -1;
}
@@ -7542,13 +7542,13 @@ ACMD_FUNC(sizeguild)
pl_sd->state.size = size;
if( size == SZ_MEDIUM )
- clif_specialeffect(&pl_sd->bl,420,AREA);
+ clif->specialeffect(&pl_sd->bl,420,AREA);
else if( size == SZ_BIG )
- clif_specialeffect(&pl_sd->bl,422,AREA);
+ clif->specialeffect(&pl_sd->bl,422,AREA);
}
}
- clif_displaymessage(fd, msg_txt(1303)); // Size change applied.
+ clif->displaymessage(fd, msg_txt(1303)); // Size change applied.
return 0;
}
@@ -7562,10 +7562,10 @@ ACMD_FUNC(monsterignore)
if (!sd->state.monster_ignore) {
sd->state.monster_ignore = 1;
- clif_displaymessage(sd->fd, msg_txt(1305)); // You are now immune to attacks.
+ clif->displaymessage(sd->fd, msg_txt(1305)); // You are now immune to attacks.
} else {
sd->state.monster_ignore = 0;
- clif_displaymessage(sd->fd, msg_txt(1306)); // Returned to normal state.
+ clif->displaymessage(sd->fd, msg_txt(1306)); // Returned to normal state.
}
return 0;
@@ -7583,24 +7583,24 @@ ACMD_FUNC(fakename)
if( sd->fakename[0] )
{
sd->fakename[0] = '\0';
- clif_charnameack(0, &sd->bl);
- clif_displaymessage(sd->fd, msg_txt(1307)); // Returned to real name.
+ clif->charnameack(0, &sd->bl);
+ clif->displaymessage(sd->fd, msg_txt(1307)); // Returned to real name.
return 0;
}
- clif_displaymessage(sd->fd, msg_txt(1308)); // You must enter a name.
+ clif->displaymessage(sd->fd, msg_txt(1308)); // You must enter a name.
return -1;
}
if( strlen(message) < 2 )
{
- clif_displaymessage(sd->fd, msg_txt(1309)); // Fake name must be at least two characters.
+ clif->displaymessage(sd->fd, msg_txt(1309)); // Fake name must be at least two characters.
return -1;
}
safestrncpy(sd->fakename, message, sizeof(sd->fakename));
- clif_charnameack(0, &sd->bl);
- clif_displaymessage(sd->fd, msg_txt(1310)); // Fake name enabled.
+ clif->charnameack(0, &sd->bl);
+ clif->displaymessage(sd->fd, msg_txt(1310)); // Fake name enabled.
return 0;
}
@@ -7609,12 +7609,12 @@ ACMD_FUNC(fakename)
* Ragnarok Resources
*------------------------------------------*/
ACMD_FUNC(mapflag) {
-#define checkflag( cmd ) if ( map[ sd->bl.m ].flag.cmd ) clif_displaymessage(sd->fd,#cmd)
+#define checkflag( cmd ) if ( map[ sd->bl.m ].flag.cmd ) clif->displaymessage(sd->fd,#cmd)
#define setflag( cmd ) \
if ( strcmp( flag_name , #cmd ) == 0 ){\
map[ sd->bl.m ].flag.cmd = flag;\
sprintf(atcmd_output,"[ @mapflag ] %s flag has been set to %s value = %hd",#cmd,flag?"On":"Off",flag);\
- clif_displaymessage(sd->fd,atcmd_output);\
+ clif->displaymessage(sd->fd,atcmd_output);\
return 0;\
}
char flag_name[100];
@@ -7623,8 +7623,8 @@ ACMD_FUNC(mapflag) {
memset(flag_name, '\0', sizeof(flag_name));
if (!message || !*message || (sscanf(message, "%99s %hd", flag_name, &flag) < 1)) {
- clif_displaymessage(sd->fd,msg_txt(1311)); // Enabled Mapflags in this map:
- clif_displaymessage(sd->fd,"----------------------------------");
+ clif->displaymessage(sd->fd,msg_txt(1311)); // Enabled Mapflags in this map:
+ clif->displaymessage(sd->fd,"----------------------------------");
checkflag(autotrade); checkflag(allowks); checkflag(nomemo); checkflag(noteleport);
checkflag(noreturn); checkflag(monster_noteleport); checkflag(nosave); checkflag(nobranch);
checkflag(noexppenalty); checkflag(pvp); checkflag(pvp_noparty); checkflag(pvp_noguild);
@@ -7637,9 +7637,9 @@ ACMD_FUNC(mapflag) {
checkflag(nojobexp); checkflag(nomobloot); checkflag(nomvploot); checkflag(nightenabled);
checkflag(nodrop); checkflag(novending); checkflag(loadevent);
checkflag(nochat); checkflag(partylock); checkflag(guildlock); checkflag(src4instance);
- clif_displaymessage(sd->fd," ");
- clif_displaymessage(sd->fd,msg_txt(1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
- clif_displaymessage(sd->fd,msg_txt(1313)); // Type "@mapflag available" to list the available mapflags.
+ clif->displaymessage(sd->fd," ");
+ clif->displaymessage(sd->fd,msg_txt(1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
+ clif->displaymessage(sd->fd,msg_txt(1313)); // Type "@mapflag available" to list the available mapflags.
return 1;
}
for (i = 0; flag_name[i]; i++) flag_name[i] = (char)tolower(flag_name[i]); //lowercase
@@ -7657,17 +7657,17 @@ ACMD_FUNC(mapflag) {
setflag(nodrop); setflag(novending); setflag(loadevent);
setflag(nochat); setflag(partylock); setflag(guildlock); setflag(src4instance);
- clif_displaymessage(sd->fd,msg_txt(1314)); // Invalid flag name or flag.
- clif_displaymessage(sd->fd,msg_txt(1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
- clif_displaymessage(sd->fd,msg_txt(1315)); // Available Flags:
- clif_displaymessage(sd->fd,"----------------------------------");
- clif_displaymessage(sd->fd,"town, autotrade, allowks, nomemo, noteleport, noreturn, monster_noteleport, nosave,");
- clif_displaymessage(sd->fd,"nobranch, noexppenalty, pvp, pvp_noparty, pvp_noguild, pvp_nightmaredrop,");
- clif_displaymessage(sd->fd,"pvp_nocalcrank, gvg_castle, gvg, gvg_dungeon, gvg_noparty, battleground,");
- clif_displaymessage(sd->fd,"nozenypenalty, notrade, noskill, nowarp, nowarpto, noicewall, snow, clouds, clouds2,");
- clif_displaymessage(sd->fd,"fog, fireworks, sakura, leaves, nogo, nobaseexp, nojobexp, nomobloot,");
- clif_displaymessage(sd->fd,"nomvploot, nightenabled, nodrop, novending, loadevent, nochat, partylock,");
- clif_displaymessage(sd->fd,"guildlock, src4instance");
+ clif->displaymessage(sd->fd,msg_txt(1314)); // Invalid flag name or flag.
+ clif->displaymessage(sd->fd,msg_txt(1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On)
+ clif->displaymessage(sd->fd,msg_txt(1315)); // Available Flags:
+ clif->displaymessage(sd->fd,"----------------------------------");
+ clif->displaymessage(sd->fd,"town, autotrade, allowks, nomemo, noteleport, noreturn, monster_noteleport, nosave,");
+ clif->displaymessage(sd->fd,"nobranch, noexppenalty, pvp, pvp_noparty, pvp_noguild, pvp_nightmaredrop,");
+ clif->displaymessage(sd->fd,"pvp_nocalcrank, gvg_castle, gvg, gvg_dungeon, gvg_noparty, battleground,");
+ clif->displaymessage(sd->fd,"nozenypenalty, notrade, noskill, nowarp, nowarpto, noicewall, snow, clouds, clouds2,");
+ clif->displaymessage(sd->fd,"fog, fireworks, sakura, leaves, nogo, nobaseexp, nojobexp, nomobloot,");
+ clif->displaymessage(sd->fd,"nomvploot, nightenabled, nodrop, novending, loadevent, nochat, partylock,");
+ clif->displaymessage(sd->fd,"guildlock, src4instance");
#undef checkflag
#undef setflag
@@ -7682,12 +7682,12 @@ ACMD_FUNC(showexp)
{
if (sd->state.showexp) {
sd->state.showexp = 0;
- clif_displaymessage(fd, msg_txt(1316)); // Gained exp will not be shown.
+ clif->displaymessage(fd, msg_txt(1316)); // Gained exp will not be shown.
return 0;
}
sd->state.showexp = 1;
- clif_displaymessage(fd, msg_txt(1317)); // Gained exp is now shown.
+ clif->displaymessage(fd, msg_txt(1317)); // Gained exp is now shown.
return 0;
}
@@ -7695,12 +7695,12 @@ ACMD_FUNC(showzeny)
{
if (sd->state.showzeny) {
sd->state.showzeny = 0;
- clif_displaymessage(fd, msg_txt(1318)); // Gained zeny will not be shown.
+ clif->displaymessage(fd, msg_txt(1318)); // Gained zeny will not be shown.
return 0;
}
sd->state.showzeny = 1;
- clif_displaymessage(fd, msg_txt(1319)); // Gained zeny is now shown.
+ clif->displaymessage(fd, msg_txt(1319)); // Gained zeny is now shown.
return 0;
}
@@ -7708,12 +7708,12 @@ ACMD_FUNC(showdelay)
{
if (sd->state.showdelay) {
sd->state.showdelay = 0;
- clif_displaymessage(fd, msg_txt(1320)); // Skill delay failures will not be shown.
+ clif->displaymessage(fd, msg_txt(1320)); // Skill delay failures will not be shown.
return 0;
}
sd->state.showdelay = 1;
- clif_displaymessage(fd, msg_txt(1321)); // Skill delay failures are now shown.
+ clif->displaymessage(fd, msg_txt(1321)); // Skill delay failures are now shown.
return 0;
}
@@ -7733,7 +7733,7 @@ ACMD_FUNC(invite)
if(did == 0) {
// "Duel: @invite without @duel."
- clif_displaymessage(fd, msg_txt(350));
+ clif->displaymessage(fd, msg_txt(350));
return 0;
}
@@ -7741,32 +7741,32 @@ ACMD_FUNC(invite)
duel_list[did].members_count >= duel_list[did].max_players_limit) {
// "Duel: Limit of players is reached."
- clif_displaymessage(fd, msg_txt(351));
+ clif->displaymessage(fd, msg_txt(351));
return 0;
}
if(target_sd == NULL) {
// "Duel: Player not found."
- clif_displaymessage(fd, msg_txt(352));
+ clif->displaymessage(fd, msg_txt(352));
return 0;
}
if(target_sd->duel_group > 0 || target_sd->duel_invite > 0) {
// "Duel: Player already in duel."
- clif_displaymessage(fd, msg_txt(353));
+ clif->displaymessage(fd, msg_txt(353));
return 0;
}
if(battle_config.duel_only_on_same_map && target_sd->bl.m != sd->bl.m)
{
sprintf(atcmd_output, msg_txt(364), message);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
duel_invite(did, sd, target_sd);
// "Duel: Invitation has been sent."
- clif_displaymessage(fd, msg_txt(354));
+ clif->displaymessage(fd, msg_txt(354));
return 0;
}
@@ -7781,7 +7781,7 @@ ACMD_FUNC(duel)
if(sd->duel_invite > 0) {
// "Duel: @duel without @reject."
- clif_displaymessage(fd, msg_txt(355));
+ clif->displaymessage(fd, msg_txt(355));
return 0;
}
@@ -7789,14 +7789,14 @@ ACMD_FUNC(duel)
char output[CHAT_SIZE_MAX];
// "Duel: You can take part in duel only one time per %d minutes."
sprintf(output, msg_txt(356), battle_config.duel_time_interval);
- clif_displaymessage(fd, output);
+ clif->displaymessage(fd, output);
return 0;
}
if( message[0] ) {
if(sscanf(message, "%d", &maxpl) >= 1) {
if(maxpl < 2 || maxpl > 65535) {
- clif_displaymessage(fd, msg_txt(357)); // "Duel: Invalid value."
+ clif->displaymessage(fd, msg_txt(357)); // "Duel: Invalid value."
return 0;
}
duel_create(sd, maxpl);
@@ -7807,15 +7807,15 @@ ACMD_FUNC(duel)
unsigned int newduel;
if((newduel = duel_create(sd, 2)) != -1) {
if(target_sd->duel_group > 0 || target_sd->duel_invite > 0) {
- clif_displaymessage(fd, msg_txt(353)); // "Duel: Player already in duel."
+ clif->displaymessage(fd, msg_txt(353)); // "Duel: Player already in duel."
return 0;
}
duel_invite(newduel, sd, target_sd);
- clif_displaymessage(fd, msg_txt(354)); // "Duel: Invitation has been sent."
+ clif->displaymessage(fd, msg_txt(354)); // "Duel: Invitation has been sent."
}
} else {
// "Duel: Player not found."
- clif_displaymessage(fd, msg_txt(352));
+ clif->displaymessage(fd, msg_txt(352));
return 0;
}
}
@@ -7830,12 +7830,12 @@ ACMD_FUNC(leave)
{
if(sd->duel_group <= 0) {
// "Duel: @leave without @duel."
- clif_displaymessage(fd, msg_txt(358));
+ clif->displaymessage(fd, msg_txt(358));
return 0;
}
duel_leave(sd->duel_group, sd);
- clif_displaymessage(fd, msg_txt(359)); // "Duel: You left the duel."
+ clif->displaymessage(fd, msg_txt(359)); // "Duel: You left the duel."
return 0;
}
@@ -7845,26 +7845,26 @@ ACMD_FUNC(accept)
char output[CHAT_SIZE_MAX];
// "Duel: You can take part in duel only one time per %d minutes."
sprintf(output, msg_txt(356), battle_config.duel_time_interval);
- clif_displaymessage(fd, output);
+ clif->displaymessage(fd, output);
return 0;
}
if(sd->duel_invite <= 0) {
// "Duel: @accept without invititation."
- clif_displaymessage(fd, msg_txt(360));
+ clif->displaymessage(fd, msg_txt(360));
return 0;
}
if( duel_list[sd->duel_invite].max_players_limit > 0 && duel_list[sd->duel_invite].members_count >= duel_list[sd->duel_invite].max_players_limit )
{
// "Duel: Limit of players is reached."
- clif_displaymessage(fd, msg_txt(351));
+ clif->displaymessage(fd, msg_txt(351));
return 0;
}
duel_accept(sd->duel_invite, sd);
// "Duel: Invitation has been accepted."
- clif_displaymessage(fd, msg_txt(361));
+ clif->displaymessage(fd, msg_txt(361));
return 0;
}
@@ -7872,13 +7872,13 @@ ACMD_FUNC(reject)
{
if(sd->duel_invite <= 0) {
// "Duel: @reject without invititation."
- clif_displaymessage(fd, msg_txt(362));
+ clif->displaymessage(fd, msg_txt(362));
return 0;
}
duel_reject(sd->duel_invite, sd);
// "Duel: Invitation has been rejected."
- clif_displaymessage(fd, msg_txt(363));
+ clif->displaymessage(fd, msg_txt(363));
return 0;
}
@@ -7893,7 +7893,7 @@ ACMD_FUNC(cash)
nullpo_retr(-1, sd);
if( !message || !*message || (value = atoi(message)) == 0 ) {
- clif_displaymessage(fd, msg_txt(1322)); // Please enter an amount.
+ clif->displaymessage(fd, msg_txt(1322)); // Please enter an amount.
return -1;
}
@@ -7902,15 +7902,15 @@ ACMD_FUNC(cash)
if( value > 0 ) {
if( (ret=pc_getcash(sd, value, 0)) >= 0){
sprintf(output, msg_txt(505), ret, sd->cashPoints);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif->disp_onlyself(sd, output, strlen(output));
}
- else clif_displaymessage(fd, msg_txt(149)); // Unable to decrease the number/value.
+ else clif->displaymessage(fd, msg_txt(149)); // Unable to decrease the number/value.
} else {
if( (ret=pc_paycash(sd, -value, 0)) >= 0){
sprintf(output, msg_txt(410), ret, sd->cashPoints);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif->disp_onlyself(sd, output, strlen(output));
}
- else clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
+ else clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
}
}
else
@@ -7918,15 +7918,15 @@ ACMD_FUNC(cash)
if( value > 0 ) {
if( (ret=pc_getcash(sd, 0, value)) >= 0){
sprintf(output, msg_txt(506), ret, sd->kafraPoints);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif->disp_onlyself(sd, output, strlen(output));
}
- else clif_displaymessage(fd, msg_txt(149)); // Unable to decrease the number/value.
+ else clif->displaymessage(fd, msg_txt(149)); // Unable to decrease the number/value.
} else {
if( (ret=pc_paycash(sd, -value, -value)) >= 0){
sprintf(output, msg_txt(411), ret, sd->kafraPoints);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif->disp_onlyself(sd, output, strlen(output));
}
- else clif_displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
+ else clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value.
}
}
@@ -7940,17 +7940,17 @@ ACMD_FUNC(clone)
struct map_session_data *pl_sd=NULL;
if (!message || !*message) {
- clif_displaymessage(sd->fd,msg_txt(1323)); // You must enter a player name or ID.
+ clif->displaymessage(sd->fd,msg_txt(1323)); // You must enter a player name or ID.
return 0;
}
if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL) {
- clif_displaymessage(fd, msg_txt(3)); // Character not found.
+ clif->displaymessage(fd, msg_txt(3)); // Character not found.
return 0;
}
if(pc_get_group_level(pl_sd) > pc_get_group_level(sd)) {
- clif_displaymessage(fd, msg_txt(126)); // Cannot clone a player of higher GM level than yourself.
+ clif->displaymessage(fd, msg_txt(126)); // Cannot clone a player of higher GM level than yourself.
return 0;
}
@@ -7959,13 +7959,13 @@ ACMD_FUNC(clone)
else if (strcmpi(command+1, "slaveclone") == 0) {
flag = 2;
if(pc_isdead(sd)){
- clif_displaymessage(fd, msg_txt(129+flag*2));
+ clif->displaymessage(fd, msg_txt(129+flag*2));
return 0;
}
master = sd->bl.id;
if (battle_config.atc_slave_clone_limit
&& mob_countslave(&sd->bl) >= battle_config.atc_slave_clone_limit) {
- clif_displaymessage(fd, msg_txt(127)); // You've reached your slave clones limit.
+ clif->displaymessage(fd, msg_txt(127)); // You've reached your slave clones limit.
return 0;
}
}
@@ -7981,10 +7981,10 @@ ACMD_FUNC(clone)
}
if((x = mob_clone_spawn(pl_sd, sd->bl.m, x, y, "", master, 0, flag?1:0, 0)) > 0) {
- clif_displaymessage(fd, msg_txt(128+flag*2)); // Evil Clone spawned. Clone spawned. Slave clone spawned.
+ clif->displaymessage(fd, msg_txt(128+flag*2)); // Evil Clone spawned. Clone spawned. Slave clone spawned.
return 0;
}
- clif_displaymessage(fd, msg_txt(129+flag*2)); // Unable to spawn evil clone. Unable to spawn clone. Unable to spawn slave clone.
+ clif->displaymessage(fd, msg_txt(129+flag*2)); // Unable to spawn evil clone. Unable to spawn clone. Unable to spawn slave clone.
return 0;
}
@@ -7999,24 +7999,24 @@ ACMD_FUNC(main)
if(strcmpi(message, "on") == 0) {
if(!sd->state.mainchat) {
sd->state.mainchat = 1;
- clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated.
+ clif->displaymessage(fd, msg_txt(380)); // Main chat has been activated.
} else {
- clif_displaymessage(fd, msg_txt(381)); // Main chat already activated.
+ clif->displaymessage(fd, msg_txt(381)); // Main chat already activated.
}
} else if(strcmpi(message, "off") == 0) {
if(sd->state.mainchat) {
sd->state.mainchat = 0;
- clif_displaymessage(fd, msg_txt(382)); // Main chat has been disabled.
+ clif->displaymessage(fd, msg_txt(382)); // Main chat has been disabled.
} else {
- clif_displaymessage(fd, msg_txt(383)); // Main chat already disabled.
+ clif->displaymessage(fd, msg_txt(383)); // Main chat already disabled.
}
} else {
if(!sd->state.mainchat) {
sd->state.mainchat = 1;
- clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated.
+ clif->displaymessage(fd, msg_txt(380)); // Main chat has been activated.
}
if (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) {
- clif_displaymessage(fd, msg_txt(387));
+ clif->displaymessage(fd, msg_txt(387));
return -1;
}
@@ -8033,9 +8033,9 @@ ACMD_FUNC(main)
} else {
if(sd->state.mainchat)
- clif_displaymessage(fd, msg_txt(384)); // Main chat currently enabled. Usage: @main <on|off>, @main <message>.
+ clif->displaymessage(fd, msg_txt(384)); // Main chat currently enabled. Usage: @main <on|off>, @main <message>.
else
- clif_displaymessage(fd, msg_txt(385)); // Main chat currently disabled. Usage: @main <on|off>, @main <message>.
+ clif->displaymessage(fd, msg_txt(385)); // Main chat currently disabled. Usage: @main <on|off>, @main <message>.
}
return 0;
}
@@ -8047,10 +8047,10 @@ ACMD_FUNC(main)
ACMD_FUNC(noask)
{
if(sd->state.noask) {
- clif_displaymessage(fd, msg_txt(391)); // Autorejecting is deactivated.
+ clif->displaymessage(fd, msg_txt(391)); // Autorejecting is deactivated.
sd->state.noask = 0;
} else {
- clif_displaymessage(fd, msg_txt(390)); // Autorejecting is activated.
+ clif->displaymessage(fd, msg_txt(390)); // Autorejecting is activated.
sd->state.noask = 1;
}
@@ -8064,14 +8064,14 @@ ACMD_FUNC(noask)
ACMD_FUNC(request)
{
if (!message || !*message) {
- clif_displaymessage(sd->fd,msg_txt(277)); // Usage: @request <petition/message to online GMs>.
+ clif->displaymessage(sd->fd,msg_txt(277)); // Usage: @request <petition/message to online GMs>.
return -1;
}
sprintf(atcmd_output, msg_txt(278), message); // (@request): %s
intif_wis_message_to_gm(sd->status.name, PC_PERM_RECEIVE_REQUESTS, atcmd_output);
- clif_disp_onlyself(sd, atcmd_output, strlen(atcmd_output));
- clif_displaymessage(sd->fd,msg_txt(279)); // @request sent.
+ clif->disp_onlyself(sd, atcmd_output, strlen(atcmd_output));
+ clif->displaymessage(sd->fd,msg_txt(279)); // @request sent.
return 0;
}
@@ -8081,7 +8081,7 @@ ACMD_FUNC(request)
ACMD_FUNC(feelreset)
{
pc_resetfeel(sd);
- clif_displaymessage(fd, msg_txt(1324)); // Reset 'Feeling' maps.
+ clif->displaymessage(fd, msg_txt(1324)); // Reset 'Feeling' maps.
return 0;
}
@@ -8093,7 +8093,7 @@ ACMD_FUNC(auction)
{
nullpo_ret(sd);
- clif_Auction_openwindow(sd);
+ clif->auction_openwindow(sd);
return 0;
}
@@ -8107,27 +8107,27 @@ ACMD_FUNC(ksprotection)
if( sd->state.noks ) {
sd->state.noks = 0;
- clif_displaymessage(fd, msg_txt(1325)); // [ K.S Protection Inactive ]
+ clif->displaymessage(fd, msg_txt(1325)); // [ K.S Protection Inactive ]
}
else
{
if( !message || !*message || !strcmpi(message, "party") )
{ // Default is Party
sd->state.noks = 2;
- clif_displaymessage(fd, msg_txt(1326)); // [ K.S Protection Active - Option: Party ]
+ clif->displaymessage(fd, msg_txt(1326)); // [ K.S Protection Active - Option: Party ]
}
else if( !strcmpi(message, "self") )
{
sd->state.noks = 1;
- clif_displaymessage(fd, msg_txt(1327)); // [ K.S Protection Active - Option: Self ]
+ clif->displaymessage(fd, msg_txt(1327)); // [ K.S Protection Active - Option: Self ]
}
else if( !strcmpi(message, "guild") )
{
sd->state.noks = 3;
- clif_displaymessage(fd, msg_txt(1328)); // [ K.S Protection Active - Option: Guild ]
+ clif->displaymessage(fd, msg_txt(1328)); // [ K.S Protection Active - Option: Guild ]
}
else
- clif_displaymessage(fd, msg_txt(1329)); // Usage: @noks <self|party|guild>
+ clif->displaymessage(fd, msg_txt(1329)); // Usage: @noks <self|party|guild>
}
return 0;
}
@@ -8140,10 +8140,10 @@ ACMD_FUNC(allowks)
if( map[sd->bl.m].flag.allowks ) {
map[sd->bl.m].flag.allowks = 0;
- clif_displaymessage(fd, msg_txt(1330)); // [ Map K.S Protection Active ]
+ clif->displaymessage(fd, msg_txt(1330)); // [ Map K.S Protection Active ]
} else {
map[sd->bl.m].flag.allowks = 1;
- clif_displaymessage(fd, msg_txt(1331)); // [ Map K.S Protection Inactive ]
+ clif->displaymessage(fd, msg_txt(1331)); // [ Map K.S Protection Inactive ]
}
return 0;
}
@@ -8154,7 +8154,7 @@ ACMD_FUNC(resetstat)
pc_resetstate(sd);
sprintf(atcmd_output, msg_txt(207), sd->status.name);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
@@ -8164,7 +8164,7 @@ ACMD_FUNC(resetskill)
pc_resetskill(sd,1);
sprintf(atcmd_output, msg_txt(206), sd->status.name);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
@@ -8224,7 +8224,7 @@ ACMD_FUNC(itemlist)
if( count == 1 )
{
StringBuf_Printf(&buf, msg_txt(1332), location, sd->status.name); // ------ %s items list of '%s' ------
- clif_displaymessage(fd, StringBuf_Value(&buf));
+ clif->displaymessage(fd, StringBuf_Value(&buf));
StringBuf_Clear(&buf);
}
@@ -8270,7 +8270,7 @@ ACMD_FUNC(itemlist)
StringBuf_AppendStr(&buf, equipstr);
}
- clif_displaymessage(fd, StringBuf_Value(&buf));
+ clif->displaymessage(fd, StringBuf_Value(&buf));
StringBuf_Clear(&buf);
if( it->card[0] == CARD0_PET )
@@ -8317,7 +8317,7 @@ ACMD_FUNC(itemlist)
}
if( StringBuf_Length(&buf) > 0 )
- clif_displaymessage(fd, StringBuf_Value(&buf));
+ clif->displaymessage(fd, StringBuf_Value(&buf));
StringBuf_Clear(&buf);
}
@@ -8327,7 +8327,7 @@ ACMD_FUNC(itemlist)
else
StringBuf_Printf(&buf, msg_txt(1354), counter, count, location); // %d item(s) found in %d %s slots.
- clif_displaymessage(fd, StringBuf_Value(&buf));
+ clif->displaymessage(fd, StringBuf_Value(&buf));
StringBuf_Destroy(&buf);
@@ -8387,11 +8387,11 @@ ACMD_FUNC(stats)
sprintf(job_jobname, "Job - %s %s", job_name(sd->status.class_), "(level %d)");
sprintf(output, msg_txt(53), sd->status.name); // '%s' stats:
- clif_displaymessage(fd, output);
+ clif->displaymessage(fd, output);
for (i = 0; output_table[i].format != NULL; i++) {
sprintf(output, output_table[i].format, output_table[i].value);
- clif_displaymessage(fd, output);
+ clif->displaymessage(fd, output);
}
return 0;
@@ -8407,7 +8407,7 @@ ACMD_FUNC(delitem)
if( !message || !*message || ( sscanf(message, "\"%99[^\"]\" %d", item_name, &amount) < 2 && sscanf(message, "%99s %d", item_name, &amount) < 2 ) || amount < 1 )
{
- clif_displaymessage(fd, msg_txt(1355)); // Please enter an item name/ID, a quantity, and a player name (usage: #delitem <player> <item_name_or_ID> <quantity>).
+ clif->displaymessage(fd, msg_txt(1355)); // Please enter an item name/ID, a quantity, and a player name (usage: #delitem <player> <item_name_or_ID> <quantity>).
return -1;
}
@@ -8417,7 +8417,7 @@ ACMD_FUNC(delitem)
}
else
{
- clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name.
+ clif->displaymessage(fd, msg_txt(19)); // Invalid item ID or name.
return -1;
}
@@ -8439,22 +8439,22 @@ ACMD_FUNC(delitem)
// notify target
sprintf(atcmd_output, msg_txt(113), total-amount); // %d item(s) removed by a GM.
- clif_displaymessage(sd->fd, atcmd_output);
+ clif->displaymessage(sd->fd, atcmd_output);
// notify source
if( amount == total )
{
- clif_displaymessage(fd, msg_txt(116)); // Character does not have the item.
+ clif->displaymessage(fd, msg_txt(116)); // Character does not have the item.
}
else if( amount )
{
sprintf(atcmd_output, msg_txt(115), total-amount, total-amount, total); // %d item(s) removed. Player had only %d on %d items.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
else
{
sprintf(atcmd_output, msg_txt(114), total); // %d item(s) removed from the player.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
return 0;
@@ -8474,25 +8474,25 @@ ACMD_FUNC(font)
if( sd->user_font )
{
sd->user_font = 0;
- clif_displaymessage(fd, msg_txt(1356)); // Returning to normal font.
- clif_font(sd);
+ clif->displaymessage(fd, msg_txt(1356)); // Returning to normal font.
+ clif->font(sd);
}
else
{
- clif_displaymessage(fd, msg_txt(1357)); // Use @font <1-9> to change your message font.
- clif_displaymessage(fd, msg_txt(1358)); // Use 0 or no parameter to return to normal font.
+ clif->displaymessage(fd, msg_txt(1357)); // Use @font <1-9> to change your message font.
+ clif->displaymessage(fd, msg_txt(1358)); // Use 0 or no parameter to return to normal font.
}
}
else if( font_id < 0 || font_id > 9 )
- clif_displaymessage(fd, msg_txt(1359)); // Invalid font. Use a value from 0 to 9.
+ clif->displaymessage(fd, msg_txt(1359)); // Invalid font. Use a value from 0 to 9.
else if( font_id != sd->user_font )
{
sd->user_font = font_id;
- clif_font(sd);
- clif_displaymessage(fd, msg_txt(1360)); // Font changed.
+ clif->font(sd);
+ clif->displaymessage(fd, msg_txt(1360)); // Font changed.
}
else
- clif_displaymessage(fd, msg_txt(1361)); // Already using this font.
+ clif->displaymessage(fd, msg_txt(1361)); // Already using this font.
return 0;
}
@@ -8511,7 +8511,7 @@ static void atcommand_commands_sub(struct map_session_data* sd, const int fd, At
memset(line_buff,' ',CHATBOX_SIZE);
line_buff[CHATBOX_SIZE-1] = 0;
- clif_displaymessage(fd, msg_txt(273)); // "Commands available:"
+ clif->displaymessage(fd, msg_txt(273)); // "Commands available:"
for (cmd = dbi_first(iter); dbi_exists(iter); cmd = dbi_next(iter)) {
unsigned int slen = 0;
@@ -8535,7 +8535,7 @@ static void atcommand_commands_sub(struct map_session_data* sd, const int fd, At
// flush the text buffer if this command won't fit into it
if ( slen + cur - line_buff >= CHATBOX_SIZE )
{
- clif_displaymessage(fd,line_buff);
+ clif->displaymessage(fd,line_buff);
cur = line_buff;
memset(line_buff,' ',CHATBOX_SIZE);
line_buff[CHATBOX_SIZE-1] = 0;
@@ -8547,10 +8547,10 @@ static void atcommand_commands_sub(struct map_session_data* sd, const int fd, At
count++;
}
dbi_destroy(iter);
- clif_displaymessage(fd,line_buff);
+ clif->displaymessage(fd,line_buff);
sprintf(atcmd_output, msg_txt(274), count); // "%d commands found."
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return;
}
@@ -8575,12 +8575,12 @@ ACMD_FUNC(charcommands)
/* for new mounts */
ACMD_FUNC(mount2) {
- clif_displaymessage(sd->fd,msg_txt(1362)); // NOTICE: If you crash with mount your LUA is outdated.
+ clif->displaymessage(sd->fd,msg_txt(1362)); // NOTICE: If you crash with mount your LUA is outdated.
if( !(sd->sc.option&OPTION_MOUNTING) ) {
- clif_displaymessage(sd->fd,msg_txt(1363)); // You have mounted.
+ clif->displaymessage(sd->fd,msg_txt(1363)); // You have mounted.
pc_setoption(sd, sd->sc.option|OPTION_MOUNTING);
} else {
- clif_displaymessage(sd->fd,msg_txt(1364)); // You have released your mount.
+ clif->displaymessage(sd->fd,msg_txt(1364)); // You have released your mount.
pc_setoption(sd, sd->sc.option&~OPTION_MOUNTING);
}
return 0;
@@ -8590,8 +8590,8 @@ ACMD_FUNC(accinfo) {
char query[NAME_LENGTH];
if (!message || !*message || strlen(message) > NAME_LENGTH ) {
- clif_displaymessage(fd, msg_txt(1365)); // Usage: @accinfo/@accountinfo <account_id/char name>
- clif_displaymessage(fd, msg_txt(1366)); // You may search partial name by making use of '%' in the search, ex. "@accinfo %Mario%" lists all characters whose name contains "Mario".
+ clif->displaymessage(fd, msg_txt(1365)); // Usage: @accinfo/@accountinfo <account_id/char name>
+ clif->displaymessage(fd, msg_txt(1366)); // You may search partial name by making use of '%' in the search, ex. "@accinfo %Mario%" lists all characters whose name contains "Mario".
return -1;
}
@@ -8611,19 +8611,19 @@ ACMD_FUNC(set) {
bool is_str = false;
if( !message || !*message || (toset = sscanf(message, "%31s %128[^\n]s", reg, val)) < 1 ) {
- clif_displaymessage(fd, msg_txt(1367)); // Usage: @set <variable name> <value>
- clif_displaymessage(fd, msg_txt(1368)); // Usage: ex. "@set PoringCharVar 50"
- clif_displaymessage(fd, msg_txt(1369)); // Usage: ex. "@set PoringCharVarSTR$ Super Duper String"
- clif_displaymessage(fd, msg_txt(1370)); // Usage: ex. "@set PoringCharVarSTR$" outputs its value, Super Duper String.
+ clif->displaymessage(fd, msg_txt(1367)); // Usage: @set <variable name> <value>
+ clif->displaymessage(fd, msg_txt(1368)); // Usage: ex. "@set PoringCharVar 50"
+ clif->displaymessage(fd, msg_txt(1369)); // Usage: ex. "@set PoringCharVarSTR$ Super Duper String"
+ clif->displaymessage(fd, msg_txt(1370)); // Usage: ex. "@set PoringCharVarSTR$" outputs its value, Super Duper String.
return -1;
}
/* disabled variable types (they require a proper script state to function, so allowing them would crash the server) */
if( reg[0] == '.' ) {
- clif_displaymessage(fd, msg_txt(1371)); // NPC variables may not be used with @set.
+ clif->displaymessage(fd, msg_txt(1371)); // NPC variables may not be used with @set.
return -1;
} else if( reg[0] == '\'' ) {
- clif_displaymessage(fd, msg_txt(1372)); // Instance variables may not be used with @set.
+ clif->displaymessage(fd, msg_txt(1372)); // Instance variables may not be used with @set.
return -1;
}
@@ -8714,7 +8714,7 @@ ACMD_FUNC(set) {
break;
}
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
aFree(data);
@@ -8722,7 +8722,7 @@ ACMD_FUNC(set) {
}
ACMD_FUNC(reloadquestdb) {
do_reload_quest();
- clif_displaymessage(fd, msg_txt(1377)); // Quest database has been reloaded.
+ clif->displaymessage(fd, msg_txt(1377)); // Quest database has been reloaded.
return 0;
}
ACMD_FUNC(addperm) {
@@ -8732,11 +8732,11 @@ ACMD_FUNC(addperm) {
if( !message || !*message ) {
sprintf(atcmd_output, msg_txt(1378),command); // Usage: %s <permission_name>
- clif_displaymessage(fd, atcmd_output);
- clif_displaymessage(fd, msg_txt(1379)); // -- Permission List
+ clif->displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, msg_txt(1379)); // -- Permission List
for( i = 0; i < perm_size; i++ ) {
sprintf(atcmd_output,"- %s",pc_g_permission_name[i].name);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
return -1;
}
@@ -8745,28 +8745,28 @@ ACMD_FUNC(addperm) {
if( i == perm_size ) {
sprintf(atcmd_output,msg_txt(1380),message); // '%s' is not a known permission.
- clif_displaymessage(fd, atcmd_output);
- clif_displaymessage(fd, msg_txt(1379)); // -- Permission List
+ clif->displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, msg_txt(1379)); // -- Permission List
for( i = 0; i < perm_size; i++ ) {
sprintf(atcmd_output,"- %s",pc_g_permission_name[i].name);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
return -1;
}
if( add && (sd->permissions&pc_g_permission_name[i].permission) ) {
sprintf(atcmd_output, msg_txt(1381),sd->status.name,pc_g_permission_name[i].name); // User '%s' already possesses the '%s' permission.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return -1;
} else if ( !add && !(sd->permissions&pc_g_permission_name[i].permission) ) {
sprintf(atcmd_output, msg_txt(1382),sd->status.name,pc_g_permission_name[i].name); // User '%s' doesn't possess the '%s' permission.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
sprintf(atcmd_output,msg_txt(1383),sd->status.name); // -- User '%s' Permissions
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
for( i = 0; i < perm_size; i++ ) {
if( sd->permissions&pc_g_permission_name[i].permission ) {
sprintf(atcmd_output,"- %s",pc_g_permission_name[i].name);
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
}
}
@@ -8780,21 +8780,21 @@ ACMD_FUNC(addperm) {
sprintf(atcmd_output, msg_txt(1384),sd->status.name); // User '%s' permissions updated successfully. The changes are temporary.
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return 0;
}
ACMD_FUNC(unloadnpcfile) {
if( !message || !*message ) {
- clif_displaymessage(fd, msg_txt(1385)); // Usage: @unloadnpcfile <file name>
+ clif->displaymessage(fd, msg_txt(1385)); // Usage: @unloadnpcfile <file name>
return -1;
}
if( npc_unloadfile(message) )
- clif_displaymessage(fd, msg_txt(1386)); // File unloaded. Be aware that mapflags and monsters spawned directly are not removed.
+ clif->displaymessage(fd, msg_txt(1386)); // File unloaded. Be aware that mapflags and monsters spawned directly are not removed.
else {
- clif_displaymessage(fd, msg_txt(1387)); // File not found.
+ clif->displaymessage(fd, msg_txt(1387)); // File not found.
return -1;
}
return 0;
@@ -8810,12 +8810,12 @@ ACMD_FUNC(cart) {
if( !message || !*message || val < 0 || val > MAX_CARTS ) {
sprintf(atcmd_output, msg_txt(1390),command,MAX_CARTS); // Unknown Cart (usage: %s <0-%d>).
- clif_displaymessage(fd, atcmd_output);
+ clif->displaymessage(fd, atcmd_output);
return -1;
}
if( val == 0 && !pc_iscarton(sd) ) {
- clif_displaymessage(fd, msg_txt(1391)); // You do not possess a cart to be removed
+ clif->displaymessage(fd, msg_txt(1391)); // You do not possess a cart to be removed
return -1;
}
@@ -8834,7 +8834,7 @@ ACMD_FUNC(cart) {
MC_CART_MDFY(0);
}
- clif_displaymessage(fd, msg_txt(1392)); // Cart Added
+ clif->displaymessage(fd, msg_txt(1392)); // Cart Added
return 0;
#undef MC_CART_MDFY
@@ -9206,7 +9206,7 @@ static void atcommand_get_suggestions(struct map_session_data* sd, const char *n
strcat(buffer," ");
}
- clif_displaymessage(sd->fd, buffer);
+ clif->displaymessage(sd->fd, buffer);
}
dbi_destroy(atcommand_iter);
@@ -9250,7 +9250,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
if ( type == 1) {
//Commands are disabled on maps flagged as 'nocommand'
if ( map[sd->bl.m].nocommand && pc_get_group_level(sd) < map[sd->bl.m].nocommand ) {
- clif_displaymessage(fd, msg_txt(143));
+ clif->displaymessage(fd, msg_txt(143));
return false;
}
}
@@ -9294,7 +9294,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
}
sprintf(output, msg_txt(1388), charcommand_symbol); // Charcommand failed (usage: %c<command> <char name> <parameters>).
- clif_displaymessage(fd, output);
+ clif->displaymessage(fd, output);
return true;
} while(0);
}
@@ -9321,7 +9321,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
if (*message == charcommand_symbol &&
(ssd = map_nick2sd(charname)) == NULL && (ssd = map_nick2sd(charname2)) == NULL ) {
sprintf(output, msg_txt(1389), command); // %s failed. Player not found.
- clif_displaymessage(fd, output);
+ clif->displaymessage(fd, output);
return true;
}
@@ -9345,7 +9345,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
if (info == NULL) {
if( pc_get_group_level(sd) ) { // TODO: remove or replace with proper permission
sprintf(output, msg_txt(153), command); // "%s is Unknown Command."
- clif_displaymessage(fd, output);
+ clif->displaymessage(fd, output);
atcommand_get_suggestions(sd, command + 1, *message == atcommand_symbol);
return true;
} else
@@ -9359,7 +9359,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
return false;
}
if( pc_isdead(sd) && pc_has_permission(sd,PC_PERM_DISABLE_CMD_DEAD) ) {
- clif_displaymessage(fd, msg_txt(1393)); // You can't use commands while dead
+ clif->displaymessage(fd, msg_txt(1393)); // You can't use commands while dead
return true;
}
}
@@ -9368,7 +9368,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
if (*message == charcommand_symbol &&
(ssd = map_nick2sd(charname)) == NULL && (ssd = map_nick2sd(charname2)) == NULL ) {
sprintf(output, msg_txt(1389), command); // %s failed. Player not found.
- clif_displaymessage(fd, output);
+ clif->displaymessage(fd, output);
return true;
}
@@ -9376,7 +9376,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
if ( (info->func(fd, (*atcmd_msg == atcommand_symbol) ? sd : ssd, command, params) != 0) )
{
sprintf(output,msg_txt(154), command); // %s failed.
- clif_displaymessage(fd, output);
+ clif->displaymessage(fd, output);
return true;
}
diff --git a/src/map/battle.c b/src/map/battle.c
index ea0254a99..8f97ca58d 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -832,7 +832,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
}
if( sc->data[SC_WEAPONBLOCKING] && flag&(BF_SHORT|BF_WEAPON) && rnd()%100 < sc->data[SC_WEAPONBLOCKING]->val2 )
{
- clif_skill_nodamage(bl,src,GC_WEAPONBLOCKING,1,1);
+ clif->skill_nodamage(bl,src,GC_WEAPONBLOCKING,1,1);
d->dmg_lv = ATK_BLOCK;
sc_start2(bl,SC_COMBO,100,GC_WEAPONBLOCKING,src->id,2000);
return 0;
@@ -840,7 +840,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
if( (sce=sc->data[SC_AUTOGUARD]) && flag&BF_WEAPON && !(skill->get_nk(skill_id)&NK_NO_CARDFIX_ATK) && rnd()%100 < sce->val2 )
{
int delay;
- clif_skill_nodamage(bl,bl,CR_AUTOGUARD,sce->val1,1);
+ clif->skill_nodamage(bl,bl,CR_AUTOGUARD,sce->val1,1);
// different delay depending on skill level [celest]
if (sce->val1 <= 5)
delay = 300;
@@ -856,7 +856,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
}
if( (sce = sc->data[SC_MILLENNIUMSHIELD]) && sce->val2 > 0 && damage > 0 ) {
- clif_skill_nodamage(bl, bl, RK_MILLENNIUMSHIELD, 1, 1);
+ clif->skill_nodamage(bl, bl, RK_MILLENNIUMSHIELD, 1, 1);
sce->val3 -= damage; // absorb damage
d->dmg_lv = ATK_BLOCK;
sc_start(bl,SC_STUN,15,0,skill->get_time2(RK_MILLENNIUMSHIELD,sce->val1)); // There is a chance to be stuned when one shield is broken.
@@ -864,7 +864,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
sce->val2--;
if( sce->val2 > 0 ) {
if( sd )
- clif_millenniumshield(sd,sce->val2);
+ clif->millenniumshield(sd,sce->val2);
sce->val3 = 1000; // Next Shield
} else
status_change_end(bl,SC_MILLENNIUMSHIELD,INVALID_TIMER); // All shields down
@@ -875,7 +875,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
if( (sce=sc->data[SC_PARRYING]) && flag&BF_WEAPON && skill_id != WS_CARTTERMINATION && rnd()%100 < sce->val2 )
{ // attack blocked by Parrying
- clif_skill_nodamage(bl, bl, LK_PARRYING, sce->val1,1);
+ clif->skill_nodamage(bl, bl, LK_PARRYING, sce->val1,1);
return 0;
}
@@ -883,7 +883,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
(flag&BF_LONG || sc->data[SC_SPURT])
&& rnd()%100 < 20) {
if (sd && pc_issit(sd)) pc_setstand(sd); //Stand it to dodge.
- clif_skill_nodamage(bl,bl,TK_DODGE,1,1);
+ clif->skill_nodamage(bl,bl,TK_DODGE,1,1);
if (!sc->data[SC_COMBO])
sc_start4(bl, SC_COMBO, 100, TK_JUMPKICK, src->id, 1, 0, 2000);
return 0;
@@ -902,7 +902,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
if((sce=sc->data[SC_KAUPE]) && rnd()%100 < sce->val2)
{ //Kaupe blocks damage (skill or otherwise) from players, mobs, homuns, mercenaries.
- clif_specialeffect(bl, 462, AREA);
+ clif->specialeffect(bl, 462, AREA);
//Shouldn't end until Breaker's non-weapon part connects.
if (skill_id != ASC_BREAKER || !(flag&BF_WEAPON))
if (--(sce->val3) <= 0) //We make it work like Safety Wall, even though it only blocks 1 time.
@@ -911,7 +911,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
}
if( flag&BF_MAGIC && (sce=sc->data[SC_PRESTIGE]) && rnd()%100 < sce->val2) {
- clif_specialeffect(bl, 462, AREA); // Still need confirm it.
+ clif->specialeffect(bl, 462, AREA); // Still need confirm it.
return 0;
}
@@ -922,7 +922,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
if( !status_isdead(src) )
skill->counter_additional_effect( src, bl, skill_id, skill_lv, flag, gettick() );
if (sce) {
- clif_specialeffect(bl, 462, AREA);
+ clif->specialeffect(bl, 462, AREA);
skill->blown(src,bl,sce->val3,-1,0);
}
//Both need to be consumed if they are active.
@@ -1117,7 +1117,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
int dy[8]={1,1,0,-1,-1,-1,0,1};
uint8 dir = map_calc_dir(bl, src->x, src->y);
if( unit_movepos(bl, src->x-dx[dir], src->y-dy[dir], 1, 1) ) {
- clif_slide(bl,src->x-dx[dir],src->y-dy[dir]);
+ clif->slide(bl,src->x-dx[dir],src->y-dy[dir]);
unit_setdir(bl, dir);
}
d->dmg_lv = ATK_DEF;
@@ -1155,7 +1155,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
if( s_bl->type == BL_PC )
((TBL_PC*)s_bl)->shadowform_id = 0;
} else {
- status_damage(bl, s_bl, damage, 0, clif_damage(s_bl, s_bl, gettick(), 500, 500, damage, -1, 0, 0), 0);
+ status_damage(bl, s_bl, damage, 0, clif->damage(s_bl, s_bl, gettick(), 500, 500, damage, -1, 0, 0), 0);
return ATK_NONE;
}
}
@@ -3527,8 +3527,8 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
rnd()%100 < tsc->data[SC_REJECTSWORD]->val2
) {
ATK_RATER(50)
- status_fix_damage(target,src,wd.damage,clif_damage(target,src,gettick(),0,0,wd.damage,0,0,0));
- clif_skill_nodamage(target,target,ST_REJECTSWORD,tsc->data[SC_REJECTSWORD]->val1,1);
+ status_fix_damage(target,src,wd.damage,clif->damage(target,src,gettick(),0,0,wd.damage,0,0,0));
+ clif->skill_nodamage(target,target,ST_REJECTSWORD,tsc->data[SC_REJECTSWORD]->val1,1);
if( --(tsc->data[SC_REJECTSWORD]->val3) <= 0 )
status_change_end(target, SC_REJECTSWORD, INVALID_TIMER);
}
@@ -4578,9 +4578,9 @@ int battle_calc_return_damage(struct block_list* bl, struct block_list *src, int
if (ratio > 5000) ratio = 5000; // Maximum of 5000% ATK
rdamage = rdamage * ratio / 100 + (*dmg) * (10 + sc->data[SC_CRESCENTELBOW]->val1 * 20 / 10) / 10;
skill->blown(bl, src, skill->get_blewcount(SR_CRESCENTELBOW_AUTOSPELL, sc->data[SC_CRESCENTELBOW]->val1), unit_getdir(src), 0);
- clif_skill_damage(bl, src, gettick(), status_get_amotion(src), 0, rdamage,
+ clif->skill_damage(bl, src, gettick(), status_get_amotion(src), 0, rdamage,
1, SR_CRESCENTELBOW_AUTOSPELL, sc->data[SC_CRESCENTELBOW]->val1, 6); // This is how official does
- clif_damage(src, bl, gettick(), status_get_amotion(src)+1000, 0, rdamage/10, 1, 0, 0);
+ clif->damage(src, bl, gettick(), status_get_amotion(src)+1000, 0, rdamage/10, 1, 0, 0);
status_damage(src, bl, status_damage(bl, src, rdamage, 0, 0, 1)/10, 0, 0, 1);
status_change_end(bl, SC_CRESCENTELBOW, INVALID_TIMER);
return 0; // Just put here to minimize redundancy
@@ -4602,7 +4602,7 @@ int battle_calc_return_damage(struct block_list* bl, struct block_list *src, int
int rd1 = 0;
rd1 = min(damage,status_get_max_hp(bl)) * sc->data[SC_DEATHBOUND]->val2 / 100; // Amplify damage.
*dmg = rd1 * 30 / 100; // Received damage = 30% of amplifly damage.
- clif_skill_damage(src,bl,gettick(), status_get_amotion(src), 0, -30000, 1, RK_DEATHBOUND, sc->data[SC_DEATHBOUND]->val1,6);
+ clif->skill_damage(src,bl,gettick(), status_get_amotion(src), 0, -30000, 1, RK_DEATHBOUND, sc->data[SC_DEATHBOUND]->val1,6);
status_change_end(bl,SC_DEATHBOUND,INVALID_TIMER);
rdamage += rd1;
if (rdamage < 1) rdamage = 1;
@@ -4695,7 +4695,7 @@ int battle_damage_area( struct block_list *bl, va_list ap) {
battle->delay_damage(tick, amotion,src,bl,0,CR_REFLECTSHIELD,0,damage,ATK_DEF,0,true);
else
status_fix_damage(src,bl,damage,0);
- clif_damage(bl,bl,tick,amotion,dmotion,damage,1,ATK_BLOCK,0);
+ clif->damage(bl,bl,tick,amotion,dmotion,damage,1,ATK_BLOCK,0);
skill->additional_effect(src, bl, CR_REFLECTSHIELD, 1, BF_WEAPON|BF_SHORT|BF_NORMAL,ATK_DEF,tick);
map_freeblock_unlock();
}
@@ -4740,7 +4740,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
{
int index = sd->equip_index[EQI_AMMO];
if (index<0) {
- clif_arrow_fail(sd,0);
+ clif->arrow_fail(sd,0);
return ATK_NONE;
}
//Ammo check by Ishizu-chan
@@ -4748,7 +4748,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
switch (sd->status.weapon) {
case W_BOW:
if (sd->inventory_data[index]->look != A_ARROW) {
- clif_arrow_fail(sd,0);
+ clif->arrow_fail(sd,0);
return ATK_NONE;
}
break;
@@ -4757,13 +4757,13 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
case W_GATLING:
case W_SHOTGUN:
if (sd->inventory_data[index]->look != A_BULLET) {
- clif_arrow_fail(sd,0);
+ clif->arrow_fail(sd,0);
return ATK_NONE;
}
break;
case W_GRENADE:
if (sd->inventory_data[index]->look != A_GRENADE) {
- clif_arrow_fail(sd,0);
+ clif->arrow_fail(sd,0);
return ATK_NONE;
}
break;
@@ -4784,8 +4784,8 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
if(dist <= 0 || (!map_check_dir(dir,t_dir) && dist <= tstatus->rhw.range+1))
{
uint16 skill_lv = tsc->data[SC_AUTOCOUNTER]->val1;
- clif_skillcastcancel(target); //Remove the casting bar. [Skotlex]
- clif_damage(src, target, tick, sstatus->amotion, 1, 0, 1, 0, 0); //Display MISS.
+ clif->skillcastcancel(target); //Remove the casting bar. [Skotlex]
+ clif->damage(src, target, tick, sstatus->amotion, 1, 0, 1, 0, 0); //Display MISS.
status_change_end(target, SC_AUTOCOUNTER, INVALID_TIMER);
skill->attack(BF_WEAPON,target,target,src,KN_AUTOCOUNTER,skill_lv,tick,0);
return ATK_BLOCK;
@@ -4799,8 +4799,8 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
status_change_end(target, SC_BLADESTOP_WAIT, INVALID_TIMER);
if(sc_start4(src, SC_BLADESTOP, 100, sd?pc_checkskill(sd, MO_BLADESTOP):5, 0, 0, target->id, duration))
{ //Target locked.
- clif_damage(src, target, tick, sstatus->amotion, 1, 0, 1, 0, 0); //Display MISS.
- clif_bladestop(target, src->id, 1);
+ clif->damage(src, target, tick, sstatus->amotion, 1, 0, 1, 0, 0); //Display MISS.
+ clif->bladestop(target, src->id, 1);
sc_start4(target, SC_BLADESTOP, 100, skill_lv, 0, 0, src->id, duration);
return ATK_BLOCK;
}
@@ -4910,14 +4910,14 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
if( src != target )// Don't reflect your own damage (Grand Cross)
map_foreachinshootrange(battle->damage_area,target,skill->get_splash(LG_REFLECTDAMAGE,1),BL_CHAR,tick,target,wd.amotion,wd.dmotion,rdamage,tstatus->race,0);
} else {
- rdelay = clif_damage(src, src, tick, wd.amotion, sstatus->dmotion, rdamage, 1, 4, 0);
+ rdelay = clif->damage(src, src, tick, wd.amotion, sstatus->dmotion, rdamage, 1, 4, 0);
//Use Reflect Shield to signal this kind of skill trigger. [Skotlex]
skill->additional_effect(target,src,CR_REFLECTSHIELD,1,BF_WEAPON|BF_SHORT|BF_NORMAL,ATK_DEF,tick);
}
}
}
- wd.dmotion = clif_damage(src, target, tick, wd.amotion, wd.dmotion, wd.damage, wd.div_ , wd.type, wd.damage2);
+ wd.dmotion = clif->damage(src, target, tick, wd.amotion, wd.dmotion, wd.damage, wd.div_ , wd.type, wd.damage2);
if (sd && sd->bonus.splash_range > 0 && damage > 0)
skill->castend_damage_id(src, target, 0, 1, tick, 0);
@@ -4939,7 +4939,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
(d_bl->type == BL_PC && ((TBL_PC*)d_bl)->devotion[sce->val2] == target->id)
) && check_distance_bl(target, d_bl, sce->val3) )
{
- clif_damage(d_bl, d_bl, gettick(), 0, 0, damage, 0, 0, 0);
+ clif->damage(d_bl, d_bl, gettick(), 0, 0, damage, 0, 0, 0);
status_fix_damage(NULL, d_bl, damage, 0);
}
else
@@ -4947,16 +4947,16 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
} else if( tsc->data[SC_CIRCLE_OF_FIRE_OPTION] && (wd.flag&BF_SHORT) && target->type == BL_PC ) {
struct elemental_data *ed = ((TBL_PC*)target)->ed;
if( ed ) {
- clif_skill_damage(&ed->bl, target, tick, status_get_amotion(src), 0, -30000, 1, EL_CIRCLE_OF_FIRE, tsc->data[SC_CIRCLE_OF_FIRE_OPTION]->val1, 6);
+ clif->skill_damage(&ed->bl, target, tick, status_get_amotion(src), 0, -30000, 1, EL_CIRCLE_OF_FIRE, tsc->data[SC_CIRCLE_OF_FIRE_OPTION]->val1, 6);
skill->attack(BF_MAGIC,&ed->bl,&ed->bl,src,EL_CIRCLE_OF_FIRE,tsc->data[SC_CIRCLE_OF_FIRE_OPTION]->val1,tick,wd.flag);
}
} else if( tsc->data[SC_WATER_SCREEN_OPTION] && tsc->data[SC_WATER_SCREEN_OPTION]->val1 ) {
struct block_list *e_bl = map_id2bl(tsc->data[SC_WATER_SCREEN_OPTION]->val1);
if( e_bl && !status_isdead(e_bl) ) {
- clif_damage(e_bl,e_bl,tick,wd.amotion,wd.dmotion,damage,wd.div_,wd.type,wd.damage2);
+ clif->damage(e_bl,e_bl,tick,wd.amotion,wd.dmotion,damage,wd.div_,wd.type,wd.damage2);
status_damage(target,e_bl,damage,0,0,0);
// Just show damage in target.
- clif_damage(src, target, tick, wd.amotion, wd.dmotion, damage, wd.div_, wd.type, wd.damage2 );
+ clif->damage(src, target, tick, wd.amotion, wd.dmotion, damage, wd.div_, wd.type, wd.damage2 );
map_freeblock_unlock();
return ATK_NONE;
}
@@ -5021,7 +5021,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
}
if( type != CAST_GROUND ){
- clif_skill_fail(sd,r_skill,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,r_skill,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return wd.dmg_lv;
}
@@ -5043,7 +5043,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
sd->state.autocast = 0;
sd->ud.canact_tick = tick + skill->delay_fix(src, r_skill, r_lv);
- clif_status_change(src, SI_ACTIONDELAY, 1, skill->delay_fix(src, r_skill, r_lv), 0, 0, 1);
+ clif->status_change(src, SI_ACTIONDELAY, 1, skill->delay_fix(src, r_skill, r_lv), 0, 0, 1);
}
}
diff --git a/src/map/battleground.c b/src/map/battleground.c
index 7b605066d..c6a33024a 100644
--- a/src/map/battleground.c
+++ b/src/map/battleground.c
@@ -71,7 +71,7 @@ int bg_team_warp(int bg_id, unsigned short mapindex, short x, short y)
int bg_send_dot_remove(struct map_session_data *sd)
{
if( sd && sd->bg_id )
- clif_bg_xy_remove(sd);
+ clif->bg_xy_remove(sd);
return 0;
}
@@ -97,11 +97,11 @@ int bg_team_join(int bg_id, struct map_session_data *sd)
for( i = 0; i < MAX_BG_MEMBERS; i++ )
{
if( (pl_sd = bg->members[i].sd) != NULL && pl_sd != sd )
- clif_hpmeter_single(sd->fd, pl_sd->bl.id, pl_sd->battle_status.hp, pl_sd->battle_status.max_hp);
+ clif->hpmeter_single(sd->fd, pl_sd->bl.id, pl_sd->battle_status.hp, pl_sd->battle_status.max_hp);
}
- clif_bg_hp(sd);
- clif_bg_xy(sd);
+ clif->bg_hp(sd);
+ clif->bg_xy(sd);
return 1;
}
@@ -130,7 +130,7 @@ int bg_team_leave(struct map_session_data *sd, int flag)
sprintf(output, "Server : %s has quit the game...", sd->status.name);
else
sprintf(output, "Server : %s is leaving the battlefield...", sd->status.name);
- clif_bg_message(bg, 0, "Server", output, strlen(output) + 1);
+ clif->bg_message(bg, 0, "Server", output, strlen(output) + 1);
if( bg->logout_event[0] && flag )
npc_event(sd, bg->logout_event, 0);
@@ -212,7 +212,7 @@ int bg_send_message(struct map_session_data *sd, const char *mes, int len)
nullpo_ret(sd);
if( sd->bg_id == 0 || (bg = bg_team_search(sd->bg_id)) == NULL )
return 0;
- clif_bg_message(bg, sd->bl.id, sd->status.name, mes, len);
+ clif->bg_message(bg, sd->bl.id, sd->status.name, mes, len);
return 0;
}
@@ -233,7 +233,7 @@ int bg_send_xy_timer_sub(DBKey key, DBData *data, va_list ap)
{ // xy update
bg->members[i].x = sd->bl.x;
bg->members[i].y = sd->bl.y;
- clif_bg_xy(sd);
+ clif->bg_xy(sd);
}
}
return 0;
diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c
index 8e3c21bd4..bd7d92727 100644
--- a/src/map/buyingstore.c
+++ b/src/map/buyingstore.c
@@ -9,7 +9,7 @@
#include "atcommand.h" // msg_txt
#include "battle.h" // battle_config.*
#include "buyingstore.h" // struct s_buyingstore
-#include "clif.h" // clif_buyingstore_*
+#include "clif.h" // clif->buyingstore_*
#include "log.h" // log_pick_pc, log_zeny
#include "pc.h" // struct map_session_data
@@ -58,13 +58,13 @@ bool buyingstore_setup(struct map_session_data* sd, unsigned char slots)
if( map[sd->bl.m].flag.novending )
{// custom: no vending maps
- clif_displaymessage(sd->fd, msg_txt(276)); // "You can't open a shop on this map"
+ clif->displaymessage(sd->fd, msg_txt(276)); // "You can't open a shop on this map"
return false;
}
if( map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING) )
{// custom: no vending cells
- clif_displaymessage(sd->fd, msg_txt(204)); // "You can't open a shop on this cell."
+ clif->displaymessage(sd->fd, msg_txt(204)); // "You can't open a shop on this cell."
return false;
}
@@ -75,7 +75,7 @@ bool buyingstore_setup(struct map_session_data* sd, unsigned char slots)
}
sd->buyingstore.slots = slots;
- clif_buyingstore_open(sd);
+ clif->buyingstore_open(sd);
return true;
}
@@ -94,15 +94,15 @@ void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha
if( !battle_config.feature_buying_store || pc_istrading(sd) || sd->buyingstore.slots == 0 || count > sd->buyingstore.slots || zenylimit <= 0 || zenylimit > sd->status.zeny || !storename[0] )
{// disabled or invalid input
sd->buyingstore.slots = 0;
- clif_buyingstore_open_failed(sd, BUYINGSTORE_CREATE, 0);
+ clif->buyingstore_open_failed(sd, BUYINGSTORE_CREATE, 0);
return;
}
if( !pc_can_give_items(sd) )
{// custom: GM is not allowed to buy (give zeny)
sd->buyingstore.slots = 0;
- clif_displaymessage(sd->fd, msg_txt(246));
- clif_buyingstore_open_failed(sd, BUYINGSTORE_CREATE, 0);
+ clif->displaymessage(sd->fd, msg_txt(246));
+ clif->buyingstore_open_failed(sd, BUYINGSTORE_CREATE, 0);
return;
}
@@ -113,13 +113,13 @@ void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha
if( map[sd->bl.m].flag.novending )
{// custom: no vending maps
- clif_displaymessage(sd->fd, msg_txt(276)); // "You can't open a shop on this map"
+ clif->displaymessage(sd->fd, msg_txt(276)); // "You can't open a shop on this map"
return;
}
if( map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING) )
{// custom: no vending cells
- clif_displaymessage(sd->fd, msg_txt(204)); // "You can't open a shop on this cell."
+ clif->displaymessage(sd->fd, msg_txt(204)); // "You can't open a shop on this cell."
return;
}
@@ -174,14 +174,14 @@ void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha
if( i != count )
{// invalid item/amount/price
sd->buyingstore.slots = 0;
- clif_buyingstore_open_failed(sd, BUYINGSTORE_CREATE, 0);
+ clif->buyingstore_open_failed(sd, BUYINGSTORE_CREATE, 0);
return;
}
if( (sd->max_weight*90)/100 < weight )
{// not able to carry all wanted items without getting overweight (90%)
sd->buyingstore.slots = 0;
- clif_buyingstore_open_failed(sd, BUYINGSTORE_CREATE_OVERWEIGHT, weight);
+ clif->buyingstore_open_failed(sd, BUYINGSTORE_CREATE_OVERWEIGHT, weight);
return;
}
@@ -191,8 +191,8 @@ void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha
sd->buyingstore.zenylimit = zenylimit;
sd->buyingstore.slots = i; // store actual amount of items
safestrncpy(sd->message, storename, sizeof(sd->message));
- clif_buyingstore_myitemlist(sd);
- clif_buyingstore_entry(sd);
+ clif->buyingstore_myitemlist(sd);
+ clif->buyingstore_entry(sd);
}
@@ -205,7 +205,7 @@ void buyingstore_close(struct map_session_data* sd)
memset(&sd->buyingstore, 0, sizeof(sd->buyingstore));
// notify other players
- clif_buyingstore_disappear_entry(sd);
+ clif->buyingstore_disappear_entry(sd);
}
}
@@ -221,7 +221,7 @@ void buyingstore_open(struct map_session_data* sd, int account_id)
if( !pc_can_give_items(sd) )
{// custom: GM is not allowed to sell
- clif_displaymessage(sd->fd, msg_txt(246));
+ clif->displaymessage(sd->fd, msg_txt(246));
return;
}
@@ -236,7 +236,7 @@ void buyingstore_open(struct map_session_data* sd, int account_id)
}
// success
- clif_buyingstore_itemlist(sd, pl_sd);
+ clif->buyingstore_itemlist(sd, pl_sd);
}
@@ -253,26 +253,26 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int
if( !battle_config.feature_buying_store || pc_istrading(sd) )
{// not allowed to sell
- clif_buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, 0);
+ clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, 0);
return;
}
if( !pc_can_give_items(sd) )
{// custom: GM is not allowed to sell
- clif_displaymessage(sd->fd, msg_txt(246));
- clif_buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, 0);
+ clif->displaymessage(sd->fd, msg_txt(246));
+ clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, 0);
return;
}
if( ( pl_sd = map_id2sd(account_id) ) == NULL || !pl_sd->state.buyingstore || pl_sd->buyer_id != buyer_id )
{// not online, not buying or not same store
- clif_buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, 0);
+ clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, 0);
return;
}
if( !searchstore_queryremote(sd, account_id) && ( sd->bl.m != pl_sd->bl.m || !check_distance_bl(&sd->bl, &pl_sd->bl, AREA_SIZE) ) )
{// out of view range
- clif_buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, 0);
+ clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, 0);
return;
}
@@ -301,53 +301,53 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int
{// duplicate
ShowWarning("buyingstore_trade: Found duplicate item on selling list (prevnameid=%hu, prevamount=%hu, nameid=%hu, amount=%hu, account_id=%d, char_id=%d).\n",
RBUFW(itemlist,k*6+2), RBUFW(itemlist,k*6+4), nameid, amount, sd->status.account_id, sd->status.char_id);
- clif_buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, nameid);
+ clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, nameid);
return;
}
}
if( index < 0 || index >= ARRAYLENGTH(sd->status.inventory) || sd->inventory_data[index] == NULL || sd->status.inventory[index].nameid != nameid || sd->status.inventory[index].amount < amount )
{// invalid input
- clif_buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, nameid);
+ clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, nameid);
return;
}
if( sd->status.inventory[index].expire_time || !itemdb_cantrade(&sd->status.inventory[index], pc_get_group_level(sd), pc_get_group_level(pl_sd)) || memcmp(sd->status.inventory[index].card, buyingstore_blankslots, sizeof(buyingstore_blankslots)) )
{// non-tradable item
- clif_buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, nameid);
+ clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, nameid);
return;
}
ARR_FIND( 0, pl_sd->buyingstore.slots, listidx, pl_sd->buyingstore.items[listidx].nameid == nameid );
if( listidx == pl_sd->buyingstore.slots || pl_sd->buyingstore.items[listidx].amount == 0 )
{// there is no such item or the buyer has already bought all of them
- clif_buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, nameid);
+ clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, nameid);
return;
}
if( pl_sd->buyingstore.items[listidx].amount < amount )
{// buyer does not need that much of the item
- clif_buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_COUNT, nameid);
+ clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_COUNT, nameid);
return;
}
if( pc_checkadditem(pl_sd, nameid, amount) == ADDITEM_OVERAMOUNT )
{// buyer does not have enough space for this item
- clif_buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, nameid);
+ clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, nameid);
return;
}
if( amount*(unsigned int)sd->inventory_data[index]->weight > pl_sd->max_weight-weight )
{// normally this is not supposed to happen, as the total weight is
// checked upon creation, but the buyer could have gained items
- clif_buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, nameid);
+ clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, nameid);
return;
}
weight+= amount*sd->inventory_data[index]->weight;
if( amount*pl_sd->buyingstore.items[listidx].price > pl_sd->buyingstore.zenylimit-zeny )
{// buyer does not have enough zeny
- clif_buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_ZENY, nameid);
+ clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_ZENY, nameid);
return;
}
zeny+= amount*pl_sd->buyingstore.items[listidx].price;
@@ -377,19 +377,19 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int
pl_sd->buyingstore.zenylimit-= zeny;
// notify clients
- clif_buyingstore_delete_item(sd, index, amount, pl_sd->buyingstore.items[listidx].price);
- clif_buyingstore_update_item(pl_sd, nameid, amount);
+ clif->buyingstore_delete_item(sd, index, amount, pl_sd->buyingstore.items[listidx].price);
+ clif->buyingstore_update_item(pl_sd, nameid, amount);
}
// check whether or not there is still something to buy
ARR_FIND( 0, pl_sd->buyingstore.slots, i, pl_sd->buyingstore.items[i].amount != 0 );
if( i == pl_sd->buyingstore.slots )
{// everything was bought
- clif_buyingstore_trade_failed_buyer(pl_sd, BUYINGSTORE_TRADE_BUYER_NO_ITEMS);
+ clif->buyingstore_trade_failed_buyer(pl_sd, BUYINGSTORE_TRADE_BUYER_NO_ITEMS);
}
else if( pl_sd->buyingstore.zenylimit == 0 )
{// zeny limit reached
- clif_buyingstore_trade_failed_buyer(pl_sd, BUYINGSTORE_TRADE_BUYER_ZENY);
+ clif->buyingstore_trade_failed_buyer(pl_sd, BUYINGSTORE_TRADE_BUYER_ZENY);
}
else
{// continue buying
diff --git a/src/map/chat.c b/src/map/chat.c
index 33798d563..98f866133 100644
--- a/src/map/chat.c
+++ b/src/map/chat.c
@@ -83,13 +83,13 @@ int chat_createpcchat(struct map_session_data* sd, const char* title, const char
if( map[sd->bl.m].flag.nochat )
{
- clif_displaymessage(sd->fd, msg_txt(281));
+ clif->displaymessage(sd->fd, msg_txt(281));
return 0; //Can't create chatrooms on this map.
}
if( map_getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNOCHAT) )
{
- clif_displaymessage (sd->fd, msg_txt(665));
+ clif->displaymessage (sd->fd, msg_txt(665));
return 0;
}
@@ -101,11 +101,11 @@ int chat_createpcchat(struct map_session_data* sd, const char* title, const char
cd->users = 1;
cd->usersd[0] = sd;
pc_setchatid(sd,cd->bl.id);
- clif_createchat(sd,0);
- clif_dispchat(cd,0);
+ clif->createchat(sd,0);
+ clif->dispchat(cd,0);
}
else
- clif_createchat(sd,1);
+ clif->createchat(sd,1);
return 0;
}
@@ -122,32 +122,32 @@ int chat_joinchat(struct map_session_data* sd, int chatid, const char* pass)
if( cd == NULL || cd->bl.type != BL_CHAT || cd->bl.m != sd->bl.m || sd->state.vending || sd->state.buyingstore || sd->chatID || ((cd->owner->type == BL_NPC) ? cd->users+1 : cd->users) >= cd->limit )
{
- clif_joinchatfail(sd,0);
+ clif->joinchatfail(sd,0);
return 0;
}
if( !cd->pub && strncmp(pass, cd->pass, sizeof(cd->pass)) != 0 && !pc_has_permission(sd, PC_PERM_JOIN_ALL_CHAT) )
{
- clif_joinchatfail(sd,1);
+ clif->joinchatfail(sd,1);
return 0;
}
if( sd->status.base_level < cd->minLvl || sd->status.base_level > cd->maxLvl ) {
if(sd->status.base_level < cd->minLvl)
- clif_joinchatfail(sd,5);
+ clif->joinchatfail(sd,5);
else
- clif_joinchatfail(sd,6);
+ clif->joinchatfail(sd,6);
return 0;
}
if( sd->status.zeny < cd->zeny ) {
- clif_joinchatfail(sd,4);
+ clif->joinchatfail(sd,4);
return 0;
}
if( cd->owner->type != BL_NPC && idb_exists(cd->kick_list,sd->status.char_id) ) {
- clif_joinchatfail(sd,2);//You have been kicked out of the room.
+ clif->joinchatfail(sd,2);//You have been kicked out of the room.
return 0;
}
@@ -157,9 +157,9 @@ int chat_joinchat(struct map_session_data* sd, int chatid, const char* pass)
pc_setchatid(sd,cd->bl.id);
- clif_joinchatok(sd, cd); //To the person who newly joined the list of all
- clif_addchat(cd, sd); //Reports To the person who already in the chat
- clif_dispchat(cd, 0); //Reported number of changes to the people around
+ clif->joinchatok(sd, cd); //To the person who newly joined the list of all
+ clif->addchat(cd, sd); //Reports To the person who already in the chat
+ clif->dispchat(cd, 0); //Reported number of changes to the people around
chat_triggerevent(cd); //Event
@@ -192,7 +192,7 @@ int chat_leavechat(struct map_session_data* sd, bool kicked)
return -1;
}
- clif_leavechat(cd, sd, kicked);
+ clif->leavechat(cd, sd, kicked);
pc_setchatid(sd, 0);
cd->users--;
@@ -206,7 +206,7 @@ int chat_leavechat(struct map_session_data* sd, bool kicked)
struct skill_unit* unit;
struct skill_unit_group* group;
- clif_clearchat(cd, 0);
+ clif->clearchat(cd, 0);
db_destroy(cd->kick_list);
map_deliddb(&cd->bl);
map_delblock(&cd->bl);
@@ -223,8 +223,8 @@ int chat_leavechat(struct map_session_data* sd, bool kicked)
if( leavechar == 0 && cd->owner->type == BL_PC )
{ // Set and announce new owner
cd->owner = (struct block_list*) cd->usersd[0];
- clif_changechatowner(cd, cd->usersd[0]);
- clif_clearchat(cd, 0);
+ clif->changechatowner(cd, cd->usersd[0]);
+ clif->clearchat(cd, 0);
//Adjust Chat location after owner has been changed.
map_delblock( &cd->bl );
@@ -232,10 +232,10 @@ int chat_leavechat(struct map_session_data* sd, bool kicked)
cd->bl.y=cd->usersd[0]->bl.y;
map_addblock( &cd->bl );
- clif_dispchat(cd,0);
+ clif->dispchat(cd,0);
}
else
- clif_dispchat(cd,0); // refresh chatroom
+ clif->dispchat(cd,0); // refresh chatroom
return 0;
}
@@ -260,11 +260,11 @@ int chat_changechatowner(struct map_session_data* sd, const char* nextownername)
return -1; // name not found
// erase temporarily
- clif_clearchat(cd,0);
+ clif->clearchat(cd,0);
// set new owner
cd->owner = (struct block_list*) cd->usersd[i];
- clif_changechatowner(cd,cd->usersd[i]);
+ clif->changechatowner(cd,cd->usersd[i]);
// swap the old and new owners' positions
tmpsd = cd->usersd[i];
@@ -278,7 +278,7 @@ int chat_changechatowner(struct map_session_data* sd, const char* nextownername)
map_addblock( &cd->bl );
// and display again
- clif_dispchat(cd,0);
+ clif->dispchat(cd,0);
return 0;
}
@@ -301,8 +301,8 @@ int chat_changechatstatus(struct map_session_data* sd, const char* title, const
cd->limit = min(limit, ARRAYLENGTH(cd->usersd));
cd->pub = pub;
- clif_changechatstatus(cd);
- clif_dispchat(cd,0);
+ clif->changechatstatus(cd);
+ clif->dispchat(cd,0);
return 0;
}
@@ -355,7 +355,7 @@ int chat_createnpcchat(struct npc_data* nd, const char* title, int limit, bool p
if( cd ) {
nd->chat_id = cd->bl.id;
- clif_dispchat(cd,0);
+ clif->dispchat(cd,0);
}
return 0;
@@ -372,7 +372,7 @@ int chat_deletenpcchat(struct npc_data* nd)
return 0;
chat_npckickall(cd);
- clif_clearchat(cd, 0);
+ clif->clearchat(cd, 0);
map_deliddb(&cd->bl);
map_delblock(&cd->bl);
map_freeblock(&cd->bl);
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 484e48df8..d3abb8680 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -330,8 +330,8 @@ int chrif_connect(int fd) {
memcpy(WFIFOP(fd,2), userid, NAME_LENGTH);
memcpy(WFIFOP(fd,26), passwd, NAME_LENGTH);
WFIFOL(fd,50) = 0;
- WFIFOL(fd,54) = htonl(clif_getip());
- WFIFOW(fd,58) = htons(clif_getport());
+ WFIFOL(fd,54) = htonl(clif->map_ip);
+ WFIFOW(fd,58) = htons(clif->map_port);
WFIFOSET(fd,60);
return 0;
@@ -400,7 +400,7 @@ int chrif_changemapserver(struct map_session_data* sd, uint32 ip, uint16 port) {
nullpo_retr(-1, sd);
if (other_mapserver_count < 1) {//No other map servers are online!
- clif_authfail_fd(sd->fd, 0);
+ clif->authfail_fd(sd->fd, 0);
return -1;
}
@@ -435,9 +435,9 @@ int chrif_changemapserverack(int account_id, int login_id1, int login_id2, int c
if ( !login_id1 ) {
ShowError("map server change failed.\n");
- clif_authfail_fd(node->fd, 0);
+ clif->authfail_fd(node->fd, 0);
} else
- clif_changemapserver(node->sd, map_index, x, y, ntohl(ip), ntohs(port));
+ clif->changemapserver(node->sd, map_index, x, y, ntohl(ip), ntohs(port));
//Player has been saved already, remove him from memory. [Skotlex]
chrif_auth_delete(account_id, char_id, ST_MAPCHANGE);
@@ -498,7 +498,7 @@ static int chrif_reconnect(DBKey key, DBData *data, va_list ap) {
if( map_mapname2ipport(sd->mapindex,&ip,&port) == 0 )
chrif_changemapserver(sd, ip, port);
else //too much lag/timeout is the closest explanation for this error.
- clif_authfail_fd(sd->fd, 3);
+ clif->authfail_fd(sd->fd, 3);
break;
}
@@ -673,7 +673,7 @@ void chrif_authfail(int fd) {/* HELLO WORLD. ip in RFIFOL 15 is not being used (
node->sex == sex &&
node->state == ST_LOGIN )
{// found a match
- clif_authfail_fd(node->fd, 0);
+ clif->authfail_fd(node->fd, 0);
chrif_auth_delete(account_id, char_id, ST_LOGIN);
}
}
@@ -811,10 +811,10 @@ int chrif_changesex(struct map_session_data *sd) {
WFIFOW(char_fd,30) = 5;
WFIFOSET(char_fd,44);
- clif_displaymessage(sd->fd, msg_txt(408)); //"Need disconnection to perform change-sex request..."
+ clif->displaymessage(sd->fd, msg_txt(408)); //"Need disconnection to perform change-sex request..."
if (sd->fd)
- clif_authfail_fd(sd->fd, 15);
+ clif->authfail_fd(sd->fd, 15);
else
map_quit(sd);
return 0;
@@ -856,7 +856,7 @@ static void chrif_char_ask_name_answer(int acc, const char* player_name, uint16
default: output[0] = '\0'; break;
}
- clif_displaymessage(sd->fd, output);
+ clif->displaymessage(sd->fd, output);
}
/*==========================================
@@ -897,7 +897,7 @@ int chrif_changedsex(int fd) {
sd->status.skill[i].lv = 0;
}
}
- clif_updatestatus(sd, SP_SKILLPOINT);
+ clif->updatestatus(sd, SP_SKILLPOINT);
// change job if necessary
if (sd->status.sex) //Changed from Dancer
sd->status.class_ -= 1;
@@ -908,7 +908,7 @@ int chrif_changedsex(int fd) {
// save character
sd->login_id1++; // change identify, because if player come back in char within the 5 seconds, he can change its characters
// do same modify in login-server for the account, but no in char-server (it ask again login_id1 to login, and don't remember it)
- clif_displaymessage(sd->fd, msg_txt(409)); //"Your sex has been changed (need disconnection by the server)..."
+ clif->displaymessage(sd->fd, msg_txt(409)); //"Your sex has been changed (need disconnection by the server)..."
set_eof(sd->fd); // forced to disconnect for the change
map_quit(sd); // Remove leftovers (e.g. autotrading) [Paradox924X]
}
@@ -967,7 +967,7 @@ int chrif_deadopt(int father_id, int mother_id, int child_id) {
sd->status.skill[WE_CALLBABY].id = 0;
sd->status.skill[WE_CALLBABY].lv = 0;
sd->status.skill[WE_CALLBABY].flag = 0;
- clif_deleteskill(sd,WE_CALLBABY);
+ clif->deleteskill(sd,WE_CALLBABY);
}
if( mother_id && ( sd = map_charid2sd(mother_id) ) != NULL && sd->status.child == child_id ) {
@@ -975,7 +975,7 @@ int chrif_deadopt(int father_id, int mother_id, int child_id) {
sd->status.skill[WE_CALLBABY].id = 0;
sd->status.skill[WE_CALLBABY].lv = 0;
sd->status.skill[WE_CALLBABY].flag = 0;
- clif_deleteskill(sd,WE_CALLBABY);
+ clif->deleteskill(sd,WE_CALLBABY);
}
return 0;
@@ -1004,18 +1004,18 @@ int chrif_accountban(int fd) {
if (RFIFOB(fd,6) == 0) { // 0: change of statut, 1: ban
int ret_status = RFIFOL(fd,7); // status or final date of a banishment
if(0<ret_status && ret_status<=9)
- clif_displaymessage(sd->fd, msg_txt(411+ret_status));
+ clif->displaymessage(sd->fd, msg_txt(411+ret_status));
else if(ret_status==100)
- clif_displaymessage(sd->fd, msg_txt(421));
+ clif->displaymessage(sd->fd, msg_txt(421));
else
- clif_displaymessage(sd->fd, msg_txt(420)); //"Your account has not more authorised."
+ clif->displaymessage(sd->fd, msg_txt(420)); //"Your account has not more authorised."
} else if (RFIFOB(fd,6) == 1) { // 0: change of statut, 1: ban
time_t timestamp;
char tmpstr[2048];
timestamp = (time_t)RFIFOL(fd,7); // status or final date of a banishment
strcpy(tmpstr, msg_txt(423)); //"Your account has been banished until "
strftime(tmpstr + strlen(tmpstr), 24, "%d-%m-%Y %H:%M:%S", localtime(&timestamp));
- clif_displaymessage(sd->fd, tmpstr);
+ clif->displaymessage(sd->fd, tmpstr);
}
set_eof(sd->fd); // forced to disconnect for the change
@@ -1048,11 +1048,11 @@ int chrif_disconnectplayer(int fd) {
}
switch(RFIFOB(fd, 6)) {
- case 1: clif_authfail_fd(sd->fd, 1); break; //server closed
- case 2: clif_authfail_fd(sd->fd, 2); break; //someone else logged in
- case 3: clif_authfail_fd(sd->fd, 4); break; //server overpopulated
- case 4: clif_authfail_fd(sd->fd, 10); break; //out of available time paid for
- case 5: clif_authfail_fd(sd->fd, 15); break; //forced to dc by gm
+ case 1: clif->authfail_fd(sd->fd, 1); break; //server closed
+ case 2: clif->authfail_fd(sd->fd, 2); break; //someone else logged in
+ case 3: clif->authfail_fd(sd->fd, 4); break; //server overpopulated
+ case 4: clif->authfail_fd(sd->fd, 10); break; //out of available time paid for
+ case 5: clif->authfail_fd(sd->fd, 15); break; //forced to dc by gm
}
return 0;
}
@@ -1349,7 +1349,7 @@ void chrif_update_ip(int fd) {
if (new_ip && new_ip != char_ip)
char_ip = new_ip; //Update char_ip
- new_ip = clif_refresh_ip();
+ new_ip = clif->refresh_ip();
if (!new_ip)
return; //No change
@@ -1425,7 +1425,7 @@ int chrif_parse(int fd) {
case 0x2afb: chrif_sendmapack(fd); break;
case 0x2afd: chrif_authok(fd); break;
case 0x2b00: map_setusers(RFIFOL(fd,2)); chrif_keepalive(fd); break;
- case 0x2b03: clif_charselectok(RFIFOL(fd,2), RFIFOB(fd,6)); break;
+ case 0x2b03: clif->charselectok(RFIFOL(fd,2), RFIFOB(fd,6)); break;
case 0x2b04: chrif_recvmap(fd); break;
case 0x2b06: chrif_changemapserverack(RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOL(fd,14), RFIFOW(fd,18), RFIFOW(fd,20), RFIFOW(fd,22), RFIFOL(fd,24), RFIFOW(fd,28)); break;
case 0x2b09: map_addnickdb(RFIFOL(fd,2), (char*)RFIFOP(fd,6)); break;
diff --git a/src/map/clif.c b/src/map/clif.c
index 0ddc5f6ea..120de98c2 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -183,12 +183,6 @@ static inline unsigned int mes_len_check(char* mes, unsigned int len, unsigned i
}
-static char map_ip_str[128];
-static uint32 map_ip;
-static uint32 bind_ip = INADDR_ANY;
-static uint16 map_port = 5121;
-int map_fd;
-
static int clif_parse (int fd);
/*==========================================
@@ -197,23 +191,23 @@ static int clif_parse (int fd);
int clif_setip(const char* ip)
{
char ip_str[16];
- map_ip = host2ip(ip);
- if (!map_ip) {
+ clif->map_ip = host2ip(ip);
+ if (!clif->map_ip) {
ShowWarning("Failed to Resolve Map Server Address! (%s)\n", ip);
return 0;
}
- safestrncpy(map_ip_str, ip, sizeof(map_ip_str));
- ShowInfo("Map Server IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%s"CL_RESET"'.\n", ip, ip2str(map_ip, ip_str));
+ safestrncpy(clif->map_ip_str, ip, sizeof(clif->map_ip_str));
+ ShowInfo("Map Server IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%s"CL_RESET"'.\n", ip, ip2str(clif->map_ip, ip_str));
return 1;
}
void clif_setbindip(const char* ip)
{
- bind_ip = host2ip(ip);
- if (bind_ip) {
+ clif->bind_ip = host2ip(ip);
+ if (clif->bind_ip) {
char ip_str[16];
- ShowInfo("Map Server Bind IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%s"CL_RESET"'.\n", ip, ip2str(bind_ip, ip_str));
+ ShowInfo("Map Server Bind IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%s"CL_RESET"'.\n", ip, ip2str(clif->bind_ip, ip_str));
} else {
ShowWarning("Failed to Resolve Map Server Address! (%s)\n", ip);
}
@@ -225,7 +219,7 @@ void clif_setbindip(const char* ip)
*------------------------------------------*/
void clif_setport(uint16 port)
{
- map_port = port;
+ clif->map_port = port;
}
/*==========================================
@@ -233,21 +227,7 @@ void clif_setport(uint16 port)
*------------------------------------------*/
uint32 clif_getip(void)
{
- return map_ip;
-}
-
-//Refreshes map_server ip, returns the new ip if the ip changed, otherwise it returns 0.
-uint32 clif_refresh_ip(void)
-{
- uint32 new_ip;
-
- new_ip = host2ip(map_ip_str);
- if (new_ip && new_ip != map_ip) {
- map_ip = new_ip;
- ShowInfo("Updating IP resolution of [%s].\n", map_ip_str);
- return map_ip;
- }
- return 0;
+ return clif->map_ip;
}
/*==========================================
@@ -255,23 +235,35 @@ uint32 clif_refresh_ip(void)
*------------------------------------------*/
uint16 clif_getport(void)
{
- return map_port;
+ return clif->map_port;
+}
+
+uint32 clif_refresh_ip(void) {
+ uint32 new_ip;
+
+ new_ip = host2ip(clif->map_ip_str);
+ if (new_ip && new_ip != clif->map_ip) {
+ clif->map_ip = new_ip;
+ ShowInfo("Updating IP resolution of [%s].\n", clif->map_ip_str);
+ return clif->map_ip;
+ }
+ return 0;
}
#if PACKETVER >= 20071106
static inline unsigned char clif_bl_type(struct block_list *bl) {
switch (bl->type) {
- case BL_PC: return disguised(bl)?0x1:0x0; //PC_TYPE
- case BL_ITEM: return 0x2; //ITEM_TYPE
- case BL_SKILL: return 0x3; //SKILL_TYPE
- case BL_CHAT: return 0x4; //UNKNOWN_TYPE
- case BL_MOB: return pcdb_checkid(status_get_viewdata(bl)->class_)?0x0:0x5; //NPC_MOB_TYPE
- case BL_NPC: return 0x6; //NPC_EVT_TYPE
- case BL_PET: return pcdb_checkid(status_get_viewdata(bl)->class_)?0x0:0x7; //NPC_PET_TYPE
- case BL_HOM: return 0x8; //NPC_HOM_TYPE
- case BL_MER: return 0x9; //NPC_MERSOL_TYPE
- case BL_ELEM: return 0xa; //NPC_ELEMENTAL_TYPE
- default: return 0x1; //NPC_TYPE
+ case BL_PC: return disguised(bl)?0x1:0x0; //PC_TYPE
+ case BL_ITEM: return 0x2; //ITEM_TYPE
+ case BL_SKILL: return 0x3; //SKILL_TYPE
+ case BL_CHAT: return 0x4; //UNKNOWN_TYPE
+ case BL_MOB: return pcdb_checkid(status_get_viewdata(bl)->class_)?0x0:0x5; //NPC_MOB_TYPE
+ case BL_NPC: return 0x6; //NPC_EVT_TYPE
+ case BL_PET: return pcdb_checkid(status_get_viewdata(bl)->class_)?0x0:0x7; //NPC_PET_TYPE
+ case BL_HOM: return 0x8; //NPC_HOM_TYPE
+ case BL_MER: return 0x9; //NPC_MERSOL_TYPE
+ case BL_ELEM: return 0xa; //NPC_ELEMENTAL_TYPE
+ default: return 0x1; //NPC_TYPE
}
}
#endif
@@ -305,30 +297,28 @@ static int clif_send_sub(struct block_list *bl, va_list ap)
nullpo_ret(src_bl = va_arg(ap,struct block_list*));
type = va_arg(ap,int);
- switch(type)
- {
- case AREA_WOS:
- if (bl == src_bl)
- return 0;
- break;
- case AREA_WOC:
- if (sd->chatID || bl == src_bl)
- return 0;
- break;
- case AREA_WOSC:
- {
- if(src_bl->type == BL_PC){
- struct map_session_data *ssd = (struct map_session_data *)src_bl;
- if (ssd && sd->chatID && (sd->chatID == ssd->chatID))
- return 0;
- }
- else if(src_bl->type == BL_NPC) {
- struct npc_data *nd = (struct npc_data *)src_bl;
- if (nd && sd->chatID && (sd->chatID == nd->chat_id))
- return 0;
+ switch(type) {
+ case AREA_WOS:
+ if (bl == src_bl)
+ return 0;
+ break;
+ case AREA_WOC:
+ if (sd->chatID || bl == src_bl)
+ return 0;
+ break;
+ case AREA_WOSC: {
+ if(src_bl->type == BL_PC){
+ struct map_session_data *ssd = (struct map_session_data *)src_bl;
+ if (ssd && sd->chatID && (sd->chatID == ssd->chatID))
+ return 0;
+ }
+ else if(src_bl->type == BL_NPC) {
+ struct npc_data *nd = (struct npc_data *)src_bl;
+ if (nd && sd->chatID && (sd->chatID == nd->chat_id))
+ return 0;
+ }
}
- }
- break;
+ break;
}
if (session[fd] == NULL)
@@ -336,7 +326,7 @@ static int clif_send_sub(struct block_list *bl, va_list ap)
WFIFOHEAD(fd, len);
if (WFIFOP(fd,0) == buf) {
- ShowError("WARNING: Invalid use of clif_send function\n");
+ ShowError("WARNING: Invalid use of clif->send function\n");
ShowError(" Packet x%4x use a WFIFO of a player instead of to use a buffer.\n", WBUFW(buf,0));
ShowError(" Please correct your code.\n");
// don't send to not move the pointer of the packet for next sessions in the loop
@@ -357,8 +347,7 @@ static int clif_send_sub(struct block_list *bl, va_list ap)
* Packet Delegation (called on all packets that require data to be sent to more than one client)
* functions that are sent solely to one use whose ID it posses use WFIFOSET
*------------------------------------------*/
-int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target type)
-{
+int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target type) {
int i;
struct map_session_data *sd, *tsd;
struct party_data *p = NULL;
@@ -376,10 +365,8 @@ int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target
case ALL_CLIENT: //All player clients.
iter = mapit_getallusers();
- while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL )
- {
- if( packet_db[tsd->packet_ver][RBUFW(buf,0)].len )
- { // packet must exist for the client version
+ while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL ) {
+ if( packet_db[tsd->packet_ver][RBUFW(buf,0)].len ) { // packet must exist for the client version
WFIFOHEAD(tsd->fd, len);
memcpy(WFIFOP(tsd->fd,0), buf, len);
WFIFOSET(tsd->fd,len);
@@ -390,10 +377,8 @@ int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target
case ALL_SAMEMAP: //All players on the same map
iter = mapit_getallusers();
- while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL )
- {
- if( bl->m == tsd->bl.m && packet_db[tsd->packet_ver][RBUFW(buf,0)].len )
- { // packet must exist for the client version
+ while( (tsd = (TBL_PC*)mapit_next(iter)) != NULL ) {
+ if( bl->m == tsd->bl.m && packet_db[tsd->packet_ver][RBUFW(buf,0)].len ) { // packet must exist for the client version
WFIFOHEAD(tsd->fd, len);
memcpy(WFIFOP(tsd->fd,0), buf, len);
WFIFOSET(tsd->fd,len);
@@ -405,7 +390,7 @@ int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target
case AREA:
case AREA_WOSC:
if (sd && bl->prev == NULL) //Otherwise source misses the packet.[Skotlex]
- clif_send (buf, len, bl, SELF);
+ clif->send (buf, len, bl, SELF);
case AREA_WOC:
case AREA_WOS:
map_foreachinarea(clif_send_sub, bl->m, bl->x-AREA_SIZE, bl->y-AREA_SIZE, bl->x+AREA_SIZE, bl->y+AREA_SIZE,
@@ -629,7 +614,7 @@ int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target
break;
default:
- ShowError("clif_send: Unrecognized type %d\n",type);
+ ShowError("clif->send: Unrecognized type %d\n",type);
return -1;
}
@@ -767,7 +752,7 @@ void clif_dropflooritem(struct flooritem_data* fitem)
WBUFB(buf,14) = fitem->suby;
WBUFW(buf,15) = fitem->item_data.amount;
- clif_send(buf, packet_len(0x9e), &fitem->bl, AREA);
+ clif->send(buf, packet_len(0x9e), &fitem->bl, AREA);
}
@@ -784,7 +769,7 @@ void clif_clearflooritem(struct flooritem_data *fitem, int fd)
WBUFL(buf,2) = fitem->bl.id;
if (fd == 0) {
- clif_send(buf, packet_len(0xa1), &fitem->bl, AREA);
+ clif->send(buf, packet_len(0xa1), &fitem->bl, AREA);
} else {
WFIFOHEAD(fd,packet_len(0xa1));
memcpy(WFIFOP(fd,0), buf, packet_len(0xa1));
@@ -828,11 +813,11 @@ void clif_clearunit_area(struct block_list* bl, clr_type type)
WBUFL(buf,2) = bl->id;
WBUFB(buf,6) = type;
- clif_send(buf, packet_len(0x80), bl, type == CLR_DEAD ? AREA : AREA_WOS);
+ clif->send(buf, packet_len(0x80), bl, type == CLR_DEAD ? AREA : AREA_WOS);
if(disguised(bl)) {
WBUFL(buf,2) = -bl->id;
- clif_send(buf, packet_len(0x80), bl, SELF);
+ clif->send(buf, packet_len(0x80), bl, SELF);
}
}
@@ -1211,7 +1196,7 @@ static void clif_setdisguise(struct block_list *bl, unsigned char *buf,int len)
#else
WBUFL(buf,2)=-bl->id;
#endif
- clif_send(buf, len, bl, SELF);
+ clif->send(buf, len, bl, SELF);
}
@@ -1230,7 +1215,7 @@ void clif_class_change(struct block_list *bl,int class_,int type)
WBUFL(buf,2)=bl->id;
WBUFB(buf,6)=type;
WBUFL(buf,7)=class_;
- clif_send(buf,packet_len(0x1b0),bl,AREA);
+ clif->send(buf,packet_len(0x1b0),bl,AREA);
}
}
@@ -1282,27 +1267,22 @@ static void clif_weather_check(struct map_session_data *sd)
|| map[m].flag.clouds2)
{
if (map[m].flag.snow)
- clif_specialeffect_single(&sd->bl, 162, fd);
+ clif->specialeffect_single(&sd->bl, 162, fd);
if (map[m].flag.clouds)
- clif_specialeffect_single(&sd->bl, 233, fd);
+ clif->specialeffect_single(&sd->bl, 233, fd);
if (map[m].flag.clouds2)
- clif_specialeffect_single(&sd->bl, 516, fd);
+ clif->specialeffect_single(&sd->bl, 516, fd);
if (map[m].flag.fog)
- clif_specialeffect_single(&sd->bl, 515, fd);
+ clif->specialeffect_single(&sd->bl, 515, fd);
if (map[m].flag.fireworks) {
- clif_specialeffect_single(&sd->bl, 297, fd);
- clif_specialeffect_single(&sd->bl, 299, fd);
- clif_specialeffect_single(&sd->bl, 301, fd);
+ clif->specialeffect_single(&sd->bl, 297, fd);
+ clif->specialeffect_single(&sd->bl, 299, fd);
+ clif->specialeffect_single(&sd->bl, 301, fd);
}
if (map[m].flag.sakura)
- clif_specialeffect_single(&sd->bl, 163, fd);
+ clif->specialeffect_single(&sd->bl, 163, fd);
if (map[m].flag.leaves)
- clif_specialeffect_single(&sd->bl, 333, fd);
- /**
- * No longer available, keeping here just in case it's back someday. [Ind]
- **/
- //if (map[m].flag.rain)
- // clif_specialeffect_single(&sd->bl, 161, fd);
+ clif->specialeffect_single(&sd->bl, 333, fd);
}
}
/**
@@ -1341,12 +1321,12 @@ int clif_spawn(struct block_list *bl)
return 0;
len = clif_set_unit_idle(bl, buf,true);
- clif_send(buf, len, bl, AREA_WOS);
+ clif->send(buf, len, bl, AREA_WOS);
if (disguised(bl))
clif_setdisguise(bl, buf, len);
if (vd->cloth_color)
- clif_refreshlook(bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,AREA_WOS);
+ clif->refreshlook(bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,AREA_WOS);
switch (bl->type)
@@ -1356,50 +1336,50 @@ int clif_spawn(struct block_list *bl)
TBL_PC *sd = ((TBL_PC*)bl);
int i;
if (sd->spiritball > 0)
- clif_spiritball(&sd->bl);
+ clif->spiritball(&sd->bl);
if(sd->state.size==SZ_BIG) // tiny/big players [Valaris]
- clif_specialeffect(bl,423,AREA);
+ clif->specialeffect(bl,423,AREA);
else if(sd->state.size==SZ_MEDIUM)
- clif_specialeffect(bl,421,AREA);
+ clif->specialeffect(bl,421,AREA);
if( sd->bg_id && map[sd->bl.m].flag.battleground )
- clif_sendbgemblem_area(sd);
+ clif->sendbgemblem_area(sd);
if( sd->sc.option&OPTION_MOUNTING ) {
//New Mounts are not complaint to the original method, so we gotta tell this guy that he is mounting.
- clif_status_load_notick(&sd->bl,SI_ALL_RIDING,2,1,0,0);
+ clif->sc_notick(&sd->bl,SI_ALL_RIDING,2,1,0,0);
}
for(i = 1; i < 5; i++){
if( sd->talisman[i] > 0 )
- clif_talisman(sd, i);
+ clif->talisman(sd, i);
}
#ifdef NEW_CARTS
if( sd->sc.data[SC_PUSH_CART] )
- clif_status_load_notick(&sd->bl, SI_ON_PUSH_CART, 2, sd->sc.data[SC_PUSH_CART]->val1, 0, 0);
+ clif->sc_notick(&sd->bl, SI_ON_PUSH_CART, 2, sd->sc.data[SC_PUSH_CART]->val1, 0, 0);
#endif
if (sd->status.robe)
- clif_refreshlook(bl,bl->id,LOOK_ROBE,sd->status.robe,AREA);
+ clif->refreshlook(bl,bl->id,LOOK_ROBE,sd->status.robe,AREA);
}
break;
case BL_MOB:
{
TBL_MOB *md = ((TBL_MOB*)bl);
if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
- clif_specialeffect(&md->bl,423,AREA);
+ clif->specialeffect(&md->bl,423,AREA);
else if(md->special_state.size==SZ_MEDIUM)
- clif_specialeffect(&md->bl,421,AREA);
+ clif->specialeffect(&md->bl,421,AREA);
}
break;
case BL_NPC:
{
TBL_NPC *nd = ((TBL_NPC*)bl);
if( nd->size == SZ_BIG )
- clif_specialeffect(&nd->bl,423,AREA);
+ clif->specialeffect(&nd->bl,423,AREA);
else if( nd->size == SZ_MEDIUM )
- clif_specialeffect(&nd->bl,421,AREA);
+ clif->specialeffect(&nd->bl,421,AREA);
}
break;
case BL_PET:
if (vd->head_bottom)
- clif_pet_equip_area((TBL_PET*)bl); // needed to display pet equip properly
+ clif->send_petdata(NULL, (TBL_PET*)bl, 3, vd->head_bottom); // needed to display pet equip properly
break;
}
return 0;
@@ -1459,7 +1439,7 @@ void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag)
WBUFL(buf,63)=hd->exp_next;
WBUFW(buf,67)=hd->homunculus.skillpts;
WBUFW(buf,69)=status_get_range(&hd->bl);
- clif_send(buf,packet_len(0x22e),&sd->bl,SELF);
+ clif->send(buf,packet_len(0x22e),&sd->bl,SELF);
}
@@ -1575,12 +1555,12 @@ static void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_
int len;
len = clif_set_unit_walking(bl,ud,buf);
- clif_send(buf,len,bl,AREA_WOS);
+ clif->send(buf,len,bl,AREA_WOS);
if (disguised(bl))
clif_setdisguise(bl, buf, len);
if(vd->cloth_color)
- clif_refreshlook(bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,AREA_WOS);
+ clif->refreshlook(bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,AREA_WOS);
switch(bl->type)
{
@@ -1589,25 +1569,23 @@ static void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_
TBL_PC *sd = ((TBL_PC*)bl);
// clif_movepc(sd);
if(sd->state.size==SZ_BIG) // tiny/big players [Valaris]
- clif_specialeffect(&sd->bl,423,AREA);
+ clif->specialeffect(&sd->bl,423,AREA);
else if(sd->state.size==SZ_MEDIUM)
- clif_specialeffect(&sd->bl,421,AREA);
+ clif->specialeffect(&sd->bl,421,AREA);
}
break;
case BL_MOB:
{
TBL_MOB *md = ((TBL_MOB*)bl);
if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
- clif_specialeffect(&md->bl,423,AREA);
+ clif->specialeffect(&md->bl,423,AREA);
else if(md->special_state.size==SZ_MEDIUM)
- clif_specialeffect(&md->bl,421,AREA);
+ clif->specialeffect(&md->bl,421,AREA);
}
break;
case BL_PET:
- if( vd->head_bottom )
- {// needed to display pet equip properly
- clif_pet_equip_area((TBL_PET*)bl);
- }
+ if( vd->head_bottom ) // needed to display pet equip properly
+ clif->send_petdata(NULL, (TBL_PET*)bl, 3, vd->head_bottom);
break;
}
}
@@ -1644,11 +1622,11 @@ void clif_move(struct unit_data *ud)
WBUFL(buf,2)=bl->id;
WBUFPOS2(buf,6,bl->x,bl->y,ud->to_x,ud->to_y,8,8);
WBUFL(buf,12)=gettick();
- clif_send(buf, packet_len(0x86), bl, AREA_WOS);
+ clif->send(buf, packet_len(0x86), bl, AREA_WOS);
if (disguised(bl))
{
WBUFL(buf,2)=-bl->id;
- clif_send(buf, packet_len(0x86), bl, SELF);
+ clif->send(buf, packet_len(0x86), bl, SELF);
}
}
@@ -1723,7 +1701,7 @@ void clif_blown(struct block_list *bl)
{
//Aegis packets says fixpos, but it's unsure whether slide works better or not.
// clif_fixpos(bl);
- clif_slide(bl, bl->x, bl->y);
+ clif->slide(bl, bl->x, bl->y);
}
@@ -1740,12 +1718,11 @@ void clif_fixpos(struct block_list *bl)
WBUFL(buf,2) = bl->id;
WBUFW(buf,6) = bl->x;
WBUFW(buf,8) = bl->y;
- clif_send(buf, packet_len(0x88), bl, AREA);
+ clif->send(buf, packet_len(0x88), bl, AREA);
- if( disguised(bl) )
- {
+ if( disguised(bl) ) {
WBUFL(buf,2) = -bl->id;
- clif_send(buf, packet_len(0x88), bl, SELF);
+ clif->send(buf, packet_len(0x88), bl, SELF);
}
}
@@ -1910,8 +1887,7 @@ void clif_scriptclose(struct map_session_data *sd, int npcid)
/*==========================================
*
*------------------------------------------*/
-void clif_sendfakenpc(struct map_session_data *sd, int npcid)
-{
+void clif_sendfakenpc(struct map_session_data *sd, int npcid) {
unsigned char *buf;
int fd = sd->fd;
sd->state.using_fake_npc = 1;
@@ -1962,7 +1938,7 @@ void clif_scriptmenu(struct map_session_data* sd, int npcid, const char* mes)
if (!sd->state.using_fake_npc && (npcid == fake_nd->bl.id || ((bl = map_id2bl(npcid)) && (bl->m!=sd->bl.m ||
bl->x<sd->bl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 ||
bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1))))
- clif_sendfakenpc(sd, npcid);
+ clif->sendfakenpc(sd, npcid);
WFIFOHEAD(fd, slen);
WFIFOW(fd,0)=0xb7;
@@ -1994,7 +1970,7 @@ void clif_scriptinput(struct map_session_data *sd, int npcid)
if (!sd->state.using_fake_npc && (npcid == fake_nd->bl.id || ((bl = map_id2bl(npcid)) && (bl->m!=sd->bl.m ||
bl->x<sd->bl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 ||
bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1))))
- clif_sendfakenpc(sd, npcid);
+ clif->sendfakenpc(sd, npcid);
fd=sd->fd;
WFIFOHEAD(fd, packet_len(0x142));
@@ -2025,7 +2001,7 @@ void clif_scriptinputstr(struct map_session_data *sd, int npcid)
if (!sd->state.using_fake_npc && (npcid == fake_nd->bl.id || ((bl = map_id2bl(npcid)) && (bl->m!=sd->bl.m ||
bl->x<sd->bl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 ||
bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1))))
- clif_sendfakenpc(sd, npcid);
+ clif->sendfakenpc(sd, npcid);
fd=sd->fd;
WFIFOHEAD(fd, packet_len(0x1d4));
@@ -2354,8 +2330,7 @@ void clif_inventorylist(struct map_session_data *sd)
n++;
}
}
- if( n )
- {
+ if( n ) {
#if PACKETVER < 5
WBUFW(buf,0)=0xa3;
#elif PACKETVER < 20080102
@@ -2364,20 +2339,19 @@ void clif_inventorylist(struct map_session_data *sd)
WBUFW(buf,0)=0x2e8;
#endif
WBUFW(buf,2)=4+n*s;
- clif_send(buf, WBUFW(buf,2), &sd->bl, SELF);
+ clif->send(buf, WBUFW(buf,2), &sd->bl, SELF);
}
if( arrow >= 0 )
- clif_arrowequip(sd,arrow);
+ clif->arrowequip(sd,arrow);
- if( ne )
- {
+ if( ne ) {
#if PACKETVER < 20071002
WBUFW(bufe,0)=0xa4;
#else
WBUFW(bufe,0)=0x2d0;
#endif
WBUFW(bufe,2)=4+ne*se;
- clif_send(bufe, WBUFW(bufe,2), &sd->bl, SELF);
+ clif->send(bufe, WBUFW(bufe,2), &sd->bl, SELF);
}
#if PACKETVER >= 20111122
for( i = 0; i < MAX_INVENTORY; i++ ) {
@@ -2505,7 +2479,7 @@ void clif_storagelist(struct map_session_data* sd, struct item* items, int items
WBUFW(buf,0)=0x2ea;
#endif
WBUFW(buf,2)=4+n*s;
- clif_send(buf, WBUFW(buf,2), &sd->bl, SELF);
+ clif->send(buf, WBUFW(buf,2), &sd->bl, SELF);
}
if( ne )
{
@@ -2515,7 +2489,7 @@ void clif_storagelist(struct map_session_data* sd, struct item* items, int items
WBUFW(bufe,0)=0x2d1;
#endif
WBUFW(bufe,2)=4+ne*cmd;
- clif_send(bufe, WBUFW(bufe,2), &sd->bl, SELF);
+ clif->send(bufe, WBUFW(bufe,2), &sd->bl, SELF);
}
if( buf ) aFree(buf);
@@ -2585,7 +2559,7 @@ void clif_cartlist(struct map_session_data *sd)
WBUFW(buf,0)=0x2e9;
#endif
WBUFW(buf,2)=4+n*s;
- clif_send(buf, WBUFW(buf,2), &sd->bl, SELF);
+ clif->send(buf, WBUFW(buf,2), &sd->bl, SELF);
}
if( ne )
{
@@ -2595,7 +2569,7 @@ void clif_cartlist(struct map_session_data *sd)
WBUFW(bufe,0)=0x2d2;
#endif
WBUFW(bufe,2)=4+ne*cmd;
- clif_send(bufe, WBUFW(bufe,2), &sd->bl, SELF);
+ clif->send(bufe, WBUFW(bufe,2), &sd->bl, SELF);
}
if( buf ) aFree(buf);
@@ -2629,7 +2603,7 @@ void clif_guild_xy(struct map_session_data *sd)
WBUFL(buf,2)=sd->status.account_id;
WBUFW(buf,6)=sd->bl.x;
WBUFW(buf,8)=sd->bl.y;
- clif_send(buf,packet_len(0x1eb),&sd->bl,GUILD_SAMEMAP_WOS);
+ clif->send(buf,packet_len(0x1eb),&sd->bl,GUILD_SAMEMAP_WOS);
}
/*==========================================
@@ -2659,7 +2633,7 @@ void clif_guild_xy_remove(struct map_session_data *sd)
WBUFL(buf,2)=sd->status.account_id;
WBUFW(buf,6)=-1;
WBUFW(buf,8)=-1;
- clif_send(buf,packet_len(0x1eb),&sd->bl,GUILD_SAMEMAP_WOS);
+ clif->send(buf,packet_len(0x1eb),&sd->bl,GUILD_SAMEMAP_WOS);
}
/*==========================================
@@ -2792,9 +2766,9 @@ void clif_updatestatus(struct map_session_data *sd,int type)
// TODO: Won't these overwrite the current packet?
clif_hpmeter(sd);
if( !battle_config.party_hp_mode && sd->status.party_id )
- clif_party_hp(sd);
+ clif->party_hp(sd);
if( sd->bg_id )
- clif_bg_hp(sd);
+ clif->bg_hp(sd);
break;
case SP_SP:
WFIFOL(fd,4)=sd->battle_status.sp;
@@ -2937,7 +2911,7 @@ void clif_updatestatus(struct map_session_data *sd,int type)
break;
default:
- ShowError("clif_updatestatus : unrecognized type %d\n",type);
+ ShowError("clif->updatestatus : unrecognized type %d\n",type);
return;
}
WFIFOSET(fd,len);
@@ -2966,7 +2940,7 @@ void clif_changestatus(struct map_session_data* sd,int type,int val)
return;
}
- clif_send(buf,packet_len(0x1ab),&sd->bl,AREA_WOS);
+ clif->send(buf,packet_len(0x1ab),&sd->bl,AREA_WOS);
}
@@ -3077,7 +3051,7 @@ void clif_changelook(struct block_list *bl,int type,int val)
WBUFL(buf,2)=bl->id;
WBUFB(buf,6)=type;
WBUFB(buf,7)=val;
- clif_send(buf,packet_len(0xc3),bl,target);
+ clif->send(buf,packet_len(0xc3),bl,target);
#else
WBUFW(buf,0)=0x1d7;
WBUFL(buf,2)=bl->id;
@@ -3089,7 +3063,7 @@ void clif_changelook(struct block_list *bl,int type,int val)
WBUFB(buf,6)=type;
WBUFL(buf,7)=val;
}
- clif_send(buf,packet_len(0x1d7),bl,target);
+ clif->send(buf,packet_len(0x1d7),bl,target);
#endif
}
@@ -3102,14 +3076,14 @@ void clif_changetraplook(struct block_list *bl,int val)
WBUFL(buf,2)=bl->id;
WBUFB(buf,6)=LOOK_BASE;
WBUFB(buf,7)=val;
- clif_send(buf,packet_len(0xc3),bl,AREA);
+ clif->send(buf,packet_len(0xc3),bl,AREA);
#else
WBUFW(buf,0)=0x1d7;
WBUFL(buf,2)=bl->id;
WBUFB(buf,6)=LOOK_BASE;
WBUFW(buf,7)=val;
WBUFW(buf,9)=0;
- clif_send(buf,packet_len(0x1d7),bl,AREA);
+ clif->send(buf,packet_len(0x1d7),bl,AREA);
#endif
}
@@ -3122,14 +3096,14 @@ void clif_refreshlook(struct block_list *bl,int id,int type,int val,enum send_ta
WBUFL(buf,2)=id;
WBUFB(buf,6)=type;
WBUFB(buf,7)=val;
- clif_send(buf,packet_len(0xc3),bl,target);
+ clif->send(buf,packet_len(0xc3),bl,target);
#else
WBUFW(buf,0)=0x1d7;
WBUFL(buf,2)=id;
WBUFB(buf,6)=type;
WBUFW(buf,7)=val;
WBUFW(buf,9)=0;
- clif_send(buf,packet_len(0x1d7),bl,target);
+ clif->send(buf,packet_len(0x1d7),bl,target);
#endif
}
@@ -3187,15 +3161,15 @@ void clif_initialstatus(struct map_session_data *sd)
WFIFOSET(fd,packet_len(0xbd));
- clif_updatestatus(sd,SP_STR);
- clif_updatestatus(sd,SP_AGI);
- clif_updatestatus(sd,SP_VIT);
- clif_updatestatus(sd,SP_INT);
- clif_updatestatus(sd,SP_DEX);
- clif_updatestatus(sd,SP_LUK);
+ clif->updatestatus(sd,SP_STR);
+ clif->updatestatus(sd,SP_AGI);
+ clif->updatestatus(sd,SP_VIT);
+ clif->updatestatus(sd,SP_INT);
+ clif->updatestatus(sd,SP_DEX);
+ clif->updatestatus(sd,SP_LUK);
- clif_updatestatus(sd,SP_ATTACKRANGE);
- clif_updatestatus(sd,SP_ASPD);
+ clif->updatestatus(sd,SP_ATTACKRANGE);
+ clif->updatestatus(sd,SP_ASPD);
}
@@ -3372,7 +3346,7 @@ void clif_misceffect(struct block_list* bl,int type)
WBUFL(buf,2) = bl->id;
WBUFL(buf,6) = type;
- clif_send(buf,packet_len(0x19b),bl,AREA);
+ clif->send(buf,packet_len(0x19b),bl,AREA);
}
@@ -3398,14 +3372,14 @@ void clif_changeoption(struct block_list* bl)
WBUFL(buf,10) = sc->option;
WBUFB(buf,14) = (sd)? sd->status.karma : 0;
if(disguised(bl)) {
- clif_send(buf,packet_len(0x229),bl,AREA_WOS);
+ clif->send(buf,packet_len(0x229),bl,AREA_WOS);
WBUFL(buf,2) = -bl->id;
- clif_send(buf,packet_len(0x229),bl,SELF);
+ clif->send(buf,packet_len(0x229),bl,SELF);
WBUFL(buf,2) = bl->id;
WBUFL(buf,10) = OPTION_INVISIBLE;
- clif_send(buf,packet_len(0x229),bl,SELF);
+ clif->send(buf,packet_len(0x229),bl,SELF);
} else
- clif_send(buf,packet_len(0x229),bl,AREA);
+ clif->send(buf,packet_len(0x229),bl,AREA);
#else
WBUFW(buf,0) = 0x119;
WBUFL(buf,2) = bl->id;
@@ -3414,14 +3388,14 @@ void clif_changeoption(struct block_list* bl)
WBUFW(buf,10) = sc->option;
WBUFB(buf,12) = (sd)? sd->status.karma : 0;
if(disguised(bl)) {
- clif_send(buf,packet_len(0x119),bl,AREA_WOS);
+ clif->send(buf,packet_len(0x119),bl,AREA_WOS);
WBUFL(buf,2) = -bl->id;
- clif_send(buf,packet_len(0x119),bl,SELF);
+ clif->send(buf,packet_len(0x119),bl,SELF);
WBUFL(buf,2) = bl->id;
WBUFW(buf,10) = OPTION_INVISIBLE;
- clif_send(buf,packet_len(0x119),bl,SELF);
+ clif->send(buf,packet_len(0x119),bl,SELF);
} else
- clif_send(buf,packet_len(0x119),bl,AREA);
+ clif->send(buf,packet_len(0x119),bl,AREA);
#endif
}
@@ -3442,14 +3416,14 @@ void clif_changeoption2(struct block_list* bl)
WBUFL(buf,10) = clif_setlevel(bl);
WBUFL(buf,14) = sc->opt3;
if(disguised(bl)) {
- clif_send(buf,packet_len(0x28a),bl,AREA_WOS);
+ clif->send(buf,packet_len(0x28a),bl,AREA_WOS);
WBUFL(buf,2) = -bl->id;
- clif_send(buf,packet_len(0x28a),bl,SELF);
+ clif->send(buf,packet_len(0x28a),bl,SELF);
WBUFL(buf,2) = bl->id;
WBUFL(buf,6) = OPTION_INVISIBLE;
- clif_send(buf,packet_len(0x28a),bl,SELF);
+ clif->send(buf,packet_len(0x28a),bl,SELF);
} else
- clif_send(buf,packet_len(0x28a),bl,AREA);
+ clif->send(buf,packet_len(0x28a),bl,AREA);
}
@@ -3490,7 +3464,7 @@ void clif_useitemack(struct map_session_data *sd,int index,int amount,bool ok)
WBUFL(buf,6)=sd->bl.id;
WBUFW(buf,10)=amount;
WBUFB(buf,12)=ok;
- clif_send(buf,packet_len(0x1c8),&sd->bl,AREA);
+ clif->send(buf,packet_len(0x1c8),&sd->bl,AREA);
#endif
}
}
@@ -3549,7 +3523,7 @@ void clif_dispchat(struct chat_data* cd, int fd)
memcpy(WFIFOP(fd,0),buf,WBUFW(buf,2));
WFIFOSET(fd,WBUFW(buf,2));
} else {
- clif_send(buf,WBUFW(buf,2),cd->owner,AREA_WOSC);
+ clif->send(buf,WBUFW(buf,2),cd->owner,AREA_WOSC);
}
}
@@ -3582,7 +3556,7 @@ void clif_changechatstatus(struct chat_data* cd)
WBUFB(buf,16) = type;
memcpy((char*)WBUFP(buf,17), cd->title, strlen(cd->title)); // not zero-terminated
- clif_send(buf,WBUFW(buf,2),cd->owner,CHAT);
+ clif->send(buf,WBUFW(buf,2),cd->owner,CHAT);
}
@@ -3601,7 +3575,7 @@ void clif_clearchat(struct chat_data *cd,int fd)
memcpy(WFIFOP(fd,0),buf,packet_len(0xd8));
WFIFOSET(fd,packet_len(0xd8));
} else {
- clif_send(buf,packet_len(0xd8),cd->owner,AREA_WOSC);
+ clif->send(buf,packet_len(0xd8),cd->owner,AREA_WOSC);
}
}
@@ -3683,7 +3657,7 @@ void clif_addchat(struct chat_data* cd,struct map_session_data *sd)
WBUFW(buf, 0) = 0xdc;
WBUFW(buf, 2) = cd->users;
memcpy(WBUFP(buf, 4),sd->status.name,NAME_LENGTH);
- clif_send(buf,packet_len(0xdc),&sd->bl,CHAT_WOS);
+ clif->send(buf,packet_len(0xdc),&sd->bl,CHAT_WOS);
}
@@ -3707,7 +3681,7 @@ void clif_changechatowner(struct chat_data* cd, struct map_session_data* sd)
WBUFL(buf,32) = 0;
memcpy(WBUFP(buf,36),sd->status.name,NAME_LENGTH);
- clif_send(buf,packet_len(0xe1)*2,&sd->bl,CHAT);
+ clif->send(buf,packet_len(0xe1)*2,&sd->bl,CHAT);
}
@@ -3728,7 +3702,7 @@ void clif_leavechat(struct chat_data* cd, struct map_session_data* sd, bool flag
memcpy(WBUFP(buf,4),sd->status.name,NAME_LENGTH);
WBUFB(buf,28) = flag;
- clif_send(buf,packet_len(0xdd),&sd->bl,CHAT);
+ clif->send(buf,packet_len(0xdd),&sd->bl,CHAT);
}
@@ -4037,9 +4011,9 @@ static void clif_getareachar_pc(struct map_session_data* sd,struct map_session_d
if( (cd = (struct chat_data*)map_id2bl(dstsd->chatID)) && cd->usersd[0]==dstsd)
clif_dispchat(cd,sd->fd);
} else if( dstsd->state.vending )
- clif_showvendingboard(&dstsd->bl,dstsd->message,sd->fd);
+ clif->showvendingboard(&dstsd->bl,dstsd->message,sd->fd);
else if( dstsd->state.buyingstore )
- clif_buyingstore_entry_single(sd, dstsd);
+ clif->buyingstore_entry_single(sd, dstsd);
if(dstsd->spiritball > 0)
clif_spiritball_single(sd->fd, dstsd);
@@ -4049,27 +4023,27 @@ static void clif_getareachar_pc(struct map_session_data* sd,struct map_session_d
}
if( dstsd->sc.option&OPTION_MOUNTING ) {
//New Mounts are not complaint to the original method, so we gotta tell this guy that I'm mounting.
- clif_status_load_single(sd->fd,dstsd->bl.id,SI_ALL_RIDING,2,1,0,0);
+ clif->sc_single(sd->fd,dstsd->bl.id,SI_ALL_RIDING,2,1,0,0);
}
#ifdef NEW_CARTS
if( dstsd->sc.data[SC_PUSH_CART] )
- clif_status_load_single(sd->fd, dstsd->bl.id, SI_ON_PUSH_CART, 2, dstsd->sc.data[SC_PUSH_CART]->val1, 0, 0);
+ clif->sc_single(sd->fd, dstsd->bl.id, SI_ON_PUSH_CART, 2, dstsd->sc.data[SC_PUSH_CART]->val1, 0, 0);
#endif
if( (sd->status.party_id && dstsd->status.party_id == sd->status.party_id) || //Party-mate, or hpdisp setting.
(sd->bg_id && sd->bg_id == dstsd->bg_id) || //BattleGround
pc_has_permission(sd, PC_PERM_VIEW_HPMETER)
)
- clif_hpmeter_single(sd->fd, dstsd->bl.id, dstsd->battle_status.hp, dstsd->battle_status.max_hp);
+ clif->hpmeter_single(sd->fd, dstsd->bl.id, dstsd->battle_status.hp, dstsd->battle_status.max_hp);
// display link (sd - dstsd) to sd
ARR_FIND( 0, 5, i, sd->devotion[i] == dstsd->bl.id );
- if( i < 5 ) clif_devotion(&sd->bl, sd);
+ if( i < 5 ) clif->devotion(&sd->bl, sd);
// display links (dstsd - devotees) to sd
ARR_FIND( 0, 5, i, dstsd->devotion[i] > 0 );
- if( i < 5 ) clif_devotion(&dstsd->bl, sd);
+ if( i < 5 ) clif->devotion(&dstsd->bl, sd);
// display link (dstsd - crusader) to sd
if( dstsd->sc.data[SC_DEVOTION] && (d_bl = map_id2bl(dstsd->sc.data[SC_DEVOTION]->val1)) != NULL )
- clif_devotion(d_bl, sd);
+ clif->devotion(d_bl, sd);
}
void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
@@ -4091,10 +4065,10 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
ud = unit_bl2ud(bl);
len = ( ud && ud->walktimer != INVALID_TIMER ) ? clif_set_unit_walking(bl,ud,buf) : clif_set_unit_idle(bl,buf,false);
- clif_send(buf,len,&sd->bl,SELF);
+ clif->send(buf,len,&sd->bl,SELF);
if (vd->cloth_color)
- clif_refreshlook(&sd->bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,SELF);
+ clif->refreshlook(&sd->bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,SELF);
switch (bl->type)
{
case BL_PC:
@@ -4102,20 +4076,20 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
TBL_PC* tsd = (TBL_PC*)bl;
clif_getareachar_pc(sd, tsd);
if(tsd->state.size==SZ_BIG) // tiny/big players [Valaris]
- clif_specialeffect_single(bl,423,sd->fd);
+ clif->specialeffect_single(bl,423,sd->fd);
else if(tsd->state.size==SZ_MEDIUM)
- clif_specialeffect_single(bl,421,sd->fd);
+ clif->specialeffect_single(bl,421,sd->fd);
if( tsd->bg_id && map[tsd->bl.m].flag.battleground )
- clif_sendbgemblem_single(sd->fd,tsd);
+ clif->sendbgemblem_single(sd->fd,tsd);
if( tsd->sc.data[SC_CAMOUFLAGE] )
- clif_status_load(bl,SI_CAMOUFLAGE,1);
+ clif->status_change(bl, SI_CAMOUFLAGE, 1, 0, 0, 0, 0);
if ( tsd->status.robe )
- clif_refreshlook(&sd->bl,bl->id,LOOK_ROBE,tsd->status.robe,SELF);
+ clif->refreshlook(&sd->bl,bl->id,LOOK_ROBE,tsd->status.robe,SELF);
}
break;
case BL_MER: // Devotion Effects
if( ((TBL_MER*)bl)->devotion_flag )
- clif_devotion(bl, sd);
+ clif->devotion(bl, sd);
break;
case BL_NPC:
{
@@ -4123,31 +4097,31 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
if( nd->chat_id )
clif_dispchat((struct chat_data*)map_id2bl(nd->chat_id),sd->fd);
if( nd->size == SZ_BIG )
- clif_specialeffect_single(bl,423,sd->fd);
+ clif->specialeffect_single(bl,423,sd->fd);
else if( nd->size == SZ_MEDIUM )
- clif_specialeffect_single(bl,421,sd->fd);
+ clif->specialeffect_single(bl,421,sd->fd);
}
break;
case BL_MOB:
{
TBL_MOB* md = (TBL_MOB*)bl;
if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
- clif_specialeffect_single(bl,423,sd->fd);
+ clif->specialeffect_single(bl,423,sd->fd);
else if(md->special_state.size==SZ_MEDIUM)
- clif_specialeffect_single(bl,421,sd->fd);
+ clif->specialeffect_single(bl,421,sd->fd);
#if PACKETVER >= 20120404
if( !(md->status.mode&MD_BOSS) ){
int i;
for(i = 0; i < DAMAGELOG_SIZE; i++)// must show hp bar to all char who already hit the mob.
if( md->dmglog[i].id == sd->status.char_id )
- clif_monster_hp_bar(md, sd->fd);
+ clif->monster_hp_bar(md, sd->fd);
}
#endif
}
break;
case BL_PET:
if (vd->head_bottom)
- clif_pet_equip(sd, (TBL_PET*)bl); // needed to display pet equip properly
+ clif->send_petdata(NULL, (TBL_PET*)bl, 3, vd->head_bottom); // needed to display pet equip properly
break;
}
}
@@ -4248,11 +4222,11 @@ int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tic
WBUFB(buf,28)=type;
#endif
if(disguised(dst)) {
- clif_send(buf,packet_len(cmd),dst,AREA_WOS);
+ clif->send(buf,packet_len(cmd),dst,AREA_WOS);
WBUFL(buf,6) = -dst->id;
- clif_send(buf,packet_len(cmd),dst,SELF);
+ clif->send(buf,packet_len(cmd),dst,SELF);
} else
- clif_send(buf,packet_len(cmd),dst,AREA);
+ clif->send(buf,packet_len(cmd),dst,AREA);
if(disguised(src)) {
WBUFL(buf,2) = -src->id;
@@ -4265,7 +4239,7 @@ int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tic
if(damage > 0) WBUFL(buf,22) = -1;
if(damage2 > 0) WBUFL(buf,29) = -1;
#endif
- clif_send(buf,packet_len(cmd),src,SELF);
+ clif->send(buf,packet_len(cmd),src,SELF);
}
if(src == dst) {
@@ -4290,7 +4264,7 @@ void clif_takeitem(struct block_list* src, struct block_list* dst)
WBUFL(buf, 2) = src->id;
WBUFL(buf, 6) = dst->id;
WBUFB(buf,26) = 1;
- clif_send(buf, packet_len(0x8a), src, AREA);
+ clif->send(buf, packet_len(0x8a), src, AREA);
}
@@ -4305,11 +4279,11 @@ void clif_sitting(struct block_list* bl)
WBUFW(buf, 0) = 0x8a;
WBUFL(buf, 2) = bl->id;
WBUFB(buf,26) = 2;
- clif_send(buf, packet_len(0x8a), bl, AREA);
+ clif->send(buf, packet_len(0x8a), bl, AREA);
if(disguised(bl)) {
WBUFL(buf, 2) = - bl->id;
- clif_send(buf, packet_len(0x8a), bl, SELF);
+ clif->send(buf, packet_len(0x8a), bl, SELF);
}
}
@@ -4324,11 +4298,11 @@ void clif_standing(struct block_list* bl)
WBUFW(buf, 0) = 0x8a;
WBUFL(buf, 2) = bl->id;
WBUFB(buf,26) = 3;
- clif_send(buf, packet_len(0x8a), bl, AREA);
+ clif->send(buf, packet_len(0x8a), bl, AREA);
if(disguised(bl)) {
WBUFL(buf, 2) = - bl->id;
- clif_send(buf, packet_len(0x8a), bl, SELF);
+ clif->send(buf, packet_len(0x8a), bl, SELF);
}
}
@@ -4358,7 +4332,7 @@ void clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_targe
dummy_bl.x = x;
dummy_bl.y = y;
dummy_bl.m = m;
- clif_send(buf,packet_len(0x192),&dummy_bl,target);
+ clif->send(buf,packet_len(0x192),&dummy_bl,target);
}
}
@@ -4460,7 +4434,7 @@ void clif_skill_delunit(struct skill_unit *unit)
WBUFW(buf, 0)=0x120;
WBUFL(buf, 2)=unit->bl.id;
- clif_send(buf,packet_len(0x120),&unit->bl,AREA);
+ clif->send(buf,packet_len(0x120),&unit->bl,AREA);
}
@@ -4475,7 +4449,7 @@ void clif_skillunit_update(struct block_list* bl)
WBUFW(buf,0) = 0x1ac;
WBUFL(buf,2) = bl->id;
- clif_send(buf,packet_len(0x1ac),bl,AREA);
+ clif->send(buf,packet_len(0x1ac),bl,AREA);
}
@@ -4535,12 +4509,12 @@ int clif_outsight(struct block_list *bl,va_list ap)
clif_dispchat(cd,tsd->fd);
}
if( sd->state.vending )
- clif_closevendingboard(bl,tsd->fd);
+ clif->closevendingboard(bl,tsd->fd);
if( sd->state.buyingstore )
- clif_buyingstore_disappear_entry_single(tsd, sd);
+ clif->buyingstore_disappear_entry_single(tsd, sd);
break;
case BL_ITEM:
- clif_clearflooritem((struct flooritem_data*)bl,tsd->fd);
+ clif->clearflooritem((struct flooritem_data*)bl,tsd->fd);
break;
case BL_SKILL:
clif_clearchar_skillunit((struct skill_unit *)bl,tsd->fd);
@@ -4639,12 +4613,10 @@ void clif_skillinfoblock(struct map_session_data *sd)
WFIFOSET(fd,len);
// workaround for bugreport:5348; send the remaining skills one by one to bypass packet size limit
- for ( ; i < MAX_SKILL; i++)
- {
- if( (id = sd->status.skill[i].id) != 0 )
- {
- clif_addskill(sd, id);
- clif_skillinfo(sd, id, 0);
+ for ( ; i < MAX_SKILL; i++) {
+ if( (id = sd->status.skill[i].id) != 0 ) {
+ clif->addskill(sd, id);
+ clif->skillinfo(sd, id, 0);
}
}
}
@@ -4780,11 +4752,11 @@ void clif_skillcasting(struct block_list* bl, int src_id, int dst_id, int dst_x,
#endif
if (disguised(bl)) {
- clif_send(buf,packet_len(cmd), bl, AREA_WOS);
+ clif->send(buf,packet_len(cmd), bl, AREA_WOS);
WBUFL(buf,2) = -src_id;
- clif_send(buf,packet_len(cmd), bl, SELF);
+ clif->send(buf,packet_len(cmd), bl, SELF);
} else
- clif_send(buf,packet_len(cmd), bl, AREA);
+ clif->send(buf,packet_len(cmd), bl, AREA);
}
@@ -4798,7 +4770,7 @@ void clif_skillcastcancel(struct block_list* bl)
WBUFW(buf,0) = 0x1b9;
WBUFL(buf,2) = bl->id;
- clif_send(buf,packet_len(0x1b9), bl, AREA);
+ clif->send(buf,packet_len(0x1b9), bl, AREA);
}
@@ -4913,11 +4885,11 @@ int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int
WBUFW(buf,28)=div;
WBUFB(buf,30)=type;
if (disguised(dst)) {
- clif_send(buf,packet_len(0x114),dst,AREA_WOS);
+ clif->send(buf,packet_len(0x114),dst,AREA_WOS);
WBUFL(buf,8)=-dst->id;
- clif_send(buf,packet_len(0x114),dst,SELF);
+ clif->send(buf,packet_len(0x114),dst,SELF);
} else
- clif_send(buf,packet_len(0x114),dst,AREA);
+ clif->send(buf,packet_len(0x114),dst,AREA);
if(disguised(src)) {
WBUFL(buf,4)=-src->id;
@@ -4925,7 +4897,7 @@ int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int
WBUFL(buf,8)=dst->id;
if(damage > 0)
WBUFW(buf,24)=-1;
- clif_send(buf,packet_len(0x114),src,SELF);
+ clif->send(buf,packet_len(0x114),src,SELF);
}
#else
WBUFW(buf,0)=0x1de;
@@ -4944,11 +4916,11 @@ int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int
WBUFW(buf,30)=div;
WBUFB(buf,32)=type;
if (disguised(dst)) {
- clif_send(buf,packet_len(0x1de),dst,AREA_WOS);
+ clif->send(buf,packet_len(0x1de),dst,AREA_WOS);
WBUFL(buf,8)=-dst->id;
- clif_send(buf,packet_len(0x1de),dst,SELF);
+ clif->send(buf,packet_len(0x1de),dst,SELF);
} else
- clif_send(buf,packet_len(0x1de),dst,AREA);
+ clif->send(buf,packet_len(0x1de),dst,AREA);
if(disguised(src)) {
WBUFL(buf,4)=-src->id;
@@ -4956,7 +4928,7 @@ int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int
WBUFL(buf,8)=dst->id;
if(damage > 0)
WBUFL(buf,24)=-1;
- clif_send(buf,packet_len(0x1de),src,SELF);
+ clif->send(buf,packet_len(0x1de),src,SELF);
}
#endif
@@ -5002,12 +4974,12 @@ int clif_skill_damage2(struct block_list *src,struct block_list *dst,unsigned in
WBUFW(buf,30)=skill_lv;
WBUFW(buf,32)=div;
WBUFB(buf,34)=type;
- clif_send(buf,packet_len(0x115),src,AREA);
+ clif->send(buf,packet_len(0x115),src,AREA);
if(disguised(src)) {
WBUFL(buf,4)=-src->id;
if(damage > 0)
WBUFW(buf,28)=-1;
- clif_send(buf,packet_len(0x115),src,SELF);
+ clif->send(buf,packet_len(0x115),src,SELF);
}
if (disguised(dst)) {
WBUFL(buf,8)=-dst->id;
@@ -5015,7 +4987,7 @@ int clif_skill_damage2(struct block_list *src,struct block_list *dst,unsigned in
WBUFL(buf,4)=src->id;
else if(damage > 0)
WBUFW(buf,28)=-1;
- clif_send(buf,packet_len(0x115),dst,SELF);
+ clif->send(buf,packet_len(0x115),dst,SELF);
}
//Because the damage delay must be synced with the client, here is where the can-walk tick must be updated. [Skotlex]
@@ -5040,17 +5012,17 @@ int clif_skill_nodamage(struct block_list *src,struct block_list *dst,uint16 ski
WBUFB(buf,14)=fail;
if (disguised(dst)) {
- clif_send(buf,packet_len(0x11a),dst,AREA_WOS);
+ clif->send(buf,packet_len(0x11a),dst,AREA_WOS);
WBUFL(buf,6)=-dst->id;
- clif_send(buf,packet_len(0x11a),dst,SELF);
+ clif->send(buf,packet_len(0x11a),dst,SELF);
} else
- clif_send(buf,packet_len(0x11a),dst,AREA);
+ clif->send(buf,packet_len(0x11a),dst,AREA);
if(src && disguised(src)) {
WBUFL(buf,10)=-src->id;
if (disguised(dst))
WBUFL(buf,6)=dst->id;
- clif_send(buf,packet_len(0x11a),src,SELF);
+ clif->send(buf,packet_len(0x11a),src,SELF);
}
return fail;
@@ -5073,11 +5045,11 @@ void clif_skill_poseffect(struct block_list *src,uint16 skill_id,int val,int x,i
WBUFW(buf,12)=y;
WBUFL(buf,14)=tick;
if(disguised(src)) {
- clif_send(buf,packet_len(0x117),src,AREA_WOS);
+ clif->send(buf,packet_len(0x117),src,AREA_WOS);
WBUFL(buf,4)=-src->id;
- clif_send(buf,packet_len(0x117),src,SELF);
+ clif->send(buf,packet_len(0x117),src,SELF);
} else
- clif_send(buf,packet_len(0x117),src,AREA);
+ clif->send(buf,packet_len(0x117),src,AREA);
}
@@ -5105,7 +5077,7 @@ void clif_skill_setunit(struct skill_unit *unit)
WBUFB(buf,15)=1;
WBUFB(buf,16)=1;
safestrncpy((char*)WBUFP(buf,17),unit->group->valstr,MESSAGE_SIZE);
- clif_send(buf,packet_len(0x1c9),&unit->bl,AREA);
+ clif->send(buf,packet_len(0x1c9),&unit->bl,AREA);
return;
}
#endif
@@ -5121,7 +5093,7 @@ void clif_skill_setunit(struct skill_unit *unit)
else
WBUFB(buf,14)=unit->group->unit_id;
WBUFB(buf,15)=1; // ignored by client (always gets set to 1)
- clif_send(buf,packet_len(0x11f),&unit->bl,AREA);
+ clif->send(buf,packet_len(0x11f),&unit->bl,AREA);
}
@@ -5231,7 +5203,7 @@ void clif_skill_estimation(struct map_session_data *sd,struct block_list *dst)
// The following caps negative attributes to 0 since the client displays them as 255-fix. [Skotlex]
// WBUFB(buf,20+i)= (unsigned char)((fix=battle_attr_ratio(i+1,status->def_ele, status->ele_lv))<0?0:fix);
- clif_send(buf,packet_len(0x18c),&sd->bl,sd->status.party_id>0?PARTY_SAMEMAP:SELF);
+ clif->send(buf,packet_len(0x18c),&sd->bl,sd->status.party_id>0?PARTY_SAMEMAP:SELF);
}
@@ -5330,7 +5302,7 @@ void clif_cooking_list(struct map_session_data *sd, int trigger, uint16 skill_id
if( skill_id != AM_PHARMACY ) { // AM_PHARMACY is used to Cooking.
// It fails.
#if PACKETVER >= 20090922
- clif_msg_skill(sd,skill_id,0x625);
+ clif->msg_skill(sd,skill_id,0x625);
#else
WFIFOW(fd,2) = 6 + 2 * c;
WFIFOSET(fd,WFIFOW(fd,2));
@@ -5382,7 +5354,7 @@ void clif_status_change(struct block_list *bl,int type,int flag,int tick,int val
WBUFL(buf,21) = val3;
}
#endif
- clif_send(buf,packet_len(WBUFW(buf,0)),bl, (sd && sd->status.option&OPTION_INVISIBLE) ? SELF : AREA);
+ clif->send(buf,packet_len(WBUFW(buf,0)),bl, (sd && sd->status.option&OPTION_INVISIBLE) ? SELF : AREA);
}
/// Send message (modified by [Yor]) (ZC_NOTIFY_PLAYERCHAT).
@@ -5430,7 +5402,7 @@ void clif_broadcast(struct block_list* bl, const char* mes, int len, int type, e
else if (type == 0x20) // bc_woe
WBUFL(buf,4) = 0x73737373; //If there's "ssss", game client will recognize message as 'WoE broadcast'.
memcpy(WBUFP(buf, 4 + lp), mes, len);
- clif_send(buf, WBUFW(buf,2), bl, target);
+ clif->send(buf, WBUFW(buf,2), bl, target);
if (buf)
aFree(buf);
@@ -5459,7 +5431,7 @@ void clif_GlobalMessage(struct block_list* bl, const char* message) {
WBUFW(buf,2)=len+8;
WBUFL(buf,4)=bl->id;
safestrncpy((char *) WBUFP(buf,8),message,len);
- clif_send((unsigned char *) buf,WBUFW(buf,2),bl,ALL_CLIENT);
+ clif->send((unsigned char *) buf,WBUFW(buf,2),bl,ALL_CLIENT);
}
@@ -5482,7 +5454,7 @@ void clif_MainChatMessage(const char* message) {
WBUFW(buf,2)=len+8;
WBUFL(buf,4)=0;
safestrncpy((char *) WBUFP(buf,8),message,len);
- clif_send(buf,WBUFW(buf,2),NULL,CHAT_MAINCHAT);
+ clif->send(buf,WBUFW(buf,2),NULL,CHAT_MAINCHAT);
}
/// Send broadcast message with font formatting (ZC_BROADCAST2).
@@ -5499,7 +5471,7 @@ void clif_broadcast2(struct block_list* bl, const char* mes, int len, unsigned l
WBUFW(buf,12) = fontAlign;
WBUFW(buf,14) = fontY;
memcpy(WBUFP(buf,16), mes, len);
- clif_send(buf, WBUFW(buf,2), bl, target);
+ clif->send(buf, WBUFW(buf,2), bl, target);
if (buf)
aFree(buf);
@@ -5536,7 +5508,7 @@ void clif_resurrection(struct block_list *bl,int type)
WBUFL(buf,2)=bl->id;
WBUFW(buf,6)=0;
- clif_send(buf,packet_len(0x148),bl,type==1 ? AREA : AREA_WOS);
+ clif->send(buf,packet_len(0x148),bl,type==1 ? AREA : AREA_WOS);
if (disguised(bl))
clif_spawn(bl);
}
@@ -5596,11 +5568,11 @@ void clif_pvpset(struct map_session_data *sd,int pvprank,int pvpnum,int type)
WBUFL(buf,6) = pvprank;
WBUFL(buf,10) = pvpnum;
if(sd->sc.option&OPTION_INVISIBLE || sd->disguise) //Causes crashes when a 'mob' with pvp info dies.
- clif_send(buf,packet_len(0x19a),&sd->bl,SELF);
+ clif->send(buf,packet_len(0x19a),&sd->bl,SELF);
else if(!type)
- clif_send(buf,packet_len(0x19a),&sd->bl,AREA);
+ clif->send(buf,packet_len(0x19a),&sd->bl,AREA);
else
- clif_send(buf,packet_len(0x19a),&sd->bl,ALL_SAMEMAP);
+ clif->send(buf,packet_len(0x19a),&sd->bl,ALL_SAMEMAP);
}
}
@@ -5618,7 +5590,7 @@ void clif_map_property_mapall(int map, enum map_property property)
bl.m = map;
WBUFW(buf,0)=0x199;
WBUFW(buf,2)=property;
- clif_send(buf,packet_len(0x199),&bl,ALL_SAMEMAP);
+ clif->send(buf,packet_len(0x199),&bl,ALL_SAMEMAP);
}
@@ -6065,7 +6037,7 @@ void clif_showvendingboard(struct block_list* bl, const char* message, int fd)
memcpy(WFIFOP(fd,0),buf,packet_len(0x131));
WFIFOSET(fd,packet_len(0x131));
} else {
- clif_send(buf,packet_len(0x131),bl,AREA_WOS);
+ clif->send(buf,packet_len(0x131),bl,AREA_WOS);
}
}
@@ -6085,7 +6057,7 @@ void clif_closevendingboard(struct block_list* bl, int fd)
memcpy(WFIFOP(fd,0),buf,packet_len(0x132));
WFIFOSET(fd,packet_len(0x132));
} else {
- clif_send(buf,packet_len(0x132),bl,AREA_WOS);
+ clif->send(buf,packet_len(0x132),bl,AREA_WOS);
}
}
@@ -6271,7 +6243,7 @@ void clif_party_member_info(struct party_data *p, struct map_session_data *sd)
mapindex_getmapname_ext(map[sd->bl.m].name, (char*)WBUFP(buf,63));
WBUFB(buf,79) = (p->party.item&1)?1:0;
WBUFB(buf,80) = (p->party.item&2)?1:0;
- clif_send(buf,packet_len(0x1e9),&sd->bl,PARTY);
+ clif->send(buf,packet_len(0x1e9),&sd->bl,PARTY);
}
@@ -6310,9 +6282,9 @@ void clif_party_info(struct party_data* p, struct map_session_data *sd)
WBUFW(buf,2) = 28+c*46;
if(sd) { // send only to self
- clif_send(buf, WBUFW(buf,2), &sd->bl, SELF);
+ clif->send(buf, WBUFW(buf,2), &sd->bl, SELF);
} else if (party_sd) { // send to whole party
- clif_send(buf, WBUFW(buf,2), &party_sd->bl, PARTY);
+ clif->send(buf, WBUFW(buf,2), &party_sd->bl, PARTY);
}
}
@@ -6441,9 +6413,9 @@ void clif_party_option(struct party_data *p,struct map_session_data *sd,int flag
WBUFB(buf,7)=(p->party.item&2)?1:0;
#endif
if(flag==0)
- clif_send(buf,packet_len(cmd),&sd->bl,PARTY);
+ clif->send(buf,packet_len(cmd),&sd->bl,PARTY);
else
- clif_send(buf,packet_len(cmd),&sd->bl,SELF);
+ clif->send(buf,packet_len(cmd),&sd->bl,SELF);
}
@@ -6474,9 +6446,9 @@ void clif_party_withdraw(struct party_data* p, struct map_session_data* sd, int
memcpy(WBUFP(buf,6),name,NAME_LENGTH);
WBUFB(buf,30)=flag&0x0f;
if((flag&0xf0)==0)
- clif_send(buf,packet_len(0x105),&sd->bl,PARTY);
+ clif->send(buf,packet_len(0x105),&sd->bl,PARTY);
else
- clif_send(buf,packet_len(0x105),&sd->bl,SELF);
+ clif->send(buf,packet_len(0x105),&sd->bl,SELF);
}
@@ -6504,7 +6476,7 @@ void clif_party_message(struct party_data* p, int account_id, const char* mes, i
WBUFW(buf,2)=len+8;
WBUFL(buf,4)=account_id;
safestrncpy((char *)WBUFP(buf,8), mes, len);
- clif_send(buf,len+8,&sd->bl,PARTY);
+ clif->send(buf,len+8,&sd->bl,PARTY);
}
}
@@ -6521,7 +6493,7 @@ void clif_party_xy(struct map_session_data *sd)
WBUFL(buf,2)=sd->status.account_id;
WBUFW(buf,6)=sd->bl.x;
WBUFW(buf,8)=sd->bl.y;
- clif_send(buf,packet_len(0x107),&sd->bl,PARTY_SAMEMAP_WOS);
+ clif->send(buf,packet_len(0x107),&sd->bl,PARTY_SAMEMAP_WOS);
}
@@ -6567,7 +6539,7 @@ void clif_party_hp(struct map_session_data *sd)
WBUFL(buf,6) = sd->battle_status.hp;
WBUFL(buf,10) = sd->battle_status.max_hp;
#endif
- clif_send(buf,packet_len(cmd),&sd->bl,PARTY_AREA_WOS);
+ clif->send(buf,packet_len(cmd),&sd->bl,PARTY_AREA_WOS);
}
@@ -6734,9 +6706,9 @@ void clif_send_petdata(struct map_session_data* sd, struct pet_data* pd, int typ
WBUFL(buf,3) = pd->bl.id;
WBUFL(buf,7) = param;
if (sd)
- clif_send(buf, packet_len(0x1a4), &sd->bl, SELF);
+ clif->send(buf, packet_len(0x1a4), &sd->bl, SELF);
else
- clif_send(buf, packet_len(0x1a4), &pd->bl, AREA);
+ clif->send(buf, packet_len(0x1a4), &pd->bl, AREA);
}
@@ -6792,7 +6764,7 @@ void clif_pet_emotion(struct pet_data *pd,int param)
}
WBUFL(buf,6)=param;
- clif_send(buf,packet_len(0x1aa),&pd->bl,AREA);
+ clif->send(buf,packet_len(0x1aa),&pd->bl,AREA);
}
@@ -6895,9 +6867,9 @@ void clif_devotion(struct block_list *src, struct map_session_data *tsd)
}
if( tsd )
- clif_send(buf, packet_len(0x1cf), &tsd->bl, SELF);
+ clif->send(buf, packet_len(0x1cf), &tsd->bl, SELF);
else
- clif_send(buf, packet_len(0x1cf), src, AREA);
+ clif->send(buf, packet_len(0x1cf), src, AREA);
}
/*==========================================
@@ -6920,7 +6892,7 @@ void clif_spiritball(struct block_list *bl) {
case BL_PC: WBUFW(buf, 6) = sd->spiritball; break;
case BL_HOM: WBUFW(buf, 6) = hd->homunculus.spiritball; break;
}
- clif_send(buf, packet_len(0x1d0), bl, AREA);
+ clif->send(buf, packet_len(0x1d0), bl, AREA);
}
@@ -6935,7 +6907,7 @@ void clif_combo_delay(struct block_list *bl,int wait)
WBUFW(buf,0)=0x1d2;
WBUFL(buf,2)=bl->id;
WBUFL(buf,6)=wait;
- clif_send(buf,packet_len(0x1d2),bl,AREA);
+ clif->send(buf,packet_len(0x1d2),bl,AREA);
}
@@ -6955,7 +6927,7 @@ void clif_bladestop(struct block_list *src, int dst_id, int active)
WBUFL(buf,6)=dst_id;
WBUFL(buf,10)=active;
- clif_send(buf,packet_len(0x1d1),src,AREA);
+ clif->send(buf,packet_len(0x1d1),src,AREA);
}
@@ -6969,7 +6941,7 @@ void clif_mvp_effect(struct map_session_data *sd)
WBUFW(buf,0)=0x10c;
WBUFL(buf,2)=sd->bl.id;
- clif_send(buf,packet_len(0x10c),&sd->bl,AREA);
+ clif->send(buf,packet_len(0x10c),&sd->bl,AREA);
}
@@ -7092,14 +7064,14 @@ void clif_guild_memberlogin_notice(struct guild *g,int idx,int flag)
WBUFW(buf,14) = sd->status.sex;
WBUFW(buf,16) = sd->status.hair;
WBUFW(buf,18) = sd->status.hair_color;
- clif_send(buf,packet_len(0x1f2),&sd->bl,GUILD_WOS);
+ clif->send(buf,packet_len(0x1f2),&sd->bl,GUILD_WOS);
}
else if( ( sd = guild_getavailablesd(g) ) != NULL )
{
WBUFW(buf,14) = 0;
WBUFW(buf,16) = 0;
WBUFW(buf,18) = 0;
- clif_send(buf,packet_len(0x1f2),&sd->bl,GUILD);
+ clif->send(buf,packet_len(0x1f2),&sd->bl,GUILD);
}
}
@@ -7138,7 +7110,7 @@ void clif_guild_send_onlineinfo(struct map_session_data *sd)
}
}
- clif_send(buf, p_len*count, &sd->bl, SELF);
+ clif->send(buf, p_len*count, &sd->bl, SELF);
}
@@ -7355,7 +7327,7 @@ void clif_guild_positionchanged(struct guild *g,int idx)
memcpy(WBUFP(buf,20),g->position[idx].name,NAME_LENGTH);
// }*
if( (sd=guild_getavailablesd(g))!=NULL )
- clif_send(buf,WBUFW(buf,2),&sd->bl,GUILD);
+ clif->send(buf,WBUFW(buf,2),&sd->bl,GUILD);
}
@@ -7379,7 +7351,7 @@ void clif_guild_memberpositionchanged(struct guild *g,int idx)
WBUFL(buf,12)=g->member[idx].position;
// }*
if( (sd=guild_getavailablesd(g))!=NULL )
- clif_send(buf,WBUFW(buf,2),&sd->bl,GUILD);
+ clif->send(buf,WBUFW(buf,2),&sd->bl,GUILD);
}
@@ -7419,7 +7391,7 @@ void clif_guild_emblem_area(struct block_list* bl)
WBUFL(buf,2) = bl->id;
WBUFL(buf,6) = status_get_guild_id(bl);
WBUFW(buf,10) = status_get_emblem_id(bl);
- clif_send(buf, 12, bl, AREA_WOS);
+ clif->send(buf, 12, bl, AREA_WOS);
}
@@ -7535,7 +7507,7 @@ void clif_guild_leave(struct map_session_data *sd,const char *name,const char *m
WBUFW(buf, 0)=0x15a;
memcpy(WBUFP(buf, 2),name,NAME_LENGTH);
memcpy(WBUFP(buf,26),mes,40);
- clif_send(buf,packet_len(0x15a),&sd->bl,GUILD_NOBG);
+ clif->send(buf,packet_len(0x15a),&sd->bl,GUILD_NOBG);
}
@@ -7559,7 +7531,7 @@ void clif_guild_expulsion(struct map_session_data* sd, const char* name, const c
#if PACKETVER < 20100803
memset(WBUFP(buf,66), 0, NAME_LENGTH); // account name (not used for security reasons)
#endif
- clif_send(buf, packet_len(cmd), &sd->bl, GUILD_NOBG);
+ clif->send(buf, packet_len(cmd), &sd->bl, GUILD_NOBG);
}
@@ -7629,7 +7601,7 @@ void clif_guild_message(struct guild *g,int account_id,const char *mes,int len)
safestrncpy((char*)WBUFP(buf,4), mes, len+1);
if ((sd = guild_getavailablesd(g)) != NULL)
- clif_send(buf, WBUFW(buf,2), &sd->bl, GUILD_NOBG);
+ clif->send(buf, WBUFW(buf,2), &sd->bl, GUILD_NOBG);
}
@@ -7748,7 +7720,7 @@ void clif_guild_allianceadded(struct guild *g,int idx)
WBUFL(buf,2)=g->alliance[idx].opposition;
WBUFL(buf,6)=g->alliance[idx].guild_id;
memcpy(WBUFP(buf,10),g->alliance[idx].name,NAME_LENGTH);
- clif_send(buf,packet_len(0x185),guild_getavailablesd(g),GUILD);
+ clif->send(buf,packet_len(0x185),guild_getavailablesd(g),GUILD);
}
*/
@@ -7785,7 +7757,7 @@ void clif_emotion(struct block_list *bl,int type)
WBUFW(buf,0)=0xc0;
WBUFL(buf,2)=bl->id;
WBUFB(buf,6)=type;
- clif_send(buf,packet_len(0xc0),bl,AREA);
+ clif->send(buf,packet_len(0xc0),bl,AREA);
}
@@ -7799,7 +7771,7 @@ void clif_talkiebox(struct block_list* bl, const char* talkie)
WBUFW(buf,0) = 0x191;
WBUFL(buf,2) = bl->id;
safestrncpy((char*)WBUFP(buf,6),talkie,MESSAGE_SIZE);
- clif_send(buf,packet_len(0x191),bl,AREA);
+ clif->send(buf,packet_len(0x191),bl,AREA);
}
@@ -7813,7 +7785,7 @@ void clif_wedding_effect(struct block_list *bl)
WBUFW(buf,0) = 0x1ea;
WBUFL(buf,2) = bl->id;
- clif_send(buf, packet_len(0x1ea), bl, AREA);
+ clif->send(buf, packet_len(0x1ea), bl, AREA);
}
@@ -7844,7 +7816,7 @@ void clif_callpartner(struct map_session_data *sd)
WBUFB(buf,2) = 0;
}
- clif_send(buf, packet_len(0x1e6), &sd->bl, AREA);
+ clif->send(buf, packet_len(0x1e6), &sd->bl, AREA);
}
@@ -7901,9 +7873,8 @@ void clif_marriage_proposal(int fd, struct map_session_data *sd, struct map_sess
/*==========================================
*
*------------------------------------------*/
-void clif_disp_onlyself(struct map_session_data *sd, const char *mes, int len)
-{
- clif_disp_message(&sd->bl, mes, len, SELF);
+void clif_disp_onlyself(struct map_session_data *sd, const char *mes, int len) {
+ clif->disp_message(&sd->bl, mes, len, SELF);
}
/*==========================================
@@ -7926,7 +7897,7 @@ void clif_disp_message(struct block_list* src, const char* mes, int len, enum se
WBUFW(buf, 0) = 0x17f;
WBUFW(buf, 2) = len + 5;
safestrncpy((char*)WBUFP(buf,4), mes, len+1);
- clif_send(buf, WBUFW(buf,2), src, target);
+ clif->send(buf, WBUFW(buf,2), src, target);
}
@@ -8109,7 +8080,7 @@ void clif_soundeffectall(struct block_list* bl, const char* name, int type, enum
WBUFB(buf,26) = type;
WBUFL(buf,27) = 0;
WBUFL(buf,31) = bl->id;
- clif_send(buf, packet_len(0x1d3), bl, coverage);
+ clif->send(buf, packet_len(0x1d3), bl, coverage);
}
@@ -8129,16 +8100,15 @@ void clif_specialeffect(struct block_list* bl, int type, enum send_target target
WBUFL(buf,2) = bl->id;
WBUFL(buf,6) = type;
- clif_send(buf, packet_len(0x1f3), bl, target);
+ clif->send(buf, packet_len(0x1f3), bl, target);
if (disguised(bl)) {
WBUFL(buf,2) = -bl->id;
- clif_send(buf, packet_len(0x1f3), bl, SELF);
+ clif->send(buf, packet_len(0x1f3), bl, SELF);
}
}
-void clif_specialeffect_single(struct block_list* bl, int type, int fd)
-{
+void clif_specialeffect_single(struct block_list* bl, int type, int fd) {
WFIFOHEAD(fd,10);
WFIFOW(fd,0) = 0x1f3;
WFIFOL(fd,2) = bl->id;
@@ -8162,12 +8132,12 @@ void clif_specialeffect_value(struct block_list* bl, int effect_id, int num, sen
WBUFL(buf,6) = effect_id;
WBUFL(buf,10) = num;
- clif_send(buf, packet_len(0x284), bl, target);
+ clif->send(buf, packet_len(0x284), bl, target);
if( disguised(bl) )
{
WBUFL(buf,2) = -bl->id;
- clif_send(buf, packet_len(0x284), bl, SELF);
+ clif->send(buf, packet_len(0x284), bl, SELF);
}
}
// Modification of clif_messagecolor to send colored messages to players to chat log only (doesn't display overhead)
@@ -8181,7 +8151,7 @@ int clif_colormes(struct map_session_data * sd, enum clif_colors color, const ch
WFIFOL(sd->fd,4) = 0;
WFIFOL(sd->fd,8) = color_table[color];
safestrncpy((char*)WFIFOP(sd->fd,12), msg, msg_len);
- clif_send(WFIFOP(sd->fd,0), WFIFOW(sd->fd,2), &sd->bl, SELF);
+ clif->send(WFIFOP(sd->fd,0), WFIFOW(sd->fd,2), &sd->bl, SELF);
return 0;
}
@@ -8207,7 +8177,7 @@ void clif_messagecolor(struct block_list* bl, unsigned long color, const char* m
WBUFL(buf,8) = color;
memcpy(WBUFP(buf,12), msg, msg_len);
- clif_send(buf, WBUFW(buf,2), bl, AREA_CHAT_WOC);
+ clif->send(buf, WBUFW(buf,2), bl, AREA_CHAT_WOC);
}
/// Public chat message [Valaris] (ZC_NOTIFY_CHAT).
@@ -8227,7 +8197,7 @@ void clif_message(struct block_list* bl, const char* msg) {
WBUFL(buf,4) = bl->id;
safestrncpy((char*)WBUFP(buf,8), msg, msg_len);
- clif_send(buf, WBUFW(buf,2), bl, AREA_CHAT_WOC);
+ clif->send(buf, WBUFW(buf,2), bl, AREA_CHAT_WOC);
}
// refresh the client's screen, getting rid of any effects
@@ -8240,16 +8210,16 @@ void clif_refresh(struct map_session_data *sd)
clif_inventorylist(sd);
if(pc_iscarton(sd)) {
clif_cartlist(sd);
- clif_updatestatus(sd,SP_CARTINFO);
- }
- clif_updatestatus(sd,SP_WEIGHT);
- clif_updatestatus(sd,SP_MAXWEIGHT);
- clif_updatestatus(sd,SP_STR);
- clif_updatestatus(sd,SP_AGI);
- clif_updatestatus(sd,SP_VIT);
- clif_updatestatus(sd,SP_INT);
- clif_updatestatus(sd,SP_DEX);
- clif_updatestatus(sd,SP_LUK);
+ clif->updatestatus(sd,SP_CARTINFO);
+ }
+ clif->updatestatus(sd,SP_WEIGHT);
+ clif->updatestatus(sd,SP_MAXWEIGHT);
+ clif->updatestatus(sd,SP_STR);
+ clif->updatestatus(sd,SP_AGI);
+ clif->updatestatus(sd,SP_VIT);
+ clif->updatestatus(sd,SP_INT);
+ clif->updatestatus(sd,SP_DEX);
+ clif->updatestatus(sd,SP_LUK);
if (sd->spiritball)
clif_spiritball_single(sd->fd, sd);
for(i = 1; i < 5; i++){
@@ -8257,15 +8227,15 @@ void clif_refresh(struct map_session_data *sd)
clif_talisman_single(sd->fd, sd, i);
}
if (sd->vd.cloth_color)
- clif_refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF);
+ clif->refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF);
if(merc_is_hom_active(sd->hd))
- clif_send_homdata(sd,SP_ACK,0);
+ clif->send_homdata(sd,SP_ACK,0);
if( sd->md ) {
- clif_mercenary_info(sd);
- clif_mercenary_skillblock(sd);
+ clif->mercenary_info(sd);
+ clif->mercenary_skillblock(sd);
}
if( sd->ed )
- clif_elemental_info(sd);
+ clif->elemental_info(sd);
map_foreachinrange(clif_getareachar,&sd->bl,AREA_SIZE,BL_ALL,sd);
clif_weather_check(sd);
if( sd->chatID )
@@ -8277,7 +8247,7 @@ void clif_refresh(struct map_session_data *sd)
if( pc_isdead(sd) ) // When you refresh, resend the death packet.
clif_clearunit_single(sd->bl.id,CLR_DEAD,sd->fd);
else
- clif_changed_dir(&sd->bl, SELF);
+ clif->changed_dir(&sd->bl, SELF);
// unlike vending, resuming buyingstore crashes the client.
buyingstore_close(sd);
@@ -8419,7 +8389,7 @@ void clif_charnameack (int fd, struct block_list *bl)
// if no receipient specified just update nearby clients
if (fd == 0)
- clif_send(buf, packet_len(cmd), bl, AREA);
+ clif->send(buf, packet_len(cmd), bl, AREA);
else {
WFIFOHEAD(fd, packet_len(cmd));
memcpy(WFIFOP(fd, 0), buf, packet_len(cmd));
@@ -8479,7 +8449,7 @@ void clif_charnameupdate (struct map_session_data *ssd)
}
// Update nearby clients
- clif_send(buf, packet_len(cmd), &ssd->bl, AREA);
+ clif->send(buf, packet_len(cmd), &ssd->bl, AREA);
}
@@ -8498,12 +8468,12 @@ void clif_slide(struct block_list *bl, int x, int y)
WBUFL(buf, 2) = bl->id;
WBUFW(buf, 6) = x;
WBUFW(buf, 8) = y;
- clif_send(buf, packet_len(0x1ff), bl, AREA);
+ clif->send(buf, packet_len(0x1ff), bl, AREA);
if( disguised(bl) )
{
WBUFL(buf,2) = -bl->id;
- clif_send(buf, packet_len(0x1ff), bl, SELF);
+ clif->send(buf, packet_len(0x1ff), bl, SELF);
}
}
@@ -8525,13 +8495,13 @@ void clif_disp_overhead(struct map_session_data *sd, const char* mes)
WBUFW(buf,2) = len_mes + 8; // len of message + 8 (command+len+id)
WBUFL(buf,4) = sd->bl.id;
safestrncpy((char*)WBUFP(buf,8), mes, len_mes);
- clif_send(buf, WBUFW(buf,2), &sd->bl, AREA_CHAT_WOC);
+ clif->send(buf, WBUFW(buf,2), &sd->bl, AREA_CHAT_WOC);
// send back message to the speaker
WBUFW(buf,0) = 0x8e;
WBUFW(buf, 2) = len_mes + 4;
safestrncpy((char*)WBUFP(buf,4), mes, len_mes);
- clif_send(buf, WBUFW(buf,2), &sd->bl, SELF);
+ clif->send(buf, WBUFW(buf,2), &sd->bl, SELF);
}
/*==========================
@@ -8546,7 +8516,7 @@ void clif_party_xy_remove(struct map_session_data *sd)
WBUFL(buf,2)=sd->status.account_id;
WBUFW(buf,6)=-1;
WBUFW(buf,8)=-1;
- clif_send(buf,packet_len(0x107),&sd->bl,PARTY_SAMEMAP_WOS);
+ clif->send(buf,packet_len(0x107),&sd->bl,PARTY_SAMEMAP_WOS);
}
@@ -9125,7 +9095,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
#endif
if(sd->vd.cloth_color)
- clif_refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF);
+ clif->refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF);
// item
clif_inventorylist(sd); // inventory list first, otherwise deleted items in pc_checkitem show up as 'unknown item'
pc_checkitem(sd);
@@ -9133,12 +9103,12 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
// cart
if(pc_iscarton(sd)) {
clif_cartlist(sd);
- clif_updatestatus(sd,SP_CARTINFO);
+ clif->updatestatus(sd,SP_CARTINFO);
}
// weight
- clif_updatestatus(sd,SP_WEIGHT);
- clif_updatestatus(sd,SP_MAXWEIGHT);
+ clif->updatestatus(sd,SP_WEIGHT);
+ clif->updatestatus(sd,SP_MAXWEIGHT);
// guild
// (needs to go before clif_spawn() to show guild emblems correctly)
@@ -9178,7 +9148,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
clif_party_hp(sd); // Show hp after displacement [LuzZza]
}
- if( sd->bg_id ) clif_bg_hp(sd); // BattleGround System
+ if( sd->bg_id ) clif->bg_hp(sd); // BattleGround System
if(map[sd->bl.m].flag.pvp && !(sd->sc.option&OPTION_INVISIBLE)) {
if(!battle_config.pk_mode) { // remove pvp stuff for pk_mode [Valaris]
@@ -9218,8 +9188,8 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
{
map_addblock(&sd->pd->bl);
clif_spawn(&sd->pd->bl);
- clif_send_petdata(sd,sd->pd,0,0);
- clif_send_petstatus(sd);
+ clif->send_petdata(sd,sd->pd,0,0);
+ clif->send_petstatus(sd);
// skill->unit_move(&sd->pd->bl,gettick(),1);
}
}
@@ -9229,7 +9199,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
{
map_addblock(&sd->hd->bl);
clif_spawn(&sd->hd->bl);
- clif_send_homdata(sd,SP_ACK,0);
+ clif->send_homdata(sd,SP_ACK,0);
clif_hominfo(sd,sd->hd,1);
clif_hominfo(sd,sd->hd,0); //for some reason, at least older clients want this sent twice
clif_homskillinfoblock(sd);
@@ -9241,41 +9211,41 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if( sd->md ) {
map_addblock(&sd->md->bl);
- clif_spawn(&sd->md->bl);
- clif_mercenary_info(sd);
- clif_mercenary_skillblock(sd);
+ clif->spawn(&sd->md->bl);
+ clif->mercenary_info(sd);
+ clif->mercenary_skillblock(sd);
status_calc_bl(&sd->md->bl, SCB_SPEED); // Mercenary mimic their master's speed on each map change
}
if( sd->ed ) {
map_addblock(&sd->ed->bl);
- clif_spawn(&sd->ed->bl);
- clif_elemental_info(sd);
- clif_elemental_updatestatus(sd,SP_HP);
- clif_hpmeter_single(sd->fd,sd->ed->bl.id,sd->ed->battle_status.hp,sd->ed->battle_status.max_hp);
- clif_elemental_updatestatus(sd,SP_SP);
+ clif->spawn(&sd->ed->bl);
+ clif->elemental_info(sd);
+ clif->elemental_updatestatus(sd,SP_HP);
+ clif->hpmeter_single(sd->fd,sd->ed->bl.id,sd->ed->battle_status.hp,sd->ed->battle_status.max_hp);
+ clif->elemental_updatestatus(sd,SP_SP);
status_calc_bl(&sd->ed->bl, SCB_SPEED); //Elemental mimic their master's speed on each map change
}
if(sd->state.connect_new) {
int lv;
sd->state.connect_new = 0;
- clif_skillinfoblock(sd);
- clif_hotkeys_send(sd);
- clif_updatestatus(sd,SP_BASEEXP);
- clif_updatestatus(sd,SP_NEXTBASEEXP);
- clif_updatestatus(sd,SP_JOBEXP);
- clif_updatestatus(sd,SP_NEXTJOBEXP);
- clif_updatestatus(sd,SP_SKILLPOINT);
+ clif->skillinfoblock(sd);
+ clif->hotkeys(sd);
+ clif->updatestatus(sd,SP_BASEEXP);
+ clif->updatestatus(sd,SP_NEXTBASEEXP);
+ clif->updatestatus(sd,SP_JOBEXP);
+ clif->updatestatus(sd,SP_NEXTJOBEXP);
+ clif->updatestatus(sd,SP_SKILLPOINT);
clif_initialstatus(sd);
if (sd->sc.option&OPTION_FALCON)
- clif_status_load(&sd->bl, SI_FALCON, 1);
+ clif->status_change(&sd->bl, SI_FALCON, 1, 0, 0, 0, 0);
if (sd->sc.option&OPTION_RIDING)
- clif_status_load(&sd->bl, SI_RIDING, 1);
+ clif->status_change(&sd->bl, SI_RIDING, 1, 0, 0, 0, 0);
else if (sd->sc.option&OPTION_WUGRIDER)
- clif_status_load(&sd->bl, SI_WUGRIDER, 1);
+ clif->status_change(&sd->bl, SI_WUGRIDER, 1, 0, 0, 0, 0);
if(sd->status.manner < 0)
sc_start(&sd->bl,SC_NOCHAT,100,0,0);
@@ -9296,22 +9266,22 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if (night_flag && map[sd->bl.m].flag.nightenabled) {
sd->state.night = 1;
- clif_status_load(&sd->bl, SI_NIGHT, 1);
+ clif->status_change(&sd->bl, SI_NIGHT, 1, 0, 0, 0, 0);
}
// Notify everyone that this char logged in [Skotlex].
- map_foreachpc(clif_friendslist_toggle_sub, sd->status.account_id, sd->status.char_id, 1);
+ map_foreachpc(clif->friendslist_toggle_sub, sd->status.account_id, sd->status.char_id, 1);
//Login Event
npc_script_event(sd, NPCE_LOGIN);
} else {
//For some reason the client "loses" these on warp/map-change.
- clif_updatestatus(sd,SP_STR);
- clif_updatestatus(sd,SP_AGI);
- clif_updatestatus(sd,SP_VIT);
- clif_updatestatus(sd,SP_INT);
- clif_updatestatus(sd,SP_DEX);
- clif_updatestatus(sd,SP_LUK);
+ clif->updatestatus(sd,SP_STR);
+ clif->updatestatus(sd,SP_AGI);
+ clif->updatestatus(sd,SP_VIT);
+ clif->updatestatus(sd,SP_INT);
+ clif->updatestatus(sd,SP_DEX);
+ clif->updatestatus(sd,SP_LUK);
// abort currently running script
sd->state.using_fake_npc = 0;
@@ -9332,25 +9302,20 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
(map_flag_gvg(sd->state.pmap) || map_flag_gvg(sd->bl.m) || map[sd->state.pmap].flag.battleground || map[sd->bl.m].flag.battleground) )
status_calc_bl(&sd->bl, SCB_FLEE); //Refresh flee penalty
- if( night_flag && map[sd->bl.m].flag.nightenabled )
- { //Display night.
- if( !sd->state.night )
- {
+ if( night_flag && map[sd->bl.m].flag.nightenabled ) { //Display night.
+ if( !sd->state.night ) {
sd->state.night = 1;
- clif_status_load(&sd->bl, SI_NIGHT, 1);
+ clif->status_change(&sd->bl, SI_NIGHT, 1, 0, 0, 0, 0);
}
- }
- else if( sd->state.night )
- { //Clear night display.
+ } else if( sd->state.night ) { //Clear night display.
sd->state.night = 0;
- clif_status_load(&sd->bl, SI_NIGHT, 0);
+ clif->status_change(&sd->bl, SI_NIGHT, 0, 0, 0, 0, 0);
}
- if( map[sd->bl.m].flag.battleground )
- {
+ if( map[sd->bl.m].flag.battleground ) {
clif_map_type(sd, MAPTYPE_BATTLEFIELD); // Battleground Mode
if( map[sd->bl.m].flag.battleground == 2 )
- clif_bg_updatescore_single(sd);
+ clif->bg_updatescore_single(sd);
}
if( map[sd->bl.m].flag.allowks && !map_flag_ks(sd->bl.m) )
@@ -9384,7 +9349,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
npc_script_event(sd, NPCE_LOADMAP);
if (pc_checkskill(sd, SG_DEVIL) && !pc_nextjobexp(sd))
- clif_status_load(&sd->bl, SI_DEVIL, 1); //blindness [Komurka]
+ clif->status_change(&sd->bl, SI_DEVIL, 0, 0, 0, 0, 0); //blindness [Komurka]
if (sd->sc.opt2) //Client loses these on warp.
clif_changeoption(&sd->bl);
@@ -9406,7 +9371,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
clif_clearunit_area(&sd->bl, CLR_DEAD);
else {
skill->usave_trigger(sd);
- clif_changed_dir(&sd->bl, SELF);
+ clif->changed_dir(&sd->bl, SELF);
}
// Trigger skill effects if you appear standing on them
@@ -9679,7 +9644,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
WFIFOL(fd,4) = sd->bl.id;
safestrncpy((char*)WFIFOP(fd,8), is_fake ? fakename : text, textlen);
//FIXME: chat has range of 9 only
- clif_send(WFIFOP(fd,0), WFIFOW(fd,2), &sd->bl, sd->chatID ? CHAT_WOS : AREA_CHAT_WOC);
+ clif->send(WFIFOP(fd,0), WFIFOW(fd,2), &sd->bl, sd->chatID ? CHAT_WOS : AREA_CHAT_WOC);
// send back message to the speaker
if( is_fake ) {
@@ -9741,12 +9706,12 @@ void clif_changed_dir(struct block_list *bl, enum send_target target)
WBUFW(buf,6) = bl->type==BL_PC?((TBL_PC*)bl)->head_dir:0;
WBUFB(buf,8) = unit_getdir(bl);
- clif_send(buf, packet_len(0x9c), bl, target);
+ clif->send(buf, packet_len(0x9c), bl, target);
if (disguised(bl)) {
WBUFL(buf,2) = -bl->id;
WBUFW(buf,6) = 0;
- clif_send(buf, packet_len(0x9c), bl, SELF);
+ clif->send(buf, packet_len(0x9c), bl, SELF);
}
}
@@ -11754,7 +11719,7 @@ void clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info** results,
void clif_parse_PartyBookingDeleteReq(int fd, struct map_session_data* sd)
{
if(party_booking_delete(sd))
- clif_PartyBookingDeleteAck(sd, 0);
+ clif->PartyBookingDeleteAck(sd, 0);
}
@@ -11808,7 +11773,7 @@ void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_boo
for(i=0; i<PARTY_BOOKING_JOBS; i++)
WBUFW(buf,38+i*2) = pb_ad->p_detail.job[i];
- clif_send(buf, packet_len(0x809), &sd->bl, ALL_CLIENT);
+ clif->send(buf, packet_len(0x809), &sd->bl, ALL_CLIENT);
}
@@ -11825,7 +11790,7 @@ void clif_PartyBookingUpdateNotify(struct map_session_data* sd, struct party_boo
WBUFL(buf,2) = pb_ad->index;
for(i=0; i<PARTY_BOOKING_JOBS; i++)
WBUFW(buf,6+i*2) = pb_ad->p_detail.job[i];
- clif_send(buf,packet_len(0x80a),&sd->bl,ALL_CLIENT); // Now UPDATE all client.
+ clif->send(buf,packet_len(0x80a),&sd->bl,ALL_CLIENT); // Now UPDATE all client.
}
@@ -11838,7 +11803,7 @@ void clif_PartyBookingDeleteNotify(struct map_session_data* sd, int index)
WBUFW(buf,0) = 0x80b;
WBUFL(buf,2) = index;
- clif_send(buf, packet_len(0x80b), &sd->bl, ALL_CLIENT); // Now UPDATE all client.
+ clif->send(buf, packet_len(0x80b), &sd->bl, ALL_CLIENT); // Now UPDATE all client.
}
@@ -15021,7 +14986,7 @@ void clif_bg_hp(struct map_session_data *sd)
WBUFW(buf,32) = sd->battle_status.max_hp;
}
- clif_send(buf, packet_len(cmd), &sd->bl, BG_AREA_WOS);
+ clif->send(buf, packet_len(cmd), &sd->bl, BG_AREA_WOS);
}
@@ -15039,7 +15004,7 @@ void clif_bg_xy(struct map_session_data *sd)
WBUFW(buf,32)=sd->bl.x;
WBUFW(buf,34)=sd->bl.y;
- clif_send(buf, packet_len(0x2df), &sd->bl, BG_SAMEMAP_WOS);
+ clif->send(buf, packet_len(0x2df), &sd->bl, BG_SAMEMAP_WOS);
}
void clif_bg_xy_remove(struct map_session_data *sd)
@@ -15054,7 +15019,7 @@ void clif_bg_xy_remove(struct map_session_data *sd)
WBUFW(buf,32)=-1;
WBUFW(buf,34)=-1;
- clif_send(buf, packet_len(0x2df), &sd->bl, BG_SAMEMAP_WOS);
+ clif->send(buf, packet_len(0x2df), &sd->bl, BG_SAMEMAP_WOS);
}
@@ -15074,7 +15039,7 @@ void clif_bg_message(struct battleground_data *bg, int src_id, const char *name,
WBUFL(buf,4) = src_id;
memcpy(WBUFP(buf,8), name, NAME_LENGTH);
memcpy(WBUFP(buf,32), mes, len);
- clif_send(buf,WBUFW(buf,2), &sd->bl, BG);
+ clif->send(buf,WBUFW(buf,2), &sd->bl, BG);
if( buf )
aFree(buf);
@@ -15125,7 +15090,7 @@ void clif_bg_updatescore(int16 m)
WBUFW(buf,0) = 0x2de;
WBUFW(buf,2) = map[m].bgscore_lion;
WBUFW(buf,4) = map[m].bgscore_eagle;
- clif_send(buf,packet_len(0x2de),&bl,ALL_SAMEMAP);
+ clif->send(buf,packet_len(0x2de),&bl,ALL_SAMEMAP);
}
void clif_bg_updatescore_single(struct map_session_data *sd)
@@ -15153,7 +15118,7 @@ void clif_sendbgemblem_area(struct map_session_data *sd)
WBUFL(buf,2) = sd->bl.id;
safestrncpy((char*)WBUFP(buf,6), sd->status.name, NAME_LENGTH); // name don't show in screen.
WBUFW(buf,30) = sd->bg_id;
- clif_send(buf,packet_len(0x2dd), &sd->bl, AREA);
+ clif->send(buf,packet_len(0x2dd), &sd->bl, AREA);
}
void clif_sendbgemblem_single(int fd, struct map_session_data *sd)
@@ -15178,7 +15143,7 @@ void clif_font(struct map_session_data *sd)
WBUFW(buf,0) = 0x2ef;
WBUFL(buf,2) = sd->bl.id;
WBUFW(buf,6) = sd->user_font;
- clif_send(buf, packet_len(0x2ef), &sd->bl, AREA);
+ clif->send(buf, packet_len(0x2ef), &sd->bl, AREA);
#endif
}
@@ -15204,14 +15169,14 @@ int clif_instance(int instance_id, int type, int flag)
WBUFW(buf,0) = 0x02CB;
memcpy(WBUFP(buf,2),instance[instance_id].name,INSTANCE_NAME_LENGTH);
WBUFW(buf,63) = flag;
- clif_send(buf,packet_len(0x02CB),&sd->bl,PARTY);
+ clif->send(buf,packet_len(0x02CB),&sd->bl,PARTY);
break;
case 2:
// S 0x2cc <Standby Position>.W
// To announce Instancing queue creation if no maps available
WBUFW(buf,0) = 0x02CC;
WBUFW(buf,2) = flag;
- clif_send(buf,packet_len(0x02CC),&sd->bl,PARTY);
+ clif->send(buf,packet_len(0x02CC),&sd->bl,PARTY);
break;
case 3:
case 4:
@@ -15228,7 +15193,7 @@ int clif_instance(int instance_id, int type, int flag)
WBUFL(buf,63) = 0;
WBUFL(buf,67) = (uint32)instance[instance_id].idle_timeout;
}
- clif_send(buf,packet_len(0x02CD),&sd->bl,PARTY);
+ clif->send(buf,packet_len(0x02CD),&sd->bl,PARTY);
break;
case 5:
// S 0x2ce <Message ID>.L
@@ -15240,7 +15205,7 @@ int clif_instance(int instance_id, int type, int flag)
WBUFW(buf,0) = 0x02CE;
WBUFL(buf,2) = flag;
//WBUFL(buf,6) = EnterLimitDate;
- clif_send(buf,packet_len(0x02CE),&sd->bl,PARTY);
+ clif->send(buf,packet_len(0x02CE),&sd->bl,PARTY);
break;
}
return 0;
@@ -15302,7 +15267,7 @@ void clif_party_show_picker(struct map_session_data * sd, struct item * item_dat
clif_addcards(WBUFP(buf,11), item_data);
WBUFW(buf,19) = id->equip; // equip location
WBUFB(buf,21) = itemtype(id->type); // item type
- clif_send(buf, packet_len(0x2b8), &sd->bl, PARTY_SAMEMAP_WOS);
+ clif->send(buf, packet_len(0x2b8), &sd->bl, PARTY_SAMEMAP_WOS);
#endif
}
@@ -15571,7 +15536,7 @@ void clif_buyingstore_entry(struct map_session_data* sd)
WBUFL(buf,2) = sd->bl.id;
memcpy(WBUFP(buf,6), sd->message, MESSAGE_SIZE);
- clif_send(buf, packet_len(0x814), &sd->bl, AREA_WOS);
+ clif->send(buf, packet_len(0x814), &sd->bl, AREA_WOS);
}
void clif_buyingstore_entry_single(struct map_session_data* sd, struct map_session_data* pl_sd)
{
@@ -15602,7 +15567,7 @@ void clif_buyingstore_disappear_entry(struct map_session_data* sd)
WBUFW(buf,0) = 0x816;
WBUFL(buf,2) = sd->bl.id;
- clif_send(buf, packet_len(0x816), &sd->bl, AREA_WOS);
+ clif->send(buf, packet_len(0x816), &sd->bl, AREA_WOS);
}
void clif_buyingstore_disappear_entry_single(struct map_session_data* sd, struct map_session_data* pl_sd)
{
@@ -16025,7 +15990,7 @@ void clif_millenniumshield(struct map_session_data *sd, short shields ) {
WBUFL(buf,2) = sd->bl.id;
WBUFW(buf,6) = shields;
WBUFW(buf,8) = 0;
- clif_send(buf,packet_len(0x440),&sd->bl,AREA);
+ clif->send(buf,packet_len(0x440),&sd->bl,AREA);
#endif
}
/**
@@ -16216,7 +16181,7 @@ int clif_status_load_notick(struct block_list *bl,int type,int flag,int val1, in
WBUFL(buf,17) = val2;
WBUFL(buf,21) = val3;
- clif_send(buf,packet_len(0x043f),bl,AREA);
+ clif->send(buf,packet_len(0x043f),bl,AREA);
return 0;
}
//Notifies FD of ID's type
@@ -16285,7 +16250,7 @@ void clif_talisman(struct map_session_data *sd,short type)
WBUFL(buf,2)=sd->bl.id;
WBUFW(buf,6)=type;
WBUFW(buf,8)=sd->talisman[type];
- clif_send(buf,packet_len(0x08cf),&sd->bl,AREA);
+ clif->send(buf,packet_len(0x08cf),&sd->bl,AREA);
}
/// Move Item from or to Personal Tab (CZ_WHATSOEVER) [FE]
/// 0907 <index>.W
@@ -16340,7 +16305,7 @@ void clif_snap( struct block_list *bl, short x, short y ) {
WBUFW(buf,6) = x;
WBUFW(buf,8) = y;
- clif_send(buf,packet_len(0x8d2),bl,AREA);
+ clif->send(buf,packet_len(0x8d2),bl,AREA);
}
void clif_monster_hp_bar( struct mob_data* md, int fd ) {
@@ -16871,7 +16836,6 @@ static int packetdb_readdb(void)
{clif_parse_SelectEgg,"selectegg"},
{clif_parse_SendEmotion,"sendemotion"},
{clif_parse_ChangePetName,"changepetname"},
-
{clif_parse_GMKick,"gmkick"},
{clif_parse_GMHide,"gmhide"},
{clif_parse_GMReqNoChat,"gmreqnochat"},
@@ -17126,8 +17090,8 @@ int do_init_clif(void) {
packetdb_readdb();
set_defaultparse(clif_parse);
- if( make_listen_bind(bind_ip,map_port) == -1 ) {
- ShowFatalError("Failed to bind to port '"CL_WHITE"%d"CL_RESET"'\n",map_port);
+ if( make_listen_bind(clif->bind_ip,clif->map_port) == -1 ) {
+ ShowFatalError("Failed to bind to port '"CL_WHITE"%d"CL_RESET"'\n",clif->map_port);
exit(EXIT_FAILURE);
}
@@ -17142,3 +17106,390 @@ int do_init_clif(void) {
void do_final_clif(void) {
ers_destroy(delay_clearunit_ers);
}
+void clif_defaults(void) {
+ clif = &clif_s;
+ /* vars */
+ clif->bind_ip = INADDR_ANY;
+ clif->map_port = 5121;
+ /* core */
+ clif->init = do_init_clif;
+ clif->final = do_final_clif;
+ clif->setip = clif_setip;
+ clif->setbindip = clif_setbindip;
+ clif->setport = clif_setport;
+ clif->refresh_ip = clif_refresh_ip;
+ clif->send = clif_send;
+ /* auth */
+ clif->authok = clif_authok;
+ clif->authrefuse = clif_authrefuse;
+ clif->authfail_fd = clif_authfail_fd;
+ clif->charselectok = clif_charselectok;
+ /* item-related */
+ clif->dropflooritem = clif_dropflooritem;
+ clif->clearflooritem = clif_clearflooritem;
+ clif->additem = clif_additem;
+ clif->dropitem = clif_dropitem;
+ clif->delitem = clif_delitem;
+ clif->takeitem = clif_takeitem;
+ clif->arrowequip = clif_arrowequip;
+ clif->arrow_fail = clif_arrow_fail;
+ clif->use_card = clif_use_card;
+ clif->cart_additem = clif_cart_additem;
+ clif->cart_delitem = clif_cart_delitem;
+ clif->equipitemack = clif_equipitemack;
+ clif->unequipitemack = clif_unequipitemack;
+ clif->useitemack = clif_useitemack;
+ /* unit-related */
+ clif->clearunit_single = clif_clearunit_single;
+ clif->clearunit_area = clif_clearunit_area;
+ clif->clearunit_delayed = clif_clearunit_delayed;
+ clif->walkok = clif_walkok;
+ clif->move = clif_move;
+ clif->blown = clif_blown;
+ clif->slide = clif_slide;
+ clif->fixpos = clif_fixpos;
+ clif->changelook = clif_changelook;
+ clif->changetraplook = clif_changetraplook;
+ clif->refreshlook = clif_refreshlook;
+ clif->class_change = clif_class_change;
+ clif->skill_setunit = clif_skill_setunit;
+ clif->skill_delunit = clif_skill_delunit;
+ clif->skillunit_update = clif_skillunit_update;
+ /* main unit spawn */
+ clif->spawn = clif_spawn;
+ /* map-related */
+ clif->changemap = clif_changemap;
+ clif->changemapcell = clif_changemapcell;
+ clif->map_property = clif_map_property;
+ clif->pvpset = clif_pvpset;
+ clif->map_property_mapall = clif_map_property_mapall;
+ clif->bossmapinfo = clif_bossmapinfo;
+ /* multi-map-server */
+ clif->changemapserver = clif_changemapserver;
+ /* npc-shop-related */
+ clif->npcbuysell = clif_npcbuysell;
+ clif->buylist = clif_buylist;
+ clif->selllist = clif_selllist;
+ clif->cashshop_show = clif_cashshop_show;
+ /* npc-script-related */
+ clif->scriptmes = clif_scriptmes;
+ clif->scriptnext = clif_scriptnext;
+ clif->scriptclose = clif_scriptclose;
+ clif->scriptmenu = clif_scriptmenu;
+ clif->scriptinput = clif_scriptinput;
+ clif->scriptinputstr = clif_scriptinputstr;
+ clif->cutin = clif_cutin;
+ clif->sendfakenpc = clif_sendfakenpc;
+ /* client-user-interface-related */
+ clif->viewpoint = clif_viewpoint;
+ clif->damage = clif_damage;
+ clif->sitting = clif_sitting;
+ clif->standing = clif_standing;
+ clif->arrow_create_list = clif_arrow_create_list;
+ clif->refresh = clif_refresh;
+ clif->fame_blacksmith = clif_fame_blacksmith;
+ clif->fame_alchemist = clif_fame_alchemist;
+ clif->fame_taekwon = clif_fame_taekwon;
+ clif->hotkeys = clif_hotkeys_send;
+ clif->insight = clif_insight;
+ clif->outsight = clif_outsight;
+ clif->skillcastcancel = clif_skillcastcancel;
+ clif->skill_fail = clif_skill_fail;
+ clif->skill_cooldown = clif_skill_cooldown;
+ clif->skill_memomessage = clif_skill_memomessage;
+ clif->skill_teleportmessage = clif_skill_teleportmessage;
+ clif->skill_produce_mix_list = clif_skill_produce_mix_list;
+ clif->cooking_list = clif_cooking_list;
+ clif->autospell = clif_autospell;
+ clif->combo_delay = clif_combo_delay;
+ clif->status_change = clif_status_change;
+ clif->insert_card = clif_insert_card;
+ clif->inventorylist = clif_inventorylist;
+ clif->equiplist = clif_equiplist;
+ clif->cartlist = clif_cartlist;
+ clif->clearcart = clif_clearcart;
+ clif->item_identify_list = clif_item_identify_list;
+ clif->item_identified = clif_item_identified;
+ clif->item_repair_list = clif_item_repair_list;
+ clif->item_repaireffect = clif_item_repaireffect;
+ clif->item_damaged = clif_item_damaged;
+ clif->item_refine_list = clif_item_refine_list;
+ clif->item_skill = clif_item_skill;
+ clif->mvp_item = clif_mvp_item;
+ clif->mvp_exp = clif_mvp_exp;
+ clif->mvp_noitem = clif_mvp_noitem;
+ clif->changed_dir = clif_changed_dir;
+ clif->charnameack = clif_charnameack;
+ clif->monster_hp_bar = clif_monster_hp_bar;
+ clif->hpmeter_single = clif_hpmeter_single;
+ clif->upgrademessage = clif_upgrademessage;
+ clif->get_weapon_view = clif_get_weapon_view;
+ clif->gospel_info = clif_gospel_info;
+ clif->feel_req = clif_feel_req;
+ clif->starskill = clif_starskill;
+ clif->feel_info = clif_feel_info;
+ clif->hate_info = clif_hate_info;
+ clif->mission_info = clif_mission_info;
+ clif->feel_hate_reset = clif_feel_hate_reset;
+ clif->equiptickack = clif_equiptickack;
+ clif->viewequip_ack = clif_viewequip_ack;
+ clif->viewequip_fail = clif_viewequip_fail;
+ clif->equipcheckbox = clif_equipcheckbox;
+ clif->displayexp = clif_displayexp;
+ clif->font = clif_font;
+ clif->progressbar = clif_progressbar;
+ clif->progressbar_abort = clif_progressbar_abort;
+ clif->showdigit = clif_showdigit;
+ clif->elementalconverter_list = clif_elementalconverter_list;
+ clif->spellbook_list = clif_spellbook_list;
+ clif->magicdecoy_list = clif_magicdecoy_list;
+ clif->poison_list = clif_poison_list;
+ clif->autoshadowspell_list = clif_autoshadowspell_list;
+ clif->skill_itemlistwindow = clif_skill_itemlistwindow;
+ clif->sc_notick = clif_status_load_notick;
+ clif->sc_single = clif_status_load_single;
+ /* player-unit-specific-related */
+ clif->updatestatus = clif_updatestatus;
+ clif->changestatus = clif_changestatus;
+ clif->statusupack = clif_statusupack;
+ clif->movetoattack = clif_movetoattack;
+ clif->solved_charname = clif_solved_charname;
+ clif->charnameupdate = clif_charnameupdate;
+ /* visual effects client-side */
+ clif->misceffect = clif_misceffect;
+ clif->changeoption = clif_changeoption;
+ clif->changeoption2 = clif_changeoption2;
+ clif->emotion = clif_emotion;
+ clif->talkiebox = clif_talkiebox;
+ clif->wedding_effect = clif_wedding_effect;
+ clif->divorced = clif_divorced;
+ clif->callpartner = clif_callpartner;
+ clif->skill_damage = clif_skill_damage;
+ clif->skill_nodamage = clif_skill_nodamage;
+ clif->skill_poseffect = clif_skill_poseffect;
+ clif->skill_estimation = clif_skill_estimation;
+ clif->skill_warppoint = clif_skill_warppoint;
+ clif->skillcasting = clif_skillcasting;
+ clif->produce_effect = clif_produceeffect;
+ clif->devotion = clif_devotion;
+ clif->spiritball = clif_spiritball;
+ clif->bladestop = clif_bladestop;
+ clif->mvp_effect = clif_mvp_effect;
+ clif->heal = clif_heal;
+ clif->resurrection = clif_resurrection;
+ clif->refine = clif_refine;
+ clif->weather = clif_weather;
+ clif->specialeffect = clif_specialeffect;
+ clif->specialeffect_single = clif_specialeffect_single;
+ clif->specialeffect_value = clif_specialeffect_value;
+ clif->millenniumshield = clif_millenniumshield;
+ clif->talisman = clif_talisman;
+ clif->snap = clif_snap;
+ /* sound effects client-side */
+ clif->playBGM = clif_playBGM;
+ clif->soundeffect = clif_soundeffect;
+ clif->soundeffectall = clif_soundeffectall;
+ /* chat/message-related */
+ clif->GlobalMessage = clif_GlobalMessage;
+ clif->createchat = clif_createchat;
+ clif->dispchat = clif_dispchat;
+ clif->joinchatfail = clif_joinchatfail;
+ clif->joinchatok = clif_joinchatok;
+ clif->addchat = clif_addchat;
+ clif->changechatowner = clif_changechatowner;
+ clif->clearchat = clif_clearchat;
+ clif->leavechat = clif_leavechat;
+ clif->changechatstatus = clif_changechatstatus;
+ clif->wis_message = clif_wis_message;
+ clif->wis_end = clif_wis_end;
+ clif->displaymessage = clif_displaymessage;
+ clif->disp_onlyself = clif_disp_onlyself;
+ clif->disp_message = clif_disp_message;
+ clif->broadcast = clif_broadcast;
+ clif->MainChatMessage = clif_MainChatMessage;
+ clif->broadcast2 = clif_broadcast2;
+ clif->messagecolor = clif_messagecolor;
+ clif->message = clif_message;
+ clif->disp_overhead = clif_disp_overhead;
+ clif->msg = clif_msg;
+ clif->msg_value = clif_msg_value;
+ clif->msg_skill = clif_msg_skill;
+ clif->msgtable = clif_msgtable;
+ clif->msgtable_num = clif_msgtable_num;
+ clif->colormes = clif_colormes;
+ /* trade handling */
+ clif->traderequest = clif_traderequest;
+ clif->tradestart = clif_tradestart;
+ clif->tradeadditem = clif_tradeadditem;
+ clif->tradeitemok = clif_tradeitemok;
+ clif->tradedeal_lock = clif_tradedeal_lock;
+ clif->tradecancelled = clif_tradecancelled;
+ clif->tradecompleted = clif_tradecompleted;
+ clif->tradeundo = clif_tradeundo;
+ /* vending handling */
+ clif->openvendingreq = clif_openvendingreq;
+ clif->showvendingboard = clif_showvendingboard;
+ clif->closevendingboard = clif_closevendingboard;
+ clif->vendinglist = clif_vendinglist;
+ clif->buyvending = clif_buyvending;
+ clif->openvending = clif_openvending;
+ clif->vendingreport = clif_vendingreport;
+ /* storage handling */
+ clif->storagelist = clif_storagelist;
+ clif->updatestorageamount = clif_updatestorageamount;
+ clif->storageitemadded = clif_storageitemadded;
+ clif->storageitemremoved = clif_storageitemremoved;
+ clif->storageclose = clif_storageclose;
+ /* skill-list handling */
+ clif->skillinfoblock = clif_skillinfoblock;
+ clif->skillup = clif_skillup;
+ clif->skillinfo = clif_skillinfo;
+ clif->addskill = clif_addskill;
+ clif->deleteskill = clif_deleteskill;
+ /* party-specific */
+ clif->party_created = clif_party_created;
+ clif->party_member_info = clif_party_member_info;
+ clif->party_info = clif_party_info;
+ clif->party_invite = clif_party_invite;
+ clif->party_inviteack = clif_party_inviteack;
+ clif->party_option = clif_party_option;
+ clif->party_withdraw = clif_party_withdraw;
+ clif->party_message = clif_party_message;
+ clif->party_xy = clif_party_xy;
+ clif->party_xy_single = clif_party_xy_single;
+ clif->party_hp = clif_party_hp;
+ clif->party_xy_remove = clif_party_xy_remove;
+ clif->party_show_picker = clif_party_show_picker;
+ /* guild-specific */
+ clif->guild_created = clif_guild_created;
+ clif->guild_belonginfo = clif_guild_belonginfo;
+ clif->guild_masterormember = clif_guild_masterormember;
+ clif->guild_basicinfo = clif_guild_basicinfo;
+ clif->guild_allianceinfo = clif_guild_allianceinfo;
+ clif->guild_memberlist = clif_guild_memberlist;
+ clif->guild_skillinfo = clif_guild_skillinfo;
+ clif->guild_send_onlineinfo = clif_guild_send_onlineinfo;
+ clif->guild_memberlogin_notice = clif_guild_memberlogin_notice;
+ clif->guild_invite = clif_guild_invite;
+ clif->guild_inviteack = clif_guild_inviteack;
+ clif->guild_leave = clif_guild_leave;
+ clif->guild_expulsion = clif_guild_expulsion;
+ clif->guild_positionchanged = clif_guild_positionchanged;
+ clif->guild_memberpositionchanged = clif_guild_memberpositionchanged;
+ clif->guild_emblem = clif_guild_emblem;
+ clif->guild_emblem_area = clif_guild_emblem_area;
+ clif->guild_notice = clif_guild_notice;
+ clif->guild_message = clif_guild_message;
+ clif->guild_skillup = clif_guild_skillup;
+ clif->guild_reqalliance = clif_guild_reqalliance;
+ clif->guild_allianceack = clif_guild_allianceack;
+ clif->guild_delalliance = clif_guild_delalliance;
+ clif->guild_oppositionack = clif_guild_oppositionack;
+ clif->guild_broken = clif_guild_broken;
+ clif->guild_xy = clif_guild_xy;
+ clif->guild_xy_single = clif_guild_xy_single;
+ clif->guild_xy_remove = clif_guild_xy_remove;
+ /* battleground-specific */
+ clif->bg_hp = clif_bg_hp;
+ clif->bg_xy = clif_bg_xy;
+ clif->bg_xy_remove = clif_bg_xy_remove;
+ clif->bg_message = clif_bg_message;
+ clif->bg_updatescore = clif_bg_updatescore;
+ clif->bg_updatescore_single = clif_bg_updatescore_single;
+ clif->sendbgemblem_area = clif_sendbgemblem_area;
+ clif->sendbgemblem_single = clif_sendbgemblem_single;
+ /* instance-related */
+ clif->instance = clif_instance;
+ clif->instance_join = clif_instance_join;
+ clif->instance_leave = clif_instance_leave;
+ /* pet-related */
+ clif->catch_process = clif_catch_process;
+ clif->pet_roulette = clif_pet_roulette;
+ clif->sendegg = clif_sendegg;
+ clif->send_petstatus = clif_send_petstatus;
+ clif->send_petdata = clif_send_petdata;
+ clif->pet_emotion = clif_pet_emotion;
+ clif->pet_food = clif_pet_food;
+ /* friend-related */
+ clif->friendslist_toggle_sub = clif_friendslist_toggle_sub;
+ clif->friendslist_send = clif_friendslist_send;
+ clif->friendslist_reqack = clif_friendslist_reqack;
+ /* gm-related */
+ clif->GM_kickack = clif_GM_kickack;
+ clif->GM_kick = clif_GM_kick;
+ clif->manner_message = clif_manner_message;
+ clif->GM_silence = clif_GM_silence;
+ /* hom-related */
+ clif->hominfo = clif_hominfo;
+ clif->homskillinfoblock = clif_homskillinfoblock;
+ clif->homskillup = clif_homskillup;
+ clif->hom_food = clif_hom_food;
+ clif->send_homdata = clif_send_homdata;
+ /* questlog-related */
+ clif->quest_send_list = clif_quest_send_list;
+ clif->quest_send_mission = clif_quest_send_mission;
+ clif->quest_add = clif_quest_add;
+ clif->quest_delete = clif_quest_delete;
+ clif->quest_update_status = clif_quest_update_status;
+ clif->quest_update_objective = clif_quest_update_objective;
+ clif->quest_show_event = clif_quest_show_event;
+ /* mail-related */
+ clif->mail_window = clif_Mail_window;
+ clif->mail_read = clif_Mail_read;
+ clif->mail_delete = clif_Mail_delete;
+ clif->mail_return = clif_Mail_return;
+ clif->mail_send = clif_Mail_send;
+ clif->mail_new = clif_Mail_new;
+ clif->mail_refreshinbox = clif_Mail_refreshinbox;
+ clif->mail_getattachment = clif_Mail_getattachment;
+ /* auction-related */
+ clif->auction_openwindow = clif_Auction_openwindow;
+ clif->auction_results = clif_Auction_results;
+ clif->auction_message = clif_Auction_message;
+ clif->auction_close = clif_Auction_close;
+ /* mercenary-related */
+ clif->mercenary_info = clif_mercenary_info;
+ clif->mercenary_skillblock = clif_mercenary_skillblock;
+ clif->mercenary_message = clif_mercenary_message;
+ clif->mercenary_updatestatus = clif_mercenary_updatestatus;
+ /* item rental */
+ clif->rental_time = clif_rental_time;
+ clif->rental_expired = clif_rental_expired;
+ /* party booking related */
+ clif->PartyBookingRegisterAck = clif_PartyBookingRegisterAck;
+ clif->PartyBookingDeleteAck = clif_PartyBookingDeleteAck;
+ clif->PartyBookingSearchAck = clif_PartyBookingSearchAck;
+ clif->PartyBookingUpdateNotify = clif_PartyBookingUpdateNotify;
+ clif->PartyBookingDeleteNotify = clif_PartyBookingDeleteNotify;
+ clif->PartyBookingInsertNotify = clif_PartyBookingInsertNotify;
+ /* buying store-related */
+ clif->buyingstore_open = clif_buyingstore_open;
+ clif->buyingstore_open_failed = clif_buyingstore_open_failed;
+ clif->buyingstore_myitemlist = clif_buyingstore_myitemlist;
+ clif->buyingstore_entry = clif_buyingstore_entry;
+ clif->buyingstore_entry_single = clif_buyingstore_entry_single;
+ clif->buyingstore_disappear_entry = clif_buyingstore_disappear_entry;
+ clif->buyingstore_disappear_entry_single = clif_buyingstore_disappear_entry_single;
+ clif->buyingstore_itemlist = clif_buyingstore_itemlist;
+ clif->buyingstore_trade_failed_buyer = clif_buyingstore_trade_failed_buyer;
+ clif->buyingstore_update_item = clif_buyingstore_update_item;
+ clif->buyingstore_delete_item = clif_buyingstore_delete_item;
+ clif->buyingstore_trade_failed_seller = clif_buyingstore_trade_failed_seller;
+ /* search store-related */
+ clif->search_store_info_ack = clif_search_store_info_ack;
+ clif->search_store_info_failed = clif_search_store_info_failed;
+ clif->open_search_store_info = clif_open_search_store_info;
+ clif->search_store_info_click_ack = clif_search_store_info_click_ack;
+ /* elemental-related */
+ clif->elemental_info = clif_elemental_info;
+ clif->elemental_updatestatus = clif_elemental_updatestatus;
+ /* misc-handling */
+ clif->adopt_reply = clif_Adopt_reply;
+ clif->readbook = clif_readbook;
+ /*------------------------
+ *- Parse Incoming Packet
+ *------------------------*/
+ clif->ActionRequest_sub = clif_parse_ActionRequest_sub;
+ clif->LoadEndAck = clif_parse_LoadEndAck;
+ clif->Auction_cancelreg = clif_parse_Auction_cancelreg;
+}
diff --git a/src/map/clif.h b/src/map/clif.h
index 1c04ae393..c93169a77 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -1,15 +1,19 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#ifndef _CLIF_H_
#define _CLIF_H_
#include "../common/cbasetypes.h"
-//#include "../common/mmo.h"
+#include <stdarg.h>
+
+/**
+ * Declarations
+ **/
struct item;
struct storage_data;
struct guild_storage;
-//#include "map.h"
struct block_list;
struct unit_data;
struct map_session_data;
@@ -27,27 +31,23 @@ struct guild;
struct battleground_data;
struct quest;
struct party_booking_ad_info;
-#include <stdarg.h>
-enum
-{// packet DB
+/**
+ * Defines
+ **/
+#define SERVER 0 /* reserved for server use */
+#define packet_len(cmd) packet_db[SERVER][cmd].len
+#define clif_menuskill_clear(sd) (sd)->menuskill_id = (sd)->menuskill_val = (sd)->menuskill_val2 = 0;
+
+/**
+ * Enumerations
+ **/
+enum {// packet DB
MAX_PACKET_DB = 0xF00,
MAX_PACKET_VER = 32,
MAX_PACKET_POS = 20,
};
-struct s_packet_db {
- short len;
- void (*func)(int, struct map_session_data *);
- short pos[MAX_PACKET_POS];
-};
-
-// packet_db[SERVER] is reserved for server use
-#define SERVER 0
-#define packet_len(cmd) packet_db[SERVER][cmd].len
-extern struct s_packet_db packet_db[MAX_PACKET_VER+1][MAX_PACKET_DB+1];
-
-// local define
typedef enum send_target {
ALL_CLIENT,
ALL_SAMEMAP,
@@ -83,8 +83,7 @@ typedef enum send_target {
BG_AREA_WOS,
} send_target;
-typedef enum emotion_type
-{
+typedef enum emotion_type {
E_GASP = 0, // /!
E_WHAT, // /?
E_HO,
@@ -173,12 +172,11 @@ typedef enum emotion_type
E_YUT5,
E_YUT6,
E_YUT7,
- //
+ /* ... */
E_MAX
} emotion_type;
-typedef enum clr_type
-{
+typedef enum clr_type {
CLR_OUTSIGHT = 0,
CLR_DEAD,
CLR_RESPAWN,
@@ -186,8 +184,7 @@ typedef enum clr_type
CLR_TRICKDEAD,
} clr_type;
-enum map_property
-{// clif_map_property
+enum map_property { // clif_map_property
MAPPROPERTY_NOTHING = 0,
MAPPROPERTY_FREEPVPZONE = 1,
MAPPROPERTY_EVENTPVPZONE = 2,
@@ -197,8 +194,7 @@ enum map_property
MAPPROPERTY_DENYSKILLZONE = 6,
};
-enum map_type
-{// clif_map_type
+enum map_type { // clif_map_type
MAPTYPE_VILLAGE = 0,
MAPTYPE_VILLAGE_IN = 1,
MAPTYPE_FIELD = 2,
@@ -226,8 +222,7 @@ enum map_type
MAPTYPE_UNUSED = 29,
};
-enum useskill_fail_cause
-{// clif_skill_fail
+enum useskill_fail_cause { // clif_skill_fail
USESKILL_FAIL_LEVEL = 0,
USESKILL_FAIL_SP_INSUFFICIENT = 1,
USESKILL_FAIL_HP_INSUFFICIENT = 2,
@@ -318,459 +313,425 @@ enum clif_messages {
SKILL_CANT_USE_AREA = 0x536,
};
-int clif_setip(const char* ip);
-void clif_setbindip(const char* ip);
-void clif_setport(uint16 port);
-
-uint32 clif_getip(void);
-uint32 clif_refresh_ip(void);
-uint16 clif_getport(void);
-
-void clif_authok(struct map_session_data *sd);
-void clif_authrefuse(int fd, uint8 error_code);
-void clif_authfail_fd(int fd, int type);
-void clif_charselectok(int id, uint8 ok);
-void clif_dropflooritem(struct flooritem_data* fitem);
-void clif_clearflooritem(struct flooritem_data *fitem, int fd);
-
-void clif_clearunit_single(int id, clr_type type, int fd);
-void clif_clearunit_area(struct block_list* bl, clr_type type);
-void clif_clearunit_delayed(struct block_list* bl, clr_type type, unsigned int tick);
-int clif_spawn(struct block_list *bl); //area
-void clif_walkok(struct map_session_data *sd); // self
-void clif_move(struct unit_data *ud); //area
-void clif_changemap(struct map_session_data *sd, short map, int x, int y); //self
-void clif_changemapserver(struct map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port); //self
-void clif_blown(struct block_list *bl); // area
-void clif_slide(struct block_list *bl, int x, int y); // area
-void clif_fixpos(struct block_list *bl); // area
-void clif_npcbuysell(struct map_session_data* sd, int id); //self
-void clif_buylist(struct map_session_data *sd, struct npc_data *nd); //self
-void clif_selllist(struct map_session_data *sd); //self
-void clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes); //self
-void clif_scriptnext(struct map_session_data *sd,int npcid); //self
-void clif_scriptclose(struct map_session_data *sd, int npcid); //self
-void clif_scriptmenu(struct map_session_data* sd, int npcid, const char* mes); //self
-void clif_scriptinput(struct map_session_data *sd, int npcid); //self
-void clif_scriptinputstr(struct map_session_data *sd, int npcid); // self
-void clif_cutin(struct map_session_data* sd, const char* image, int type); //self
-void clif_viewpoint(struct map_session_data *sd, int npc_id, int type, int x, int y, int id, int color); //self
-void clif_additem(struct map_session_data *sd, int n, int amount, int fail); // self
-void clif_dropitem(struct map_session_data *sd,int n,int amount); //self
-void clif_delitem(struct map_session_data *sd,int n,int amount, short reason); //self
-void clif_updatestatus(struct map_session_data *sd,int type); //self
-void clif_changestatus(struct map_session_data* sd,int type,int val); //area
-int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tick, int sdelay, int ddelay, int damage, int div, int type, int damage2); // area
-void clif_takeitem(struct block_list* src, struct block_list* dst);
-void clif_sitting(struct block_list* bl);
-void clif_standing(struct block_list* bl);
-void clif_changelook(struct block_list *bl,int type,int val); // area
-void clif_changetraplook(struct block_list *bl,int val); // area
-void clif_refreshlook(struct block_list *bl,int id,int type,int val,enum send_target target); //area specified in 'target'
-void clif_arrowequip(struct map_session_data *sd,int val); //self
-void clif_arrow_fail(struct map_session_data *sd,int type); //self
-void clif_arrow_create_list(struct map_session_data *sd); //self
-void clif_statusupack(struct map_session_data *sd,int type,int ok,int val); // self
-void clif_equipitemack(struct map_session_data *sd,int n,int pos,int ok); // self
-void clif_unequipitemack(struct map_session_data *sd,int n,int pos,int ok); // self
-void clif_misceffect(struct block_list* bl,int type); // area
-void clif_changeoption(struct block_list* bl); // area
-void clif_changeoption2(struct block_list* bl); // area
-void clif_useitemack(struct map_session_data *sd,int index,int amount,bool ok); // self
-void clif_GlobalMessage(struct block_list* bl, const char* message);
-void clif_createchat(struct map_session_data* sd, int flag); // self
-void clif_dispchat(struct chat_data* cd, int fd); // area or fd
-void clif_joinchatfail(struct map_session_data *sd,int flag); // self
-void clif_joinchatok(struct map_session_data *sd,struct chat_data* cd); // self
-void clif_addchat(struct chat_data* cd,struct map_session_data *sd); // chat
-void clif_changechatowner(struct chat_data* cd, struct map_session_data* sd); // chat
-void clif_clearchat(struct chat_data *cd,int fd); // area or fd
-void clif_leavechat(struct chat_data* cd, struct map_session_data* sd, bool flag); // chat
-void clif_changechatstatus(struct chat_data* cd); // chat
-void clif_refresh(struct map_session_data *sd); // self
-
-void clif_fame_blacksmith(struct map_session_data *sd, int points);
-void clif_fame_alchemist(struct map_session_data *sd, int points);
-void clif_fame_taekwon(struct map_session_data *sd, int points);
-
-void clif_emotion(struct block_list *bl,int type);
-void clif_talkiebox(struct block_list* bl, const char* talkie);
-void clif_wedding_effect(struct block_list *bl);
-void clif_divorced(struct map_session_data* sd, const char* name);
-void clif_callpartner(struct map_session_data *sd);
-void clif_playBGM(struct map_session_data* sd, const char* name);
-void clif_soundeffect(struct map_session_data* sd, struct block_list* bl, const char* name, int type);
-void clif_soundeffectall(struct block_list* bl, const char* name, int type, enum send_target coverage);
-void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type, int target_id, unsigned int tick);
-void clif_parse_LoadEndAck(int fd,struct map_session_data *sd);
-void clif_hotkeys_send(struct map_session_data *sd);
-
-// trade
-void clif_traderequest(struct map_session_data* sd, const char* name);
-void clif_tradestart(struct map_session_data* sd, uint8 type);
-void clif_tradeadditem(struct map_session_data* sd, struct map_session_data* tsd, int index, int amount);
-void clif_tradeitemok(struct map_session_data* sd, int index, int fail);
-void clif_tradedeal_lock(struct map_session_data* sd, int fail);
-void clif_tradecancelled(struct map_session_data* sd);
-void clif_tradecompleted(struct map_session_data* sd, int fail);
-void clif_tradeundo(struct map_session_data* sd);
-
-// storage
-void clif_storagelist(struct map_session_data* sd, struct item* items, int items_length);
-void clif_updatestorageamount(struct map_session_data* sd, int amount, int max_amount);
-void clif_storageitemadded(struct map_session_data* sd, struct item* i, int index, int amount);
-void clif_storageitemremoved(struct map_session_data* sd, int index, int amount);
-void clif_storageclose(struct map_session_data* sd);
-
-int clif_insight(struct block_list *bl,va_list ap); // map_forallinmovearea callback
-int clif_outsight(struct block_list *bl,va_list ap); // map_forallinmovearea callback
-
-void clif_class_change(struct block_list *bl,int class_,int type);
-#define clif_mob_class_change(md, class_) clif_class_change(&md->bl, class_, 1)
-
-void clif_skillinfoblock(struct map_session_data *sd);
-void clif_skillup(struct map_session_data *sd,uint16 skill_id);
-void clif_skillinfo(struct map_session_data *sd,int skill, int inf);
-void clif_addskill(struct map_session_data *sd, int id);
-void clif_deleteskill(struct map_session_data *sd, int id);
-
-void clif_skillcasting(struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, int property, int casttime);
-void clif_skillcastcancel(struct block_list* bl);
-void clif_skill_fail(struct map_session_data *sd,uint16 skill_id,enum useskill_fail_cause cause,int btype);
-void clif_skill_cooldown(struct map_session_data *sd, uint16 skill_id, unsigned int tick);
-int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int tick,int sdelay,int ddelay,int damage,int div,uint16 skill_id,uint16 skill_lv,int type);
-//int clif_skill_damage2(struct block_list *src,struct block_list *dst,unsigned int tick,int sdelay,int ddelay,int damage,int div,uint16 skill_id,uint16 skill_lv,int type);
-int clif_skill_nodamage(struct block_list *src,struct block_list *dst,uint16 skill_id,int heal,int fail);
-void clif_skill_poseffect(struct block_list *src,uint16 skill_id,int val,int x,int y,int tick);
-void clif_skill_estimation(struct map_session_data *sd,struct block_list *dst);
-void clif_skill_warppoint(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4);
-void clif_skill_memomessage(struct map_session_data* sd, int type);
-void clif_skill_teleportmessage(struct map_session_data *sd, int type);
-void clif_skill_produce_mix_list(struct map_session_data *sd, int skill_id, int trigger);
-void clif_cooking_list(struct map_session_data *sd, int trigger, uint16 skill_id, int qty, int list_type);
-
-void clif_produceeffect(struct map_session_data* sd,int flag,int nameid);
-
-void clif_skill_setunit(struct skill_unit *unit);
-void clif_skill_delunit(struct skill_unit *unit);
-
-void clif_skillunit_update(struct block_list* bl);
-
-void clif_autospell(struct map_session_data *sd,uint16 skill_lv);
-void clif_devotion(struct block_list *src, struct map_session_data *tsd);
-void clif_spiritball(struct block_list *bl);
-void clif_combo_delay(struct block_list *bl,int wait);
-void clif_bladestop(struct block_list *src, int dst_id, int active);
-void clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_target target);
-
-#define clif_status_load(bl, type, flag) clif_status_change((bl), (type), (flag), 0, 0, 0, 0)
-void clif_status_change(struct block_list *bl,int type,int flag,int tick,int val1, int val2, int val3);
-
-void clif_wis_message(int fd, const char* nick, const char* mes, int mes_len);
-void clif_wis_end(int fd, int flag);
-
-void clif_solved_charname(int fd, int charid, const char* name);
-void clif_charnameack(int fd, struct block_list *bl);
-void clif_charnameupdate(struct map_session_data *ssd);
-
-void clif_use_card(struct map_session_data *sd,int idx);
-void clif_insert_card(struct map_session_data *sd,int idx_equip,int idx_card,int flag);
-
-void clif_inventorylist(struct map_session_data *sd);
-void clif_equiplist(struct map_session_data *sd);
-
-void clif_cart_additem(struct map_session_data *sd,int n,int amount,int fail);
-void clif_cart_delitem(struct map_session_data *sd,int n,int amount);
-void clif_cartlist(struct map_session_data *sd);
-void clif_clearcart(int fd);
-
-void clif_item_identify_list(struct map_session_data *sd);
-void clif_item_identified(struct map_session_data *sd,int idx,int flag);
-void clif_item_repair_list(struct map_session_data *sd, struct map_session_data *dstsd, int lv);
-void clif_item_repaireffect(struct map_session_data *sd, int idx, int flag);
-void clif_item_damaged(struct map_session_data* sd, unsigned short position);
-void clif_item_refine_list(struct map_session_data *sd);
-
-void clif_item_skill(struct map_session_data *sd,uint16 skill_id,uint16 skill_lv);
-
-void clif_mvp_effect(struct map_session_data *sd);
-void clif_mvp_item(struct map_session_data *sd,int nameid);
-void clif_mvp_exp(struct map_session_data *sd, unsigned int exp);
-void clif_mvp_noitem(struct map_session_data* sd);
-void clif_changed_dir(struct block_list *bl, enum send_target target);
-
-// vending
-void clif_openvendingreq(struct map_session_data* sd, int num);
-void clif_showvendingboard(struct block_list* bl, const char* message, int fd);
-void clif_closevendingboard(struct block_list* bl, int fd);
-void clif_vendinglist(struct map_session_data* sd, int id, struct s_vending* vending);
-void clif_buyvending(struct map_session_data* sd, int index, int amount, int fail);
-void clif_openvending(struct map_session_data* sd, int id, struct s_vending* vending);
-void clif_vendingreport(struct map_session_data* sd, int index, int amount);
-
-void clif_movetoattack(struct map_session_data *sd,struct block_list *bl);
-
-// party
-void clif_party_created(struct map_session_data *sd,int result);
-void clif_party_member_info(struct party_data *p, struct map_session_data *sd);
-void clif_party_info(struct party_data* p, struct map_session_data *sd);
-void clif_party_invite(struct map_session_data *sd,struct map_session_data *tsd);
-void clif_party_inviteack(struct map_session_data* sd, const char* nick, int result);
-void clif_party_option(struct party_data *p,struct map_session_data *sd,int flag);
-void clif_party_withdraw(struct party_data* p, struct map_session_data* sd, int account_id, const char* name, int flag);
-void clif_party_message(struct party_data* p, int account_id, const char* mes, int len);
-void clif_party_xy(struct map_session_data *sd);
-void clif_party_xy_single(int fd, struct map_session_data *sd);
-void clif_party_hp(struct map_session_data *sd);
-void clif_hpmeter_single(int fd, int id, unsigned int hp, unsigned int maxhp);
-
-// guild
-void clif_guild_created(struct map_session_data *sd,int flag);
-void clif_guild_belonginfo(struct map_session_data *sd, struct guild *g);
-void clif_guild_masterormember(struct map_session_data *sd);
-void clif_guild_basicinfo(struct map_session_data *sd);
-void clif_guild_allianceinfo(struct map_session_data *sd);
-void clif_guild_memberlist(struct map_session_data *sd);
-void clif_guild_skillinfo(struct map_session_data* sd);
-void clif_guild_send_onlineinfo(struct map_session_data *sd); //[LuzZza]
-void clif_guild_memberlogin_notice(struct guild *g,int idx,int flag);
-void clif_guild_invite(struct map_session_data *sd,struct guild *g);
-void clif_guild_inviteack(struct map_session_data *sd,int flag);
-void clif_guild_leave(struct map_session_data *sd,const char *name,const char *mes);
-void clif_guild_expulsion(struct map_session_data* sd, const char* name, const char* mes, int account_id);
-void clif_guild_positionchanged(struct guild *g,int idx);
-void clif_guild_memberpositionchanged(struct guild *g,int idx);
-void clif_guild_emblem(struct map_session_data *sd,struct guild *g);
-void clif_guild_emblem_area(struct block_list* bl);
-void clif_guild_notice(struct map_session_data* sd, struct guild* g);
-void clif_guild_message(struct guild *g,int account_id,const char *mes,int len);
-int clif_guild_skillup(struct map_session_data *sd,uint16 skill_id,int lv);
-void clif_guild_reqalliance(struct map_session_data *sd,int account_id,const char *name);
-void clif_guild_allianceack(struct map_session_data *sd,int flag);
-void clif_guild_delalliance(struct map_session_data *sd,int guild_id,int flag);
-void clif_guild_oppositionack(struct map_session_data *sd,int flag);
-void clif_guild_broken(struct map_session_data *sd,int flag);
-void clif_guild_xy(struct map_session_data *sd);
-void clif_guild_xy_single(int fd, struct map_session_data *sd);
-void clif_guild_xy_remove(struct map_session_data *sd);
-
-// Battleground
-void clif_bg_hp(struct map_session_data *sd);
-void clif_bg_xy(struct map_session_data *sd);
-void clif_bg_xy_remove(struct map_session_data *sd);
-void clif_bg_message(struct battleground_data *bg, int src_id, const char *name, const char *mes, int len);
-void clif_bg_updatescore(int16 m);
-void clif_bg_updatescore_single(struct map_session_data *sd);
-void clif_sendbgemblem_area(struct map_session_data *sd);
-void clif_sendbgemblem_single(int fd, struct map_session_data *sd);
-
-// Instancing
-int clif_instance(int instance_id, int type, int flag);
-void clif_instance_join(int fd, int instance_id);
-void clif_instance_leave(int fd);
-
-// Custom Fonts
-void clif_font(struct map_session_data *sd);
-
-// atcommand
-void clif_displaymessage(const int fd, const char* mes);
-void clif_disp_onlyself(struct map_session_data *sd, const char *mes, int len);
-void clif_disp_message(struct block_list* src, const char* mes, int len, enum send_target target);
-void clif_broadcast(struct block_list* bl, const char* mes, int len, int type, enum send_target target);
-void clif_MainChatMessage(const char* message);
-void clif_broadcast2(struct block_list* bl, const char* mes, int len, unsigned long fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target);
-void clif_heal(int fd,int type,int val);
-void clif_resurrection(struct block_list *bl,int type);
-void clif_map_property(struct map_session_data* sd, enum map_property property);
-void clif_pvpset(struct map_session_data *sd, int pvprank, int pvpnum,int type);
-void clif_map_property_mapall(int map, enum map_property property);
-void clif_refine(int fd, int fail, int index, int val);
-void clif_upgrademessage(int fd, int result, int item_id);
-
-//petsystem
-void clif_catch_process(struct map_session_data *sd);
-void clif_pet_roulette(struct map_session_data *sd,int data);
-void clif_sendegg(struct map_session_data *sd);
-void clif_send_petstatus(struct map_session_data *sd);
-void clif_send_petdata(struct map_session_data* sd, struct pet_data* pd, int type, int param);
-#define clif_pet_equip(sd, pd) clif_send_petdata(sd, pd, 3, (pd)->vd.head_bottom)
-#define clif_pet_equip_area(pd) clif_send_petdata(NULL, pd, 3, (pd)->vd.head_bottom)
-#define clif_pet_performance(pd, param) clif_send_petdata(NULL, pd, 4, param)
-void clif_pet_emotion(struct pet_data *pd,int param);
-void clif_pet_food(struct map_session_data *sd,int foodid,int fail);
-
-//friends list
-int clif_friendslist_toggle_sub(struct map_session_data *sd,va_list ap);
-void clif_friendslist_send(struct map_session_data *sd);
-void clif_friendslist_reqack(struct map_session_data *sd, struct map_session_data *f_sd, int type);
-
-void clif_weather(int16 m); // [Valaris]
-void clif_specialeffect(struct block_list* bl, int type, enum send_target target); // special effects [Valaris]
-void clif_specialeffect_single(struct block_list* bl, int type, int fd);
-void clif_messagecolor(struct block_list* bl, unsigned long color, const char* msg); // Mob/Npc color talk [SnakeDrak]
-void clif_message(struct block_list* bl, const char* msg);
-void clif_specialeffect_value(struct block_list* bl, int effect_id, int num, send_target target);
-
-void clif_GM_kickack(struct map_session_data *sd, int id);
-void clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd);
-void clif_manner_message(struct map_session_data* sd, uint32 type);
-void clif_GM_silence(struct map_session_data* sd, struct map_session_data* tsd, uint8 type);
-
-void clif_disp_overhead(struct map_session_data *sd, const char* mes);
-
-void clif_get_weapon_view(struct map_session_data* sd, unsigned short *rhand, unsigned short *lhand);
-
-void clif_party_xy_remove(struct map_session_data *sd); //Fix for minimap [Kevin]
-void clif_gospel_info(struct map_session_data *sd, int type);
-void clif_feel_req(int fd, struct map_session_data *sd, uint16 skill_lv);
-void clif_starskill(struct map_session_data* sd, const char* mapname, int monster_id, unsigned char star, unsigned char result);
-void clif_feel_info(struct map_session_data* sd, unsigned char feel_level, unsigned char type);
-void clif_hate_info(struct map_session_data *sd, unsigned char hate_level,int class_, unsigned char type);
-void clif_mission_info(struct map_session_data *sd, int mob_id, unsigned char progress);
-void clif_feel_hate_reset(struct map_session_data *sd);
-
-// [blackhole89]
-void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag);
-int clif_homskillinfoblock(struct map_session_data *sd);
-void clif_homskillup(struct map_session_data *sd, uint16 skill_id); //[orn]
-int clif_hom_food(struct map_session_data *sd,int foodid,int fail); //[orn]
-void clif_send_homdata(struct map_session_data *sd, int state, int param); //[orn]
-
-void clif_equiptickack(struct map_session_data* sd, int flag);
-void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* tsd);
-void clif_viewequip_fail(struct map_session_data* sd);
-void clif_equipcheckbox(struct map_session_data* sd);
-
-void clif_msg(struct map_session_data* sd, unsigned short id);
-void clif_msg_value(struct map_session_data* sd, unsigned short id, int value);
-void clif_msg_skill(struct map_session_data* sd, uint16 skill_id, int msg_id);
-
-//quest system [Kevin] [Inkfish]
-void clif_quest_send_list(struct map_session_data * sd);
-void clif_quest_send_mission(struct map_session_data * sd);
-void clif_quest_add(struct map_session_data * sd, struct quest * qd, int index);
-void clif_quest_delete(struct map_session_data * sd, int quest_id);
-void clif_quest_update_status(struct map_session_data * sd, int quest_id, bool active);
-void clif_quest_update_objective(struct map_session_data * sd, struct quest * qd, int index);
-void clif_quest_show_event(struct map_session_data *sd, struct block_list *bl, short state, short color);
-void clif_displayexp(struct map_session_data *sd, unsigned int exp, char type, bool quest);
-
-int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target type);
-int do_init_clif(void);
-void do_final_clif(void);
-
-// MAIL SYSTEM
-void clif_Mail_window(int fd, int flag);
-void clif_Mail_read(struct map_session_data *sd, int mail_id);
-void clif_Mail_delete(int fd, int mail_id, short fail);
-void clif_Mail_return(int fd, int mail_id, short fail);
-void clif_Mail_send(int fd, bool fail);
-void clif_Mail_new(int fd, int mail_id, const char *sender, const char *title);
-void clif_Mail_refreshinbox(struct map_session_data *sd);
-void clif_Mail_getattachment(int fd, uint8 flag);
-// AUCTION SYSTEM
-void clif_Auction_openwindow(struct map_session_data *sd);
-void clif_Auction_results(struct map_session_data *sd, short count, short pages, uint8 *buf);
-void clif_Auction_message(int fd, unsigned char flag);
-void clif_Auction_close(int fd, unsigned char flag);
-void clif_parse_Auction_cancelreg(int fd, struct map_session_data *sd);
-
-void clif_bossmapinfo(int fd, struct mob_data *md, short flag);
-void clif_cashshop_show(struct map_session_data *sd, struct npc_data *nd);
-
-// ADOPTION
-void clif_Adopt_reply(struct map_session_data *sd, int type);
-
-// MERCENARIES
-void clif_mercenary_info(struct map_session_data *sd);
-void clif_mercenary_skillblock(struct map_session_data *sd);
-void clif_mercenary_message(struct map_session_data* sd, int message);
-void clif_mercenary_updatestatus(struct map_session_data *sd, int type);
-
-// RENTAL SYSTEM
-void clif_rental_time(int fd, int nameid, int seconds);
-void clif_rental_expired(int fd, int index, int nameid);
-
-// BOOK READING
-void clif_readbook(int fd, int book_id, int page);
-
-// Show Picker
-void clif_party_show_picker(struct map_session_data * sd, struct item * item_data);
-
-// Progress Bar [Inkfish]
-void clif_progressbar(struct map_session_data * sd, unsigned long color, unsigned int second);
-void clif_progressbar_abort(struct map_session_data * sd);
-
-void clif_PartyBookingRegisterAck(struct map_session_data *sd, int flag);
-void clif_PartyBookingDeleteAck(struct map_session_data* sd, int flag);
-void clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info** results, int count, bool more_result);
-void clif_PartyBookingUpdateNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad);
-void clif_PartyBookingDeleteNotify(struct map_session_data* sd, int index);
-void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad);
-
-void clif_showdigit(struct map_session_data* sd, unsigned char type, int value);
-
-/// Buying Store System
-void clif_buyingstore_open(struct map_session_data* sd);
-void clif_buyingstore_open_failed(struct map_session_data* sd, unsigned short result, unsigned int weight);
-void clif_buyingstore_myitemlist(struct map_session_data* sd);
-void clif_buyingstore_entry(struct map_session_data* sd);
-void clif_buyingstore_entry_single(struct map_session_data* sd, struct map_session_data* pl_sd);
-void clif_buyingstore_disappear_entry(struct map_session_data* sd);
-void clif_buyingstore_disappear_entry_single(struct map_session_data* sd, struct map_session_data* pl_sd);
-void clif_buyingstore_itemlist(struct map_session_data* sd, struct map_session_data* pl_sd);
-void clif_buyingstore_trade_failed_buyer(struct map_session_data* sd, short result);
-void clif_buyingstore_update_item(struct map_session_data* sd, unsigned short nameid, unsigned short amount);
-void clif_buyingstore_delete_item(struct map_session_data* sd, short index, unsigned short amount, int price);
-void clif_buyingstore_trade_failed_seller(struct map_session_data* sd, short result, unsigned short nameid);
-
-/// Search Store System
-void clif_search_store_info_ack(struct map_session_data* sd);
-void clif_search_store_info_failed(struct map_session_data* sd, unsigned char reason);
-void clif_open_search_store_info(struct map_session_data* sd);
-void clif_search_store_info_click_ack(struct map_session_data* sd, short x, short y);
-/**
- * 3CeAM
- **/
-void clif_msgtable(int fd, int line);
-void clif_msgtable_num(int fd, int line, int num);
-
-int clif_elementalconverter_list(struct map_session_data *sd);
-
-void clif_millenniumshield(struct map_session_data *sd, short shields );
-
-int clif_spellbook_list(struct map_session_data *sd);
-
-int clif_magicdecoy_list(struct map_session_data *sd, uint16 skill_lv, short x, short y);
-
-int clif_poison_list(struct map_session_data *sd, uint16 skill_lv);
-
-int clif_autoshadowspell_list(struct map_session_data *sd);
-
-int clif_status_load_notick(struct block_list *bl,int type,int flag,int val1, int val2, int val3);
-int clif_status_load_single(int fd, int id,int type,int flag,int val1, int val2, int val3);
-
-
-int clif_skill_itemlistwindow( struct map_session_data *sd, uint16 skill_id, uint16 skill_lv );
-void clif_elemental_info(struct map_session_data *sd);
-void clif_elemental_updatestatus(struct map_session_data *sd, int type);
-
-void clif_talisman(struct map_session_data *sd, short type);
-
-void clif_snap( struct block_list *bl, short x, short y );
-void clif_monster_hp_bar( struct mob_data* md, int fd );
-
/**
* Color Table
**/
enum clif_colors {
COLOR_RED,
-
+
COLOR_MAX
};
+
+/**
+ * Structures
+ **/
+struct s_packet_db {
+ short len;
+ void (*func)(int, struct map_session_data *);
+ short pos[MAX_PACKET_POS];
+};
+
+/**
+ * Vars
+ **/
+extern struct s_packet_db packet_db[MAX_PACKET_VER+1][MAX_PACKET_DB+1];
unsigned long color_table[COLOR_MAX];
-int clif_colormes(struct map_session_data * sd, enum clif_colors color, const char* msg);
-#define clif_menuskill_clear(sd) (sd)->menuskill_id = (sd)->menuskill_val = (sd)->menuskill_val2 = 0;
+/**
+ * Clif.c Interface
+ **/
+struct clif_interface {
+ /* vars */
+ uint32 map_ip;
+ uint32 bind_ip;
+ uint16 map_port;
+ char map_ip_str[128];
+ int map_fd;
+ /* core */
+ int (*init) (void);
+ void (*final) (void);
+ int (*setip) (const char* ip);
+ void (*setbindip) (const char* ip);
+ void (*setport) (uint16 port);
+ uint32 (*refresh_ip) (void);
+ int (*send) (const uint8* buf, int len, struct block_list* bl, enum send_target type);
+ /* auth */
+ void (*authok) (struct map_session_data *sd);
+ void (*authrefuse) (int fd, uint8 error_code);
+ void (*authfail_fd) (int fd, int type);
+ void (*charselectok) (int id, uint8 ok);
+ /* item-related */
+ void (*dropflooritem) (struct flooritem_data* fitem);
+ void (*clearflooritem) (struct flooritem_data *fitem, int fd);
+ void (*additem) (struct map_session_data *sd, int n, int amount, int fail);
+ void (*dropitem) (struct map_session_data *sd,int n,int amount);
+ void (*delitem) (struct map_session_data *sd,int n,int amount, short reason);
+ void (*takeitem) (struct block_list* src, struct block_list* dst);
+ void (*arrowequip) (struct map_session_data *sd,int val);
+ void (*arrow_fail) (struct map_session_data *sd,int type);
+ void (*use_card) (struct map_session_data *sd,int idx);
+ void (*cart_additem) (struct map_session_data *sd,int n,int amount,int fail);
+ void (*cart_delitem) (struct map_session_data *sd,int n,int amount);
+ void (*equipitemack) (struct map_session_data *sd,int n,int pos,int ok);
+ void (*unequipitemack) (struct map_session_data *sd,int n,int pos,int ok);
+ void (*useitemack) (struct map_session_data *sd,int index,int amount,bool ok);
+ /* unit-related */
+ void (*clearunit_single) (int id, clr_type type, int fd);
+ void (*clearunit_area) (struct block_list* bl, clr_type type);
+ void (*clearunit_delayed) (struct block_list* bl, clr_type type, unsigned int tick);
+ void (*walkok) (struct map_session_data *sd);
+ void (*move) (struct unit_data *ud);
+ void (*blown) (struct block_list *bl);
+ void (*slide) (struct block_list *bl, int x, int y);
+ void (*fixpos) (struct block_list *bl);
+ void (*changelook) (struct block_list *bl,int type,int val);
+ void (*changetraplook) (struct block_list *bl,int val);
+ void (*refreshlook) (struct block_list *bl,int id,int type,int val,enum send_target target);
+ void (*class_change) (struct block_list *bl,int class_,int type);
+ void (*skill_setunit) (struct skill_unit *unit);
+ void (*skill_delunit) (struct skill_unit *unit);
+ void (*skillunit_update) (struct block_list* bl);
+ /* main unit spawn */
+ int (*spawn) (struct block_list *bl);
+ /* map-related */
+ void (*changemap) (struct map_session_data *sd, short map, int x, int y);
+ void (*changemapcell) (int fd, int16 m, int x, int y, int type, enum send_target target);
+ void (*map_property) (struct map_session_data* sd, enum map_property property);
+ void (*pvpset) (struct map_session_data *sd, int pvprank, int pvpnum,int type);
+ void (*map_property_mapall) (int map, enum map_property property);
+ void (*bossmapinfo) (int fd, struct mob_data *md, short flag);
+ /* multi-map-server */
+ void (*changemapserver) (struct map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port);
+ /* npc-shop-related */
+ void (*npcbuysell) (struct map_session_data* sd, int id);
+ void (*buylist) (struct map_session_data *sd, struct npc_data *nd);
+ void (*selllist) (struct map_session_data *sd);
+ void (*cashshop_show) (struct map_session_data *sd, struct npc_data *nd);
+ /* npc-script-related */
+ void (*scriptmes) (struct map_session_data *sd, int npcid, const char *mes);
+ void (*scriptnext) (struct map_session_data *sd,int npcid);
+ void (*scriptclose) (struct map_session_data *sd, int npcid);
+ void (*scriptmenu) (struct map_session_data* sd, int npcid, const char* mes);
+ void (*scriptinput) (struct map_session_data *sd, int npcid);
+ void (*scriptinputstr) (struct map_session_data *sd, int npcid);
+ void (*cutin) (struct map_session_data* sd, const char* image, int type);
+ void (*sendfakenpc) (struct map_session_data *sd, int npcid);
+ /* client-user-interface-related */
+ void (*viewpoint) (struct map_session_data *sd, int npc_id, int type, int x, int y, int id, int color);
+ int (*damage) (struct block_list* src, struct block_list* dst, unsigned int tick, int sdelay, int ddelay, int damage, int div, int type, int damage2);
+ void (*sitting) (struct block_list* bl);
+ void (*standing) (struct block_list* bl);
+ void (*arrow_create_list) (struct map_session_data *sd);
+ void (*refresh) (struct map_session_data *sd);
+ void (*fame_blacksmith) (struct map_session_data *sd, int points);
+ void (*fame_alchemist) (struct map_session_data *sd, int points);
+ void (*fame_taekwon) (struct map_session_data *sd, int points);
+ void (*hotkeys) (struct map_session_data *sd);
+ int (*insight) (struct block_list *bl,va_list ap);
+ int (*outsight) (struct block_list *bl,va_list ap);
+ void (*skillcastcancel) (struct block_list* bl);
+ void (*skill_fail) (struct map_session_data *sd,uint16 skill_id,enum useskill_fail_cause cause,int btype);
+ void (*skill_cooldown) (struct map_session_data *sd, uint16 skill_id, unsigned int tick);
+ void (*skill_memomessage) (struct map_session_data* sd, int type);
+ void (*skill_teleportmessage) (struct map_session_data *sd, int type);
+ void (*skill_produce_mix_list) (struct map_session_data *sd, int skill_id, int trigger);
+ void (*cooking_list) (struct map_session_data *sd, int trigger, uint16 skill_id, int qty, int list_type);
+ void (*autospell) (struct map_session_data *sd,uint16 skill_lv);
+ void (*combo_delay) (struct block_list *bl,int wait);
+ void (*status_change) (struct block_list *bl,int type,int flag,int tick,int val1, int val2, int val3);
+ void (*insert_card) (struct map_session_data *sd,int idx_equip,int idx_card,int flag);
+ void (*inventorylist) (struct map_session_data *sd);
+ void (*equiplist) (struct map_session_data *sd);
+ void (*cartlist) (struct map_session_data *sd);
+ void (*clearcart) (int fd);
+ void (*item_identify_list) (struct map_session_data *sd);
+ void (*item_identified) (struct map_session_data *sd,int idx,int flag);
+ void (*item_repair_list) (struct map_session_data *sd, struct map_session_data *dstsd, int lv);
+ void (*item_repaireffect) (struct map_session_data *sd, int idx, int flag);
+ void (*item_damaged) (struct map_session_data* sd, unsigned short position);
+ void (*item_refine_list) (struct map_session_data *sd);
+ void (*item_skill) (struct map_session_data *sd,uint16 skill_id,uint16 skill_lv);
+ void (*mvp_item) (struct map_session_data *sd,int nameid);
+ void (*mvp_exp) (struct map_session_data *sd, unsigned int exp);
+ void (*mvp_noitem) (struct map_session_data* sd);
+ void (*changed_dir) (struct block_list *bl, enum send_target target);
+ void (*charnameack) (int fd, struct block_list *bl);
+ void (*monster_hp_bar) ( struct mob_data* md, int fd );
+ void (*hpmeter_single) (int fd, int id, unsigned int hp, unsigned int maxhp);
+ void (*upgrademessage) (int fd, int result, int item_id);
+ void (*get_weapon_view) (struct map_session_data* sd, unsigned short *rhand, unsigned short *lhand);
+ void (*gospel_info) (struct map_session_data *sd, int type);
+ void (*feel_req) (int fd, struct map_session_data *sd, uint16 skill_lv);
+ void (*starskill) (struct map_session_data* sd, const char* mapname, int monster_id, unsigned char star, unsigned char result);
+ void (*feel_info) (struct map_session_data* sd, unsigned char feel_level, unsigned char type);
+ void (*hate_info) (struct map_session_data *sd, unsigned char hate_level,int class_, unsigned char type);
+ void (*mission_info) (struct map_session_data *sd, int mob_id, unsigned char progress);
+ void (*feel_hate_reset) (struct map_session_data *sd);
+ void (*equiptickack) (struct map_session_data* sd, int flag);
+ void (*viewequip_ack) (struct map_session_data* sd, struct map_session_data* tsd);
+ void (*viewequip_fail) (struct map_session_data* sd);
+ void (*equipcheckbox) (struct map_session_data* sd);
+ void (*displayexp) (struct map_session_data *sd, unsigned int exp, char type, bool quest);
+ void (*font) (struct map_session_data *sd);
+ void (*progressbar) (struct map_session_data * sd, unsigned long color, unsigned int second);
+ void (*progressbar_abort) (struct map_session_data * sd);
+ void (*showdigit) (struct map_session_data* sd, unsigned char type, int value);
+ int (*elementalconverter_list) (struct map_session_data *sd);
+ int (*spellbook_list) (struct map_session_data *sd);
+ int (*magicdecoy_list) (struct map_session_data *sd, uint16 skill_lv, short x, short y);
+ int (*poison_list) (struct map_session_data *sd, uint16 skill_lv);
+ int (*autoshadowspell_list) (struct map_session_data *sd);
+ int (*skill_itemlistwindow) ( struct map_session_data *sd, uint16 skill_id, uint16 skill_lv );
+ int (*sc_notick) (struct block_list *bl,int type,int flag,int val1, int val2, int val3);
+ int (*sc_single) (int fd, int id,int type,int flag,int val1, int val2, int val3);
+ /* player-unit-specific-related */
+ void (*updatestatus) (struct map_session_data *sd,int type);
+ void (*changestatus) (struct map_session_data* sd,int type,int val);
+ void (*statusupack) (struct map_session_data *sd,int type,int ok,int val);
+ void (*movetoattack) (struct map_session_data *sd,struct block_list *bl);
+ void (*solved_charname) (int fd, int charid, const char* name);
+ void (*charnameupdate) (struct map_session_data *ssd);
+ /* visual effects client-side */
+ void (*misceffect) (struct block_list* bl,int type);
+ void (*changeoption) (struct block_list* bl);
+ void (*changeoption2) (struct block_list* bl);
+ void (*emotion) (struct block_list *bl,int type);
+ void (*talkiebox) (struct block_list* bl, const char* talkie);
+ void (*wedding_effect) (struct block_list *bl);
+ void (*divorced) (struct map_session_data* sd, const char* name);
+ void (*callpartner) (struct map_session_data *sd);
+ int (*skill_damage) (struct block_list *src,struct block_list *dst,unsigned int tick,int sdelay,int ddelay,int damage,int div,uint16 skill_id,uint16 skill_lv,int type);
+ int (*skill_nodamage) (struct block_list *src,struct block_list *dst,uint16 skill_id,int heal,int fail);
+ void (*skill_poseffect) (struct block_list *src,uint16 skill_id,int val,int x,int y,int tick);
+ void (*skill_estimation) (struct map_session_data *sd,struct block_list *dst);
+ void (*skill_warppoint) (struct map_session_data* sd, uint16 skill_id, uint16 skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4);
+ void (*skillcasting) (struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, int property, int casttime);
+ void (*produce_effect) (struct map_session_data* sd,int flag,int nameid);
+ void (*devotion) (struct block_list *src, struct map_session_data *tsd);
+ void (*spiritball) (struct block_list *bl);
+ void (*bladestop) (struct block_list *src, int dst_id, int active);
+ void (*mvp_effect) (struct map_session_data *sd);
+ void (*heal) (int fd,int type,int val);
+ void (*resurrection) (struct block_list *bl,int type);
+ void (*refine) (int fd, int fail, int index, int val);
+ 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 (*millenniumshield) (struct map_session_data *sd, short shields );
+ void (*talisman) (struct map_session_data *sd, short type);
+ void (*snap) ( struct block_list *bl, short x, short y );
+ /* sound effects client-side */
+ void (*playBGM) (struct map_session_data* sd, const char* name);
+ void (*soundeffect) (struct map_session_data* sd, struct block_list* bl, const char* name, int type);
+ void (*soundeffectall) (struct block_list* bl, const char* name, int type, enum send_target coverage);
+ /* chat/message-related */
+ void (*GlobalMessage) (struct block_list* bl, const char* message);
+ void (*createchat) (struct map_session_data* sd, int flag);
+ void (*dispchat) (struct chat_data* cd, int fd);
+ void (*joinchatfail) (struct map_session_data *sd,int flag);
+ void (*joinchatok) (struct map_session_data *sd,struct chat_data* cd);
+ void (*addchat) (struct chat_data* cd,struct map_session_data *sd);
+ void (*changechatowner) (struct chat_data* cd, struct map_session_data* sd);
+ void (*clearchat) (struct chat_data *cd,int fd);
+ void (*leavechat) (struct chat_data* cd, struct map_session_data* sd, bool flag);
+ void (*changechatstatus) (struct chat_data* cd);
+ void (*wis_message) (int fd, const char* nick, const char* mes, int mes_len);
+ void (*wis_end) (int fd, int flag);
+ void (*displaymessage) (const int fd, const char* mes);
+ void (*disp_onlyself) (struct map_session_data *sd, const char *mes, int len);
+ void (*disp_message) (struct block_list* src, const char* mes, int len, enum send_target target);
+ void (*broadcast) (struct block_list* bl, const char* mes, int len, int type, enum send_target target);
+ void (*MainChatMessage) (const char* message);
+ void (*broadcast2) (struct block_list* bl, const char* mes, int len, unsigned long fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target);
+ void (*messagecolor) (struct block_list* bl, unsigned long color, const char* msg);
+ void (*message) (struct block_list* bl, const char* msg);
+ void (*disp_overhead) (struct map_session_data *sd, const char* mes);
+ void (*msg) (struct map_session_data* sd, unsigned short id);
+ void (*msg_value) (struct map_session_data* sd, unsigned short id, int value);
+ void (*msg_skill) (struct map_session_data* sd, uint16 skill_id, int msg_id);
+ void (*msgtable) (int fd, int line);
+ void (*msgtable_num) (int fd, int line, int num);
+ int (*colormes) (struct map_session_data * sd, enum clif_colors color, const char* msg);
+ /* trade handling */
+ void (*traderequest) (struct map_session_data* sd, const char* name);
+ void (*tradestart) (struct map_session_data* sd, uint8 type);
+ void (*tradeadditem) (struct map_session_data* sd, struct map_session_data* tsd, int index, int amount);
+ void (*tradeitemok) (struct map_session_data* sd, int index, int fail);
+ void (*tradedeal_lock) (struct map_session_data* sd, int fail);
+ void (*tradecancelled) (struct map_session_data* sd);
+ void (*tradecompleted) (struct map_session_data* sd, int fail);
+ void (*tradeundo) (struct map_session_data* sd);
+ /* vending handling */
+ void (*openvendingreq) (struct map_session_data* sd, int num);
+ void (*showvendingboard) (struct block_list* bl, const char* message, int fd);
+ void (*closevendingboard) (struct block_list* bl, int fd);
+ void (*vendinglist) (struct map_session_data* sd, int id, struct s_vending* vending);
+ void (*buyvending) (struct map_session_data* sd, int index, int amount, int fail);
+ void (*openvending) (struct map_session_data* sd, int id, struct s_vending* vending);
+ void (*vendingreport) (struct map_session_data* sd, int index, int amount);
+ /* storage handling */
+ void (*storagelist) (struct map_session_data* sd, struct item* items, int items_length);
+ void (*updatestorageamount) (struct map_session_data* sd, int amount, int max_amount);
+ void (*storageitemadded) (struct map_session_data* sd, struct item* i, int index, int amount);
+ void (*storageitemremoved) (struct map_session_data* sd, int index, int amount);
+ void (*storageclose) (struct map_session_data* sd);
+ /* skill-list handling */
+ void (*skillinfoblock) (struct map_session_data *sd);
+ void (*skillup) (struct map_session_data *sd,uint16 skill_id);
+ void (*skillinfo) (struct map_session_data *sd,int skill, int inf);
+ void (*addskill) (struct map_session_data *sd, int id);
+ void (*deleteskill) (struct map_session_data *sd, int id);
+ /* party-specific */
+ void (*party_created) (struct map_session_data *sd,int result);
+ void (*party_member_info) (struct party_data *p, struct map_session_data *sd);
+ void (*party_info) (struct party_data* p, struct map_session_data *sd);
+ void (*party_invite) (struct map_session_data *sd,struct map_session_data *tsd);
+ void (*party_inviteack) (struct map_session_data* sd, const char* nick, int result);
+ void (*party_option) (struct party_data *p,struct map_session_data *sd,int flag);
+ void (*party_withdraw) (struct party_data* p, struct map_session_data* sd, int account_id, const char* name, int flag);
+ void (*party_message) (struct party_data* p, int account_id, const char* mes, int len);
+ void (*party_xy) (struct map_session_data *sd);
+ void (*party_xy_single) (int fd, struct map_session_data *sd);
+ void (*party_hp) (struct map_session_data *sd);
+ void (*party_xy_remove) (struct map_session_data *sd);
+ void (*party_show_picker) (struct map_session_data * sd, struct item * item_data);
+ /* guild-specific */
+ void (*guild_created) (struct map_session_data *sd,int flag);
+ void (*guild_belonginfo) (struct map_session_data *sd, struct guild *g);
+ void (*guild_masterormember) (struct map_session_data *sd);
+ void (*guild_basicinfo) (struct map_session_data *sd);
+ void (*guild_allianceinfo) (struct map_session_data *sd);
+ void (*guild_memberlist) (struct map_session_data *sd);
+ void (*guild_skillinfo) (struct map_session_data* sd);
+ void (*guild_send_onlineinfo) (struct map_session_data *sd); //[LuzZza]
+ void (*guild_memberlogin_notice) (struct guild *g,int idx,int flag);
+ void (*guild_invite) (struct map_session_data *sd,struct guild *g);
+ void (*guild_inviteack) (struct map_session_data *sd,int flag);
+ void (*guild_leave) (struct map_session_data *sd,const char *name,const char *mes);
+ void (*guild_expulsion) (struct map_session_data* sd, const char* name, const char* mes, int account_id);
+ void (*guild_positionchanged) (struct guild *g,int idx);
+ void (*guild_memberpositionchanged) (struct guild *g,int idx);
+ void (*guild_emblem) (struct map_session_data *sd,struct guild *g);
+ void (*guild_emblem_area) (struct block_list* bl);
+ void (*guild_notice) (struct map_session_data* sd, struct guild* g);
+ void (*guild_message) (struct guild *g,int account_id,const char *mes,int len);
+ int (*guild_skillup) (struct map_session_data *sd,uint16 skill_id,int lv);
+ void (*guild_reqalliance) (struct map_session_data *sd,int account_id,const char *name);
+ void (*guild_allianceack) (struct map_session_data *sd,int flag);
+ void (*guild_delalliance) (struct map_session_data *sd,int guild_id,int flag);
+ void (*guild_oppositionack) (struct map_session_data *sd,int flag);
+ void (*guild_broken) (struct map_session_data *sd,int flag);
+ void (*guild_xy) (struct map_session_data *sd);
+ void (*guild_xy_single) (int fd, struct map_session_data *sd);
+ void (*guild_xy_remove) (struct map_session_data *sd);
+ /* battleground-specific */
+ void (*bg_hp) (struct map_session_data *sd);
+ void (*bg_xy) (struct map_session_data *sd);
+ void (*bg_xy_remove) (struct map_session_data *sd);
+ void (*bg_message) (struct battleground_data *bg, int src_id, const char *name, const char *mes, int len);
+ void (*bg_updatescore) (int16 m);
+ void (*bg_updatescore_single) (struct map_session_data *sd);
+ void (*sendbgemblem_area) (struct map_session_data *sd);
+ void (*sendbgemblem_single) (int fd, struct map_session_data *sd);
+ /* instance-related */
+ int (*instance) (int instance_id, int type, int flag);
+ void (*instance_join) (int fd, int instance_id);
+ void (*instance_leave) (int fd);
+ /* pet-related */
+ void (*catch_process) (struct map_session_data *sd);
+ void (*pet_roulette) (struct map_session_data *sd,int data);
+ void (*sendegg) (struct map_session_data *sd);
+ void (*send_petstatus) (struct map_session_data *sd);
+ void (*send_petdata) (struct map_session_data* sd, struct pet_data* pd, int type, int param);
+ void (*pet_emotion) (struct pet_data *pd,int param);
+ void (*pet_food) (struct map_session_data *sd,int foodid,int fail);
+ /* friend-related */
+ int (*friendslist_toggle_sub) (struct map_session_data *sd,va_list ap);
+ void (*friendslist_send) (struct map_session_data *sd);
+ void (*friendslist_reqack) (struct map_session_data *sd, struct map_session_data *f_sd, int type);
+ /* gm-related */
+ void (*GM_kickack) (struct map_session_data *sd, int id);
+ void (*GM_kick) (struct map_session_data *sd,struct map_session_data *tsd);
+ void (*manner_message) (struct map_session_data* sd, uint32 type);
+ void (*GM_silence) (struct map_session_data* sd, struct map_session_data* tsd, uint8 type);
+ /* hom-related */
+ void (*hominfo) (struct map_session_data *sd, struct homun_data *hd, int flag);
+ int (*homskillinfoblock) (struct map_session_data *sd);
+ void (*homskillup) (struct map_session_data *sd, uint16 skill_id);
+ int (*hom_food) (struct map_session_data *sd,int foodid,int fail);
+ void (*send_homdata) (struct map_session_data *sd, int state, int param);
+ /* questlog-related */
+ void (*quest_send_list) (struct map_session_data * sd);
+ void (*quest_send_mission) (struct map_session_data * sd);
+ void (*quest_add) (struct map_session_data * sd, struct quest * qd, int index);
+ void (*quest_delete) (struct map_session_data * sd, int quest_id);
+ void (*quest_update_status) (struct map_session_data * sd, int quest_id, bool active);
+ void (*quest_update_objective) (struct map_session_data * sd, struct quest * qd, int index);
+ void (*quest_show_event) (struct map_session_data *sd, struct block_list *bl, short state, short color);
+ /* mail-related */
+ void (*mail_window) (int fd, int flag);
+ void (*mail_read) (struct map_session_data *sd, int mail_id);
+ void (*mail_delete) (int fd, int mail_id, short fail);
+ void (*mail_return) (int fd, int mail_id, short fail);
+ void (*mail_send) (int fd, bool fail);
+ void (*mail_new) (int fd, int mail_id, const char *sender, const char *title);
+ void (*mail_refreshinbox) (struct map_session_data *sd);
+ void (*mail_getattachment) (int fd, uint8 flag);
+ /* auction-related */
+ void (*auction_openwindow) (struct map_session_data *sd);
+ void (*auction_results) (struct map_session_data *sd, short count, short pages, uint8 *buf);
+ void (*auction_message) (int fd, unsigned char flag);
+ void (*auction_close) (int fd, unsigned char flag);
+ /* mercenary-related */
+ void (*mercenary_info) (struct map_session_data *sd);
+ void (*mercenary_skillblock) (struct map_session_data *sd);
+ void (*mercenary_message) (struct map_session_data* sd, int message);
+ void (*mercenary_updatestatus) (struct map_session_data *sd, int type);
+ /* item rental */
+ void (*rental_time) (int fd, int nameid, int seconds);
+ void (*rental_expired) (int fd, int index, int nameid);
+ /* party booking related */
+ void (*PartyBookingRegisterAck) (struct map_session_data *sd, int flag);
+ void (*PartyBookingDeleteAck) (struct map_session_data* sd, int flag);
+ void (*PartyBookingSearchAck) (int fd, struct party_booking_ad_info** results, int count, bool more_result);
+ void (*PartyBookingUpdateNotify) (struct map_session_data* sd, struct party_booking_ad_info* pb_ad);
+ void (*PartyBookingDeleteNotify) (struct map_session_data* sd, int index);
+ void (*PartyBookingInsertNotify) (struct map_session_data* sd, struct party_booking_ad_info* pb_ad);
+ /* buying store-related */
+ void (*buyingstore_open) (struct map_session_data* sd);
+ void (*buyingstore_open_failed) (struct map_session_data* sd, unsigned short result, unsigned int weight);
+ void (*buyingstore_myitemlist) (struct map_session_data* sd);
+ void (*buyingstore_entry) (struct map_session_data* sd);
+ void (*buyingstore_entry_single) (struct map_session_data* sd, struct map_session_data* pl_sd);
+ void (*buyingstore_disappear_entry) (struct map_session_data* sd);
+ void (*buyingstore_disappear_entry_single) (struct map_session_data* sd, struct map_session_data* pl_sd);
+ void (*buyingstore_itemlist) (struct map_session_data* sd, struct map_session_data* pl_sd);
+ void (*buyingstore_trade_failed_buyer) (struct map_session_data* sd, short result);
+ void (*buyingstore_update_item) (struct map_session_data* sd, unsigned short nameid, unsigned short amount);
+ void (*buyingstore_delete_item) (struct map_session_data* sd, short index, unsigned short amount, int price);
+ void (*buyingstore_trade_failed_seller) (struct map_session_data* sd, short result, unsigned short nameid);
+ /* search store-related */
+ void (*search_store_info_ack) (struct map_session_data* sd);
+ void (*search_store_info_failed) (struct map_session_data* sd, unsigned char reason);
+ void (*open_search_store_info) (struct map_session_data* sd);
+ void (*search_store_info_click_ack) (struct map_session_data* sd, short x, short y);
+ /* elemental-related */
+ void (*elemental_info) (struct map_session_data *sd);
+ void (*elemental_updatestatus) (struct map_session_data *sd, int type);
+ /* misc-handling */
+ void (*adopt_reply) (struct map_session_data *sd, int type);
+ void (*readbook) (int fd, int book_id, int page);
+ /*------------------------
+ *- Parse Incoming Packet
+ *------------------------*/
+ void (*ActionRequest_sub) (struct map_session_data *sd, int action_type, int target_id, unsigned int tick);
+ void (*LoadEndAck) (int fd,struct map_session_data *sd);
+ void (*Auction_cancelreg) (int fd, struct map_session_data *sd);
+} clif_s;
+
+struct clif_interface *clif;
+
+void clif_defaults(void);
#endif /* _CLIF_H_ */
diff --git a/src/map/duel.c b/src/map/duel.c
index c13d004b0..1c659bd33 100644
--- a/src/map/duel.c
+++ b/src/map/duel.c
@@ -52,7 +52,7 @@ static int duel_showinfo_sub(struct map_session_data* sd, va_list va)
if (sd->duel_group != ssd->duel_group) return 0;
sprintf(output, " %d. %s", ++(*p), sd->status.name);
- clif_disp_onlyself(ssd, output, strlen(output));
+ clif->disp_onlyself(ssd, output, strlen(output));
return 1;
}
@@ -73,7 +73,7 @@ void duel_showinfo(const unsigned int did, struct map_session_data* sd)
duel_list[did].members_count,
duel_list[did].members_count + duel_list[did].invites_count);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif->disp_onlyself(sd, output, strlen(output));
map_foreachpc(duel_showinfo_sub, sd, &p);
}
@@ -92,10 +92,10 @@ int duel_create(struct map_session_data* sd, const unsigned int maxpl)
duel_list[i].max_players_limit = maxpl;
strcpy(output, msg_txt(372)); // " -- Duel has been created (@invite/@leave) --"
- clif_disp_onlyself(sd, output, strlen(output));
+ clif->disp_onlyself(sd, output, strlen(output));
- clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
- //clif_misceffect2(&sd->bl, 159);
+ clif->map_property(sd, MAPPROPERTY_FREEPVPZONE);
+ //clif->misceffect2(&sd->bl, 159);
return i;
}
@@ -105,14 +105,14 @@ void duel_invite(const unsigned int did, struct map_session_data* sd, struct map
// " -- Player %s invites %s to duel --"
sprintf(output, msg_txt(373), sd->status.name, target_sd->status.name);
- clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
+ clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
target_sd->duel_invite = did;
duel_list[did].invites_count++;
// "Blue -- Player %s invites you to PVP duel (@accept/@reject) --"
sprintf(output, msg_txt(374), sd->status.name);
- clif_broadcast((struct block_list *)target_sd, output, strlen(output)+1, 0x10, SELF);
+ clif->broadcast((struct block_list *)target_sd, output, strlen(output)+1, 0x10, SELF);
}
static int duel_leave_sub(struct map_session_data* sd, va_list va)
@@ -129,7 +129,7 @@ void duel_leave(const unsigned int did, struct map_session_data* sd)
// " <- Player %s has left duel --"
sprintf(output, msg_txt(375), sd->status.name);
- clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
+ clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
duel_list[did].members_count--;
@@ -140,7 +140,7 @@ void duel_leave(const unsigned int did, struct map_session_data* sd)
sd->duel_group = 0;
duel_savetime(sd);
- clif_map_property(sd, MAPPROPERTY_NOTHING);
+ clif->map_property(sd, MAPPROPERTY_NOTHING);
}
void duel_accept(const unsigned int did, struct map_session_data* sd)
@@ -154,10 +154,10 @@ void duel_accept(const unsigned int did, struct map_session_data* sd)
// " -> Player %s has accepted duel --"
sprintf(output, msg_txt(376), sd->status.name);
- clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
+ clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
- clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
- //clif_misceffect2(&sd->bl, 159);
+ clif->map_property(sd, MAPPROPERTY_FREEPVPZONE);
+ //clif->misceffect2(&sd->bl, 159);
}
void duel_reject(const unsigned int did, struct map_session_data* sd)
@@ -166,7 +166,7 @@ void duel_reject(const unsigned int did, struct map_session_data* sd)
// " -- Player %s has rejected duel --"
sprintf(output, msg_txt(377), sd->status.name);
- clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
+ clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
duel_list[did].invites_count--;
sd->duel_invite = 0;
diff --git a/src/map/elemental.c b/src/map/elemental.c
index c5b6302d5..dfe1a0c5b 100644
--- a/src/map/elemental.c
+++ b/src/map/elemental.c
@@ -272,11 +272,11 @@ int elemental_data_received(struct s_elemental *ele, bool flag) {
if( ed->bl.prev == NULL && sd->bl.prev != NULL ) {
map_addblock(&ed->bl);
- clif_spawn(&ed->bl);
- clif_elemental_info(sd);
- clif_elemental_updatestatus(sd,SP_HP);
- clif_hpmeter_single(sd->fd,ed->bl.id,ed->battle_status.hp,ed->battle_status.max_hp);
- clif_elemental_updatestatus(sd,SP_SP);
+ clif->spawn(&ed->bl);
+ clif->elemental_info(sd);
+ clif->elemental_updatestatus(sd,SP_HP);
+ clif->hpmeter_single(sd->fd,ed->bl.id,ed->battle_status.hp,ed->battle_status.max_hp);
+ clif->elemental_updatestatus(sd,SP_SP);
}
return 1;
@@ -536,9 +536,9 @@ int elemental_change_mode(struct elemental_data *ed, int mode) {
void elemental_heal(struct elemental_data *ed, int hp, int sp) {
if( hp )
- clif_elemental_updatestatus(ed->master, SP_HP);
+ clif->elemental_updatestatus(ed->master, SP_HP);
if( sp )
- clif_elemental_updatestatus(ed->master, SP_SP);
+ clif->elemental_updatestatus(ed->master, SP_SP);
}
int elemental_dead(struct elemental_data *ed) {
@@ -696,8 +696,8 @@ static int elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_
if( master_dist > AREA_SIZE ) { // Master out of vision range.
elemental_unlocktarget(ed);
unit_warp(&ed->bl,sd->bl.m,sd->bl.x,sd->bl.y,CLR_TELEPORT);
- clif_elemental_updatestatus(sd,SP_HP);
- clif_elemental_updatestatus(sd,SP_SP);
+ clif->elemental_updatestatus(sd,SP_HP);
+ clif->elemental_updatestatus(sd,SP_SP);
return 0;
} else if( master_dist > MAX_ELEDISTANCE ) { // Master too far, chase.
short x = sd->bl.x, y = sd->bl.y;
diff --git a/src/map/guild.c b/src/map/guild.c
index 68746def6..fa06f7f4c 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -345,7 +345,7 @@ int guild_send_xy_timer_sub(DBKey key, DBData *data, va_list ap)
struct map_session_data* sd = g->member[i].sd;
if( sd != NULL && sd->fd && (sd->guild_x != sd->bl.x || sd->guild_y != sd->bl.y) && !sd->bg_id )
{
- clif_guild_xy(sd);
+ clif->guild_xy(sd);
sd->guild_x = sd->bl.x;
sd->guild_y = sd->bl.y;
}
@@ -363,7 +363,7 @@ static int guild_send_xy_timer(int tid, unsigned int tick, int id, intptr_t data
int guild_send_dot_remove(struct map_session_data *sd)
{
if (sd->status.guild_id)
- clif_guild_xy_remove(sd);
+ clif->guild_xy_remove(sd);
return 0;
}
//------------------------------------------------------------------------
@@ -382,12 +382,12 @@ int guild_create(struct map_session_data *sd, const char *name)
if( sd->status.guild_id )
{// already in a guild
- clif_guild_created(sd,1);
+ clif->guild_created(sd,1);
return 0;
}
if( battle_config.guild_emperium_check && pc_search_inventory(sd,714) == -1 )
{// item required
- clif_guild_created(sd,3);
+ clif->guild_created(sd,3);
return 0;
}
@@ -405,12 +405,12 @@ int guild_created(int account_id,int guild_id)
if(sd==NULL)
return 0;
if(!guild_id) {
- clif_guild_created(sd, 2); // Creation failure (presence of the same name Guild)
+ clif->guild_created(sd, 2); // Creation failure (presence of the same name Guild)
return 0;
}
//struct guild *g;
sd->status.guild_id=guild_id;
- clif_guild_created(sd,0);
+ clif->guild_created(sd,0);
if(battle_config.guild_emperium_check)
pc_delitem(sd,pc_search_inventory(sd,ITEMID_EMPERIUM),1,0,0,LOG_TYPE_CONSUME); //emperium consumption
return 0;
@@ -520,8 +520,8 @@ int guild_recv_info(struct guild *sg)
//Also set the guild master flag.
sd->state.gmaster_flag = g;
- clif_charnameupdate(sd); // [LuzZza]
- clif_guild_masterormember(sd);
+ clif->charnameupdate(sd); // [LuzZza]
+ clif->guild_masterormember(sd);
}
}else
before=*g;
@@ -536,7 +536,7 @@ int guild_recv_info(struct guild *sg)
for(i=bm=m=0;i<g->max_member;i++){
if(g->member[i].account_id>0){
sd = g->member[i].sd = guild_sd_check(g->guild_id, g->member[i].account_id, g->member[i].char_id);
- if (sd) clif_charnameupdate(sd); // [LuzZza]
+ if (sd) clif->charnameupdate(sd); // [LuzZza]
m++;
}else
g->member[i].sd=NULL;
@@ -551,20 +551,20 @@ int guild_recv_info(struct guild *sg)
if (before.guild_lv != g->guild_lv || bm != m ||
before.max_member != g->max_member) {
- clif_guild_basicinfo(sd); //Submit basic information
- clif_guild_emblem(sd, g); //Submit emblem
+ clif->guild_basicinfo(sd); //Submit basic information
+ clif->guild_emblem(sd, g); //Submit emblem
}
if (bm != m) { //Send members information
- clif_guild_memberlist(g->member[i].sd);
+ clif->guild_memberlist(g->member[i].sd);
}
if (before.skill_point != g->skill_point)
- clif_guild_skillinfo(sd); //Submit information skills
+ clif->guild_skillinfo(sd); //Submit information skills
if (guild_new) { // Send information and affiliation if unsent
- clif_guild_belonginfo(sd, g);
- clif_guild_notice(sd, g);
+ clif->guild_belonginfo(sd, g);
+ clif->guild_notice(sd, g);
sd->guild_emblem_id = g->emblem_id;
}
}
@@ -603,13 +603,13 @@ int guild_invite(struct map_session_data *sd, struct map_session_data *tsd) {
if(!battle_config.invite_request_check) {
if (tsd->party_invite > 0 || tsd->trade_partner || tsd->adopt_invite) { //checking if there no other invitation pending
- clif_guild_inviteack(sd,0);
+ clif->guild_inviteack(sd,0);
return 0;
}
}
if (!tsd->fd) { //You can't invite someone who has already disconnected.
- clif_guild_inviteack(sd,1);
+ clif->guild_inviteack(sd,1);
return 0;
}
@@ -617,21 +617,21 @@ int guild_invite(struct map_session_data *sd, struct map_session_data *tsd) {
tsd->guild_invite>0 ||
((agit_flag || agit2_flag) && map[tsd->bl.m].flag.gvg_castle))
{ //Can't invite people inside castles. [Skotlex]
- clif_guild_inviteack(sd,0);
+ clif->guild_inviteack(sd,0);
return 0;
}
//search an empty spot in guild
ARR_FIND( 0, g->max_member, i, g->member[i].account_id == 0 );
if(i==g->max_member){
- clif_guild_inviteack(sd,3);
+ clif->guild_inviteack(sd,3);
return 0;
}
tsd->guild_invite=sd->status.guild_id;
tsd->guild_invite_account=sd->status.account_id;
- clif_guild_invite(tsd,g);
+ clif->guild_invite(tsd,g);
return 0;
}
@@ -653,14 +653,14 @@ int guild_reply_invite(struct map_session_data* sd, int guild_id, int flag)
if ( sd->status.guild_id > 0 ) // [Paradox924X]
{ // Already in another guild.
- if ( tsd ) clif_guild_inviteack(tsd,0);
+ if ( tsd ) clif->guild_inviteack(tsd,0);
return 0;
}
else if( flag == 0 )
{// rejected
sd->guild_invite = 0;
sd->guild_invite_account = 0;
- if( tsd ) clif_guild_inviteack(tsd,1);
+ if( tsd ) clif->guild_inviteack(tsd,1);
}
else
{// accepted
@@ -680,7 +680,7 @@ int guild_reply_invite(struct map_session_data* sd, int guild_id, int flag)
{
sd->guild_invite = 0;
sd->guild_invite_account = 0;
- if( tsd ) clif_guild_inviteack(tsd,3);
+ if( tsd ) clif->guild_inviteack(tsd,3);
return 0;
}
@@ -744,7 +744,7 @@ int guild_member_added(int guild_id,int account_id,int char_id,int flag)
if (flag == 1) { //failure
if( sd2!=NULL )
- clif_guild_inviteack(sd2,3);
+ clif->guild_inviteack(sd2,3);
return 0;
}
@@ -752,16 +752,16 @@ int guild_member_added(int guild_id,int account_id,int char_id,int flag)
sd->status.guild_id = g->guild_id;
sd->guild_emblem_id = g->emblem_id;
//Packets which were sent in the previous 'guild_sent' implementation.
- clif_guild_belonginfo(sd,g);
- clif_guild_notice(sd,g);
+ clif->guild_belonginfo(sd,g);
+ clif->guild_notice(sd,g);
//TODO: send new emblem info to others
if( sd2!=NULL )
- clif_guild_inviteack(sd2,2);
+ clif->guild_inviteack(sd2,2);
//Next line commented because it do nothing, look at guild_recv_info [LuzZza]
- //clif_charnameupdate(sd); //Update display name [Skotlex]
+ //clif->charnameupdate(sd); //Update display name [Skotlex]
return 0;
}
@@ -844,13 +844,13 @@ int guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, c
return 0; // noone online to inform
if(!flag)
- clif_guild_leave(online_member_sd, name, mes);
+ clif->guild_leave(online_member_sd, name, mes);
else
- clif_guild_expulsion(online_member_sd, name, mes, account_id);
+ clif->guild_expulsion(online_member_sd, name, mes, account_id);
// remove member from guild
memset(&g->member[i],0,sizeof(struct guild_member));
- clif_guild_memberlist(online_member_sd);
+ clif->guild_memberlist(online_member_sd);
// update char, if online
if(sd != NULL && sd->status.guild_id == guild_id)
@@ -863,7 +863,7 @@ int guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, c
sd->status.guild_id = 0;
sd->guild_emblem_id = 0;
- clif_charnameupdate(sd); //Update display name [Skotlex]
+ clif->charnameupdate(sd); //Update display name [Skotlex]
//TODO: send emblem update to self and people around
}
return 0;
@@ -895,8 +895,8 @@ int guild_send_memberinfoshort(struct map_session_data *sd,int online)
if(sd->state.connect_new)
{ //Note that this works because it is invoked in parse_LoadEndAck before connect_new is cleared.
- clif_guild_belonginfo(sd,g);
- clif_guild_notice(sd,g);
+ clif->guild_belonginfo(sd,g);
+ clif->guild_notice(sd,g);
sd->guild_emblem_id = g->emblem_id;
}
return 0;
@@ -945,7 +945,7 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin
g->member[idx].sd = guild_sd_check(guild_id, account_id, char_id);
if(oldonline!=online)
- clif_guild_memberlogin_notice(g, idx, online);
+ clif->guild_memberlogin_notice(g, idx, online);
if(!g->member[idx].sd)
return 0;
@@ -958,8 +958,8 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin
g->member[i].sd->bl.m != g->member[idx].sd->bl.m)
continue;
- clif_guild_xy_single(g->member[idx].sd->fd, g->member[i].sd);
- clif_guild_xy_single(g->member[i].sd->fd, g->member[idx].sd);
+ clif->guild_xy_single(g->member[idx].sd->fd, g->member[i].sd);
+ clif->guild_xy_single(g->member[i].sd->fd, g->member[idx].sd);
}
return 0;
@@ -991,7 +991,7 @@ int guild_recv_message(int guild_id,int account_id,const char *mes,int len)
struct guild *g;
if( (g=guild_search(guild_id))==NULL)
return 0;
- clif_guild_message(g,account_id,mes,len);
+ clif->guild_message(g,account_id,mes,len);
return 0;
}
@@ -1011,11 +1011,11 @@ int guild_memberposition_changed(struct guild *g,int idx,int pos)
nullpo_ret(g);
g->member[idx].position=pos;
- clif_guild_memberpositionchanged(g,idx);
+ clif->guild_memberpositionchanged(g,idx);
// Update char position in client [LuzZza]
if(g->member[idx].sd != NULL)
- clif_charnameupdate(g->member[idx].sd);
+ clif->charnameupdate(g->member[idx].sd);
return 0;
}
@@ -1046,12 +1046,12 @@ int guild_position_changed(int guild_id,int idx,struct guild_position *p)
if(g==NULL)
return 0;
memcpy(&g->position[idx],p,sizeof(struct guild_position));
- clif_guild_positionchanged(g,idx);
+ clif->guild_positionchanged(g,idx);
// Update char name in client [LuzZza]
for(i=0;i<g->max_member;i++)
if(g->member[i].position == idx && g->member[i].sd != NULL)
- clif_charnameupdate(g->member[i].sd);
+ clif->charnameupdate(g->member[i].sd);
return 0;
}
@@ -1083,7 +1083,7 @@ int guild_notice_changed(int guild_id,const char *mes1,const char *mes2)
for(i=0;i<g->max_member;i++){
if((sd=g->member[i].sd)!=NULL)
- clif_guild_notice(sd,g);
+ clif->guild_notice(sd,g);
}
return 0;
}
@@ -1098,7 +1098,7 @@ int guild_change_emblem(struct map_session_data *sd,int len,const char *data)
if (battle_config.require_glory_guild &&
!((g = guild_search(sd->status.guild_id)) && guild_checkskill(g, GD_GLORYGUILD)>0)) {
- clif_skill_fail(sd,GD_GLORYGUILD,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,GD_GLORYGUILD,USESKILL_FAIL_LEVEL,0);
return 0;
}
@@ -1123,9 +1123,9 @@ int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data)
for(i=0;i<g->max_member;i++){
if((sd=g->member[i].sd)!=NULL){
sd->guild_emblem_id=emblem_id;
- clif_guild_belonginfo(sd,g);
- clif_guild_emblem(sd,g);
- clif_guild_emblem_area(&sd->bl);
+ clif->guild_belonginfo(sd,g);
+ clif->guild_emblem(sd,g);
+ clif->guild_emblem_area(&sd->bl);
}
}
{// update guardians (mobs)
@@ -1142,7 +1142,7 @@ int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data)
if( md == NULL || md->guardian_data == NULL )
continue;
md->guardian_data->emblem_id = emblem_id;
- clif_guild_emblem_area(&md->bl);
+ clif->guild_emblem_area(&md->bl);
}
// update temporary guardians
for( i = 0; i < gc->temp_guardians_max; ++i )
@@ -1151,7 +1151,7 @@ int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data)
if( md == NULL || md->guardian_data == NULL )
continue;
md->guardian_data->emblem_id = emblem_id;
- clif_guild_emblem_area(&md->bl);
+ clif->guild_emblem_area(&md->bl);
}
}
dbi_destroy(iter);
@@ -1159,7 +1159,7 @@ int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data)
{// update npcs (flags or other npcs that used flagemblem to attach to this guild)
for( i = 0; i < guild_flags_count; i++ ) {
if( guild_flags[i] && guild_flags[i]->u.scr.guild_id == guild_id ) {
- clif_guild_emblem_area(&guild_flags[i]->bl);
+ clif->guild_emblem_area(&guild_flags[i]->bl);
}
}
}
@@ -1272,7 +1272,7 @@ int guild_skillupack(int guild_id,uint16 skill_id,int account_id)
if(g==NULL)
return 0;
if( sd != NULL ) {
- clif_guild_skillup(sd,skill_id,g->skill[skill_id-GD_SKILLBASE].lv);
+ clif->guild_skillup(sd,skill_id,g->skill[skill_id-GD_SKILLBASE].lv);
/* Guild Aura handling */
switch( skill_id ) {
@@ -1288,7 +1288,7 @@ int guild_skillupack(int guild_id,uint16 skill_id,int account_id)
// Inform all members
for(i=0;i<g->max_member;i++)
if((sd=g->member[i].sd)!=NULL)
- clif_guild_skillinfo(sd);
+ clif->guild_skillinfo(sd);
return 0;
}
@@ -1370,7 +1370,7 @@ int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd)
int i;
if(agit_flag || agit2_flag) { // Disable alliance creation during woe [Valaris]
- clif_displaymessage(sd->fd,msg_txt(676)); //"Alliances cannot be made during Guild Wars!"
+ clif->displaymessage(sd->fd,msg_txt(676)); //"Alliances cannot be made during Guild Wars!"
return 0;
} // end addition [Valaris]
@@ -1391,23 +1391,23 @@ int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd)
return 0;
if( guild_get_alliance_count(g[0],0) >= battle_config.max_guild_alliance ) {
- clif_guild_allianceack(sd,4);
+ clif->guild_allianceack(sd,4);
return 0;
}
if( guild_get_alliance_count(g[1],0) >= battle_config.max_guild_alliance ) {
- clif_guild_allianceack(sd,3);
+ clif->guild_allianceack(sd,3);
return 0;
}
if( tsd->guild_alliance>0 ){
- clif_guild_allianceack(sd,1);
+ clif->guild_allianceack(sd,1);
return 0;
}
for (i = 0; i < MAX_GUILDALLIANCE; i++) { // check if already allied
if( g[0]->alliance[i].guild_id==tsd->status.guild_id &&
g[0]->alliance[i].opposition==0){
- clif_guild_allianceack(sd,0);
+ clif->guild_allianceack(sd,0);
return 0;
}
}
@@ -1415,7 +1415,7 @@ int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd)
tsd->guild_alliance=sd->status.guild_id;
tsd->guild_alliance_account=sd->status.account_id;
- clif_guild_reqalliance(tsd,sd->status.account_id,g[0]->name);
+ clif->guild_reqalliance(tsd,sd->status.account_id,g[0]->name);
return 0;
}
@@ -1429,7 +1429,7 @@ int guild_reply_reqalliance(struct map_session_data *sd,int account_id,int flag)
nullpo_ret(sd);
tsd= map_id2sd( account_id );
if (!tsd) { //Character left? Cancel alliance.
- clif_guild_allianceack(sd,3);
+ clif->guild_allianceack(sd,3);
return 0;
}
@@ -1444,13 +1444,13 @@ int guild_reply_reqalliance(struct map_session_data *sd,int account_id,int flag)
tg=guild_search(tsd->status.guild_id);
if(g==NULL || guild_get_alliance_count(g,0) >= battle_config.max_guild_alliance){
- clif_guild_allianceack(sd,4);
- clif_guild_allianceack(tsd,3);
+ clif->guild_allianceack(sd,4);
+ clif->guild_allianceack(tsd,3);
return 0;
}
if(tg==NULL || guild_get_alliance_count(tg,0) >= battle_config.max_guild_alliance){
- clif_guild_allianceack(sd,3);
- clif_guild_allianceack(tsd,4);
+ clif->guild_allianceack(sd,3);
+ clif->guild_allianceack(tsd,4);
return 0;
}
@@ -1475,7 +1475,7 @@ int guild_reply_reqalliance(struct map_session_data *sd,int account_id,int flag)
sd->guild_alliance=0;
sd->guild_alliance_account=0;
if(tsd!=NULL)
- clif_guild_allianceack(tsd,3);
+ clif->guild_allianceack(tsd,3);
}
return 0;
}
@@ -1488,7 +1488,7 @@ int guild_delalliance(struct map_session_data *sd,int guild_id,int flag)
nullpo_ret(sd);
if(agit_flag || agit2_flag) { // Disable alliance breaking during woe [Valaris]
- clif_displaymessage(sd->fd,msg_txt(677)); //"Alliances cannot be broken during Guild Wars!"
+ clif->displaymessage(sd->fd,msg_txt(677)); //"Alliances cannot be broken during Guild Wars!"
return 0;
} // end addition [Valaris]
@@ -1515,14 +1515,14 @@ int guild_opposition(struct map_session_data *sd,struct map_session_data *tsd)
return 0;
if( guild_get_alliance_count(g,1) >= battle_config.max_guild_alliance ) {
- clif_guild_oppositionack(sd,1);
+ clif->guild_oppositionack(sd,1);
return 0;
}
for (i = 0; i < MAX_GUILDALLIANCE; i++) { // checking relations
if(g->alliance[i].guild_id==tsd->status.guild_id){
if (g->alliance[i].opposition == 1) { // check if not already hostile
- clif_guild_oppositionack(sd,2);
+ clif->guild_oppositionack(sd,2);
return 0;
}
if(agit_flag || agit2_flag) // Prevent the changing of alliances to oppositions during WoE.
@@ -1568,7 +1568,7 @@ int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id
if (flag & 0x70) { // failure
for(i=0;i<2-(flag&1);i++)
if( sd[i]!=NULL )
- clif_guild_allianceack(sd[i],((flag>>4)==i+1)?3:4);
+ clif->guild_allianceack(sd[i],((flag>>4)==i+1)?3:4);
return 0;
}
@@ -1596,16 +1596,16 @@ int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id
g[i]->alliance[j].guild_id = 0;
}
if (sd[i] != NULL) // notify players
- clif_guild_delalliance(sd[i],guild_id[1-i],(flag&1));
+ clif->guild_delalliance(sd[i],guild_id[1-i],(flag&1));
}
}
if ((flag & 0x0f) == 0) { // alliance notification
if( sd[1]!=NULL )
- clif_guild_allianceack(sd[1],2);
+ clif->guild_allianceack(sd[1],2);
} else if ((flag & 0x0f) == 1) { // enemy notification
if( sd[0]!=NULL )
- clif_guild_oppositionack(sd[0],0);
+ clif->guild_oppositionack(sd[0],0);
}
@@ -1614,7 +1614,7 @@ int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id
if(g[i]!=NULL)
for(j=0;j<g[i]->max_member;j++)
if((sd=g[i]->member[j].sd)!=NULL)
- clif_guild_allianceinfo(sd);
+ clif->guild_allianceinfo(sd);
}
return 0;
}
@@ -1636,7 +1636,7 @@ int guild_broken_sub(DBKey key, DBData *data, va_list ap)
if(g->alliance[i].guild_id==guild_id){
for(j=0;j<g->max_member;j++)
if( (sd=g->member[j].sd)!=NULL )
- clif_guild_delalliance(sd,guild_id,g->alliance[i].opposition);
+ clif->guild_delalliance(sd,guild_id,g->alliance[i].opposition);
intif_guild_alliance(g->guild_id, guild_id,0,0,g->alliance[i].opposition|8);
g->alliance[i].guild_id=0;
}
@@ -1683,8 +1683,8 @@ int guild_broken(int guild_id,int flag)
if(sd->state.storage_flag == 2)
storage_guild_storage_quit(sd,1);
sd->status.guild_id=0;
- clif_guild_broken(g->member[i].sd,0);
- clif_charnameupdate(sd); // [LuzZza]
+ clif->guild_broken(g->member[i].sd,0);
+ clif->charnameupdate(sd); // [LuzZza]
}
}
@@ -1745,13 +1745,13 @@ int guild_gm_changed(int guild_id, int account_id, int char_id)
if (g->member[pos].sd && g->member[pos].sd->fd)
{
- clif_displaymessage(g->member[pos].sd->fd, msg_txt(678)); //"You no longer are the Guild Master."
+ clif->displaymessage(g->member[pos].sd->fd, msg_txt(678)); //"You no longer are the Guild Master."
g->member[pos].sd->state.gmaster_flag = 0;
}
if (g->member[0].sd && g->member[0].sd->fd)
{
- clif_displaymessage(g->member[0].sd->fd, msg_txt(679)); //"You have become the Guild Master!"
+ clif->displaymessage(g->member[0].sd->fd, msg_txt(679)); //"You have become the Guild Master!"
g->member[0].sd->state.gmaster_flag = g;
//Block his skills for 5 minutes to prevent abuse.
guild_block_skill(g->member[0].sd, 300000);
@@ -1762,8 +1762,8 @@ int guild_gm_changed(int guild_id, int account_id, int char_id)
{
if( g->member[i].sd && g->member[i].sd->fd )
{
- clif_guild_basicinfo(g->member[i].sd);
- clif_guild_memberlist(g->member[i].sd);
+ clif->guild_basicinfo(g->member[i].sd);
+ clif->guild_memberlist(g->member[i].sd);
}
}
@@ -1793,7 +1793,7 @@ int guild_break(struct map_session_data *sd,char *name)
break;
}
if(i<g->max_member){
- clif_guild_broken(sd,2);
+ clif->guild_broken(sd,2);
return 0;
}
diff --git a/src/map/homunculus.c b/src/map/homunculus.c
index 096d595f8..9462ab0d2 100644
--- a/src/map/homunculus.c
+++ b/src/map/homunculus.c
@@ -96,7 +96,7 @@ int hom_addspiritball(TBL_HOM *hd, int max) {
else
hd->homunculus.spiritball++;
- clif_spiritball(&hd->bl);
+ clif->spiritball(&hd->bl);
return 0;
}
@@ -117,13 +117,13 @@ int hom_delspiritball(TBL_HOM *hd, int count, int type) {
hd->homunculus.spiritball -= count;
if (!type)
- clif_spiritball(&hd->bl);
+ clif->spiritball(&hd->bl);
return 0;
}
void merc_damage(struct homun_data *hd) {
- clif_hominfo(hd->master,hd,0);
+ clif->hominfo(hd->master,hd,0);
}
int merc_hom_dead(struct homun_data *hd)
@@ -131,7 +131,7 @@ int merc_hom_dead(struct homun_data *hd)
//There's no intimacy penalties on death (from Tharis)
struct map_session_data *sd = hd->master;
- clif_emotion(&hd->bl, E_WAH);
+ clif->emotion(&hd->bl, E_WAH);
//Delete timers when dead.
merc_hom_hungry_timer_delete(hd);
@@ -140,7 +140,7 @@ int merc_hom_dead(struct homun_data *hd)
if (!sd) //unit remove map will invoke unit free
return 3;
- clif_emotion(&sd->bl, E_SOB);
+ clif->emotion(&sd->bl, E_SOB);
//Remove from map (if it has no intimacy, it is auto-removed from memory)
return 3;
}
@@ -168,7 +168,7 @@ int merc_hom_vaporize(struct map_session_data *sd, int flag)
hd->homunculus.vaporize = 1;
if(battle_config.hom_setting&0x40)
memset(hd->blockskill, 0, sizeof(hd->blockskill));
- clif_hominfo(sd, sd->hd, 0);
+ clif->hominfo(sd, sd->hd, 0);
merc_save(hd);
return unit_remove_map(&hd->bl, CLR_OUTSIGHT);
}
@@ -185,13 +185,13 @@ int merc_hom_delete(struct homun_data *hd, int emote)
return unit_free(&hd->bl,CLR_DEAD);
if (emote >= 0)
- clif_emotion(&sd->bl, emote);
+ clif->emotion(&sd->bl, emote);
//This makes it be deleted right away.
hd->homunculus.intimacy = 0;
// Send homunculus_dead to client
hd->homunculus.hp = 0;
- clif_hominfo(sd, hd, 0);
+ clif->hominfo(sd, hd, 0);
return unit_remove_map(&hd->bl,CLR_OUTSIGHT);
}
@@ -247,7 +247,7 @@ int merc_hom_calc_skilltree(struct homun_data *hd, int flag_evolve)
}
if( hd->master )
- clif_homskillinfoblock(hd->master);
+ clif->homskillinfoblock(hd->master);
return 0;
}
@@ -291,9 +291,9 @@ void merc_hom_skillup(struct homun_data *hd,uint16 skill_id)
hd->homunculus.skillpts-- ;
status_calc_homunculus(hd,0);
if (hd->master) {
- clif_homskillup(hd->master, skill_id);
- clif_hominfo(hd->master,hd,0);
- clif_homskillinfoblock(hd->master);
+ clif->homskillup(hd->master, skill_id);
+ clif->hominfo(hd->master,hd,0);
+ clif->homskillinfoblock(hd->master);
}
}
}
@@ -358,7 +358,7 @@ int merc_hom_levelup(struct homun_data *hd)
growth_max_hp, growth_max_sp,
growth_str/10.0, growth_agi/10.0, growth_vit/10.0,
growth_int/10.0, growth_dex/10.0, growth_luk/10.0);
- clif_disp_onlyself(hd->master,output,strlen(output));
+ clif->disp_onlyself(hd->master,output,strlen(output));
}
return 1 ;
}
@@ -385,7 +385,7 @@ int merc_hom_evolution(struct homun_data *hd)
if(!hd->homunculusDB->evo_class || hd->homunculus.class_ == hd->homunculusDB->evo_class)
{
- clif_emotion(&hd->bl, E_SWT);
+ clif->emotion(&hd->bl, E_SWT);
return 0 ;
}
sd = hd->master;
@@ -414,9 +414,9 @@ int merc_hom_evolution(struct homun_data *hd)
unit_remove_map(&hd->bl, CLR_OUTSIGHT);
map_addblock(&hd->bl);
- clif_spawn(&hd->bl);
- clif_emotion(&sd->bl, E_NO1);
- clif_specialeffect(&hd->bl,568,AREA);
+ clif->spawn(&hd->bl);
+ clif->emotion(&sd->bl, E_NO1);
+ clif->specialeffect(&hd->bl,568,AREA);
//status_Calc flag&1 will make current HP/SP be reloaded from hom structure
hom->hp = hd->battle_status.hp;
@@ -440,7 +440,7 @@ int hom_mutate(struct homun_data *hd, int homun_id)
m_id = hom_class2mapid(homun_id);
if( m_class == -1 || m_id == -1 || !(m_class&HOM_EVO) || !(m_id&HOM_S) ) {
- clif_emotion(&hd->bl, E_SWT);
+ clif->emotion(&hd->bl, E_SWT);
return 0;
}
@@ -458,9 +458,9 @@ int hom_mutate(struct homun_data *hd, int homun_id)
unit_remove_map(&hd->bl, CLR_OUTSIGHT);
map_addblock(&hd->bl);
- clif_spawn(&hd->bl);
- clif_emotion(&sd->bl, E_NO1);
- clif_specialeffect(&hd->bl,568,AREA);
+ clif->spawn(&hd->bl);
+ clif->emotion(&sd->bl, E_NO1);
+ clif->specialeffect(&hd->bl,568,AREA);
//status_Calc flag&1 will make current HP/SP be reloaded from hom structure
@@ -498,7 +498,7 @@ int merc_hom_gainexp(struct homun_data *hd,int exp)
hd->homunculus.exp += exp;
if(hd->homunculus.exp < hd->exp_next) {
- clif_hominfo(hd->master,hd,0);
+ clif->hominfo(hd->master,hd,0);
return 0;
}
@@ -508,7 +508,7 @@ int merc_hom_gainexp(struct homun_data *hd,int exp)
if( hd->exp_next == 0 )
hd->homunculus.exp = 0 ;
- clif_specialeffect(&hd->bl,568,AREA);
+ clif->specialeffect(&hd->bl,568,AREA);
status_calc_homunculus(hd,0);
status_percent_heal(&hd->bl, 100, 100);
return 0;
@@ -539,7 +539,7 @@ int merc_hom_decrease_intimacy(struct homun_data * hd, unsigned int value)
}
void merc_hom_heal(struct homun_data *hd) {
- clif_hominfo(hd->master,hd,0);
+ clif->hominfo(hd->master,hd,0);
}
void merc_save(struct homun_data *hd)
@@ -586,7 +586,7 @@ int merc_hom_food(struct map_session_data *sd, struct homun_data *hd)
foodID = hd->homunculusDB->foodID;
i = pc_search_inventory(sd,foodID);
if(i < 0) {
- clif_hom_food(sd,foodID,0);
+ clif->hom_food(sd,foodID,0);
return 1;
}
pc_delitem(sd,i,1,0,0,LOG_TYPE_CONSUME);
@@ -612,10 +612,10 @@ int merc_hom_food(struct map_session_data *sd, struct homun_data *hd)
if(hd->homunculus.hunger > 100)
hd->homunculus.hunger = 100;
- clif_emotion(&hd->bl,emotion);
- clif_send_homdata(sd,SP_HUNGRY,hd->homunculus.hunger);
- clif_send_homdata(sd,SP_INTIMATE,hd->homunculus.intimacy / 100);
- clif_hom_food(sd,foodID,1);
+ clif->emotion(&hd->bl,emotion);
+ clif->send_homdata(sd,SP_HUNGRY,hd->homunculus.hunger);
+ clif->send_homdata(sd,SP_INTIMATE,hd->homunculus.intimacy / 100);
+ clif->hom_food(sd,foodID,1);
// Too much food :/
if(hd->homunculus.intimacy == 0)
@@ -645,11 +645,11 @@ static int merc_hom_hungry(int tid, unsigned int tick, int id, intptr_t data)
hd->homunculus.hunger-- ;
if(hd->homunculus.hunger <= 10) {
- clif_emotion(&hd->bl, E_AN);
+ clif->emotion(&hd->bl, E_AN);
} else if(hd->homunculus.hunger == 25) {
- clif_emotion(&hd->bl, E_HMM);
+ clif->emotion(&hd->bl, E_HMM);
} else if(hd->homunculus.hunger == 75) {
- clif_emotion(&hd->bl, E_OK);
+ clif->emotion(&hd->bl, E_OK);
}
if(hd->homunculus.hunger < 0) {
@@ -657,10 +657,10 @@ static int merc_hom_hungry(int tid, unsigned int tick, int id, intptr_t data)
// Delete the homunculus if intimacy <= 100
if ( !merc_hom_decrease_intimacy(hd, 100) )
return merc_hom_delete(hd, E_OMG);
- clif_send_homdata(sd,SP_INTIMATE,hd->homunculus.intimacy / 100);
+ clif->send_homdata(sd,SP_INTIMATE,hd->homunculus.intimacy / 100);
}
- clif_send_homdata(sd,SP_HUNGRY,hd->homunculus.hunger);
+ clif->send_homdata(sd,SP_HUNGRY,hd->homunculus.hunger);
hd->hungry_timer = add_timer(tick+hd->homunculusDB->hungryDelay,merc_hom_hungry,sd->bl.id,0); //simple Fix albator
return 0;
}
@@ -703,13 +703,13 @@ int merc_hom_change_name_ack(struct map_session_data *sd, char* name, int flag)
normalize_name(name," ");//bugreport:3032
if ( !flag || !strlen(name) ) {
- clif_displaymessage(sd->fd, msg_txt(280)); // You cannot use this name
+ clif->displaymessage(sd->fd, msg_txt(280)); // You cannot use this name
return 0;
}
safestrncpy(hd->homunculus.name,name,NAME_LENGTH);
- clif_charnameack (0,&hd->bl);
+ clif->charnameack (0,&hd->bl);
hd->homunculus.rename_flag = 1;
- clif_hominfo(sd,hd,0);
+ clif->hominfo(sd,hd,0);
return 1;
}
@@ -814,11 +814,11 @@ int merc_call_homunculus(struct map_session_data *sd)
hd->bl.y = sd->bl.y;
hd->bl.m = sd->bl.m;
map_addblock(&hd->bl);
- clif_spawn(&hd->bl);
- clif_send_homdata(sd,SP_ACK,0);
- clif_hominfo(sd,hd,1);
- clif_hominfo(sd,hd,0); // send this x2. dunno why, but kRO does that [blackhole89]
- clif_homskillinfoblock(sd);
+ clif->spawn(&hd->bl);
+ clif->send_homdata(sd,SP_ACK,0);
+ clif->hominfo(sd,hd,1);
+ clif->hominfo(sd,hd,0); // send this x2. dunno why, but kRO does that [blackhole89]
+ clif->homskillinfoblock(sd);
if (battle_config.slaves_inherit_speed&1)
status_calc_bl(&hd->bl, SCB_SPEED);
merc_save(hd);
@@ -860,11 +860,11 @@ int merc_hom_recv_data(int account_id, struct s_homunculus *sh, int flag)
if(hd && hd->homunculus.hp && !hd->homunculus.vaporize && hd->bl.prev == NULL && sd->bl.prev != NULL)
{
map_addblock(&hd->bl);
- clif_spawn(&hd->bl);
- clif_send_homdata(sd,SP_ACK,0);
- clif_hominfo(sd,hd,1);
- clif_hominfo(sd,hd,0); // send this x2. dunno why, but kRO does that [blackhole89]
- clif_homskillinfoblock(sd);
+ clif->spawn(&hd->bl);
+ clif->send_homdata(sd,SP_ACK,0);
+ clif->hominfo(sd,hd,1);
+ clif->hominfo(sd,hd,0); // send this x2. dunno why, but kRO does that [blackhole89]
+ clif->homskillinfoblock(sd);
merc_hom_init_timers(hd);
}
return 1;
@@ -934,7 +934,7 @@ int merc_resurrect_homunculus(struct map_session_data* sd, unsigned char per, sh
hd->bl.x = x;
hd->bl.y = y;
map_addblock(&hd->bl);
- clif_spawn(&hd->bl);
+ clif->spawn(&hd->bl);
}
status_revive(&hd->bl, per, 0);
return 1;
@@ -946,10 +946,10 @@ void merc_hom_revive(struct homun_data *hd, unsigned int hp, unsigned int sp)
hd->homunculus.hp = hd->battle_status.hp;
if (!sd)
return;
- clif_send_homdata(sd,SP_ACK,0);
- clif_hominfo(sd,hd,1);
- clif_hominfo(sd,hd,0);
- clif_homskillinfoblock(sd);
+ clif->send_homdata(sd,SP_ACK,0);
+ clif->hominfo(sd,hd,1);
+ clif->hominfo(sd,hd,0);
+ clif->homskillinfoblock(sd);
}
void merc_reset_stats(struct homun_data *hd)
@@ -1015,10 +1015,10 @@ int merc_hom_shuffle(struct homun_data *hd)
hd->homunculus.exp = exp;
memcpy(&hd->homunculus.hskill, &b_skill, sizeof(b_skill));
hd->homunculus.skillpts = skillpts;
- clif_homskillinfoblock(sd);
+ clif->homskillinfoblock(sd);
status_calc_homunculus(hd,0);
status_percent_heal(&hd->bl, 100, 100);
- clif_specialeffect(&hd->bl,568,AREA);
+ clif->specialeffect(&hd->bl,568,AREA);
return 1;
}
diff --git a/src/map/instance.c b/src/map/instance.c
index 76ae61147..8ddde8b3e 100644
--- a/src/map/instance.c
+++ b/src/map/instance.c
@@ -88,7 +88,7 @@ int instance_create(int party_id, const char *name)
memset( instance[i].map, 0x00, sizeof(instance[i].map) );
p->instance_id = i;
- clif_instance(i, 1, 0); // Start instancing window
+ clif->instance(i, 1, 0); // Start instancing window
ShowInfo("[Instance] Created: %s.\n", name);
return i;
}
@@ -357,7 +357,7 @@ void instance_destroy(int instance_id)
else
type = 3;
- clif_instance(instance_id, 5, type); // Report users this instance has been destroyed
+ clif->instance(instance_id, 5, type); // Report users this instance has been destroyed
while( instance[instance_id].num_map && last != instance[instance_id].map[0] )
{ // Remove all maps from instance
@@ -403,13 +403,13 @@ void instance_check_idle(int instance_id)
delete_timer(instance[instance_id].idle_timer, instance_destroy_timer);
instance[instance_id].idle_timer = INVALID_TIMER;
instance[instance_id].idle_timeout = 0;
- clif_instance(instance_id, 3, 0); // Notify instance users normal instance expiration
+ clif->instance(instance_id, 3, 0); // Notify instance users normal instance expiration
}
else if( instance[instance_id].idle_timer == INVALID_TIMER && idle )
{
instance[instance_id].idle_timeout = now + instance[instance_id].idle_timeoutval;
instance[instance_id].idle_timer = add_timer( gettick() + (unsigned int)instance[instance_id].idle_timeoutval * 1000, instance_destroy_timer, instance_id, 0);
- clif_instance(instance_id, 4, 0); // Notify instance users it will be destroyed of no user join it again in "X" time
+ clif->instance(instance_id, 4, 0); // Notify instance users it will be destroyed of no user join it again in "X" time
}
}
@@ -453,7 +453,7 @@ void instance_set_timeout(int instance_id, unsigned int progress_timeout, unsign
}
if( instance[instance_id].idle_timer == INVALID_TIMER && instance[instance_id].progress_timer != INVALID_TIMER )
- clif_instance(instance_id, 3, 0);
+ clif->instance(instance_id, 3, 0);
}
/*--------------------------------------
@@ -463,7 +463,7 @@ void instance_check_kick(struct map_session_data *sd)
{
int16 m = sd->bl.m;
- clif_instance_leave(sd->fd);
+ clif->instance_leave(sd->fd);
if( map[m].instance_id )
{ // User was on the instance map
if( map[m].save.map )
diff --git a/src/map/intif.c b/src/map/intif.c
index 613a71e66..ba14ad6f3 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -142,7 +142,7 @@ int intif_broadcast(const char* mes, int len, int type)
int lp = type ? 4 : 0;
// Send to the local players
- clif_broadcast(NULL, mes, len, type, ALL_CLIENT);
+ clif->broadcast(NULL, mes, len, type, ALL_CLIENT);
if (CheckForCharServer())
return 0;
@@ -171,9 +171,9 @@ int intif_broadcast2(const char* mes, int len, unsigned long fontColor, short fo
{
// Send to the local players
if (fontColor == 0xFE000000) // This is main chat message [LuzZza]
- clif_MainChatMessage(mes);
+ clif->MainChatMessage(mes);
else
- clif_broadcast2(NULL, mes, len, fontColor, fontType, fontSize, fontAlign, fontY, ALL_CLIENT);
+ clif->broadcast2(NULL, mes, len, fontColor, fontType, fontSize, fontAlign, fontY, ALL_CLIENT);
if (CheckForCharServer())
return 0;
@@ -224,7 +224,7 @@ int intif_wis_message(struct map_session_data *sd, char *nick, char *mes, int me
if (other_mapserver_count < 1)
{ //Character not found.
- clif_wis_end(sd->fd, 1);
+ clif->wis_end(sd->fd, 1);
return 0;
}
@@ -888,7 +888,7 @@ int intif_parse_WisMessage(int fd)
return 0;
}
//Success to send whisper.
- clif_wis_message(sd->fd, wisp_source, (char*)RFIFOP(fd,56),RFIFOW(fd,2)-56);
+ clif->wis_message(sd->fd, wisp_source, (char*)RFIFOP(fd,56),RFIFOW(fd,2)-56);
intif_wis_replay(id,0); // succes
return 0;
}
@@ -902,7 +902,7 @@ int intif_parse_WisEnd(int fd)
ShowInfo("intif_parse_wisend: player: %s, flag: %d\n", RFIFOP(fd,2), RFIFOB(fd,26)); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
sd = (struct map_session_data *)map_nick2sd((char *) RFIFOP(fd,2));
if (sd != NULL)
- clif_wis_end(sd->fd, RFIFOB(fd,26));
+ clif->wis_end(sd->fd, RFIFOB(fd,26));
return 0;
}
@@ -919,7 +919,7 @@ static int mapif_parse_WisToGM_sub(struct map_session_data* sd,va_list va)
wisp_name = va_arg(va, char*);
message = va_arg(va, char*);
len = va_arg(va, int);
- clif_wis_message(sd->fd, wisp_name, message, len);
+ clif->wis_message(sd->fd, wisp_name, message, len);
return 1;
}
@@ -1523,12 +1523,12 @@ int intif_parse_Mail_inboxreceived(int fd)
sd->mail.changed = false; // cache is now in sync
if (flag)
- clif_Mail_refreshinbox(sd);
+ clif->mail_refreshinbox(sd);
else if( battle_config.mail_show_status && ( battle_config.mail_show_status == 1 || sd->mail.inbox.unread ) )
{
char output[128];
sprintf(output, msg_txt(510), sd->mail.inbox.unchecked, sd->mail.inbox.unread + sd->mail.inbox.unchecked);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif->disp_onlyself(sd, output, strlen(output));
}
return 0;
}
@@ -1633,7 +1633,7 @@ int intif_parse_Mail_delete(int fd)
intif_Mail_requestinbox(sd->status.char_id, 1); // Free space is available for new mails
}
- clif_Mail_delete(sd->fd, mail_id, failed);
+ clif->mail_delete(sd->fd, mail_id, failed);
return 0;
}
/*------------------------------------------
@@ -1679,7 +1679,7 @@ int intif_parse_Mail_return(int fd)
intif_Mail_requestinbox(sd->status.char_id, 1); // Free space is available for new mails
}
- clif_Mail_return(sd->fd, mail_id, fail);
+ clif->mail_return(sd->fd, mail_id, fail);
return 0;
}
/*------------------------------------------
@@ -1725,7 +1725,7 @@ static void intif_parse_Mail_send(int fd)
mail_deliveryfail(sd, &msg);
else
{
- clif_Mail_send(sd->fd, false);
+ clif->mail_send(sd->fd, false);
if( save_settings&16 )
chrif_save(sd, 0);
}
@@ -1743,7 +1743,7 @@ static void intif_parse_Mail_new(int fd)
return;
sd->mail.changed = true;
- clif_Mail_new(sd->fd, mail_id, sender_name, title);
+ clif->mail_new(sd->fd, mail_id, sender_name, title);
}
/*==========================================
@@ -1780,7 +1780,7 @@ static void intif_parse_Auction_results(int fd)
if( sd == NULL )
return;
- clif_Auction_results(sd, count, pages, data);
+ clif->auction_results(sd, count, pages, data);
}
int intif_Auction_register(struct auction_data *auction)
@@ -1816,7 +1816,7 @@ static void intif_parse_Auction_register(int fd)
if( auction.auction_id > 0 )
{
- clif_Auction_message(sd->fd, 1); // Confirmation Packet ??
+ clif->auction_message(sd->fd, 1); // Confirmation Packet ??
if( save_settings&32 )
chrif_save(sd,0);
}
@@ -1824,7 +1824,7 @@ static void intif_parse_Auction_register(int fd)
{
int zeny = auction.hours*battle_config.auction_feeperhour;
- clif_Auction_message(sd->fd, 4);
+ clif->auction_message(sd->fd, 4);
pc_additem(sd, &auction.item, auction.item.amount, LOG_TYPE_AUCTION);
pc_getzeny(sd, zeny, LOG_TYPE_AUCTION, NULL);
@@ -1855,10 +1855,10 @@ static void intif_parse_Auction_cancel(int fd)
switch( result )
{
- case 0: clif_Auction_message(sd->fd, 2); break;
- case 1: clif_Auction_close(sd->fd, 2); break;
- case 2: clif_Auction_close(sd->fd, 1); break;
- case 3: clif_Auction_message(sd->fd, 3); break;
+ case 0: clif->auction_message(sd->fd, 2); break;
+ case 1: clif->auction_close(sd->fd, 2); break;
+ case 2: clif->auction_close(sd->fd, 1); break;
+ case 3: clif->auction_message(sd->fd, 3); break;
}
}
@@ -1884,11 +1884,11 @@ static void intif_parse_Auction_close(int fd)
if( sd == NULL )
return;
- clif_Auction_close(sd->fd, result);
+ clif->auction_close(sd->fd, result);
if( result == 0 )
{
// FIXME: Leeching off a parse function
- clif_parse_Auction_cancelreg(fd, sd);
+ clif->Auction_cancelreg(fd, sd);
intif_Auction_requestlist(sd->status.char_id, 6, 0, "", 1);
}
}
@@ -1921,14 +1921,12 @@ static void intif_parse_Auction_bid(int fd)
if( sd == NULL )
return;
- clif_Auction_message(sd->fd, result);
- if( bid > 0 )
- {
+ clif->auction_message(sd->fd, result);
+ if( bid > 0 ) {
pc_getzeny(sd, bid, LOG_TYPE_AUCTION,NULL);
}
- if( result == 1 )
- { // To update the list, display your buy list
- clif_parse_Auction_cancelreg(fd, sd);
+ if( result == 1 ) { // To update the list, display your buy list
+ clif->Auction_cancelreg(fd, sd);
intif_Auction_requestlist(sd->status.char_id, 7, 0, "", 1);
}
}
@@ -1942,7 +1940,7 @@ static void intif_parse_Auction_message(int fd)
if( sd == NULL )
return;
- clif_Auction_message(sd->fd, result);
+ clif->auction_message(sd->fd, result);
}
/*==========================================
@@ -2147,7 +2145,7 @@ void intif_parse_MessageToFD(int fd) {
if( sd->bl.id == aid ) {
char msg[512];
safestrncpy(msg, (char*)RFIFOP(fd,12), RFIFOW(fd,2) - 12);
- clif_displaymessage(u_fd,msg);
+ clif->displaymessage(u_fd,msg);
}
}
@@ -2182,11 +2180,11 @@ int intif_parse(int fd)
switch(cmd){
case 0x3800:
if (RFIFOL(fd,4) == 0xFF000000) //Normal announce.
- clif_broadcast(NULL, (char *) RFIFOP(fd,16), packet_len-16, 0, ALL_CLIENT);
+ clif->broadcast(NULL, (char *) RFIFOP(fd,16), packet_len-16, 0, ALL_CLIENT);
else if (RFIFOL(fd,4) == 0xFE000000) //Main chat message [LuzZza]
- clif_MainChatMessage((char *)RFIFOP(fd,16));
+ clif->MainChatMessage((char *)RFIFOP(fd,16));
else //Color announce.
- clif_broadcast2(NULL, (char *) RFIFOP(fd,16), packet_len-16, RFIFOL(fd,4), RFIFOW(fd,8), RFIFOW(fd,10), RFIFOW(fd,12), RFIFOW(fd,14), ALL_CLIENT);
+ clif->broadcast2(NULL, (char *) RFIFOP(fd,16), packet_len-16, RFIFOL(fd,4), RFIFOW(fd,8), RFIFOW(fd,10), RFIFOW(fd,12), RFIFOW(fd,14), ALL_CLIENT);
break;
case 0x3801: intif_parse_WisMessage(fd); break;
case 0x3802: intif_parse_WisEnd(fd); break;
diff --git a/src/map/mail.c b/src/map/mail.c
index 03b8227b5..ffb3176c1 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -33,7 +33,7 @@ int mail_removeitem(struct map_session_data *sd, short flag)
if (flag) // Item send
pc_delitem(sd, sd->mail.index, sd->mail.amount, 1, 0, LOG_TYPE_MAIL);
else
- clif_additem(sd, sd->mail.index, sd->mail.amount, 0);
+ clif->additem(sd, sd->mail.index, sd->mail.amount, 0);
}
sd->mail.nameid = 0;
@@ -68,7 +68,7 @@ unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount) {
amount = sd->status.zeny;
sd->mail.zeny = amount;
- // clif_updatestatus(sd, SP_ZENY);
+ // clif->updatestatus(sd, SP_ZENY);
return 0;
} else { // Item Transfer
idx -= 2;
@@ -132,7 +132,7 @@ void mail_getattachment(struct map_session_data* sd, int zeny, struct item* item
if( item->nameid > 0 && item->amount > 0 )
{
pc_additem(sd, item, item->amount, LOG_TYPE_MAIL);
- clif_Mail_getattachment(sd->fd, 0);
+ clif->mail_getattachment(sd->fd, 0);
}
if( zeny > 0 )
@@ -148,7 +148,7 @@ int mail_openmail(struct map_session_data *sd)
if( sd->state.storage_flag || sd->state.vending || sd->state.buyingstore || sd->state.trading )
return 0;
- clif_Mail_window(sd->fd, 0);
+ clif->mail_window(sd->fd, 0);
return 1;
}
@@ -169,7 +169,7 @@ void mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg)
pc_getzeny(sd,msg->zeny,LOG_TYPE_MAIL, NULL); //Zeny receive (due to failure)
}
- clif_Mail_send(sd->fd, true);
+ clif->mail_send(sd->fd, true);
}
// This function only check if the mail operations are valid
@@ -177,7 +177,7 @@ bool mail_invalid_operation(struct map_session_data *sd)
{
if( !map[sd->bl.m].flag.town && !pc_can_use_command(sd, "mail", COMMAND_ATCOMMAND) )
{
- ShowWarning("clif_parse_Mail: char '%s' trying to do invalid mail operations.\n", sd->status.name);
+ ShowWarning("clif->parse_Mail: char '%s' trying to do invalid mail operations.\n", sd->status.name);
return true;
}
diff --git a/src/map/map.c b/src/map/map.c
index 1ba37fe75..25bc331fa 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1282,7 +1282,7 @@ int map_clearflooritem_timer(int tid, unsigned int tick, int id, intptr_t data)
if (search_petDB_index(fitem->item_data.nameid, PET_EGG) >= 0)
intif_delete_petdata(MakeDWord(fitem->item_data.card[1], fitem->item_data.card[2]));
- clif_clearflooritem(fitem, 0);
+ clif->clearflooritem(fitem, 0);
map_deliddb(&fitem->bl);
map_delblock(&fitem->bl);
map_freeblock(&fitem->bl);
@@ -1298,7 +1298,7 @@ void map_clearflooritem(struct block_list *bl) {
if( fitem->cleartimer )
delete_timer(fitem->cleartimer,map_clearflooritem_timer);
- clif_clearflooritem(fitem, 0);
+ clif->clearflooritem(fitem, 0);
map_deliddb(&fitem->bl);
map_delblock(&fitem->bl);
map_freeblock(&fitem->bl);
@@ -1465,7 +1465,7 @@ int map_addflooritem(struct item *item_data,int amount,int16 m,int16 x,int16 y,i
map_addiddb(&fitem->bl);
map_addblock(&fitem->bl);
- clif_dropflooritem(fitem);
+ clif->dropflooritem(fitem);
return fitem->bl.id;
}
@@ -1494,13 +1494,12 @@ void map_addnickdb(int charid, const char* nick)
p = idb_ensure(nick_db, charid, create_charid2nick);
safestrncpy(p->nick, nick, sizeof(p->nick));
- while( p->requests )
- {
+ while( p->requests ) {
req = p->requests;
p->requests = req->next;
sd = map_charid2sd(req->charid);
if( sd )
- clif_solved_charname(sd->fd, charid, p->nick);
+ clif->solved_charname(sd->fd, charid, p->nick);
aFree(req);
}
}
@@ -1517,13 +1516,12 @@ void map_delnickdb(int charid, const char* name)
if (!nick_db->remove(nick_db, db_i2key(charid), &data) || (p = db_data2ptr(&data)) == NULL)
return;
- while( p->requests )
- {
+ while( p->requests ) {
req = p->requests;
p->requests = req->next;
sd = map_charid2sd(req->charid);
if( sd )
- clif_solved_charname(sd->fd, charid, name);
+ clif->solved_charname(sd->fd, charid, name);
aFree(req);
}
aFree(p);
@@ -1541,16 +1539,14 @@ void map_reqnickdb(struct map_session_data * sd, int charid)
nullpo_retv(sd);
tsd = map_charid2sd(charid);
- if( tsd )
- {
- clif_solved_charname(sd->fd, charid, tsd->status.name);
+ if( tsd ) {
+ clif->solved_charname(sd->fd, charid, tsd->status.name);
return;
}
p = idb_ensure(nick_db, charid, create_charid2nick);
- if( *p->nick )
- {
- clif_solved_charname(sd->fd, charid, p->nick);
+ if( *p->nick ) {
+ clif->solved_charname(sd->fd, charid, p->nick);
return;
}
// not in cache, request it
@@ -2635,7 +2631,7 @@ bool map_iwall_set(int16 m, int16 x, int16 y, int size, int8 dir, bool shootable
map_setcell(m, x1, y1, CELL_WALKABLE, false);
map_setcell(m, x1, y1, CELL_SHOOTABLE, shootable);
- clif_changemapcell(0, m, x1, y1, map_getcell(m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
+ clif->changemapcell(0, m, x1, y1, map_getcell(m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
}
iwall->size = i;
@@ -2646,8 +2642,7 @@ bool map_iwall_set(int16 m, int16 x, int16 y, int size, int8 dir, bool shootable
return true;
}
-void map_iwall_get(struct map_session_data *sd)
-{
+void map_iwall_get(struct map_session_data *sd) {
struct iwall_data *iwall;
DBIterator* iter;
int16 x1, y1;
@@ -2657,15 +2652,13 @@ void map_iwall_get(struct map_session_data *sd)
return;
iter = db_iterator(iwall_db);
- for( iwall = dbi_first(iter); dbi_exists(iter); iwall = dbi_next(iter) )
- {
+ for( iwall = dbi_first(iter); dbi_exists(iter); iwall = dbi_next(iter) ) {
if( iwall->m != sd->bl.m )
continue;
- for( i = 0; i < iwall->size; i++ )
- {
+ for( i = 0; i < iwall->size; i++ ) {
map_iwall_nextxy(iwall->x, iwall->y, iwall->dir, i, &x1, &y1);
- clif_changemapcell(sd->fd, iwall->m, x1, y1, map_getcell(iwall->m, x1, y1, CELL_GETTYPE), SELF);
+ clif->changemapcell(sd->fd, iwall->m, x1, y1, map_getcell(iwall->m, x1, y1, CELL_GETTYPE), SELF);
}
}
dbi_destroy(iter);
@@ -2679,14 +2672,13 @@ void map_iwall_remove(const char *wall_name)
if( (iwall = (struct iwall_data *)strdb_get(iwall_db, wall_name)) == NULL )
return; // Nothing to do
- for( i = 0; i < iwall->size; i++ )
- {
+ for( i = 0; i < iwall->size; i++ ) {
map_iwall_nextxy(iwall->x, iwall->y, iwall->dir, i, &x1, &y1);
map_setcell(iwall->m, x1, y1, CELL_SHOOTABLE, true);
map_setcell(iwall->m, x1, y1, CELL_WALKABLE, true);
- clif_changemapcell(0, iwall->m, x1, y1, map_getcell(iwall->m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
+ clif->changemapcell(0, iwall->m, x1, y1, map_getcell(iwall->m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
}
map[iwall->m].iwall_num--;
@@ -2717,7 +2709,7 @@ int map_setipport(unsigned short mapindex, uint32 ip, uint16 port)
if(mdos->cell) //Local map,Do nothing. Give priority to our own local maps over ones from another server. [Skotlex]
return 0;
- if(ip == clif_getip() && port == clif_getport()) {
+ if(ip == clif->map_ip && port == clif->map_port) {
//That's odd, we received info that we are the ones with this map, but... we don't have it.
ShowFatalError("map_setipport : received info that this map-server SHOULD have map '%s', but it is not loaded.\n",mapindex_id2name(mapindex));
exit(EXIT_FAILURE);
@@ -3322,11 +3314,11 @@ int map_config_read(char *cfgName)
else if (strcmpi(w1, "char_port") == 0)
chrif_setport(atoi(w2));
else if (strcmpi(w1, "map_ip") == 0)
- map_ip_set = clif_setip(w2);
+ map_ip_set = clif->setip(w2);
else if (strcmpi(w1, "bind_ip") == 0)
- clif_setbindip(w2);
+ clif->setbindip(w2);
else if (strcmpi(w1, "map_port") == 0) {
- clif_setport(atoi(w2));
+ clif->setport(atoi(w2));
map_port = (atoi(w2));
} else if (strcmpi(w1, "map") == 0)
map_addmap(w2);
@@ -3957,7 +3949,7 @@ void do_final(void)
do_final_atcommand();
battle->final();
do_final_chrif();
- do_final_clif();
+ clif->final();
do_final_npc();
do_final_script();
do_final_instance();
@@ -4084,7 +4076,7 @@ void do_shutdown(void)
struct map_session_data* sd;
struct s_mapiterator* iter = mapit_getallusers();
for( sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) )
- clif_GM_kick(NULL, sd);
+ clif->GM_kick(NULL, sd);
mapit_free(iter);
flush_fifos();
}
@@ -4208,14 +4200,16 @@ int do_init(int argc, char *argv[])
}
}
+ battle_defaults();
+ clif_defaults();
+ skill_defaults();
+
map_config_read(MAP_CONF_NAME);
- /* only temporary until sirius's datapack patch is complete */
-
// loads npcs
map_reloadnpc(false);
chrif_checkdefaultlogin();
-
+
if (!map_ip_set || !char_ip_set) {
char ip_str[16];
ip2str(addr_[0], ip_str);
@@ -4230,13 +4224,10 @@ int do_init(int argc, char *argv[])
ShowInfo("Defaulting to %s as our IP address\n", ip_str);
if (!map_ip_set)
- clif_setip(ip_str);
+ clif->setip(ip_str);
if (!char_ip_set)
chrif_setip(ip_str);
}
-
- battle_defaults();
- skill_defaults();
battle->config_read(BATTLE_CONF_FILENAME);
msg_config_read(MSG_CONF_NAME);
@@ -4276,7 +4267,7 @@ int do_init(int argc, char *argv[])
battle->init();
do_init_instance();
do_init_chrif();
- do_init_clif();
+ clif->init();
do_init_script();
do_init_itemdb();
skill->init();
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index 665e6aeac..f673ae5de 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -157,7 +157,7 @@ int mercenary_set_faith(struct mercenary_data *md, int value)
*faith += value;
*faith = cap_value(*faith, 0, SHRT_MAX);
- clif_mercenary_updatestatus(sd, SP_MERCFAITH);
+ clif->mercenary_updatestatus(sd, SP_MERCFAITH);
return 0;
}
@@ -261,7 +261,7 @@ int merc_delete(struct mercenary_data *md, int reply)
case 1: mercenary_set_faith(md, -1); break; // -1 Loyalty on Mercenary killed
}
- clif_mercenary_message(sd, reply);
+ clif->mercenary_message(sd, reply);
return unit_remove_map(&md->bl, CLR_OUTSIGHT);
}
@@ -337,9 +337,9 @@ int merc_data_received(struct s_mercenary *merc, bool flag)
if( md && md->bl.prev == NULL && sd->bl.prev != NULL )
{
map_addblock(&md->bl);
- clif_spawn(&md->bl);
- clif_mercenary_info(sd);
- clif_mercenary_skillblock(sd);
+ clif->spawn(&md->bl);
+ clif->mercenary_info(sd);
+ clif->mercenary_skillblock(sd);
}
return 1;
@@ -348,9 +348,9 @@ int merc_data_received(struct s_mercenary *merc, bool flag)
void mercenary_heal(struct mercenary_data *md, int hp, int sp)
{
if( hp )
- clif_mercenary_updatestatus(md->master, SP_HP);
+ clif->mercenary_updatestatus(md->master, SP_HP);
if( sp )
- clif_mercenary_updatestatus(md->master, SP_SP);
+ clif->mercenary_updatestatus(md->master, SP_SP);
}
int mercenary_dead(struct mercenary_data *md)
@@ -380,7 +380,7 @@ int mercenary_kills(struct mercenary_data *md)
}
if( md->master )
- clif_mercenary_updatestatus(md->master, SP_MERCKILLS);
+ clif->mercenary_updatestatus(md->master, SP_MERCKILLS);
return 0;
}
diff --git a/src/map/mob.c b/src/map/mob.c
index 2995a4db4..6a507a099 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -162,7 +162,7 @@ void mvptomb_create(struct mob_data *md, char *killer, time_t time)
status_set_viewdata(&nd->bl, nd->class_);
status_change_init(&nd->bl);
unit_dataset(&nd->bl);
- clif_spawn(&nd->bl);
+ clif->spawn(&nd->bl);
}
@@ -174,7 +174,7 @@ void mvptomb_destroy(struct mob_data *md) {
m = nd->bl.m;
- clif_clearunit_area(&nd->bl,CLR_OUTSIGHT);
+ clif->clearunit_area(&nd->bl,CLR_OUTSIGHT);
map_delblock(&nd->bl);
@@ -399,7 +399,7 @@ bool mob_ksprotected (struct block_list *src, struct block_list *target)
if( DIFF_TICK(sd->ks_floodprotect_tick, tick) <= 0 )
{
sprintf(output, "[KS Warning!! - Owner : %s]", pl_sd->status.name);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif->disp_onlyself(sd, output, strlen(output));
sd->ks_floodprotect_tick = tick + 2000;
}
@@ -408,7 +408,7 @@ bool mob_ksprotected (struct block_list *src, struct block_list *target)
if( DIFF_TICK(pl_sd->ks_floodprotect_tick, tick) <= 0 )
{
sprintf(output, "[Watch out! %s is trying to KS you!]", sd->status.name);
- clif_disp_onlyself(pl_sd, output, strlen(output));
+ clif->disp_onlyself(pl_sd, output, strlen(output));
pl_sd->ks_floodprotect_tick = tick + 2000;
}
@@ -984,7 +984,7 @@ int mob_spawn (struct mob_data *md)
map_addblock(&md->bl);
if( map[md->bl.m].users )
- clif_spawn(&md->bl);
+ clif->spawn(&md->bl);
skill->unit_move(&md->bl,tick,1);
mobskill_use(md, tick, MSC_SPAWN);
return 0;
@@ -1614,7 +1614,7 @@ static bool mob_ai_sub_hard(struct mob_data *md, unsigned int tick)
}
if (pcdb_checkid(md->vd->class_))
{ //Give them walk act/delay to properly mimic players. [Skotlex]
- clif_takeitem(&md->bl,tbl);
+ clif->takeitem(&md->bl,tbl);
md->ud.canact_tick = tick + md->status.amotion;
unit_set_walkdelay(&md->bl, tick, md->status.amotion, 1);
}
@@ -2063,7 +2063,7 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage)
}
if (battle_config.show_mob_info&3)
- clif_charnameack (0, &md->bl);
+ clif->charnameack (0, &md->bl);
if (!src)
return;
@@ -2074,7 +2074,7 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage)
for(i = 0; i < DAMAGELOG_SIZE; i++){ // must show hp bar to all char who already hit the mob.
struct map_session_data *sd = map_charid2sd(md->dmglog[i].id);
if( sd && check_distance_bl(&md->bl, &sd->bl, AREA_SIZE) ) // check if in range
- clif_monster_hp_bar(md, sd->fd);
+ clif->monster_hp_bar(md, sd->fd);
}
}
#endif
@@ -2481,8 +2481,8 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
mexp = (unsigned int)cap_value(exp, 1, UINT_MAX);
- clif_mvp_effect(mvp_sd);
- clif_mvp_exp(mvp_sd,mexp);
+ clif->mvp_effect(mvp_sd);
+ clif->mvp_exp(mvp_sd,mexp);
pc_gainexp(mvp_sd, &md->bl, mexp,0, false);
log_mvp[1] = mexp;
@@ -2519,7 +2519,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
memset(&item,0,sizeof(item));
item.nameid=mdrop_id[i];
item.identify= itemdb_isidentified(item.nameid);
- clif_mvp_item(mvp_sd,item.nameid);
+ clif->mvp_item(mvp_sd,item.nameid);
log_mvp[0] = item.nameid;
//A Rare MVP Drop Global Announce by Lupus
@@ -2533,7 +2533,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
}
if((temp = pc_additem(mvp_sd,&item,1,LOG_TYPE_PICKDROP_PLAYER)) != 0) {
- clif_additem(mvp_sd,0,0,temp);
+ clif->additem(mvp_sd,0,0,temp);
map_addflooritem(&item,1,mvp_sd->bl.m,mvp_sd->bl.x,mvp_sd->bl.y,mvp_sd->status.char_id,(second_sd?second_sd->status.char_id:0),(third_sd?third_sd->status.char_id:0),1);
}
@@ -2569,7 +2569,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
sd->mission_mobid = temp;
pc_setglobalreg(sd,"TK_MISSION_ID", temp);
sd->mission_count = 0;
- clif_mission_info(sd, temp, 0);
+ clif->mission_info(sd, temp, 0);
}
pc_setglobalreg(sd,"TK_MISSION_COUNT", sd->mission_count);
}
@@ -2616,14 +2616,14 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if( pcdb_checkid(md->vd->class_) ) {//Player mobs are not removed automatically by the client.
/* first we set them dead, then we delay the outsight effect */
- clif_clearunit_area(&md->bl,CLR_DEAD);
- clif_clearunit_delayed(&md->bl, CLR_OUTSIGHT,tick+3000);
+ clif->clearunit_area(&md->bl,CLR_DEAD);
+ clif->clearunit_delayed(&md->bl, CLR_OUTSIGHT,tick+3000);
} else
/**
* We give the client some time to breath and this allows it to display anything it'd like with the dead corpose
* For example, this delay allows it to display soul drain effect
**/
- clif_clearunit_delayed(&md->bl, CLR_DEAD, tick+250);
+ clif->clearunit_delayed(&md->bl, CLR_DEAD, tick+250);
}
@@ -2651,11 +2651,11 @@ void mob_revive(struct mob_data *md, unsigned int hp)
md->tdmg = 0;
if (!md->bl.prev)
map_addblock(&md->bl);
- clif_spawn(&md->bl);
+ clif->spawn(&md->bl);
skill->unit_move(&md->bl,tick,1);
mobskill_use(md, tick, MSC_SPAWN);
if (battle_config.show_mob_info&3)
- clif_charnameack (0, &md->bl);
+ clif->charnameack (0, &md->bl);
}
int mob_guardian_guildchange(struct mob_data *md)
@@ -2762,7 +2762,7 @@ int mob_class_change (struct mob_data *md, int class_)
mob_stop_walking(md, 0);
unit_skillcastcancel(&md->bl, 0);
status_set_viewdata(&md->bl, class_);
- clif_mob_class_change(md,md->vd->class_);
+ clif->class_change(&md->bl, md->vd->class_, 1);
status_calc_mob(md, 1);
md->ud.state.speed_changed = 1; //Speed change update.
@@ -2784,7 +2784,7 @@ int mob_class_change (struct mob_data *md, int class_)
md->target_id = md->attacked_id = 0;
//Need to update name display.
- clif_charnameack(0, &md->bl);
+ clif->charnameack(0, &md->bl);
status_change_end(&md->bl,SC_KEEPING,INVALID_TIMER);
return 0;
}
@@ -2795,7 +2795,7 @@ int mob_class_change (struct mob_data *md, int class_)
void mob_heal(struct mob_data *md,unsigned int heal)
{
if (battle_config.show_mob_info&3)
- clif_charnameack (0, &md->bl);
+ clif->charnameack (0, &md->bl);
}
/*==========================================
@@ -2945,7 +2945,7 @@ int mob_summonslave(struct mob_data *md2,int *value,int amount,uint16 skill_id)
}
}
- clif_skill_nodamage(&md->bl,&md->bl,skill_id,amount,1);
+ clif->skill_nodamage(&md->bl,&md->bl,skill_id,amount,1);
}
return 0;
@@ -3269,7 +3269,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
snprintf(name, sizeof name,"%s", md->name);
strtok(name, "#"); // discard extra name identifier if present [Daegaladh]
snprintf(temp, sizeof temp,"%s : %s", name, mc->msg);
- clif_messagecolor(&md->bl, mc->color, temp);
+ clif->messagecolor(&md->bl, mc->color, temp);
}
if(!(battle_config.mob_ai&0x200)) { //pass on delay to same skill.
for (j = 0; j < md->db->maxskill; j++)
diff --git a/src/map/npc.c b/src/map/npc.c
index 797fc7422..eab38886c 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -199,24 +199,24 @@ int npc_enable(const char* name, int flag)
if (flag&1) {
nd->sc.option&=~OPTION_INVISIBLE;
- clif_spawn(&nd->bl);
+ clif->spawn(&nd->bl);
} else if (flag&2)
nd->sc.option&=~OPTION_HIDE;
else if (flag&4)
nd->sc.option|= OPTION_HIDE;
else { //Can't change the view_data to invisible class because the view_data for all npcs is shared! [Skotlex]
nd->sc.option|= OPTION_INVISIBLE;
- clif_clearunit_area(&nd->bl,CLR_OUTSIGHT); // Hack to trick maya purple card [Xazax]
+ clif->clearunit_area(&nd->bl,CLR_OUTSIGHT); // Hack to trick maya purple card [Xazax]
}
if (nd->class_ == WARP_CLASS || nd->class_ == FLAG_CLASS)
{ //Client won't display option changes for these classes [Toms]
if (nd->sc.option&(OPTION_HIDE|OPTION_INVISIBLE))
- clif_clearunit_area(&nd->bl, CLR_OUTSIGHT);
+ clif->clearunit_area(&nd->bl, CLR_OUTSIGHT);
else
- clif_spawn(&nd->bl);
+ clif->spawn(&nd->bl);
} else
- clif_changeoption(&nd->bl);
+ clif->changeoption(&nd->bl);
if( flag&3 && (nd->u.scr.xs >= 0 || nd->u.scr.ys >= 0) ) //check if player standing on a OnTouchArea
map_foreachinarea( npc_enable_sub, nd->bl.m, nd->bl.x-nd->u.scr.xs, nd->bl.y-nd->u.scr.ys, nd->bl.x+nd->u.scr.xs, nd->bl.y+nd->u.scr.ys, BL_PC, nd );
@@ -256,7 +256,7 @@ int npc_rr_secure_timeout_timer(int tid, unsigned int tick, int id, intptr_t dat
/**
* This guy's been idle for longer than allowed, close him.
**/
- clif_scriptclose(sd,sd->npc_id);
+ clif->scriptclose(sd,sd->npc_id);
sd->npc_idle_timer = INVALID_TIMER;
} else //Create a new instance of ourselves to continue
sd->npc_idle_timer = add_timer(gettick() + (SECURE_NPCTIMEOUT_INTERVAL*1000),npc_rr_secure_timeout_timer,sd->bl.id,0);
@@ -274,7 +274,7 @@ int npc_event_dequeue(struct map_session_data* sd)
if(sd->npc_id)
{ //Current script is aborted.
if(sd->state.using_fake_npc){
- clif_clearunit_single(sd->npc_id, CLR_OUTSIGHT, sd->fd);
+ clif->clearunit_single(sd->npc_id, CLR_OUTSIGHT, sd->fd);
sd->state.using_fake_npc = 0;
}
if (sd->st) {
@@ -970,7 +970,7 @@ int npc_touch_areanpc(struct map_session_data* sd, int16 m, int16 x, int16 y)
struct unit_data *ud = unit_bl2ud(&sd->bl);
if( ud && ud->walkpath.path_pos < ud->walkpath.path_len )
{ // Since walktimer always == INVALID_TIMER at this time, we stop walking manually. [Inkfish]
- clif_fixpos(&sd->bl);
+ clif->fixpos(&sd->bl);
ud->walkpath.path_pos = ud->walkpath.path_len;
}
sd->areanpc_id = map[m].npc[i]->bl.id;
@@ -1141,7 +1141,7 @@ int npc_globalmessage(const char* name, const char* mes)
return 0;
snprintf(temp, sizeof(temp), "%s : %s", name, mes);
- clif_GlobalMessage(&nd->bl,temp);
+ clif->GlobalMessage(&nd->bl,temp);
return 0;
}
@@ -1156,19 +1156,19 @@ void run_tomb(struct map_session_data* sd, struct npc_data* nd)
// TODO: Find exact color?
snprintf(buffer, sizeof(buffer), msg_txt(657), nd->u.tomb.md->db->name);
- clif_scriptmes(sd, nd->bl.id, buffer);
+ clif->scriptmes(sd, nd->bl.id, buffer);
- clif_scriptmes(sd, nd->bl.id, msg_txt(658));
+ clif->scriptmes(sd, nd->bl.id, msg_txt(658));
snprintf(buffer, sizeof(buffer), msg_txt(659), time);
- clif_scriptmes(sd, nd->bl.id, buffer);
+ clif->scriptmes(sd, nd->bl.id, buffer);
- clif_scriptmes(sd, nd->bl.id, msg_txt(660));
+ clif->scriptmes(sd, nd->bl.id, msg_txt(660));
snprintf(buffer, sizeof(buffer), msg_txt(661), nd->u.tomb.killer_name[0] ? nd->u.tomb.killer_name : "Unknown");
- clif_scriptmes(sd, nd->bl.id, buffer);
+ clif->scriptmes(sd, nd->bl.id, buffer);
- clif_scriptclose(sd, nd->bl.id);
+ clif->scriptclose(sd, nd->bl.id);
}
/*==========================================
@@ -1193,10 +1193,10 @@ int npc_click(struct map_session_data* sd, struct npc_data* nd)
switch(nd->subtype) {
case SHOP:
- clif_npcbuysell(sd,nd->bl.id);
+ clif->npcbuysell(sd,nd->bl.id);
break;
case CASHSHOP:
- clif_cashshop_show(sd,nd);
+ clif->cashshop_show(sd,nd);
break;
case SCRIPT:
run_script(nd->u.scr.script,0,sd->bl.id,nd->bl.id);
@@ -1285,9 +1285,9 @@ int npc_buysellsel(struct map_session_data* sd, int id, int type)
sd->npc_shopid = id;
if (type==0) {
- clif_buylist(sd,nd);
+ clif->buylist(sd,nd);
} else {
- clif_selllist(sd);
+ clif->selllist(sd);
}
return 0;
}
@@ -1483,7 +1483,7 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po
/// Player item purchase from npc shop.
///
/// @param item_list 'n' pairs <amount,itemid>
-/// @return result code for clif_parse_NpcBuyListSend
+/// @return result code for clif->parse_NpcBuyListSend
int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list)
{
struct npc_data* nd;
@@ -1662,7 +1662,7 @@ static int npc_selllist_sub(struct map_session_data* sd, int n, unsigned short*
/// Player item selling to npc shop.
///
/// @param item_list 'n' pairs <index,amount>
-/// @return result code for clif_parse_NpcSellListSend
+/// @return result code for clif->parse_NpcSellListSend
int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list)
{
double z;
@@ -1766,7 +1766,7 @@ int npc_remove_map(struct npc_data* nd)
if(nd->bl.prev == NULL || nd->bl.m < 0)
return 1; //Not assigned to a map.
m = nd->bl.m;
- clif_clearunit_area(&nd->bl,CLR_RESPAWN);
+ clif->clearunit_area(&nd->bl,CLR_RESPAWN);
npc_unsetcells(nd);
map_delblock(&nd->bl);
//Remove npc from map[].npc list. [Skotlex]
@@ -2102,7 +2102,7 @@ struct npc_data* npc_add_warp(char* name, short from_mapid, short from_x, short
status_change_init(&nd->bl);
unit_dataset(&nd->bl);
if( map[nd->bl.m].users )
- clif_spawn(&nd->bl);
+ clif->spawn(&nd->bl);
strdb_put(npcname_db, nd->exname, nd);
return nd;
@@ -2163,7 +2163,7 @@ static const char* npc_parse_warp(char* w1, char* w2, char* w3, char* w4, const
status_change_init(&nd->bl);
unit_dataset(&nd->bl);
if( map[nd->bl.m].users )
- clif_spawn(&nd->bl);
+ clif->spawn(&nd->bl);
strdb_put(npcname_db, nd->exname, nd);
return strchr(start,'\n');// continue
@@ -2276,7 +2276,7 @@ static const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const
unit_dataset(&nd->bl);
nd->ud.dir = dir;
if( map[nd->bl.m].users )
- clif_spawn(&nd->bl);
+ clif->spawn(&nd->bl);
} else
{// 'floating' shop?
map_addiddb(&nd->bl);
@@ -2489,7 +2489,7 @@ static const char* npc_parse_script(char* w1, char* w2, char* w3, char* w4, cons
{
status_set_viewdata(&nd->bl, nd->class_);
if( map[nd->bl.m].users )
- clif_spawn(&nd->bl);
+ clif->spawn(&nd->bl);
}
}
else
@@ -2650,7 +2650,7 @@ const char* npc_parse_duplicate(char* w1, char* w2, char* w3, char* w4, const ch
{
status_set_viewdata(&nd->bl, nd->class_);
if( map[nd->bl.m].users )
- clif_spawn(&nd->bl);
+ clif->spawn(&nd->bl);
}
}
else
@@ -2728,7 +2728,7 @@ int npc_duplicate4instance(struct npc_data *snd, int16 m) {
status_change_init(&wnd->bl);
unit_dataset(&wnd->bl);
if( map[wnd->bl.m].users )
- clif_spawn(&wnd->bl);
+ clif->spawn(&wnd->bl);
strdb_put(npcname_db, wnd->exname, wnd);
}
else
@@ -2832,9 +2832,9 @@ void npc_movenpc(struct npc_data* nd, int16 x, int16 y)
x = cap_value(x, 0, map[m].xs-1);
y = cap_value(y, 0, map[m].ys-1);
- map_foreachinrange(clif_outsight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl);
+ map_foreachinrange(clif->outsight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl);
map_moveblock(&nd->bl, x, y, gettick());
- map_foreachinrange(clif_insight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl);
+ map_foreachinrange(clif->insight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl);
}
/// Changes the display name of the npc.
@@ -2847,7 +2847,7 @@ void npc_setdisplayname(struct npc_data* nd, const char* newname)
safestrncpy(nd->name, newname, sizeof(nd->name));
if( map[nd->bl.m].users )
- clif_charnameack(0, &nd->bl);
+ clif->charnameack(0, &nd->bl);
}
/// Changes the display class of the npc.
@@ -2862,11 +2862,11 @@ void npc_setclass(struct npc_data* nd, short class_)
return;
if( map[nd->bl.m].users )
- clif_clearunit_area(&nd->bl, CLR_OUTSIGHT);// fade out
+ clif->clearunit_area(&nd->bl, CLR_OUTSIGHT);// fade out
nd->class_ = class_;
status_set_viewdata(&nd->bl, class_);
if( map[nd->bl.m].users )
- clif_spawn(&nd->bl);// fade in
+ clif->spawn(&nd->bl);// fade in
}
// @commands (script based)
diff --git a/src/map/party.c b/src/map/party.c
index e4d34bb1c..baf680df3 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -159,7 +159,7 @@ int party_create(struct map_session_data *sd,char *name,int item,int item2)
if( sd->status.party_id > 0 || sd->party_joining || sd->party_creating )
{// already associated with a party
- clif_party_created(sd,2);
+ clif->party_created(sd,2);
return 0;
}
@@ -188,10 +188,10 @@ void party_created(int account_id,int char_id,int fail,int party_id,char *name)
if( !fail ) {
sd->status.party_id = party_id;
- clif_party_created(sd,0); //Success message
+ clif->party_created(sd,0); //Success message
//We don't do any further work here because the char-server sends a party info packet right after creating the party.
} else {
- clif_party_created(sd,1); // "party name already exists"
+ clif->party_created(sd,1); // "party name already exists"
}
}
@@ -315,12 +315,12 @@ int party_recv_info(struct party* sp, int char_id)
sd = p->data[member_id].sd;
if( sd == NULL )
continue;// not online
- clif_charnameupdate(sd); //Update other people's display. [Skotlex]
- clif_party_member_info(p,sd);
- clif_party_option(p,sd,0x100);
- clif_party_info(p,NULL);
+ clif->charnameupdate(sd); //Update other people's display. [Skotlex]
+ clif->party_member_info(p,sd);
+ clif->party_option(p,sd,0x100);
+ clif->party_info(p,NULL);
if( p->instance_id != 0 )
- clif_instance_join(sd->fd, p->instance_id);
+ clif->instance_join(sd->fd, p->instance_id);
}
if( char_id != 0 )// requester
{
@@ -345,7 +345,7 @@ int party_invite(struct map_session_data *sd,struct map_session_data *tsd)
ARR_FIND(0, MAX_PARTY, i, p->data[i].sd == sd);
if( i == MAX_PARTY || !p->party.member[i].leader ) {
- clif_displaymessage(sd->fd, msg_txt(282));
+ clif->displaymessage(sd->fd, msg_txt(282));
return 0;
}
@@ -353,43 +353,43 @@ int party_invite(struct map_session_data *sd,struct map_session_data *tsd)
ARR_FIND(0, MAX_PARTY, i, p->party.member[i].account_id == 0);
if( i == MAX_PARTY ) {
- clif_party_inviteack(sd, (tsd?tsd->status.name:""), 3);
+ clif->party_inviteack(sd, (tsd?tsd->status.name:""), 3);
return 0;
}
// confirm whether the account has the ability to invite before checking the player
if( !pc_has_permission(sd, PC_PERM_PARTY) || (tsd && !pc_has_permission(tsd, PC_PERM_PARTY)) ) {
- clif_displaymessage(sd->fd, msg_txt(81)); // "Your GM level doesn't authorize you to preform this action on the specified player."
+ clif->displaymessage(sd->fd, msg_txt(81)); // "Your GM level doesn't authorize you to preform this action on the specified player."
return 0;
}
if( tsd == NULL) {
- clif_party_inviteack(sd, "", 7);
+ clif->party_inviteack(sd, "", 7);
return 0;
}
if(!battle_config.invite_request_check) {
if (tsd->guild_invite>0 || tsd->trade_partner || tsd->adopt_invite) {
- clif_party_inviteack(sd,tsd->status.name,0);
+ clif->party_inviteack(sd,tsd->status.name,0);
return 0;
}
}
if (!tsd->fd) { //You can't invite someone who has already disconnected.
- clif_party_inviteack(sd,tsd->status.name,1);
+ clif->party_inviteack(sd,tsd->status.name,1);
return 0;
}
if( tsd->status.party_id > 0 || tsd->party_invite > 0 )
{// already associated with a party
- clif_party_inviteack(sd,tsd->status.name,0);
+ clif->party_inviteack(sd,tsd->status.name,0);
return 0;
}
tsd->party_invite=sd->status.party_id;
tsd->party_invite_account=sd->status.account_id;
- clif_party_invite(sd,tsd);
+ clif->party_invite(sd,tsd);
return 1;
}
@@ -417,7 +417,7 @@ void party_reply_invite(struct map_session_data *sd,int party_id,int flag)
sd->party_invite = 0;
sd->party_invite_account = 0;
if( tsd != NULL )
- clif_party_inviteack(tsd,sd->status.name,1);
+ clif->party_inviteack(tsd,sd->status.name,1);
}
}
@@ -439,7 +439,7 @@ void party_member_joined(struct map_session_data *sd)
{
p->data[i].sd = sd;
if( p->instance_id )
- clif_instance_join(sd->fd,p->instance_id);
+ clif->instance_join(sd->fd,p->instance_id);
}
else
sd->status.party_id = 0; //He does not belongs to the party really?
@@ -474,31 +474,31 @@ int party_member_added(int party_id,int account_id,int char_id, int flag)
if( flag )
{// failed
if( sd2 != NULL )
- clif_party_inviteack(sd2,sd->status.name,3);
+ clif->party_inviteack(sd2,sd->status.name,3);
return 0;
}
sd->status.party_id = party_id;
- clif_party_member_info(p,sd);
- clif_party_option(p,sd,0x100);
- clif_party_info(p,sd);
+ clif->party_member_info(p,sd);
+ clif->party_option(p,sd,0x100);
+ clif->party_info(p,sd);
if( sd2 != NULL )
- clif_party_inviteack(sd2,sd->status.name,2);
+ clif->party_inviteack(sd2,sd->status.name,2);
for( i = 0; i < ARRAYLENGTH(p->data); ++i )
{// hp of the other party members
sd2 = p->data[i].sd;
if( sd2 && sd2->status.account_id != account_id && sd2->status.char_id != char_id )
- clif_hpmeter_single(sd->fd, sd2->bl.id, sd2->battle_status.hp, sd2->battle_status.max_hp);
+ clif->hpmeter_single(sd->fd, sd2->bl.id, sd2->battle_status.hp, sd2->battle_status.max_hp);
}
- clif_party_hp(sd);
- clif_party_xy(sd);
- clif_charnameupdate(sd); //Update char name's display [Skotlex]
+ clif->party_hp(sd);
+ clif->party_xy(sd);
+ clif->charnameupdate(sd); //Update char name's display [Skotlex]
if( p->instance_id )
- clif_instance_join(sd->fd, p->instance_id);
+ clif->instance_join(sd->fd, p->instance_id);
return 0;
}
@@ -558,7 +558,7 @@ int party_member_withdraw(int party_id, int account_id, int char_id)
ARR_FIND( 0, MAX_PARTY, i, p->party.member[i].account_id == account_id && p->party.member[i].char_id == char_id );
if( i < MAX_PARTY )
{
- clif_party_withdraw(p,sd,account_id,p->party.member[i].name,0x0);
+ clif->party_withdraw(p,sd,account_id,p->party.member[i].name,0x0);
memset(&p->party.member[i], 0, sizeof(p->party.member[0]));
memset(&p->data[i], 0, sizeof(p->data[0]));
p->party.count--;
@@ -569,7 +569,7 @@ int party_member_withdraw(int party_id, int account_id, int char_id)
if( sd && sd->status.party_id == party_id && sd->status.char_id == char_id )
{
sd->status.party_id = 0;
- clif_charnameupdate(sd); //Update name display [Skotlex]
+ clif->charnameupdate(sd); //Update name display [Skotlex]
//TODO: hp bars should be cleared too
if( p->instance_id )
instance_check_kick(sd);
@@ -598,7 +598,7 @@ int party_broken(int party_id)
{
if( p->data[i].sd!=NULL )
{
- clif_party_withdraw(p,p->data[i].sd,p->party.member[i].account_id,p->party.member[i].name,0x10);
+ clif->party_withdraw(p,p->data[i].sd,p->party.member[i].account_id,p->party.member[i].name,0x10);
p->data[i].sd->status.party_id=0;
}
}
@@ -631,7 +631,7 @@ int party_optionchanged(int party_id,int account_id,int exp,int item,int flag)
p->party.item=item;
}
- clif_party_option(p,sd,flag);
+ clif->party_option(p,sd,flag);
return 0;
}
@@ -644,13 +644,13 @@ bool party_changeleader(struct map_session_data *sd, struct map_session_data *ts
return false;
if (!tsd || tsd->status.party_id != sd->status.party_id) {
- clif_displaymessage(sd->fd, msg_txt(283));
+ clif->displaymessage(sd->fd, msg_txt(283));
return false;
}
if( map[sd->bl.m].flag.partylock )
{
- clif_displaymessage(sd->fd, msg_txt(287));
+ clif->displaymessage(sd->fd, msg_txt(287));
return false;
}
@@ -663,7 +663,7 @@ bool party_changeleader(struct map_session_data *sd, struct map_session_data *ts
if (!p->party.member[mi].leader)
{ //Need to be a party leader.
- clif_displaymessage(sd->fd, msg_txt(282));
+ clif->displaymessage(sd->fd, msg_txt(282));
return false;
}
@@ -674,15 +674,15 @@ bool party_changeleader(struct map_session_data *sd, struct map_session_data *ts
//Change leadership.
p->party.member[mi].leader = 0;
if (p->data[mi].sd->fd)
- clif_displaymessage(p->data[mi].sd->fd, msg_txt(284));
+ clif->displaymessage(p->data[mi].sd->fd, msg_txt(284));
p->party.member[tmi].leader = 1;
if (p->data[tmi].sd->fd)
- clif_displaymessage(p->data[tmi].sd->fd, msg_txt(285));
+ clif->displaymessage(p->data[tmi].sd->fd, msg_txt(285));
//Update info.
intif_party_leaderchange(p->party.party_id,p->party.member[tmi].account_id,p->party.member[tmi].char_id);
- clif_party_info(p,NULL);
+ clif->party_info(p,NULL);
return true;
}
@@ -714,7 +714,7 @@ int party_recv_movemap(int party_id,int account_id,int char_id, unsigned short m
//Check if they still exist on this map server
p->data[i].sd = party_sd_check(party_id, account_id, char_id);
- clif_party_info(p,NULL);
+ clif->party_info(p,NULL);
return 0;
}
@@ -732,9 +732,9 @@ void party_send_movemap(struct map_session_data *sd)
if(sd->state.connect_new) {
//Note that this works because this function is invoked before connect_new is cleared.
- clif_party_option(p,sd,0x100);
- clif_party_info(p,sd);
- clif_party_member_info(p,sd);
+ clif->party_option(p,sd,0x100);
+ clif->party_info(p,sd);
+ clif->party_member_info(p,sd);
}
if (sd->fd) { // synchronize minimap positions with the rest of the party
@@ -744,8 +744,8 @@ void party_send_movemap(struct map_session_data *sd)
p->data[i].sd != sd &&
p->data[i].sd->bl.m == sd->bl.m)
{
- clif_party_xy_single(sd->fd, p->data[i].sd);
- clif_party_xy_single(p->data[i].sd->fd, sd);
+ clif->party_xy_single(sd->fd, p->data[i].sd);
+ clif->party_xy_single(p->data[i].sd->fd, sd);
}
}
}
@@ -796,7 +796,7 @@ int party_recv_message(int party_id,int account_id,const char *mes,int len)
struct party_data *p;
if( (p=party_search(party_id))==NULL)
return 0;
- clif_party_message(p,account_id,mes,len);
+ clif->party_message(p,account_id,mes,len);
return 0;
}
@@ -874,13 +874,13 @@ int party_send_xy_timer(int tid, unsigned int tick, int id, intptr_t data)
if( p->data[i].x != sd->bl.x || p->data[i].y != sd->bl.y )
{// perform position update
- clif_party_xy(sd);
+ clif->party_xy(sd);
p->data[i].x = sd->bl.x;
p->data[i].y = sd->bl.y;
}
if (battle_config.party_hp_mode && p->data[i].hp != sd->battle_status.hp)
{// perform hp update
- clif_party_hp(sd);
+ clif->party_hp(sd);
p->data[i].hp = sd->battle_status.hp;
}
}
@@ -1014,7 +1014,7 @@ int party_share_loot(struct party_data* p, struct map_session_data* sd, struct i
}
if( p && battle_config.party_show_share_picker && battle_config.show_picker_item_type&(1<<itemdb_type(item_data->nameid)) )
- clif_party_show_picker(target, item_data);
+ clif->party_show_picker(target, item_data);
return 0;
}
@@ -1022,7 +1022,7 @@ int party_share_loot(struct party_data* p, struct map_session_data* sd, struct i
int party_send_dot_remove(struct map_session_data *sd)
{
if (sd->status.party_id)
- clif_party_xy_remove(sd);
+ clif->party_xy_remove(sd);
return 0;
}
@@ -1116,7 +1116,7 @@ void party_booking_register(struct map_session_data *sd, short level, short mapi
}
else
{// already registered
- clif_PartyBookingRegisterAck(sd, 2);
+ clif->PartyBookingRegisterAck(sd, 2);
return;
}
@@ -1130,8 +1130,8 @@ void party_booking_register(struct map_session_data *sd, short level, short mapi
pb_ad->p_detail.job[i] = job[i];
else pb_ad->p_detail.job[i] = -1;
- clif_PartyBookingRegisterAck(sd, 0);
- clif_PartyBookingInsertNotify(sd, pb_ad); // Notice
+ clif->PartyBookingRegisterAck(sd, 0);
+ clif->PartyBookingInsertNotify(sd, pb_ad); // Notice
}
void party_booking_update(struct map_session_data *sd, short* job)
@@ -1151,7 +1151,7 @@ void party_booking_update(struct map_session_data *sd, short* job)
pb_ad->p_detail.job[i] = job[i];
else pb_ad->p_detail.job[i] = -1;
- clif_PartyBookingUpdateNotify(sd, pb_ad);
+ clif->PartyBookingUpdateNotify(sd, pb_ad);
}
void party_booking_search(struct map_session_data *sd, short level, short mapid, short job, unsigned long lastindex, short resultcount)
@@ -1188,7 +1188,7 @@ void party_booking_search(struct map_session_data *sd, short level, short mapid,
}
}
dbi_destroy(iter);
- clif_PartyBookingSearchAck(sd->fd, result_list, count, more_result);
+ clif->PartyBookingSearchAck(sd->fd, result_list, count, more_result);
}
bool party_booking_delete(struct map_session_data *sd)
@@ -1197,7 +1197,7 @@ bool party_booking_delete(struct map_session_data *sd)
if((pb_ad = (struct party_booking_ad_info*)idb_get(party_booking_db, sd->status.char_id))!=NULL)
{
- clif_PartyBookingDeleteNotify(sd, pb_ad->index);
+ clif->PartyBookingDeleteNotify(sd, pb_ad->index);
idb_remove(party_booking_db,sd->status.char_id);
}
return true;
diff --git a/src/map/pc.c b/src/map/pc.c
index 1a77aae97..aac605d45 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -172,7 +172,7 @@ static int pc_spiritball_timer(int tid, unsigned int tick, int id, intptr_t data
memmove(sd->spirit_timer+i, sd->spirit_timer+i+1, (sd->spiritball-i)*sizeof(int));
sd->spirit_timer[sd->spiritball] = INVALID_TIMER;
- clif_spiritball(&sd->bl);
+ clif->spiritball(&sd->bl);
return 0;
}
@@ -205,9 +205,9 @@ int pc_addspiritball(struct map_session_data *sd,int interval,int max)
sd->spirit_timer[i] = tid;
sd->spiritball++;
if( (sd->class_&MAPID_THIRDMASK) == MAPID_ROYAL_GUARD )
- clif_millenniumshield(sd,sd->spiritball);
+ clif->millenniumshield(sd,sd->spiritball);
else
- clif_spiritball(&sd->bl);
+ clif->spiritball(&sd->bl);
return 0;
}
@@ -244,9 +244,9 @@ int pc_delspiritball(struct map_session_data *sd,int count,int type)
if(!type) {
if( (sd->class_&MAPID_THIRDMASK) == MAPID_ROYAL_GUARD )
- clif_millenniumshield(sd,sd->spiritball);
+ clif->millenniumshield(sd,sd->spiritball);
else
- clif_spiritball(&sd->bl);
+ clif->spiritball(&sd->bl);
}
return 0;
}
@@ -357,13 +357,13 @@ void pc_addfame(struct map_session_data *sd,int count)
sd->status.fame = MAX_FAME;
switch(sd->class_&MAPID_UPPERMASK){
case MAPID_BLACKSMITH: // Blacksmith
- clif_fame_blacksmith(sd,count);
+ clif->fame_blacksmith(sd,count);
break;
case MAPID_ALCHEMIST: // Alchemist
- clif_fame_alchemist(sd,count);
+ clif->fame_alchemist(sd,count);
break;
case MAPID_TAEKWON: // Taekwon
- clif_fame_taekwon(sd,count);
+ clif->fame_taekwon(sd,count);
break;
}
chrif_updatefamelist(sd);
@@ -463,11 +463,11 @@ void pc_inventory_rentals(struct map_session_data *sd)
&& sd->sc.option&OPTION_MOUNTING ) {
pc_setoption(sd, sd->sc.option&~OPTION_MOUNTING);
}
- clif_rental_expired(sd->fd, i, sd->status.inventory[i].nameid);
+ clif->rental_expired(sd->fd, i, sd->status.inventory[i].nameid);
pc_delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_OTHER);
} else {
expire_tick = (unsigned int)(sd->status.inventory[i].expire_time - time(NULL)) * 1000;
- clif_rental_time(sd->fd, sd->status.inventory[i].nameid, (int)(expire_tick / 1000));
+ clif->rental_time(sd->fd, sd->status.inventory[i].nameid, (int)(expire_tick / 1000));
next_tick = min(expire_tick, next_tick);
c++;
}
@@ -772,18 +772,18 @@ bool pc_can_Adopt(struct map_session_data *p1_sd, struct map_session_data *p2_sd
// Already adopted a baby
if( p1_sd->status.child || p2_sd->status.child ) {
- clif_Adopt_reply(p1_sd, 0);
+ clif->adopt_reply(p1_sd, 0);
return false;
}
// Parents need at least lvl 70 to adopt
if( p1_sd->status.base_level < 70 || p2_sd->status.base_level < 70 ) {
- clif_Adopt_reply(p1_sd, 1);
+ clif->adopt_reply(p1_sd, 1);
return false;
}
if( b_sd->status.partner_id ) {
- clif_Adopt_reply(p1_sd, 2);
+ clif->adopt_reply(p1_sd, 2);
return false;
}
@@ -818,9 +818,9 @@ bool pc_adoption(struct map_session_data *p1_sd, struct map_session_data *p2_sd,
// Restore progress
b_sd->status.job_level = joblevel;
- clif_updatestatus(b_sd, SP_JOBLEVEL);
+ clif->updatestatus(b_sd, SP_JOBLEVEL);
b_sd->status.job_exp = jobexp;
- clif_updatestatus(b_sd, SP_JOBEXP);
+ clif->updatestatus(b_sd, SP_JOBEXP);
// Baby Skills
pc_skill(b_sd, WE_BABY, 1, 0);
@@ -927,7 +927,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
memcpy(&sd->status, st, sizeof(*st));
if (st->sex != sd->status.sex) {
- clif_authfail_fd(sd->fd, 0);
+ clif->authfail_fd(sd->fd, 0);
return false;
}
@@ -1036,12 +1036,12 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
// try warping to a default map instead (church graveyard)
if (pc_setpos(sd, mapindex_name2id(MAP_PRONTERA), 273, 354, CLR_OUTSIGHT) != 0) {
// if we fail again
- clif_authfail_fd(sd->fd, 0);
+ clif->authfail_fd(sd->fd, 0);
return false;
}
}
- clif_authok(sd);
+ clif->authok(sd);
//Prevent S. Novices from getting the no-death bonus just yet. [Skotlex]
sd->die_counter=-1;
@@ -1054,7 +1054,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sd->status.name, sd->status.account_id, sd->status.char_id,
sd->packet_ver, CONVIP(ip), sd->group_id);
// Send friends list
- clif_friendslist_send(sd);
+ clif->friendslist_send(sd);
if( !changing_mapservers ) {
@@ -1068,28 +1068,28 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sprintf(buf,"SVN Revision: %s", svn);
else
sprintf(buf,"Unknown Version");
- clif_displaymessage(sd->fd, buf);
+ clif->displaymessage(sd->fd, buf);
}
// Message of the Day [Valaris]
for(i=0; motd_text[i][0] && i < MOTD_LINE_SIZE; i++) {
if (battle_config.motd_type)
- clif_disp_onlyself(sd,motd_text[i],strlen(motd_text[i]));
+ clif->disp_onlyself(sd,motd_text[i],strlen(motd_text[i]));
else
- clif_displaymessage(sd->fd, motd_text[i]);
+ clif->displaymessage(sd->fd, motd_text[i]);
}
// message of the limited time of the account
if (expiration_time != 0) { // don't display if it's unlimited or unknow value
char tmpstr[1024];
strftime(tmpstr, sizeof(tmpstr) - 1, msg_txt(501), localtime(&expiration_time)); // "Your account time limit is: %d-%m-%Y %H:%M:%S."
- clif_wis_message(sd->fd, wisp_server_name, tmpstr, strlen(tmpstr)+1);
+ clif->wis_message(sd->fd, wisp_server_name, tmpstr, strlen(tmpstr)+1);
}
/**
* Fixes login-without-aura glitch (the screen won't blink at this point, don't worry :P)
**/
- clif_changemap(sd,sd->mapindex,sd->bl.x,sd->bl.y);
+ clif->changemap(sd,sd->mapindex,sd->bl.x,sd->bl.y);
}
/**
@@ -1112,7 +1112,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
*------------------------------------------*/
void pc_authfail(struct map_session_data *sd)
{
- clif_authfail_fd(sd->fd, 0);
+ clif->authfail_fd(sd->fd, 0);
return;
}
@@ -1124,7 +1124,7 @@ int pc_set_hate_mob(struct map_session_data *sd, int pos, struct block_list *bl)
return 0;
if (sd->hate_mob[pos] != -1)
{ //Can't change hate targets.
- clif_hate_info(sd, pos, sd->hate_mob[pos], 0); //Display current
+ clif->hate_info(sd, pos, sd->hate_mob[pos], 0); //Display current
return 0;
}
@@ -1138,7 +1138,7 @@ int pc_set_hate_mob(struct map_session_data *sd, int pos, struct block_list *bl)
}
sd->hate_mob[pos] = class_;
pc_setglobalreg(sd,sg_info[pos].hate_var,class_+1);
- clif_hate_info(sd, pos, class_, 1);
+ clif->hate_info(sd, pos, class_, 1);
return 1;
}
@@ -1237,7 +1237,7 @@ int pc_reg_received(struct map_session_data *sd)
if (sd->state.connect_new == 0 && sd->fd)
{ //Character already loaded map! Gotta trigger LoadEndAck manually.
sd->state.connect_new = 1;
- clif_parse_LoadEndAck(sd->fd, sd);
+ clif->LoadEndAck(sd->fd, sd);
}
pc_inventory_rentals(sd);
@@ -1664,7 +1664,7 @@ int pc_disguise(struct map_session_data *sd, int class_)
if (sd->bl.prev != NULL) {
pc_stop_walking(sd, 0);
- clif_clearunit_area(&sd->bl, CLR_OUTSIGHT);
+ clif->clearunit_area(&sd->bl, CLR_OUTSIGHT);
}
if (!class_) {
@@ -1674,14 +1674,14 @@ int pc_disguise(struct map_session_data *sd, int class_)
sd->disguise=class_;
status_set_viewdata(&sd->bl, class_);
- clif_changeoption(&sd->bl);
+ clif->changeoption(&sd->bl);
if (sd->bl.prev != NULL) {
- clif_spawn(&sd->bl);
+ clif->spawn(&sd->bl);
if (class_ == sd->status.class_ && pc_iscarton(sd))
{ //It seems the cart info is lost on undisguise.
- clif_cartlist(sd);
- clif_updatestatus(sd,SP_CARTINFO);
+ clif->cartlist(sd);
+ clif->updatestatus(sd,SP_CARTINFO);
}
}
return 1;
@@ -2425,7 +2425,7 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
case SP_INTRAVISION: // Maya Purple Card effect allowing to see Hiding/Cloaking people [DracoRPG]
if(sd->state.lr_flag != 2) {
sd->special_state.intravision = 1;
- clif_status_load(&sd->bl, SI_INTRAVISION, 1);
+ clif->status_change(&sd->bl, SI_INTRAVISION, 1, 0, 0, 0, 0);
}
break;
case SP_NO_KNOCKBACK:
@@ -3466,10 +3466,10 @@ int pc_skill(TBL_PC* sd, int id, int level, int flag)
if( level == 0 ) //Remove skill.
{
sd->status.skill[id].id = 0;
- clif_deleteskill(sd,id);
+ clif->deleteskill(sd,id);
}
else
- clif_addskill(sd,id);
+ clif->addskill(sd,id);
if( !skill->get_inf(id) ) //Only recalculate for passive skills.
status_calc_pc(sd, 0);
break;
@@ -3542,14 +3542,14 @@ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
if( pc_delitem(sd,idx_card,1,1,0,LOG_TYPE_OTHER) == 1 )
{// failed
- clif_insert_card(sd,idx_equip,idx_card,1);
+ clif->insert_card(sd,idx_equip,idx_card,1);
}
else
{// success
log_pick_pc(sd, LOG_TYPE_OTHER, -1, &sd->status.inventory[idx_equip]);
sd->status.inventory[idx_equip].card[i] = nameid;
log_pick_pc(sd, LOG_TYPE_OTHER, 1, &sd->status.inventory[idx_equip]);
- clif_insert_card(sd,idx_equip,idx_card,0);
+ clif->insert_card(sd,idx_equip,idx_card,0);
}
return 0;
@@ -3664,14 +3664,14 @@ int pc_payzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type,
return 1; //Not enough.
sd->status.zeny -= zeny;
- clif_updatestatus(sd,SP_ZENY);
+ clif->updatestatus(sd,SP_ZENY);
if(!tsd) tsd = sd;
log_zeny(sd, type, tsd, -zeny);
if( zeny > 0 && sd->state.showzeny ) {
char output[255];
sprintf(output, "Removed %dz.", zeny);
- clif_disp_onlyself(sd,output,strlen(output));
+ clif->disp_onlyself(sd,output,strlen(output));
}
return 0;
@@ -3713,7 +3713,7 @@ int pc_paycash(struct map_session_data *sd, int price, int points)
{
char output[128];
sprintf(output, msg_txt(504), points, cash, sd->kafraPoints, sd->cashPoints);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif->disp_onlyself(sd, output, strlen(output));
}
return cash+points;
}
@@ -3738,7 +3738,7 @@ int pc_getcash(struct map_session_data *sd, int cash, int points)
if( battle_config.cashshop_show_points )
{
sprintf(output, msg_txt(505), cash, sd->cashPoints);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif->disp_onlyself(sd, output, strlen(output));
}
return cash;
}
@@ -3761,7 +3761,7 @@ int pc_getcash(struct map_session_data *sd, int cash, int points)
if( battle_config.cashshop_show_points )
{
sprintf(output, msg_txt(506), points, sd->kafraPoints);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif->disp_onlyself(sd, output, strlen(output));
}
return points;
}
@@ -3792,14 +3792,14 @@ int pc_getzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type,
zeny = MAX_ZENY - sd->status.zeny;
sd->status.zeny += zeny;
- clif_updatestatus(sd,SP_ZENY);
+ clif->updatestatus(sd,SP_ZENY);
if(!tsd) tsd = sd;
log_zeny(sd, type, tsd, zeny);
if( zeny > 0 && sd->state.showzeny ) {
char output[255];
sprintf(output, "Gained %dz.", zeny);
- clif_disp_onlyself(sd,output,strlen(output));
+ clif->disp_onlyself(sd,output,strlen(output));
}
return 0;
@@ -3865,7 +3865,7 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
if( amount > MAX_AMOUNT - sd->status.inventory[i].amount || ( data->stack.inventory && amount > data->stack.amount - sd->status.inventory[i].amount ) )
return 5;
sd->status.inventory[i].amount += amount;
- clif_additem(sd,i,amount,0);
+ clif->additem(sd,i,amount,0);
break;
}
}
@@ -3884,7 +3884,7 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
sd->status.inventory[i].amount = amount;
sd->inventory_data[i] = data;
- clif_additem(sd,i,amount,0);
+ clif->additem(sd,i,amount,0);
}
#ifdef NSI_UNIQUE_ID
if( !itemdb_isstackable2(data) && !item_data->unique_id )
@@ -3893,7 +3893,7 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
log_pick_pc(sd, log_type, amount, &sd->status.inventory[i]);
sd->weight += w;
- clif_updatestatus(sd,SP_WEIGHT);
+ clif->updatestatus(sd,SP_WEIGHT);
//Auto-equip
if(data->flag.autoequip)
pc_equipitem(sd, i, data->equip);
@@ -3901,11 +3901,11 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
/* rental item check */
if( item_data->expire_time ) {
if( time(NULL) > item_data->expire_time ) {
- clif_rental_expired(sd->fd, i, sd->status.inventory[i].nameid);
+ clif->rental_expired(sd->fd, i, sd->status.inventory[i].nameid);
pc_delitem(sd, i, sd->status.inventory[i].amount, 1, 0, LOG_TYPE_OTHER);
} else {
int seconds = (int)( item_data->expire_time - time(NULL) );
- clif_rental_time(sd->fd, sd->status.inventory[i].nameid, seconds);
+ clif->rental_time(sd->fd, sd->status.inventory[i].nameid, seconds);
pc_inventory_rental_add(sd, seconds);
}
}
@@ -3941,9 +3941,9 @@ int pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reas
sd->inventory_data[n] = NULL;
}
if(!(type&1))
- clif_delitem(sd,n,amount,reason);
+ clif->delitem(sd,n,amount,reason);
if(!(type&2))
- clif_updatestatus(sd,SP_WEIGHT);
+ clif->updatestatus(sd,SP_WEIGHT);
return 0;
}
@@ -3974,13 +3974,13 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount)
if( map[sd->bl.m].flag.nodrop )
{
- clif_displaymessage (sd->fd, msg_txt(271));
+ clif->displaymessage (sd->fd, msg_txt(271));
return 0; //Can't drop items in nodrop mapflag maps.
}
if( !pc_candrop(sd,&sd->status.inventory[n]) )
{
- clif_displaymessage (sd->fd, msg_txt(263));
+ clif->displaymessage (sd->fd, msg_txt(263));
return 0;
}
@@ -3988,7 +3988,7 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount)
return 0;
pc_delitem(sd, n, amount, 1, 0, LOG_TYPE_PICKDROP_PLAYER);
- clif_dropitem(sd, n, amount);
+ clif->dropitem(sd, n, amount);
return 1;
}
@@ -4052,13 +4052,13 @@ int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem)
//This function takes care of giving the item to whoever should have it, considering party-share options.
if ((flag = party_share_loot(p,sd,&fitem->item_data, fitem->first_get_charid))) {
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
return 1;
}
//Display pickup animation.
pc_stop_attack(sd);
- clif_takeitem(&sd->bl,&fitem->bl);
+ clif->takeitem(&sd->bl,&fitem->bl);
map_clearflooritem(&fitem->bl);
return 1;
}
@@ -4100,7 +4100,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
case 12212: // Giant Fly Wing
if( map[sd->bl.m].flag.noteleport || map_flag_gvg(sd->bl.m) )
{
- clif_skill_teleportmessage(sd,0);
+ clif->skill_teleportmessage(sd,0);
return 0;
}
case 602: // ButterFly Wing
@@ -4113,7 +4113,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
case 14591: // Siege Teleport Scroll
if( sd->duel_group && !battle_config.duel_allow_teleport )
{
- clif_displaymessage(sd->fd, msg_txt(663));
+ clif->displaymessage(sd->fd, msg_txt(663));
return 0;
}
if( nameid != 601 && nameid != 12212 && map[sd->bl.m].flag.noreturn )
@@ -4233,9 +4233,9 @@ int pc_useitem(struct map_session_data *sd,int n)
nullpo_ret(sd);
if( sd->npc_id ){
- /* TODO: add to clif_messages enum */
+ /* TODO: add to clif->messages enum */
#ifdef RENEWAL
- clif_msg(sd, 0x783); // TODO look for the client date that has this message.
+ clif->msg(sd, 0x783); // TODO look for the client date that has this message.
#endif
return 0;
}
@@ -4302,7 +4302,7 @@ int pc_useitem(struct map_session_data *sd,int n)
sprintf(e_msg,"Item Failed. [%s] is cooling down. wait %d seconds.",
itemdb_jname(sd->status.inventory[n].nameid),
e_tick+1);
- clif_colormes(sd,COLOR_RED,e_msg);
+ clif->colormes(sd,COLOR_RED,e_msg);
return 0; // Delay has not expired yet
}
} else {// not yet used item (all slots are initially empty)
@@ -4325,7 +4325,7 @@ int pc_useitem(struct map_session_data *sd,int n)
for(i = 0; i < map[sd->bl.m].zone->disabled_items_count; i++) {
if( map[sd->bl.m].zone->disabled_items[i] == nameid ) {
if( battle_config.item_restricted_consumption_type ) {
- clif_useitemack(sd,n,sd->status.inventory[n].amount-1,true);
+ clif->useitemack(sd,n,sd->status.inventory[n].amount-1,true);
pc_delitem(sd,n,1,1,0,LOG_TYPE_CONSUME);
}
return 0;
@@ -4341,13 +4341,13 @@ int pc_useitem(struct map_session_data *sd,int n)
script = sd->inventory_data[n]->script;
//Check if the item is to be consumed immediately [Skotlex]
if( sd->inventory_data[n]->flag.delay_consume )
- clif_useitemack(sd,n,amount,true);
+ clif->useitemack(sd,n,amount,true);
else {
if( sd->status.inventory[n].expire_time == 0 ) {
- clif_useitemack(sd,n,amount-1,true);
+ clif->useitemack(sd,n,amount-1,true);
pc_delitem(sd,n,1,1,0,LOG_TYPE_CONSUME); // Rental Usable Items are not deleted until expiration
} else
- clif_useitemack(sd,n,0,false);
+ clif->useitemack(sd,n,0,false);
}
if(sd->status.inventory[n].card[0]==CARD0_CREATE &&
pc_famerank(MakeDWord(sd->status.inventory[n].card[2],sd->status.inventory[n].card[3]), MAPID_ALCHEMIST))
@@ -4392,7 +4392,7 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
if( !itemdb_cancartstore(item_data, pc_get_group_level(sd)) )
{ // Check item trade restrictions [Skotlex]
- clif_displaymessage (sd->fd, msg_txt(264));
+ clif->displaymessage (sd->fd, msg_txt(264));
return 1;
}
@@ -4414,7 +4414,7 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
return 1; // no room
sd->status.cart[i].amount+=amount;
- clif_cart_additem(sd,i,amount,0);
+ clif->cart_additem(sd,i,amount,0);
}
else
{// item not stackable or not present, add it
@@ -4425,13 +4425,13 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
memcpy(&sd->status.cart[i],item_data,sizeof(sd->status.cart[0]));
sd->status.cart[i].amount=amount;
sd->cart_num++;
- clif_cart_additem(sd,i,amount,0);
+ clif->cart_additem(sd,i,amount,0);
}
sd->status.cart[i].favorite = 0;/* clear */
log_pick_pc(sd, log_type, amount, &sd->status.cart[i]);
sd->cart_weight += w;
- clif_updatestatus(sd,SP_CARTINFO);
+ clif->updatestatus(sd,SP_CARTINFO);
return 0;
}
@@ -4459,8 +4459,8 @@ int pc_cart_delitem(struct map_session_data *sd,int n,int amount,int type,e_log_
sd->cart_num--;
}
if(!type) {
- clif_cart_delitem(sd,n,amount);
- clif_updatestatus(sd,SP_CARTINFO);
+ clif->cart_delitem(sd,n,amount);
+ clif->updatestatus(sd,SP_CARTINFO);
}
return 0;
@@ -4534,7 +4534,7 @@ int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount)
if((flag = pc_additem(sd,item_data,amount,LOG_TYPE_NONE)) == 0)
return pc_cart_delitem(sd,idx,amount,0,LOG_TYPE_NONE);
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
return 1;
}
@@ -4556,7 +4556,7 @@ int pc_show_steal(struct block_list *bl,va_list ap)
sprintf(output,"%s stole an Unknown Item (id: %i).",sd->status.name, itemid);
else
sprintf(output,"%s stole %s.",sd->status.name,item->jname);
- clif_displaymessage( ((struct map_session_data *)bl)->fd, output);
+ clif->displaymessage( ((struct map_session_data *)bl)->fd, output);
return 0;
}
@@ -4620,7 +4620,7 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil
md->state.steal_flag = UCHAR_MAX; //you can't steal from this mob any more
if(flag) { //Failed to steal due to overweight
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
return 0;
}
@@ -4754,7 +4754,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
sd->regen.state.gc = 0;
// make sure vending is allowed here
if (sd->state.vending && map[m].flag.novending) {
- clif_displaymessage (sd->fd, msg_txt(276)); // "You can't open a shop on this map"
+ clif->displaymessage (sd->fd, msg_txt(276)); // "You can't open a shop on this map"
vending_closevending(sd);
}
}
@@ -4800,13 +4800,13 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
}
if (sd->state.vending && map_getcell(m,x,y,CELL_CHKNOVENDING)) {
- clif_displaymessage (sd->fd, msg_txt(204)); // "You can't open a shop on this cell."
+ clif->displaymessage (sd->fd, msg_txt(204)); // "You can't open a shop on this cell."
vending_closevending(sd);
}
if(sd->bl.prev != NULL){
unit_remove_map_pc(sd,clrtype);
- clif_changemap(sd,map[m].index,x,y); // [MouseJstr]
+ clif->changemap(sd,map[m].index,x,y); // [MouseJstr]
} else if(sd->state.active)
//Tag player for rewarping after map-loading is done. [Skotlex]
sd->state.rewarp = 1;
@@ -4892,7 +4892,7 @@ int pc_memo(struct map_session_data* sd, int pos)
// check mapflags
if( sd->bl.m >= 0 && (map[sd->bl.m].flag.nomemo || map[sd->bl.m].flag.nowarpto) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE) ) {
- clif_skill_teleportmessage(sd, 1); // "Saved point cannot be memorized."
+ clif->skill_teleportmessage(sd, 1); // "Saved point cannot be memorized."
return 0;
}
@@ -4903,11 +4903,11 @@ int pc_memo(struct map_session_data* sd, int pos)
// check required skill level
skill = pc_checkskill(sd, AL_WARP);
if( skill < 1 ) {
- clif_skill_memomessage(sd,2); // "You haven't learned Warp."
+ clif->skill_memomessage(sd,2); // "You haven't learned Warp."
return 0;
}
if( skill < 2 || skill - 2 < pos ) {
- clif_skill_memomessage(sd,1); // "Skill Level is not high enough."
+ clif->skill_memomessage(sd,1); // "Skill Level is not high enough."
return 0;
}
@@ -4924,7 +4924,7 @@ int pc_memo(struct map_session_data* sd, int pos)
sd->status.memo_point[pos].x = sd->bl.x;
sd->status.memo_point[pos].y = sd->bl.y;
- clif_skill_memomessage(sd, 0);
+ clif->skill_memomessage(sd, 0);
return 1;
}
@@ -5618,10 +5618,10 @@ int pc_checkbaselevelup(struct map_session_data *sd) {
if (battle_config.pet_lv_rate && sd->pd) //<Skotlex> update pet's level
status_calc_pet(sd->pd,0);
- clif_updatestatus(sd,SP_STATUSPOINT);
- clif_updatestatus(sd,SP_BASELEVEL);
- clif_updatestatus(sd,SP_BASEEXP);
- clif_updatestatus(sd,SP_NEXTBASEEXP);
+ clif->updatestatus(sd,SP_STATUSPOINT);
+ clif->updatestatus(sd,SP_BASELEVEL);
+ clif->updatestatus(sd,SP_BASEEXP);
+ clif->updatestatus(sd,SP_NEXTBASEEXP);
status_calc_pc(sd,0);
status_percent_heal(&sd->bl,100,100);
@@ -5637,7 +5637,7 @@ int pc_checkbaselevelup(struct map_session_data *sd) {
sc_start(&sd->bl,status_skill2sc(AL_INCAGI),100,10,600000);
sc_start(&sd->bl,status_skill2sc(AL_BLESSING),100,10,600000);
}
- clif_misceffect(&sd->bl,0);
+ clif->misceffect(&sd->bl,0);
npc_script_event(sd, NPCE_BASELVUP); //LORDALFA - LVLUPEVENT
if(sd->status.party_id)
@@ -5678,14 +5678,14 @@ int pc_checkjoblevelup(struct map_session_data *sd)
} while ((next=pc_nextjobexp(sd)) > 0 && sd->status.job_exp >= next);
- clif_updatestatus(sd,SP_JOBLEVEL);
- clif_updatestatus(sd,SP_JOBEXP);
- clif_updatestatus(sd,SP_NEXTJOBEXP);
- clif_updatestatus(sd,SP_SKILLPOINT);
+ clif->updatestatus(sd,SP_JOBLEVEL);
+ clif->updatestatus(sd,SP_JOBEXP);
+ clif->updatestatus(sd,SP_NEXTJOBEXP);
+ clif->updatestatus(sd,SP_SKILLPOINT);
status_calc_pc(sd,0);
- clif_misceffect(&sd->bl,1);
+ clif->misceffect(&sd->bl,1);
if (pc_checkskill(sd, SG_DEVIL) && !pc_nextjobexp(sd))
- clif_status_change(&sd->bl,SI_DEVIL, 1, 0, 0, 0, 1); //Permanent blind effect from SG_DEVIL.
+ clif->status_change(&sd->bl,SI_DEVIL, 1, 0, 0, 0, 1); //Permanent blind effect from SG_DEVIL.
npc_script_event(sd, NPCE_JOBLVUP);
return 1;
@@ -5772,7 +5772,7 @@ int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int
else
sd->status.base_exp += base_exp;
pc_checkbaselevelup(sd);
- clif_updatestatus(sd,SP_BASEEXP);
+ clif->updatestatus(sd,SP_BASEEXP);
}
if (job_exp) {
@@ -5782,18 +5782,18 @@ int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int
else
sd->status.job_exp += job_exp;
pc_checkjoblevelup(sd);
- clif_updatestatus(sd,SP_JOBEXP);
+ clif->updatestatus(sd,SP_JOBEXP);
}
if(base_exp)
- clif_displayexp(sd, base_exp, SP_BASEEXP, quest);
+ clif->displayexp(sd, base_exp, SP_BASEEXP, quest);
if(job_exp)
- clif_displayexp(sd, job_exp, SP_JOBEXP, quest);
+ clif->displayexp(sd, job_exp, SP_JOBEXP, quest);
if(sd->state.showexp) {
char output[256];
sprintf(output,
"Experience Gained Base:%u (%.2f%%) Job:%u (%.2f%%)",base_exp,nextbp*(float)100,job_exp,nextjp*(float)100);
- clif_disp_onlyself(sd,output,strlen(output));
+ clif->disp_onlyself(sd,output,strlen(output));
}
return 1;
@@ -5953,7 +5953,7 @@ int pc_statusup(struct map_session_data* sd, int type)
need = pc_need_status_point(sd,type,1);
if( type < SP_STR || type > SP_LUK || need < 0 || need > sd->status.status_point )
{
- clif_statusupack(sd,type,0,0);
+ clif->statusupack(sd,type,0,0);
return 1;
}
@@ -5961,7 +5961,7 @@ int pc_statusup(struct map_session_data* sd, int type)
max = pc_maxparameter(sd);
if( pc_getstat(sd,type) >= max )
{
- clif_statusupack(sd,type,0,0);
+ clif->statusupack(sd,type,0,0);
return 1;
}
@@ -5973,15 +5973,15 @@ int pc_statusup(struct map_session_data* sd, int type)
// update increase cost indicator
if( need != pc_need_status_point(sd,type,1) )
- clif_updatestatus(sd, SP_USTR + type-SP_STR);
+ clif->updatestatus(sd, SP_USTR + type-SP_STR);
// update statpoint count
- clif_updatestatus(sd,SP_STATUSPOINT);
+ clif->updatestatus(sd,SP_STATUSPOINT);
// update stat value
- clif_statusupack(sd,type,1,val); // required
+ clif->statusupack(sd,type,1,val); // required
if( val > 255 )
- clif_updatestatus(sd,type); // send after the 'ack' to override the truncated value
+ clif->updatestatus(sd,type); // send after the 'ack' to override the truncated value
return 0;
}
@@ -5999,7 +5999,7 @@ int pc_statusup2(struct map_session_data* sd, int type, int val)
if( type < SP_STR || type > SP_LUK )
{
- clif_statusupack(sd,type,0,0);
+ clif->statusupack(sd,type,0,0);
return 1;
}
@@ -6013,12 +6013,12 @@ int pc_statusup2(struct map_session_data* sd, int type, int val)
// update increase cost indicator
if( need != pc_need_status_point(sd,type,1) )
- clif_updatestatus(sd, SP_USTR + type-SP_STR);
+ clif->updatestatus(sd, SP_USTR + type-SP_STR);
// update stat value
- clif_statusupack(sd,type,1,val); // required
+ clif->statusupack(sd,type,1,val); // required
if( val > 255 )
- clif_updatestatus(sd,type); // send after the 'ack' to override the truncated value
+ clif->updatestatus(sd,type); // send after the 'ack' to override the truncated value
return 0;
}
@@ -6060,12 +6060,12 @@ int pc_skillup(struct map_session_data *sd,uint16 skill_id)
else
pc_check_skilltree(sd, skill_id); // Check if a new skill can Lvlup
- clif_skillup(sd,skill_id);
- clif_updatestatus(sd,SP_SKILLPOINT);
+ clif->skillup(sd,skill_id);
+ clif->updatestatus(sd,SP_SKILLPOINT);
if( skill_id == GN_REMODELING_CART ) /* cart weight info was updated by status_calc_pc */
- clif_updatestatus(sd,SP_CARTINFO);
+ clif->updatestatus(sd,SP_CARTINFO);
if (!pc_has_permission(sd, PC_PERM_ALL_SKILL)) // may skill everything at any time anyways, and this would cause a huge slowdown
- clif_skillinfoblock(sd);
+ clif->skillinfoblock(sd);
}
return 0;
@@ -6122,7 +6122,7 @@ int pc_allskillup(struct map_session_data *sd)
status_calc_pc(sd,0);
//Required because if you could level up all skills previously,
//the update will not be sent as only the lv variable changes.
- clif_skillinfoblock(sd);
+ clif->skillinfoblock(sd);
return 0;
}
@@ -6177,28 +6177,28 @@ int pc_resetlvl(struct map_session_data* sd,int type)
sd->status.job_exp=0;
}
- clif_updatestatus(sd,SP_STATUSPOINT);
- clif_updatestatus(sd,SP_STR);
- clif_updatestatus(sd,SP_AGI);
- clif_updatestatus(sd,SP_VIT);
- clif_updatestatus(sd,SP_INT);
- clif_updatestatus(sd,SP_DEX);
- clif_updatestatus(sd,SP_LUK);
- clif_updatestatus(sd,SP_BASELEVEL);
- clif_updatestatus(sd,SP_JOBLEVEL);
- clif_updatestatus(sd,SP_STATUSPOINT);
- clif_updatestatus(sd,SP_BASEEXP);
- clif_updatestatus(sd,SP_JOBEXP);
- clif_updatestatus(sd,SP_NEXTBASEEXP);
- clif_updatestatus(sd,SP_NEXTJOBEXP);
- clif_updatestatus(sd,SP_SKILLPOINT);
-
- clif_updatestatus(sd,SP_USTR); // Updates needed stat points - Valaris
- clif_updatestatus(sd,SP_UAGI);
- clif_updatestatus(sd,SP_UVIT);
- clif_updatestatus(sd,SP_UINT);
- clif_updatestatus(sd,SP_UDEX);
- clif_updatestatus(sd,SP_ULUK); // End Addition
+ clif->updatestatus(sd,SP_STATUSPOINT);
+ clif->updatestatus(sd,SP_STR);
+ clif->updatestatus(sd,SP_AGI);
+ clif->updatestatus(sd,SP_VIT);
+ clif->updatestatus(sd,SP_INT);
+ clif->updatestatus(sd,SP_DEX);
+ clif->updatestatus(sd,SP_LUK);
+ clif->updatestatus(sd,SP_BASELEVEL);
+ clif->updatestatus(sd,SP_JOBLEVEL);
+ clif->updatestatus(sd,SP_STATUSPOINT);
+ clif->updatestatus(sd,SP_BASEEXP);
+ clif->updatestatus(sd,SP_JOBEXP);
+ clif->updatestatus(sd,SP_NEXTBASEEXP);
+ clif->updatestatus(sd,SP_NEXTJOBEXP);
+ clif->updatestatus(sd,SP_SKILLPOINT);
+
+ clif->updatestatus(sd,SP_USTR); // Updates needed stat points - Valaris
+ clif->updatestatus(sd,SP_UAGI);
+ clif->updatestatus(sd,SP_UVIT);
+ clif->updatestatus(sd,SP_UINT);
+ clif->updatestatus(sd,SP_UDEX);
+ clif->updatestatus(sd,SP_ULUK); // End Addition
for(i=0;i<EQI_MAX;i++) { // unequip items that can't be equipped by base 1 [Valaris]
if(sd->equip_index[i] >= 0)
@@ -6210,7 +6210,7 @@ int pc_resetlvl(struct map_session_data* sd,int type)
party_send_levelup(sd);
status_calc_pc(sd,0);
- clif_skillinfoblock(sd);
+ clif->skillinfoblock(sd);
return 0;
}
@@ -6252,21 +6252,21 @@ int pc_resetstate(struct map_session_data* sd)
pc_setstat(sd, SP_DEX, 1);
pc_setstat(sd, SP_LUK, 1);
- clif_updatestatus(sd,SP_STR);
- clif_updatestatus(sd,SP_AGI);
- clif_updatestatus(sd,SP_VIT);
- clif_updatestatus(sd,SP_INT);
- clif_updatestatus(sd,SP_DEX);
- clif_updatestatus(sd,SP_LUK);
+ clif->updatestatus(sd,SP_STR);
+ clif->updatestatus(sd,SP_AGI);
+ clif->updatestatus(sd,SP_VIT);
+ clif->updatestatus(sd,SP_INT);
+ clif->updatestatus(sd,SP_DEX);
+ clif->updatestatus(sd,SP_LUK);
- clif_updatestatus(sd,SP_USTR); // Updates needed stat points - Valaris
- clif_updatestatus(sd,SP_UAGI);
- clif_updatestatus(sd,SP_UVIT);
- clif_updatestatus(sd,SP_UINT);
- clif_updatestatus(sd,SP_UDEX);
- clif_updatestatus(sd,SP_ULUK); // End Addition
+ clif->updatestatus(sd,SP_USTR); // Updates needed stat points - Valaris
+ clif->updatestatus(sd,SP_UAGI);
+ clif->updatestatus(sd,SP_UVIT);
+ clif->updatestatus(sd,SP_UINT);
+ clif->updatestatus(sd,SP_UDEX);
+ clif->updatestatus(sd,SP_ULUK); // End Addition
- clif_updatestatus(sd,SP_STATUSPOINT);
+ clif->updatestatus(sd,SP_STATUSPOINT);
if( sd->mission_mobid ) { //bugreport:2200
sd->mission_mobid = 0;
@@ -6302,7 +6302,7 @@ int pc_resetskill(struct map_session_data* sd, int flag)
return 0;
if( pc_checkskill(sd, SG_DEVIL) && !pc_nextjobexp(sd) )
- clif_status_load(&sd->bl, SI_DEVIL, 0); //Remove perma blindness due to skill-reset. [Skotlex]
+ clif->status_change(&sd->bl, SI_DEVIL, 0, 0, 0, 0, 0); //Remove perma blindness due to skill-reset. [Skotlex]
i = sd->sc.option;
if( i&OPTION_RIDING && pc_checkskill(sd, KN_RIDING) )
i &= ~OPTION_RIDING;
@@ -6388,8 +6388,8 @@ int pc_resetskill(struct map_session_data* sd, int flag)
if( flag&1 )
{
- clif_updatestatus(sd,SP_SKILLPOINT);
- clif_skillinfoblock(sd);
+ clif->updatestatus(sd,SP_SKILLPOINT);
+ clif->skillinfoblock(sd);
status_calc_pc(sd,0);
}
@@ -6483,7 +6483,7 @@ void pc_respawn(struct map_session_data* sd, clr_type clrtype)
pc_setstand(sd);
pc_setrestartvalue(sd,3);
if( pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, clrtype) )
- clif_resurrection(&sd->bl, 1); //If warping fails, send a normal stand up packet.
+ clif->resurrection(&sd->bl, 1); //If warping fails, send a normal stand up packet.
}
static int pc_respawn_timer(int tid, unsigned int tick, int id, intptr_t data)
@@ -6503,8 +6503,8 @@ static int pc_respawn_timer(int tid, unsigned int tick, int id, intptr_t data)
*------------------------------------------*/
void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int hp, unsigned int sp)
{
- if (sp) clif_updatestatus(sd,SP_SP);
- if (hp) clif_updatestatus(sd,SP_HP);
+ if (sp) clif->updatestatus(sd,SP_SP);
+ if (hp) clif->updatestatus(sd,SP_HP);
else return;
if( !src || src == &sd->bl )
@@ -6516,7 +6516,7 @@ void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int h
}
if( sd->progressbar.npc_id )
- clif_progressbar_abort(sd);
+ clif->progressbar_abort(sd);
if( sd->status.pet_id > 0 && sd->pd && battle_config.pet_damage_support )
pet_target_check(sd,src,1);
@@ -6549,7 +6549,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
pet_set_intimate(pd, pd->pet.intimate - pd->petDB->die);
if( pd->pet.intimate < 0 )
pd->pet.intimate = 0;
- clif_send_petdata(sd,sd->pd,1,pd->pet.intimate);
+ clif->send_petdata(sd,sd->pd,1,pd->pet.intimate);
}
if( sd->pd->target_id ) // Unlock all targets...
pet_unlocktarget(sd->pd);
@@ -6587,7 +6587,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
if (sd->npc_id)
{
if (sd->state.using_fake_npc) {
- clif_clearunit_single(sd->npc_id, CLR_OUTSIGHT, sd->fd);
+ clif->clearunit_single(sd->npc_id, CLR_OUTSIGHT, sd->fd);
sd->state.using_fake_npc = 0;
}
if (sd->state.menu_or_input)
@@ -6604,7 +6604,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
/* e.g. not killed thru pc_damage */
if( pc_issit(sd) ) {
- clif_status_load(&sd->bl,SI_SIT,0);
+ clif->status_change(&sd->bl, SI_SIT, 0, 0, 0, 0, 0);
}
pc_setdead(sd);
@@ -6633,14 +6633,14 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
(unsigned int)md->level < pc_maxbaselv(sd) &&
!md->guardian_data && !md->special_state.ai// Guardians/summons should not level. [Skotlex]
) { // monster level up [Valaris]
- clif_misceffect(&md->bl,0);
+ clif->misceffect(&md->bl,0);
md->level++;
status_calc_mob(md, 0);
status_percent_heal(src,10,0);
if( battle_config.show_mob_info&4 )
{// update name with new level
- clif_charnameack(0, &md->bl);
+ clif->charnameack(0, &md->bl);
}
}
src = battle->get_master(src); // Maybe Player Summon
@@ -6716,7 +6716,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
sd->state.snovice_dead_flag = 1;
pc_setstand(sd);
status_percent_heal(&sd->bl, 100, 100);
- clif_resurrection(&sd->bl, 1);
+ clif->resurrection(&sd->bl, 1);
if(battle_config.pc_invincible_time)
pc_setinvincibletimer(sd, battle_config.pc_invincible_time);
sc_start(&sd->bl,status_skill2sc(MO_STEELBODY),100,1,skill->get_time(MO_STEELBODY,1));
@@ -6746,7 +6746,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
if (battle_config.pk_mode && src && src->type==BL_PC)
base_penalty*=2;
sd->status.base_exp -= min(sd->status.base_exp, base_penalty);
- clif_updatestatus(sd,SP_BASEEXP);
+ clif->updatestatus(sd,SP_BASEEXP);
}
}
if(battle_config.death_penalty_job > 0)
@@ -6764,7 +6764,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
if (battle_config.pk_mode && src && src->type==BL_PC)
base_penalty*=2;
sd->status.job_exp -= min(sd->status.job_exp, base_penalty);
- clif_updatestatus(sd,SP_JOBEXP);
+ clif->updatestatus(sd,SP_JOBEXP);
}
}
if(battle_config.zeny_penalty > 0 && !map[sd->bl.m].flag.nozenypenalty)
@@ -6866,8 +6866,8 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
}
void pc_revive(struct map_session_data *sd,unsigned int hp, unsigned int sp) {
- if(hp) clif_updatestatus(sd,SP_HP);
- if(sp) clif_updatestatus(sd,SP_SP);
+ if(hp) clif->updatestatus(sd,SP_HP);
+ if(sp) clif->updatestatus(sd,SP_SP);
pc_setstand(sd);
if(battle_config.pc_invincible_time > 0)
@@ -7051,10 +7051,10 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
}
sd->status.base_level = (unsigned int)val;
sd->status.base_exp = 0;
- // clif_updatestatus(sd, SP_BASELEVEL); // Gets updated at the bottom
- clif_updatestatus(sd, SP_NEXTBASEEXP);
- clif_updatestatus(sd, SP_STATUSPOINT);
- clif_updatestatus(sd, SP_BASEEXP);
+ // clif->updatestatus(sd, SP_BASELEVEL); // Gets updated at the bottom
+ clif->updatestatus(sd, SP_NEXTBASEEXP);
+ clif->updatestatus(sd, SP_STATUSPOINT);
+ clif->updatestatus(sd, SP_BASEEXP);
status_calc_pc(sd, 0);
if(sd->status.party_id)
{
@@ -7065,13 +7065,13 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
if ((unsigned int)val >= sd->status.job_level) {
if ((unsigned int)val > pc_maxjoblv(sd)) val = pc_maxjoblv(sd);
sd->status.skill_point += val - sd->status.job_level;
- clif_updatestatus(sd, SP_SKILLPOINT);
+ clif->updatestatus(sd, SP_SKILLPOINT);
}
sd->status.job_level = (unsigned int)val;
sd->status.job_exp = 0;
- // clif_updatestatus(sd, SP_JOBLEVEL); // Gets updated at the bottom
- clif_updatestatus(sd, SP_NEXTJOBEXP);
- clif_updatestatus(sd, SP_JOBEXP);
+ // clif->updatestatus(sd, SP_JOBLEVEL); // Gets updated at the bottom
+ clif->updatestatus(sd, SP_NEXTJOBEXP);
+ clif->updatestatus(sd, SP_JOBEXP);
status_calc_pc(sd, 0);
break;
case SP_SKILLPOINT:
@@ -7116,7 +7116,7 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
if( sd->battle_status.max_hp < sd->battle_status.hp )
{
sd->battle_status.hp = sd->battle_status.max_hp;
- clif_updatestatus(sd, SP_HP);
+ clif->updatestatus(sd, SP_HP);
}
break;
case SP_SP:
@@ -7128,7 +7128,7 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
if( sd->battle_status.max_sp < sd->battle_status.sp )
{
sd->battle_status.sp = sd->battle_status.max_sp;
- clif_updatestatus(sd, SP_SP);
+ clif->updatestatus(sd, SP_SP);
}
break;
case SP_STR:
@@ -7168,26 +7168,26 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
ShowError("pc_setparam: Attempted to set unknown parameter '%d'.\n", type);
return 0;
}
- clif_updatestatus(sd,type);
+ clif->updatestatus(sd,type);
return 1;
}
/*==========================================
- * HP/SP Healing. If flag is passed, the heal type is through clif_heal, otherwise update status.
+ * HP/SP Healing. If flag is passed, the heal type is through clif->heal, otherwise update status.
*------------------------------------------*/
void pc_heal(struct map_session_data *sd,unsigned int hp,unsigned int sp, int type)
{
if (type) {
if (hp)
- clif_heal(sd->fd,SP_HP,hp);
+ clif->heal(sd->fd,SP_HP,hp);
if (sp)
- clif_heal(sd->fd,SP_SP,sp);
+ clif->heal(sd->fd,SP_SP,sp);
} else {
if(hp)
- clif_updatestatus(sd,SP_HP);
+ clif->updatestatus(sd,SP_HP);
if(sp)
- clif_updatestatus(sd,SP_SP);
+ clif->updatestatus(sd,SP_SP);
}
return;
}
@@ -7364,7 +7364,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
sd->status.skill[sd->cloneskill_id].id = 0;
sd->status.skill[sd->cloneskill_id].lv = 0;
sd->status.skill[sd->cloneskill_id].flag = 0;
- clif_deleteskill(sd,sd->cloneskill_id);
+ clif->deleteskill(sd,sd->cloneskill_id);
}
sd->cloneskill_id = 0;
pc_setglobalreg(sd, "CLONE_SKILL", 0);
@@ -7376,7 +7376,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
sd->status.skill[sd->reproduceskill_id].id = 0;
sd->status.skill[sd->reproduceskill_id].lv = 0;
sd->status.skill[sd->reproduceskill_id].flag = 0;
- clif_deleteskill(sd,sd->reproduceskill_id);
+ clif->deleteskill(sd,sd->reproduceskill_id);
}
sd->reproduceskill_id = 0;
pc_setglobalreg(sd, "REPRODUCE_SKILL",0);
@@ -7409,15 +7409,15 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
sd->status.base_level = pc_maxbaselv(sd);
sd->status.base_exp=0;
pc_resetstate(sd);
- clif_updatestatus(sd,SP_STATUSPOINT);
- clif_updatestatus(sd,SP_BASELEVEL);
- clif_updatestatus(sd,SP_BASEEXP);
- clif_updatestatus(sd,SP_NEXTBASEEXP);
+ clif->updatestatus(sd,SP_STATUSPOINT);
+ clif->updatestatus(sd,SP_BASELEVEL);
+ clif->updatestatus(sd,SP_BASEEXP);
+ clif->updatestatus(sd,SP_NEXTBASEEXP);
}
- clif_updatestatus(sd,SP_JOBLEVEL);
- clif_updatestatus(sd,SP_JOBEXP);
- clif_updatestatus(sd,SP_NEXTJOBEXP);
+ clif->updatestatus(sd,SP_JOBLEVEL);
+ clif->updatestatus(sd,SP_JOBEXP);
+ clif->updatestatus(sd,SP_NEXTJOBEXP);
for(i=0;i<EQI_MAX;i++) {
if(sd->equip_index[i] >= 0)
@@ -7431,13 +7431,13 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
pc_disguise(sd, 0);
status_set_viewdata(&sd->bl, job);
- clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_); // move sprite update to prevent client crashes with incompatible equipment [Valaris]
+ clif->changelook(&sd->bl,LOOK_BASE,sd->vd.class_); // move sprite update to prevent client crashes with incompatible equipment [Valaris]
if(sd->vd.cloth_color)
- clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
+ clif->changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
//Update skill tree.
pc_calc_skilltree(sd);
- clif_skillinfoblock(sd);
+ clif->skillinfoblock(sd);
if (sd->ed)
elemental_delete(sd->ed, 0);
@@ -7474,7 +7474,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
merc_hom_vaporize(sd, 0);
if(sd->status.manner < 0)
- clif_changestatus(sd,SP_MANNER,sd->status.manner);
+ clif->changestatus(sd,SP_MANNER,sd->status.manner);
status_calc_pc(sd,0);
pc_checkallowskill(sd);
@@ -7506,12 +7506,12 @@ int pc_equiplookall(struct map_session_data *sd)
{
nullpo_ret(sd);
- clif_changelook(&sd->bl,LOOK_WEAPON,0);
- clif_changelook(&sd->bl,LOOK_SHOES,0);
- clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
- clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
- clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
- clif_changelook(&sd->bl,LOOK_ROBE, sd->status.robe);
+ clif->changelook(&sd->bl,LOOK_WEAPON,0);
+ clif->changelook(&sd->bl,LOOK_SHOES,0);
+ clif->changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
+ clif->changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
+ clif->changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
+ clif->changelook(&sd->bl,LOOK_ROBE, sd->status.robe);
return 0;
}
@@ -7570,7 +7570,7 @@ int pc_changelook(struct map_session_data *sd,int type,int val)
sd->status.robe = val;
break;
}
- clif_changelook(&sd->bl,type,val);
+ clif->changelook(&sd->bl,type,val);
return 0;
}
@@ -7585,52 +7585,52 @@ int pc_setoption(struct map_session_data *sd,int type)
//Option has to be changed client-side before the class sprite or it won't always work (eg: Wedding sprite) [Skotlex]
sd->sc.option=type;
- clif_changeoption(&sd->bl);
+ clif->changeoption(&sd->bl);
if( (type&OPTION_RIDING && !(p_type&OPTION_RIDING)) || (type&OPTION_DRAGON && !(p_type&OPTION_DRAGON) && pc_checkskill(sd,RK_DRAGONTRAINING) > 0) )
{ // Mounting
- clif_status_load(&sd->bl,SI_RIDING,1);
+ clif->status_change(&sd->bl, SI_RIDING, 1, 0, 0, 0, 0);
status_calc_pc(sd,0);
}
else if( (!(type&OPTION_RIDING) && p_type&OPTION_RIDING) || (!(type&OPTION_DRAGON) && p_type&OPTION_DRAGON && pc_checkskill(sd,RK_DRAGONTRAINING) > 0) )
{ // Dismount
- clif_status_load(&sd->bl,SI_RIDING,0);
+ clif->status_change(&sd->bl, SI_RIDING, 0, 0, 0, 0, 0);
status_calc_pc(sd,0);
}
#ifndef NEW_CARTS
if( type&OPTION_CART && !( p_type&OPTION_CART ) ) { //Cart On
- clif_cartlist(sd);
- clif_updatestatus(sd, SP_CARTINFO);
+ clif->cartlist(sd);
+ clif->updatestatus(sd, SP_CARTINFO);
if(pc_checkskill(sd, MC_PUSHCART) < 10)
status_calc_pc(sd,0); //Apply speed penalty.
} else if( !( type&OPTION_CART ) && p_type&OPTION_CART ){ //Cart Off
- clif_clearcart(sd->fd);
+ clif->clearcart(sd->fd);
if(pc_checkskill(sd, MC_PUSHCART) < 10)
status_calc_pc(sd,0); //Remove speed penalty.
}
#endif
if (type&OPTION_MOUNTING && !(p_type&OPTION_MOUNTING) ) {
- clif_status_load_notick(&sd->bl,SI_ALL_RIDING,2,1,0,0);
+ clif->sc_notick(&sd->bl,SI_ALL_RIDING,2,1,0,0);
status_calc_pc(sd,0);
} else if (!(type&OPTION_MOUNTING) && p_type&OPTION_MOUNTING) {
- clif_status_load_notick(&sd->bl,SI_ALL_RIDING,0,0,0,0);
+ clif->sc_notick(&sd->bl,SI_ALL_RIDING,0,0,0,0);
status_calc_pc(sd,0);
}
if (type&OPTION_FALCON && !(p_type&OPTION_FALCON)) //Falcon ON
- clif_status_load(&sd->bl,SI_FALCON,1);
+ clif->status_change(&sd->bl, SI_FALCON, 1, 0, 0, 0, 0);
else if (!(type&OPTION_FALCON) && p_type&OPTION_FALCON) //Falcon OFF
- clif_status_load(&sd->bl,SI_FALCON,0);
+ clif->status_change(&sd->bl, SI_FALCON, 0, 0, 0, 0, 0);
if( (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER ) {
if( type&OPTION_WUGRIDER && !(p_type&OPTION_WUGRIDER) ) { // Mounting
- clif_status_load(&sd->bl,SI_WUGRIDER,1);
+ clif->status_change(&sd->bl, SI_WUGRIDER, 1, 0, 0, 0, 0);
status_calc_pc(sd,0);
} else if( !(type&OPTION_WUGRIDER) && p_type&OPTION_WUGRIDER ) { // Dismount
- clif_status_load(&sd->bl,SI_WUGRIDER,0);
+ clif->status_change(&sd->bl, SI_WUGRIDER, 0, 0, 0, 0, 0);
status_calc_pc(sd,0);
}
}
@@ -7683,10 +7683,10 @@ int pc_setoption(struct map_session_data *sd,int type)
}
pc_stop_attack(sd); //Stop attacking on new view change (to prevent wedding/santa attacks.
- clif_changelook(&sd->bl,LOOK_BASE,new_look);
+ clif->changelook(&sd->bl,LOOK_BASE,new_look);
if (sd->vd.cloth_color)
- clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
- clif_skillinfoblock(sd); // Skill list needs to be updated after base change.
+ clif->changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
+ clif->skillinfoblock(sd); // Skill list needs to be updated after base change.
return 0;
}
@@ -7717,14 +7717,14 @@ int pc_setcart(struct map_session_data *sd,int type) {
if( !sd->sc.data[SC_PUSH_CART] )
return 0;
status_change_end(&sd->bl,SC_PUSH_CART,INVALID_TIMER);
- clif_clearcart(sd->fd);
+ clif->clearcart(sd->fd);
break;
default:/* everything else is an allowed ID so we can move on */
if( !sd->sc.data[SC_PUSH_CART] ) /* first time, so fill cart data */
- clif_cartlist(sd);
- clif_updatestatus(sd, SP_CARTINFO);
+ clif->cartlist(sd);
+ clif->updatestatus(sd, SP_CARTINFO);
sc_start(&sd->bl, SC_PUSH_CART, 100, type, 0);
- clif_status_load_notick(&sd->bl, SI_ON_PUSH_CART, 2 , type, 0, 0);
+ clif->sc_notick(&sd->bl, SI_ON_PUSH_CART, 2 , type, 0, 0);
if( sd->sc.data[SC_PUSH_CART] )/* forcefully update */
sd->sc.data[SC_PUSH_CART]->val1 = type;
break;
@@ -8416,13 +8416,13 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
nullpo_ret(sd);
if( n < 0 || n >= MAX_INVENTORY ) {
- clif_equipitemack(sd,0,0,0);
+ clif->equipitemack(sd,0,0,0);
return 0;
}
if( DIFF_TICK(sd->canequip_tick,gettick()) > 0 )
{
- clif_equipitemack(sd,n,0,0);
+ clif->equipitemack(sd,n,0,0);
return 0;
}
@@ -8433,13 +8433,13 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
ShowInfo("equip %d(%d) %x:%x\n",sd->status.inventory[n].nameid,n,id?id->equip:0,req_pos);
if(!pc_isequip(sd,n) || !(pos&req_pos) || sd->status.inventory[n].equip != 0 || sd->status.inventory[n].attribute==1 ) { // [Valaris]
// FIXME: pc_isequip: equip level failure uses 2 instead of 0
- clif_equipitemack(sd,n,0,0); // fail
+ clif->equipitemack(sd,n,0,0); // fail
return 0;
}
if (sd->sc.data[SC_BERSERK] || sd->sc.data[SC_SATURDAYNIGHTFEVER] || sd->sc.data[SC__BLOODYLUST])
{
- clif_equipitemack(sd,n,0,0); // fail
+ clif->equipitemack(sd,n,0,0); // fail
return 0;
}
@@ -8475,11 +8475,11 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
}
if(pos==EQP_AMMO){
- clif_arrowequip(sd,n);
- clif_arrow_fail(sd,3);
+ clif->arrowequip(sd,n);
+ clif->arrow_fail(sd,3);
}
else
- clif_equipitemack(sd,n,pos,1);
+ clif->equipitemack(sd,n,pos,1);
sd->status.inventory[n].equip=pos;
@@ -8489,7 +8489,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
else
sd->weapontype1 = 0;
pc_calcweapontype(sd);
- clif_changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
+ clif->changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
}
if(pos & EQP_HAND_L) {
if(id) {
@@ -8506,7 +8506,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
else
sd->status.shield = sd->weapontype2 = 0;
pc_calcweapontype(sd);
- clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
+ clif->changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
}
//Added check to prevent sending the same look on multiple slots ->
//causes client to redraw item on top of itself. (suggested by Lupus)
@@ -8515,54 +8515,54 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
sd->status.head_bottom = id->look;
else
sd->status.head_bottom = 0;
- clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
+ clif->changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
}
if(pos & EQP_HEAD_TOP && pc_checkequip(sd,EQP_COSTUME_HEAD_TOP) == -1) {
if(id)
sd->status.head_top = id->look;
else
sd->status.head_top = 0;
- clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
+ clif->changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
}
if(pos & EQP_HEAD_MID && pc_checkequip(sd,EQP_COSTUME_HEAD_MID) == -1) {
if(id && !(pos&EQP_HEAD_TOP))
sd->status.head_mid = id->look;
else
sd->status.head_mid = 0;
- clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
+ clif->changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
}
if(pos & EQP_COSTUME_HEAD_TOP) {
if(id){
sd->status.head_top = id->look;
} else
sd->status.head_top = 0;
- clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
+ clif->changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
}
if(pos & EQP_COSTUME_HEAD_MID) {
if(id && !(pos&EQP_HEAD_TOP)){
sd->status.head_mid = id->look;
} else
sd->status.head_mid = 0;
- clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
+ clif->changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
}
if(pos & EQP_COSTUME_HEAD_LOW) {
if(id && !(pos&(EQP_HEAD_TOP|EQP_HEAD_MID))){
sd->status.head_bottom = id->look;
} else
sd->status.head_bottom = 0;
- clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
+ clif->changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
}
if(pos & EQP_SHOES)
- clif_changelook(&sd->bl,LOOK_SHOES,0);
+ clif->changelook(&sd->bl,LOOK_SHOES,0);
if( pos&EQP_GARMENT ) {
sd->status.robe = id ? id->look : 0;
- clif_changelook(&sd->bl, LOOK_ROBE, sd->status.robe);
+ clif->changelook(&sd->bl, LOOK_ROBE, sd->status.robe);
}
if(pos & EQP_COSTUME_GARMENT) {
sd->status.robe = id ? id->look : 0;
- clif_changelook(&sd->bl,LOOK_ROBE,sd->status.robe);
+ clif->changelook(&sd->bl,LOOK_ROBE,sd->status.robe);
}
@@ -8590,7 +8590,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
status_calc_pc(sd,0);
if (flag) //Update skill data
- clif_skillinfoblock(sd);
+ clif->skillinfoblock(sd);
//OnEquip script [Skotlex]
if (id) {
@@ -8628,20 +8628,20 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) {
nullpo_ret(sd);
if( n < 0 || n >= MAX_INVENTORY ) {
- clif_unequipitemack(sd,0,0,0);
+ clif->unequipitemack(sd,0,0,0);
return 0;
}
// if player is berserk then cannot unequip
if (!(flag & 2) && sd->sc.count && (sd->sc.data[SC_BERSERK] || sd->sc.data[SC_SATURDAYNIGHTFEVER] || sd->sc.data[SC__BLOODYLUST]))
{
- clif_unequipitemack(sd,n,0,0);
+ clif->unequipitemack(sd,n,0,0);
return 0;
}
if( !(flag&2) && sd->sc.count && sd->sc.data[SC_KYOUGAKU] )
{
- clif_unequipitemack(sd,n,0,0);
+ clif->unequipitemack(sd,n,0,0);
return 0;
}
@@ -8649,7 +8649,7 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) {
ShowInfo("unequip %d %x:%x\n",n,pc_equippoint(sd,n),sd->status.inventory[n].equip);
if(!sd->status.inventory[n].equip){ //Nothing to unequip
- clif_unequipitemack(sd,n,0,0);
+ clif->unequipitemack(sd,n,0,0);
return 0;
}
for(i=0;i<EQI_MAX;i++) {
@@ -8661,57 +8661,57 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) {
sd->weapontype1 = 0;
sd->status.weapon = sd->weapontype2;
pc_calcweapontype(sd);
- clif_changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
+ clif->changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
if( !battle_config.dancing_weaponswitch_fix )
status_change_end(&sd->bl, SC_DANCING, INVALID_TIMER); // Unequipping => stop dancing.
}
if(sd->status.inventory[n].equip & EQP_HAND_L) {
sd->status.shield = sd->weapontype2 = 0;
pc_calcweapontype(sd);
- clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
+ clif->changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
}
if(sd->status.inventory[n].equip & EQP_HEAD_LOW && pc_checkequip(sd,EQP_COSTUME_HEAD_LOW) == -1 ) {
sd->status.head_bottom = 0;
- clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
+ clif->changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
}
if(sd->status.inventory[n].equip & EQP_HEAD_TOP && pc_checkequip(sd,EQP_COSTUME_HEAD_TOP) == -1 ) {
sd->status.head_top = 0;
- clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
+ clif->changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
}
if(sd->status.inventory[n].equip & EQP_HEAD_MID && pc_checkequip(sd,EQP_COSTUME_HEAD_MID) == -1 ) {
sd->status.head_mid = 0;
- clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
+ clif->changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
}
if(sd->status.inventory[n].equip & EQP_COSTUME_HEAD_TOP) {
sd->status.head_top = ( pc_checkequip(sd,EQP_HEAD_TOP) >= 0 ) ? sd->inventory_data[pc_checkequip(sd,EQP_HEAD_TOP)]->look : 0;
- clif_changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
+ clif->changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top);
}
if(sd->status.inventory[n].equip & EQP_COSTUME_HEAD_MID) {
sd->status.head_mid = ( pc_checkequip(sd,EQP_HEAD_MID) >= 0 ) ? sd->inventory_data[pc_checkequip(sd,EQP_HEAD_MID)]->look : 0;
- clif_changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
+ clif->changelook(&sd->bl,LOOK_HEAD_MID,sd->status.head_mid);
}
if(sd->status.inventory[n].equip & EQP_COSTUME_HEAD_LOW) {
sd->status.head_bottom = ( pc_checkequip(sd,EQP_HEAD_LOW) >= 0 ) ? sd->inventory_data[pc_checkequip(sd,EQP_HEAD_LOW)]->look : 0;
- clif_changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
+ clif->changelook(&sd->bl,LOOK_HEAD_BOTTOM,sd->status.head_bottom);
}
if(sd->status.inventory[n].equip & EQP_SHOES)
- clif_changelook(&sd->bl,LOOK_SHOES,0);
+ clif->changelook(&sd->bl,LOOK_SHOES,0);
if( sd->status.inventory[n].equip&EQP_GARMENT && pc_checkequip(sd,EQP_COSTUME_GARMENT) == -1 ) {
sd->status.robe = 0;
- clif_changelook(&sd->bl, LOOK_ROBE, 0);
+ clif->changelook(&sd->bl, LOOK_ROBE, 0);
}
if(sd->status.inventory[n].equip & EQP_COSTUME_GARMENT) {
sd->status.robe = ( pc_checkequip(sd,EQP_GARMENT) >= 0 ) ? sd->inventory_data[pc_checkequip(sd,EQP_GARMENT)]->look : 0;
- clif_changelook(&sd->bl,LOOK_ROBE,sd->status.robe);
+ clif->changelook(&sd->bl,LOOK_ROBE,sd->status.robe);
}
- clif_unequipitemack(sd,n,sd->status.inventory[n].equip,1);
+ clif->unequipitemack(sd,n,sd->status.inventory[n].equip,1);
if((sd->status.inventory[n].equip & EQP_ARMS) &&
sd->weapontype1 == 0 && sd->weapontype2 == 0 && (!sd->sc.data[SC_SEVENWIND] || sd->sc.data[SC_ASPERSIO])) //Check for seven wind (but not level seven!)
@@ -8873,7 +8873,7 @@ int pc_calc_pvprank(struct map_session_data *sd)
sd->pvp_rank=1;
map_foreachinmap(pc_calc_pvprank_sub,sd->bl.m,BL_PC,sd);
if(old!=sd->pvp_rank || sd->pvp_lastusers!=m->users_pvp)
- clif_pvpset(sd,sd->pvp_rank,sd->pvp_lastusers=m->users_pvp,0);
+ clif->pvpset(sd,sd->pvp_rank,sd->pvp_lastusers=m->users_pvp,0);
return sd->pvp_rank;
}
/*==========================================
@@ -8966,8 +8966,8 @@ int pc_divorce(struct map_session_data *sd)
pc_delitem(p_sd, i, 1, 0, 0, LOG_TYPE_OTHER);
}
- clif_divorced(sd, p_sd->status.name);
- clif_divorced(p_sd, sd->status.name);
+ clif->divorced(sd, p_sd->status.name);
+ clif->divorced(p_sd, sd->status.name);
return 0;
}
@@ -9142,9 +9142,8 @@ int pc_autosave(int tid, unsigned int tick, int id, intptr_t data)
static int pc_daynight_timer_sub(struct map_session_data *sd,va_list ap)
{
- if (sd->state.night != night_flag && map[sd->bl.m].flag.nightenabled)
- { //Night/day state does not match.
- clif_status_load(&sd->bl, SI_NIGHT, night_flag); //New night effect by dynamix [Skotlex]
+ if (sd->state.night != night_flag && map[sd->bl.m].flag.nightenabled) { //Night/day state does not match.
+ clif->status_change(&sd->bl, SI_NIGHT, night_flag, 0, 0, 0, 0); //New night effect by dynamix [Skotlex]
sd->state.night = night_flag;
return 1;
}
@@ -9196,7 +9195,7 @@ void pc_setstand(struct map_session_data *sd){
nullpo_retv(sd);
status_change_end(&sd->bl, SC_TENSIONRELAX, INVALID_TIMER);
- clif_status_load(&sd->bl,SI_SIT,0);
+ clif->status_change(&sd->bl, SI_SIT, 0, 0, 0, 0, 0);
//Reset sitting tick.
sd->ssregen.tick.hp = sd->ssregen.tick.sp = 0;
sd->state.dead_sit = sd->vd.dead_sit = 0;
@@ -9289,7 +9288,7 @@ static int pc_talisman_timer(int tid, unsigned int tick, int id, intptr_t data)
memmove(sd->talisman_timer[type]+i, sd->talisman_timer[type]+i+1, (sd->talisman[type]-i)*sizeof(int));
sd->talisman_timer[type][sd->talisman[type]] = INVALID_TIMER;
- clif_talisman(sd, type);
+ clif->talisman(sd, type);
return 0;
}
@@ -9322,7 +9321,7 @@ int pc_add_talisman(struct map_session_data *sd,int interval,int max,int type)
sd->talisman_timer[type][i] = tid;
sd->talisman[type]++;
- clif_talisman(sd, type);
+ clif->talisman(sd, type);
return 0;
}
@@ -9356,7 +9355,7 @@ int pc_del_talisman(struct map_session_data *sd,int count,int type)
sd->talisman_timer[type][i] = INVALID_TIMER;
}
- clif_talisman(sd, type);
+ clif->talisman(sd, type);
return 0;
}
#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP)
diff --git a/src/map/pet.c b/src/map/pet.c
index 5301037b8..3edf3367c 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -226,9 +226,9 @@ static int pet_hungry(int tid, unsigned int tick, int id, intptr_t data)
pd->status.speed = pd->db->status.speed;
}
status_calc_pet(pd, 0);
- clif_send_petdata(sd,pd,1,pd->pet.intimate);
+ clif->send_petdata(sd,pd,1,pd->pet.intimate);
}
- clif_send_petdata(sd,pd,2,pd->pet.hungry);
+ clif->send_petdata(sd,pd,2,pd->pet.hungry);
if(battle_config.pet_hungry_delay_rate != 100)
interval = (pd->petDB->hungry_delay*battle_config.pet_hungry_delay_rate)/100;
@@ -285,7 +285,7 @@ static int pet_performance(struct map_session_data *sd, struct pet_data *pd)
val = 1;
pet_stop_walking(pd,2000<<8);
- clif_pet_performance(pd, rnd()%val + 1);
+ clif->send_petdata(NULL, pd, 4, rnd()%val + 1);
pet_lootitem_drop(pd,NULL);
return 1;
}
@@ -304,7 +304,7 @@ static int pet_return_egg(struct map_session_data *sd, struct pet_data *pd)
tmp_item.card[2] = GetWord(pd->pet.pet_id,1);
tmp_item.card[3] = pd->pet.rename_flag;
if((flag = pc_additem(sd,&tmp_item,1,LOG_TYPE_OTHER))) {
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
map_addflooritem(&tmp_item,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
pd->pet.incuvate = 1;
@@ -411,11 +411,11 @@ int pet_birth_process(struct map_session_data *sd, struct s_pet *pet)
if(sd->bl.prev != NULL) {
map_addblock(&sd->pd->bl);
- clif_spawn(&sd->pd->bl);
- clif_send_petdata(sd,sd->pd, 0,0);
- clif_send_petdata(sd,sd->pd, 5,battle_config.pet_hair_style);
- clif_pet_equip_area(sd->pd);
- clif_send_petstatus(sd);
+ clif->spawn(&sd->pd->bl);
+ clif->send_petdata(sd,sd->pd, 0,0);
+ clif->send_petdata(sd,sd->pd, 5,battle_config.pet_hair_style);
+ clif->send_petdata(NULL, sd->pd, 3, sd->pd->vd.head_bottom);
+ clif->send_petstatus(sd);
}
Assert((sd->status.pet_id == 0 || sd->pd == 0) || sd->pd->msd == sd);
@@ -452,11 +452,11 @@ int pet_recv_petdata(int account_id,struct s_pet *p,int flag)
pet_data_init(sd,p);
if(sd->pd && sd->bl.prev != NULL) {
map_addblock(&sd->pd->bl);
- clif_spawn(&sd->pd->bl);
- clif_send_petdata(sd,sd->pd,0,0);
- clif_send_petdata(sd,sd->pd,5,battle_config.pet_hair_style);
- clif_pet_equip_area(sd->pd);
- clif_send_petstatus(sd);
+ clif->spawn(&sd->pd->bl);
+ clif->send_petdata(sd,sd->pd,0,0);
+ clif->send_petdata(sd,sd->pd,5,battle_config.pet_hair_style);
+ clif->send_petdata(NULL, sd->pd, 3, sd->pd->vd.head_bottom);
+ clif->send_petstatus(sd);
}
}
@@ -483,7 +483,7 @@ int pet_catch_process1(struct map_session_data *sd,int target_class)
nullpo_ret(sd);
sd->catch_target_class = target_class;
- clif_catch_process(sd);
+ clif->catch_process(sd);
return 0;
}
@@ -498,7 +498,7 @@ int pet_catch_process2(struct map_session_data* sd, int target_id)
md = (struct mob_data*)map_id2bl(target_id);
if(!md || md->bl.type != BL_MOB || md->bl.prev == NULL)
{ // Invalid inputs/state, abort capture.
- clif_pet_roulette(sd,0);
+ clif->pet_roulette(sd,0);
sd->catch_target_class = -1;
sd->itemid = sd->itemindex = -1;
return 1;
@@ -511,8 +511,8 @@ int pet_catch_process2(struct map_session_data* sd, int target_id)
if (sd->catch_target_class == 0 && !(md->status.mode&MD_BOSS))
sd->catch_target_class = md->class_;
if(i < 0 || sd->catch_target_class != md->class_) {
- clif_emotion(&md->bl, E_AG); //mob will do /ag if wrong lure is used on them.
- clif_pet_roulette(sd,0);
+ clif->emotion(&md->bl, E_AG); //mob will do /ag if wrong lure is used on them.
+ clif->pet_roulette(sd,0);
sd->catch_target_class = -1;
return 1;
}
@@ -527,13 +527,13 @@ int pet_catch_process2(struct map_session_data* sd, int target_id)
{
unit_remove_map(&md->bl,CLR_OUTSIGHT);
status_kill(&md->bl);
- clif_pet_roulette(sd,1);
+ clif->pet_roulette(sd,1);
intif_create_pet(sd->status.account_id,sd->status.char_id,pet_db[i].class_,mob_db(pet_db[i].class_)->lv,
pet_db[i].EggID,0,pet_db[i].intimate,100,0,1,pet_db[i].jname);
}
else
{
- clif_pet_roulette(sd,0);
+ clif->pet_roulette(sd,0);
sd->catch_target_class = -1;
}
@@ -569,7 +569,7 @@ int pet_get_egg(int account_id,int pet_id,int flag)
tmp_item.card[2] = GetWord(pet_id,1);
tmp_item.card[3] = 0; //New pets are not named.
if((ret = pc_additem(sd,&tmp_item,1,LOG_TYPE_PICKDROP_PLAYER))) {
- clif_additem(sd,0,0,ret);
+ clif->additem(sd,0,0,ret);
map_addflooritem(&tmp_item,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
@@ -592,7 +592,7 @@ int pet_menu(struct map_session_data *sd,int menunum)
switch(menunum) {
case 0:
- clif_send_petstatus(sd);
+ clif->send_petstatus(sd);
break;
case 1:
pet_food(sd, sd->pd);
@@ -636,15 +636,15 @@ int pet_change_name_ack(struct map_session_data *sd, char* name, int flag)
normalize_name(name," ");//bugreport:3032
if ( !flag || !strlen(name) ) {
- clif_displaymessage(sd->fd, msg_txt(280)); // You cannot use this name for your pet.
- clif_send_petstatus(sd); //Send status so client knows oet name change got rejected.
+ clif->displaymessage(sd->fd, msg_txt(280)); // You cannot use this name for your pet.
+ clif->send_petstatus(sd); //Send status so client knows oet name change got rejected.
return 0;
}
memcpy(pd->pet.name, name, NAME_LENGTH);
- clif_charnameack (0,&pd->bl);
+ clif->charnameack (0,&pd->bl);
pd->pet.rename_flag = 1;
- clif_pet_equip_area(pd);
- clif_send_petstatus(sd);
+ clif->send_petdata(NULL, sd->pd, 3, sd->pd->vd.head_bottom);
+ clif->send_petstatus(sd);
return 1;
}
@@ -660,14 +660,14 @@ int pet_equipitem(struct map_session_data *sd,int index)
nameid = sd->status.inventory[index].nameid;
if(pd->petDB->AcceID == 0 || nameid != pd->petDB->AcceID || pd->pet.equip != 0) {
- clif_equipitemack(sd,0,0,0);
+ clif->equipitemack(sd,0,0,0);
return 1;
}
pc_delitem(sd,index,1,0,0,LOG_TYPE_OTHER);
pd->pet.equip = nameid;
status_set_viewdata(&pd->bl, pd->pet.class_); //Updates view_data.
- clif_pet_equip_area(pd);
+ clif->send_petdata(NULL, sd->pd, 3, sd->pd->vd.head_bottom);
if (battle_config.pet_equip_required)
{ //Skotlex: start support timers if need
unsigned int tick = gettick();
@@ -696,12 +696,12 @@ static int pet_unequipitem(struct map_session_data *sd, struct pet_data *pd)
nameid = pd->pet.equip;
pd->pet.equip = 0;
status_set_viewdata(&pd->bl, pd->pet.class_);
- clif_pet_equip_area(pd);
+ clif->send_petdata(NULL, sd->pd, 3, sd->pd->vd.head_bottom);
memset(&tmp_item,0,sizeof(tmp_item));
tmp_item.nameid = nameid;
tmp_item.identify = 1;
if((flag = pc_additem(sd,&tmp_item,1,LOG_TYPE_OTHER))) {
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
map_addflooritem(&tmp_item,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
if( battle_config.pet_equip_required )
@@ -736,7 +736,7 @@ static int pet_food(struct map_session_data *sd, struct pet_data *pd)
k=pd->petDB->FoodID;
i=pc_search_inventory(sd,k);
if(i < 0) {
- clif_pet_food(sd,k,0);
+ clif->pet_food(sd,k,0);
return 1;
}
pc_delitem(sd,i,1,0,0,LOG_TYPE_CONSUME);
@@ -770,9 +770,9 @@ static int pet_food(struct map_session_data *sd, struct pet_data *pd)
if( pd->pet.hungry > 100 )
pd->pet.hungry = 100;
- clif_send_petdata(sd,pd,2,pd->pet.hungry);
- clif_send_petdata(sd,pd,1,pd->pet.intimate);
- clif_pet_food(sd,pd->petDB->FoodID,1);
+ clif->send_petdata(sd,pd,2,pd->pet.hungry);
+ clif->send_petdata(sd,pd,1,pd->pet.intimate);
+ clif->pet_food(sd,pd->petDB->FoodID,1);
return 0;
}
@@ -1012,7 +1012,7 @@ int pet_lootitem_drop(struct pet_data *pd,struct map_session_data *sd)
it = &pd->loot->item[i];
if(sd){
if((flag = pc_additem(sd,it,it->amount,LOG_TYPE_PICKDROP_PLAYER))){
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
ditem = ers_alloc(item_drop_ers, struct item_drop);
memcpy(&ditem->item_data, it, sizeof(struct item));
ditem->next = dlist->item;
@@ -1102,9 +1102,9 @@ int pet_recovery_timer(int tid, unsigned int tick, int id, intptr_t data)
if(sd->sc.data[pd->recovery->type])
{ //Display a heal animation?
//Detoxify is chosen for now.
- clif_skill_nodamage(&pd->bl,&sd->bl,TF_DETOXIFY,1,1);
+ clif->skill_nodamage(&pd->bl,&sd->bl,TF_DETOXIFY,1,1);
status_change_end(&sd->bl, pd->recovery->type, INVALID_TIMER);
- clif_emotion(&pd->bl, E_OK);
+ clif->emotion(&pd->bl, E_OK);
}
pd->recovery->timer = INVALID_TIMER;
@@ -1141,7 +1141,7 @@ int pet_heal_timer(int tid, unsigned int tick, int id, intptr_t data)
}
pet_stop_attack(pd);
pet_stop_walking(pd,1);
- clif_skill_nodamage(&pd->bl,&sd->bl,AL_HEAL,pd->s_skill->lv,1);
+ clif->skill_nodamage(&pd->bl,&sd->bl,AL_HEAL,pd->s_skill->lv,1);
status_heal(&sd->bl, pd->s_skill->lv,0, 0);
pd->s_skill->timer=add_timer(tick+pd->s_skill->delay*1000,pet_heal_timer,sd->bl.id,0);
return 0;
diff --git a/src/map/quest.c b/src/map/quest.c
index c7ca06514..3ef162aaa 100644
--- a/src/map/quest.c
+++ b/src/map/quest.c
@@ -53,8 +53,8 @@ int quest_pc_login(TBL_PC * sd)
if(sd->avail_quests == 0)
return 1;
- clif_quest_send_list(sd);
- clif_quest_send_mission(sd);
+ clif->quest_send_list(sd);
+ clif->quest_send_mission(sd);
return 0;
}
@@ -97,7 +97,7 @@ int quest_add(TBL_PC * sd, int quest_id)
sd->avail_quests++;
sd->save_quest = true;
- clif_quest_add(sd, &sd->quest_log[i], sd->quest_index[i]);
+ clif->quest_add(sd, &sd->quest_log[i], sd->quest_index[i]);
if( save_settings&64 )
chrif_save(sd,0);
@@ -144,8 +144,8 @@ int quest_change(TBL_PC * sd, int qid1, int qid2)
sd->quest_index[i] = j;
sd->save_quest = true;
- clif_quest_delete(sd, qid1);
- clif_quest_add(sd, &sd->quest_log[i], sd->quest_index[i]);
+ clif->quest_delete(sd, qid1);
+ clif->quest_add(sd, &sd->quest_log[i], sd->quest_index[i]);
if( save_settings&64 )
chrif_save(sd,0);
@@ -176,7 +176,7 @@ int quest_delete(TBL_PC * sd, int quest_id)
sd->quest_index[sd->num_quests] = 0;
sd->save_quest = true;
- clif_quest_delete(sd, quest_id);
+ clif->quest_delete(sd, quest_id);
if( save_settings&64 )
chrif_save(sd,0);
@@ -217,7 +217,7 @@ void quest_update_objective(TBL_PC * sd, int mob) {
if( quest_db[sd->quest_index[i]].mob[j] == mob && sd->quest_log[i].count[j] < quest_db[sd->quest_index[i]].count[j] ) {
sd->quest_log[i].count[j]++;
sd->save_quest = true;
- clif_quest_update_objective(sd,&sd->quest_log[i],sd->quest_index[i]);
+ clif->quest_update_objective(sd,&sd->quest_log[i],sd->quest_index[i]);
}
}
}
@@ -236,7 +236,7 @@ int quest_update_status(TBL_PC * sd, int quest_id, quest_state status) {
sd->save_quest = true;
if( status < Q_COMPLETE ) {
- clif_quest_update_status(sd, quest_id, (bool)status);
+ clif->quest_update_status(sd, quest_id, (bool)status);
return 0;
}
@@ -247,7 +247,7 @@ int quest_update_status(TBL_PC * sd, int quest_id, quest_state status) {
memcpy(&sd->quest_log[sd->avail_quests], &tmp_quest,sizeof(struct quest));
}
- clif_quest_delete(sd, quest_id);
+ clif->quest_delete(sd, quest_id);
if( save_settings&64 )
chrif_save(sd,0);
diff --git a/src/map/script.c b/src/map/script.c
index dcaeacf5b..a6bbdb0bd 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -3797,7 +3797,7 @@ void run_script_main(struct script_state *st)
if ((sd = map_id2sd(st->rid))!=NULL)
{ //Restore previous stack and save char.
if(sd->state.using_fake_npc){
- clif_clearunit_single(sd->npc_id, CLR_OUTSIGHT, sd->fd);
+ clif->clearunit_single(sd->npc_id, CLR_OUTSIGHT, sd->fd);
sd->state.using_fake_npc = 0;
}
//Restore previous script if any.
@@ -4349,7 +4349,7 @@ BUILDIN_FUNC(mes)
if( !script_hasdata(st, 3) )
{// only a single line detected in the script
- clif_scriptmes(sd, st->oid, script_getstr(st, 2));
+ clif->scriptmes(sd, st->oid, script_getstr(st, 2));
}
else
{// parse multiple lines as they exist
@@ -4358,7 +4358,7 @@ BUILDIN_FUNC(mes)
for( i = 2; script_hasdata(st, i); i++ )
{
// send the message to the client
- clif_scriptmes(sd, st->oid, script_getstr(st, i));
+ clif->scriptmes(sd, st->oid, script_getstr(st, i));
}
}
@@ -4378,7 +4378,7 @@ BUILDIN_FUNC(next)
return 0;
st->state = STOP;
- clif_scriptnext(sd, st->oid);
+ clif->scriptnext(sd, st->oid);
return 0;
}
@@ -4395,7 +4395,7 @@ BUILDIN_FUNC(close)
return 0;
st->state = CLOSE;
- clif_scriptclose(sd, st->oid);
+ clif->scriptclose(sd, st->oid);
return 0;
}
@@ -4412,7 +4412,7 @@ BUILDIN_FUNC(close2)
return 0;
st->state = STOP;
- clif_scriptclose(sd, st->oid);
+ clif->scriptclose(sd, st->oid);
return 0;
}
@@ -4529,10 +4529,10 @@ BUILDIN_FUNC(menu)
CREATE(menu, char, 2048);
safestrncpy(menu, StringBuf_Value(&buf), 2047);
ShowWarning("NPC Menu too long! (source:%s / length:%d)\n",nd?nd->name:"Unknown",StringBuf_Length(&buf));
- clif_scriptmenu(sd, st->oid, menu);
+ clif->scriptmenu(sd, st->oid, menu);
aFree(menu);
} else
- clif_scriptmenu(sd, st->oid, StringBuf_Value(&buf));
+ clif->scriptmenu(sd, st->oid, StringBuf_Value(&buf));
StringBuf_Destroy(&buf);
@@ -4630,10 +4630,10 @@ BUILDIN_FUNC(select)
CREATE(menu, char, 2048);
safestrncpy(menu, StringBuf_Value(&buf), 2047);
ShowWarning("NPC Menu too long! (source:%s / length:%d)\n",nd?nd->name:"Unknown",StringBuf_Length(&buf));
- clif_scriptmenu(sd, st->oid, menu);
+ clif->scriptmenu(sd, st->oid, menu);
aFree(menu);
} else
- clif_scriptmenu(sd, st->oid, StringBuf_Value(&buf));
+ clif->scriptmenu(sd, st->oid, StringBuf_Value(&buf));
StringBuf_Destroy(&buf);
if( sd->npc_menu >= 0xff ) {
@@ -4705,10 +4705,10 @@ BUILDIN_FUNC(prompt)
CREATE(menu, char, 2048);
safestrncpy(menu, StringBuf_Value(&buf), 2047);
ShowWarning("NPC Menu too long! (source:%s / length:%d)\n",nd?nd->name:"Unknown",StringBuf_Length(&buf));
- clif_scriptmenu(sd, st->oid, menu);
+ clif->scriptmenu(sd, st->oid, menu);
aFree(menu);
} else
- clif_scriptmenu(sd, st->oid, StringBuf_Value(&buf));
+ clif->scriptmenu(sd, st->oid, StringBuf_Value(&buf));
StringBuf_Destroy(&buf);
if( sd->npc_menu >= 0xff )
@@ -5424,9 +5424,9 @@ BUILDIN_FUNC(input)
sd->state.menu_or_input = 1;
st->state = RERUNLINE;
if( is_string_variable(name) )
- clif_scriptinputstr(sd,st->oid);
+ clif->scriptinputstr(sd,st->oid);
else
- clif_scriptinput(sd,st->oid);
+ clif->scriptinput(sd,st->oid);
}
else
{ // take received text/value and store it in the designated variable
@@ -5958,7 +5958,7 @@ BUILDIN_FUNC(changelook)
if( sd == NULL )
return 0;
- clif_changelook(&sd->bl,type,val);
+ clif->changelook(&sd->bl,type,val);
return 0;
}
@@ -5974,7 +5974,7 @@ BUILDIN_FUNC(cutin)
if( sd == NULL )
return 0;
- clif_cutin(sd,script_getstr(st,2),script_getnum(st,3));
+ clif->cutin(sd,script_getstr(st,2),script_getnum(st,3));
return 0;
}
@@ -5996,7 +5996,7 @@ BUILDIN_FUNC(viewpoint)
if( sd == NULL )
return 0;
- clif_viewpoint(sd,st->oid,type,x,y,id,color);
+ clif->viewpoint(sd,st->oid,type,x,y,id,color);
return 0;
}
@@ -6364,7 +6364,7 @@ BUILDIN_FUNC(getitem)
{
if ((flag = pc_additem(sd, &it, get_count, LOG_TYPE_SCRIPT)))
{
- clif_additem(sd, 0, 0, flag);
+ clif->additem(sd, 0, 0, flag);
if( pc_candrop(sd,&it) )
map_addflooritem(&it,get_count,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
@@ -6462,7 +6462,7 @@ BUILDIN_FUNC(getitem2)
{
if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_SCRIPT)))
{
- clif_additem(sd, 0, 0, flag);
+ clif->additem(sd, 0, 0, flag);
if( pc_candrop(sd,&item_tmp) )
map_addflooritem(&item_tmp,get_count,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
@@ -6525,7 +6525,7 @@ BUILDIN_FUNC(rentitem)
if( (flag = pc_additem(sd, &it, 1, LOG_TYPE_SCRIPT)) )
{
- clif_additem(sd, 0, 0, flag);
+ clif->additem(sd, 0, 0, flag);
return 1;
}
@@ -6878,7 +6878,7 @@ BUILDIN_FUNC(delitem)
ShowError("script:delitem: failed to delete %d items (AID=%d item_id=%d).\n", it.amount, sd->status.account_id, it.nameid);
st->state = END;
- clif_scriptclose(sd, st->oid);
+ clif->scriptclose(sd, st->oid);
return 1;
}
@@ -6954,7 +6954,7 @@ BUILDIN_FUNC(delitem2)
ShowError("script:delitem2: failed to delete %d items (AID=%d item_id=%d).\n", it.amount, sd->status.account_id, it.nameid);
st->state = END;
- clif_scriptclose(sd, st->oid);
+ clif->scriptclose(sd, st->oid);
return 1;
}
@@ -7473,9 +7473,9 @@ BUILDIN_FUNC(repair)
repaircounter++;
if(num==repaircounter){
sd->status.inventory[i].attribute=0;
- clif_equiplist(sd);
- clif_produceeffect(sd, 0, sd->status.inventory[i].nameid);
- clif_misceffect(&sd->bl, 3);
+ clif->equiplist(sd);
+ clif->produce_effect(sd, 0, sd->status.inventory[i].nameid);
+ clif->misceffect(&sd->bl, 3);
break;
}
}
@@ -7501,15 +7501,15 @@ BUILDIN_FUNC(repairall)
if(sd->status.inventory[i].nameid && sd->status.inventory[i].attribute)
{
sd->status.inventory[i].attribute = 0;
- clif_produceeffect(sd,0,sd->status.inventory[i].nameid);
+ clif->produce_effect(sd,0,sd->status.inventory[i].nameid);
repaircounter++;
}
}
if(repaircounter)
{
- clif_misceffect(&sd->bl, 3);
- clif_equiplist(sd);
+ clif->misceffect(&sd->bl, 3);
+ clif->equiplist(sd);
}
return 0;
@@ -7694,15 +7694,15 @@ BUILDIN_FUNC(successrefitem)
sd->status.inventory[i].refine++;
pc_unequipitem(sd,i,2); // status calc will happen in pc_equipitem() below
- clif_refine(sd->fd,0,i,sd->status.inventory[i].refine);
- clif_delitem(sd,i,1,3);
+ clif->refine(sd->fd,0,i,sd->status.inventory[i].refine);
+ clif->delitem(sd,i,1,3);
//Logs items, got from (N)PC scripts [Lupus]
log_pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i]);
- clif_additem(sd,i,1,0);
+ clif->additem(sd,i,1,0);
pc_equipitem(sd,i,ep);
- clif_misceffect(&sd->bl,3);
+ clif->misceffect(&sd->bl,3);
if(sd->status.inventory[i].refine == MAX_REFINE &&
sd->status.inventory[i].card[0] == CARD0_FORGE &&
sd->status.char_id == (int)MakeDWord(sd->status.inventory[i].card[2],sd->status.inventory[i].card[3])
@@ -7742,11 +7742,11 @@ BUILDIN_FUNC(failedrefitem)
if(i >= 0) {
sd->status.inventory[i].refine = 0;
pc_unequipitem(sd,i,3); //recalculate bonus
- clif_refine(sd->fd,1,i,sd->status.inventory[i].refine); //notify client of failure
+ clif->refine(sd->fd,1,i,sd->status.inventory[i].refine); //notify client of failure
pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
- clif_misceffect(&sd->bl,2); // display failure effect
+ clif->misceffect(&sd->bl,2); // display failure effect
}
return 0;
@@ -7776,15 +7776,15 @@ BUILDIN_FUNC(downrefitem)
sd->status.inventory[i].refine++;
pc_unequipitem(sd,i,2); // status calc will happen in pc_equipitem() below
- clif_refine(sd->fd,2,i,sd->status.inventory[i].refine = sd->status.inventory[i].refine - 2);
- clif_delitem(sd,i,1,3);
+ clif->refine(sd->fd,2,i,sd->status.inventory[i].refine = sd->status.inventory[i].refine - 2);
+ clif->delitem(sd,i,1,3);
//Logs items, got from (N)PC scripts [Lupus]
log_pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i]);
- clif_additem(sd,i,1,0);
+ clif->additem(sd,i,1,0);
pc_equipitem(sd,i,ep);
- clif_misceffect(&sd->bl,2);
+ clif->misceffect(&sd->bl,2);
}
return 0;
@@ -8668,7 +8668,7 @@ BUILDIN_FUNC(itemskill)
sd->skillitem=id;
sd->skillitemlv=lv;
- clif_item_skill(sd,id,lv);
+ clif->item_skill(sd,id,lv);
return 0;
}
/*==========================================
@@ -8684,7 +8684,7 @@ BUILDIN_FUNC(produce)
return 0;
trigger=script_getnum(st,2);
- clif_skill_produce_mix_list(sd, -1, trigger);
+ clif->skill_produce_mix_list(sd, -1, trigger);
return 0;
}
/*==========================================
@@ -8700,7 +8700,7 @@ BUILDIN_FUNC(cooking)
return 0;
trigger=script_getnum(st,2);
- clif_cooking_list(sd, trigger, AM_PHARMACY, 1, 1);
+ clif->cooking_list(sd, trigger, AM_PHARMACY, 1, 1);
return 0;
}
/*==========================================
@@ -9526,9 +9526,9 @@ BUILDIN_FUNC(announce)
(flag == 3) ? SELF :
ALL_CLIENT;
if (fontColor)
- clif_broadcast2(bl, mes, (int)strlen(mes)+1, strtol(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY, target);
+ clif->broadcast2(bl, mes, (int)strlen(mes)+1, strtol(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY, target);
else
- clif_broadcast(bl, mes, (int)strlen(mes)+1, flag&0xf0, target);
+ clif->broadcast(bl, mes, (int)strlen(mes)+1, flag&0xf0, target);
}
else
{
@@ -9552,9 +9552,9 @@ static int buildin_announce_sub(struct block_list *bl, va_list ap)
short fontAlign = (short)va_arg(ap, int);
short fontY = (short)va_arg(ap, int);
if (fontColor)
- clif_broadcast2(bl, mes, len, strtol(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY, SELF);
+ clif->broadcast2(bl, mes, len, strtol(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY, SELF);
else
- clif_broadcast(bl, mes, len, type, SELF);
+ clif->broadcast(bl, mes, len, type, SELF);
return 0;
}
/* Runs item effect on attached character.
@@ -9702,8 +9702,8 @@ BUILDIN_FUNC(getusersname)
/* Temporary fix for bugreport:1023.
* Do not uncomment unless you want thousands of 'next' buttons.
if((disp_num++)%10==0)
- clif_scriptnext(sd,st->oid);*/
- clif_scriptmes(sd,st->oid,pl_sd->status.name);
+ clif->scriptnext(sd,st->oid);*/
+ clif->scriptmes(sd,st->oid,pl_sd->status.name);
}
mapit_free(iter);
@@ -10146,7 +10146,7 @@ BUILDIN_FUNC(homunculus_evolution)
if (sd->hd->homunculus.intimacy > 91000)
merc_hom_evolution(sd->hd);
else
- clif_emotion(&sd->hd->bl, E_SWT);
+ clif->emotion(&sd->hd->bl, E_SWT);
}
return 0;
}
@@ -10175,7 +10175,7 @@ BUILDIN_FUNC(homunculus_mutate)
if ( m_class != -1 && m_id != -1 && m_class&HOM_EVO && m_id&HOM_S && sd->hd->homunculus.level >= 99 )
hom_mutate(sd->hd, homun_id);
else
- clif_emotion(&sd->hd->bl, E_SWT);
+ clif->emotion(&sd->hd->bl, E_SWT);
}
return 0;
}
@@ -10246,7 +10246,7 @@ BUILDIN_FUNC(birthpet)
return 0;
}
- clif_sendegg(sd);
+ clif->sendegg(sd);
return 0;
}
@@ -10332,11 +10332,11 @@ BUILDIN_FUNC(changebase)
if(!sd->disguise && vclass != sd->vd.class_) {
status_set_viewdata(&sd->bl, vclass);
//Updated client view. Base, Weapon and Cloth Colors.
- clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
- clif_changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
+ clif->changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
+ clif->changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
if (sd->vd.cloth_color)
- clif_changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
- clif_skillinfoblock(sd);
+ clif->changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
+ clif->skillinfoblock(sd);
}
return 0;
@@ -10753,7 +10753,7 @@ static int script_mapflag_pvp_sub(struct block_list *bl,va_list ap) {
sd->pvp_won = 0;
sd->pvp_lost = 0;
}
- clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
+ clif->map_property(sd, MAPPROPERTY_FREEPVPZONE);
return 0;
}
BUILDIN_FUNC(setmapflag)
@@ -10798,7 +10798,7 @@ BUILDIN_FUNC(setmapflag)
case MF_PVP_NOGUILD: map[m].flag.pvp_noguild = 1; break;
case MF_GVG:
map[m].flag.gvg = 1;
- clif_map_property_mapall(m, MAPPROPERTY_AGITZONE);
+ clif->map_property_mapall(m, MAPPROPERTY_AGITZONE);
break;
case MF_GVG_NOPARTY: map[m].flag.gvg_noparty = 1; break;
case MF_NOTRADE: map[m].flag.notrade = 1; break;
@@ -10880,13 +10880,13 @@ BUILDIN_FUNC(removemapflag)
case MF_NOZENYPENALTY: map[m].flag.nozenypenalty = 0; break;
case MF_PVP:
map[m].flag.pvp = 0;
- clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
+ clif->map_property_mapall(m, MAPPROPERTY_NOTHING);
break;
case MF_PVP_NOPARTY: map[m].flag.pvp_noparty = 0; break;
case MF_PVP_NOGUILD: map[m].flag.pvp_noguild = 0; break;
case MF_GVG:
map[m].flag.gvg = 0;
- clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
+ clif->map_property_mapall(m, MAPPROPERTY_NOTHING);
break;
case MF_GVG_NOPARTY: map[m].flag.gvg_noparty = 0; break;
case MF_NOTRADE: map[m].flag.notrade = 0; break;
@@ -10950,7 +10950,7 @@ BUILDIN_FUNC(pvpon)
return 0; // nothing to do
map[m].flag.pvp = 1;
- clif_map_property_mapall(m, MAPPROPERTY_FREEPVPZONE);
+ clif->map_property_mapall(m, MAPPROPERTY_FREEPVPZONE);
if(battle_config.pk_mode) // disable ranking functions if pk_mode is on [Valaris]
return 0;
@@ -10976,7 +10976,7 @@ BUILDIN_FUNC(pvpon)
static int buildin_pvpoff_sub(struct block_list *bl,va_list ap)
{
TBL_PC* sd = (TBL_PC*)bl;
- clif_pvpset(sd, 0, 0, 2);
+ clif->pvpset(sd, 0, 0, 2);
if (sd->pvp_timer != INVALID_TIMER) {
delete_timer(sd->pvp_timer, pc_calc_pvprank_timer);
sd->pvp_timer = INVALID_TIMER;
@@ -10995,7 +10995,7 @@ BUILDIN_FUNC(pvpoff)
return 0; //fixed Lupus
map[m].flag.pvp = 0;
- clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
+ clif->map_property_mapall(m, MAPPROPERTY_NOTHING);
if(battle_config.pk_mode) // disable ranking options if pk_mode is on [Valaris]
return 0;
@@ -11013,7 +11013,7 @@ BUILDIN_FUNC(gvgon)
m = map_mapname2mapid(str);
if(m >= 0 && !map[m].flag.gvg) {
map[m].flag.gvg = 1;
- clif_map_property_mapall(m, MAPPROPERTY_AGITZONE);
+ clif->map_property_mapall(m, MAPPROPERTY_AGITZONE);
}
return 0;
@@ -11027,7 +11027,7 @@ BUILDIN_FUNC(gvgoff)
m = map_mapname2mapid(str);
if(m >= 0 && map[m].flag.gvg) {
map[m].flag.gvg = 0;
- clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
+ clif->map_property_mapall(m, MAPPROPERTY_NOTHING);
}
return 0;
@@ -11056,16 +11056,16 @@ BUILDIN_FUNC(emotion)
else
sd = script_rid2sd(st);
if (sd)
- clif_emotion(&sd->bl,type);
+ clif->emotion(&sd->bl,type);
} else
if( script_hasdata(st,4) )
{
TBL_NPC *nd = npc_name2id(script_getstr(st,4));
if(nd)
- clif_emotion(&nd->bl,type);
+ clif->emotion(&nd->bl,type);
}
else
- clif_emotion(map_id2bl(st->oid),type);
+ clif->emotion(map_id2bl(st->oid),type);
return 0;
}
@@ -11182,7 +11182,7 @@ BUILDIN_FUNC(flagemblem)
} else {
bool changed = ( nd->u.scr.guild_id != g_id )?true:false;
nd->u.scr.guild_id = g_id;
- clif_guild_emblem_area(&nd->bl);
+ clif->guild_emblem_area(&nd->bl);
/* guild flag caching */
if( g_id ) /* adding a id */
guild_flag_add(nd);
@@ -11344,7 +11344,7 @@ BUILDIN_FUNC(successremovecards) {
item_tmp.identify = 1;
if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){ // get back the cart in inventory
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
@@ -11366,11 +11366,11 @@ BUILDIN_FUNC(successremovecards) {
pc_delitem(sd,i,1,0,3,LOG_TYPE_SCRIPT);
if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){ //chk if can be spawn in inventory otherwise put on floor
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
- clif_misceffect(&sd->bl,3);
+ clif->misceffect(&sd->bl,3);
}
return 0;
}
@@ -11411,7 +11411,7 @@ BUILDIN_FUNC(failedremovecards) {
item_tmp.identify = 1;
if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
@@ -11440,11 +11440,11 @@ BUILDIN_FUNC(failedremovecards) {
pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
- clif_misceffect(&sd->bl,2);
+ clif->misceffect(&sd->bl,2);
}
return 0;
@@ -11576,7 +11576,7 @@ BUILDIN_FUNC(wedding_effect)
bl=map_id2bl(st->oid);
} else
bl=&sd->bl;
- clif_wedding_effect(bl);
+ clif->wedding_effect(bl);
return 0;
}
BUILDIN_FUNC(divorce)
@@ -12183,7 +12183,7 @@ BUILDIN_FUNC(classchange)
_class=script_getnum(st,2);
type=script_getnum(st,3);
- clif_class_change(bl,_class,type);
+ clif->class_change(bl,_class,type);
return 0;
}
@@ -12198,11 +12198,11 @@ BUILDIN_FUNC(misceffect)
if(st->oid && st->oid != fake_nd->bl.id) {
struct block_list *bl = map_id2bl(st->oid);
if (bl)
- clif_specialeffect(bl,type,AREA);
+ clif->specialeffect(bl,type,AREA);
} else{
TBL_PC *sd=script_rid2sd(st);
if(sd)
- clif_specialeffect(&sd->bl,type,AREA);
+ clif->specialeffect(&sd->bl,type,AREA);
}
return 0;
}
@@ -12218,7 +12218,7 @@ BUILDIN_FUNC(playBGM)
{
name = script_getstr(st,2);
- clif_playBGM(sd, name);
+ clif->playBGM(sd, name);
}
return 0;
@@ -12228,7 +12228,7 @@ static int playBGM_sub(struct block_list* bl,va_list ap)
{
const char* name = va_arg(ap,const char*);
- clif_playBGM(BL_CAST(BL_PC, bl), name);
+ clif->playBGM(BL_CAST(BL_PC, bl), name);
return 0;
}
@@ -12237,7 +12237,7 @@ static int playBGM_foreachpc_sub(struct map_session_data* sd, va_list args)
{
const char* name = va_arg(args, const char*);
- clif_playBGM(sd, name);
+ clif->playBGM(sd, name);
return 0;
}
@@ -12285,7 +12285,7 @@ BUILDIN_FUNC(soundeffect)
if(sd)
{
- clif_soundeffect(sd,&sd->bl,name,type);
+ clif->soundeffect(sd,&sd->bl,name,type);
}
return 0;
}
@@ -12295,7 +12295,7 @@ int soundeffect_sub(struct block_list* bl,va_list ap)
char* name = va_arg(ap,char*);
int type = va_arg(ap,int);
- clif_soundeffect((TBL_PC *)bl, bl, name, type);
+ clif->soundeffect((TBL_PC *)bl, bl, name, type);
return 0;
}
@@ -12321,7 +12321,7 @@ BUILDIN_FUNC(soundeffectall)
if(!script_hasdata(st,4))
{ // area around
- clif_soundeffectall(bl, name, type, AREA);
+ clif->soundeffectall(bl, name, type, AREA);
}
else
if(!script_hasdata(st,5))
@@ -12519,7 +12519,7 @@ BUILDIN_FUNC(skilleffect)
uint16 skill_lv=script_getnum(st,3);
sd=script_rid2sd(st);
- clif_skill_nodamage(&sd->bl,&sd->bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(&sd->bl,&sd->bl,skill_id,skill_lv,1);
return 0;
}
@@ -12539,7 +12539,7 @@ BUILDIN_FUNC(npcskilleffect)
int y=script_getnum(st,5);
if (bl)
- clif_skill_poseffect(bl,skill_id,skill_lv,x,y,gettick());
+ clif->skill_poseffect(bl,skill_id,skill_lv,x,y,gettick());
return 0;
}
@@ -12560,16 +12560,16 @@ BUILDIN_FUNC(specialeffect)
{
TBL_NPC *nd = npc_name2id(script_getstr(st,4));
if(nd)
- clif_specialeffect(&nd->bl, type, target);
+ clif->specialeffect(&nd->bl, type, target);
}
else
{
if (target == SELF) {
TBL_PC *sd=script_rid2sd(st);
if (sd)
- clif_specialeffect_single(bl,type,sd->fd);
+ clif->specialeffect_single(bl,type,sd->fd);
} else {
- clif_specialeffect(bl, type, target);
+ clif->specialeffect(bl, type, target);
}
}
@@ -12586,7 +12586,7 @@ BUILDIN_FUNC(specialeffect2)
sd = map_nick2sd(script_getstr(st,4));
if (sd)
- clif_specialeffect(&sd->bl, type, target);
+ clif->specialeffect(&sd->bl, type, target);
return 0;
}
@@ -12663,7 +12663,7 @@ BUILDIN_FUNC(dispbottom)
const char *message;
message=script_getstr(st,2);
if(sd)
- clif_disp_onlyself(sd,message,(int)strlen(message));
+ clif->disp_onlyself(sd,message,(int)strlen(message));
return 0;
}
@@ -12683,7 +12683,7 @@ BUILDIN_FUNC(recovery)
status_revive(&sd->bl, 100, 100);
else
status_percent_heal(&sd->bl, 100, 100);
- clif_displaymessage(sd->fd,msg_txt(680));
+ clif->displaymessage(sd->fd,msg_txt(680));
}
mapit_free(iter);
return 0;
@@ -12898,7 +12898,7 @@ BUILDIN_FUNC(message)
if((pl_sd=map_nick2sd((char *) player)) == NULL)
return 0;
- clif_displaymessage(pl_sd->fd, msg);
+ clif->displaymessage(pl_sd->fd, msg);
return 0;
}
@@ -12919,7 +12919,7 @@ BUILDIN_FUNC(npctalk)
safestrncpy(name, nd->name, sizeof(name));
strtok(name, "#"); // discard extra name identifier if present
safesnprintf(message, sizeof(message), "%s : %s", name, str);
- clif_message(&nd->bl, message);
+ clif->message(&nd->bl, message);
}
return 0;
@@ -13230,7 +13230,7 @@ BUILDIN_FUNC(summon)
check_event(st, event);
}
- clif_skill_poseffect(&sd->bl,AM_CALLHOMUN,1,sd->bl.x,sd->bl.y,tick);
+ clif->skill_poseffect(&sd->bl,AM_CALLHOMUN,1,sd->bl.x,sd->bl.y,tick);
md = mob_once_spawn_sub(&sd->bl, sd->bl.m, sd->bl.x, sd->bl.y, str, _class, event, SZ_SMALL, AI_NONE);
if (md) {
@@ -13240,7 +13240,7 @@ BUILDIN_FUNC(summon)
delete_timer(md->deletetimer, mob_timer_delete);
md->deletetimer = add_timer(tick+(timeout>0?timeout*1000:60000),mob_timer_delete,md->bl.id,0);
mob_spawn (md); //Now it is ready for spawning.
- clif_specialeffect(&md->bl,344,AREA);
+ clif->specialeffect(&md->bl,344,AREA);
sc_start4(&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000);
}
return 0;
@@ -14403,8 +14403,8 @@ BUILDIN_FUNC(setnpcdisplay)
npc_setclass(nd, class_);
else if( size != -1 )
{ // Required to update the visual size
- clif_clearunit_area(&nd->bl, CLR_OUTSIGHT);
- clif_spawn(&nd->bl);
+ clif->clearunit_area(&nd->bl, CLR_OUTSIGHT);
+ clif->spawn(&nd->bl);
}
script_pushint(st,0);
@@ -14723,11 +14723,11 @@ BUILDIN_FUNC(callshop)
{
case 1: npc_buysellsel(sd,nd->bl.id,0); break; //Buy window
case 2: npc_buysellsel(sd,nd->bl.id,1); break; //Sell window
- default: clif_npcbuysell(sd,nd->bl.id); break; //Show menu
+ default: clif->npcbuysell(sd,nd->bl.id); break; //Show menu
}
}
else
- clif_cashshop_show(sd, nd);
+ clif->cashshop_show(sd, nd);
sd->npc_shopid = nd->bl.id;
script_pushint(st,1);
@@ -15346,7 +15346,7 @@ BUILDIN_FUNC(unitattack)
switch( unit_bl->type )
{
case BL_PC:
- clif_parse_ActionRequest_sub(((TBL_PC *)unit_bl), actiontype > 0 ? 0x07 : 0x00, target_bl->id, gettick());
+ clif->ActionRequest_sub(((TBL_PC *)unit_bl), actiontype > 0 ? 0x07 : 0x00, target_bl->id, gettick());
script_pushint(st, 1);
return 0;
case BL_MOB:
@@ -15404,9 +15404,9 @@ BUILDIN_FUNC(unittalk)
struct StringBuf sbuf;
StringBuf_Init(&sbuf);
StringBuf_Printf(&sbuf, "%s : %s", status_get_name(bl), message);
- clif_message(bl, StringBuf_Value(&sbuf));
+ clif->message(bl, StringBuf_Value(&sbuf));
if( bl->type == BL_PC )
- clif_displaymessage(((TBL_PC*)bl)->fd, StringBuf_Value(&sbuf));
+ clif->displaymessage(((TBL_PC*)bl)->fd, StringBuf_Value(&sbuf));
StringBuf_Destroy(&sbuf);
}
@@ -15428,7 +15428,7 @@ BUILDIN_FUNC(unitemote)
emotion = script_getnum(st,3);
bl = map_id2bl(unit_id);
if( bl != NULL )
- clif_emotion(bl, emotion);
+ clif->emotion(bl, emotion);
return 0;
}
@@ -15693,7 +15693,7 @@ BUILDIN_FUNC(openauction)
if( sd == NULL )
return 0;
- clif_Auction_openwindow(sd);
+ clif->auction_openwindow(sd);
return 0;
}
@@ -15911,7 +15911,7 @@ BUILDIN_FUNC(mercenary_set_faith)
*calls += value;
*calls = cap_value(*calls, 0, INT_MAX);
if( mercenary_get_guild(sd->md) == guild )
- clif_mercenary_updatestatus(sd,SP_MERCFAITH);
+ clif->mercenary_updatestatus(sd,SP_MERCFAITH);
return 0;
}
@@ -15930,7 +15930,7 @@ BUILDIN_FUNC(readbook)
book_id = script_getnum(st,2);
page = script_getnum(st,3);
- clif_readbook(sd->fd, book_id, page);
+ clif->readbook(sd->fd, book_id, page);
return 0;
}
@@ -16003,7 +16003,7 @@ BUILDIN_FUNC(showevent)
if( color < 0 || color > 3 )
color = 0; // set default color
- clif_quest_show_event(sd, &nd->bl, state, color);
+ clif->quest_show_event(sd, &nd->bl, state, color);
return 0;
}
@@ -16160,7 +16160,7 @@ BUILDIN_FUNC(bg_monster_set_team)
mob_stop_attack(md);
mob_stop_walking(md, 0);
md->target_id = md->attacked_id = 0;
- clif_charnameack(0, &md->bl);
+ clif->charnameack(0, &md->bl);
return 0;
}
@@ -16230,7 +16230,7 @@ BUILDIN_FUNC(bg_updatescore)
map[m].bgscore_lion = script_getnum(st,3);
map[m].bgscore_eagle = script_getnum(st,4);
- clif_bg_updatescore(m);
+ clif->bg_updatescore(m);
return 0;
}
@@ -16642,7 +16642,7 @@ BUILDIN_FUNC(setfont)
else
sd->user_font = 0;
- clif_font(sd);
+ clif->font(sd);
return 0;
}
@@ -16681,7 +16681,7 @@ static int buildin_mobuseskill_sub(struct block_list *bl,va_list ap)
else
unit_skilluse_id2(&md->bl, tbl->id, skill_id, skill_lv, casttime, cancel);
- clif_emotion(&md->bl, emotion);
+ clif->emotion(&md->bl, emotion);
return 0;
}
@@ -16739,7 +16739,7 @@ BUILDIN_FUNC(progressbar)
sd->progressbar.npc_id = st->oid;
sd->progressbar.timeout = gettick() + second*1000;
- clif_progressbar(sd, strtol(color, (char **)NULL, 0), second);
+ clif->progressbar(sd, strtol(color, (char **)NULL, 0), second);
return 0;
}
@@ -16856,7 +16856,7 @@ BUILDIN_FUNC(showdigit)
}
}
- clif_showdigit(sd, (unsigned char)type, value);
+ clif->showdigit(sd, (unsigned char)type, value);
return 0;
}
/**
@@ -16866,7 +16866,7 @@ BUILDIN_FUNC(makerune) {
TBL_PC* sd;
if( (sd = script_rid2sd(st)) == NULL )
return 0;
- clif_skill_produce_mix_list(sd,RK_RUNEMASTERY,24);
+ clif->skill_produce_mix_list(sd,RK_RUNEMASTERY,24);
sd->itemid = script_getnum(st,2);
return 0;
}
@@ -17286,7 +17286,7 @@ BUILDIN_FUNC(getrandgroupitem) {
// if not pet egg
if (!pet_create_egg(sd, nameid)) {
if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_SCRIPT))) {
- clif_additem(sd, 0, 0, flag);
+ clif->additem(sd, 0, 0, flag);
if( pc_candrop(sd,&item_tmp) )
map_addflooritem(&item_tmp,get_count,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
diff --git a/src/map/searchstore.c b/src/map/searchstore.c
index c59c13bed..cac79a242 100644
--- a/src/map/searchstore.c
+++ b/src/map/searchstore.c
@@ -6,7 +6,7 @@
#include "../common/showmsg.h" // ShowError, ShowWarning
#include "../common/strlib.h" // safestrncpy
#include "battle.h" // battle_config.*
-#include "clif.h" // clif_open_search_store_info, clif_search_store_info_*
+#include "clif.h" // clif->open_search_store_info, clif->search_store_info_*
#include "pc.h" // struct map_session_data
#include "searchstore.h" // struct s_search_store_info
@@ -106,7 +106,7 @@ bool searchstore_open(struct map_session_data* sd, unsigned int uses, unsigned s
sd->searchstore.uses = uses;
sd->searchstore.effect = effect;
- clif_open_search_store_info(sd);
+ clif->open_search_store_info(sd);
return true;
}
@@ -141,13 +141,13 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
if( sd->searchstore.nextquerytime > querytime )
{
- clif_search_store_info_failed(sd, SSI_FAILED_LIMIT_SEARCH_TIME);
+ clif->search_store_info_failed(sd, SSI_FAILED_LIMIT_SEARCH_TIME);
return;
}
if( !sd->searchstore.uses )
{
- clif_search_store_info_failed(sd, SSI_FAILED_SEARCH_CNT);
+ clif->search_store_info_failed(sd, SSI_FAILED_SEARCH_CNT);
return;
}
@@ -157,7 +157,7 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
if( !itemdb_exists(itemlist[i]) )
{
ShowWarning("searchstore_query: Client resolved item %hu is not known.\n", itemlist[i]);
- clif_search_store_info_failed(sd, SSI_FAILED_NOTHING_SEARCH_ITEM);
+ clif->search_store_info_failed(sd, SSI_FAILED_NOTHING_SEARCH_ITEM);
return;
}
}
@@ -166,7 +166,7 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
if( !itemdb_exists(cardlist[i]) )
{
ShowWarning("searchstore_query: Client resolved card %hu is not known.\n", cardlist[i]);
- clif_search_store_info_failed(sd, SSI_FAILED_NOTHING_SEARCH_ITEM);
+ clif->search_store_info_failed(sd, SSI_FAILED_NOTHING_SEARCH_ITEM);
return;
}
}
@@ -205,7 +205,7 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
if( !store_searchall(pl_sd, &s) )
{// exceeded result size
- clif_search_store_info_failed(sd, SSI_FAILED_OVER_MAXCOUNT);
+ clif->search_store_info_failed(sd, SSI_FAILED_OVER_MAXCOUNT);
break;
}
}
@@ -218,7 +218,7 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
sd->searchstore.items = (struct s_search_store_info_item*)aRealloc(sd->searchstore.items, sizeof(struct s_search_store_info_item)*sd->searchstore.count);
// present results
- clif_search_store_info_ack(sd);
+ clif->search_store_info_ack(sd);
// one page displayed
sd->searchstore.pages++;
@@ -229,10 +229,10 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
searchstore_clear(sd);
// update uses
- clif_search_store_info_ack(sd);
+ clif->search_store_info_ack(sd);
// notify of failure
- clif_search_store_info_failed(sd, SSI_FAILED_NOTHING_SEARCH_ITEM);
+ clif->search_store_info_failed(sd, SSI_FAILED_NOTHING_SEARCH_ITEM);
}
}
@@ -257,7 +257,7 @@ void searchstore_next(struct map_session_data* sd)
}
// present results
- clif_search_store_info_ack(sd);
+ clif->search_store_info_ack(sd);
// one more page displayed
sd->searchstore.pages++;
@@ -308,19 +308,19 @@ void searchstore_click(struct map_session_data* sd, int account_id, int store_id
if( i == sd->searchstore.count )
{// no such result, crafted
ShowWarning("searchstore_click: Received request with item %hu of account %d, which is not part of current result set (account_id=%d, char_id=%d).\n", nameid, account_id, sd->bl.id, sd->status.char_id);
- clif_search_store_info_failed(sd, SSI_FAILED_SSILIST_CLICK_TO_OPEN_STORE);
+ clif->search_store_info_failed(sd, SSI_FAILED_SSILIST_CLICK_TO_OPEN_STORE);
return;
}
if( ( pl_sd = map_id2sd(account_id) ) == NULL )
{// no longer online
- clif_search_store_info_failed(sd, SSI_FAILED_SSILIST_CLICK_TO_OPEN_STORE);
+ clif->search_store_info_failed(sd, SSI_FAILED_SSILIST_CLICK_TO_OPEN_STORE);
return;
}
if( !searchstore_hasstore(pl_sd, sd->searchstore.type) || searchstore_getstoreid(pl_sd, sd->searchstore.type) != store_id )
{// no longer vending/buying or not same shop
- clif_search_store_info_failed(sd, SSI_FAILED_SSILIST_CLICK_TO_OPEN_STORE);
+ clif->search_store_info_failed(sd, SSI_FAILED_SSILIST_CLICK_TO_OPEN_STORE);
return;
}
@@ -328,7 +328,7 @@ void searchstore_click(struct map_session_data* sd, int account_id, int store_id
if( !store_search(pl_sd, nameid) )
{// item no longer being sold/bought
- clif_search_store_info_failed(sd, SSI_FAILED_SSILIST_CLICK_TO_OPEN_STORE);
+ clif->search_store_info_failed(sd, SSI_FAILED_SSILIST_CLICK_TO_OPEN_STORE);
return;
}
@@ -339,11 +339,11 @@ void searchstore_click(struct map_session_data* sd, int account_id, int store_id
if( sd->bl.m != pl_sd->bl.m )
{// not on same map, wipe previous marker
- clif_search_store_info_click_ack(sd, -1, -1);
+ clif->search_store_info_click_ack(sd, -1, -1);
}
else
{
- clif_search_store_info_click_ack(sd, pl_sd->bl.x, pl_sd->bl.y);
+ clif->search_store_info_click_ack(sd, pl_sd->bl.x, pl_sd->bl.y);
}
break;
diff --git a/src/map/skill.c b/src/map/skill.c
index 3d673d41e..ea70e2fe2 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -502,7 +502,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
}
if (sd->blockskill[idx] > 0) {
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_SKILLINTERVAL, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_SKILLINTERVAL, 0);
return 1;
}
@@ -515,7 +515,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
for(i = 0; i < map[m].zone->disabled_skills_count; i++) {
if( skill_id == map[m].zone->disabled_skills[i] ) {
- clif_msg(sd, SKILL_CANT_USE_AREA); // This skill cannot be used within this area
+ clif->msg(sd, SKILL_CANT_USE_AREA); // This skill cannot be used within this area
return 1;
}
}
@@ -528,7 +528,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
case RETURN_TO_ELDICASTES:
case ALL_GUARDIAN_RECALL:
if(map[m].flag.nowarp) {
- clif_skill_teleportmessage(sd,0);
+ clif->skill_teleportmessage(sd,0);
return 1;
}
return 0;
@@ -536,7 +536,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
case SC_FATALMENACE:
case SC_DIMENSIONDOOR:
if(map[m].flag.noteleport) {
- clif_skill_teleportmessage(sd,0);
+ clif->skill_teleportmessage(sd,0);
return 1;
}
return 0; // gonna be checked in 'skill->castend_nodamage_id'
@@ -544,7 +544,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
case WE_CALLPARENT:
case WE_CALLBABY:
if (map[m].flag.nomemo) {
- clif_skill_teleportmessage(sd,1);
+ clif->skill_teleportmessage(sd,1);
return 1;
}
break;
@@ -554,8 +554,8 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
// uncomment for more verbose message.
//char output[150];
//sprintf(output, msg_txt(662), battle_config.min_npc_vendchat_distance);
- //clif_displaymessage(sd->fd, output);
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_THERE_ARE_NPC_AROUND,0);
+ //clif->displaymessage(sd->fd, output);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_THERE_ARE_NPC_AROUND,0);
return 1;
}
case MC_IDENTIFY:
@@ -563,13 +563,13 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
case WZ_ICEWALL:
// noicewall flag [Valaris]
if (map[m].flag.noicewall) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 1;
}
break;
case GC_DARKILLUSION:
if( map_flag_gvg(m) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 1;
}
break;
@@ -579,7 +579,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
!(battle_config.emergency_call&(map[m].flag.gvg || map[m].flag.gvg_castle?8:4)) ||
(battle_config.emergency_call&16 && map[m].flag.nowarpto && !map[m].flag.gvg_castle)
) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 1;
}
break;
@@ -596,7 +596,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
* These skills cannot be used while in mado gear (credits to Xantara)
**/
if( pc_ismadogear(sd) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 1;
}
break;
@@ -607,7 +607,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
case WM_LULLABY_DEEPSLEEP:
case WM_SATURDAY_NIGHT_FEVER:
if( !map_flag_vs(m) ) {
- clif_skill_teleportmessage(sd,2); // This skill uses this msg instead of skill fails.
+ clif->skill_teleportmessage(sd,2); // This skill uses this msg instead of skill fails.
return 1;
}
break;
@@ -798,9 +798,9 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
(temp=pc_checkskill(sd,RG_SNATCHER)) > 0 &&
(temp*15 + 55) + pc_checkskill(sd,TF_STEAL)*10 > rnd()%1000) {
if(pc_steal_item(sd,bl,pc_checkskill(sd,TF_STEAL)))
- clif_skill_nodamage(src,bl,TF_STEAL,temp,1);
+ clif->skill_nodamage(src,bl,TF_STEAL,temp,1);
else
- clif_skill_fail(sd,RG_SNATCHER,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,RG_SNATCHER,USESKILL_FAIL_LEVEL,0);
}
// Chance to trigger Taekwon kicks [Dralnu]
if(sc && !sc->data[SC_COMBO]) {
@@ -864,7 +864,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
if(!sc_start2(bl,SC_POISON,(4*skill_lv+10),skill_lv,src->id,skill->get_time2(skill_id,skill_lv))
&& sd && skill_id==TF_POISON
)
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
case AS_SONICBLOW:
@@ -963,7 +963,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
case AM_ACIDTERROR:
sc_start2(bl,SC_BLEEDING,(skill_lv*3),skill_lv,src->id,skill->get_time2(skill_id,skill_lv));
if (skill->break_equip(bl, EQP_ARMOR, 100*skill->get_time(skill_id,skill_lv), BCT_ENEMY))
- clif_emotion(bl,E_OMG);
+ clif->emotion(bl,E_OMG);
break;
case AM_DEMONSTRATION:
@@ -1153,7 +1153,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
if (sstatus->dex > tstatus->dex)
rate += (sstatus->dex - tstatus->dex)/5; //TODO: Made up formula
skill->strip_equip(bl, EQP_WEAPON, rate, skill_lv, skill->get_time(skill_id,skill_lv));
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case NPC_EVILLAND:
sc_start(bl,SC_BLIND,5*skill_lv,skill_lv,skill->get_time2(skill_id,skill_lv));
@@ -1257,7 +1257,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
break;
case LG_MOONSLASHER:
rate = 32 + 8 * skill_lv;
- if( rnd()%100 < rate && dstsd ) // Uses skill->addtimerskill to avoid damage and setsit packet overlaping. Officially clif_setsit is received about 500 ms after damage packet.
+ if( rnd()%100 < rate && dstsd ) // Uses skill->addtimerskill to avoid damage and setsit packet overlaping. Officially clif->setsit is received about 500 ms after damage packet.
skill->addtimerskill(src,tick+500,bl->id,0,0,skill_id,skill_lv,BF_WEAPON,0);
else if( dstmd && !is_boss(bl) )
sc_start(bl,SC_STOP,100,skill_lv,skill->get_time(skill_id,skill_lv));
@@ -1463,7 +1463,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
if (DIFF_TICK(ud->canact_tick, tick + rate) < 0){
ud->canact_tick = tick+rate;
if ( battle_config.display_status_timers )
- clif_status_change(src, SI_ACTIONDELAY, 1, rate, 0, 0, 0);
+ clif->status_change(src, SI_ACTIONDELAY, 1, rate, 0, 0, 0);
}
}
}
@@ -1560,7 +1560,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
if (DIFF_TICK(ud->canact_tick, tick + rate) < 0){
ud->canact_tick = tick+rate;
if ( battle_config.display_status_timers && sd )
- clif_status_change(src, SI_ACTIONDELAY, 1, rate, 0, 0, 0);
+ clif->status_change(src, SI_ACTIONDELAY, 1, rate, 0, 0, 0);
}
}
}
@@ -1763,7 +1763,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
TBL_HOM *hd = (TBL_HOM*)src;
hd->homunculus.intimacy = 200;
if (hd->master)
- clif_send_homdata(hd->master,SP_INTIMATE,hd->homunculus.intimacy/100);
+ clif->send_homdata(hd->master,SP_INTIMATE,hd->homunculus.intimacy/100);
}
break;
case CR_GRANDCROSS:
@@ -1781,7 +1781,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
(rate=pc_checkskill(sd,HW_SOULDRAIN))>0
){ //Soul Drain should only work on targetted spells [Skotlex]
if (pc_issit(sd)) pc_setstand(sd); //Character stuck in attacking animation while 'sitting' fix. [Skotlex]
- clif_skill_nodamage(src,bl,HW_SOULDRAIN,rate,1);
+ clif->skill_nodamage(src,bl,HW_SOULDRAIN,rate,1);
status_heal(src, 0, status_get_lv(bl)*(95+15*rate)/100, 2);
}
@@ -1896,7 +1896,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
if (DIFF_TICK(ud->canact_tick, tick + rate) < 0){
ud->canact_tick = tick+rate;
if ( battle_config.display_status_timers && dstsd )
- clif_status_change(bl, SI_ACTIONDELAY, 1, rate, 0, 0, 0);
+ clif->status_change(bl, SI_ACTIONDELAY, 1, rate, 0, 0, 0);
}
}
}
@@ -2010,7 +2010,7 @@ int skill_break_equip (struct block_list *bl, unsigned short where, int rate, in
pc_unequipitem(sd, j, 3);
}
}
- clif_equiplist(sd);
+ clif->equiplist(sd);
}
return where; //Return list of pieces broken.
@@ -2124,7 +2124,7 @@ int skill_magic_reflect(struct block_list* src, struct block_list* bl, int type)
if( sc->data[SC_KAITE] && (src->type == BL_PC || status_get_lv(src) <= 80) )
{// Kaite only works against non-players if they are low-level.
- clif_specialeffect(bl, 438, AREA);
+ clif->specialeffect(bl, 438, AREA);
if( --sc->data[SC_KAITE]->val2 <= 0 )
status_change_end(bl, SC_KAITE, INVALID_TIMER);
return 2;
@@ -2272,7 +2272,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
nbl = battle->get_enemy_area(bl,bl->x,bl->y,2,BL_CHAR,bl->id);
if( nbl ){ // Only one target is chosen.
damage = damage / 2; // Deflect half of the damage to a target nearby
- clif_skill_damage(bl, nbl, tick, status_get_amotion(src), 0, status_fix_damage(bl,nbl,damage,0), dmg.div_, OB_OBOROGENSOU_TRANSITION_ATK, -1, 6);
+ clif->skill_damage(bl, nbl, tick, status_get_amotion(src), 0, status_fix_damage(bl,nbl,damage,0), dmg.div_, OB_OBOROGENSOU_TRANSITION_ATK, -1, 6);
}
}
@@ -2344,7 +2344,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
{
//TODO: This code was taken from Triple Blows, is this even how it should be? [Skotlex]
sc_start2(src,SC_COMBO,100,HT_POWER,bl->id,2000);
- clif_combo_delay(src,2000);
+ clif->combo_delay(src,2000);
}
break;
case TK_COUNTER:
@@ -2376,14 +2376,14 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
flag = DIFF_TICK(sd->ud.canact_tick, tick);
if (flag < 1) flag = 1;
sc_start2(src,SC_COMBO,100,skill_id,bl->id,flag);
- clif_combo_delay(src, flag);
+ clif->combo_delay(src, flag);
}
}
//Display damage.
switch( skill_id ) {
case PA_GOSPEL: //Should look like Holy Cross [Skotlex]
- dmg.dmotion = clif_skill_damage(dsrc,bl,tick,dmg.amotion,dmg.dmotion, damage, dmg.div_, CR_HOLYCROSS, -1, 5);
+ dmg.dmotion = clif->skill_damage(dsrc,bl,tick,dmg.amotion,dmg.dmotion, damage, dmg.div_, CR_HOLYCROSS, -1, 5);
break;
//Skills that need be passed as a normal attack for the client to display correctly.
case HVAN_EXPLOSION:
@@ -2396,27 +2396,27 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
case NPC_CRITICALSLASH:
case TF_DOUBLE:
case GS_CHAINACTION:
- dmg.dmotion = clif_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,dmg.type,dmg.damage2);
+ dmg.dmotion = clif->damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,dmg.type,dmg.damage2);
break;
case AS_SPLASHER:
if( flag&SD_ANIMATION ) // the surrounding targets
- dmg.dmotion = clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, -1, 5); // needs -1 as skill level
+ dmg.dmotion = clif->skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, -1, 5); // needs -1 as skill level
else // the central target doesn't display an animation
- dmg.dmotion = clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, -2, 5); // needs -2(!) as skill level
+ dmg.dmotion = clif->skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, -2, 5); // needs -2(!) as skill level
break;
case WL_HELLINFERNO:
case SR_EARTHSHAKER:
- dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,1,skill_id,-2,6);
+ dmg.dmotion = clif->skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,1,skill_id,-2,6);
break;
case WL_SOULEXPANSION:
case WL_COMET:
case KO_MUCHANAGE:
case NJ_HUUMA:
- dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,skill_id,skill_lv,8);
+ dmg.dmotion = clif->skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,skill_id,skill_lv,8);
break;
case WL_CHAINLIGHTNING_ATK:
- dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,1,WL_CHAINLIGHTNING,-2,6);
+ dmg.dmotion = clif->skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,1,WL_CHAINLIGHTNING,-2,6);
break;
case LG_OVERBRAND_BRANDISH:
case LG_OVERBRAND_PLUSATK:
@@ -2438,20 +2438,20 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
case EL_HURRICANE_ATK:
case KO_BAKURETSU:
case GN_CRAZYWEED_ATK:
- dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,skill_id,-1,5);
+ dmg.dmotion = clif->skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,skill_id,-1,5);
break;
case GN_SLINGITEM_RANGEMELEEATK:
- dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,GN_SLINGITEM,-2,6);
+ dmg.dmotion = clif->skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,GN_SLINGITEM,-2,6);
break;
case EL_STONE_RAIN:
- dmg.dmotion = clif_skill_damage(dsrc,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,skill_id,-1,(flag&1)?8:5);
+ dmg.dmotion = clif->skill_damage(dsrc,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,skill_id,-1,(flag&1)?8:5);
break;
case WM_SEVERE_RAINSTORM_MELEE:
- dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,WM_SEVERE_RAINSTORM,skill_lv,5);
+ dmg.dmotion = clif->skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,WM_SEVERE_RAINSTORM,skill_lv,5);
break;
case WM_REVERBERATION_MELEE:
case WM_REVERBERATION_MAGIC:
- dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,WM_REVERBERATION,-2,6);
+ dmg.dmotion = clif->skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion,damage,dmg.div_,WM_REVERBERATION,-2,6);
break;
case HT_CLAYMORETRAP:
case HT_BLASTMINE:
@@ -2460,14 +2460,14 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
case RA_CLUSTERBOMB:
case RA_FIRINGTRAP:
case RA_ICEBOUNDTRAP:
- dmg.dmotion = clif_skill_damage(src,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id,flag&SD_LEVEL?-1:skill_lv, 5);
+ dmg.dmotion = clif->skill_damage(src,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id,flag&SD_LEVEL?-1:skill_lv, 5);
if( dsrc != src ) // avoid damage display redundancy
break;
case HT_LANDMINE:
- dmg.dmotion = clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, -1, type);
+ dmg.dmotion = clif->skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, -1, type);
break;
case WZ_SIGHTBLASTER:
- dmg.dmotion = clif_skill_damage(src,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, flag&SD_LEVEL?-1:skill_lv, 5);
+ dmg.dmotion = clif->skill_damage(src,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, flag&SD_LEVEL?-1:skill_lv, 5);
break;
case AB_DUPLELIGHT_MELEE:
case AB_DUPLELIGHT_MAGIC:
@@ -2478,9 +2478,9 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
if( bl->type == BL_SKILL ){
TBL_SKILL *su = (TBL_SKILL*)bl;
if( su->group && skill->get_inf2(su->group->skill_id)&INF2_TRAP )// show damage on trap targets
- clif_skill_damage(src,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, flag&SD_LEVEL?-1:skill_lv, 5);
+ clif->skill_damage(src,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, flag&SD_LEVEL?-1:skill_lv, 5);
}
- dmg.dmotion = clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, flag&SD_LEVEL?-1:skill_lv, type);
+ dmg.dmotion = clif->skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, flag&SD_LEVEL?-1:skill_lv, type);
break;
}
@@ -2533,7 +2533,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
tsd->status.skill[tsd->reproduceskill_id].id = 0;
tsd->status.skill[tsd->reproduceskill_id].lv = 0;
tsd->status.skill[tsd->reproduceskill_id].flag = 0;
- clif_deleteskill(tsd,tsd->reproduceskill_id);
+ clif->deleteskill(tsd,tsd->reproduceskill_id);
}
tsd->reproduceskill_id = copy_skill;
@@ -2543,14 +2543,14 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
tsd->status.skill[copy_skill].id = copy_skill;
tsd->status.skill[copy_skill].lv = lv;
tsd->status.skill[copy_skill].flag = SKILL_FLAG_PLAGIARIZED;
- clif_addskill(tsd,copy_skill);
+ clif->addskill(tsd,copy_skill);
} else {
lv = skill_lv;
if (tsd->cloneskill_id && tsd->status.skill[tsd->cloneskill_id].flag == SKILL_FLAG_PLAGIARIZED){
tsd->status.skill[tsd->cloneskill_id].id = 0;
tsd->status.skill[tsd->cloneskill_id].lv = 0;
tsd->status.skill[tsd->cloneskill_id].flag = 0;
- clif_deleteskill(tsd,tsd->cloneskill_id);
+ clif->deleteskill(tsd,tsd->cloneskill_id);
}
if ((type = pc_checkskill(tsd,RG_PLAGIARISM)) < lv)
@@ -2563,7 +2563,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
tsd->status.skill[skill_id].id = copy_skill;
tsd->status.skill[skill_id].lv = lv;
tsd->status.skill[skill_id].flag = SKILL_FLAG_PLAGIARIZED;
- clif_addskill(tsd,skill_id);
+ clif->addskill(tsd,skill_id);
}
}
}
@@ -2639,7 +2639,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
case GN_WALLOFTHORN:
unit_stop_walking(bl,1);
skill->blown(dsrc,bl,dmg.blewcount,dir, 0x2 );
- clif_fixpos(bl);
+ clif->fixpos(bl);
break;
default:
skill->blown(dsrc,bl,dmg.blewcount,dir, 0x0 );
@@ -2666,12 +2666,12 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
) && check_distance_bl(bl, d_bl, sce->val3) )
{
if(!rmdamage){
- clif_damage(d_bl,d_bl, gettick(), 0, 0, damage, 0, 0, 0);
+ clif->damage(d_bl,d_bl, gettick(), 0, 0, damage, 0, 0, 0);
status_fix_damage(NULL,d_bl, damage, 0);
} else{ //Reflected magics are done directly on the target not on paladin
//This check is only for magical skill.
//For BF_WEAPON skills types track var rdamage and function battle_calc_return_damage
- clif_damage(bl,bl, gettick(), 0, 0, damage, 0, 0, 0);
+ clif->damage(bl,bl, gettick(), 0, 0, damage, 0, 0, 0);
status_fix_damage(bl,bl, damage, 0);
}
}
@@ -2713,7 +2713,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
battle->delay_damage(tick, dmg.amotion,bl,src,0,CR_REFLECTSHIELD,0,rdamage,ATK_DEF,0,additional_effects);
else
status_fix_damage(bl,src,rdamage,0);
- clif_damage(src,src,tick, dmg.amotion,0,rdamage,1,4,0); // in aegis damage reflected is shown in single hit.
+ clif->damage(src,src,tick, dmg.amotion,0,rdamage,1,4,0); // in aegis damage reflected is shown in single hit.
//Use Reflect Shield to signal this kind of skill trigger. [Skotlex]
if( tsd && src != bl )
battle->drain(tsd, src, rdamage, rdamage, sstatus->race, is_boss(src));
@@ -2733,7 +2733,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
if( ssc && ssc->data[SC_POISONINGWEAPON] && rnd()%100 < 70 + 5*skill_lv ) {
sc_start(bl,ssc->data[SC_POISONINGWEAPON]->val2,100,ssc->data[SC_POISONINGWEAPON]->val1,skill->get_time2(GC_POISONINGWEAPON, 1));
status_change_end(src,SC_POISONINGWEAPON,INVALID_TIMER);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
}
break;
@@ -2790,7 +2790,7 @@ int skill_area_sub (struct block_list *bl, va_list ap) {
if(battle->check_target(src,bl,flag) > 0) {
// several splash skills need this initial dummy packet to display correctly
if (flag&SD_PREAMBLE && skill_area_temp[2] == 0)
- clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
if (flag&(SD_SPLASH|SD_PREAMBLE))
skill_area_temp[2]++;
@@ -3007,11 +3007,11 @@ int skill_check_condition_mercenary(struct block_list *bl, int skill_id, int lv,
if( !(type&2) ) {
if( hp > 0 && status->hp <= (unsigned int)hp ) {
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_HP_INSUFFICIENT, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_HP_INSUFFICIENT, 0);
return 0;
}
if( sp > 0 && status->sp <= (unsigned int)sp ) {
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_SP_INSUFFICIENT, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_SP_INSUFFICIENT, 0);
return 0;
}
}
@@ -3020,7 +3020,7 @@ int skill_check_condition_mercenary(struct block_list *bl, int skill_id, int lv,
switch( state ) {
case ST_MOVE_ENABLE:
if( !unit_can_move(bl) ) {
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
return 0;
}
break;
@@ -3036,7 +3036,7 @@ int skill_check_condition_mercenary(struct block_list *bl, int skill_id, int lv,
index[i] = pc_search_inventory(sd, itemid[i]);
if( index[i] < 0 || sd->status.inventory[index[i]].amount < amount[i] )
{
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
return 0;
}
}
@@ -3204,7 +3204,7 @@ int skill_timerskill(int tid, unsigned int tick, int id, intptr_t data) {
if( (tsd = ((TBL_PC*)target)) && !pc_issit(tsd) ) {
pc_setsit(tsd);
skill->sit(tsd,1);
- clif_sitting(&tsd->bl);
+ clif->sitting(&tsd->bl);
}
}
break;
@@ -3241,7 +3241,7 @@ int skill_timerskill(int tid, unsigned int tick, int id, intptr_t data) {
if( path_search_long(NULL, src->m, src->x, src->y, x, y, CELL_CHKWALL) )
skill->unitsetting(src,skl->skill_id,skl->skill_lv,x,y,skl->flag);
if( path_search_long(NULL, src->m, src->x, src->y, skl->x, skl->y, CELL_CHKWALL) )
- clif_skill_poseffect(src,skl->skill_id,skl->skill_lv,skl->x,skl->y,tick);
+ clif->skill_poseffect(src,skl->skill_id,skl->skill_lv,skl->x,skl->y,tick);
}
else if( path_search_long(NULL, src->m, src->x, src->y, skl->x, skl->y, CELL_CHKWALL) )
skill->unitsetting(src,skl->skill_id,skl->skill_lv,skl->x,skl->y,skl->flag);
@@ -3329,8 +3329,8 @@ int skill_reveal_trap (struct block_list *bl, va_list ap) {
TBL_SKILL *su = (TBL_SKILL*)bl;
if (su->alive && su->group && skill->get_inf2(su->group->skill_id)&INF2_TRAP) { //Reveal trap.
//Change look is not good enough, the client ignores it as an actual trap still. [Skotlex]
- //clif_changetraplook(bl, su->group->unit_id);
- clif_skill_setunit(su);
+ //clif->changetraplook(bl, su->group->unit_id);
+ clif->skill_setunit(su);
return 1;
}
return 0;
@@ -3367,7 +3367,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
sc_type sct = status_skill2sc(skill_id);
if(sct != SC_NONE)
status_change_end(bl, sct, INVALID_TIMER);
- clif_skill_damage(src, bl, tick, status_get_amotion(src), status_get_dmotion(bl), 0, 1, skill_id, skill_lv, skill->get_hit(skill_id));
+ clif->skill_damage(src, bl, tick, status_get_amotion(src), status_get_dmotion(bl), 0, 1, skill_id, skill_lv, skill->get_hit(skill_id));
return 1;
}
@@ -3534,7 +3534,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
break;
case TK_STORMKICK: // Taekwon kicks [Dralnu]
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
skill_area_temp[1] = 0;
map_foreachinrange(skill->attack_area, src,
skill->get_splash(skill_id, skill_lv), splash_target(src),
@@ -3548,7 +3548,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
// teleport to target (if not on WoE grounds)
if( !map_flag_gvg(src->m) && !map[src->m].flag.battleground && unit_movepos(src, bl->x, bl->y, 0, 1) )
- clif_slide(src, bl->x, bl->y);
+ clif->slide(src, bl->x, bl->y);
// cause damage and knockback if the path to target was a straight one
if( path ) {
@@ -3602,7 +3602,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
unit_setdir(bl,dir);
}
else if (sd)
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
}
break;
@@ -3661,9 +3661,9 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
else y = 0;
if( (mbl == src || (!map_flag_gvg(src->m) && !map[src->m].flag.battleground) ) && // only NJ_ISSEN don't have slide effect in GVG
unit_movepos(src, mbl->x+x, mbl->y+y, 1, 1) ) {
- clif_slide(src, src->x, src->y);
+ clif->slide(src, src->x, src->y);
//uncomment this if you want to remove MO_EXTREMITYFIST glitchy walking effect. [malufett]
- //clif_fixpos(src);
+ //clif->fixpos(src);
}
}
break;
@@ -3733,7 +3733,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
heal = skill->attack(skill->get_type(skill_id), src, src, bl, skill_id, skill_lv, tick, sflag);
if( skill_id == NPC_VAMPIRE_GIFT && heal > 0 ) {
- clif_skill_nodamage(NULL, src, AL_HEAL, heal, 1);
+ clif->skill_nodamage(NULL, src, AL_HEAL, heal, 1);
status_heal(src,heal,0,0);
}
} else {
@@ -3741,10 +3741,10 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
case NJ_BAKUENRYU:
case LG_EARTHDRIVE:
case GN_CARTCANNON:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case LG_MOONSLASHER:
- clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
break;
case NPC_EARTHQUAKE://FIXME: Isn't EarthQuake a ground skill after all?
skill->addtimerskill(src,tick+250,src->id,0,0,skill_id,skill_lv,2,flag|BCT_ENEMY|SD_SPLASH|1);
@@ -3799,7 +3799,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
skill_area_temp[0] = map_foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), BL_CHAR, src, skill_id, skill_lv, tick, flag|BCT_ENEMY, skill->area_sub_count);
if( skill_area_temp[0] > 1 ) break; // collision
}
- clif_blown(bl); //Update target pos.
+ clif->blown(bl); //Update target pos.
if (i!=c) { //Splash
skill_area_temp[1] = bl->id;
map_foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|1, skill->castend_damage_id);
@@ -3845,8 +3845,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
}
break;
case CH_PALMSTRIKE: // Palm Strike takes effect 1sec after casting. [Skotlex]
- // clif_skill_nodamage(src,bl,skill_id,skill_lv,0); //Can't make this one display the correct attack animation delay :/
- clif_damage(src,bl,tick,status_get_amotion(src),0,-1,1,4,0); //Display an absorbed damage attack.
+ // clif->skill_nodamage(src,bl,skill_id,skill_lv,0); //Can't make this one display the correct attack animation delay :/
+ clif->damage(src,bl,tick,status_get_amotion(src),0,-1,1,4,0); //Display an absorbed damage attack.
skill->addtimerskill(src, tick + (1000+status_get_amotion(src)), bl->id, 0, 0, skill_id, skill_lv, BF_WEAPON, flag);
break;
@@ -3951,14 +3951,14 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
case SL_STUN:
if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) {
status_change_start(src,SC_STUN,10000,skill_lv,0,0,0,500,10);
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
skill->attack(BF_MAGIC,src,src,bl,skill_id,skill_lv,tick,flag);
break;
case NPC_DARKBREATH:
- clif_emotion(src,E_AG);
+ clif->emotion(src,E_AG);
case SN_FALCONASSAULT:
case PA_PRESSURE:
case CR_ACIDDEMONSTRATION:
@@ -3976,7 +3976,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
case RK_DRAGONBREATH: {
struct status_change *tsc = NULL;
if( (tsc = status_get_sc(bl)) && (tsc->data[SC_HIDING] )) {
- clif_skill_nodamage(src,src,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,src,skill_id,skill_lv,1);
} else
skill->attack(BF_MISC,src,src,bl,skill_id,skill_lv,tick,flag);
}
@@ -3995,12 +3995,12 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
// Celest
case PF_SOULBURN:
if (rnd()%100 < (skill_lv < 5 ? 30 + skill_lv * 10 : 70)) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if (skill_lv == 5)
skill->attack(BF_MAGIC,src,src,bl,skill_id,skill_lv,tick,flag);
status_percent_damage(src, bl, 0, 100, false);
} else {
- clif_skill_nodamage(src,src,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,src,skill_id,skill_lv,1);
if (skill_lv == 5)
skill->attack(BF_MAGIC,src,src,src,skill_id,skill_lv,tick,flag);
status_percent_damage(src, src, 0, 100, false);
@@ -4013,7 +4013,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
int heal = skill->attack( (skill_id == NPC_BLOODDRAIN) ? BF_WEAPON : BF_MAGIC,
src, src, bl, skill_id, skill_lv, tick, flag);
if (heal > 0){
- clif_skill_nodamage(NULL, src, AL_HEAL, heal, 1);
+ clif->skill_nodamage(NULL, src, AL_HEAL, heal, 1);
status_heal(src, heal, 0, 0);
}
}
@@ -4033,14 +4033,14 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
short x, y;
map_search_freecell(bl, 0, &x, &y, 1, 1, 0);
if (unit_movepos(src, x, y, 0, 0))
- clif_slide(src,src->x,src->y);
+ clif->slide(src,src->x,src->y);
}
status_change_end(src, SC_HIDING, INVALID_TIMER);
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
break;
case RK_PHANTOMTHRUST:
unit_setdir(src,map_calc_dir(src, bl->x, bl->y));
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
skill->blown(src,bl,distance_bl(src,bl)-1,unit_getdir(src),0);
if( battle->check_target(src,bl,BCT_ENEMY) )
@@ -4053,7 +4053,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
if( pc_checkskill(sd,RK_RUNEMASTERY) >= ( skill_id == RK_CRUSHSTRIKE ? 7 : 3 ) )
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
else
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
} else //non-sd support
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
break;
@@ -4071,8 +4071,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
if( unit_movepos(src, bl->x+x, bl->y+y, 1, 1) )
{
- clif_slide(src,bl->x+x,bl->y+y);
- clif_fixpos(src); // the official server send these two packts.
+ clif->slide(src,bl->x+x,bl->y+y);
+ clif->fixpos(src); // the official server send these two packts.
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
if( rnd()%100 < 4 * skill_lv )
skill->castend_damage_id(src,bl,GC_CROSSIMPACT,skill_lv,tick,flag);
@@ -4085,12 +4085,12 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
if( sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == GC_WEAPONBLOCKING )
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
else if( sd )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_GC_WEAPONBLOCKING,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_GC_WEAPONBLOCKING,0);
break;
case GC_CROSSRIPPERSLASHER:
if( sd && !(sc && sc->data[SC_ROLLINGCUTTER]) )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_CONDITION,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_CONDITION,0);
else
{
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
@@ -4107,7 +4107,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
}
break;
case WL_CHAINLIGHTNING:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
skill->addtimerskill(src,tick + 150,bl->id,3,0,WL_CHAINLIGHTNING_ATK,skill_lv,4+skill_lv,flag);
break;
case WL_DRAINLIFE:
@@ -4123,7 +4123,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
if( heal && rnd()%100 < rate )
{
status_heal(src, heal, 0, 0);
- clif_skill_nodamage(NULL, src, AL_HEAL, heal, 1);
+ clif->skill_nodamage(NULL, src, AL_HEAL, heal, 1);
}
}
break;
@@ -4144,7 +4144,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
if( j < 4 )
{ // Need 4 spheres minimum
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
@@ -4168,7 +4168,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
case WLS_STONE: subskill = WL_TETRAVORTEX_GROUND; k |= 8; break;
}
skill->addtimerskill(src, tick + i * 200, bl->id, k, 0, subskill, skill_lv, i, flag);
- clif_skill_nodamage(src, bl, subskill, skill_lv, 1);
+ clif->skill_nodamage(src, bl, subskill, skill_lv, 1);
status_change_end(src, spheres[i], INVALID_TIMER);
}
}
@@ -4202,7 +4202,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
else // Last spell to be released
status_change_end(src, SC_READING_SB, INVALID_TIMER);
if( bl->type != BL_SKILL ) /* skill types will crash the client */
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
if( !skill->check_condition_castbegin(sd, skill_id, skill_lv) )
break;
@@ -4219,7 +4219,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
}
sd->ud.canact_tick = tick + skill->delay_fix(src, skill_id, skill_lv);
- clif_status_change(src, SI_ACTIONDELAY, 1, skill->delay_fix(src, skill_id, skill_lv), 0, 0, 0);
+ clif->status_change(src, SI_ACTIONDELAY, 1, skill->delay_fix(src, skill_id, skill_lv), 0, 0, 0);
} else { // Summon Balls
int j = 0, k, skele;
int spheres[5] = { 0, 0, 0, 0, 0 },
@@ -4234,7 +4234,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
}
if( j == 0 ) { // No Spheres
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_SUMMON_NONE,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_SUMMON_NONE,0);
break;
}
@@ -4253,7 +4253,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
skill->addtimerskill(src,tick+status_get_adelay(src)*i,bl->id,0,0,skele,sc->data[spheres[i]]->val3,BF_MAGIC,flag|SD_LEVEL);
status_change_end(src, spheres[i], INVALID_TIMER); // Eliminate ball
}
- clif_skill_nodamage(src,bl,skill_id,0,1);
+ clif->skill_nodamage(src,bl,skill_id,0,1);
}
}
break;
@@ -4276,8 +4276,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
if( unit_movepos(src, bl->x+x[dir], bl->y+y[dir], 1, 1) )
{
- clif_slide(src, bl->x+x[dir], bl->y+y[dir]);
- clif_fixpos(src);
+ clif->slide(src, bl->x+x[dir], bl->y+y[dir]);
+ clif->fixpos(src);
skill->attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
}
break;
@@ -4286,7 +4286,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
if( path_search(NULL,src->m,src->x,src->y,bl->x,bl->y,1,CELL_CHKNOREACH) ) {
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
}else if( sd && skill_id == RA_WUGBITE ) // Only RA_WUGBITE has the skill fail message.
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
break;
@@ -4330,7 +4330,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
else
{
map_foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill->castend_damage_id);
- clif_skill_damage(src,src,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src,src,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
if( sd ) pc_overheat(sd,1);
}
break;
@@ -4350,12 +4350,12 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
skill_area_temp[5] = y;
map_foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|1, skill->castend_damage_id);
skill->addtimerskill(src,tick + 800,src->id,x,y,skill_id,skill_lv,0,flag); // To teleport Self
- clif_skill_damage(src,src,tick,status_get_amotion(src),0,-30000,1,skill_id,skill_lv,6);
+ clif->skill_damage(src,src,tick,status_get_amotion(src),0,-30000,1,skill_id,skill_lv,6);
}
break;
case LG_PINPOINTATTACK:
if( !map_flag_gvg(src->m) && !map[src->m].flag.battleground && unit_movepos(src, bl->x, bl->y, 1, 1) )
- clif_slide(src,bl->x,bl->y);
+ clif->slide(src,bl->x,bl->y);
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
break;
@@ -4377,8 +4377,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
case SR_KNUCKLEARROW:
if( !map_flag_gvg(src->m) && !map[src->m].flag.battleground && unit_movepos(src, bl->x, bl->y, 1, 1) ) {
- clif_slide(src,bl->x,bl->y);
- clif_fixpos(src); // Aegis send this packet too.
+ clif->slide(src,bl->x,bl->y);
+ clif->fixpos(src); // Aegis send this packet too.
}
if( flag&1 )
@@ -4411,7 +4411,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER);
} else{
map_foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill->castend_damage_id);
- clif_skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
}
break;
@@ -4422,7 +4422,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
status_change_end(bl, SC_POISON, INVALID_TIMER);
}
else if( sd )
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
}
break;
@@ -4430,7 +4430,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
if( flag&1 )
skill->attack(skill->get_type(skill_id), src, src, bl, skill_id, skill_lv, tick, flag);
else {
- clif_skill_nodamage(src, bl, skill_id, 0, 1);
+ clif->skill_nodamage(src, bl, skill_id, 0, 1);
skill->addtimerskill(src, gettick() + skill->get_time(skill_id, skill_lv) - 1000, bl->id, 0, 0, skill_id, skill_lv, 0, 0);
}
break;
@@ -4444,8 +4444,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
skill->attack(skill->get_type(skill_id+1),src,src,bl,skill_id+1,skill_lv,tick,flag);
else {
int i = skill->get_splash(skill_id,skill_lv);
- clif_skill_nodamage(src,battle->get_master(src),skill_id,skill_lv,1);
- clif_skill_damage(src, bl, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_nodamage(src,battle->get_master(src),skill_id,skill_lv,1);
+ clif->skill_damage(src, bl, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
if( rnd()%100 < 30 )
map_foreachinrange(skill->area_sub,bl,i,BL_CHAR,src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill->castend_damage_id);
else
@@ -4454,8 +4454,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
break;
case EL_ROCK_CRUSHER:
- clif_skill_nodamage(src,battle->get_master(src),skill_id,skill_lv,1);
- clif_skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_nodamage(src,battle->get_master(src),skill_id,skill_lv,1);
+ clif->skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
if( rnd()%100 < 50 )
skill->attack(BF_MAGIC,src,src,bl,skill_id,skill_lv,tick,flag);
else
@@ -4467,8 +4467,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
skill->attack(skill->get_type(skill_id),src,src,bl,skill_id,skill_lv,tick,flag);
else {
int i = skill->get_splash(skill_id,skill_lv);
- clif_skill_nodamage(src,battle->get_master(src),skill_id,skill_lv,1);
- clif_skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_nodamage(src,battle->get_master(src),skill_id,skill_lv,1);
+ clif->skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
if( rnd()%100 < 30 )
map_foreachinrange(skill->area_sub,bl,i,BL_CHAR,src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill->castend_damage_id);
else
@@ -4480,8 +4480,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
case EL_ICE_NEEDLE:
case EL_WIND_SLASH:
case EL_STONE_HAMMER:
- clif_skill_nodamage(src,battle->get_master(src),skill_id,skill_lv,1);
- clif_skill_damage(src, bl, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_nodamage(src,battle->get_master(src),skill_id,skill_lv,1);
+ clif->skill_damage(src, bl, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
skill->attack(skill->get_type(skill_id),src,src,bl,skill_id,skill_lv,tick,flag);
break;
@@ -4493,8 +4493,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
sc_type type = status_skill2sc(skill_id), type2;
type2 = type-1;
- clif_skill_nodamage(src,battle->get_master(src),skill_id,skill_lv,1);
- clif_skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_nodamage(src,battle->get_master(src),skill_id,skill_lv,1);
+ clif->skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
if( (sc && sc->data[type2]) || (tsc && tsc->data[type]) ) {
elemental_clean_single_effect(ele, skill_id);
}
@@ -4504,7 +4504,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
sc_start(src,type2,100,skill_lv,skill->get_time(skill_id,skill_lv));
sc_start(battle->get_master(src),type,100,ele->bl.id,skill->get_time(skill_id,skill_lv));
}
- clif_skill_nodamage(src,src,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,src,skill_id,skill_lv,1);
}
break;
@@ -4527,12 +4527,12 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
case MH_TINDER_BREAKER:
if (unit_movepos(src, bl->x, bl->y, 1, 1)) {
#if PACKETVER >= 20111005
- clif_snap(src, bl->x, bl->y);
+ clif->snap(src, bl->x, bl->y);
#else
- clif_skill_poseffect(src,skill_id,skill_lv,bl->x,bl->y,tick);
+ clif->skill_poseffect(src,skill_id,skill_lv,bl->x,bl->y,tick);
#endif
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start4(bl,SC_CLOSECONFINE2,100,skill_lv,src->id,0,0,skill->get_time(skill_id,skill_lv)));
skill->attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
break;
@@ -4555,7 +4555,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
default:
ShowWarning("skill_castend_damage_id: Unknown skill used:%d\n",skill_id);
- clif_skill_damage(src, bl, tick, status_get_amotion(src), tstatus->dmotion,
+ clif->skill_damage(src, bl, tick, status_get_amotion(src), tstatus->dmotion,
0, abs(skill->get_num(skill_id, skill_lv)),
skill_id, skill_lv, skill->get_hit(skill_id));
map_freeblock_unlock();
@@ -4642,7 +4642,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
switch (skill_id) {
case HLIF_HEAL: //[orn]
if (bl->type != BL_HOM) {
- if (sd) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0) ;
+ if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0) ;
break ;
}
case AL_HEAL:
@@ -4657,7 +4657,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if (sd && battle->check_undead(tstatus->race,tstatus->def_ele)) {
if (battle->check_target(src, bl, BCT_ENEMY) < 1) {
//Offensive heal does not works on non-enemies. [Skotlex]
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
return skill->castend_damage_id (src, bl, skill_id, skill_lv, tick, flag);
@@ -4732,7 +4732,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
else if (tsc->data[SC_BERSERK] || tsc->data[SC_SATURDAYNIGHTFEVER] || tsc->data[SC__BLOODYLUST])
heal = 0; //Needed so that it actually displays 0 when healing.
}
- clif_skill_nodamage (src, bl, skill_id, heal, 1);
+ clif->skill_nodamage (src, bl, skill_id, heal, 1);
if( tsc && tsc->data[SC_AKAITSUKI] && heal && skill_id != HLIF_HEAL )
heal = ~heal + 1;
heal_get_jobexp = status_heal(bl,heal,0,0);
@@ -4749,7 +4749,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case PR_REDEMPTIO:
if (sd && !(flag&1)) {
if (sd->status.party_id == 0) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
skill_area_temp[0] = 0;
@@ -4758,15 +4758,15 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
src,skill_id,skill_lv,tick, flag|BCT_PARTY|1,
skill->castend_nodamage_id);
if (skill_area_temp[0] == 0) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
skill_area_temp[0] = 5 - skill_area_temp[0]; // The actual penalty...
if (skill_area_temp[0] > 0 && !map[src->m].flag.noexppenalty) { //Apply penalty
sd->status.base_exp -= min(sd->status.base_exp, pc_nextbaseexp(sd) * skill_area_temp[0] * 2/1000); //0.2% penalty per each.
sd->status.job_exp -= min(sd->status.job_exp, pc_nextjobexp(sd) * skill_area_temp[0] * 2/1000);
- clif_updatestatus(sd,SP_BASEEXP);
- clif_updatestatus(sd,SP_JOBEXP);
+ clif->updatestatus(sd,SP_BASEEXP);
+ clif->updatestatus(sd,SP_JOBEXP);
}
status_set_hp(src, 1, 0);
status_set_sp(src, 0, 0);
@@ -4780,7 +4780,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case ALL_RESURRECTION:
if(sd && (map_flag_gvg(bl->m) || map[bl->m].flag.battleground))
{ //No reviving in WoE grounds!
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
if (!status_isdead(bl))
@@ -4803,7 +4803,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
per = sper = 100;
if (status_revive(bl, per, sper))
{
- clif_skill_nodamage(src,bl,ALL_RESURRECTION,skill_lv,1); //Both Redemptio and Res show this skill-animation.
+ clif->skill_nodamage(src,bl,ALL_RESURRECTION,skill_lv,1); //Both Redemptio and Res show this skill-animation.
if(sd && dstsd && battle_config.resurrection_exp > 0)
{
int exp = 0,jexp = 0;
@@ -4825,7 +4825,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case AL_DECAGI:
case MER_DECAGI:
- clif_skill_nodamage (src, bl, skill_id, skill_lv,
+ clif->skill_nodamage (src, bl, skill_id, skill_lv,
sc_start(bl, type, (40 + skill_lv * 2 + (status_get_lv(src) + sstatus->int_)/5), skill_lv, skill->get_time(skill_id,skill_lv)));
break;
@@ -4835,7 +4835,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
else {
map_foreachinrange(skill->area_sub, src, skill->get_splash(skill_id, skill_lv), BL_CHAR,
src, skill_id, skill_lv, tick, flag|BCT_ENEMY|1, skill->castend_nodamage_id);
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
}
break;
@@ -4845,7 +4845,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
status_change_end(bl,type, INVALID_TIMER);
else
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv));
- clif_skill_nodamage (src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage (src, bl, skill_id, skill_lv, 1);
break;
case SA_ABRACADABRA:
@@ -4859,14 +4859,14 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
rnd()%10000 >= skill_abra_db[i].per
);
abra_skill_lv = min(skill_lv, skill->get_max(abra_skill_id));
- clif_skill_nodamage (src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage (src, bl, skill_id, skill_lv, 1);
if( sd )
{// player-casted
sd->state.abra_flag = 1;
sd->skillitem = abra_skill_id;
sd->skillitemlv = abra_skill_lv;
- clif_item_skill(sd, abra_skill_id, abra_skill_lv);
+ clif->item_skill(sd, abra_skill_id, abra_skill_lv);
}
else
{// mob-casted
@@ -4900,11 +4900,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case SA_COMA:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time2(skill_id,skill_lv)));
break;
case SA_FULLRECOVERY:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if (status_isimmune(bl))
break;
status_percent_heal(bl, 100, 100);
@@ -4915,7 +4915,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( status_isimmune(bl) )
break;
heal = status_percent_heal(bl, 100, 0);
- clif_skill_nodamage(NULL, bl, AL_HEAL, heal, 1);
+ clif->skill_nodamage(NULL, bl, AL_HEAL, heal, 1);
if( dstmd )
{ // Reset Damage Logs
memset(dstmd->dmglog, 0, sizeof(dstmd->dmglog));
@@ -4924,20 +4924,20 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
}
break;
case SA_SUMMONMONSTER:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if (sd) mob_once_spawn(sd, src->m, src->x, src->y," --ja--", -1, 1, "", SZ_SMALL, AI_NONE);
break;
case SA_LEVELUP:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if (sd && pc_nextbaseexp(sd)) pc_gainexp(sd, NULL, pc_nextbaseexp(sd) * 10 / 100, 0, false);
break;
case SA_INSTANTDEATH:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
status_set_hp(bl,1,0);
break;
case SA_QUESTION:
case SA_GRAVITY:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case SA_CLASSCHANGE:
case SA_MONOCELL:
@@ -4946,11 +4946,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
int class_;
if ( sd && dstmd->status.mode&MD_BOSS )
{
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
class_ = skill_id==SA_MONOCELL?1002:mob_get_random_id(4, 1, 0);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
mob_class_change(dstmd,class_);
if( tsc && dstmd->status.mode&MD_BOSS )
{
@@ -4965,22 +4965,22 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SA_DEATH:
if ( sd && dstmd && dstmd->status.mode&MD_BOSS )
{
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
status_kill(bl);
break;
case SA_REVERSEORCISH:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id, skill_lv)));
break;
case SA_FORTUNE:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if(sd) pc_getzeny(sd,status_get_lv(bl)*100,LOG_TYPE_STEAL,NULL);
break;
case SA_TAMINGMONSTER:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if (sd && dstmd) {
ARR_FIND( 0, MAX_PET_DB, i, dstmd->class_ == pet_db[i].class_ );
if( i < MAX_PET_DB )
@@ -4991,12 +4991,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case CR_PROVIDENCE:
if(sd && dstsd){ //Check they are not another crusader [Skotlex]
if ((dstsd->class_&MAPID_UPPERMASK) == MAPID_CRUSADER) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return 1;
}
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
break;
@@ -5006,7 +5006,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( sd && dstsd && (dstsd->class_&MAPID_UPPERMASK) == MAPID_BARDDANCER && dstsd->status.sex == sd->status.sex )
{// Cannot cast on another bard/dancer-type class of the same gender as caster
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return 1;
}
@@ -5017,7 +5017,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
sc_start(src,SC_MARIONETTE,100,bl->id,skill->get_time(skill_id,skill_lv));
sc_start(bl,SC_MARIONETTE2,100,src->id,skill->get_time(skill_id,skill_lv));
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
else
if( sc->data[SC_MARIONETTE ] && sc->data[SC_MARIONETTE ]->val1 == bl->id &&
@@ -5029,7 +5029,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
else
{
if( sd )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return 1;
@@ -5039,7 +5039,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case RG_CLOSECONFINE:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start4(bl,type,100,skill_lv,src->id,0,0,skill->get_time(skill_id,skill_lv)));
break;
case SA_FLAMELAUNCHER: // added failure chance and chance to break weapon if turned on [Valaris]
@@ -5059,31 +5059,31 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
dstsd->sc.data[SC_ENCPOISON]
))
) {
- if (sd) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,0);
+ if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,0);
break;
}
}
// 100% success rate at lv4 & 5, but lasts longer at lv5
- if(!clif_skill_nodamage(src,bl,skill_id,skill_lv, sc_start(bl,type,(60+skill_lv*10),skill_lv, skill->get_time(skill_id,skill_lv)))) {
+ if(!clif->skill_nodamage(src,bl,skill_id,skill_lv, sc_start(bl,type,(60+skill_lv*10),skill_lv, skill->get_time(skill_id,skill_lv)))) {
if (sd)
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
if (skill->break_equip(bl, EQP_WEAPON, 10000, BCT_PARTY) && sd && sd != dstsd)
- clif_displaymessage(sd->fd, msg_txt(669));
+ clif->displaymessage(sd->fd, msg_txt(669));
}
break;
case PR_ASPERSIO:
if (sd && dstmd) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,0);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,0);
break;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
break;
case ITEM_ENCHANTARMS:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start2(bl,type,100,skill_lv,
skill->get_ele(skill_id,skill_lv), skill->get_time(skill_id,skill_lv)));
break;
@@ -5098,7 +5098,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case ELE_DARK : type = SC_SHADOWWEAPON; break;
case ELE_HOLY : type = SC_ASPERSIO; break;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
sc_start(bl,SC_SEVENWIND,100,skill_lv,skill->get_time(skill_id,skill_lv));
@@ -5107,7 +5107,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case PR_KYRIE:
case MER_KYRIE:
- clif_skill_nodamage(bl,bl,skill_id,skill_lv,
+ clif->skill_nodamage(bl,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
break;
//Passive Magnum, should had been casted on yourself.
@@ -5116,7 +5116,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
skill_area_temp[1] = 0;
map_foreachinrange(skill->area_sub, src, skill->get_splash(skill_id, skill_lv), BL_SKILL|BL_CHAR,
src,skill_id,skill_lv,tick, flag|BCT_ENEMY|1, skill->castend_damage_id);
- clif_skill_nodamage (src,src,skill_id,skill_lv,1);
+ clif->skill_nodamage (src,src,skill_id,skill_lv,1);
// Initiate 10% of your damage becomes fire element.
sc_start4(src,SC_WATK_ELEMENT,100,3,20,0,0,skill->get_time2(skill_id, skill_lv));
if( sd )
@@ -5132,11 +5132,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( unit_movepos(src, bl->x, bl->y, 1, 1) )
{
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
- clif_slide(src,bl->x,bl->y);
+ clif->slide(src,bl->x,bl->y);
}
}
else
- clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL,0);
break;
case AL_INCAGI:
@@ -5214,7 +5214,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SR_GENTLETOUCH_ENERGYGAIN:
case GN_CARTBOOST:
case KO_MEIKYOUSISUI:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
break;
@@ -5222,7 +5222,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if (sd) {
int bonus = 25 + 10 * skill_lv;
bonus += (pc_checkskill(sd, SA_FLAMELAUNCHER)+pc_checkskill(sd, SA_FROSTWEAPON)+pc_checkskill(sd, SA_LIGHTNINGLOADER)+pc_checkskill(sd, SA_SEISMICWEAPON))*5;
- clif_skill_nodamage( src, bl, skill_id, skill_lv,
+ clif->skill_nodamage( src, bl, skill_id, skill_lv,
battle->check_target(src,bl,BCT_PARTY) ?
sc_start2(bl, type, 100, skill_lv, bonus, skill->get_time(skill_id,skill_lv)) :
0
@@ -5231,15 +5231,15 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case NPC_STOP:
- if( clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ if( clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start2(bl,type,100,skill_lv,src->id,skill->get_time(skill_id,skill_lv)) ) )
sc_start2(src,type,100,skill_lv,bl->id,skill->get_time(skill_id,skill_lv));
break;
case HP_ASSUMPTIO:
if( sd && dstmd )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
else
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
break;
case MG_SIGHT:
@@ -5249,17 +5249,17 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case NPC_WIDESIGHT:
case NPC_STONESKIN:
case NPC_ANTIMAGIC:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start2(bl,type,100,skill_lv,skill_id,skill->get_time(skill_id,skill_lv)));
break;
case HLIF_AVOID:
case HAMI_DEFENCE:
i = skill->get_time(skill_id,skill_lv);
- clif_skill_nodamage(bl,bl,skill_id,skill_lv,sc_start(bl,type,100,skill_lv,i)); // Master
- clif_skill_nodamage(src,src,skill_id,skill_lv,sc_start(src,type,100,skill_lv,i)); // Homunc
+ clif->skill_nodamage(bl,bl,skill_id,skill_lv,sc_start(bl,type,100,skill_lv,i)); // Master
+ clif->skill_nodamage(src,src,skill_id,skill_lv,sc_start(src,type,100,skill_lv,i)); // Homunc
break;
case NJ_BUNSINJYUTSU:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
status_change_end(bl, SC_NEN, INVALID_TIMER);
break;
@@ -5273,12 +5273,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
skill->get_splash(skill_id, skill_lv), BL_PC,
src, skill_id, skill_lv, tick, flag|BCT_ALL|1,
skill->castend_nodamage_id);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
*/
case SM_ENDURE:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
if (sd)
skill->blockpc_start (sd, skill_id, skill->get_time2(skill_id,skill_lv), false);
@@ -5294,49 +5294,49 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
dstsd->sc.data[SC_GHOSTWEAPON]
// dstsd->sc.data[SC_ENCPOISON] //People say you should be able to recast to lengthen the timer. [Skotlex]
) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,0);
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
break;
case LK_TENSIONRELAX:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start4(bl,type,100,skill_lv,0,0,skill->get_time2(skill_id,skill_lv),
skill->get_time(skill_id,skill_lv)));
break;
case MC_CHANGECART:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case TK_MISSION:
if (sd) {
int id;
if (sd->mission_mobid && (sd->mission_count || rnd()%100)) { //Cannot change target when already have one
- clif_mission_info(sd, sd->mission_mobid, sd->mission_count);
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->mission_info(sd, sd->mission_mobid, sd->mission_count);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
id = mob_get_random_id(0,0xF, sd->status.base_level);
if (!id) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
sd->mission_mobid = id;
sd->mission_count = 0;
pc_setglobalreg(sd,"TK_MISSION_ID", id);
- clif_mission_info(sd, id, 0);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->mission_info(sd, id, 0);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
case AC_CONCENTRATION:
{
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
map_foreachinrange( status_change_timer_sub, src,
skill->get_splash(skill_id, skill_lv), BL_CHAR,
@@ -5353,12 +5353,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
return 1;
}
//TODO: How much does base level affects? Dummy value of 1% per level difference used. [Skotlex]
- clif_skill_nodamage(src,bl,skill_id == SM_SELFPROVOKE ? SM_PROVOKE : skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id == SM_SELFPROVOKE ? SM_PROVOKE : skill_id,skill_lv,
(i = sc_start(bl,type, skill_id == SM_SELFPROVOKE ? 100:( 50 + 3*skill_lv + status_get_lv(src) - status_get_lv(bl)), skill_lv, skill->get_time(skill_id,skill_lv))));
if( !i )
{
if( sd )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return 0;
}
@@ -5387,7 +5387,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( !dstsd || (!sd && !mer) )
{ // Only players can be devoted
if( sd )
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
break;
}
@@ -5400,7 +5400,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
(dstsd->sc.data[SC_HELLPOWER])) // Players affected by SC_HELLPOWERR cannot be devoted.
{
if( sd )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return 1;
}
@@ -5415,7 +5415,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
ARR_FIND(0, count, i, sd->devotion[i] == 0 );
if( i == count )
{ // No free slots, skill Fail
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
map_freeblock_unlock();
return 1;
}
@@ -5426,9 +5426,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
else
mer->devotion_flag = 1; // Mercenary Devoting Owner
- clif_skill_nodamage(src, bl, skill_id, skill_lv,
+ clif->skill_nodamage(src, bl, skill_id, skill_lv,
sc_start4(bl, type, 100, src->id, i, skill->get_range2(src,skill_id,skill_lv),0, skill->get_time2(skill_id, skill_lv)));
- clif_devotion(src, NULL);
+ clif->devotion(src, NULL);
}
break;
@@ -5437,7 +5437,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
int limit = skill_lv;
if( sd->sc.data[SC_RAISINGDRAGON] )
limit += sd->sc.data[SC_RAISINGDRAGON]->val1;
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
pc_addspiritball(sd,skill->get_time(skill_id,skill_lv),limit);
}
break;
@@ -5447,7 +5447,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
int limit = 5;
if( sd->sc.data[SC_RAISINGDRAGON] )
limit += sd->sc.data[SC_RAISINGDRAGON]->val1;
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
for (i = 0; i < limit; i++)
pc_addspiritball(sd,skill->get_time(skill_id,skill_lv),limit);
}
@@ -5479,37 +5479,37 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
mob_target(dstmd,src,0);
}
if (i) status_heal(src, 0, i, 3);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,i?1:0);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,i?1:0);
break;
case AC_MAKINGARROW:
if(sd) {
- clif_arrow_create_list(sd);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->arrow_create_list(sd);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
case AM_PHARMACY:
if(sd) {
- clif_skill_produce_mix_list(sd,skill_id,22);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_produce_mix_list(sd,skill_id,22);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
case SA_CREATECON:
if(sd) {
- clif_elementalconverter_list(sd);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->elementalconverter_list(sd);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
case BS_HAMMERFALL:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,SC_STUN,(20 + 10 * skill_lv),skill_lv,skill->get_time2(skill_id,skill_lv)));
break;
case RG_RAID:
skill_area_temp[1] = 0;
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
map_foreachinrange(skill->area_sub, bl,
skill->get_splash(skill_id, skill_lv), splash_target(src),
src,skill_id,skill_lv,tick, flag|BCT_ENEMY|1,
@@ -5527,21 +5527,21 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SR_HOWLINGOFLION:
case KO_HAPPOKUNAI:
skill_area_temp[1] = 0;
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
i = map_foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), splash_target(src),
src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill->castend_damage_id);
if( !i && ( skill_id == NC_AXETORNADO || skill_id == SR_SKYNETBLOW || skill_id == KO_HAPPOKUNAI ) )
- clif_skill_damage(src,src,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src,src,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
break;
case NC_EMERGENCYCOOL:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
status_change_end(src,SC_OVERHEAT_LIMITPOINT,INVALID_TIMER);
status_change_end(src,SC_OVERHEAT,INVALID_TIMER);
break;
case SR_WINDMILL:
case GN_CART_TORNADO:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
case SR_EARTHSHAKER:
case NC_INFRAREDSCAN:
case NPC_EARTHQUAKE:
@@ -5560,7 +5560,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case WZ_SIGHTRASHER:
//Passive side of the attack.
status_change_end(src, SC_SIGHT, INVALID_TIMER);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
map_foreachinrange(skill->area_sub,src,
skill->get_splash(skill_id, skill_lv),BL_CHAR|BL_SKILL,
src,skill_id,skill_lv,tick, flag|BCT_ENEMY|1,
@@ -5570,7 +5570,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case NJ_HYOUSYOURAKU:
case NJ_RAIGEKISAI:
case WZ_FROSTNOVA:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
skill_area_temp[1] = 0;
map_foreachinrange(skill->attack_area, src,
skill->get_splash(skill_id, skill_lv), splash_target(src),
@@ -5583,7 +5583,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
//Except for Summoned Marine spheres on non-versus maps, where it's just enemy.
i = ((!md || md->special_state.ai == 2) && !map_flag_vs(src->m))?
BCT_ENEMY:BCT_ALL;
- clif_skill_nodamage(src, src, skill_id, -1, 1);
+ clif->skill_nodamage(src, src, skill_id, -1, 1);
map_delblock(src); //Required to prevent chain-self-destructions hitting back.
map_foreachinrange(skill->area_sub, bl,
skill->get_splash(skill_id, skill_lv), splash_target(src),
@@ -5601,18 +5601,18 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case CASH_INCAGI:
case CASH_ASSUMPTIO:
if( sd == NULL || sd->status.party_id == 0 || (flag & 1) )
- clif_skill_nodamage(bl, bl, skill_id, skill_lv, sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ clif->skill_nodamage(bl, bl, skill_id, skill_lv, sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
else if( sd )
party_foreachsamemap(skill->area_sub, sd, skill->get_splash(skill_id, skill_lv), src, skill_id, skill_lv, tick, flag|BCT_PARTY|1, skill->castend_nodamage_id);
break;
case MER_MAGNIFICAT:
if( mer != NULL )
{
- clif_skill_nodamage(bl, bl, skill_id, skill_lv, sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ clif->skill_nodamage(bl, bl, skill_id, skill_lv, sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
if( mer->master && mer->master->status.party_id != 0 && !(flag&1) )
party_foreachsamemap(skill->area_sub, mer->master, skill->get_splash(skill_id, skill_lv), src, skill_id, skill_lv, tick, flag|BCT_PARTY|1, skill->castend_nodamage_id);
else if( mer->master && !(flag&1) )
- clif_skill_nodamage(src, &mer->master->bl, skill_id, skill_lv, sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ clif->skill_nodamage(src, &mer->master->bl, skill_id, skill_lv, sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
}
break;
@@ -5621,7 +5621,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case BS_WEAPONPERFECT:
case BS_OVERTHRUST:
if (sd == NULL || sd->status.party_id == 0 || (flag & 1)) {
- clif_skill_nodamage(bl,bl,skill_id,skill_lv,
+ clif->skill_nodamage(bl,bl,skill_id,skill_lv,
sc_start2(bl,type,100,skill_lv,(src == bl)? 1:0,skill->get_time(skill_id,skill_lv)));
} else if (sd) {
party_foreachsamemap(skill->area_sub,
@@ -5647,11 +5647,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case GS_GATLINGFEVER:
if( tsce )
{
- clif_skill_nodamage(src,bl,skill_id,skill_lv,status_change_end(bl, type, INVALID_TIMER));
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,status_change_end(bl, type, INVALID_TIMER));
map_freeblock_unlock();
return 0;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
break;
case SL_KAITE:
case SL_KAAHI:
@@ -5666,11 +5666,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
dstsd->status.char_id == sd->status.child
)) {
status_change_start(src,SC_STUN,10000,skill_lv,0,0,0,500,8);
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id, skill_lv)));
break;
case SM_AUTOBERSERK:
@@ -5679,34 +5679,34 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
i = status_change_end(bl, type, INVALID_TIMER);
else
i = sc_start(bl,type,100,skill_lv,60000);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,i);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,i);
break;
case TF_HIDING:
case ST_CHASEWALK:
case KO_YAMIKUMO:
if (tsce)
{
- clif_skill_nodamage(src,bl,skill_id,-1,status_change_end(bl, type, INVALID_TIMER)); //Hide skill-scream animation.
+ clif->skill_nodamage(src,bl,skill_id,-1,status_change_end(bl, type, INVALID_TIMER)); //Hide skill-scream animation.
map_freeblock_unlock();
return 0;
} else if( tsc && tsc->option&OPTION_MADOGEAR ) {
//Mado Gear cannot hide
- if( sd ) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ if( sd ) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return 0;
}
- clif_skill_nodamage(src,bl,skill_id,-1,sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ clif->skill_nodamage(src,bl,skill_id,-1,sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
break;
case TK_RUN:
if (tsce)
{
- clif_skill_nodamage(src,bl,skill_id,skill_lv,status_change_end(bl, type, INVALID_TIMER));
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,status_change_end(bl, type, INVALID_TIMER));
map_freeblock_unlock();
return 0;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,sc_start4(bl,type,100,skill_lv,unit_getdir(bl),0,0,0));
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start4(bl,type,100,skill_lv,unit_getdir(bl),0,0,0));
if (sd) // If the client receives a skill-use packet inmediately before a walkok packet, it will discard the walk packet! [Skotlex]
- clif_walkok(sd); // So aegis has to resend the walk ok.
+ clif->walkok(sd); // So aegis has to resend the walk ok.
break;
case AS_CLOAKING:
case GC_CLOAKINGEXCEED:
@@ -5716,30 +5716,30 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if (tsce) {
i = status_change_end(bl, type, INVALID_TIMER);
if( i )
- clif_skill_nodamage(src,bl,skill_id,( skill_id == LG_FORCEOFVANGUARD ) ? skill_lv : -1,i);
+ clif->skill_nodamage(src,bl,skill_id,( skill_id == LG_FORCEOFVANGUARD ) ? skill_lv : -1,i);
else if( sd )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return 0;
}
case RA_CAMOUFLAGE:
i = sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv));
if( i )
- clif_skill_nodamage(src,bl,skill_id,( skill_id == LG_FORCEOFVANGUARD ) ? skill_lv : -1,i);
+ clif->skill_nodamage(src,bl,skill_id,( skill_id == LG_FORCEOFVANGUARD ) ? skill_lv : -1,i);
else if( sd )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
case BD_ADAPTATION:
if(tsc && tsc->data[SC_DANCING]){
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
status_change_end(bl, SC_DANCING, INVALID_TIMER);
}
break;
case BA_FROSTJOKER:
case DC_SCREAM:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
skill->addtimerskill(src,tick+2000,bl->id,src->x,src->y,skill_id,skill_lv,0,flag);
if (md) {
@@ -5747,28 +5747,28 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
//NOTE: mobs don't have the sprite animation that is used when performing this skill (will cause glitches)
char temp[70];
snprintf(temp, sizeof(temp), "%s : %s !!",md->name,skill_db[skill_id].desc);
- clif_message(&md->bl,temp);
+ clif->message(&md->bl,temp);
}
break;
case BA_PANGVOICE:
- clif_skill_nodamage(src,bl,skill_id,skill_lv, sc_start(bl,SC_CONFUSION,50,7,skill->get_time(skill_id,skill_lv)));
+ clif->skill_nodamage(src,bl,skill_id,skill_lv, sc_start(bl,SC_CONFUSION,50,7,skill->get_time(skill_id,skill_lv)));
break;
case DC_WINKCHARM:
if( dstsd )
- clif_skill_nodamage(src,bl,skill_id,skill_lv, sc_start(bl,SC_CONFUSION,30,7,skill->get_time2(skill_id,skill_lv)));
+ clif->skill_nodamage(src,bl,skill_id,skill_lv, sc_start(bl,SC_CONFUSION,30,7,skill->get_time2(skill_id,skill_lv)));
else
if( dstmd )
{
if( status_get_lv(src) > status_get_lv(bl)
&& (tstatus->race == RC_DEMON || tstatus->race == RC_DEMIHUMAN || tstatus->race == RC_ANGEL)
&& !(tstatus->mode&MD_BOSS) )
- clif_skill_nodamage(src,bl,skill_id,skill_lv, sc_start2(bl,type,70,skill_lv,src->id,skill->get_time(skill_id,skill_lv)));
+ clif->skill_nodamage(src,bl,skill_id,skill_lv, sc_start2(bl,type,70,skill_lv,src->id,skill->get_time(skill_id,skill_lv)));
else
{
- clif_skill_nodamage(src,bl,skill_id,skill_lv,0);
- if(sd) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,0);
+ if(sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
}
}
break;
@@ -5776,9 +5776,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case TF_STEAL:
if(sd) {
if(pc_steal_item(sd,bl,skill_lv))
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
else
- clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL,0);
}
break;
@@ -5788,11 +5788,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
dstmd->state.provoke_flag = src->id;
mob_target(dstmd, src, skill->get_range2(src,skill_id,skill_lv));
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
else
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
}
break;
@@ -5800,7 +5800,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
int brate = 0;
if (tstatus->mode&MD_BOSS) {
- if (sd) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
if(status_isimmune(bl) || !tsc)
@@ -5811,15 +5811,15 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if (tsc->data[SC_STONE]) {
status_change_end(bl, SC_STONE, INVALID_TIMER);
- if (sd) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
if (sc_start4(bl,SC_STONE,(skill_lv*4+20)+brate,
skill_lv, 0, 0, skill->get_time(skill_id, skill_lv),
skill->get_time2(skill_id,skill_lv)))
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
else if(sd) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
// Level 6-10 doesn't consume a red gem if it fails [celest]
if (skill_lv > 5)
{ // not to consume items
@@ -5831,30 +5831,30 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case NV_FIRSTAID:
- clif_skill_nodamage(src,bl,skill_id,5,1);
+ clif->skill_nodamage(src,bl,skill_id,5,1);
status_heal(bl,5,0,0);
break;
case AL_CURE:
if(status_isimmune(bl)) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,0);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,0);
break;
}
status_change_end(bl, SC_SILENCE, INVALID_TIMER);
status_change_end(bl, SC_BLIND, INVALID_TIMER);
status_change_end(bl, SC_CONFUSION, INVALID_TIMER);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case TF_DETOXIFY:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
status_change_end(bl, SC_POISON, INVALID_TIMER);
status_change_end(bl, SC_DPOISON, INVALID_TIMER);
break;
case PR_STRECOVERY:
if(status_isimmune(bl)) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,0);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,0);
break;
}
if (tsc && tsc->opt1) {
@@ -5871,7 +5871,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
1,0,0,0,
skill->get_time2(skill_id, skill_lv) * (100-(tstatus->int_+tstatus->vit)/2)/100,0);
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if(dstmd)
mob_unlocktarget(dstmd,tick);
break;
@@ -5880,30 +5880,30 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case MER_BENEDICTION:
status_change_end(bl, SC_CURSE, INVALID_TIMER);
status_change_end(bl, SC_BLIND, INVALID_TIMER);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case MER_COMPRESS:
status_change_end(bl, SC_BLEEDING, INVALID_TIMER);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case MER_MENTALCURE:
status_change_end(bl, SC_CONFUSION, INVALID_TIMER);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case MER_RECUPERATE:
status_change_end(bl, SC_POISON, INVALID_TIMER);
status_change_end(bl, SC_SILENCE, INVALID_TIMER);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case MER_REGAIN:
status_change_end(bl, SC_SLEEP, INVALID_TIMER);
status_change_end(bl, SC_STUN, INVALID_TIMER);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case MER_TENDER:
status_change_end(bl, SC_FREEZE, INVALID_TIMER);
status_change_end(bl, SC_STONE, INVALID_TIMER);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case MER_SCAPEGOAT:
@@ -5923,42 +5923,42 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
if( dstsd )
{ // Fail on Players
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
if( dstmd && dstmd->class_ == MOBID_EMPERIUM )
break; // Cannot be Used on Emperium
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
- clif_skill_estimation(sd, bl);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_estimation(sd, bl);
if( skill_id == MER_ESTIMATION )
sd = NULL;
break;
case BS_REPAIRWEAPON:
if(sd && dstsd)
- clif_item_repair_list(sd,dstsd,skill_lv);
+ clif->item_repair_list(sd,dstsd,skill_lv);
break;
case MC_IDENTIFY:
if(sd)
- clif_item_identify_list(sd);
+ clif->item_identify_list(sd);
break;
// Weapon Refining [Celest]
case WS_WEAPONREFINE:
if(sd)
- clif_item_refine_list(sd);
+ clif->item_refine_list(sd);
break;
case MC_VENDING:
if(sd)
{ //Prevent vending of GMs with unnecessary Level to trade/drop. [Skotlex]
if ( !pc_can_give_items(sd) )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
else {
sd->state.prevend = 1;
- clif_openvendingreq(sd,2+skill_lv);
+ clif->openvendingreq(sd,2+skill_lv);
}
}
break;
@@ -5967,12 +5967,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if(sd)
{
if (map[bl->m].flag.noteleport && skill_lv <= 2) {
- clif_skill_teleportmessage(sd,0);
+ clif->skill_teleportmessage(sd,0);
break;
}
if(!battle_config.duel_allow_teleport && sd->duel_group && skill_lv <= 2) { // duel restriction [LuzZza]
char output[128]; sprintf(output, msg_txt(365), skill->get_name(AL_TELEPORT));
- clif_displaymessage(sd->fd, output); //"Duel: Can't use %s in duel."
+ clif->displaymessage(sd->fd, output); //"Duel: Can't use %s in duel."
break;
}
@@ -5985,26 +5985,26 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if( skill_lv == 1 )
- clif_skill_warppoint(sd,skill_id,skill_lv, (unsigned short)-1,0,0,0);
+ clif->skill_warppoint(sd,skill_id,skill_lv, (unsigned short)-1,0,0,0);
else
- clif_skill_warppoint(sd,skill_id,skill_lv, (unsigned short)-1,sd->status.save_point.map,0,0);
+ clif->skill_warppoint(sd,skill_id,skill_lv, (unsigned short)-1,sd->status.save_point.map,0,0);
} else
unit_warp(bl,-1,-1,-1,CLR_TELEPORT);
break;
case NPC_EXPULSION:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
unit_warp(bl,-1,-1,-1,CLR_TELEPORT);
break;
case AL_HOLYWATER:
if(sd) {
if (skill->produce_mix(sd, skill_id, 523, 0, 0, 0, 1))
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
else
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
}
break;
@@ -6013,23 +6013,23 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
int eflag;
struct item item_tmp;
struct block_list tbl;
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
memset(&item_tmp,0,sizeof(item_tmp));
memset(&tbl,0,sizeof(tbl)); // [MouseJstr]
item_tmp.nameid = ITEMID_STONE;
item_tmp.identify = 1;
tbl.id = 0;
- clif_takeitem(&sd->bl,&tbl);
+ clif->takeitem(&sd->bl,&tbl);
eflag = pc_additem(sd,&item_tmp,1,LOG_TYPE_PRODUCE);
if(eflag) {
- clif_additem(sd,0,0,eflag);
+ clif->additem(sd,0,0,eflag);
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
break;
case ASC_CDP:
if(sd) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
skill->produce_mix(sd, skill_id, 678, 0, 0, 0, 1); //Produce a Deadly Poison Bottle.
}
break;
@@ -6092,17 +6092,17 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
//Special message when trying to use strip on FCP [Jobbie]
if( sd && skill_id == ST_FULLSTRIP && tsc && tsc->data[SC_CP_WEAPON] && tsc->data[SC_CP_HELM] && tsc->data[SC_CP_ARMOR] && tsc->data[SC_CP_SHIELD])
{
- clif_gospel_info(sd, 0x28);
+ clif->gospel_info(sd, 0x28);
break;
}
//Attempts to strip at rate i and duration d
if( (i = skill->strip_equip(bl, location, i, skill_lv, d)) || (skill_id != ST_FULLSTRIP && skill_id != GC_WEAPONCRUSH ) )
- clif_skill_nodamage(src,bl,skill_id,skill_lv,i);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,i);
//Nothing stripped.
if( sd && !i )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
@@ -6118,18 +6118,18 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
x = skill_lv%11 - 1;
i = pc_search_inventory(sd,skill_db[skill_id].itemid[x]);
if( i < 0 || skill_db[skill_id].itemid[x] <= 0 ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return 1;
}
if(sd->inventory_data[i] == NULL || sd->status.inventory[i].amount < skill_db[skill_id].amount[x]) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return 1;
}
if( skill_id == AM_BERSERKPITCHER ) {
if( dstsd && dstsd->status.base_level < (unsigned int)sd->inventory_data[i]->elv ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return 1;
}
@@ -6196,11 +6196,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
sp += sp / 10;
}
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if( hp > 0 || (skill_id == AM_POTIONPITCHER && sp <= 0) )
- clif_skill_nodamage(NULL,bl,AL_HEAL,hp,1);
+ clif->skill_nodamage(NULL,bl,AL_HEAL,hp,1);
if( sp > 0 )
- clif_skill_nodamage(NULL,bl,MG_SRECOVERY,sp,1);
+ clif->skill_nodamage(NULL,bl,MG_SRECOVERY,sp,1);
#ifdef RENEWAL
if( tsc && tsc->data[SC_EXTREMITYFIST2] )
sp = 0;
@@ -6216,29 +6216,29 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
unsigned int equip[] = {EQP_WEAPON, EQP_SHIELD, EQP_ARMOR, EQP_HEAD_TOP};
if( sd && ( bl->type != BL_PC || ( dstsd && pc_checkequip(dstsd,equip[skill_id - AM_CP_WEAPON]) < 0 ) ) ){
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock(); // Don't consume item requirements
return 0;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
}
break;
case AM_TWILIGHT1:
if (sd) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
//Prepare 200 White Potions.
if (!skill->produce_mix(sd, skill_id, 504, 0, 0, 0, 200))
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
}
break;
case AM_TWILIGHT2:
if (sd) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
//Prepare 200 Slim White Potions.
if (!skill->produce_mix(sd, skill_id, 547, 0, 0, 0, 200))
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
}
break;
case AM_TWILIGHT3:
@@ -6252,10 +6252,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|| !skill->can_produce_mix(sd,7135,-1, 50) //50 Flame Bottle
|| ebottle < 200 //200 empty bottle are required at total.
) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
skill->produce_mix(sd, skill_id, 970, 0, 0, 0, 100);
skill->produce_mix(sd, skill_id, 7136, 0, 0, 0, 50);
skill->produce_mix(sd, skill_id, 7135, 0, 0, 0, 50);
@@ -6264,21 +6264,21 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SA_DISPELL:
if (flag&1 || (i = skill->get_splash(skill_id, skill_lv)) < 1)
{
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if((dstsd && (dstsd->class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER)
|| (tsc && tsc->data[SC_SPIRIT] && tsc->data[SC_SPIRIT]->val2 == SL_ROGUE) //Rogue's spirit defends againt dispel.
|| rnd()%100 >= 50+10*skill_lv
|| ( tsc && tsc->option&OPTION_MADOGEAR ) )//Mado Gear is immune to dispell according to bug report 49 [Ind]
{
if (sd)
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
if(status_isimmune(bl) || !tsc || !tsc->count)
break;
if( sd && dstsd && !map_flag_vs(sd->bl.m) && sd->status.guild_id == dstsd->status.guild_id ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
@@ -6364,7 +6364,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case TF_BACKSLIDING: //This is the correct implementation as per packet logging information. [Skotlex]
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
skill->blown(src,bl,skill->get_blewcount(skill_id,skill_lv),unit_getdir(bl),0);
break;
@@ -6383,9 +6383,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
y = src->y + diry[dir]*skill_lv*2;
}
- clif_skill_nodamage(src,bl,TK_HIGHJUMP,skill_lv,1);
+ clif->skill_nodamage(src,bl,TK_HIGHJUMP,skill_lv,1);
if(!map_count_oncell(src->m,x,y,BL_PC|BL_NPC|BL_MOB) && map_getcell(src->m,x,y,CELL_CHKREACH)) {
- clif_slide(src,x,y);
+ clif->slide(src,x,y);
unit_movepos(src, x, y, 1, 0);
}
}
@@ -6393,7 +6393,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SA_CASTCANCEL:
case SO_SPELLFIST:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
unit_skillcastcancel(src,1);
if(sd) {
int sp = skill->get_sp(sd->skill_id_old,sd->skill_lv_old);
@@ -6427,13 +6427,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{ //Only 10% success chance against bosses. [Skotlex]
if (rnd()%100 < 90)
{
- if (sd) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
} else if (!dstsd || map_flag_vs(bl->m)) //HP damage only on pvp-maps when against players.
hp = tstatus->max_hp/50; //Recover 2% HP [Skotlex]
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
unit_skillcastcancel(bl,0);
sp = skill->get_sp(bl_skill_id,bl_skill_lv);
status_zap(bl, hp, sp);
@@ -6452,13 +6452,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
}
break;
case SA_MAGICROD:
- clif_skill_nodamage(src,src,SA_MAGICROD,skill_lv,1);
+ clif->skill_nodamage(src,src,SA_MAGICROD,skill_lv,1);
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv));
break;
case SA_AUTOSPELL:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if(sd)
- clif_autospell(sd,skill_lv);
+ clif->autospell(sd,skill_lv);
else {
int maxlv=1,spellid=0;
static const int spellarray[3] = { MG_COLDBOLT,MG_FIREBOLT,MG_LIGHTNINGBOLT };
@@ -6494,7 +6494,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case BS_GREED:
if(sd){
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
map_foreachinrange(skill->greed,bl,
skill->get_splash(skill_id, skill_lv),BL_ITEM,bl);
}
@@ -6517,7 +6517,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case NPC_CHANGEHOLY:
case NPC_CHANGEDARKNESS:
case NPC_CHANGETELEKINESIS:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start2(bl, type, 100, skill_lv, skill->get_ele(skill_id,skill_lv),
skill->get_time(skill_id, skill_lv)));
break;
@@ -6525,13 +6525,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
//This skill should fail if target is wearing bathory/evil druid card [Brainstorm]
//TO-DO This is ugly, fix it
if(tstatus->def_ele==ELE_UNDEAD || tstatus->def_ele==ELE_DARK) break;
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start2(bl, type, 100, skill_lv, skill->get_ele(skill_id,skill_lv),
skill->get_time(skill_id, skill_lv)));
break;
case NPC_PROVOCATION:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if (md) mob_unlocktarget(md, tick);
break;
@@ -6540,7 +6540,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
int skill_time = skill->get_time(skill_id,skill_lv);
struct unit_data *ud = unit_bl2ud(bl);
- if (clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ if (clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill_time))
&& ud) { //Disable attacking/acting/moving for skill's duration.
ud->attackabletime =
@@ -6557,18 +6557,18 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case NPC_DARKBLESSING:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start2(bl,type,(50+skill_lv*5),skill_lv,skill_lv,skill->get_time2(skill_id,skill_lv)));
break;
case NPC_LICK:
status_zap(bl, 0, 100);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,(skill_lv*5),skill_lv,skill->get_time2(skill_id,skill_lv)));
break;
case NPC_SUICIDE:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
status_kill(src); //When suiciding, neither exp nor drops is given.
break;
@@ -6595,7 +6595,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
int i = SC_ASPDPOTION0 + skill_lv - 1;
if (i > SC_ASPDPOTION3)
i = SC_ASPDPOTION3;
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,(sc_type)i,100,skill_lv,skill_lv * 60000));
}
break;
@@ -6643,7 +6643,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
//val[4] if set, asks to delete the previous mode change.
if(md && md->skill_idx >= 0 && tsc)
{
- clif_emotion(bl, md->db->skill[md->skill_idx].val[0]);
+ clif->emotion(bl, md->db->skill[md->skill_idx].val[0]);
if(md->db->skill[md->skill_idx].val[4] && tsce)
status_change_end(bl, type, INVALID_TIMER);
@@ -6658,39 +6658,39 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case NPC_POWERUP:
sc_start(bl,SC_INCATKRATE,100,200,skill->get_time(skill_id, skill_lv));
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,100,skill->get_time(skill_id, skill_lv)));
break;
case NPC_AGIUP:
sc_start(bl,SC_SPEEDUP1,100,skill_lv,skill->get_time(skill_id, skill_lv));
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,100,skill->get_time(skill_id, skill_lv)));
break;
case NPC_INVISIBLE:
//Have val4 passed as 6 is for "infinite cloak" (do not end on attack/skill use).
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start4(bl,type,100,skill_lv,0,0,6,skill->get_time(skill_id,skill_lv)));
break;
case NPC_SIEGEMODE:
// not sure what it does
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case WE_MALE:
{
int hp_rate=(!skill_lv)? 0:skill_db[skill_id].hp_rate[skill_lv-1];
int gain_hp= tstatus->max_hp*abs(hp_rate)/100; // The earned is the same % of the target HP than it costed the caster. [Skotlex]
- clif_skill_nodamage(src,bl,skill_id,status_heal(bl, gain_hp, 0, 0),1);
+ clif->skill_nodamage(src,bl,skill_id,status_heal(bl, gain_hp, 0, 0),1);
}
break;
case WE_FEMALE:
{
int sp_rate=(!skill_lv)? 0:skill_db[skill_id].sp_rate[skill_lv-1];
int gain_sp=tstatus->max_sp*abs(sp_rate)/100;// The earned is the same % of the target SP than it costed the caster. [Skotlex]
- clif_skill_nodamage(src,bl,skill_id,status_heal(bl, 0, gain_sp, 0),1);
+ clif->skill_nodamage(src,bl,skill_id,status_heal(bl, 0, gain_sp, 0),1);
}
break;
@@ -6701,7 +6701,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
struct map_session_data *m_sd = pc_get_mother(sd);
// if neither was found
if(!f_sd && !m_sd){
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return 0;
}
@@ -6717,10 +6717,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
hp = sstatus->max_hp/10;
sp = hp * 10 * skill_lv / 100;
if (!status_charge(src,hp,0)) {
- if (sd) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
status_heal(bl,0,sp,2);
}
break;
@@ -6736,7 +6736,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
// Players can only remove their own traps or traps on Vs maps.
if( su && (sg = su->group) && (src->type == BL_MER || sg->src_id == src->id || map_flag_vs(bl->m)) && (skill->get_inf2(sg->skill_id)&INF2_TRAP) )
{
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
if( sd && !(sg->unit_id == UNT_USED_TRAPS || (sg->unit_id == UNT_ANKLESNARE && sg->val2 != 0 )) )
{ // prevent picking up expired traps
if( battle_config.skill_removetrap_type )
@@ -6752,7 +6752,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
item_tmp.identify = 1;
if( item_tmp.nameid && (flag=pc_additem(sd,&item_tmp,skill_db[su->group->skill_id].amount[i],LOG_TYPE_OTHER)) )
{
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
map_addflooritem(&item_tmp,skill_db[su->group->skill_id].amount[i],sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
@@ -6766,19 +6766,19 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
item_tmp.identify = 1;
if( item_tmp.nameid && (flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_OTHER)) )
{
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
}
skill->delunit(su);
}else if(sd)
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
}
break;
case HT_SPRINGTRAP:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
{
struct skill_unit *su=NULL;
if((bl->type==BL_SKILL) && (su=(struct skill_unit *)bl) && (su->group) ){
@@ -6799,7 +6799,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case UNT_CLAYMORETRAP:
case UNT_TALKIEBOX:
su->group->unit_id = UNT_USED_TRAPS;
- clif_changetraplook(bl, UNT_USED_TRAPS);
+ clif->changetraplook(bl, UNT_USED_TRAPS);
su->group->limit=DIFF_TICK(tick+1500,su->group->tick);
su->limit=DIFF_TICK(tick+1500,su->group->tick);
}
@@ -6807,7 +6807,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
}
break;
case BD_ENCORE:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if(sd)
unit_skilluse_id(src,src->id,sd->skill_id_dance,sd->skill_lv_dance);
break;
@@ -6821,11 +6821,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|| tstatus-> hp > tstatus->max_hp*3/4
#endif
) {
- if (sd) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return 1;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start4(bl,type,100,skill_lv,skill_id,src->id,skill->get_time(skill_id,skill_lv),1000));
#ifndef RENEWAL
if (sd) skill->blockpc_start (sd, skill_id, skill->get_time(skill_id, skill_lv)+3000, false);
@@ -6847,10 +6847,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
}
//Has a 55% + skill_lv*5% success chance.
- if (!clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ if (!clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,55+5*skill_lv,skill_lv,skill->get_time(skill_id,skill_lv))))
{
- if (sd) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return 0;
}
@@ -6874,13 +6874,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
unsigned int sp1 = 0, sp2 = 0;
if (dstmd) {
if (dstmd->state.soul_change_flag) {
- if(sd) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ if(sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
dstmd->state.soul_change_flag = 1;
sp2 = sstatus->max_sp * 3 /100;
status_heal(src, 0, sp2, 2);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
}
sp1 = sstatus->sp;
@@ -6893,7 +6893,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
#endif
status_set_sp(src, sp2, 3);
status_set_sp(bl, sp1, 3);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
@@ -6927,9 +6927,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
}
}
if(hp > 0)
- clif_skill_nodamage(NULL,bl,AL_HEAL,hp,1);
+ clif->skill_nodamage(NULL,bl,AL_HEAL,hp,1);
if(sp > 0)
- clif_skill_nodamage(NULL,bl,MG_SRECOVERY,sp,1);
+ clif->skill_nodamage(NULL,bl,MG_SRECOVERY,sp,1);
status_heal(bl,hp,sp,0);
}
break;
@@ -6946,16 +6946,16 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
s++;
}
if( sd && !s ){
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock(); // Don't consume item requirements
return 0;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
case RG_CLEANER: //AppleGirl
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case CG_LONGINGFREEDOM:
@@ -6963,7 +6963,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if (tsc && !tsce && (tsce=tsc->data[SC_DANCING]) && tsce->val4
&& (tsce->val1&0xFFFF) != CG_MOONLIT) //Can't use Longing for Freedom while under Moonlight Petals. [Skotlex]
{
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
}
}
@@ -6975,7 +6975,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( rnd() % 100 > skill_lv * 8 || (dstmd && ((dstmd->guardian_data && dstmd->class_ == MOBID_EMPERIUM) || mob_is_battleground(dstmd))) )
{
if( sd )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return 0;
@@ -6983,7 +6983,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
status_zap(src,0,skill_db[skill->get_index(skill_id)].sp[skill_lv]); // consume sp only if succeeded [Inkfish]
do {
eff = rnd() % 14;
- clif_specialeffect(bl, 523 + eff, AREA);
+ clif->specialeffect(bl, 523 + eff, AREA);
switch (eff)
{
case 0: // heals SP to 0
@@ -6998,7 +6998,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case 3: // 1000 damage, random armor destroyed
{
status_fix_damage(src, bl, 1000, 0);
- clif_damage(src,bl,tick,0,0,1000,0,0,0);
+ clif->damage(src,bl,tick,0,0,1000,0,0,0);
if( !status_isdead(bl) ) {
int where[] = { EQP_ARMOR, EQP_SHIELD, EQP_HELM, EQP_SHOES, EQP_GARMENT };
skill->break_equip(bl, where[rnd()%5], 10000, BCT_ENEMY);
@@ -7035,14 +7035,14 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case 10: // 6666 damage, atk matk halved, cursed
status_fix_damage(src, bl, 6666, 0);
- clif_damage(src,bl,tick,0,0,6666,0,0,0);
+ clif->damage(src,bl,tick,0,0,6666,0,0,0);
sc_start(bl,SC_INCATKRATE,100,-50,skill->get_time2(skill_id,skill_lv));
sc_start(bl,SC_INCMATKRATE,100,-50,skill->get_time2(skill_id,skill_lv));
sc_start(bl,SC_CURSE,skill_lv,100,skill->get_time2(skill_id,skill_lv));
break;
case 11: // 4444 damage
status_fix_damage(src, bl, 4444, 0);
- clif_damage(src,bl,tick,0,0,4444,0,0,0);
+ clif->damage(src,bl,tick,0,0,4444,0,0,0);
break;
case 12: // stun
sc_start(bl,SC_STUN,100,skill_lv,5000);
@@ -7058,7 +7058,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
}
} while ((--count) > 0);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
@@ -7079,26 +7079,26 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SL_WIZARD:
//NOTE: here, 'type' has the value of the associated MAPID, not of the SC_SPIRIT constant.
if (sd && !(dstsd && (dstsd->class_&MAPID_UPPERMASK) == type)) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
if (skill_id == SL_SUPERNOVICE && dstsd && dstsd->die_counter && !(rnd()%100))
{ //Erase death count 1% of the casts
dstsd->die_counter = 0;
pc_setglobalreg(dstsd,"PC_DIE_COUNTER", 0);
- clif_specialeffect(bl, 0x152, AREA);
+ clif->specialeffect(bl, 0x152, AREA);
//SC_SPIRIT invokes status_calc_pc for us.
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start4(bl,SC_SPIRIT,100,skill_lv,skill_id,0,0,skill->get_time(skill_id,skill_lv)));
sc_start(src,SC_SMA,100,skill_lv,skill->get_time(SL_SMA,skill_lv));
break;
case SL_HIGH:
if (sd && !(dstsd && (dstsd->class_&JOBL_UPPER) && !(dstsd->class_&JOBL_2) && dstsd->status.base_level < 70)) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start4(bl,type,100,skill_lv,skill_id,0,0,skill->get_time(skill_id,skill_lv)));
sc_start(src,SC_SMA,100,skill_lv,skill->get_time(SL_SMA,skill_lv));
break;
@@ -7106,7 +7106,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SL_SWOO:
if (tsce) {
if(sd)
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
status_change_start(src,SC_STUN,10000,skill_lv,0,0,0,10000,8);
status_change_end(bl, SC_SWOO, INVALID_TIMER);
break;
@@ -7114,11 +7114,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SL_SKA: // [marquis007]
case SL_SKE:
if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
status_change_start(src,SC_STUN,10000,skill_lv,0,0,0,500,10);
break;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
if (skill_id == SL_SKE)
sc_start(src,SC_SMA,100,skill_lv,skill->get_time(SL_SMA,skill_lv));
break;
@@ -7129,7 +7129,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if (status_get_guild_id(src) == status_get_guild_id(bl))
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id, skill_lv));
} else if (status_get_guild_id(src)) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
map_foreachinrange(skill->area_sub, src,
skill->get_splash(skill_id, skill_lv), BL_PC,
src,skill_id,skill_lv,tick, flag|BCT_GUILD|1,
@@ -7143,7 +7143,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if (status_get_guild_id(src) == status_get_guild_id(bl))
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id, skill_lv));
} else if (status_get_guild_id(src)) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
map_foreachinrange(skill->area_sub, src,
skill->get_splash(skill_id, skill_lv), BL_PC,
src,skill_id,skill_lv,tick, flag|BCT_GUILD|1,
@@ -7155,9 +7155,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case GD_RESTORE:
if(flag&1) {
if (status_get_guild_id(src) == status_get_guild_id(bl))
- clif_skill_nodamage(src,bl,AL_HEAL,status_percent_heal(bl,90,90),1);
+ clif->skill_nodamage(src,bl,AL_HEAL,status_percent_heal(bl,90,90),1);
} else if (status_get_guild_id(src)) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
map_foreachinrange(skill->area_sub, src,
skill->get_splash(skill_id, skill_lv), BL_PC,
src,skill_id,skill_lv,tick, flag|BCT_GUILD|1,
@@ -7176,7 +7176,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
g = sd?sd->state.gmaster_flag:guild_search(status_get_guild_id(src));
if (!g)
break;
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
for(i = 0; i < g->max_member; i++, j++) {
if (j>8) j=0;
if ((dstsd = g->member[i].sd) != NULL && sd != dstsd && !dstsd->state.autotrade && !pc_isdead(dstsd)) {
@@ -7196,23 +7196,23 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
//AuronX reported you CAN memorize the same map as all three. [Skotlex]
if (sd) {
if(!sd->feel_map[skill_lv-1].index)
- clif_feel_req(sd->fd,sd, skill_lv);
+ clif->feel_req(sd->fd,sd, skill_lv);
else
- clif_feel_info(sd, skill_lv-1, 1);
+ clif->feel_info(sd, skill_lv-1, 1);
}
break;
case SG_HATE:
if (sd) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if (!pc_set_hate_mob(sd, skill_lv-1, bl))
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
}
break;
case GS_GLITTERING:
if(sd) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if(rnd()%100 < (20+10*skill_lv))
pc_addspiritball(sd,skill->get_time(skill_id,skill_lv),10);
else if(sd->spiritball > 0)
@@ -7226,22 +7226,22 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
i =65 -5*distance_bl(src,bl); //Base rate
if (i < 30) i = 30;
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
sc_start(bl,SC_STUN, i,skill_lv,skill->get_time2(skill_id,skill_lv));
}
break;
case AM_CALLHOMUN: //[orn]
if (sd && !merc_call_homunculus(sd))
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
case AM_REST:
if (sd) {
if (merc_hom_vaporize(sd,1))
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
else
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
}
break;
@@ -7255,12 +7255,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
skill->blockhomun_start(hd, skill_id, skill->get_time2(skill_id,skill_lv));
if (unit_movepos(src,bl->x,bl->y,0,0)) {
- clif_skill_nodamage(src,src,skill_id,skill_lv,1); // Homunc
- clif_slide(src,bl->x,bl->y) ;
+ clif->skill_nodamage(src,src,skill_id,skill_lv,1); // Homunc
+ clif->slide(src,bl->x,bl->y) ;
if (unit_movepos(bl,x,y,0,0))
{
- clif_skill_nodamage(bl,bl,skill_id,skill_lv,1); // Master
- clif_slide(bl,x,y) ;
+ clif->skill_nodamage(bl,bl,skill_id,skill_lv,1); // Master
+ clif->slide(bl,x,y) ;
}
//TODO: Shouldn't also players and the like switch targets?
@@ -7270,9 +7270,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
}
// Failed
else if (hd && hd->master)
- clif_skill_fail(hd->master, skill_id, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(hd->master, skill_id, USESKILL_FAIL_LEVEL, 0);
else if (sd)
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
break;
case HVAN_CHAOTIC: //[orn]
{
@@ -7289,8 +7289,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if (!bl) bl = src;
i = skill->calc_heal(src, bl, skill_id, 1+rnd()%skill_lv, true);
//Eh? why double skill packet?
- clif_skill_nodamage(src,bl,AL_HEAL,i,1);
- clif_skill_nodamage(src,bl,skill_id,i,1);
+ clif->skill_nodamage(src,bl,AL_HEAL,i,1);
+ clif->skill_nodamage(src,bl,skill_id,i,1);
status_heal(bl, i, 0, 0);
}
break;
@@ -7301,7 +7301,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case HLIF_CHANGE:
case MH_ANGRIFFS_MODUS:
case MH_GOLDENE_FERSE:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
if (hd)
skill->blockhomun_start(hd, skill_id, skill->get_time2(skill_id,skill_lv));
@@ -7335,7 +7335,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
sc_start2(bl,type,100,skill_lv,src->id,skill->get_time2(skill_id,skill_lv));
else {
skill_area_temp[2] = 0; //For SD_PREAMBLE
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
map_foreachinrange(skill->area_sub, bl,
skill->get_splash(skill_id, skill_lv),BL_CHAR,
src,skill_id,skill_lv,tick, flag|BCT_ENEMY|SD_PREAMBLE|1,
@@ -7347,7 +7347,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
status_percent_damage(src,bl,0,((skill_lv-1)%5+1)*20,false);
else {
skill_area_temp[2] = 0; //For SD_PREAMBLE
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
map_foreachinrange(skill->area_sub, bl,
skill->get_splash(skill_id, skill_lv),BL_CHAR,
src,skill_id,skill_lv,tick, flag|BCT_ENEMY|SD_PREAMBLE|1,
@@ -7359,26 +7359,26 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
if( !sd->status.party_id )
{
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
party_foreachsamemap(skill->area_sub, sd, skill->get_splash(skill_id, skill_lv), src, skill_id, skill_lv, tick, flag|BCT_PARTY|1, skill->castend_nodamage_id);
}
else
- clif_skill_nodamage(src,bl,skill_id,skill_lv,sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
break;
case NPC_TALK:
case ALL_WEWISH:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case ALL_BUYING_STORE:
if( sd )
{// players only, skill allows 5 buying slots
- clif_skill_nodamage(src, bl, skill_id, skill_lv, buyingstore_setup(sd, MAX_BUYINGSTORE_SLOTS));
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, buyingstore_setup(sd, MAX_BUYINGSTORE_SLOTS));
}
break;
case RK_ENCHANTBLADE:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,// formula not confirmed
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,// formula not confirmed
sc_start2(bl,type,100,skill_lv,100+20*skill_lv/*+sstatus->int_/2+status_get_lv(bl)/10*/,skill->get_time(skill_id,skill_lv)));
break;
case RK_DRAGONHOWLING:
@@ -7387,7 +7387,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
else
{
skill_area_temp[2] = 0;
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
map_foreachinrange(skill->area_sub, src,
skill->get_splash(skill_id,skill_lv),BL_CHAR,
src,skill_id,skill_lv,tick,flag|BCT_ENEMY|SD_PREAMBLE|1,
@@ -7396,7 +7396,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case RK_IGNITIONBREAK:
case LG_EARTHDRIVE:
- clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
i = skill->get_splash(skill_id,skill_lv);
if( skill_id == LG_EARTHDRIVE ) {
int dummy = 1;
@@ -7410,16 +7410,16 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
int heal = sstatus->hp / 4; // 25% HP
if( status_charge(bl,heal,0) )
- clif_skill_nodamage(src,bl,skill_id,skill_lv,sc_start2(bl,type,100,skill_lv,heal,skill->get_time(skill_id,skill_lv)));
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start2(bl,type,100,skill_lv,heal,skill->get_time(skill_id,skill_lv)));
else
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
}
break;
case RK_REFRESH:
if( sd && pc_checkskill(sd,RK_RUNEMASTERY) >= 8 )
{
int heal = status_get_max_hp(bl) * 25 / 100;
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
status_heal(bl,heal,0,1);
status_change_clear_buffs(bl,4);
@@ -7431,8 +7431,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
short shields = (rnd()%100<50) ? 4 : ((rnd()%100<80) ? 3 : 2);
sc_start4(bl,type,100,skill_lv,shields,1000,0,skill->get_time(skill_id,skill_lv));
- clif_millenniumshield(sd,shields);
- clif_skill_nodamage(src,bl,skill_id,1,1);
+ clif->millenniumshield(sd,shields);
+ clif->skill_nodamage(src,bl,skill_id,1,1);
}
break;
@@ -7450,7 +7450,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
else if( skill_id == RK_CRUSHSTRIKE )
lv = 7;
if( pc_checkskill(sd,RK_RUNEMASTERY) >= lv )
- clif_skill_nodamage(src,bl,skill_id,skill_lv,sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
}
break;
@@ -7468,7 +7468,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
} else
sc_start2(bl,type,100,7,5,skill->get_time(skill_id,skill_lv));
}
- clif_skill_nodamage(src,bl,skill_id,1,1);
+ clif->skill_nodamage(src,bl,skill_id,1,1);
break;
/**
* Guilotine Cross
@@ -7486,7 +7486,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
status_change_end(bl, SC_ROLLINGCUTTER, INVALID_TIMER);
}
sc_start(bl,SC_ROLLINGCUTTER,100,count,skill->get_time(skill_id,skill_lv));
- clif_skill_nodamage(src,src,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,src,skill_id,skill_lv,1);
}
break;
@@ -7495,26 +7495,26 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
status_change_end(bl, SC_WEAPONBLOCKING, INVALID_TIMER);
else
sc_start(bl,SC_WEAPONBLOCKING,100,skill_lv,skill->get_time(skill_id,skill_lv));
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case GC_CREATENEWPOISON:
if( sd )
{
- clif_skill_produce_mix_list(sd,skill_id,25);
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_produce_mix_list(sd,skill_id,25);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
}
break;
case GC_POISONINGWEAPON:
if( sd ) {
- clif_poison_list(sd,skill_lv);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->poison_list(sd,skill_lv);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
case GC_ANTIDOTE:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if( tsc )
{
status_change_end(bl, SC_PARALYSE, INVALID_TIMER);
@@ -7529,8 +7529,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case GC_PHANTOMMENACE:
- clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
map_foreachinrange(skill->area_sub,src,skill->get_splash(skill_id,skill_lv),BL_CHAR,
src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill->castend_damage_id);
break;
@@ -7539,15 +7539,15 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
int heal = status_get_max_hp(bl) / 10;
if( status_get_hp(bl) < heal ) { // if you haven't enough HP skill fails.
- if( sd ) clif_skill_fail(sd,skill_id,USESKILL_FAIL_HP_INSUFFICIENT,0);
+ if( sd ) clif->skill_fail(sd,skill_id,USESKILL_FAIL_HP_INSUFFICIENT,0);
break;
}
if( !status_charge(bl,heal,0) )
{
- if( sd ) clif_skill_fail(sd,skill_id,USESKILL_FAIL_HP_INSUFFICIENT,0);
+ if( sd ) clif->skill_fail(sd,skill_id,USESKILL_FAIL_HP_INSUFFICIENT,0);
break;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
}
break;
/**
@@ -7555,7 +7555,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
**/
case AB_ANCILLA:
if( sd ) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
skill->produce_mix(sd, skill_id, ITEMID_ANCILLA, 0, 0, 0, 1);
}
break;
@@ -7566,7 +7566,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
int bless_lv = pc_checkskill(sd,AL_BLESSING) + (sd->status.job_level / 10);
int agi_lv = pc_checkskill(sd,AL_INCAGI) + (sd->status.job_level / 10);
if( sd == NULL || sd->status.party_id == 0 || flag&1 )
- clif_skill_nodamage(bl, bl, skill_id, skill_lv, sc_start(bl,type,100,
+ clif->skill_nodamage(bl, bl, skill_id, skill_lv, sc_start(bl,type,100,
(skill_id == AB_CLEMENTIA)? bless_lv : (skill_id == AB_CANTO)? agi_lv : skill_lv, skill->get_time(skill_id,skill_lv)));
else if( sd )
party_foreachsamemap(skill->area_sub, sd, skill->get_splash(skill_id, skill_lv), src, skill_id, skill_lv, tick, flag|BCT_PARTY|1, skill->castend_nodamage_id);
@@ -7575,7 +7575,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case AB_PRAEFATIO:
if( sd == NULL || sd->status.party_id == 0 || flag&1 )
- clif_skill_nodamage(bl, bl, skill_id, skill_lv, sc_start4(bl, type, 100, skill_lv, 0, 0, 1, skill->get_time(skill_id, skill_lv)));
+ clif->skill_nodamage(bl, bl, skill_id, skill_lv, sc_start4(bl, type, 100, skill_lv, 0, 0, 1, skill->get_time(skill_id, skill_lv)));
else if( sd )
party_foreachsamemap(skill->area_sub, sd, skill->get_splash(skill_id, skill_lv), src, skill_id, skill_lv, tick, flag|BCT_PARTY|1, skill->castend_nodamage_id);
break;
@@ -7588,7 +7588,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( (dstsd && pc_ismadogear(dstsd)) || status_isimmune(bl))
i = 0; // Should heal by 0 or won't do anything?? in iRO it breaks the healing to members.. [malufett]
- clif_skill_nodamage(bl, bl, skill_id, i, 1);
+ clif->skill_nodamage(bl, bl, skill_id, i, 1);
if( tsc && tsc->data[SC_AKAITSUKI] && i )
i = ~i + 1;
status_heal(bl, i, 0, 0);
@@ -7605,7 +7605,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
map_foreachinrange(skill->area_sub, src, skill->get_splash(skill_id, skill_lv), BL_CHAR,
src, skill_id, skill_lv, tick, flag|BCT_ENEMY|1, skill->castend_nodamage_id);
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
}
break;
@@ -7622,7 +7622,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
status_change_end(bl, SC_FREEZING, INVALID_TIMER);
status_change_end(bl, SC_CRYSTALIZE, INVALID_TIMER);
}else //Success rate only applies to the curing effect and not stat bonus. Bonus status only applies to non infected targets
- clif_skill_nodamage(bl, bl, skill_id, skill_lv,
+ clif->skill_nodamage(bl, bl, skill_id, skill_lv,
sc_start(bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv)));
} else if( sd )
party_foreachsamemap(skill->area_sub, sd, skill->get_splash(skill_id, skill_lv),
@@ -7639,7 +7639,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
status_change_end(bl, SC_MANDRAGORA, INVALID_TIMER);
status_change_end(bl, SC_SILENCE, INVALID_TIMER);
}else // Success rate only applies to the curing effect and not stat bonus. Bonus status only applies to non infected targets
- clif_skill_nodamage(bl, bl, skill_id, skill_lv,
+ clif->skill_nodamage(bl, bl, skill_id, skill_lv,
sc_start(bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv)));
} else if( sd )
party_foreachsamemap(skill->area_sub, sd, skill->get_splash(skill_id, skill_lv),
@@ -7649,11 +7649,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case AB_CLEARANCE:
if( flag&1 || (i = skill->get_splash(skill_id, skill_lv)) < 1 )
{ //As of the behavior in official server Clearance is just a super version of Dispell skill. [Jobbie]
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if((dstsd && (dstsd->class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER) || rnd()%100 >= 30 + 10 * skill_lv)
{
if (sd)
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
if(status_isimmune(bl) || !tsc || !tsc->count)
@@ -7724,7 +7724,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
// Should the level of Lex Divina be equivalent to the level of Silentium or should the highest level learned be used? [LimitLine]
map_foreachinrange(skill->area_sub, src, skill->get_splash(skill_id, skill_lv), BL_CHAR,
src, PR_LEXDIVINA, skill_lv, tick, flag|BCT_ENEMY|1, skill->castend_nodamage_id);
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
break;
/**
* Warlock
@@ -7735,7 +7735,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
else
{
map_foreachinrange(skill->area_sub,src,skill->get_splash(skill_id, skill_lv),BL_CHAR,src,skill_id,skill_lv,tick,(map_flag_vs(src->m)?BCT_ALL:BCT_ENEMY|BCT_SELF)|flag|1,skill->castend_nodamage_id);
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
}
break;
@@ -7753,28 +7753,28 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( !(tsc && tsc->data[type]) ){
i = sc_start2(bl,type,rate,skill_lv,src->id,(src == bl)?5000:(bl->type == BL_PC)?skill->get_time(skill_id,skill_lv):skill->get_time2(skill_id, skill_lv));
- clif_skill_nodamage(src,bl,skill_id,skill_lv,i);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,i);
if( !i )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
}
}else
if( sd )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_TOTARGET,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_TOTARGET,0);
break;
case WL_FROSTMISTY:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
map_foreachinrange(skill->area_sub,bl,skill->get_splash(skill_id,skill_lv),BL_CHAR|BL_SKILL,src,skill_id,skill_lv,tick,flag|BCT_ENEMY,skill->castend_damage_id);
break;
case WL_JACKFROST:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
map_foreachinshootrange(skill->area_sub,bl,skill->get_splash(skill_id,skill_lv),BL_CHAR|BL_SKILL,src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill->castend_damage_id);
break;
case WL_MARSHOFABYSS:
// Should marsh of abyss still apply half reduction to players after the 28/10 patch? [LimitLine]
- clif_skill_nodamage(src, bl, skill_id, skill_lv,
+ clif->skill_nodamage(src, bl, skill_id, skill_lv,
sc_start4(bl, type, 100, skill_lv, status_get_int(src), sd ? sd->status.job_level : 50, 0,
skill->get_time(skill_id, skill_lv)));
break;
@@ -7809,7 +7809,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
// Doesn't send failure packet if it fails on defense.
}
else if( sd ) // Failure on Rate
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
}
break;
@@ -7833,7 +7833,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( !sctype )
{
if( sd ) // No free slots to put SC
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_SUMMON,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_SUMMON,0);
break;
}
@@ -7846,7 +7846,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
}
sc_start4(src,sctype,100,element,pos,skill_lv,0,skill->get_time(skill_id,skill_lv));
- clif_skill_nodamage(src,bl,skill_id,0,0);
+ clif->skill_nodamage(src,bl,skill_id,0,0);
}
break;
@@ -7858,21 +7858,21 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( sc && !sc->data[i] )
break;
if( i == SC_MAXSPELLBOOK ) {
- clif_skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_READING, 0);
+ clif->skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_READING, 0);
break;
}
sc_start(bl, SC_STOP, 100, skill_lv, INVALID_TIMER); //Can't move while selecting a spellbook.
- clif_spellbook_list(sd);
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->spellbook_list(sd);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
}
break;
/**
* Ranger
**/
case RA_FEARBREEZE:
- clif_skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
- clif_skill_nodamage(src, bl, skill_id, skill_lv, sc_start(bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv)));
+ clif->skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, sc_start(bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv)));
break;
case RA_WUGMASTERY:
@@ -7881,7 +7881,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
pc_setoption(sd,sd->sc.option|OPTION_WUG);
else
pc_setoption(sd,sd->sc.option&~OPTION_WUG);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
@@ -7894,25 +7894,25 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
pc_setoption(sd,sd->sc.option&~OPTION_WUGRIDER);
pc_setoption(sd,sd->sc.option|OPTION_WUG);
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
case RA_WUGDASH:
if( tsce ) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,status_change_end(bl, type, INVALID_TIMER));
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,status_change_end(bl, type, INVALID_TIMER));
map_freeblock_unlock();
return 0;
}
if( sd && pc_isridingwug(sd) ) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,sc_start4(bl,type,100,skill_lv,unit_getdir(bl),0,0,1));
- clif_walkok(sd);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start4(bl,type,100,skill_lv,unit_getdir(bl),0,0,1));
+ clif->walkok(sd);
}
break;
case RA_SENSITIVEKEEN:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
- clif_skill_damage(src,src,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_damage(src,src,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
map_foreachinrange(skill->area_sub,src,skill->get_splash(skill_id,skill_lv),BL_CHAR|BL_SKILL,src,skill_id,skill_lv,tick,flag|BCT_ENEMY,skill->castend_damage_id);
break;
/**
@@ -7923,9 +7923,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
uint8 dir = (skill_id == NC_F_SIDESLIDE) ? (unit_getdir(src)+4)%8 : unit_getdir(src);
skill->blown(src,bl,skill->get_blewcount(skill_id,skill_lv),dir,0x1);
- clif_slide(src,src->x,src->y);
- clif_fixpos(src); //Aegis sent this packet
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->slide(src,src->x,src->y);
+ clif->fixpos(src); //Aegis sent this packet
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
@@ -7933,15 +7933,15 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( sd ) {
if( pc_ismadogear(sd) )
pc_setmadogear(sd, 0);
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
skill->castend_damage_id(src, src, skill_id, skill_lv, tick, flag);
status_set_sp(src, 0, 0);
}
break;
case NC_ANALYZE:
- clif_skill_damage(src, bl, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
- clif_skill_nodamage(src, bl, skill_id, skill_lv,
+ clif->skill_damage(src, bl, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv,
sc_start(bl,type, 30 + 12 * skill_lv,skill_lv,skill->get_time(skill_id,skill_lv)));
if( sd ) pc_overheat(sd,1);
break;
@@ -7950,10 +7950,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( (i = sc_start2(bl,type,100,skill_lv,src->id,skill->get_time(skill_id,skill_lv))) )
{
map_foreachinrange(skill->area_sub,src,skill->get_splash(skill_id,skill_lv),splash_target(src),src,skill_id,skill_lv,tick,flag|BCT_ENEMY|SD_SPLASH|1,skill->castend_damage_id);;
- clif_skill_damage(src,src,tick,status_get_amotion(src),0,-30000,1,skill_id,skill_lv,6);
+ clif->skill_damage(src,src,tick,status_get_amotion(src),0,-30000,1,skill_id,skill_lv,6);
if (sd) pc_overheat(sd,1);
}
- clif_skill_nodamage(src,src,skill_id,skill_lv,i);
+ clif->skill_nodamage(src,src,skill_id,skill_lv,i);
break;
case NC_REPAIR:
@@ -7969,8 +7969,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
status_heal(src,heal,0,2);
}
- clif_skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
- clif_skill_nodamage(src, bl, skill_id, skill_lv, heal);
+ clif->skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, heal);
}
break;
@@ -7980,28 +7980,28 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
md = map_id2md(bl->id);
if( md && md->class_ >= MOBID_SILVERSNIPER && md->class_ <= MOBID_MAGICDECOY_WIND )
status_kill(bl);
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
}
break;
case SC_AUTOSHADOWSPELL:
if( sd ) {
if( sd->status.skill[sd->reproduceskill_id].id || sd->status.skill[sd->cloneskill_id].id ) {
sc_start(src,SC_STOP,100,skill_lv,-1);// The skill_lv is stored in val1 used in skill_select_menu to determine the used skill lvl [Xazax]
- clif_autoshadowspell_list(sd);
- clif_skill_nodamage(src,bl,skill_id,1,1);
+ clif->autoshadowspell_list(sd);
+ clif->skill_nodamage(src,bl,skill_id,1,1);
}
else
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_IMITATION_SKILL_NONE,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_IMITATION_SKILL_NONE,0);
}
break;
case SC_SHADOWFORM:
if( sd && dstsd && src != bl && !dstsd->shadowform_id ) {
- if( clif_skill_nodamage(src,bl,skill_id,skill_lv,sc_start4(src,type,100,skill_lv,bl->id,4+skill_lv,0,skill->get_time(skill_id, skill_lv))) )
+ if( clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start4(src,type,100,skill_lv,bl->id,4+skill_lv,0,skill->get_time(skill_id, skill_lv))) )
dstsd->shadowform_id = src->id;
}
else if( sd )
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
break;
case SC_BODYPAINT:
@@ -8019,7 +8019,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
sc_start(bl,SC_BLIND,53 + 2 * skill_lv,skill_lv,skill->get_time(skill_id,skill_lv));
}
} else {
- clif_skill_nodamage(src, bl, skill_id, 0, 1);
+ clif->skill_nodamage(src, bl, skill_id, 0, 1);
map_foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), BL_CHAR,
src, skill_id, skill_lv, tick, flag|BCT_ENEMY|1, skill->castend_nodamage_id);
}
@@ -8035,9 +8035,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
int rate = rnd_value(sstatus->dex/12,sstatus->dex/4) + 10*skill_lv + (sd?sd->status.job_level:0) + status_get_lv(src)/10
- status_get_lv(bl)/10 - tstatus->luk/10 - (dstsd?(dstsd->max_weight-dstsd->weight)/10000:0) - rnd_value(tstatus->agi/6,tstatus->agi/3);
rate = cap_value(rate, skill_lv+sstatus->dex/20, 100);
- clif_skill_nodamage(src,bl,skill_id,0,sc_start(bl,type,rate,skill_lv,skill->get_time(skill_id,skill_lv)));
+ clif->skill_nodamage(src,bl,skill_id,0,sc_start(bl,type,rate,skill_lv,skill->get_time(skill_id,skill_lv)));
} else if( sd )
- clif_skill_fail(sd,skill_id,0,0);
+ clif->skill_fail(sd,skill_id,0,0);
break;
case SC_IGNORANCE:
@@ -8045,19 +8045,19 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
int rate = rnd_value(sstatus->dex/12,sstatus->dex/4) + 10*skill_lv + (sd?sd->status.job_level:0) + status_get_lv(src)/10
- status_get_lv(bl)/10 - tstatus->luk/10 - (dstsd?(dstsd->max_weight-dstsd->weight)/10000:0) - rnd_value(tstatus->agi/6,tstatus->agi/3);
rate = cap_value(rate, skill_lv+sstatus->dex/20, 100);
- if (clif_skill_nodamage(src,bl,skill_id,0,sc_start(bl,type,rate,skill_lv,skill->get_time(skill_id,skill_lv)))) {
+ if (clif->skill_nodamage(src,bl,skill_id,0,sc_start(bl,type,rate,skill_lv,skill->get_time(skill_id,skill_lv)))) {
int sp = 200 * skill_lv;
if( dstmd ) sp = dstmd->level * 2;
if( status_zap(bl,0,sp) )
status_heal(src,0,sp/2,3);
}
- else if( sd ) clif_skill_fail(sd,skill_id,0,0);
+ else if( sd ) clif->skill_fail(sd,skill_id,0,0);
} else if( sd )
- clif_skill_fail(sd,skill_id,0,0);
+ clif->skill_fail(sd,skill_id,0,0);
break;
case LG_TRAMPLE:
- clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
map_foreachinrange(skill->destroy_trap,bl,skill->get_splash(skill_id,skill_lv),BL_SKILL,tick);
break;
@@ -8066,7 +8066,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
status_change_end(bl,type,INVALID_TIMER);
else
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv));
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case LG_SHIELDSPELL:
@@ -8082,7 +8082,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
struct item_data *shield_data = sd->inventory_data[sd->equip_index[EQI_HAND_L]];
if( !shield_data || shield_data->type != IT_ARMOR ) { // No shield?
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
break;
}
brate = shield_data->def * 10;
@@ -8096,7 +8096,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
switch( opt ) {
case 1:
sc_start(bl,SC_SHIELDSPELL_DEF,100,opt,-1);
- clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
if( rate < brate )
map_foreachinrange(skill->area_sub,src,skill->get_splash(skill_id,skill_lv),BL_CHAR,src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill->castend_damage_id);
status_change_end(bl,SC_SHIELDSPELL_DEF,INVALID_TIMER);
@@ -8124,20 +8124,20 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
switch( opt ) {
case 1:
sc_start(bl,SC_SHIELDSPELL_MDEF,100,opt,-1);
- clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
if( rate < brate )
map_foreachinrange(skill->area_sub,src,skill->get_splash(skill_id,skill_lv),BL_CHAR,src,skill_id,skill_lv,tick,flag|BCT_ENEMY|2,skill->castend_damage_id);
status_change_end(bl,SC_SHIELDSPELL_MDEF,INVALID_TIMER);
break;
case 2:
sc_start(bl,SC_SHIELDSPELL_MDEF,100,opt,-1);
- clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
if( rate < brate )
map_foreachinrange(skill->area_sub,src,skill->get_splash(skill_id,skill_lv),BL_CHAR,src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill->castend_nodamage_id);
break;
case 3:
if( sc_start(bl,SC_SHIELDSPELL_MDEF,brate,opt,sd->bonus.shieldmdef * 30000) )
- clif_skill_nodamage(src,bl,PR_MAGNIFICAT,skill_lv,
+ clif->skill_nodamage(src,bl,PR_MAGNIFICAT,skill_lv,
sc_start(bl,SC_MAGNIFICAT,100,1,sd->bonus.shieldmdef * 30000));
break;
}
@@ -8147,7 +8147,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
{
struct item *it = &sd->status.inventory[sd->equip_index[EQI_HAND_L]];
if( !it ) { // No shield?
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
brate = it->refine * 5;
@@ -8176,7 +8176,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
}
break;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
@@ -8186,7 +8186,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
else {
skill_area_temp[2] = 0;
map_foreachinrange(skill->area_sub,bl,skill->get_splash(skill_id,skill_lv),BL_PC,src,skill_id,skill_lv,tick,flag|SD_PREAMBLE|BCT_PARTY|BCT_SELF|1,skill->castend_nodamage_id);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
@@ -8194,10 +8194,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( sd && !map[sd->bl.m].flag.noexppenalty && sd->status.base_level != MAX_LEVEL ) {
sd->status.base_exp -= min(sd->status.base_exp, pc_nextbaseexp(sd) * 1 / 100); // 1% penalty.
sd->status.job_exp -= min(sd->status.job_exp, pc_nextjobexp(sd) * 1 / 100);
- clif_updatestatus(sd,SP_BASEEXP);
- clif_updatestatus(sd,SP_JOBEXP);
+ clif->updatestatus(sd,SP_BASEEXP);
+ clif->updatestatus(sd,SP_JOBEXP);
}
- clif_skill_nodamage(bl,src,skill_id,skill_lv,
+ clif->skill_nodamage(bl,src,skill_id,skill_lv,
sc_start(bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv)));
break;
case SR_CURSEDCIRCLE:
@@ -8207,17 +8207,17 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( bl->type == BL_MOB )
mob_unlocktarget((TBL_MOB*)bl,gettick());
unit_stop_attack(bl);
- clif_bladestop(src, bl->id, 1);
+ clif->bladestop(src, bl->id, 1);
map_freeblock_unlock();
return 1;
}
} else {
int count = 0;
- clif_skill_damage(src, bl, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src, bl, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
count = map_forcountinrange(skill->area_sub, src, skill->get_splash(skill_id,skill_lv), (sd)?sd->spiritball_old:15, // Assume 15 spiritballs in non-charactors
BL_CHAR, src, skill_id, skill_lv, tick, flag|BCT_ENEMY|1, skill->castend_nodamage_id);
if( sd ) pc_delspiritball(sd, count, 0);
- clif_skill_nodamage(src, src, skill_id, skill_lv,
+ clif->skill_nodamage(src, src, skill_id, skill_lv,
sc_start2(src, SC_CURSEDCIRCLE_ATKER, 100, skill_lv, count, skill->get_time(skill_id,skill_lv)));
}
break;
@@ -8228,7 +8228,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
sc_start(bl, SC_EXPLOSIONSPIRITS, 100, skill_lv, skill->get_time(skill_id, skill_lv));
for( i = 0; i < max; i++ ) // Don't call more than max available spheres.
pc_addspiritball(sd, skill->get_time(skill_id, skill_lv), max);
- clif_skill_nodamage(src, bl, skill_id, skill_lv, sc_start(bl, type, 100, skill_lv,skill->get_time(skill_id, skill_lv)));
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, sc_start(bl, type, 100, skill_lv,skill->get_time(skill_id, skill_lv)));
}
break;
@@ -8241,9 +8241,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
pc_delspiritball(dstsd, dstsd->spiritball, 0);
}
if( i ) status_percent_heal(src, 0, i);
- clif_skill_nodamage(src, bl, skill_id, skill_lv, i ? 1:0);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, i ? 1:0);
} else {
- clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
map_foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|BCT_SELF|SD_SPLASH|1, skill->castend_nodamage_id);
}
break;
@@ -8257,7 +8257,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
pc_delspiritball(sd, sd->spiritball, 0);
}
}
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
break;
case SR_GENTLETOUCH_CURE:
@@ -8266,7 +8266,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( status_isimmune(bl) )
{
- clif_skill_nodamage(src,bl,skill_id,skill_lv,0);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,0);
break;
}
@@ -8286,12 +8286,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
status_change_end(bl, SC_FREEZING, INVALID_TIMER);
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
case SR_GENTLETOUCH_CHANGE:
case SR_GENTLETOUCH_REVITALIZE:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start2(bl,type,100,skill_lv,src->id,skill->get_time(skill_id,skill_lv)));
break;
case WA_SWING_DANCE:
@@ -8299,7 +8299,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( sd == NULL || sd->status.party_id == 0 || (flag & 1) )
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv));
else if( sd ) { // Only shows effects on caster.
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
party_foreachsamemap(skill->area_sub, sd, skill->get_splash(skill_id, skill_lv), src, skill_id, skill_lv, tick, flag|BCT_PARTY|1, skill->castend_nodamage_id);
}
break;
@@ -8310,15 +8310,15 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( sd == NULL || sd->status.party_id == 0 || (flag & 1) )
sc_start4(bl,type,100,skill_lv,6*skill_lv,(sd?pc_checkskill(sd,WM_LESSON):0),(sd?sd->status.job_level:0),skill->get_time(skill_id,skill_lv));
else if( sd ) { // Only shows effects on caster.
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
party_foreachsamemap(skill->area_sub, sd, skill->get_splash(skill_id, skill_lv), src, skill_id, skill_lv, tick, flag|BCT_PARTY|1, skill->castend_nodamage_id);
}
break;
case MI_HARMONIZE:
if( src != bl )
- clif_skill_nodamage(src, src, skill_id, skill_lv, sc_start(src, type, 100, skill_lv, skill->get_time(skill_id,skill_lv)));
- clif_skill_nodamage(src, bl, skill_id, skill_lv, sc_start(bl, type, 100, skill_lv, skill->get_time(skill_id,skill_lv)));
+ clif->skill_nodamage(src, src, skill_id, skill_lv, sc_start(src, type, 100, skill_lv, skill->get_time(skill_id,skill_lv)));
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, sc_start(bl, type, 100, skill_lv, skill->get_time(skill_id,skill_lv)));
break;
case WM_DEADHILLHERE:
@@ -8332,9 +8332,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
heal = 1;
tstatus->hp = heal;
tstatus->sp -= tstatus->sp * ( 120 - 20 * skill_lv ) / 100;
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
pc_revive((TBL_PC*)bl,heal,0);
- clif_resurrection(bl,1);
+ clif->resurrection(bl,1);
}
}
break;
@@ -8348,12 +8348,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
sc_start2(bl,type,(skill_id==WM_VOICEOFSIREN)?20+10*skill_lv:100,skill_lv,(skill_id==WM_VOICEOFSIREN)?src->id:0,skill->get_time(skill_id,skill_lv));
} else {
map_foreachinrange(skill->area_sub, src, skill->get_splash(skill_id,skill_lv),(skill_id==WM_VOICEOFSIREN)?BL_CHAR|BL_SKILL:BL_PC, src, skill_id, skill_lv, tick, flag|BCT_ENEMY|1, skill->castend_nodamage_id);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
case WM_GLOOMYDAY:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if( dstsd && ( pc_checkskill(dstsd,KN_BRANDISHSPEAR) || pc_checkskill(dstsd,LK_SPIRALPIERCE) ||
pc_checkskill(dstsd,CR_SHIELDCHARGE) || pc_checkskill(dstsd,CR_SHIELDBOOMERANG) ||
pc_checkskill(dstsd,PA_SHIELDCHAIN) || pc_checkskill(dstsd,LG_SHIELDPRESS) ) )
@@ -8370,11 +8370,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
sc_start(bl, type, 100, skill_lv,skill->get_time(skill_id, skill_lv));
} else if( flag&2 ) {
if( src->id != bl->id && battle->check_target(src,bl,BCT_ENEMY) > 0 )
- status_fix_damage(src,bl,9999,clif_damage(src,bl,tick,0,0,9999,0,0,0));
+ status_fix_damage(src,bl,9999,clif->damage(src,bl,tick,0,0,9999,0,0,0));
} else if( sd ) {
short chance = sstatus->int_/6 + sd->status.job_level/5 + skill_lv*4;
if( !sd->status.party_id || (rnd()%100 > chance)) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_NEED_HELPER,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_NEED_HELPER,0);
break;
}
if( map_foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id,skill_lv),
@@ -8383,10 +8383,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
else
flag |= 1;
map_foreachinrange(skill->area_sub, src, skill->get_splash(skill_id,skill_lv),BL_PC, src, skill_id, skill_lv, tick, flag|BCT_ENEMY|BCT_SELF, skill->castend_nodamage_id);
- clif_skill_nodamage(src, bl, skill_id, skill_lv,
+ clif->skill_nodamage(src, bl, skill_id, skill_lv,
sc_start(src,SC_STOP,100,skill_lv,skill->get_time2(skill_id,skill_lv)));
if( flag&2 ) // Dealed here to prevent conflicts
- status_fix_damage(src,bl,9999,clif_damage(src,bl,tick,0,0,9999,0,0,0));
+ status_fix_damage(src,bl,9999,clif->damage(src,bl,tick,0,0,9999,0,0,0));
}
break;
@@ -8403,7 +8403,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
int count = skill->check_pc_partner(sd,skill_id,&lv,skill->get_splash(skill_id,skill_lv),1);
if( sc_start2(bl,type,100,skill_lv,count,skill->get_time(skill_id,skill_lv)) )
party_foreachsamemap(skill->area_sub,sd,skill->get_splash(skill_id,skill_lv),src,skill_id,skill_lv,tick,flag|BCT_PARTY|1,skill->castend_nodamage_id);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
@@ -8417,7 +8417,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
short lv = (short)skill_lv;
skill_area_temp[0] = (sd) ? skill->check_pc_partner(sd,skill_id,&lv,skill->get_splash(skill_id,skill_lv),1) : 50; // 50% chance in non BL_PC (clones).
map_foreachinrange(skill->area_sub, src, skill->get_splash(skill_id,skill_lv),BL_PC, src, skill_id, skill_lv, tick, flag|BCT_ENEMY|1, skill->castend_nodamage_id);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
@@ -8428,13 +8428,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
improv_skill_id = skill_improvise_db[i].skill_id;
} while( improv_skill_id == 0 || rnd()%10000 >= skill_improvise_db[i].per );
improv_skill_lv = 4 + skill_lv;
- clif_skill_nodamage (src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage (src, bl, skill_id, skill_lv, 1);
if( sd ) {
sd->state.abra_flag = 2;
sd->skillitem = improv_skill_id;
sd->skillitemlv = improv_skill_lv;
- clif_item_skill(sd, improv_skill_id, improv_skill_lv);
+ clif->item_skill(sd, improv_skill_id, improv_skill_lv);
} else {
struct unit_data *ud = unit_bl2ud(src);
int inf = skill->get_inf(improv_skill_id);
@@ -8488,7 +8488,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if(!mapindex)
{ //Given map not found?
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map_freeblock_unlock();
return 0;
}
@@ -8502,8 +8502,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
tsc->opt1 = 0;
else
tsc->opt1 = OPT1_SLEEP;
- clif_changeoption(bl);
- clif_skill_nodamage (src, bl, skill_id, skill_lv, 1);
+ clif->changeoption(bl);
+ clif->skill_nodamage (src, bl, skill_id, skill_lv, 1);
}
break;
@@ -8512,7 +8512,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
// [(15 + 5 * Skill Level) + ( Caster’s INT / 5 ) + ( Caster’s Job Level / 5 ) - ( Target’s INT / 6 ) - ( Target’s LUK / 10 )] %
int rate = (15 + 5 * skill_lv) + status_get_int(src)/5 + (sd ? sd->status.job_level : 0);
rate -= status_get_int(bl)/6 - status_get_luk(bl)/10;
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
sc_start2(bl, type, rate, skill_lv, 1, skill->get_time(skill_id, skill_lv));
}
break;
@@ -8524,7 +8524,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( bl != src )
sc_start(bl,type,rate,skill_lv,skill->get_time(skill_id,skill_lv));
}else {
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
map_foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), BL_CHAR,
src, skill_id, skill_lv, tick, flag|BCT_ALL|1, skill->castend_nodamage_id);
}
@@ -8543,10 +8543,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
// Summoning the new one.
if( !elemental_create(sd,elemental_class,skill->get_time(skill_id,skill_lv)) ) {
- clif_skill_fail(sd,skill_id,0,0);
+ clif->skill_fail(sd,skill_id,0,0);
break;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
@@ -8565,10 +8565,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case 3: mode = EL_MODE_AGGRESSIVE; break;
}
if( !elemental_change_mode(sd->ed,mode) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
@@ -8578,7 +8578,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( !sd->ed ) break;
sd->skill_id_old = skill_id;
elemental_action(sd->ed, bl, tick);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
switch(sd->ed->db->class_){
case 2115:case 2124:
case 2118:case 2121:
@@ -8601,21 +8601,21 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( !ed ) break;
if( !status_charge(&sd->bl,s_hp,s_sp) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
e_hp = ed->battle_status.max_hp * 10 / 100;
e_sp = ed->battle_status.max_sp * 10 / 100;
status_heal(&ed->bl,e_hp,e_sp,3);
- clif_skill_nodamage(src,&ed->bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,&ed->bl,skill_id,skill_lv,1);
}
break;
case GN_CHANGEMATERIAL:
case SO_EL_ANALYSIS:
if( sd ) {
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
- clif_skill_itemlistwindow(sd,skill_id,skill_lv);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_itemlistwindow(sd,skill_id,skill_lv);
}
break;
@@ -8628,11 +8628,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
(sc->bs_counter)--;
status_change_end(src, type, INVALID_TIMER); // the first one cancels and the last one will take effect resetting the timer
}
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
sc_start2(bl, type, 100, skill_lv, src->id, skill->get_time(skill_id,skill_lv));
(sc->bs_counter)++;
} else if( sd ) {
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
break;
}
}
@@ -8640,7 +8640,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case GN_MANDRAGORA:
if( flag&1 ) {
- if ( clif_skill_nodamage(bl, src, skill_id, skill_lv,
+ if ( clif->skill_nodamage(bl, src, skill_id, skill_lv,
sc_start(bl, type, 25 + 10 * skill_lv, skill_lv, skill->get_time(skill_id, skill_lv))) )
status_zap(bl, 0, status_get_max_sp(bl) * (25 + 5 * skill_lv) / 100);
} else
@@ -8665,7 +8665,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
else
skill->attack(BF_WEAPON,src,src,bl,GN_SLINGITEM_RANGEMELEEATK,skill_lv,tick,flag);
} else //Otherwise, it fails, shows animation and removes items.
- clif_skill_fail(sd,GN_SLINGITEM_RANGEMELEEATK,0xa,0);
+ clif->skill_fail(sd,GN_SLINGITEM_RANGEMELEEATK,0xa,0);
} else if( itemdb_is_GNthrowable(ammo_id) ){
struct script_code *script = sd->inventory_data[i]->script;
if( !script )
@@ -8676,8 +8676,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
run_script(script,0,src->id,0);
}
}
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);// This packet is received twice actually, I think it is to show the animation.
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);// This packet is received twice actually, I think it is to show the animation.
break;
case GN_MIX_COOKING:
@@ -8689,8 +8689,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
sd->skill_lv_old = skill_lv;
if( skill_id != GN_S_PHARMACY && skill_lv > 1 )
qty = 10;
- clif_cooking_list(sd,(skill_id - GN_MIX_COOKING) + 27,skill_id,qty,skill_id==GN_MAKEBOMB?5:6);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->cooking_list(sd,(skill_id - GN_MIX_COOKING) + 27,skill_id,qty,skill_id==GN_MAKEBOMB?5:6);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
break;
case EL_CIRCLE_OF_FIRE:
@@ -8720,8 +8720,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if( (sc && sc->data[type2]) || (tsc && tsc->data[type]) ) {
elemental_clean_single_effect(ele, skill_id);
} else {
- clif_skill_nodamage(src,src,skill_id,skill_lv,1);
- clif_skill_damage(src, ( skill_id == EL_GUST || skill_id == EL_BLAST || skill_id == EL_WILD_STORM )?src:bl, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_nodamage(src,src,skill_id,skill_lv,1);
+ clif->skill_damage(src, ( skill_id == EL_GUST || skill_id == EL_BLAST || skill_id == EL_WILD_STORM )?src:bl, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
if( skill_id == EL_WIND_STEP ) // There aren't teleport, just push the master away.
skill->blown(src,bl,(rnd()%skill->get_blewcount(skill_id,skill_lv))+1,rand()%8,0);
sc_start(src,type2,100,skill_lv,skill->get_time(skill_id,skill_lv));
@@ -8735,8 +8735,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case EL_WATER_BARRIER:
case EL_ZEPHYR:
case EL_POWER_OF_GAIA:
- clif_skill_nodamage(src,src,skill_id,skill_lv,1);
- clif_skill_damage(src, bl, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_nodamage(src,src,skill_id,skill_lv,1);
+ clif->skill_damage(src, bl, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
skill->unitsetting(src,skill_id,skill_lv,bl->x,bl->y,0);
break;
@@ -8746,12 +8746,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
struct status_change *sc = status_get_sc(&ele->bl);
sc_type type2 = type-1;
- clif_skill_nodamage(src,src,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,src,skill_id,skill_lv,1);
if( (sc && sc->data[type2]) || (tsc && tsc->data[type]) ) {
elemental_clean_single_effect(ele, skill_id);
} else {
// This not heals at the end.
- clif_skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
sc_start(src,type2,100,skill_lv,skill->get_time(skill_id,skill_lv));
sc_start(bl,type,100,src->id,skill->get_time(skill_id,skill_lv));
}
@@ -8765,7 +8765,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case KO_DOHU_KOUKAI:
if(sd) {
int ttype = skill->get_ele(skill_id, skill_lv);
- clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
pc_add_talisman(sd, skill->get_time(skill_id, skill_lv), 10, ttype);
}
break;
@@ -8784,7 +8784,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
md->deletetimer = add_timer (gettick() + skill->get_time(skill_id, skill_lv), mob_timer_delete, md->bl.id, 0);
mob_spawn( md );
pc_setinvincibletimer(sd,500);// unlock target lock
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
skill->blown(src,bl,skill->get_blewcount(skill_id,skill_lv),unit_getdir(bl),0);
}
}
@@ -8792,22 +8792,22 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case KO_KYOUGAKU:
if( dstsd && tsc && !tsc->data[type] && rand()%100 < tstatus->int_/2 ){
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
}else if( sd )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
case KO_JYUSATSU:
if( dstsd && tsc && !tsc->data[type] &&
rand()%100 < ((45+5*skill_lv) + skill_lv*5 - status_get_int(bl)/2) ){//[(Base chance of success) + (Skill Level x 5) - (int / 2)]%.
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
status_change_start(bl,type,10000,skill_lv,0,0,0,skill->get_time(skill_id,skill_lv),1));
status_zap(bl, tstatus->max_hp*skill_lv*5/100 , 0);
if( status_get_lv(bl) <= status_get_lv(src) )
status_change_start(bl,SC_COMA,10,skill_lv,0,src->id,0,0,0);
}else if( sd )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
case KO_GENWAKU:
@@ -8815,20 +8815,20 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
int x = src->x, y = src->y;
if( sd && rnd()%100 > ((45+5*skill_lv) - status_get_int(bl)/10) ){//[(Base chance of success) - (Intelligence Objectives / 10)]%.
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
if (unit_movepos(src,bl->x,bl->y,0,0)) {
- clif_skill_nodamage(src,src,skill_id,skill_lv,1);
- clif_slide(src,bl->x,bl->y) ;
+ clif->skill_nodamage(src,src,skill_id,skill_lv,1);
+ clif->slide(src,bl->x,bl->y) ;
sc_start(src,SC_CONFUSION,80,skill_lv,skill->get_time(skill_id,skill_lv));
if (unit_movepos(bl,x,y,0,0))
{
- clif_skill_damage(bl,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, -1, 6);
+ clif->skill_damage(bl,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, -1, 6);
if( bl->type == BL_PC && pc_issit((TBL_PC*)bl))
- clif_sitting(bl); //Avoid sitting sync problem
- clif_slide(bl,x,y) ;
+ clif->sitting(bl); //Avoid sitting sync problem
+ clif->slide(bl,x,y) ;
sc_start(bl,SC_CONFUSION,80,skill_lv,skill->get_time(skill_id,skill_lv));
}
}
@@ -8839,16 +8839,16 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case OB_OBOROGENSOU:
if( sd && ( (skill_id == OB_OBOROGENSOU && bl->type == BL_MOB) // This skill does not work on monsters.
|| is_boss(bl) ) ){ // Does not work on Boss monsters.
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
case KO_IZAYOI:
case OB_ZANGETSU:
case KG_KYOMU:
case KG_KAGEMUSYA:
- clif_skill_nodamage(src,bl,skill_id,skill_lv,
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
- clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
break;
case KG_KAGEHUMI:
@@ -8867,7 +8867,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
status_change_end(bl, SC_HARMONIZE, INVALID_TIMER);
}
if( skill_area_temp[2] == 1 ){
- clif_skill_damage(src,src,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src,src,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
sc_start(src, SC_STOP, 100, skill_lv, skill->get_time(skill_id, skill_lv));
}
}else{
@@ -8914,7 +8914,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
hd->homunculus.hunger = min(1,hd->homunculus.hunger);
if(s_bl && s_bl->type==BL_PC){
status_set_sp(s_bl,status_get_max_sp(s_bl)/2,0); //master drain 50% sp
- clif_send_homdata(((TBL_PC *)s_bl), SP_HUNGRY, hd->homunculus.hunger); //refresh hunger info
+ clif->send_homdata(((TBL_PC *)s_bl), SP_HUNGRY, hd->homunculus.hunger); //refresh hunger info
sc_start(s_bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv)); //gene bonus
}
sc_start(bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv));
@@ -8935,7 +8935,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case MH_LIGHT_OF_REGENE:
if(hd){
hd->homunculus.intimacy = 251; //change to neutral (can't be cast if < 750)
- if(sd) clif_send_homdata(sd, SP_INTIMATE, hd->homunculus.intimacy); //refresh intimacy info
+ if(sd) clif->send_homdata(sd, SP_INTIMATE, hd->homunculus.intimacy); //refresh intimacy info
}
//don't break need to start status and start block timer
case MH_STYLE_CHANGE:
@@ -8969,7 +8969,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
default:
ShowWarning("skill_castend_nodamage_id: Unknown skill used:%d\n",skill_id);
- clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
map_freeblock_unlock();
return 1;
}
@@ -9064,7 +9064,7 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
switch (ud->skill_id) {
//These should become skill_castend_pos
case WE_CALLPARTNER:
- if(sd) clif_callpartner(sd);
+ if(sd) clif->callpartner(sd);
case WE_CALLPARENT:
case WE_CALLBABY:
case AM_RESURRECTHOMUN:
@@ -9109,7 +9109,7 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
sc = status_get_sc(target);
if( battle->check_target(src,target, BCT_ENEMY) <= 0 && (!sc || !sc->data[SC_SILENCE]) )
{ //If it's not an enemy, and not silenced, you can't use the skill on them. [Skotlex]
- clif_skill_nodamage (src, target, ud->skill_id, ud->skill_lv, 0);
+ clif->skill_nodamage (src, target, ud->skill_id, ud->skill_lv, 0);
break;
}
}
@@ -9137,7 +9137,7 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
}
if( sd && (inf2&INF2_CHORUS_SKILL) && skill->check_pc_partner(sd, ud->skill_id, &ud->skill_lv, 1, 0) < 1 ) {
- clif_skill_fail(sd, ud->skill_id, USESKILL_FAIL_NEED_HELPER, 0);
+ clif->skill_fail(sd, ud->skill_id, USESKILL_FAIL_NEED_HELPER, 0);
break;
}
@@ -9147,14 +9147,14 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
break;
}
else if (inf && battle->check_target(src, target, inf) <= 0){
- if (sd) clif_skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0);
+ if (sd) clif->skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
if(inf&BCT_ENEMY && (sc = status_get_sc(target)) &&
sc->data[SC_FOGWALL] &&
rnd() % 100 < 75) { //Fogwall makes all offensive-type targetted skills fail at 75%
- if (sd) clif_skill_fail(sd, ud->skill_id, USESKILL_FAIL_LEVEL, 0);
+ if (sd) clif->skill_fail(sd, ud->skill_id, USESKILL_FAIL_LEVEL, 0);
break;
}
}
@@ -9166,14 +9166,14 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
if(md) {
md->last_thinktime=tick +MIN_MOBTHINKTIME;
if(md->skill_idx >= 0 && md->db->skill[md->skill_idx].emotion >= 0)
- clif_emotion(src, md->db->skill[md->skill_idx].emotion);
+ clif->emotion(src, md->db->skill[md->skill_idx].emotion);
}
if(src != target && battle_config.skill_add_range &&
!check_distance_bl(src, target, skill->get_range2(src,ud->skill_id,ud->skill_lv)+battle_config.skill_add_range))
{
if (sd) {
- clif_skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0);
if(battle_config.skill_out_range_consume) //Consume items anyway. [Skotlex]
skill->consume_requirement(sd,ud->skill_id,ud->skill_lv,3);
}
@@ -9217,7 +9217,7 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
skill->blockpc_start(sd, ud->skill_id, cooldown, false);
}
if( battle_config.display_status_timers && sd )
- clif_status_change(src, SI_ACTIONDELAY, 1, skill->delay_fix(src, ud->skill_id, ud->skill_lv), 0, 0, 0);
+ clif->status_change(src, SI_ACTIONDELAY, 1, skill->delay_fix(src, ud->skill_id, ud->skill_lv), 0, 0, 0);
if( sd )
{
switch( ud->skill_id )
@@ -9307,10 +9307,10 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
else y = 0;
if (unit_movepos(src, src->x+x, src->y+y, 1, 1))
{ //Display movement + animation.
- clif_slide(src,src->x,src->y);
- clif_skill_damage(src,target,tick,sd->battle_status.amotion,0,0,1,ud->skill_id, ud->skill_lv, 5);
+ clif->slide(src,src->x,src->y);
+ clif->skill_damage(src,target,tick,sd->battle_status.amotion,0,0,1,ud->skill_id, ud->skill_lv, 5);
}
- clif_skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0);
}
}
@@ -9371,7 +9371,7 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr_t data)
skill->check_unit_range(src,ud->skillx,ud->skilly,ud->skill_id,ud->skill_lv)
)
{
- if (sd) clif_skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0);
+ if (sd) clif->skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
if( src->type&battle_config.skill_nofootset &&
@@ -9379,7 +9379,7 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr_t data)
skill->check_unit_range2(src,ud->skillx,ud->skilly,ud->skill_id,ud->skill_lv)
)
{
- if (sd) clif_skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0);
+ if (sd) clif->skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
if( src->type&battle_config.land_skill_limit &&
@@ -9392,7 +9392,7 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr_t data)
}
if( maxcount == 0 )
{
- if (sd) clif_skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0);
+ if (sd) clif->skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
}
@@ -9423,7 +9423,7 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr_t data)
if(md) {
md->last_thinktime=tick +MIN_MOBTHINKTIME;
if(md->skill_idx >= 0 && md->db->skill[md->skill_idx].emotion >= 0)
- clif_emotion(src, md->db->skill[md->skill_idx].emotion);
+ clif->emotion(src, md->db->skill[md->skill_idx].emotion);
}
if(battle_config.skill_log && battle_config.skill_log&src->type)
@@ -9447,7 +9447,7 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr_t data)
skill->blockpc_start(sd, ud->skill_id, cooldown, false);
}
if( battle_config.display_status_timers && sd )
- clif_status_change(src, SI_ACTIONDELAY, 1, skill->delay_fix(src, ud->skill_id, ud->skill_lv), 0, 0, 0);
+ clif->status_change(src, SI_ACTIONDELAY, 1, skill->delay_fix(src, ud->skill_id, ud->skill_lv), 0, 0, 0);
// if( sd )
// {
// switch( ud->skill_id )
@@ -9528,9 +9528,9 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
break; //Effect is displayed on respective switch case.
default:
if(skill->get_inf(skill_id)&INF_SELF_SKILL)
- clif_skill_nodamage(src,src,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,src,skill_id,skill_lv,1);
else
- clif_skill_poseffect(src,skill_id,skill_lv,x,y,tick);
+ clif->skill_poseffect(src,skill_id,skill_lv,x,y,tick);
}
// SC_MAGICPOWER needs to switch states before any damage is actually dealt
@@ -9710,7 +9710,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
else { // Create Basilica. Start SC on caster. Unit timer start SC on others.
if( map_foreachinrange(skill_count_wos, src, 2, BL_MOB|BL_PC, src) ) {
if( sd )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL,0);
return 1;
}
@@ -9748,7 +9748,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
tmpy = y - area + rnd()%(area * 2 + 1);
if( i == 0 && path_search_long(NULL, src->m, src->x, src->y, tmpx, tmpy, CELL_CHKWALL) )
- clif_skill_poseffect(src,skill_id,skill_lv,tmpx,tmpy,tick);
+ clif->skill_poseffect(src,skill_id,skill_lv,tmpx,tmpy,tick);
if( i > 0 )
skill->addtimerskill(src,tick+i*1000,0,tmpx,tmpy,skill_id,skill_lv,(x1<<16)|y1,0);
@@ -9764,7 +9764,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case AL_WARP:
if(sd)
{
- clif_skill_warppoint(sd, skill_id, skill_lv, sd->status.save_point.map,
+ clif->skill_warppoint(sd, skill_id, skill_lv, sd->status.save_point.map,
(skill_lv >= 2) ? sd->status.memo_point[0].map : 0,
(skill_lv >= 3) ? sd->status.memo_point[1].map : 0,
(skill_lv >= 4) ? sd->status.memo_point[2].map : 0
@@ -9777,9 +9777,9 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case MO_BODYRELOCATION:
if (unit_movepos(src, x, y, 1, 1)) {
#if PACKETVER >= 20111005
- clif_snap(src, src->x, src->y);
+ clif->snap(src, src->x, src->y);
#else
- clif_skill_poseffect(src,skill_id,skill_lv,src->x,src->y,tick);
+ clif->skill_poseffect(src,skill_id,skill_lv,src->x,src->y,tick);
#endif
if (sd)
skill->blockpc_start (sd, MO_EXTREMITYFIST, 2000, false);
@@ -9788,7 +9788,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case NJ_SHADOWJUMP:
if( !map_flag_gvg(src->m) && !map[src->m].flag.battleground ) { //You don't move on GVG grounds.
unit_movepos(src, x, y, 1, 0);
- clif_slide(src,x,y);
+ clif->slide(src,x,y);
}
status_change_end(src, SC_HIDING, INVALID_TIMER);
break;
@@ -9820,7 +9820,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
int j = pc_search_inventory(sd,skill_db[skill_id].itemid[i]);
if( j < 0 || skill_db[skill_id].itemid[i] <= 0 || sd->inventory_data[j] == NULL || sd->status.inventory[j].amount < skill_db[skill_id].amount[i] )
{
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 1;
}
potion_flag = 1;
@@ -9872,11 +9872,11 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case HW_GANBANTEIN:
if (rnd()%100 < 80) {
int dummy = 1;
- clif_skill_poseffect(src,skill_id,skill_lv,x,y,tick);
+ clif->skill_poseffect(src,skill_id,skill_lv,x,y,tick);
i = skill->get_splash(skill_id, skill_lv);
map_foreachinarea(skill->cell_overlap, src->m, x-i, y-i, x+i, y+i, BL_SKILL, HW_GANBANTEIN, &dummy, src);
} else {
- if (sd) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 1;
}
break;
@@ -9892,12 +9892,12 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
if (sd) {
if( map_count_oncell(src->m,x,y,BL_CHAR) > 0 )
{
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 1;
}
- clif_skill_poseffect(src,skill_id,skill_lv,x,y,tick);
+ clif->skill_poseffect(src,skill_id,skill_lv,x,y,tick);
if (rnd()%100 < 50) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
} else {
TBL_MOB* md = mob_once_spawn_sub(src, src->m, x, y, "--ja--",(skill_lv < 2 ? 1084+rnd()%2 : 1078+rnd()%6),"", SZ_SMALL, AI_NONE);
int i;
@@ -9935,7 +9935,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
if (sce)
status_change_end(src, type, INVALID_TIMER); //Was under someone else's Gospel. [Skotlex]
sc_start4(src,type,100,skill_lv,0,sg->group_id,BCT_SELF,skill->get_time(skill_id,skill_lv));
- clif_skill_poseffect(src, skill_id, skill_lv, 0, 0, tick); // PA_GOSPEL music packet
+ clif->skill_poseffect(src, skill_id, skill_lv, 0, 0, tick); // PA_GOSPEL music packet
}
break;
case NJ_TATAMIGAESHI:
@@ -9948,14 +9948,14 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
{
if (!merc_resurrect_homunculus(sd, 20*skill_lv, x, y))
{
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
}
break;
case RK_WINDCUTTER:
- clif_skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
case NC_COLDSLOWER:
case NC_ARMSCANNON:
case RK_DRAGONBREATH:
@@ -9975,10 +9975,10 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case GC_POISONSMOKE:
if( !(sc && sc->data[SC_POISONINGWEAPON]) ) {
if( sd )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_GC_POISONINGWEAPON,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_GC_POISONINGWEAPON,0);
return 0;
}
- clif_skill_damage(src,src,tick,status_get_amotion(src),0,-30000,1,skill_id,skill_lv,6);
+ clif->skill_damage(src,src,tick,status_get_amotion(src),0,-30000,1,skill_id,skill_lv,6);
skill->unitsetting(src, skill_id, skill_lv, x, y, flag);
//status_change_end(src,SC_POISONINGWEAPON,INVALID_TIMER); // 08/31/2011 - When using poison smoke, you no longer lose the poisoning weapon effect.
break;
@@ -10026,7 +10026,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case RA_DETONATOR:
i = skill->get_splash(skill_id, skill_lv);
map_foreachinarea(skill->detonator, src->m, x-i, y-i, x+i, y+i, BL_SKILL, src);
- clif_skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+ clif->skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
break;
/**
* Mechanic
@@ -10059,11 +10059,11 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
break;
case NC_MAGICDECOY:
- if( sd ) clif_magicdecoy_list(sd,skill_lv,x,y);
+ if( sd ) clif->magicdecoy_list(sd,skill_lv,x,y);
break;
case SC_FEINTBOMB:
- clif_skill_nodamage(src,src,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,src,skill_id,skill_lv,1);
skill->unitsetting(src,skill_id,skill_lv,x,y,0); // Set bomb on current Position
if( skill->blown(src,src,6,unit_getdir(src),0) )
skill->castend_nodamage_id(src,src,TF_HIDING,1,tick,0);
@@ -10088,7 +10088,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
sc_start4(src,SC_BANDING,100,skill_lv,0,0,sg->group_id,skill->get_time(skill_id,skill_lv));
if( sd ) pc_banding(sd,skill_lv);
}
- clif_skill_nodamage(src,src,skill_id,skill_lv,1);
+ clif->skill_nodamage(src,src,skill_id,skill_lv,1);
break;
case LG_RAYOFGENESIS:
@@ -10097,7 +10097,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
map_foreachinarea(skill->area_sub,src->m,x-i,y-i,x+i,y+i,splash_target(src),
src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill->castend_damage_id);
} else if( sd )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL,0);
break;
case WM_DOMINION_IMPULSE:
@@ -10133,11 +10133,11 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
switch( skill_lv ) {
case 3:
ud->skillunit[i]->unit_id = UNT_FIRE_EXPANSION_SMOKE_POWDER;
- clif_changetraplook(&ud->skillunit[i]->unit->bl, UNT_FIRE_EXPANSION_SMOKE_POWDER);
+ clif->changetraplook(&ud->skillunit[i]->unit->bl, UNT_FIRE_EXPANSION_SMOKE_POWDER);
break;
case 4:
ud->skillunit[i]->unit_id = UNT_FIRE_EXPANSION_TEAR_GAS;
- clif_changetraplook(&ud->skillunit[i]->unit->bl, UNT_FIRE_EXPANSION_TEAR_GAS);
+ clif->changetraplook(&ud->skillunit[i]->unit->bl, UNT_FIRE_EXPANSION_TEAR_GAS);
break;
case 5:
map_foreachinarea(skill->area_sub, src->m,
@@ -10160,7 +10160,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case SO_ELECTRICWALK:
if( sc && sc->data[type] )
status_change_end(src,type,INVALID_TIMER);
- clif_skill_nodamage(src, src ,skill_id, skill_lv,
+ clif->skill_nodamage(src, src ,skill_id, skill_lv,
sc_start2(src, type, 100, skill_id, skill_lv, skill->get_time(skill_id, skill_lv)));
break;
@@ -10271,7 +10271,7 @@ int skill_castend_map (struct map_session_data *sd, uint16 skill_id, const char
mapindex = mapindex_name2id((char*)map);
if(!mapindex) { //Given map not found?
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
skill_failed(sd);
return 0;
}
@@ -10286,7 +10286,7 @@ int skill_castend_map (struct map_session_data *sd, uint16 skill_id, const char
maxcount--;
}
if(!maxcount) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
skill_failed(sd);
return 0;
}
@@ -10353,7 +10353,7 @@ int skill_dance_overlap_sub(struct block_list* bl, va_list ap) {
else //Remove dissonance
target->val2 &= ~UF_ENSEMBLE;
- clif_skill_setunit(target); //Update look of affected cell.
+ clif->skill_setunit(target); //Update look of affected cell.
return 1;
}
@@ -10976,7 +10976,7 @@ int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned
if( td )
sec = DIFF_TICK(td->tick, tick);
map_moveblock(bl, src->bl.x, src->bl.y, tick);
- clif_fixpos(bl);
+ clif->fixpos(bl);
sg->val2 = bl->id;
}
else
@@ -11001,11 +11001,11 @@ int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned
if (!sce) {
TBL_PC *sd = BL_CAST(BL_PC, bl); //prevent fullheal exploit
if (sd && sd->bloodylust_tick && DIFF_TICK(gettick(), sd->bloodylust_tick) < skill->get_time2(SC_BLOODYLUST, 1))
- clif_skill_nodamage(&src->bl,bl,sg->skill_id,sg->skill_lv,
+ clif->skill_nodamage(&src->bl,bl,sg->skill_id,sg->skill_lv,
sc_start4(bl, type, 100, sg->skill_lv, 1, 0, 0, skill->get_time(LK_BERSERK, sg->skill_lv)));
else {
if (sd) sd->bloodylust_tick = gettick();
- clif_skill_nodamage(&src->bl,bl,sg->skill_id,sg->skill_lv,
+ clif->skill_nodamage(&src->bl,bl,sg->skill_id,sg->skill_lv,
sc_start4(bl, type, 100, sg->skill_lv, 0, 0, 0, skill->get_time(LK_BERSERK, sg->skill_lv)));
}
}
@@ -11246,7 +11246,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
break;
if( status_isimmune(bl) )
heal = 0;
- clif_skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1);
+ clif->skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1);
if( tsc && tsc->data[SC_AKAITSUKI] && heal )
heal = ~heal + 1;
status_heal(bl, heal, 0, 0);
@@ -11269,7 +11269,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
break;
if (status_isimmune(bl))
heal = 0;
- clif_skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1);
+ clif->skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1);
status_heal(bl, heal, 0, 0);
}
break;
@@ -11345,7 +11345,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
{
skill->blown(&src->bl,bl,skill->get_blewcount(sg->skill_id,sg->skill_lv),unit_getdir(bl),0);
sg->unit_id = UNT_USED_TRAPS;
- clif_changetraplook(&src->bl, UNT_USED_TRAPS);
+ clif->changetraplook(&src->bl, UNT_USED_TRAPS);
sg->limit=DIFF_TICK(tick,sg->tick)+1500;
}
break;
@@ -11360,19 +11360,19 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
sec = DIFF_TICK(td->tick, tick);
if( sg->unit_id == UNT_MANHOLE || battle_config.skill_trap_type || !map_flag_gvg(src->bl.m) ) {
unit_movepos(bl, src->bl.x, src->bl.y, 0, 0);
- clif_fixpos(bl);
+ clif->fixpos(bl);
}
sg->val2 = bl->id;
} else
sec = 3000; //Couldn't trap it?
if( sg->unit_id == UNT_ANKLESNARE ) {
- clif_skillunit_update(&src->bl);
+ clif->skillunit_update(&src->bl);
/**
* If you're snared from a trap that was invisible this makes the trap be
* visible again -- being you stepped on it (w/o this the trap remains invisible and you go "WTF WHY I CANT MOVE")
* bugreport:3961
**/
- clif_changetraplook(&src->bl, UNT_ANKLESNARE);
+ clif->changetraplook(&src->bl, UNT_ANKLESNARE);
}
sg->limit = DIFF_TICK(tick,sg->tick)+sec;
sg->interval = -1;
@@ -11387,7 +11387,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
if( status_change_start(bl,type,10000,sg->skill_lv,sg->group_id,0,0,skill->get_time2(sg->skill_id, sg->skill_lv), 8) ) {
map_moveblock(bl, src->bl.x, src->bl.y, tick);
- clif_fixpos(bl);
+ clif->fixpos(bl);
}
@@ -11423,7 +11423,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
case UNT_FIREPILLAR_ACTIVE:
map_foreachinrange(skill->trap_splash,&src->bl, skill->get_splash(sg->skill_id, sg->skill_lv), sg->bl_flag, &src->bl,tick);
if (sg->unit_id != UNT_FIREPILLAR_ACTIVE)
- clif_changetraplook(&src->bl, sg->unit_id==UNT_LANDMINE?UNT_FIREPILLAR_ACTIVE:UNT_USED_TRAPS);
+ clif->changetraplook(&src->bl, sg->unit_id==UNT_LANDMINE?UNT_FIREPILLAR_ACTIVE:UNT_USED_TRAPS);
sg->limit=DIFF_TICK(tick,sg->tick)+1500 +
(sg->unit_id== UNT_CLUSTERBOMB || sg->unit_id== UNT_ICEBOUNDTRAP?1000:0);// Cluster Bomb/Icebound has 1s to disappear once activated.
sg->unit_id = UNT_USED_TRAPS; //Changed ID so it does not invoke a for each in area again.
@@ -11433,9 +11433,9 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
if (sg->src_id == bl->id)
break;
if (sg->val2 == 0){
- clif_talkiebox(&src->bl, sg->valstr);
+ clif->talkiebox(&src->bl, sg->valstr);
sg->unit_id = UNT_USED_TRAPS;
- clif_changetraplook(&src->bl, UNT_USED_TRAPS);
+ clif->changetraplook(&src->bl, UNT_USED_TRAPS);
sg->limit = DIFF_TICK(tick, sg->tick) + 5000;
sg->val2 = -1;
}
@@ -11469,7 +11469,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
heal = skill->calc_heal(ss,bl,sg->skill_id, sg->skill_lv, true);
if( tsc->data[SC_AKAITSUKI] && heal )
heal = ~heal + 1;
- clif_skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1);
+ clif->skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1);
status_heal(bl, heal, 0, 0);
break;
}
@@ -11491,28 +11491,28 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
{
case 0: // Heal 1~9999 HP
heal = rnd() %9999+1;
- clif_skill_nodamage(ss,bl,AL_HEAL,heal,1);
+ clif->skill_nodamage(ss,bl,AL_HEAL,heal,1);
status_heal(bl,heal,0,0);
break;
case 1: // End all negative status
status_change_clear_buffs(bl,6);
- if (tsd) clif_gospel_info(tsd, 0x15);
+ if (tsd) clif->gospel_info(tsd, 0x15);
break;
case 2: // Immunity to all status
sc_start(bl,SC_SCRESIST,100,100,time);
- if (tsd) clif_gospel_info(tsd, 0x16);
+ if (tsd) clif->gospel_info(tsd, 0x16);
break;
case 3: // MaxHP +100%
sc_start(bl,SC_INCMHPRATE,100,100,time);
- if (tsd) clif_gospel_info(tsd, 0x17);
+ if (tsd) clif->gospel_info(tsd, 0x17);
break;
case 4: // MaxSP +100%
sc_start(bl,SC_INCMSPRATE,100,100,time);
- if (tsd) clif_gospel_info(tsd, 0x18);
+ if (tsd) clif->gospel_info(tsd, 0x18);
break;
case 5: // All stats +20
sc_start(bl,SC_INCALLSTATUS,100,20,time);
- if (tsd) clif_gospel_info(tsd, 0x19);
+ if (tsd) clif->gospel_info(tsd, 0x19);
break;
case 6: // Level 10 Blessing
sc_start(bl,SC_BLESSING,100,10,time);
@@ -11522,24 +11522,24 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
break;
case 8: // Enchant weapon with Holy element
sc_start(bl,SC_ASPERSIO,100,1,time);
- if (tsd) clif_gospel_info(tsd, 0x1c);
+ if (tsd) clif->gospel_info(tsd, 0x1c);
break;
case 9: // Enchant armor with Holy element
sc_start(bl,SC_BENEDICTIO,100,1,time);
- if (tsd) clif_gospel_info(tsd, 0x1d);
+ if (tsd) clif->gospel_info(tsd, 0x1d);
break;
case 10: // DEF +25%
sc_start(bl,SC_INCDEFRATE,100,25,time);
- if (tsd) clif_gospel_info(tsd, 0x1e);
+ if (tsd) clif->gospel_info(tsd, 0x1e);
break;
case 11: // ATK +100%
sc_start(bl,SC_INCATKRATE,100,100,time);
- if (tsd) clif_gospel_info(tsd, 0x1f);
+ if (tsd) clif->gospel_info(tsd, 0x1f);
break;
case 12: // HIT/Flee +50
sc_start(bl,SC_INCHIT,100,50,time);
sc_start(bl,SC_INCFLEE,100,50,time);
- if (tsd) clif_gospel_info(tsd, 0x20);
+ if (tsd) clif->gospel_info(tsd, 0x20);
break;
}
}
@@ -11586,7 +11586,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
if( i > 0 && !(status_get_mode(bl)&MD_BOSS) )
{ // knock-back any enemy except Boss
skill->blown(&src->bl, bl, 2, unit_getdir(bl), 0);
- clif_fixpos(bl);
+ clif->fixpos(bl);
}
if( sg->src_id != bl->id && i <= 0 )
@@ -11611,7 +11611,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
skill->get_splash(sg->skill_id, sg->skill_lv), sg->bl_flag,
&src->bl,tick);
sg->unit_id = UNT_USED_TRAPS;
- //clif_changetraplook(&src->bl, UNT_FIREPILLAR_ACTIVE);
+ //clif->changetraplook(&src->bl, UNT_FIREPILLAR_ACTIVE);
sg->limit=DIFF_TICK(tick,sg->tick)+1500;
break;
/**
@@ -11663,7 +11663,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
break;
case UNT_REVERBERATION:
- clif_changetraplook(&src->bl,UNT_USED_TRAPS);
+ clif->changetraplook(&src->bl,UNT_USED_TRAPS);
map_foreachinrange(skill->trap_splash,&src->bl, skill->get_splash(sg->skill_id, sg->skill_lv), sg->bl_flag, &src->bl,tick);
sg->limit = DIFF_TICK(tick,sg->tick)+1000;
sg->unit_id = UNT_USED_TRAPS;
@@ -11691,7 +11691,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
if( td )
sec = DIFF_TICK(td->tick, tick);
///map_moveblock(bl, src->bl.x, src->bl.y, tick); // in official server it doesn't behave like this. [malufett]
- clif_fixpos(bl);
+ clif->fixpos(bl);
sg->val2 = bl->id;
} else
sec = 3000; // Couldn't trap it?
@@ -11749,7 +11749,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
if( ssc && ssc->data[SC_HEATER_OPTION] )
hp += hp * ssc->data[SC_HEATER_OPTION]->val3 / 100;
if( tstatus->hp != tstatus->max_hp )
- clif_skill_nodamage(&src->bl, bl, AL_HEAL, hp, 0);
+ clif->skill_nodamage(&src->bl, bl, AL_HEAL, hp, 0);
if( tsc && tsc->data[SC_AKAITSUKI] && hp )
hp = ~hp + 1;
status_heal(bl, hp, 0, 0);
@@ -11805,7 +11805,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
distance_xy(src->bl.x, src->bl.y, bl->x, bl->y) <= range && // only snap if the target is inside the range or
src->bl.x != bl->x && src->bl.y != bl->y){// diagonal position parallel to VE's center
unit_movepos(bl, src->bl.x, src->bl.y, 0, 0);
- clif_fixpos(bl);
+ clif->fixpos(bl);
}
}
break;
@@ -12228,7 +12228,7 @@ int skill_check_pc_partner (struct map_session_data *sd, uint16 skill_id, short*
if (c > 0 && sd->sc.data[SC_DANCING] && (tsd = map_id2sd(p_sd[0])) != NULL) {
sd->sc.data[SC_DANCING]->val4 = tsd->bl.id;
sc_start4(&tsd->bl,SC_DANCING,100,skill_id,sd->sc.data[SC_DANCING]->val2,*skill_lv,sd->bl.id,skill->get_time(skill_id,*skill_lv)+1000);
- clif_skill_nodamage(&tsd->bl, &sd->bl, skill_id, *skill_lv, 1);
+ clif->skill_nodamage(&tsd->bl, &sd->bl, skill_id, *skill_lv, 1);
tsd->skill_id_dance = skill_id;
tsd->skill_lv_dance = *skill_lv;
}
@@ -12355,7 +12355,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
}
if( pc_is90overweight(sd) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_WEIGHTOVER,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_WEIGHTOVER,0);
return 0;
}
@@ -12396,7 +12396,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case BS_ADRENALINE2: case NC_POWERSWING:
case BS_UNFAIRLYTRICK: case NC_AXETORNADO:
case BS_GREED:
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
default: //Only Mechanic exlcusive skill can be used.
break;
@@ -12414,19 +12414,19 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
switch( skill_id ) {
case SO_SPELLFIST:
if(sd->skill_id_old != MG_FIREBOLT && sd->skill_id_old != MG_COLDBOLT && sd->skill_id_old != MG_LIGHTNINGBOLT){
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
case SA_CASTCANCEL:
if(sd->ud.skilltimer == INVALID_TIMER) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case AL_WARP:
if(!battle_config.duel_allow_teleport && sd->duel_group) { // duel restriction [LuzZza]
char output[128]; sprintf(output, msg_txt(365), skill->get_name(AL_WARP));
- clif_displaymessage(sd->fd, output); //"Duel: Can't use %s in duel."
+ clif->displaymessage(sd->fd, output); //"Duel: Can't use %s in duel."
return 0;
}
break;
@@ -12434,7 +12434,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
if(sc && sc->data[SC_RAISINGDRAGON])
skill_lv += sc->data[SC_RAISINGDRAGON]->val1;
if(sd->spiritball >= skill_lv) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12487,7 +12487,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
}
else if( !unit_can_move(&sd->bl) )
{ //Placed here as ST_MOVE_ENABLE should not apply if rooted or on a combo. [Skotlex]
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12495,7 +12495,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case TK_MISSION:
if( (sd->class_&MAPID_UPPERMASK) != MAPID_TAEKWON ) {
// Cannot be used by Non-Taekwon classes
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12507,7 +12507,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case TK_JUMPKICK:
if( (sd->class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER ) {
// Soul Linkers cannot use this skill
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12538,7 +12538,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
int time;
if(!(sc && sc->data[SC_DANCING]))
{
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
time = 1000*(sc->data[SC_DANCING]->val3>>16);
@@ -12547,7 +12547,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
(sc->data[SC_DANCING]->val1>>16)) //Dance Skill LV
- time < skill->get_time2(skill_id,skill_lv))
{
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
}
@@ -12556,7 +12556,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case PR_BENEDICTIO:
if (skill->check_pc_partner(sd, skill_id, &skill_lv, 1, 0) < 2)
{
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12574,7 +12574,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case CG_HERMODE:
if(!npc_check_areanpc(1,sd->bl.m,sd->bl.x,sd->bl.y,skill->get_splash(skill_id, skill_lv)))
{
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12586,7 +12586,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
x = sd->bl.x+(i%size-range);
y = sd->bl.y+(i/size-range);
if (map_getcell(sd->bl.m,x,y,CELL_CHKWALL)) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
}
@@ -12597,7 +12597,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
int exp;
if( ((exp = pc_nextbaseexp(sd)) > 0 && get_percentage(sd->status.base_exp, exp) < 1) ||
((exp = pc_nextjobexp(sd)) > 0 && get_percentage(sd->status.job_exp, exp) < 1)) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); //Not enough exp.
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); //Not enough exp.
return 0;
}
break;
@@ -12606,7 +12606,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case AM_TWILIGHT3:
if (!party_skill_check(sd, sd->status.party_id, skill_id, skill_lv))
{
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12618,7 +12618,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
i = skill_id-SG_SUN_WARM;
if (sd->bl.m == sd->feel_map[i].m)
break;
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
break;
case SG_SUN_COMFORT:
@@ -12630,7 +12630,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
if (sd->bl.m == sd->feel_map[i].m &&
(battle_config.allow_skill_without_day || sg_info[i].day_func()))
break;
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
case SG_FUSION:
if (sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_STAR)
@@ -12640,7 +12640,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
if( require.sp > 0 )
{
if (status->sp < (unsigned int)require.sp)
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_SP_INSUFFICIENT,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_SP_INSUFFICIENT,0);
else
status_zap(&sd->bl, 0, require.sp);
}
@@ -12649,7 +12649,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case GD_REGENERATION:
case GD_RESTORE:
if (!map_flag_gvg2(sd->bl.m)) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
case GD_EMERGENCYCALL:
@@ -12660,7 +12660,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case GS_GLITTERING:
if(sd->spiritball >= 10) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12671,12 +12671,12 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
#else
if (status->hp < 2) {
#endif
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
case NJ_BUNSINJYUTSU:
if (!(sc && sc->data[SC_NEN])) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12684,7 +12684,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case NJ_ZENYNAGE:
case KO_MUCHANAGE:
if(sd->status.zeny < require.zeny) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_MONEY,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_MONEY,0);
return 0;
}
break;
@@ -12694,14 +12694,14 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
break;
case AM_CALLHOMUN: //Can't summon if a hom is already out
if (sd->status.hom_id && sd->hd && !sd->hd->homunculus.vaporize) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case AM_REST: //Can't vapo homun if you don't have an active homunc or it's hp is < 80%
if (!merc_is_hom_active(sd->hd) || sd->hd->battle_status.hp < (sd->hd->battle_status.max_hp*80/100))
{
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12715,7 +12715,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
if( sd->status.inventory[i].nameid == ITEMID_ANCILLA )
count += sd->status.inventory[i].amount;
if( count >= 3 ) {
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_ANCILLA_NUMOVER, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_ANCILLA_NUMOVER, 0);
return 0;
}
}
@@ -12727,7 +12727,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
//case AB_LAUDAAGNUS:
//case AB_LAUDARAMUS:
// if( !sd->status.party_id ) {
- // clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ // clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
// return 0;
// }
// break;
@@ -12739,8 +12739,8 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case WL_COMET:
if( skill->check_pc_partner(sd,skill_id,&skill_lv,1,0) <= 0 && ((i = pc_search_inventory(sd,require.itemid[0])) < 0 || sd->status.inventory[i].amount < require.amount[0]) )
{
- //clif_skill_fail(sd,skill_id,USESKILL_FAIL_NEED_ITEM,require.amount[0],require.itemid[0]);
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ //clif->skill_fail(sd,skill_id,USESKILL_FAIL_NEED_ITEM,require.amount[0],require.itemid[0]);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12753,7 +12753,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
ARR_FIND(SC_SPHERE_1,SC_SPHERE_5+1,i,!sc->data[i]);
if( i == SC_SPHERE_5+1 )
{ // No more free slots
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_SUMMON,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_SUMMON,0);
return 0;
}
}
@@ -12763,14 +12763,14 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
**/
case GC_HALLUCINATIONWALK:
if( sc && (sc->data[SC_HALLUCINATIONWALK] || sc->data[SC_HALLUCINATIONWALK_POSTDELAY]) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case GC_COUNTERSLASH:
case GC_WEAPONCRUSH:
if( !(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == GC_WEAPONBLOCKING) ) {
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_GC_WEAPONBLOCKING, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_GC_WEAPONBLOCKING, 0);
return 0;
}
break;
@@ -12779,25 +12779,25 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
**/
case RA_WUGMASTERY:
if( pc_isfalcon(sd) || pc_isridingwug(sd) || sd->sc.data[SC__GROOMY]) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case RA_WUGSTRIKE:
if( !pc_iswug(sd) && !pc_isridingwug(sd) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case RA_WUGRIDER:
if( pc_isfalcon(sd) || ( !pc_isridingwug(sd) && !pc_iswug(sd) ) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case RA_WUGDASH:
if(!pc_isridingwug(sd)) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12806,19 +12806,19 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
**/
case LG_BANDING:
if( sc && sc->data[SC_INSPIRATION] ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case LG_PRESTIGE:
if( sc && (sc->data[SC_BANDING] || sc->data[SC_INSPIRATION]) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case LG_RAGEBURST:
if( sd->spiritball == 0 ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_SKILLINTERVAL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_SKILLINTERVAL,0);
return 0;
}
sd->spiritball_old = require.spiritball = sd->spiritball;
@@ -12827,14 +12827,14 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
if( sc && sc->data[SC_INSPIRATION] )
return 1; // Don't check for partner.
if( !(sc && sc->data[SC_BANDING]) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL,0);
return 0;
} else if( skill->check_pc_partner(sd,skill_id,&skill_lv,skill->get_range(skill_id,skill_lv),0) < 1 )
return 0; // Just fails, no msg here.
break;
case LG_HESPERUSLIT:
if( !sc || !sc->data[SC_BANDING] ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12845,7 +12845,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case SR_CRESCENTELBOW:
if( sc && sc->data[SC_CRESCENTELBOW] ) {
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_DUPLICATE, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_DUPLICATE, 0);
return 0;
}
break;
@@ -12855,14 +12855,14 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
MOBID_EMPERIUM, MOBID_GUARIDAN_STONE1, MOBID_GUARIDAN_STONE2)) {
char output[128];
sprintf(output, "You're too close to a stone or emperium to do this skill");
- clif_colormes(sd, COLOR_RED, output);
+ clif->colormes(sd, COLOR_RED, output);
return 0;
}
}
if( sd->spiritball > 0 )
sd->spiritball_old = require.spiritball = sd->spiritball;
else {
- clif_skill_fail(sd,skill_id,0,0);
+ clif->skill_fail(sd,skill_id,0,0);
return 0;
}
break;
@@ -12873,7 +12873,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case SC_MANHOLE:
case SC_DIMENSIONDOOR:
if( sc && sc->data[SC_MAGNETICFIELD] ) {
- clif_skill_fail(sd,skill_id,0,0);
+ clif->skill_fail(sd,skill_id,0,0);
return 0;
}
break;
@@ -12881,7 +12881,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
int count;
count = skill->check_pc_partner(sd, skill_id, &skill_lv, skill->get_splash(skill_id,skill_lv), 0);
if( count < 1 ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_NEED_HELPER,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_NEED_HELPER,0);
return 0;
} else
require.sp -= require.sp * 20 * count / 100; // -20% each W/M in the party.
@@ -12891,26 +12891,26 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case SO_ELECTRICWALK: // Can't be casted until you've walked all cells.
if( sc && sc->data[SC_PROPERTYWALK] &&
sc->data[SC_PROPERTYWALK]->val3 < skill->get_maxcount(sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2) ) {
- clif_skill_fail(sd,skill_id,0x0,0);
+ clif->skill_fail(sd,skill_id,0x0,0);
return 0;
}
break;
case SO_EL_CONTROL:
if( !sd->status.ele_id || !sd->ed ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case RETURN_TO_ELDICASTES:
if( pc_ismadogear(sd) ) { //Cannot be used if Mado is equipped.
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case LG_REFLECTDAMAGE:
case CR_REFLECTSHIELD:
if( sc && sc->data[SC_KYOMU] && rand()%100 < 30){
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12922,7 +12922,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
int ttype = skill->get_ele(skill_id, skill_lv);
ARR_FIND(1, 5, i, sd->talisman[i] > 0 && i != ttype);
if( (i < 5 && i != ttype) || sd->talisman[ttype] >= 10 ){
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
return 0;
}
}
@@ -12931,7 +12931,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case KO_ZENKAI:
ARR_FIND(1, 6, i, sd->talisman[i] > 0);
if( i > 4 ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -12940,66 +12940,66 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
switch(require.state) {
case ST_HIDING:
if(!(sc && sc->option&OPTION_HIDE)) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case ST_CLOAKING:
if(!pc_iscloaking(sd)) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case ST_HIDDEN:
if(!pc_ishiding(sd)) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case ST_RIDING:
if(!pc_isriding(sd) && !pc_isridingdragon(sd)) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case ST_FALCON:
if(!pc_isfalcon(sd)) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case ST_CARTBOOST:
if(!(sc && sc->data[SC_CARTBOOST])) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
case ST_CART:
if(!pc_iscarton(sd)) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case ST_SHIELD:
if(sd->status.shield <= 0) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case ST_SIGHT:
if(!(sc && sc->data[SC_SIGHT])) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case ST_EXPLOSIONSPIRITS:
if(!(sc && sc->data[SC_EXPLOSIONSPIRITS])) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case ST_RECOV_WEIGHT_RATE:
if(battle_config.natural_heal_weight_rate <= 100 && sd->weight*100/sd->max_weight >= (unsigned int)battle_config.natural_heal_weight_rate) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -13008,7 +13008,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
sd->ud.canmove_tick = gettick(); //When using a combo, cancel the can't move delay to enable the skill. [Skotlex]
if (!unit_can_move(&sd->bl)) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -13017,63 +13017,63 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
break;
if (map_getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKWATER))
break;
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
case ST_RIDINGDRAGON:
if( !pc_isridingdragon(sd) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case ST_WUG:
if( !pc_iswug(sd) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case ST_RIDINGWUG:
if( !pc_isridingwug(sd) ){
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case ST_MADO:
if( !pc_ismadogear(sd) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
case ST_ELEMENTALSPIRIT:
if(!sd->ed) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_EL_SUMMON,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_EL_SUMMON,0);
return 0;
}
break;
case ST_POISONINGWEAPON:
if (!(sc && sc->data[SC_POISONINGWEAPON])) {
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_GC_POISONINGWEAPON, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_GC_POISONINGWEAPON, 0);
return 0;
}
break;
case ST_ROLLINGCUTTER:
if (!(sc && sc->data[SC_ROLLINGCUTTER])) {
- clif_skill_fail(sd, skill_id, USESKILL_FAIL_CONDITION, 0);
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_CONDITION, 0);
return 0;
}
break;
case ST_MH_FIGHTING:
if (!(sc && sc->data[SC_STYLE_CHANGE] && sc->data[SC_STYLE_CHANGE]->val2 == MH_MD_FIGHTING)){
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
case ST_MH_GRAPPLING:
if (!(sc && sc->data[SC_STYLE_CHANGE] && sc->data[SC_STYLE_CHANGE]->val2 == MH_MD_GRAPPLING)){
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
case ST_PECO:
if(!pc_isriding(sd)) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -13082,27 +13082,27 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
if(require.mhp > 0 && get_percentage(status->hp, status->max_hp) > require.mhp) {
//mhp is the max-hp-requirement, that is,
//you must have this % or less of HP to cast it.
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_HP_INSUFFICIENT,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_HP_INSUFFICIENT,0);
return 0;
}
if( require.weapon && !pc_check_weapontype(sd,require.weapon) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);
return 0;
}
if( require.sp > 0 && status->sp < (unsigned int)require.sp) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_SP_INSUFFICIENT,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_SP_INSUFFICIENT,0);
return 0;
}
if( require.zeny > 0 && sd->status.zeny < require.zeny ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_MONEY,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_MONEY,0);
return 0;
}
if( require.spiritball > 0 && sd->spiritball < require.spiritball) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_SPIRITS,require.spiritball);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_SPIRITS,require.spiritball);
return 0;
}
@@ -13153,7 +13153,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
return 1;
if( pc_is90overweight(sd) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_WEIGHTOVER,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_WEIGHTOVER,0);
return 0;
}
@@ -13174,7 +13174,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
if(c >= maxcount ||
(skill_id==AM_CANNIBALIZE && c != i && battle_config.summon_flora&2))
{ //Fails when: exceed max limit. There are other plant types already out.
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
}
@@ -13195,7 +13195,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
} else
map_foreachinmap(skill->check_condition_mob_master_sub, sd->bl.m, BL_MOB, sd->bl.id, mob_class, skill_id, &c);
if( c >= maxcount ) {
- clif_skill_fail(sd , skill_id, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd , skill_id, USESKILL_FAIL_LEVEL, 0);
return 0;
}
}
@@ -13205,7 +13205,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
int c = 0;
i = map_foreachinmap(skill->check_condition_mob_master_sub, sd->bl.m, BL_MOB, sd->bl.id, 2308, skill_id, &c);
if( c >= skill->get_maxcount(skill_id,skill_lv) || c != i) {
- clif_skill_fail(sd , skill_id, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd , skill_id, USESKILL_FAIL_LEVEL, 0);
return 0;
}
}
@@ -13217,18 +13217,18 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
require = skill->get_requirement(sd,skill_id,skill_lv);
if( require.hp > 0 && status->hp <= (unsigned int)require.hp) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_HP_INSUFFICIENT,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_HP_INSUFFICIENT,0);
return 0;
}
if( require.weapon && !pc_check_weapontype(sd,require.weapon) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);
return 0;
}
if( require.ammo ) { //Skill requires stuff equipped in the arrow slot.
if((i=sd->equip_index[EQI_AMMO]) < 0 || !sd->inventory_data[i] ) {
- clif_arrow_fail(sd,0);
+ clif->arrow_fail(sd,0);
return 0;
} else if( sd->status.inventory[i].amount < require.ammo_qty ) {
char e_msg[100];
@@ -13236,13 +13236,13 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
skill->get_desc(skill_id),
require.ammo_qty,
itemdb_jname(sd->status.inventory[i].nameid));
- clif_colormes(sd,COLOR_RED,e_msg);
+ clif->colormes(sd,COLOR_RED,e_msg);
return 0;
}
if (!(require.ammo&1<<sd->inventory_data[i]->look)) { //Ammo type check. Send the "wrong weapon type" message
//which is the closest we have to wrong ammo type. [Skotlex]
- clif_arrow_fail(sd,0); //Haplo suggested we just send the equip-arrows message instead. [Skotlex]
- //clif_skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);
+ clif->arrow_fail(sd,0); //Haplo suggested we just send the equip-arrows message instead. [Skotlex]
+ //clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);
return 0;
}
}
@@ -13253,11 +13253,11 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
index[i] = pc_search_inventory(sd,require.itemid[i]);
if( index[i] < 0 || sd->status.inventory[index[i]].amount < require.amount[i] ) {
if( require.itemid[i] == ITEMID_RED_GEMSTONE )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_REDJAMSTONE,0);// red gemstone required
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_REDJAMSTONE,0);// red gemstone required
else if( require.itemid[i] == ITEMID_BLUE_GEMSTONE )
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_BLUEJAMSTONE,0);// blue gemstone required
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_BLUEJAMSTONE,0);// blue gemstone required
else
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
}
@@ -14084,7 +14084,7 @@ void skill_repairweapon (struct map_session_data *sd, int idx) {
return; //Again invalid item....
if( sd != target_sd && !battle->check_range(&sd->bl,&target_sd->bl, skill->get_range2(&sd->bl, sd->menuskill_id,sd->menuskill_val2) ) ){
- clif_item_repaireffect(sd,idx,1);
+ clif->item_repaireffect(sd,idx,1);
return;
}
@@ -14093,22 +14093,22 @@ void skill_repairweapon (struct map_session_data *sd, int idx) {
else
material = materials [2]; // Armors consume 1 Steel
if ( pc_search_inventory(sd,material) < 0 ) {
- clif_skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0);
return;
}
- clif_skill_nodamage(&sd->bl,&target_sd->bl,sd->menuskill_id,1,1);
+ clif->skill_nodamage(&sd->bl,&target_sd->bl,sd->menuskill_id,1,1);
item->attribute = 0;/* clear broken state */
- clif_equiplist(target_sd);
+ clif->equiplist(target_sd);
pc_delitem(sd,pc_search_inventory(sd,material),1,0,0,LOG_TYPE_CONSUME);
- clif_item_repaireffect(sd,idx,0);
+ clif->item_repaireffect(sd,idx,0);
if( sd != target_sd )
- clif_item_repaireffect(target_sd,idx,0);
+ clif->item_repaireffect(target_sd,idx,0);
}
/*==========================================
@@ -14126,7 +14126,7 @@ void skill_identify (struct map_session_data *sd, int idx)
sd->status.inventory[idx].identify=1;
}
}
- clif_item_identified(sd,idx,flag);
+ clif->item_identified(sd,idx,flag);
}
/*==========================================
@@ -14151,7 +14151,7 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
|| ditem->flag.no_refine // if the item isn't refinable
|| (i = pc_search_inventory(sd, material [ditem->wlv])) < 0 )
{
- clif_skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0);
return;
}
@@ -14167,12 +14167,12 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
ep = item->equip;
pc_unequipitem(sd,idx,3);
}
- clif_refine(sd->fd,0,idx,item->refine);
- clif_delitem(sd,idx,1,3);
- clif_additem(sd,idx,1,0);
+ clif->refine(sd->fd,0,idx,item->refine);
+ clif->delitem(sd,idx,1,3);
+ clif->additem(sd,idx,1,0);
if (ep)
pc_equipitem(sd,idx,ep);
- clif_misceffect(&sd->bl,3);
+ clif->misceffect(&sd->bl,3);
if(item->refine == 10 &&
item->card[0] == CARD0_FORGE &&
(int)MakeDWord(item->card[2],item->card[3]) == sd->status.char_id)
@@ -14193,10 +14193,10 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
item->refine = 0;
if(item->equip)
pc_unequipitem(sd,idx,3);
- clif_refine(sd->fd,1,idx,item->refine);
+ clif->refine(sd->fd,1,idx,item->refine);
pc_delitem(sd,idx,1,0,2, LOG_TYPE_OTHER);
- clif_misceffect(&sd->bl,2);
- clif_emotion(&sd->bl, E_OMG);
+ clif->misceffect(&sd->bl,2);
+ clif->emotion(&sd->bl, E_OMG);
}
}
}
@@ -14321,9 +14321,9 @@ int skill_sit (struct map_session_data *sd, int type)
}
if( type ) {
- clif_status_load(&sd->bl,SI_SIT,1);
+ clif->status_change(&sd->bl, SI_SIT, 1, 0, 0, 0, 0);
} else {
- clif_status_load(&sd->bl,SI_SIT,0);
+ clif->status_change(&sd->bl, SI_SIT, 0, 0, 0, 0, 0);
}
if (!flag) return 0;
@@ -14549,12 +14549,12 @@ int skill_detonator(struct block_list *bl, va_list ap)
case UNT_FIRINGTRAP:
case UNT_ICEBOUNDTRAP:
if( unit_id == UNT_TALKIEBOX ) {
- clif_talkiebox(bl,unit->group->valstr);
+ clif->talkiebox(bl,unit->group->valstr);
unit->group->val2 = -1;
} else
map_foreachinrange(skill->trap_splash,bl,skill->get_splash(unit->group->skill_id,unit->group->skill_lv),unit->group->bl_flag,bl,unit->group->tick);
- clif_changetraplook(bl,unit_id == UNT_FIRINGTRAP ? UNT_DUMMYSKILL : UNT_USED_TRAPS);
+ clif->changetraplook(bl,unit_id == UNT_FIRINGTRAP ? UNT_DUMMYSKILL : UNT_USED_TRAPS);
unit->group->unit_id = UNT_USED_TRAPS;
unit->group->limit = DIFF_TICK(gettick(),unit->group->tick) +
(unit_id == UNT_TALKIEBOX ? 5000 : (unit_id == UNT_CLUSTERBOMB || unit_id == UNT_ICEBOUNDTRAP? 2500 : 1500) );
@@ -14737,7 +14737,7 @@ int skill_trap_splash (struct block_list *bl, va_list ap) {
skill->blown(src,bl,skill->get_blewcount(sg->skill_id,sg->skill_lv),-1,0);
break;
case UNT_ELECTRICSHOCKER:
- clif_skill_damage(src,bl,tick,0,0,-30000,1,sg->skill_id,sg->skill_lv,5);
+ clif->skill_damage(src,bl,tick,0,0,-30000,1,sg->skill_id,sg->skill_lv,5);
break;
case UNT_FIRINGTRAP:
case UNT_ICEBOUNDTRAP:
@@ -14875,7 +14875,7 @@ struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int
switch (group->skill_id) {
case WZ_ICEWALL:
map_setgatcell(unit->bl.m,unit->bl.x,unit->bl.y,5);
- clif_changemapcell(0,unit->bl.m,unit->bl.x,unit->bl.y,5,AREA);
+ clif->changemapcell(0,unit->bl.m,unit->bl.x,unit->bl.y,5,AREA);
skill->unitsetmapcell(unit,WZ_ICEWALL,group->skill_lv,CELL_ICEWALL,true);
map[unit->bl.m].icewall_num++;
break;
@@ -14894,7 +14894,7 @@ struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int
break;
}
- clif_skill_setunit(unit);
+ clif->skill_setunit(unit);
return unit;
}
@@ -14929,7 +14929,7 @@ int skill_delunit (struct skill_unit* unit) {
break;
case WZ_ICEWALL:
map_setgatcell(unit->bl.m,unit->bl.x,unit->bl.y,unit->val2);
- clif_changemapcell(0,unit->bl.m,unit->bl.x,unit->bl.y,unit->val2,ALL_SAMEMAP); // hack to avoid clientside cell bug
+ clif->changemapcell(0,unit->bl.m,unit->bl.x,unit->bl.y,unit->val2,ALL_SAMEMAP); // hack to avoid clientside cell bug
skill->unitsetmapcell(unit,WZ_ICEWALL,group->skill_lv,CELL_ICEWALL,false);
map[unit->bl.m].icewall_num--;
break;
@@ -14957,7 +14957,7 @@ int skill_delunit (struct skill_unit* unit) {
break;
}
- clif_skill_delunit(unit);
+ clif->skill_delunit(unit);
unit->group=NULL;
map_delblock(&unit->bl); // don't free yet
@@ -15304,7 +15304,7 @@ int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
case UNT_GROUNDDRIFT_WATER:
case UNT_GROUNDDRIFT_FIRE:
group->unit_id = UNT_USED_TRAPS;
- //clif_changetraplook(bl, UNT_FIREPILLAR_ACTIVE);
+ //clif->changetraplook(bl, UNT_FIREPILLAR_ACTIVE);
group->limit=DIFF_TICK(tick+1500,group->tick);
unit->limit=DIFF_TICK(tick+1500,group->tick);
break;
@@ -15351,7 +15351,7 @@ int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
case UNT_WARP_ACTIVE:
// warp portal opens (morph to a UNT_WARP_WAITING cell)
group->unit_id = skill->get_unit_id(group->skill_id, 1); // UNT_WARP_WAITING
- clif_changelook(&unit->bl, LOOK_BASE, group->unit_id);
+ clif->changelook(&unit->bl, LOOK_BASE, group->unit_id);
// restart timers
group->limit = skill->get_time(group->skill_id,group->skill_lv);
unit->limit = skill->get_time(group->skill_id,group->skill_lv);
@@ -15383,7 +15383,7 @@ int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
skill->delunit(unit);
break;
}
- clif_changetraplook(bl,UNT_USED_TRAPS);
+ clif->changetraplook(bl,UNT_USED_TRAPS);
map_foreachinrange(skill->trap_splash, bl, skill->get_splash(group->skill_id, group->skill_lv), group->bl_flag, bl, tick);
group->limit = DIFF_TICK(tick,group->tick)+1000;
unit->limit = DIFF_TICK(tick,group->tick)+1000;
@@ -15438,7 +15438,7 @@ int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
if( group->unit_id == UNT_ANKLESNARE && group->val2 > 0 )
skill->delunit(unit);
else {
- clif_changetraplook(bl, group->unit_id==UNT_LANDMINE?UNT_FIREPILLAR_ACTIVE:UNT_USED_TRAPS);
+ clif->changetraplook(bl, group->unit_id==UNT_LANDMINE?UNT_FIREPILLAR_ACTIVE:UNT_USED_TRAPS);
group->limit = DIFF_TICK(tick, group->tick) + 1500;
group->unit_id = UNT_USED_TRAPS;
}
@@ -15446,7 +15446,7 @@ int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
break;
case UNT_REVERBERATION:
if( unit->val1 <= 0 ){
- clif_changetraplook(bl,UNT_USED_TRAPS);
+ clif->changetraplook(bl,UNT_USED_TRAPS);
map_foreachinrange(skill->trap_splash, bl, skill->get_splash(group->skill_id, group->skill_lv), group->bl_flag, bl, tick);
group->limit = DIFF_TICK(tick,group->tick)+1000;
unit->limit = DIFF_TICK(tick,group->tick)+1000;
@@ -15711,7 +15711,7 @@ int skill_unit_move_unit_group (struct skill_unit_group *group, int16 m, int16 d
if (!(m_flag[i]&0x2)) { //We only moved the cell in 0-1
if (group->state.song_dance&0x1) //Check for dissonance effect.
skill->dance_overlap(unit1, 1);
- clif_skill_setunit(unit1);
+ clif->skill_setunit(unit1);
map_foreachincell(skill->unit_effect,unit1->bl.m,unit1->bl.x,unit1->bl.y,group->bl_flag,&unit1->bl,tick,1);
}
}
@@ -15846,7 +15846,7 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
for( i = 0; i < MAX_INVENTORY; i++ ) {
if( sd->status.inventory[i].nameid == nameid ) {
if( sd->status.inventory[i].amount >= data->stack.amount ) {
- clif_msgtable(sd->fd,0x61b);
+ clif->msgtable(sd->fd,0x61b);
return 0;
} else {
/**
@@ -16195,8 +16195,8 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
//TODO update PICKLOG
if(equip){
- clif_produceeffect(sd,0,nameid);
- clif_misceffect(&sd->bl,3);
+ clif->produce_effect(sd,0,nameid);
+ clif->misceffect(&sd->bl,3);
if(itemdb_wlv(nameid) >= 3 && ((ele? 1 : 0) + sc) >= 3) // Fame point system [DracoRPG]
pc_addfame(sd,10); // Success to forge a lv3 weapon with 3 additional ingredients = +10 fame point
} else {
@@ -16246,24 +16246,24 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
case AM_TWILIGHT2:
case AM_TWILIGHT3:
case ASC_CDP:
- clif_produceeffect(sd,2,nameid);
- clif_misceffect(&sd->bl,5);
+ clif->produce_effect(sd,2,nameid);
+ clif->misceffect(&sd->bl,5);
break;
case BS_IRON:
case BS_STEEL:
case BS_ENCHANTEDSTONE:
- clif_produceeffect(sd,0,nameid);
- clif_misceffect(&sd->bl,3);
+ clif->produce_effect(sd,0,nameid);
+ clif->misceffect(&sd->bl,3);
break;
case RK_RUNEMASTERY:
case GC_CREATENEWPOISON:
- clif_produceeffect(sd,2,nameid);
- clif_misceffect(&sd->bl,5);
+ clif->produce_effect(sd,2,nameid);
+ clif->misceffect(&sd->bl,5);
break;
default: //Those that don't require a skill?
if( skill_produce_db[idx].itemlv > 10 && skill_produce_db[idx].itemlv <= 20)
{ //Cooking items.
- clif_specialeffect(&sd->bl, 608, AREA);
+ clif->specialeffect(&sd->bl, 608, AREA);
if( sd->cook_mastery < 1999 )
pc_setglobalreg(sd, "COOK_MASTERY",sd->cook_mastery + ( 1 << ( (skill_produce_db[idx].itemlv - 11) / 2 ) ) * 5);
}
@@ -16278,7 +16278,7 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
if( rnd()%1000 < skill_changematerial_db[i].qty_rate[j] ){
tmp_item.amount = qty * skill_changematerial_db[i].qty[j];
if((flag = pc_additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE))) {
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
map_addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
k++;
@@ -16287,16 +16287,16 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
break;
}
if( k ){
- clif_msg_skill(sd,skill_id,0x627);
+ clif->msg_skill(sd,skill_id,0x627);
return 1;
}
} else if (tmp_item.amount) { //Success
if((flag = pc_additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE))) {
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
map_addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
if( skill_id == GN_MIX_COOKING || skill_id == GN_MAKEBOMB || skill_id == GN_S_PHARMACY )
- clif_msg_skill(sd,skill_id,0x627);
+ clif->msg_skill(sd,skill_id,0x627);
return 1;
}
}
@@ -16306,8 +16306,8 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
//TODO update PICKLOG
if(equip){
- clif_produceeffect(sd,1,nameid);
- clif_misceffect(&sd->bl,2);
+ clif->produce_effect(sd,1,nameid);
+ clif->misceffect(&sd->bl,2);
} else {
switch (skill_id) {
case ASC_CDP: //25% Damage yourself, and display same effect as failed potion.
@@ -16316,20 +16316,20 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
case AM_TWILIGHT1:
case AM_TWILIGHT2:
case AM_TWILIGHT3:
- clif_produceeffect(sd,3,nameid);
- clif_misceffect(&sd->bl,6);
+ clif->produce_effect(sd,3,nameid);
+ clif->misceffect(&sd->bl,6);
sd->potion_success_counter = 0; // Fame point system [DracoRPG]
break;
case BS_IRON:
case BS_STEEL:
case BS_ENCHANTEDSTONE:
- clif_produceeffect(sd,1,nameid);
- clif_misceffect(&sd->bl,2);
+ clif->produce_effect(sd,1,nameid);
+ clif->misceffect(&sd->bl,2);
break;
case RK_RUNEMASTERY:
case GC_CREATENEWPOISON:
- clif_produceeffect(sd,3,nameid);
- clif_misceffect(&sd->bl,6);
+ clif->produce_effect(sd,3,nameid);
+ clif->misceffect(&sd->bl,6);
break;
case GN_MIX_COOKING: {
struct item tmp_item;
@@ -16344,21 +16344,21 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid,
tmp_item.amount = qty;
tmp_item.identify = 1;
if( pc_additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE) ) {
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
map_addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
- clif_msg_skill(sd,skill_id,0x628);
+ clif->msg_skill(sd,skill_id,0x628);
}
break;
case GN_MAKEBOMB:
case GN_S_PHARMACY:
case GN_CHANGEMATERIAL:
- clif_msg_skill(sd,skill_id,0x628);
+ clif->msg_skill(sd,skill_id,0x628);
break;
default:
if( skill_produce_db[idx].itemlv > 10 && skill_produce_db[idx].itemlv <= 20 )
{ //Cooking items.
- clif_specialeffect(&sd->bl, 609, AREA);
+ clif->specialeffect(&sd->bl, 609, AREA);
if( sd->cook_mastery > 0 )
pc_setglobalreg(sd, "COOK_MASTERY", sd->cook_mastery - ( 1 << ((skill_produce_db[idx].itemlv - 11) / 2) ) - ( ( ( 1 << ((skill_produce_db[idx].itemlv - 11) / 2) ) >> 1 ) * 3 ));
}
@@ -16401,7 +16401,7 @@ int skill_arrow_create (struct map_session_data *sd, int nameid)
if(tmp_item.nameid <= 0 || tmp_item.amount <= 0)
continue;
if((flag = pc_additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE))) {
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
map_addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
@@ -16413,7 +16413,7 @@ int skill_poisoningweapon( struct map_session_data *sd, int nameid) {
int chance, i;
nullpo_ret(sd);
if( nameid <= 0 || (i = pc_search_inventory(sd,nameid)) < 0 || pc_delitem(sd,i,1,0,0,LOG_TYPE_CONSUME) ) {
- clif_skill_fail(sd,GC_POISONINGWEAPON,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,GC_POISONINGWEAPON,USESKILL_FAIL_LEVEL,0);
return 0;
}
switch( nameid )
@@ -16427,7 +16427,7 @@ int skill_poisoningweapon( struct map_session_data *sd, int nameid) {
case PO_MAGICMUSHROOM: type = SC_MAGICMUSHROOM; break;
case PO_OBLIVIONCURSE: type = SC_OBLIVIONCURSE; break;
default:
- clif_skill_fail(sd,GC_POISONINGWEAPON,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,GC_POISONINGWEAPON,USESKILL_FAIL_LEVEL,0);
return 0;
}
@@ -16453,8 +16453,8 @@ void skill_toggle_magicpower(struct block_list *bl, uint16 skill_id) {
status_calc_bl(bl, status_sc2scb_flag(SC_MAGICPOWER));
#ifndef RENEWAL
if(bl->type == BL_PC){// update current display.
- clif_updatestatus(((TBL_PC *)bl),SP_MATK1);
- clif_updatestatus(((TBL_PC *)bl),SP_MATK2);
+ clif->updatestatus(((TBL_PC *)bl),SP_MATK1);
+ clif->updatestatus(((TBL_PC *)bl),SP_MATK2);
}
#endif
}
@@ -16470,7 +16470,7 @@ int skill_magicdecoy(struct map_session_data *sd, int nameid) {
if( nameid <= 0 || !itemdb_is_element(nameid) || (i = pc_search_inventory(sd,nameid)) < 0 || !skill_id || pc_delitem(sd,i,1,0,0,LOG_TYPE_CONSUME) )
{
- clif_skill_fail(sd,NC_MAGICDECOY,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,NC_MAGICDECOY,USESKILL_FAIL_LEVEL,0);
return 0;
}
@@ -16511,7 +16511,7 @@ int skill_spellbook (struct map_session_data *sd, int nameid) {
for(i=SC_SPELLBOOK1; i <= SC_MAXSPELLBOOK; i++) if( sc && !sc->data[i] ) break;
if( i > SC_MAXSPELLBOOK )
{
- clif_skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_READING, 0);
+ clif->skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_READING, 0);
return 0;
}
@@ -16521,7 +16521,7 @@ int skill_spellbook (struct map_session_data *sd, int nameid) {
if( !pc_checkskill(sd, (skill_id = skill_spellbook_db[i].skill_id)) )
{ // User don't know the skill
sc_start(&sd->bl, SC_SLEEP, 100, 1, skill->get_time(WL_READING_SB, pc_checkskill(sd,WL_READING_SB)));
- clif_skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_DIFFICULT_SLEEP, 0);
+ clif->skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_DIFFICULT_SLEEP, 0);
return 0;
}
@@ -16530,7 +16530,7 @@ int skill_spellbook (struct map_session_data *sd, int nameid) {
if( sc && sc->data[SC_READING_SB] ) {
if( (sc->data[SC_READING_SB]->val2 + point) > max_preserve ) {
- clif_skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_PRESERVATION_POINT, 0);
+ clif->skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_PRESERVATION_POINT, 0);
return 0;
}
for(i = SC_MAXSPELLBOOK; i >= SC_SPELLBOOK1; i--){ // This is how official saves spellbook. [malufett]
@@ -16558,7 +16558,7 @@ int skill_select_menu(struct map_session_data *sd,uint16 skill_id) {
if( skill_id >= GS_GLITTERING || skill->get_type(skill_id) != BF_MAGIC ||
(id = sd->status.skill[skill_id].id) == 0 || sd->status.skill[skill_id].flag != SKILL_FLAG_PLAGIARIZED ) {
- clif_skill_fail(sd,SC_AUTOSHADOWSPELL,0,0);
+ clif->skill_fail(sd,SC_AUTOSHADOWSPELL,0,0);
return 0;
}
@@ -16589,7 +16589,7 @@ int skill_elementalanalysis(struct map_session_data* sd, int n, uint16 skill_lv,
add_amount = (skill_lv == 1) ? del_amount * (5 + rnd()%5) : del_amount / 10 ;
if( (nameid = sd->status.inventory[idx].nameid) <= 0 || del_amount > sd->status.inventory[idx].amount ) {
- clif_skill_fail(sd,SO_EL_ANALYSIS,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,SO_EL_ANALYSIS,USESKILL_FAIL_LEVEL,0);
return 1;
}
@@ -16605,17 +16605,17 @@ int skill_elementalanalysis(struct map_session_data* sd, int n, uint16 skill_lv,
case 992: product = 996; break; // Wind of Verdure -> Rough Wind.
case 993: product = 997; break; // Green Live -> Great Nature.
default:
- clif_skill_fail(sd,SO_EL_ANALYSIS,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,SO_EL_ANALYSIS,USESKILL_FAIL_LEVEL,0);
return 1;
}
if( pc_delitem(sd,idx,del_amount,0,1,LOG_TYPE_CONSUME) ) {
- clif_skill_fail(sd,SO_EL_ANALYSIS,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,SO_EL_ANALYSIS,USESKILL_FAIL_LEVEL,0);
return 1;
}
if( skill_lv == 2 && rnd()%100 < 25 ) { // At level 2 have a fail chance. You loose your items if it fails.
- clif_skill_fail(sd,SO_EL_ANALYSIS,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,SO_EL_ANALYSIS,USESKILL_FAIL_LEVEL,0);
return 1;
}
@@ -16627,7 +16627,7 @@ int skill_elementalanalysis(struct map_session_data* sd, int n, uint16 skill_lv,
if( tmp_item.amount ) {
if( (flag = pc_additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_CONSUME)) ) {
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
map_addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
@@ -16657,7 +16657,7 @@ int skill_changematerial(struct map_session_data *sd, int n, unsigned short *ite
nameid = sd->status.inventory[idx].nameid;
amount = item_list[k*2+1];
if( nameid > 0 && sd->status.inventory[idx].identify == 0 ){
- clif_msg_skill(sd,GN_CHANGEMATERIAL,0x62D);
+ clif->msg_skill(sd,GN_CHANGEMATERIAL,0x62D);
return 0;
}
if( nameid == skill_produce_db[i].mat_id[j] && (amount-p*skill_produce_db[i].mat_amount[j]) >= skill_produce_db[i].mat_amount[j]
@@ -16679,7 +16679,7 @@ int skill_changematerial(struct map_session_data *sd, int n, unsigned short *ite
}
if( p == 0)
- clif_msg_skill(sd,GN_CHANGEMATERIAL,0x623);
+ clif->msg_skill(sd,GN_CHANGEMATERIAL,0x623);
return 0;
}
@@ -16776,7 +16776,7 @@ int skill_blockpc_start_(struct map_session_data *sd, uint16 skill_id, int tick,
}
if( battle_config.display_status_timers )
- clif_skill_cooldown(sd, idx, tick);
+ clif->skill_cooldown(sd, idx, tick);
if( !load ) {// not being loaded initially so ensure the skill delay is recorded
if( !(cd = idb_get(skillcd_db,sd->status.char_id)) ) {// create a new skill cooldown object for map storage
@@ -17745,7 +17745,7 @@ void skill_reload (void) {
/* lets update all players skill tree : so that if any skill modes were changed they're properly updated */
iter = mapit_getallusers();
for( sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) )
- clif_skillinfoblock(sd);
+ clif->skillinfoblock(sd);
mapit_free(iter);
}
diff --git a/src/map/status.c b/src/map/status.c
index f356e4aa5..809fac4c5 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -82,7 +82,7 @@ static sc_type SkillStatusChangeTable[MAX_SKILL]; // skill -> status
static int StatusIconChangeTable[SC_MAX]; // status -> "icon" (icon is a bit of a misnomer, since there exist values with no icon associated)
static unsigned int StatusChangeFlagTable[SC_MAX]; // status -> flags
static int StatusSkillChangeTable[SC_MAX]; // status -> skill
-static int StatusRelevantBLTypes[SI_MAX]; // "icon" -> enum bl_type (for clif_status_change to identify for which bl types to send packets)
+static int StatusRelevantBLTypes[SI_MAX]; // "icon" -> enum bl_type (for clif->status_change to identify for which bl types to send packets)
/**
@@ -1244,7 +1244,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
else
status_revive(target, sc->data[SC_KAIZEL]->val2, 0);
status_change_clear(target,0);
- clif_skill_nodamage(target,target,ALL_RESURRECTION,1,1);
+ clif->skill_nodamage(target,target,ALL_RESURRECTION,1,1);
sc_start(target,status_skill2sc(PR_KYRIE),100,10,time);
if( target->type == BL_MOB )
@@ -1256,8 +1256,8 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
TBL_PC *sd = BL_CAST(BL_PC,target);
TBL_HOM *hd = sd->hd;
if(hd && hd->sc.data[SC_LIGHT_OF_REGENE]){
- clif_skillcasting(&hd->bl, hd->bl.id, target->id, 0,0, MH_LIGHT_OF_REGENE, skill->get_ele(MH_LIGHT_OF_REGENE, 1), 10); //just to display usage
- clif_skill_nodamage(&sd->bl, target, ALL_RESURRECTION, 1, status_revive(&sd->bl,10*hd->sc.data[SC_LIGHT_OF_REGENE]->val1,0));
+ clif->skillcasting(&hd->bl, hd->bl.id, target->id, 0,0, MH_LIGHT_OF_REGENE, skill->get_ele(MH_LIGHT_OF_REGENE, 1), 10); //just to display usage
+ clif->skill_nodamage(&sd->bl, target, ALL_RESURRECTION, 1, status_revive(&sd->bl,10*hd->sc.data[SC_LIGHT_OF_REGENE]->val1,0));
status_change_end(&sd->hd->bl,SC_LIGHT_OF_REGENE,INVALID_TIMER);
return hp + sp;
}
@@ -1282,7 +1282,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
unit_stop_attack(target);
unit_stop_walking(target,1);
unit_skillcastcancel(target,0);
- clif_clearunit_area(target,CLR_DEAD);
+ clif->clearunit_area(target,CLR_DEAD);
skill->unit_move(target,gettick(),4);
skill->cleartimerskill(target);
}
@@ -1452,7 +1452,7 @@ int status_revive(struct block_list *bl, unsigned char per_hp, unsigned char per
status->sp += sp;
if (bl->prev) //Animation only if character is already on a map.
- clif_resurrection(bl, 1);
+ clif->resurrection(bl, 1);
switch (bl->type) {
case BL_PC: pc_revive((TBL_PC*)bl, hp, sp); break;
case BL_MOB: mob_revive((TBL_MOB*)bl, hp); break;
@@ -1540,7 +1540,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin
if (sc->data[SC_WINKCHARM] && target && !flag) { //Prevents skill usage
if( unit_bl2ud(src) && (unit_bl2ud(src))->walktimer == INVALID_TIMER )
unit_walktobl(src, map_id2bl(sc->data[SC_WINKCHARM]->val2), 3, 1);
- clif_emotion(src, E_LV);
+ clif->emotion(src, E_LV);
return 0;
}
@@ -2117,7 +2117,7 @@ int status_calc_pet_(struct pet_data *pd, bool first)
struct status_data *bstat = &pd->db->status, *status = &pd->status;
pd->pet.level = lv;
if (!first) //Lv Up animation
- clif_misceffect(&pd->bl, 0);
+ clif->misceffect(&pd->bl, 0);
status->rhw.atk = (bstat->rhw.atk*lv)/pd->db->lv;
status->rhw.atk2 = (bstat->rhw.atk2*lv)/pd->db->lv;
status->str = (bstat->str*lv)/pd->db->lv;
@@ -2139,7 +2139,7 @@ int status_calc_pet_(struct pet_data *pd, bool first)
status_calc_misc(&pd->bl, &pd->status, lv);
if (!first) //Not done the first time because the pet is not visible yet
- clif_send_petstatus(sd);
+ clif->send_petstatus(sd);
}
} else if (first) {
status_calc_misc(&pd->bl, &pd->status, pd->db->lv);
@@ -2314,7 +2314,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
memset (&sd->left_weapon.overrefine, 0, sizeof(sd->left_weapon) - sizeof(sd->left_weapon.atkmods));
if (sd->special_state.intravision && !sd->sc.data[SC_INTRAVISION]) //Clear intravision as long as nothing else is using it
- clif_status_load(&sd->bl, SI_INTRAVISION, 0);
+ clif->status_change(&sd->bl, SI_INTRAVISION, 0, 0, 0, 0, 0);
memset(&sd->special_state,0,sizeof(sd->special_state));
memset(&status->max_hp, 0, sizeof(struct status_data)-(sizeof(status->hp)+sizeof(status->sp)));
@@ -3032,15 +3032,15 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
return 0;
}
if(memcmp(b_skill,sd->status.skill,sizeof(sd->status.skill)))
- clif_skillinfoblock(sd);
+ clif->skillinfoblock(sd);
if(b_weight != sd->weight)
- clif_updatestatus(sd,SP_WEIGHT);
+ clif->updatestatus(sd,SP_WEIGHT);
if(b_max_weight != sd->max_weight) {
- clif_updatestatus(sd,SP_MAXWEIGHT);
+ clif->updatestatus(sd,SP_MAXWEIGHT);
pc_updateweightstatus(sd);
}
if( b_cart_weight_max != sd->cart_weight_max ) {
- clif_updatestatus(sd,SP_CARTINFO);
+ clif->updatestatus(sd,SP_CARTINFO);
}
calculating = 0;
@@ -3718,7 +3718,7 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
if( status->hp > status->max_hp ) //FIXME: Should perhaps a status_zap should be issued?
{
status->hp = status->max_hp;
- if( sd ) clif_updatestatus(sd,SP_HP);
+ if( sd ) clif->updatestatus(sd,SP_HP);
}
}
@@ -3741,7 +3741,7 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
if( status->sp > status->max_sp )
{
status->sp = status->max_sp;
- if( sd ) clif_updatestatus(sd,SP_SP);
+ if( sd ) clif->updatestatus(sd,SP_SP);
}
}
@@ -3924,37 +3924,37 @@ void status_calc_bl_(struct block_list* bl, enum scb_flag flag, bool first)
{
TBL_PC* sd = BL_CAST(BL_PC, bl);
if(b_status.str != status->str)
- clif_updatestatus(sd,SP_STR);
+ clif->updatestatus(sd,SP_STR);
if(b_status.agi != status->agi)
- clif_updatestatus(sd,SP_AGI);
+ clif->updatestatus(sd,SP_AGI);
if(b_status.vit != status->vit)
- clif_updatestatus(sd,SP_VIT);
+ clif->updatestatus(sd,SP_VIT);
if(b_status.int_ != status->int_)
- clif_updatestatus(sd,SP_INT);
+ clif->updatestatus(sd,SP_INT);
if(b_status.dex != status->dex)
- clif_updatestatus(sd,SP_DEX);
+ clif->updatestatus(sd,SP_DEX);
if(b_status.luk != status->luk)
- clif_updatestatus(sd,SP_LUK);
+ clif->updatestatus(sd,SP_LUK);
if(b_status.hit != status->hit)
- clif_updatestatus(sd,SP_HIT);
+ clif->updatestatus(sd,SP_HIT);
if(b_status.flee != status->flee)
- clif_updatestatus(sd,SP_FLEE1);
+ clif->updatestatus(sd,SP_FLEE1);
if(b_status.amotion != status->amotion)
- clif_updatestatus(sd,SP_ASPD);
+ clif->updatestatus(sd,SP_ASPD);
if(b_status.speed != status->speed)
- clif_updatestatus(sd,SP_SPEED);
+ clif->updatestatus(sd,SP_SPEED);
if(b_status.batk != status->batk
#ifndef RENEWAL
|| b_status.rhw.atk != status->rhw.atk || b_status.lhw.atk != status->lhw.atk
#endif
)
- clif_updatestatus(sd,SP_ATK1);
+ clif->updatestatus(sd,SP_ATK1);
if(b_status.def != status->def){
- clif_updatestatus(sd,SP_DEF1);
+ clif->updatestatus(sd,SP_DEF1);
#ifdef RENEWAL
- clif_updatestatus(sd,SP_DEF2);
+ clif->updatestatus(sd,SP_DEF2);
#endif
}
@@ -3963,91 +3963,91 @@ void status_calc_bl_(struct block_list* bl, enum scb_flag flag, bool first)
|| b_status.rhw.atk != status->rhw.atk || b_status.lhw.atk != status->lhw.atk
#endif
)
- clif_updatestatus(sd,SP_ATK2);
+ clif->updatestatus(sd,SP_ATK2);
if(b_status.def2 != status->def2){
- clif_updatestatus(sd,SP_DEF2);
+ clif->updatestatus(sd,SP_DEF2);
#ifdef RENEWAL
- clif_updatestatus(sd,SP_DEF1);
+ clif->updatestatus(sd,SP_DEF1);
#endif
}
if(b_status.flee2 != status->flee2)
- clif_updatestatus(sd,SP_FLEE2);
+ clif->updatestatus(sd,SP_FLEE2);
if(b_status.cri != status->cri)
- clif_updatestatus(sd,SP_CRITICAL);
+ clif->updatestatus(sd,SP_CRITICAL);
#ifndef RENEWAL
if(b_status.matk_max != status->matk_max)
- clif_updatestatus(sd,SP_MATK1);
+ clif->updatestatus(sd,SP_MATK1);
if(b_status.matk_min != status->matk_min)
- clif_updatestatus(sd,SP_MATK2);
+ clif->updatestatus(sd,SP_MATK2);
#else
if(b_status.matk_max != status->matk_max || b_status.matk_min != status->matk_min){
- clif_updatestatus(sd,SP_MATK2);
- clif_updatestatus(sd,SP_MATK1);
+ clif->updatestatus(sd,SP_MATK2);
+ clif->updatestatus(sd,SP_MATK1);
}
#endif
if(b_status.mdef != status->mdef){
- clif_updatestatus(sd,SP_MDEF1);
+ clif->updatestatus(sd,SP_MDEF1);
#ifdef RENEWAL
- clif_updatestatus(sd,SP_MDEF2);
+ clif->updatestatus(sd,SP_MDEF2);
#endif
}
if(b_status.mdef2 != status->mdef2){
- clif_updatestatus(sd,SP_MDEF2);
+ clif->updatestatus(sd,SP_MDEF2);
#ifdef RENEWAL
- clif_updatestatus(sd,SP_MDEF1);
+ clif->updatestatus(sd,SP_MDEF1);
#endif
}
if(b_status.rhw.range != status->rhw.range)
- clif_updatestatus(sd,SP_ATTACKRANGE);
+ clif->updatestatus(sd,SP_ATTACKRANGE);
if(b_status.max_hp != status->max_hp)
- clif_updatestatus(sd,SP_MAXHP);
+ clif->updatestatus(sd,SP_MAXHP);
if(b_status.max_sp != status->max_sp)
- clif_updatestatus(sd,SP_MAXSP);
+ clif->updatestatus(sd,SP_MAXSP);
if(b_status.hp != status->hp)
- clif_updatestatus(sd,SP_HP);
+ clif->updatestatus(sd,SP_HP);
if(b_status.sp != status->sp)
- clif_updatestatus(sd,SP_SP);
+ clif->updatestatus(sd,SP_SP);
} else if( bl->type == BL_HOM ) {
TBL_HOM* hd = BL_CAST(BL_HOM, bl);
if( hd->master && memcmp(&b_status, status, sizeof(struct status_data)) != 0 )
- clif_hominfo(hd->master,hd,0);
+ clif->hominfo(hd->master,hd,0);
} else if( bl->type == BL_MER ) {
TBL_MER* md = BL_CAST(BL_MER, bl);
if( b_status.rhw.atk != status->rhw.atk || b_status.rhw.atk2 != status->rhw.atk2 )
- clif_mercenary_updatestatus(md->master, SP_ATK1);
+ clif->mercenary_updatestatus(md->master, SP_ATK1);
if( b_status.matk_max != status->matk_max )
- clif_mercenary_updatestatus(md->master, SP_MATK1);
+ clif->mercenary_updatestatus(md->master, SP_MATK1);
if( b_status.hit != status->hit )
- clif_mercenary_updatestatus(md->master, SP_HIT);
+ clif->mercenary_updatestatus(md->master, SP_HIT);
if( b_status.cri != status->cri )
- clif_mercenary_updatestatus(md->master, SP_CRITICAL);
+ clif->mercenary_updatestatus(md->master, SP_CRITICAL);
if( b_status.def != status->def )
- clif_mercenary_updatestatus(md->master, SP_DEF1);
+ clif->mercenary_updatestatus(md->master, SP_DEF1);
if( b_status.mdef != status->mdef )
- clif_mercenary_updatestatus(md->master, SP_MDEF1);
+ clif->mercenary_updatestatus(md->master, SP_MDEF1);
if( b_status.flee != status->flee )
- clif_mercenary_updatestatus(md->master, SP_MERCFLEE);
+ clif->mercenary_updatestatus(md->master, SP_MERCFLEE);
if( b_status.amotion != status->amotion )
- clif_mercenary_updatestatus(md->master, SP_ASPD);
+ clif->mercenary_updatestatus(md->master, SP_ASPD);
if( b_status.max_hp != status->max_hp )
- clif_mercenary_updatestatus(md->master, SP_MAXHP);
+ clif->mercenary_updatestatus(md->master, SP_MAXHP);
if( b_status.max_sp != status->max_sp )
- clif_mercenary_updatestatus(md->master, SP_MAXSP);
+ clif->mercenary_updatestatus(md->master, SP_MAXSP);
if( b_status.hp != status->hp )
- clif_mercenary_updatestatus(md->master, SP_HP);
+ clif->mercenary_updatestatus(md->master, SP_HP);
if( b_status.sp != status->sp )
- clif_mercenary_updatestatus(md->master, SP_SP);
+ clif->mercenary_updatestatus(md->master, SP_SP);
} else if( bl->type == BL_ELEM ) {
TBL_ELEM* ed = BL_CAST(BL_ELEM, bl);
if( b_status.max_hp != status->max_hp )
- clif_elemental_updatestatus(ed->master, SP_MAXHP);
+ clif->elemental_updatestatus(ed->master, SP_MAXHP);
if( b_status.max_sp != status->max_sp )
- clif_elemental_updatestatus(ed->master, SP_MAXSP);
+ clif->elemental_updatestatus(ed->master, SP_MAXSP);
if( b_status.hp != status->hp )
- clif_elemental_updatestatus(ed->master, SP_HP);
+ clif->elemental_updatestatus(ed->master, SP_HP);
if( b_status.sp != status->sp )
- clif_mercenary_updatestatus(ed->master, SP_SP);
+ clif->mercenary_updatestatus(ed->master, SP_SP);
}
}
@@ -5950,7 +5950,7 @@ void status_set_viewdata(struct block_list *bl, int class_)
}
}
sd->vd.class_ = class_;
- clif_get_weapon_view(sd, &sd->vd.weapon, &sd->vd.shield);
+ clif->get_weapon_view(sd, &sd->vd.weapon, &sd->vd.shield);
sd->vd.head_top = sd->status.head_top;
sd->vd.head_mid = sd->status.head_mid;
sd->vd.head_bottom = sd->status.head_bottom;
@@ -7101,7 +7101,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_SIGNUMCRUCIS:
val2 = 10 + 4*val1; //Def reduction
tick = -1;
- clif_emotion(bl,E_SWT);
+ clif->emotion(bl,E_SWT);
break;
case SC_MAXIMIZEPOWER:
tick_time = val2 = tick>0?tick:60000;
@@ -7254,7 +7254,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
//val3 : Brings the skill_lv (merged into val1 here)
//val4 : Partner
if (val1 == CG_MOONLIT)
- clif_status_change(bl,SI_MOONLIT,1,tick,0, 0, 0);
+ clif->status_change(bl,SI_MOONLIT,1,tick,0, 0, 0);
val1|= (val3<<16);
val3 = tick/1000; //Tick duration
tick_time = 1000; // [GodLesZ] tick time
@@ -7283,10 +7283,10 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
val3 = vd->shield;
val4 = vd->cloth_color;
unit_stop_attack(bl);
- clif_changelook(bl,LOOK_WEAPON,0);
- clif_changelook(bl,LOOK_SHIELD,0);
- clif_changelook(bl,LOOK_BASE,type==SC_WEDDING?JOB_WEDDING:type==SC_XMAS?JOB_XMAS:JOB_SUMMER);
- clif_changelook(bl,LOOK_CLOTHES_COLOR,vd->cloth_color);
+ clif->changelook(bl,LOOK_WEAPON,0);
+ clif->changelook(bl,LOOK_SHIELD,0);
+ clif->changelook(bl,LOOK_BASE,type==SC_WEDDING?JOB_WEDDING:type==SC_XMAS?JOB_XMAS:JOB_SUMMER);
+ clif->changelook(bl,LOOK_CLOTHES_COLOR,vd->cloth_color);
break;
case SC_NOCHAT:
// [GodLesZ] FIXME: is this correct? a hardcoded interval of 60sec? what about configuration ?_?
@@ -7294,8 +7294,8 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
val1 = battle_config.manner_system; //Mute filters.
if (sd)
{
- clif_changestatus(sd,SP_MANNER,sd->status.manner);
- clif_updatestatus(sd,SP_MANNER);
+ clif->changestatus(sd,SP_MANNER,sd->status.manner);
+ clif->updatestatus(sd,SP_MANNER);
}
break;
@@ -7333,7 +7333,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
break;
case SC_CONFUSION:
- clif_emotion(bl,E_WHAT);
+ clif->emotion(bl,E_WHAT);
break;
case SC_BLEEDING:
val4 = tick/10000;
@@ -7357,7 +7357,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
struct mob_data *boss_md = map_getmob_boss(bl->m); // Search for Boss on this Map
if( boss_md == NULL || boss_md->bl.prev == NULL )
{ // No MVP on this map - MVP is dead
- clif_bossmapinfo(sd->fd, boss_md, 1);
+ clif->bossmapinfo(sd->fd, boss_md, 1);
return 0; // No need to start SC
}
val1 = boss_md->bl.id;
@@ -7468,7 +7468,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_TENSIONRELAX:
if (sd) {
pc_setsit(sd);
- clif_sitting(&sd->bl);
+ clif->sitting(&sd->bl);
}
val2 = 12; //SP cost
val4 = 10000; //Decrease at 10secs intervals.
@@ -8203,7 +8203,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
{
pc_setsit(sd);
skill->sit(sd,1);
- clif_sitting(bl);
+ clif->sitting(bl);
}
break;
case SC_DANCEWITHWUG:
@@ -8416,7 +8416,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
break;
case SC_KYOUGAKU:
val2 = 2*val1 + rand()%val1;
- clif_status_change(bl,SI_ACTIVE_MONSTER_TRANSFORM,1,0,1002,0,0);
+ clif->status_change(bl,SI_ACTIVE_MONSTER_TRANSFORM,1,0,1002,0,0);
break;
case SC_KAGEMUSYA:
val3 = val1 * 2;
@@ -8502,10 +8502,10 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_WEDDING:
case SC_XMAS:
case SC_SUMMER:
- clif_changelook(bl,LOOK_WEAPON,0);
- clif_changelook(bl,LOOK_SHIELD,0);
- clif_changelook(bl,LOOK_BASE,type==SC_WEDDING?JOB_WEDDING:type==SC_XMAS?JOB_XMAS:JOB_SUMMER);
- clif_changelook(bl,LOOK_CLOTHES_COLOR,val4);
+ clif->changelook(bl,LOOK_WEAPON,0);
+ clif->changelook(bl,LOOK_SHIELD,0);
+ clif->changelook(bl,LOOK_BASE,type==SC_WEDDING?JOB_WEDDING:type==SC_XMAS?JOB_XMAS:JOB_SUMMER);
+ clif->changelook(bl,LOOK_CLOTHES_COLOR,val4);
break;
case SC_KAAHI:
val4 = INVALID_TIMER;
@@ -8724,19 +8724,19 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
//On Aegis, when turning on a status change, first goes the option packet, then the sc packet.
if(opt_flag)
- clif_changeoption(bl);
+ clif->changeoption(bl);
if (calc_flag&SCB_DYE)
{ //Reset DYE color
if (vd && vd->cloth_color)
{
val4 = vd->cloth_color;
- clif_changelook(bl,LOOK_CLOTHES_COLOR,0);
+ clif->changelook(bl,LOOK_CLOTHES_COLOR,0);
}
calc_flag&=~SCB_DYE;
}
- clif_status_change(bl,StatusIconChangeTable[type],1,tick,(val_flag&1)?val1:1,(val_flag&2)?val2:0,(val_flag&4)?val3:0);
+ clif->status_change(bl,StatusIconChangeTable[type],1,tick,(val_flag&1)?val1:1,(val_flag&2)?val2:0,(val_flag&4)?val3:0);
/**
* used as temporary storage for scs with interval ticks, so that the actual duration is sent to the client first.
@@ -8787,7 +8787,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
}
break;
case SC_BOSSMAPINFO:
- clif_bossmapinfo(sd->fd, map_id2boss(sce->val1), 0); // First Message
+ clif->bossmapinfo(sd->fd, map_id2boss(sce->val1), 0); // First Message
break;
case SC_MERC_HPUP:
status_percent_heal(bl, 100, 0); // Recover Full HP
@@ -8808,35 +8808,35 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
case SC_COMBO:
switch (sce->val1) {
case TK_STORMKICK:
- clif_skill_nodamage(bl,bl,TK_READYSTORM,1,1);
+ clif->skill_nodamage(bl,bl,TK_READYSTORM,1,1);
break;
case TK_DOWNKICK:
- clif_skill_nodamage(bl,bl,TK_READYDOWN,1,1);
+ clif->skill_nodamage(bl,bl,TK_READYDOWN,1,1);
break;
case TK_TURNKICK:
- clif_skill_nodamage(bl,bl,TK_READYTURN,1,1);
+ clif->skill_nodamage(bl,bl,TK_READYTURN,1,1);
break;
case TK_COUNTER:
- clif_skill_nodamage(bl,bl,TK_READYCOUNTER,1,1);
+ clif->skill_nodamage(bl,bl,TK_READYCOUNTER,1,1);
break;
case MO_COMBOFINISH:
case CH_TIGERFIST:
case CH_CHAINCRUSH:
if (sd)
- clif_skillinfo(sd,MO_EXTREMITYFIST, INF_SELF_SKILL);
+ clif->skillinfo(sd,MO_EXTREMITYFIST, INF_SELF_SKILL);
break;
case TK_JUMPKICK:
if (sd)
- clif_skillinfo(sd,TK_JUMPKICK, INF_SELF_SKILL);
+ clif->skillinfo(sd,TK_JUMPKICK, INF_SELF_SKILL);
break;
case MO_TRIPLEATTACK:
if (sd && pc_checkskill(sd, SR_DRAGONCOMBO) > 0)
- clif_skillinfo(sd,SR_DRAGONCOMBO, INF_SELF_SKILL);
+ clif->skillinfo(sd,SR_DRAGONCOMBO, INF_SELF_SKILL);
break;
case SR_FALLENEMPIRE:
if (sd){
- clif_skillinfo(sd,SR_GATEOFHELL, INF_SELF_SKILL);
- clif_skillinfo(sd,SR_TIGERCANNON, INF_SELF_SKILL);
+ clif->skillinfo(sd,SR_GATEOFHELL, INF_SELF_SKILL);
+ clif->skillinfo(sd,SR_TIGERCANNON, INF_SELF_SKILL);
}
break;
}
@@ -8954,7 +8954,7 @@ int status_change_clear(struct block_list* bl, int type) {
sc->option &= OPTION_MASK;
if( type == 0 || type == 2 )
- clif_changeoption(bl);
+ clif->changeoption(bl);
return 1;
}
@@ -9037,7 +9037,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
{ //Load data from sd->status.* as the stored values could have changed.
//Must remove OPTION to prevent class being rechanged.
sc->option &= type==SC_WEDDING?~OPTION_WEDDING:type==SC_XMAS?~OPTION_XMAS:~OPTION_SUMMER;
- clif_changeoption(&sd->bl);
+ clif->changeoption(&sd->bl);
status_set_viewdata(bl, sd->status.class_);
} else {
vd->class_ = sce->val1;
@@ -9045,11 +9045,11 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
vd->shield = sce->val3;
vd->cloth_color = sce->val4;
}
- clif_changelook(bl,LOOK_BASE,vd->class_);
- clif_changelook(bl,LOOK_CLOTHES_COLOR,vd->cloth_color);
- clif_changelook(bl,LOOK_WEAPON,vd->weapon);
- clif_changelook(bl,LOOK_SHIELD,vd->shield);
- if(sd) clif_skillinfoblock(sd);
+ clif->changelook(bl,LOOK_BASE,vd->class_);
+ clif->changelook(bl,LOOK_CLOTHES_COLOR,vd->cloth_color);
+ clif->changelook(bl,LOOK_WEAPON,vd->weapon);
+ clif->changelook(bl,LOOK_SHIELD,vd->shield);
+ if(sd) clif->skillinfoblock(sd);
break;
case SC_RUN:
{
@@ -9106,7 +9106,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
((TBL_PC*)d_bl)->devotion[sce->val2] = 0;
else if( d_bl->type == BL_MER )
((TBL_MER*)d_bl)->devotion_flag = 0;
- clif_devotion(d_bl, NULL);
+ clif->devotion(d_bl, NULL);
}
status_change_end(bl, SC_AUTOGUARD, INVALID_TIMER);
@@ -9128,7 +9128,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
tsc->data[SC_BLADESTOP]->val4 = 0;
status_change_end(tbl, SC_BLADESTOP, INVALID_TIMER);
}
- clif_bladestop(bl, tid, 0);
+ clif->bladestop(bl, tid, 0);
}
break;
case SC_DANCING:
@@ -9185,7 +9185,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
}
if((sce->val1&0xFFFF) == CG_MOONLIT)
- clif_status_change(bl,SI_MOONLIT,0,0,0,0,0);
+ clif->status_change(bl,SI_MOONLIT,0,0,0,0,0);
status_change_end(bl, SC_LONGING, INVALID_TIMER);
}
@@ -9195,8 +9195,8 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
sd->status.manner = 0;
if (sd && tid == INVALID_TIMER)
{
- clif_changestatus(sd,SP_MANNER,sd->status.manner);
- clif_updatestatus(sd,SP_MANNER);
+ clif->changestatus(sd,SP_MANNER,sd->status.manner);
+ clif->updatestatus(sd,SP_MANNER);
}
break;
case SC_SPLASHER:
@@ -9233,18 +9233,18 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
case MO_COMBOFINISH:
case CH_TIGERFIST:
case CH_CHAINCRUSH:
- clif_skillinfo(sd, MO_EXTREMITYFIST, 0);
+ clif->skillinfo(sd, MO_EXTREMITYFIST, 0);
break;
case TK_JUMPKICK:
- clif_skillinfo(sd, TK_JUMPKICK, 0);
+ clif->skillinfo(sd, TK_JUMPKICK, 0);
break;
case MO_TRIPLEATTACK:
if (pc_checkskill(sd, SR_DRAGONCOMBO) > 0)
- clif_skillinfo(sd, SR_DRAGONCOMBO, 0);
+ clif->skillinfo(sd, SR_DRAGONCOMBO, 0);
break;
case SR_FALLENEMPIRE:
- clif_skillinfo(sd, SR_GATEOFHELL, 0);
- clif_skillinfo(sd, SR_TIGERCANNON, 0);
+ clif->skillinfo(sd, SR_GATEOFHELL, 0);
+ clif->skillinfo(sd, SR_TIGERCANNON, 0);
break;
}
break;
@@ -9348,7 +9348,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
* 3rd Stuff
**/
case SC_MILLENNIUMSHIELD:
- clif_millenniumshield(sd,0);
+ clif->millenniumshield(sd,0);
break;
case SC_HALLUCINATIONWALK:
sc_start(bl,SC_HALLUCINATIONWALK_POSTDELAY,100,sce->val1,skill->get_time2(GC_HALLUCINATIONWALK,sce->val1));
@@ -9358,7 +9358,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
struct block_list* src = map_id2bl(sce->val2);
if( tid == -1 || !src)
break; // Terminated by Damage
- status_fix_damage(src,bl,400*sce->val1,clif_damage(bl,bl,gettick(),0,0,400*sce->val1,0,0,0));
+ status_fix_damage(src,bl,400*sce->val1,clif->damage(bl,bl,gettick(),0,0,400*sce->val1,0,0,0));
}
break;
case SC_WUGDASH:
@@ -9384,7 +9384,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
case SC_SITDOWN_FORCE:
if( sd && pc_issit(sd) ) {
pc_setstand(sd);
- clif_standing(bl);
+ clif->standing(bl);
}
break;
case SC_NEUTRALBARRIER_MASTER:
@@ -9426,7 +9426,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
struct status_change *sc = status_get_sc(src);
if( sc && sc->data[SC_CURSEDCIRCLE_ATKER] && --(sc->data[SC_CURSEDCIRCLE_ATKER]->val2) == 0 ){
status_change_end(src, SC_CURSEDCIRCLE_ATKER, INVALID_TIMER);
- clif_bladestop(bl, sce->val2, 0);
+ clif->bladestop(bl, sce->val2, 0);
}
}
break;
@@ -9440,8 +9440,8 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
}
break;
case SC_KYOUGAKU:
- clif_status_load(bl, SI_KYOUGAKU, 0); // Avoid client crash
- clif_status_load(bl, SI_ACTIVE_MONSTER_TRANSFORM, 0);
+ clif->status_change(bl, SI_KYOUGAKU, 0, 0, 0, 0, 0); // Avoid client crash
+ clif->status_change(bl, SI_ACTIVE_MONSTER_TRANSFORM, 0, 0, 0, 0, 0);
break;
case SC_INTRAVISION:
calc_flag = SCB_ALL;/* required for overlapping */
@@ -9610,17 +9610,17 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
if (calc_flag&SCB_DYE)
{ //Restore DYE color
if (vd && !vd->cloth_color && sce->val4)
- clif_changelook(bl,LOOK_CLOTHES_COLOR,sce->val4);
+ clif->changelook(bl,LOOK_CLOTHES_COLOR,sce->val4);
calc_flag&=~SCB_DYE;
}
//On Aegis, when turning off a status change, first goes the sc packet, then the option packet.
- clif_status_change(bl,StatusIconChangeTable[type],0,0,0,0,0);
+ clif->status_change(bl,StatusIconChangeTable[type],0,0,0,0,0);
if( opt_flag&8 ) //bugreport:681
- clif_changeoption2(bl);
+ clif->changeoption2(bl);
else if(opt_flag)
- clif_changeoption(bl);
+ clif->changeoption(bl);
if (calc_flag)
status_calc_bl(bl,calc_flag);
@@ -9781,7 +9781,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
unit_stop_walking(bl,1);
unit_stop_attack(bl);
sc->opt1 = OPT1_STONE;
- clif_changeoption(bl);
+ clif->changeoption(bl);
sc_timer_next(1000+tick,status_change_timer, bl->id, data );
status_calc_bl(bl, StatusChangeFlagTable[type]);
return 0;
@@ -9872,7 +9872,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
struct mob_data *boss_md = map_id2boss(sce->val1);
if( boss_md && sd->bl.m == boss_md->bl.m )
{
- clif_bossmapinfo(sd->fd, boss_md, 1); // Update X - Y on minimap
+ clif->bossmapinfo(sd->fd, boss_md, 1); // Update X - Y on minimap
if (boss_md->bl.prev != NULL) {
sc_timer_next(5000 + tick, status_change_timer, bl->id, data);
return 0;
@@ -9950,8 +9950,8 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
case SC_NOCHAT:
if(sd){
sd->status.manner++;
- clif_changestatus(sd,SP_MANNER,sd->status.manner);
- clif_updatestatus(sd,SP_MANNER);
+ clif->changestatus(sd,SP_MANNER,sd->status.manner);
+ clif->updatestatus(sd,SP_MANNER);
if (sd->status.manner < 0)
{ //Every 60 seconds your manner goes up by 1 until it gets back to 0.
sc_timer_next(60000+tick, status_change_timer, bl->id, data);
@@ -9965,7 +9965,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
//if (sce->val4 % 1000 == 0) {
// char timer[10];
// snprintf (timer, 10, "%d", sce->val4/1000);
- // clif_message(bl, timer);
+ // clif->message(bl, timer);
//}
if((sce->val4 -= 500) > 0) {
sc_timer_next(500 + tick, status_change_timer, bl->id, data);
@@ -10023,7 +10023,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
case SC_PYREXIA:
if( --(sce->val4) >= 0 ) {
map_freeblock_lock();
- clif_damage(bl,bl,tick,status_get_amotion(bl),status_get_dmotion(bl)+500,100,0,0,0);
+ clif->damage(bl,bl,tick,status_get_amotion(bl),status_get_dmotion(bl)+500,100,0,0,0);
status_fix_damage(NULL,bl,100,0);
if( sc->data[type] ) {
sc_timer_next(3000+tick,status_change_timer,bl->id,data);
@@ -10039,7 +10039,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
damage += status->vit * (sce->val1 - 3);
unit_skillcastcancel(bl,2);
map_freeblock_lock();
- status_damage(bl, bl, damage, 0, clif_damage(bl,bl,tick,status_get_amotion(bl),status_get_dmotion(bl)+500,damage,1,0,0), 1);
+ status_damage(bl, bl, damage, 0, clif->damage(bl,bl,tick,status_get_amotion(bl),status_get_dmotion(bl)+500,damage,1,0,0), 1);
if( sc->data[type] ) {
sc_timer_next(1000 + tick, status_change_timer, bl->id, data );
}
@@ -10086,7 +10086,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
}
}
- clif_emotion(bl,E_HEH);
+ clif->emotion(bl,E_HEH);
sc_timer_next(4000+tick,status_change_timer,bl->id,data);
}
return 0;
@@ -10097,7 +10097,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
if( --(sce->val4) >= 0 )
{ //Damage is every 10 seconds including 3%sp drain.
map_freeblock_lock();
- clif_damage(bl,bl,tick,status_get_amotion(bl),1,1,0,0,0);
+ clif->damage(bl,bl,tick,status_get_amotion(bl),1,1,0,0,0);
status_damage(NULL, bl, 1, status->max_sp * 3 / 100, 0, 0); //cancel dmg only if cancelable
if( sc->data[type] ) {
sc_timer_next(10000 + tick, status_change_timer, bl->id, data );
@@ -10110,7 +10110,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
case SC_OBLIVIONCURSE:
if( --(sce->val4) >= 0 )
{
- clif_emotion(bl,E_WHAT);
+ clif->emotion(bl,E_WHAT);
sc_timer_next(3000 + tick, status_change_timer, bl->id, data );
return 0;
}
@@ -10151,7 +10151,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
int damage = 1000 + 3 * status_get_max_hp(bl) / 100; // Deals fixed (1000 + 3%*MaxHP)
map_freeblock_lock();
- clif_damage(bl,bl,tick,0,0,damage,1,9,0); //damage is like endure effect with no walk delay
+ clif->damage(bl,bl,tick,0,0,damage,1,9,0); //damage is like endure effect with no walk delay
status_damage(src, bl, damage, 0, 0, 1);
if( sc->data[type]){ // Target still lives. [LimitLine]
@@ -10262,7 +10262,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
break;
map_freeblock_lock();
damage = 200 + 100 * sce->val1 + status_get_int(src);
- status_damage(src, bl, damage, 0, clif_damage(bl,bl,tick,status->amotion,status->dmotion+200,damage,1,0,0), 1);
+ status_damage(src, bl, damage, 0, clif->damage(bl,bl,tick,status->amotion,status->dmotion+200,damage,1,0,0), 1);
unit_skillcastcancel(bl,1);
if ( sc->data[type] ) {
sc_timer_next(1000 + tick, status_change_timer, bl->id, data);
@@ -10276,7 +10276,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
case SC_VOICEOFSIREN:
if( --(sce->val4) >= 0 )
{
- clif_emotion(bl,E_LV);
+ clif->emotion(bl,E_LV);
sc_timer_next(2000 + tick, status_change_timer, bl->id, data);
return 0;
}
@@ -10370,7 +10370,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
int damage = status->max_hp / 100; // Suggestion 1% each second
if( damage >= status->hp ) damage = status->hp - 1; // Do not kill, just keep you with 1 hp minimum
map_freeblock_lock();
- status_fix_damage(NULL,bl,damage,clif_damage(bl,bl,tick,0,0,damage,0,0,0));
+ status_fix_damage(NULL,bl,damage,clif->damage(bl,bl,tick,0,0,damage,0,0,0));
if( sc->data[type] ) {
sc_timer_next(1000 + tick, status_change_timer, bl->id, data);
}
@@ -10447,7 +10447,7 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data)
pc_stop_walking(sd,1|4);
pc_stop_attack(sd);
pc_setsit(sd);
- clif_sitting(bl);
+ clif->sitting(bl);
}
sc_timer_next(10000 + tick, status_change_timer, bl->id, data);
return 0;
@@ -10553,7 +10553,7 @@ int status_change_timer_sub(struct block_list* bl, va_list ap)
break;
case SC_CURSEDCIRCLE_TARGET:
if( tsc && tsc->data[SC_CURSEDCIRCLE_TARGET] && tsc->data[SC_CURSEDCIRCLE_TARGET]->val2 == src->id ) {
- clif_bladestop(bl, tsc->data[SC_CURSEDCIRCLE_TARGET]->val2, 0);
+ clif->bladestop(bl, tsc->data[SC_CURSEDCIRCLE_TARGET]->val2, 0);
status_change_end(bl, type, INVALID_TIMER);
}
break;
@@ -10965,7 +10965,7 @@ static int status_natural_heal(struct block_list* bl, va_list args)
(sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR &&
rnd()%10000 < battle_config.sg_angel_skill_ratio
) { //Angel of the Sun/Moon/Star
- clif_feel_hate_reset(sd);
+ clif->feel_hate_reset(sd);
pc_resethate(sd);
pc_resetfeel(sd);
}
diff --git a/src/map/storage.c b/src/map/storage.c
index eb7760a0f..53058f9af 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -100,14 +100,14 @@ int storage_storageopen(struct map_session_data *sd)
if( !pc_can_give_items(sd) )
{ //check is this GM level is allowed to put items to storage
- clif_displaymessage(sd->fd, msg_txt(246));
+ clif->displaymessage(sd->fd, msg_txt(246));
return 1;
}
sd->state.storage_flag = 1;
storage_sortitem(sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items));
- clif_storagelist(sd, sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items));
- clif_updatestorageamount(sd, sd->status.storage.storage_amount, MAX_STORAGE);
+ clif->storagelist(sd, sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items));
+ clif->updatestorageamount(sd, sd->status.storage.storage_amount, MAX_STORAGE);
return 0;
}
@@ -150,7 +150,7 @@ static int storage_additem(struct map_session_data* sd, struct item* item_data,
if( !itemdb_canstore(item_data, pc_get_group_level(sd)) )
{ //Check if item is storable. [Skotlex]
- clif_displaymessage (sd->fd, msg_txt(264));
+ clif->displaymessage (sd->fd, msg_txt(264));
return 1;
}
@@ -163,7 +163,7 @@ static int storage_additem(struct map_session_data* sd, struct item* item_data,
if( amount > MAX_AMOUNT - stor->items[i].amount || ( data->stack.storage && amount > data->stack.amount - stor->items[i].amount ) )
return 1;
stor->items[i].amount += amount;
- clif_storageitemadded(sd,&stor->items[i],i,amount);
+ clif->storageitemadded(sd,&stor->items[i],i,amount);
return 0;
}
}
@@ -178,8 +178,8 @@ static int storage_additem(struct map_session_data* sd, struct item* item_data,
memcpy(&stor->items[i],item_data,sizeof(stor->items[0]));
stor->storage_amount++;
stor->items[i].amount = amount;
- clif_storageitemadded(sd,&stor->items[i],i,amount);
- clif_updatestorageamount(sd, stor->storage_amount, MAX_STORAGE);
+ clif->storageitemadded(sd,&stor->items[i],i,amount);
+ clif->updatestorageamount(sd, stor->storage_amount, MAX_STORAGE);
return 0;
}
@@ -197,9 +197,9 @@ int storage_delitem(struct map_session_data* sd, int n, int amount)
{
memset(&sd->status.storage.items[n],0,sizeof(sd->status.storage.items[0]));
sd->status.storage.storage_amount--;
- if( sd->state.storage_flag == 1 ) clif_updatestorageamount(sd, sd->status.storage.storage_amount, MAX_STORAGE);
+ if( sd->state.storage_flag == 1 ) clif->updatestorageamount(sd, sd->status.storage.storage_amount, MAX_STORAGE);
}
- if( sd->state.storage_flag == 1 ) clif_storageitemremoved(sd,n,amount);
+ if( sd->state.storage_flag == 1 ) clif->storageitemremoved(sd,n,amount);
return 0;
}
@@ -255,7 +255,7 @@ int storage_storageget(struct map_session_data* sd, int index, int amount)
if( (flag = pc_additem(sd,&sd->status.storage.items[index],amount,LOG_TYPE_STORAGE)) == 0 )
storage_delitem(sd,index,amount);
else
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
return 1;
}
@@ -323,7 +323,7 @@ void storage_storageclose(struct map_session_data* sd)
{
nullpo_retv(sd);
- clif_storageclose(sd);
+ clif->storageclose(sd);
if( save_settings&4 )
chrif_save(sd,0); //Invokes the storage saving as well.
@@ -395,7 +395,7 @@ int storage_guild_storageopen(struct map_session_data* sd)
return 1; //Can't open both storages at a time.
if( !pc_can_give_items(sd) ) { //check is this GM level can open guild storage and store items [Lupus]
- clif_displaymessage(sd->fd, msg_txt(246));
+ clif->displaymessage(sd->fd, msg_txt(246));
return 1;
}
@@ -412,8 +412,8 @@ int storage_guild_storageopen(struct map_session_data* sd)
gstor->storage_status = 1;
sd->state.storage_flag = 2;
storage_sortitem(gstor->items, ARRAYLENGTH(gstor->items));
- clif_storagelist(sd, gstor->items, ARRAYLENGTH(gstor->items));
- clif_updatestorageamount(sd, gstor->storage_amount, MAX_GUILD_STORAGE);
+ clif->storagelist(sd, gstor->items, ARRAYLENGTH(gstor->items));
+ clif->updatestorageamount(sd, gstor->storage_amount, MAX_GUILD_STORAGE);
return 0;
}
@@ -444,7 +444,7 @@ int guild_storage_additem(struct map_session_data* sd, struct guild_storage* sto
if( !itemdb_canguildstore(item_data, pc_get_group_level(sd)) || item_data->expire_time )
{ //Check if item is storable. [Skotlex]
- clif_displaymessage (sd->fd, msg_txt(264));
+ clif->displaymessage (sd->fd, msg_txt(264));
return 1;
}
@@ -454,7 +454,7 @@ int guild_storage_additem(struct map_session_data* sd, struct guild_storage* sto
if( amount > MAX_AMOUNT - stor->items[i].amount || ( data->stack.guildstorage && amount > data->stack.amount - stor->items[i].amount ) )
return 1;
stor->items[i].amount+=amount;
- clif_storageitemadded(sd,&stor->items[i],i,amount);
+ clif->storageitemadded(sd,&stor->items[i],i,amount);
stor->dirty = 1;
return 0;
}
@@ -469,8 +469,8 @@ int guild_storage_additem(struct map_session_data* sd, struct guild_storage* sto
memcpy(&stor->items[i],item_data,sizeof(stor->items[0]));
stor->items[i].amount=amount;
stor->storage_amount++;
- clif_storageitemadded(sd,&stor->items[i],i,amount);
- clif_updatestorageamount(sd, stor->storage_amount, MAX_GUILD_STORAGE);
+ clif->storageitemadded(sd,&stor->items[i],i,amount);
+ clif->updatestorageamount(sd, stor->storage_amount, MAX_GUILD_STORAGE);
stor->dirty = 1;
return 0;
}
@@ -493,9 +493,9 @@ int guild_storage_delitem(struct map_session_data* sd, struct guild_storage* sto
if(stor->items[n].amount==0){
memset(&stor->items[n],0,sizeof(stor->items[0]));
stor->storage_amount--;
- clif_updatestorageamount(sd, stor->storage_amount, MAX_GUILD_STORAGE);
+ clif->updatestorageamount(sd, stor->storage_amount, MAX_GUILD_STORAGE);
}
- clif_storageitemremoved(sd,n,amount);
+ clif->storageitemremoved(sd,n,amount);
stor->dirty = 1;
return 0;
}
@@ -572,7 +572,7 @@ int storage_guild_storageget(struct map_session_data* sd, int index, int amount)
if((flag = pc_additem(sd,&stor->items[index],amount,LOG_TYPE_GSTORAGE)) == 0)
guild_storage_delitem(sd,stor,index,amount);
else //inform fail
- clif_additem(sd,0,0,flag);
+ clif->additem(sd,0,0,flag);
// log_fromstorage(sd, index, 1);
return 0;
@@ -691,7 +691,7 @@ int storage_guild_storageclose(struct map_session_data* sd)
nullpo_ret(sd);
nullpo_ret(stor=guild2storage2(sd->status.guild_id));
- clif_storageclose(sd);
+ clif->storageclose(sd);
if (stor->storage_status)
{
if (save_settings&4)
@@ -716,7 +716,7 @@ int storage_guild_storage_quit(struct map_session_data* sd, int flag)
{ //Only during a guild break flag is 1 (don't save storage)
sd->state.storage_flag = 0;
stor->storage_status = 0;
- clif_storageclose(sd);
+ clif->storageclose(sd);
if (save_settings&4)
chrif_save(sd,0);
return 0;
diff --git a/src/map/trade.c b/src/map/trade.c
index 0d01b54a6..a8174be97 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -32,24 +32,24 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
nullpo_retv(sd);
if (map[sd->bl.m].flag.notrade) {
- clif_displaymessage (sd->fd, msg_txt(272));
+ clif->displaymessage (sd->fd, msg_txt(272));
return; //Can't trade in notrade mapflag maps.
}
if (target_sd == NULL || sd == target_sd) {
- clif_tradestart(sd, 1); // character does not exist
+ clif->tradestart(sd, 1); // character does not exist
return;
}
if (target_sd->npc_id)
{ //Trade fails if you are using an NPC.
- clif_tradestart(sd, 2);
+ clif->tradestart(sd, 2);
return;
}
if (!battle_config.invite_request_check) {
if (target_sd->guild_invite > 0 || target_sd->party_invite > 0 || target_sd->adopt_invite) {
- clif_tradestart(sd, 2);
+ clif->tradestart(sd, 2);
return;
}
}
@@ -58,34 +58,34 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
struct map_session_data *previous_sd = map_id2sd(sd->trade_partner);
if( previous_sd ){
previous_sd->trade_partner = 0;
- clif_tradecancelled(previous_sd);
+ clif->tradecancelled(previous_sd);
} // Once cancelled then continue to the new one.
sd->trade_partner = 0;
- clif_tradecancelled(sd);
+ clif->tradecancelled(sd);
}
if (target_sd->trade_partner != 0) {
- clif_tradestart(sd, 2); // person is in another trade
+ clif->tradestart(sd, 2); // person is in another trade
return;
}
if (!pc_can_give_items(sd) || !pc_can_give_items(target_sd)) //check if both GMs are allowed to trade
{
- clif_displaymessage(sd->fd, msg_txt(246));
- clif_tradestart(sd, 2); // GM is not allowed to trade
+ clif->displaymessage(sd->fd, msg_txt(246));
+ clif->tradestart(sd, 2); // GM is not allowed to trade
return;
}
// Players can not request trade from far away, unless they are allowed to use @trade.
if (!pc_can_use_command(sd, "trade", COMMAND_ATCOMMAND) &&
(sd->bl.m != target_sd->bl.m || !check_distance_bl(&sd->bl, &target_sd->bl, TRADE_DISTANCE))) {
- clif_tradestart(sd, 0); // too far
+ clif->tradestart(sd, 0); // too far
return ;
}
target_sd->trade_partner = sd->status.account_id;
sd->trade_partner = target_sd->status.account_id;
- clif_traderequest(target_sd, sd->status.name);
+ clif->traderequest(target_sd, sd->status.name);
}
/*==========================================
@@ -108,21 +108,21 @@ void trade_tradeack(struct map_session_data *sd, int type)
return; //Already trading or no partner set.
if ((tsd = map_id2sd(sd->trade_partner)) == NULL) {
- clif_tradestart(sd, 1); // character does not exist
+ clif->tradestart(sd, 1); // character does not exist
sd->trade_partner=0;
return;
}
if (tsd->state.trading || tsd->trade_partner != sd->bl.id)
{
- clif_tradestart(sd, 2);
+ clif->tradestart(sd, 2);
sd->trade_partner=0;
return; //Already trading or wrong partner.
}
if (type == 4) { // Cancel
- clif_tradestart(tsd, type);
- clif_tradestart(sd, type);
+ clif->tradestart(tsd, type);
+ clif->tradestart(sd, type);
sd->state.deal_locked = 0;
sd->trade_partner = 0;
tsd->state.deal_locked = 0;
@@ -137,7 +137,7 @@ void trade_tradeack(struct map_session_data *sd, int type)
// Check here as well since the original character could had warped.
if (!pc_can_use_command(sd, "trade", COMMAND_ATCOMMAND) &&
(sd->bl.m != tsd->bl.m || !check_distance_bl(&sd->bl, &tsd->bl, TRADE_DISTANCE))) {
- clif_tradestart(sd, 0); // too far
+ clif->tradestart(sd, 0); // too far
sd->trade_partner=0;
tsd->trade_partner = 0;
return;
@@ -147,8 +147,8 @@ void trade_tradeack(struct map_session_data *sd, int type)
if (sd->npc_id || sd->state.vending || sd->state.buyingstore || sd->state.storage_flag ||
tsd->npc_id || tsd->state.vending || tsd->state.buyingstore || tsd->state.storage_flag)
{ //Fail
- clif_tradestart(sd, 2);
- clif_tradestart(tsd, 2);
+ clif->tradestart(sd, 2);
+ clif->tradestart(tsd, 2);
sd->state.deal_locked = 0;
sd->trade_partner = 0;
tsd->state.deal_locked = 0;
@@ -161,8 +161,8 @@ void trade_tradeack(struct map_session_data *sd, int type)
tsd->state.trading = 1;
memset(&sd->deal, 0, sizeof(sd->deal));
memset(&tsd->deal, 0, sizeof(tsd->deal));
- clif_tradestart(tsd, type);
- clif_tradestart(sd, type);
+ clif->tradestart(tsd, type);
+ clif->tradestart(sd, type);
}
/*==========================================
@@ -338,7 +338,7 @@ void trade_tradeadditem(struct map_session_data *sd, short index, short amount)
if( amount == 0 )
{ //Why do this.. ~.~ just send an ack, the item won't display on the trade window.
- clif_tradeitemok(sd, index, 0);
+ clif->tradeitemok(sd, index, 0);
return;
}
@@ -356,15 +356,15 @@ void trade_tradeadditem(struct map_session_data *sd, short index, short amount)
if( !itemdb_cantrade(item, src_lv, dst_lv) && //Can't trade
(pc_get_partner(sd) != target_sd || !itemdb_canpartnertrade(item, src_lv, dst_lv)) ) //Can't partner-trade
{
- clif_displaymessage (sd->fd, msg_txt(260));
- clif_tradeitemok(sd, index+2, 1);
+ clif->displaymessage (sd->fd, msg_txt(260));
+ clif->tradeitemok(sd, index+2, 1);
return;
}
if( item->expire_time )
{ // Rental System
- clif_displaymessage (sd->fd, msg_txt(260));
- clif_tradeitemok(sd, index+2, 1);
+ clif->displaymessage (sd->fd, msg_txt(260));
+ clif->tradeitemok(sd, index+2, 1);
return;
}
@@ -372,14 +372,14 @@ void trade_tradeadditem(struct map_session_data *sd, short index, short amount)
ARR_FIND( 0, 10, trade_i, sd->deal.item[trade_i].index == index || sd->deal.item[trade_i].amount == 0 );
if( trade_i == 10 ) //No space left
{
- clif_tradeitemok(sd, index+2, 1);
+ clif->tradeitemok(sd, index+2, 1);
return;
}
trade_weight = sd->inventory_data[index]->weight * amount;
if( target_sd->weight + sd->deal.weight + trade_weight > target_sd->max_weight )
{ //fail to add item -- the player was over weighted.
- clif_tradeitemok(sd, index+2, 1);
+ clif->tradeitemok(sd, index+2, 1);
return;
}
@@ -399,8 +399,8 @@ void trade_tradeadditem(struct map_session_data *sd, short index, short amount)
}
sd->deal.weight += trade_weight;
- clif_tradeitemok(sd, index+2, 0); // Return the index as it was received
- clif_tradeadditem(sd, target_sd, index+2, amount);
+ clif->tradeitemok(sd, index+2, 0); // Return the index as it was received
+ clif->tradeadditem(sd, target_sd, index+2, amount);
}
/*==========================================
@@ -427,7 +427,7 @@ void trade_tradeaddzeny(struct map_session_data* sd, int amount)
}
sd->deal.zeny = amount;
- clif_tradeadditem(sd, target_sd, 0, amount);
+ clif->tradeadditem(sd, target_sd, 0, amount);
}
/*==========================================
@@ -445,9 +445,9 @@ void trade_tradeok(struct map_session_data *sd)
return;
}
sd->state.deal_locked = 1;
- clif_tradeitemok(sd, 0, 0);
- clif_tradedeal_lock(sd, 0);
- clif_tradedeal_lock(target_sd, 1);
+ clif->tradeitemok(sd, 0, 0);
+ clif->tradedeal_lock(sd, 0);
+ clif->tradedeal_lock(target_sd, 1);
}
/*==========================================
@@ -464,29 +464,29 @@ void trade_tradecancel(struct map_session_data *sd)
{ // Not trade acepted
if( target_sd ) {
target_sd->trade_partner = 0;
- clif_tradecancelled(target_sd);
+ clif->tradecancelled(target_sd);
}
sd->trade_partner = 0;
- clif_tradecancelled(sd);
+ clif->tradecancelled(sd);
return;
}
for(trade_i = 0; trade_i < 10; trade_i++) { // give items back (only virtual)
if (!sd->deal.item[trade_i].amount)
continue;
- clif_additem(sd, sd->deal.item[trade_i].index, sd->deal.item[trade_i].amount, 0);
+ clif->additem(sd, sd->deal.item[trade_i].index, sd->deal.item[trade_i].amount, 0);
sd->deal.item[trade_i].index = 0;
sd->deal.item[trade_i].amount = 0;
}
if (sd->deal.zeny) {
- clif_updatestatus(sd, SP_ZENY);
+ clif->updatestatus(sd, SP_ZENY);
sd->deal.zeny = 0;
}
sd->state.deal_locked = 0;
sd->state.trading = 0;
sd->trade_partner = 0;
- clif_tradecancelled(sd);
+ clif->tradecancelled(sd);
if (!target_sd)
return;
@@ -494,19 +494,19 @@ void trade_tradecancel(struct map_session_data *sd)
for(trade_i = 0; trade_i < 10; trade_i++) { // give items back (only virtual)
if (!target_sd->deal.item[trade_i].amount)
continue;
- clif_additem(target_sd, target_sd->deal.item[trade_i].index, target_sd->deal.item[trade_i].amount, 0);
+ clif->additem(target_sd, target_sd->deal.item[trade_i].index, target_sd->deal.item[trade_i].amount, 0);
target_sd->deal.item[trade_i].index = 0;
target_sd->deal.item[trade_i].amount = 0;
}
if (target_sd->deal.zeny) {
- clif_updatestatus(target_sd, SP_ZENY);
+ clif->updatestatus(target_sd, SP_ZENY);
target_sd->deal.zeny = 0;
}
target_sd->state.deal_locked = 0;
target_sd->trade_partner = 0;
target_sd->state.trading = 0;
- clif_tradecancelled(target_sd);
+ clif->tradecancelled(target_sd);
}
/*==========================================
@@ -560,7 +560,7 @@ void trade_tradecommit(struct map_session_data *sd)
if (flag == 0)
pc_delitem(sd, n, sd->deal.item[trade_i].amount, 1, 6, LOG_TYPE_TRADE);
else
- clif_additem(sd, n, sd->deal.item[trade_i].amount, 0);
+ clif->additem(sd, n, sd->deal.item[trade_i].amount, 0);
sd->deal.item[trade_i].index = 0;
sd->deal.item[trade_i].amount = 0;
}
@@ -572,7 +572,7 @@ void trade_tradecommit(struct map_session_data *sd)
if (flag == 0)
pc_delitem(tsd, n, tsd->deal.item[trade_i].amount, 1, 6, LOG_TYPE_TRADE);
else
- clif_additem(tsd, n, tsd->deal.item[trade_i].amount, 0);
+ clif->additem(tsd, n, tsd->deal.item[trade_i].amount, 0);
tsd->deal.item[trade_i].index = 0;
tsd->deal.item[trade_i].amount = 0;
}
@@ -598,8 +598,8 @@ void trade_tradecommit(struct map_session_data *sd)
tsd->trade_partner = 0;
tsd->state.trading = 0;
- clif_tradecompleted(sd, 0);
- clif_tradecompleted(tsd, 0);
+ clif->tradecompleted(sd, 0);
+ clif->tradecompleted(tsd, 0);
// save both player to avoid crash: they always have no advantage/disadvantage between the 2 players
if (save_settings&1)
diff --git a/src/map/unit.c b/src/map/unit.c
index 11f7cb8c8..4732b89dd 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -97,9 +97,9 @@ int unit_walktoxy_sub(struct block_list *bl)
if (bl->type == BL_PC) {
((TBL_PC *)bl)->head_dir = 0;
- clif_walkok((TBL_PC*)bl);
+ clif->walkok((TBL_PC*)bl);
}
- clif_move(ud);
+ clif->move(ud);
if(ud->walkpath.path_pos>=ud->walkpath.path_len)
i = -1;
@@ -158,7 +158,7 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data
return unit_walktoxy_sub(bl);
//Refresh view for all those we lose sight
- map_foreachinmovearea(clif_outsight, bl, AREA_SIZE, dx, dy, sd?BL_ALL:BL_PC, bl);
+ map_foreachinmovearea(clif->outsight, bl, AREA_SIZE, dx, dy, sd?BL_ALL:BL_PC, bl);
x += dx;
y += dy;
@@ -170,7 +170,7 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data
return 0; //map_moveblock has altered the object beyond what we expected (moved/warped it)
ud->walktimer = -2; // arbitrary non-INVALID_TIMER value to make the clif code send walking packets
- map_foreachinmovearea(clif_insight, bl, AREA_SIZE, -dx, -dy, sd?BL_ALL:BL_PC, bl);
+ map_foreachinmovearea(clif->insight, bl, AREA_SIZE, -dx, -dy, sd?BL_ALL:BL_PC, bl);
ud->walktimer = INVALID_TIMER;
if(sd) {
@@ -215,11 +215,11 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data
{
if (!(ud->skill_id == NPC_SELFDESTRUCTION && ud->skilltimer != INVALID_TIMER))
{ //Skill used, abort walking
- clif_fixpos(bl); //Fix position as walk has been cancelled.
+ clif->fixpos(bl); //Fix position as walk has been cancelled.
return 0;
}
//Resend walk packet for proper Self Destruction display.
- clif_move(ud);
+ clif->move(ud);
}
}
else if( mrd && mrd->master )
@@ -260,7 +260,7 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data
if(i > 0) {
ud->walktimer = add_timer(tick+i,unit_walktoxy_timer,id,i);
if( md && DIFF_TICK(tick,md->dmgtick) < 3000 )//not required not damaged recently
- clif_move(ud);
+ clif->move(ud);
} else if(ud->state.running) {
//Keep trying to run.
if ( !(unit_run(bl) || unit_wugdash(bl,sd)) )
@@ -283,7 +283,7 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data
{ //Aegis uses one before every attack, we should
//only need this one for syncing purposes. [Skotlex]
ud->target_to = 0;
- clif_fixpos(bl);
+ clif->fixpos(bl);
unit_attack(bl, tbl->id, ud->state.attack_continue);
}
} else { //Update chase-path
@@ -491,15 +491,15 @@ int unit_run(struct block_list *bl)
if( (to_x == bl->x && to_y == bl->y ) || (to_x == (bl->x+1) || to_y == (bl->y+1)) || (to_x == (bl->x-1) || to_y == (bl->y-1))) {
//If you can't run forward, you must be next to a wall, so bounce back. [Skotlex]
- clif_status_change(bl, SI_BUMP, 1, 0, 0, 0, 0);
+ clif->status_change(bl, SI_BUMP, 1, 0, 0, 0, 0);
//Set running to 0 beforehand so status_change_end knows not to enable spurt [Kevin]
unit_bl2ud(bl)->state.running = 0;
status_change_end(bl, SC_RUN, INVALID_TIMER);
skill->blown(bl,bl,skill->get_blewcount(TK_RUN,lv),unit_getdir(bl),0);
- clif_fixpos(bl); //Why is a clif_slide (skill->blown) AND a fixpos needed? Ask Aegis.
- clif_status_change(bl, SI_BUMP, 0, 0, 0, 0, 0);
+ clif->fixpos(bl); //Why is a clif->slide (skill->blown) AND a fixpos needed? Ask Aegis.
+ clif->status_change(bl, SI_BUMP, 0, 0, 0, 0, 0);
return 0;
}
if (unit_walktoxy(bl, to_x, to_y, 1))
@@ -511,15 +511,15 @@ int unit_run(struct block_list *bl)
} while (--i > 0 && !unit_walktoxy(bl, to_x, to_y, 1));
if ( i == 0 ) {
// copy-paste from above
- clif_status_change(bl, SI_BUMP, 1, 0, 0, 0, 0);
+ clif->status_change(bl, SI_BUMP, 1, 0, 0, 0, 0);
//Set running to 0 beforehand so status_change_end knows not to enable spurt [Kevin]
unit_bl2ud(bl)->state.running = 0;
status_change_end(bl, SC_RUN, INVALID_TIMER);
skill->blown(bl,bl,skill->get_blewcount(TK_RUN,lv),unit_getdir(bl),0);
- clif_fixpos(bl);
- clif_status_change(bl, SI_BUMP, 0, 0, 0, 0, 0);
+ clif->fixpos(bl);
+ clif->status_change(bl, SI_BUMP, 0, 0, 0, 0, 0);
return 0;
}
return 1;
@@ -566,7 +566,7 @@ int unit_wugdash(struct block_list *bl, struct map_session_data *sd) {
status_change_end(bl,SC_WUGDASH,INVALID_TIMER);
if( sd ){
- clif_fixpos(bl);
+ clif->fixpos(bl);
skill->castend_damage_id(bl, &sd->bl, RA_WUGDASH, lv, gettick(), SD_LEVEL);
}
return 0;
@@ -583,7 +583,7 @@ int unit_wugdash(struct block_list *bl, struct map_session_data *sd) {
status_change_end(bl,SC_WUGDASH,INVALID_TIMER);
if( sd ){
- clif_fixpos(bl);
+ clif->fixpos(bl);
skill->castend_damage_id(bl, &sd->bl, RA_WUGDASH, lv, gettick(), SD_LEVEL);
}
return 0;
@@ -629,12 +629,12 @@ int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool
dx = dst_x - bl->x;
dy = dst_y - bl->y;
- map_foreachinmovearea(clif_outsight, bl, AREA_SIZE, dx, dy, sd?BL_ALL:BL_PC, bl);
+ map_foreachinmovearea(clif->outsight, bl, AREA_SIZE, dx, dy, sd?BL_ALL:BL_PC, bl);
map_moveblock(bl, dst_x, dst_y, gettick());
ud->walktimer = -2; // arbitrary non-INVALID_TIMER value to make the clif code send walking packets
- map_foreachinmovearea(clif_insight, bl, AREA_SIZE, -dx, -dy, sd?BL_ALL:BL_PC, bl);
+ map_foreachinmovearea(clif->insight, bl, AREA_SIZE, -dx, -dy, sd?BL_ALL:BL_PC, bl);
ud->walktimer = INVALID_TIMER;
if(sd) {
@@ -658,7 +658,7 @@ int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool
if( flag )
{
unit_movepos(bl,sd->bl.x,sd->bl.y, 0, 0);
- clif_slide(bl,bl->x,bl->y);
+ clif->slide(bl,bl->x,bl->y);
}
}
}
@@ -674,7 +674,7 @@ int unit_setdir(struct block_list *bl,unsigned char dir)
ud->dir = dir;
if (bl->type == BL_PC)
((TBL_PC *)bl)->head_dir = 0;
- clif_changed_dir(bl, AREA);
+ clif->changed_dir(bl, AREA);
return 0;
}
@@ -719,7 +719,7 @@ int unit_blown(struct block_list* bl, int dx, int dy, int count, int flag)
dy = ny-bl->y;
if(dx || dy) {
- map_foreachinmovearea(clif_outsight, bl, AREA_SIZE, dx, dy, bl->type == BL_PC ? BL_ALL : BL_PC, bl);
+ map_foreachinmovearea(clif->outsight, bl, AREA_SIZE, dx, dy, bl->type == BL_PC ? BL_ALL : BL_PC, bl);
if(su) {
skill->unit_move_unit_group(su->group, bl->m, dx, dy);
@@ -727,10 +727,10 @@ int unit_blown(struct block_list* bl, int dx, int dy, int count, int flag)
map_moveblock(bl, nx, ny, gettick());
}
- map_foreachinmovearea(clif_insight, bl, AREA_SIZE, -dx, -dy, bl->type == BL_PC ? BL_ALL : BL_PC, bl);
+ map_foreachinmovearea(clif->insight, bl, AREA_SIZE, -dx, -dy, bl->type == BL_PC ? BL_ALL : BL_PC, bl);
if(!(flag&1)) {
- clif_blown(bl);
+ clif->blown(bl);
}
if(sd) {
@@ -816,7 +816,7 @@ int unit_warp(struct block_list *bl,short m,short x,short y,clr_type type)
bl->m=m;
map_addblock(bl);
- clif_spawn(bl);
+ clif->spawn(bl);
skill->unit_move(bl,gettick(),1);
return 0;
@@ -856,7 +856,7 @@ int unit_stop_walking(struct block_list *bl,int type)
}
if(type&0x01)
- clif_fixpos(bl);
+ clif->fixpos(bl);
ud->walkpath.path_len = 0;
ud->walkpath.path_pos = 0;
@@ -984,13 +984,13 @@ int unit_resume_running(int tid, unsigned int tick, int id, intptr_t data)
TBL_PC * sd = map_id2sd(id);
if(sd && pc_isridingwug(sd))
- clif_skill_nodamage(ud->bl,ud->bl,RA_WUGDASH,ud->skill_lv,
+ clif->skill_nodamage(ud->bl,ud->bl,RA_WUGDASH,ud->skill_lv,
sc_start4(ud->bl,status_skill2sc(RA_WUGDASH),100,ud->skill_lv,unit_getdir(ud->bl),0,0,1));
else
- clif_skill_nodamage(ud->bl,ud->bl,TK_RUN,ud->skill_lv,
+ clif->skill_nodamage(ud->bl,ud->bl,TK_RUN,ud->skill_lv,
sc_start4(ud->bl,status_skill2sc(TK_RUN),100,ud->skill_lv,unit_getdir(ud->bl),0,0,0));
- if (sd) clif_walkok(sd);
+ if (sd) clif->walkok(sd);
return 0;
@@ -1105,7 +1105,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
return 0;
target = (struct block_list*)map_charid2sd(sd->status.partner_id);
if (!target) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
break;
@@ -1149,7 +1149,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
if(sd) {
if( (skill->get_inf2(skill_id)&INF2_ENSEMBLE_SKILL) && skill->check_pc_partner(sd, skill_id, &skill_lv, 1, 0) < 1 ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
@@ -1163,14 +1163,14 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
case BD_ENCORE:
//Prevent using the dance skill if you no longer have the skill in your tree.
if(!sd->skill_id_dance || pc_checkskill(sd,sd->skill_id_dance)<=0){
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
sd->skill_id_old = skill_id;
break;
case WL_WHITEIMPRISON:
if( battle->check_target(src,target,BCT_SELF|BCT_ENEMY) < 0 ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_TOTARGET,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_TOTARGET,0);
return 0;
}
break;
@@ -1313,7 +1313,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
if(!ud->state.running) //need TK_RUN or WUGDASH handler to be done before that, see bugreport:6026
unit_stop_walking(src,1);// eventhough this is not how official works but this will do the trick. bugreport:6829
// in official this is triggered even if no cast time.
- clif_skillcasting(src, src->id, target_id, 0,0, skill_id, skill->get_ele(skill_id, skill_lv), casttime);
+ clif->skillcasting(src, src->id, target_id, 0,0, skill_id, skill->get_ele(skill_id, skill_lv), casttime);
if( casttime > 0 || temp )
{
if (sd && target->type == BL_MOB)
@@ -1432,7 +1432,7 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, ui
* if we cancel it from nodamage_id, so it has to be here for it to not display the animation.
**/
if( skill_id == AL_PNEUMA && map_getcell(src->m, skill_x, skill_y, CELL_CHKLANDPROTECTOR) ) {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
}
@@ -1442,7 +1442,7 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, ui
if( map_getcell(src->m, skill_x, skill_y, CELL_CHKWALL) )
{// can't cast ground targeted spells on wall cells
- if (sd) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
@@ -1509,7 +1509,7 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, ui
unit_stop_walking(src,1);
// in official this is triggered even if no cast time.
- clif_skillcasting(src, src->id, 0, skill_x, skill_y, skill_id, skill->get_ele(skill_id, skill_lv), casttime);
+ clif->skillcasting(src, src->id, 0, skill_x, skill_y, skill_id, skill->get_ele(skill_id, skill_lv), casttime);
if( casttime > 0 ) {
ud->skilltimer = add_timer( tick+casttime, skill->castend_pos, src->id, 0 );
if( (sd && pc_checkskill(sd,SA_FREECAST) > 0) || skill_id == LG_EXEEDBREAK)
@@ -1806,7 +1806,7 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t
{ // attacking when under cast delay has restrictions:
if( tid == INVALID_TIMER )
{ //requested attack.
- if(sd) clif_skill_fail(sd,1,USESKILL_FAIL_SKILLINTERVAL,0);
+ if(sd) clif->skill_fail(sd,1,USESKILL_FAIL_SKILLINTERVAL,0);
return 0;
}
//Otherwise, we are in a combo-attack, delay this until your canact time is over. [Skotlex]
@@ -1826,7 +1826,7 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t
range++; //Extra range when chasing
if( !check_distance_bl(src,target,range) ) { //Chase if required.
if(sd)
- clif_movetoattack(sd,target);
+ clif->movetoattack(sd,target);
else if(ud->state.attack_continue)
unit_walktobl(src,target,ud->chaserange,ud->state.walk_easy|2);
return 1;
@@ -1841,7 +1841,7 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t
}
//Sync packet only for players.
//Non-players use the sync packet on the walk timer. [Skotlex]
- if (tid == INVALID_TIMER && sd) clif_fixpos(src);
+ if (tid == INVALID_TIMER && sd) clif->fixpos(src);
if( DIFF_TICK(ud->attackabletime,tick) <= 0 )
{
@@ -1953,7 +1953,7 @@ int unit_skillcastcancel(struct block_list *bl,int type)
if(bl->type==BL_MOB) ((TBL_MOB*)bl)->skill_idx = -1;
- clif_skillcastcancel(bl);
+ clif->skillcastcancel(bl);
return 1;
}
@@ -1994,7 +1994,7 @@ int unit_fixdamage(struct block_list *src,struct block_list *target,unsigned int
if(damage+damage2 <= 0)
return 0;
- return status_fix_damage(src,target,damage+damage2,clif_damage(target,target,tick,sdelay,ddelay,damage,div,type,damage2));
+ return status_fix_damage(src,target,damage+damage2,clif->damage(target,target,tick,sdelay,ddelay,damage,div,type,damage2));
}
/*==========================================
@@ -2013,7 +2013,7 @@ int unit_changeviewsize(struct block_list *bl,short size)
} else
return 0;
if(size!=0)
- clif_specialeffect(bl,421+size, AREA);
+ clif->specialeffect(bl,421+size, AREA);
return 0;
}
@@ -2190,7 +2190,7 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
struct pet_data *pd = (struct pet_data*)bl;
if( pd->pet.intimate <= 0 && !(pd->msd && !pd->msd->state.active) )
{ //If logging out, this is deleted on unit_free
- clif_clearunit_area(bl,clrtype);
+ clif->clearunit_area(bl,clrtype);
map_delblock(bl);
unit_free(bl,CLR_OUTSIGHT);
map_freeblock_unlock();
@@ -2204,8 +2204,8 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
ud->canact_tick = ud->canmove_tick; //It appears HOM do reset the can-act tick.
if( !hd->homunculus.intimacy && !(hd->master && !hd->master->state.active) )
{ //If logging out, this is deleted on unit_free
- clif_emotion(bl, E_SOB);
- clif_clearunit_area(bl,clrtype);
+ clif->emotion(bl, E_SOB);
+ clif->clearunit_area(bl,clrtype);
map_delblock(bl);
unit_free(bl,CLR_OUTSIGHT);
map_freeblock_unlock();
@@ -2218,7 +2218,7 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
ud->canact_tick = ud->canmove_tick;
if( mercenary_get_lifetime(md) <= 0 && !(md->master && !md->master->state.active) )
{
- clif_clearunit_area(bl,clrtype);
+ clif->clearunit_area(bl,clrtype);
map_delblock(bl);
unit_free(bl,CLR_OUTSIGHT);
map_freeblock_unlock();
@@ -2231,7 +2231,7 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
ud->canact_tick = ud->canmove_tick;
if( elemental_get_lifetime(ed) <= 0 && !(ed->master && !ed->master->state.active) )
{
- clif_clearunit_area(bl,clrtype);
+ clif->clearunit_area(bl,clrtype);
map_delblock(bl);
unit_free(bl,0);
map_freeblock_unlock();
@@ -2245,7 +2245,7 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
* BL_MOB is handled by mob_dead unless the monster is not dead.
**/
if( bl->type != BL_MOB || !status_isdead(bl) )
- clif_clearunit_area(bl,clrtype);
+ clif->clearunit_area(bl,clrtype);
map_delblock(bl);
map_freeblock_unlock();
return 1;
@@ -2311,7 +2311,7 @@ int unit_free(struct block_list *bl, clr_type clrtype)
duel_reject(sd->duel_invite, sd);
// Notify friends that this char logged out. [Skotlex]
- map_foreachpc(clif_friendslist_toggle_sub, sd->status.account_id, sd->status.char_id, 0);
+ map_foreachpc(clif->friendslist_toggle_sub, sd->status.account_id, sd->status.char_id, 0);
party_send_logout(sd);
guild_send_memberinfoshort(sd,0);
pc_cleareventtimer(sd);
diff --git a/src/map/vending.c b/src/map/vending.c
index 5f0ac7501..ea0c5fe2a 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -38,7 +38,7 @@ void vending_closevending(struct map_session_data* sd)
if( sd->state.vending )
{
sd->state.vending = false;
- clif_closevendingboard(&sd->bl, 0);
+ clif->closevendingboard(&sd->bl, 0);
}
}
@@ -57,13 +57,13 @@ void vending_vendinglistreq(struct map_session_data* sd, int id)
if (!pc_can_give_items(sd) || !pc_can_give_items(vsd)) //check if both GMs are allowed to trade
{ // GM is not allowed to trade
- clif_displaymessage(sd->fd, msg_txt(246));
+ clif->displaymessage(sd->fd, msg_txt(246));
return;
}
sd->vended_id = vsd->vender_id; // register vending uid
- clif_vendinglist(sd, id, vsd->vending);
+ clif->vendinglist(sd, id, vsd->vending);
}
/*==========================================
@@ -82,7 +82,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
if( vsd->vender_id != uid )
{// shop has changed
- clif_buyvending(sd, 0, 0, 6); // store information was incorrect
+ clif->buyvending(sd, 0, 0, 6); // store information was incorrect
return;
}
@@ -124,19 +124,19 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
z += ((double)vsd->vending[j].value * (double)amount);
if( z > (double)sd->status.zeny || z < 0. || z > (double)MAX_ZENY )
{
- clif_buyvending(sd, idx, amount, 1); // you don't have enough zeny
+ clif->buyvending(sd, idx, amount, 1); // you don't have enough zeny
return;
}
if( z + (double)vsd->status.zeny > (double)MAX_ZENY && !battle_config.vending_over_max )
{
- clif_buyvending(sd, idx, vsd->vending[j].amount, 4); // too much zeny = overflow
+ clif->buyvending(sd, idx, vsd->vending[j].amount, 4); // too much zeny = overflow
return;
}
w += itemdb_weight(vsd->status.cart[idx].nameid) * amount;
if( w + sd->weight > sd->max_weight )
{
- clif_buyvending(sd, idx, amount, 2); // you can not buy, because overweight
+ clif->buyvending(sd, idx, amount, 2); // you can not buy, because overweight
return;
}
@@ -149,7 +149,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
if( vending[j].amount < amount )
{
// send more quantity is not a hack (an other player can have buy items just before)
- clif_buyvending(sd, idx, vsd->vending[j].amount, 4); // not enough quantity
+ clif->buyvending(sd, idx, vsd->vending[j].amount, 4); // not enough quantity
return;
}
@@ -183,14 +183,14 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui
pc_additem(sd, &vsd->status.cart[idx], amount, LOG_TYPE_VENDING);
vsd->vending[vend_list[i]].amount -= amount;
pc_cart_delitem(vsd, idx, amount, 0, LOG_TYPE_VENDING);
- clif_vendingreport(vsd, idx, amount);
+ clif->vendingreport(vsd, idx, amount);
//print buyer's name
if( battle_config.buyer_name )
{
char temp[256];
sprintf(temp, msg_txt(265), sd->status.name);
- clif_disp_onlyself(vsd,temp,strlen(temp));
+ clif->disp_onlyself(vsd,temp,strlen(temp));
}
}
@@ -248,14 +248,14 @@ void vending_openvending(struct map_session_data* sd, const char* message, const
// skill level and cart check
if( !vending_skill_lvl || !pc_iscarton(sd) )
{
- clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0);
return;
}
// check number of items in shop
if( count < 1 || count > MAX_VENDING || count > 2 + vending_skill_lvl )
{ // invalid item count
- clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0);
+ clif->skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0);
return;
}
@@ -286,11 +286,11 @@ void vending_openvending(struct map_session_data* sd, const char* message, const
}
if( i != j )
- clif_displaymessage (sd->fd, msg_txt(266)); //"Some of your items cannot be vended and were removed from the shop."
+ clif->displaymessage (sd->fd, msg_txt(266)); //"Some of your items cannot be vended and were removed from the shop."
if( i == 0 )
{ // no valid item found
- clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); // custom reply packet
+ clif->skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); // custom reply packet
return;
}
sd->state.prevend = 0;
@@ -299,8 +299,8 @@ void vending_openvending(struct map_session_data* sd, const char* message, const
sd->vend_num = i;
safestrncpy(sd->message, message, MESSAGE_SIZE);
- clif_openvending(sd,sd->bl.id,sd->vending);
- clif_showvendingboard(&sd->bl,message,0);
+ clif->openvending(sd,sd->bl.id,sd->vending);
+ clif->showvendingboard(&sd->bl,message,0);
}