summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c86
1 files changed, 43 insertions, 43 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index c61630bb5..74d827847 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -594,7 +594,7 @@ void clif_authok(struct map_session_data *sd)
struct packet_authok p;
p.PacketType = authokType;
- p.startTime = iTimer->gettick();
+ p.startTime = timer->gettick();
WBUFPOS(&p.PosDir[0],0,sd->bl.x,sd->bl.y,sd->ud.dir); /* do the stupid client math */
p.xSize = p.ySize = 5; /* not-used */
@@ -797,7 +797,7 @@ void clif_clearunit_delayed(struct block_list* bl, clr_type type, unsigned int t
{
struct block_list *tbl = ers_alloc(clif->delay_clearunit_ers, struct block_list);
memcpy (tbl, bl, sizeof (struct block_list));
- iTimer->add_timer(tick, clif->clearunit_delayed_sub, (int)type, (intptr_t)tbl);
+ timer->add(tick, clif->clearunit_delayed_sub, (int)type, (intptr_t)tbl);
}
void clif_get_weapon_view(struct map_session_data* sd, unsigned short *rhand, unsigned short *lhand)
@@ -1152,7 +1152,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
p.head = vd->hair_style;
p.weapon = vd->weapon;
p.accessory = vd->head_bottom;
- p.moveStartTime = iTimer->gettick();
+ p.moveStartTime = timer->gettick();
#if PACKETVER < 7
p.shield = vd->shield;
#endif
@@ -1530,7 +1530,7 @@ void clif_walkok(struct map_session_data *sd)
WFIFOHEAD(fd, packet_len(0x87));
WFIFOW(fd,0)=0x87;
- WFIFOL(fd,2)=iTimer->gettick();
+ WFIFOL(fd,2)=timer->gettick();
WFIFOPOS2(fd,6,sd->bl.x,sd->bl.y,sd->ud.to_x,sd->ud.to_y,8,8);
WFIFOSET(fd,packet_len(0x87));
}
@@ -1601,7 +1601,7 @@ void clif_move(struct unit_data *ud)
WBUFW(buf,0)=0x86;
WBUFL(buf,2)=bl->id;
WBUFPOS2(buf,6,bl->x,bl->y,ud->to_x,ud->to_y,8,8);
- WBUFL(buf,12)=iTimer->gettick();
+ WBUFL(buf,12)=timer->gettick();
clif->send(buf, packet_len(0x86), bl, AREA_WOS);
if (disguised(bl)) {
WBUFL(buf,2)=-bl->id;
@@ -1627,14 +1627,14 @@ int clif_delayquit(int tid, unsigned int tick, int id, intptr_t data) {
*------------------------------------------*/
void clif_quitsave(int fd,struct map_session_data *sd) {
if (!battle_config.prevent_logout ||
- DIFF_TICK(iTimer->gettick(), sd->canlog_tick) > battle_config.prevent_logout)
+ DIFF_TICK(timer->gettick(), sd->canlog_tick) > battle_config.prevent_logout)
iMap->quit(sd);
else if (sd->fd) {
//Disassociate session from player (session is deleted after this function was called)
//And set a timer to make him quit later.
session[sd->fd]->session_data = NULL;
sd->fd = 0;
- iTimer->add_timer(iTimer->gettick() + 10000, clif->delayquit, sd->bl.id, 0);
+ timer->add(timer->gettick() + 10000, clif->delayquit, sd->bl.id, 0);
}
}
@@ -3730,7 +3730,7 @@ void clif_useitemack(struct map_session_data *sd,int index,int amount,bool ok)
}
void clif_hercules_chsys_send(struct hChSysCh *channel, struct map_session_data *sd, const char *msg) {
- if( channel->msg_delay != 0 && DIFF_TICK(sd->hchsysch_tick + ( channel->msg_delay * 1000 ), iTimer->gettick()) > 0 && !pc->has_permission(sd, PC_PERM_HCHSYS_ADMIN) ) {
+ if( channel->msg_delay != 0 && DIFF_TICK(sd->hchsysch_tick + ( channel->msg_delay * 1000 ), timer->gettick()) > 0 && !pc->has_permission(sd, PC_PERM_HCHSYS_ADMIN) ) {
clif->colormes(sd->fd,COLOR_RED,msg_txt(1455));
return;
} else {
@@ -3740,7 +3740,7 @@ void clif_hercules_chsys_send(struct hChSysCh *channel, struct map_session_data
if( channel->type == hChSys_IRC )
ircbot->relay(sd->status.name,msg);
if( channel->msg_delay != 0 )
- sd->hchsysch_tick = iTimer->gettick();
+ sd->hchsysch_tick = timer->gettick();
}
}
@@ -9417,7 +9417,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) {
if(map[sd->bl.m].flag.pvp && !(sd->sc.option&OPTION_INVISIBLE)) {
if(!battle_config.pk_mode) { // remove pvp stuff for pk_mode [Valaris]
if (!map[sd->bl.m].flag.pvp_nocalcrank)
- sd->pvp_timer = iTimer->add_timer(iTimer->gettick()+200, pc->calc_pvprank_timer, sd->bl.id, 0);
+ sd->pvp_timer = timer->add(timer->gettick()+200, pc->calc_pvprank_timer, sd->bl.id, 0);
sd->pvp_rank = 0;
sd->pvp_lastusers = 0;
sd->pvp_point = 5;
@@ -9465,7 +9465,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) {
if( battle_config.hom_setting&0x8 )
status_calc_bl(&sd->hd->bl, SCB_SPEED); //Homunc mimic their master's speed on each map change
if( !(battle_config.hom_setting&0x2) )
- skill->unit_move(&sd->hd->bl,iTimer->gettick(),1); // apply land skills immediately
+ skill->unit_move(&sd->hd->bl,timer->gettick(),1); // apply land skills immediately
}
if( sd->md ) {
@@ -9641,7 +9641,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) {
// Trigger skill effects if you appear standing on them
if(!battle_config.pc_invincible_time)
- skill->unit_move(&sd->bl,iTimer->gettick(),1);
+ skill->unit_move(&sd->bl,timer->gettick(),1);
}
@@ -9666,7 +9666,7 @@ void clif_parse_TickSend(int fd, struct map_session_data *sd)
{
sd->client_tick = RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]);
- clif->notify_time(sd, iTimer->gettick());
+ clif->notify_time(sd, timer->gettick());
}
@@ -9746,7 +9746,7 @@ void clif_parse_progressbar(int fd, struct map_session_data * sd)
{
int npc_id = sd->progressbar.npc_id;
- if( iTimer->gettick() < sd->progressbar.timeout && sd->st )
+ if( timer->gettick() < sd->progressbar.timeout && sd->st )
sd->st->state = END;
sd->state.workinprogress = sd->progressbar.npc_id = sd->progressbar.timeout = 0;
@@ -9813,7 +9813,7 @@ void clif_parse_QuitGame(int fd, struct map_session_data *sd)
{
/* Rovert's prevent logout option fixed [Valaris] */
if( !sd->sc.data[SC_CLOAKING] && !sd->sc.data[SC_HIDING] && !sd->sc.data[SC_CHASEWALK] && !sd->sc.data[SC_CLOAKINGEXCEED] &&
- (!battle_config.prevent_logout || DIFF_TICK(iTimer->gettick(), sd->canlog_tick) > battle_config.prevent_logout) )
+ (!battle_config.prevent_logout || DIFF_TICK(timer->gettick(), sd->canlog_tick) > battle_config.prevent_logout) )
{
set_eof(fd);
@@ -9896,9 +9896,9 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
return;
if( battle_config.min_chat_delay ) { //[Skotlex]
- if (DIFF_TICK(sd->cantalk_tick, iTimer->gettick()) > 0)
+ if (DIFF_TICK(sd->cantalk_tick, timer->gettick()) > 0)
return;
- sd->cantalk_tick = iTimer->gettick() + battle_config.min_chat_delay;
+ sd->cantalk_tick = timer->gettick() + battle_config.min_chat_delay;
}
if( (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE ) {
@@ -9941,16 +9941,16 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
unsigned char mylen = 1;
if( sd->disguise == -1 ) {
- sd->fontcolor_tid = iTimer->add_timer(iTimer->gettick()+5000, clif->undisguise_timer, sd->bl.id, 0);
+ sd->fontcolor_tid = timer->add(timer->gettick()+5000, clif->undisguise_timer, sd->bl.id, 0);
pc->disguise(sd,sd->status.class_);
if( pc_isdead(sd) )
clif_clearunit_single(-sd->bl.id, CLR_DEAD, sd->fd);
if( unit->is_walking(&sd->bl) )
clif->move(&sd->ud);
} else if ( sd->disguise == sd->status.class_ && sd->fontcolor_tid != INVALID_TIMER ) {
- const struct TimerData *timer;
- if( (timer = iTimer->get_timer(sd->fontcolor_tid)) ) {
- iTimer->settick_timer(sd->fontcolor_tid, timer->tick+5000);
+ const struct TimerData *td;
+ if( (td = timer->get(sd->fontcolor_tid)) ) {
+ timer->settick(sd->fontcolor_tid, td->tick+5000);
}
}
@@ -10337,7 +10337,7 @@ void clif_parse_ActionRequest(int fd, struct map_session_data *sd)
clif->pActionRequest_sub(sd,
RFIFOB(fd,packet_db[RFIFOW(fd,0)].pos[1]),
RFIFOL(fd,packet_db[RFIFOW(fd,0)].pos[0]),
- iTimer->gettick()
+ timer->gettick()
);
}
@@ -10355,7 +10355,7 @@ void clif_parse_Restart(int fd, struct map_session_data *sd) {
case 0x01:
/* Rovert's Prevent logout option - Fixed [Valaris] */
if( !sd->sc.data[SC_CLOAKING] && !sd->sc.data[SC_HIDING] && !sd->sc.data[SC_CHASEWALK] && !sd->sc.data[SC_CLOAKINGEXCEED] &&
- (!battle_config.prevent_logout || DIFF_TICK(iTimer->gettick(), sd->canlog_tick) > battle_config.prevent_logout) )
+ (!battle_config.prevent_logout || DIFF_TICK(timer->gettick(), sd->canlog_tick) > battle_config.prevent_logout) )
{ //Send to char-server for character selection.
chrif->charselectreq(sd, session[fd]->client_addr);
} else {
@@ -10387,10 +10387,10 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
return;
if (battle_config.min_chat_delay) { //[Skotlex]
- if (DIFF_TICK(sd->cantalk_tick, iTimer->gettick()) > 0) {
+ if (DIFF_TICK(sd->cantalk_tick, timer->gettick()) > 0) {
return;
}
- sd->cantalk_tick = iTimer->gettick() + battle_config.min_chat_delay;
+ sd->cantalk_tick = timer->gettick() + battle_config.min_chat_delay;
}
// Chat logging type 'W' / Whisper
@@ -10827,7 +10827,7 @@ void clif_parse_NpcClicked(int fd,struct map_session_data *sd)
switch (bl->type) {
case BL_MOB:
case BL_PC:
- clif->pActionRequest_sub(sd, 0x07, bl->id, iTimer->gettick());
+ clif->pActionRequest_sub(sd, 0x07, bl->id, timer->gettick());
break;
case BL_NPC:
if( sd->ud.skill_id < RK_ENCHANTBLADE && sd->ud.skilltimer != INVALID_TIMER ) {// TODO: should only work with none 3rd job skills
@@ -11326,7 +11326,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
{
uint16 skill_id, skill_lv;
int tmp, target_id;
- unsigned int tick = iTimer->gettick();
+ unsigned int tick = timer->gettick();
skill_lv = RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[0]);
skill_id = RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[1]);
@@ -11426,7 +11426,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
*------------------------------------------*/
void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uint16 skill_lv, uint16 skill_id, short x, short y, int skillmoreinfo)
{
- unsigned int tick = iTimer->gettick();
+ unsigned int tick = timer->gettick();
if( !(skill->get_inf(skill_id)&INF_GROUND_SKILL) )
return; //Using a target skill on the ground? WRONG.
@@ -12200,9 +12200,9 @@ void clif_parse_PartyMessage(int fd, struct map_session_data* sd)
if( battle_config.min_chat_delay )
{ //[Skotlex]
- if (DIFF_TICK(sd->cantalk_tick, iTimer->gettick()) > 0)
+ if (DIFF_TICK(sd->cantalk_tick, timer->gettick()) > 0)
return;
- sd->cantalk_tick = iTimer->gettick() + battle_config.min_chat_delay;
+ sd->cantalk_tick = timer->gettick() + battle_config.min_chat_delay;
}
party->send_message(sd, text, textlen);
@@ -13041,9 +13041,9 @@ void clif_parse_GuildMessage(int fd, struct map_session_data* sd)
if( battle_config.min_chat_delay )
{ //[Skotlex]
- if (DIFF_TICK(sd->cantalk_tick, iTimer->gettick()) > 0)
+ if (DIFF_TICK(sd->cantalk_tick, timer->gettick()) > 0)
return;
- sd->cantalk_tick = iTimer->gettick() + battle_config.min_chat_delay;
+ sd->cantalk_tick = timer->gettick() + battle_config.min_chat_delay;
}
if( sd->bg_id )
@@ -14834,7 +14834,7 @@ void clif_parse_Mail_send(int fd, struct map_session_data *sd)
return;
}
- if( DIFF_TICK(sd->cansendmail_tick, iTimer->gettick()) > 0 ) {
+ if( DIFF_TICK(sd->cansendmail_tick, timer->gettick()) > 0 ) {
clif->message(sd->fd,msg_txt(675)); //"Cannot send mails too fast!!."
clif->mail_send(fd, true); // fail
return;
@@ -14872,7 +14872,7 @@ void clif_parse_Mail_send(int fd, struct map_session_data *sd)
if( !intif->Mail_send(sd->status.account_id, &msg) )
mail->deliveryfail(sd, &msg);
- sd->cansendmail_tick = iTimer->gettick() + 1000; // 1 Second flood Protection
+ sd->cansendmail_tick = timer->gettick() + 1000; // 1 Second flood Protection
}
@@ -15411,11 +15411,11 @@ void clif_bossmapinfo(int fd, struct mob_data *md, short flag)
} else
WFIFOB(fd,2) = 2; // First Time
} else if (md->spawn_timer != INVALID_TIMER) { // Boss is Dead
- const struct TimerData * timer_data = iTimer->get_timer(md->spawn_timer);
+ const struct TimerData * timer_data = timer->get(md->spawn_timer);
unsigned int seconds;
int hours, minutes;
- seconds = DIFF_TICK(timer_data->tick, iTimer->gettick()) / 1000 + 60;
+ seconds = DIFF_TICK(timer_data->tick, timer->gettick()) / 1000 + 60;
hours = seconds / (60 * 60);
seconds = seconds - (60 * 60 * hours);
minutes = seconds / 60;
@@ -15961,9 +15961,9 @@ void clif_parse_BattleChat(int fd, struct map_session_data* sd)
return;
if( battle_config.min_chat_delay ) {
- if( DIFF_TICK(sd->cantalk_tick, iTimer->gettick()) > 0 )
+ if( DIFF_TICK(sd->cantalk_tick, timer->gettick()) > 0 )
return;
- sd->cantalk_tick = iTimer->gettick() + battle_config.min_chat_delay;
+ sd->cantalk_tick = timer->gettick() + battle_config.min_chat_delay;
}
bg->send_message(sd, text, textlen);
@@ -17397,11 +17397,11 @@ void clif_maptypeproperty2(struct block_list *bl,enum send_target t) {
p.flag.guild = 1;
p.flag.siege = map_flag_gvg2(bl->m) ? 1: 0;
p.flag.mineffect = 1;
- p.flag.nolockon = 0;
+ p.flag.nolockon = 1;
p.flag.countpk = map[bl->m].flag.pvp ? 1 : 0;
p.flag.nopartyformation = 0;
- p.flag.noitemconsumption = 0;
- p.flag.summonstarmiracle = 0;
+ p.flag.noitemconsumption = 1;
+ p.flag.summonstarmiracle = 1;
p.flag.bg = map[bl->m].flag.battleground ? 1 : 0;
clif->send(&p,sizeof(p),bl,t);
@@ -17909,8 +17909,8 @@ int do_init_clif(void) {
exit(EXIT_FAILURE);
}
- iTimer->add_timer_func_list(clif->clearunit_delayed_sub, "clif_clearunit_delayed_sub");
- iTimer->add_timer_func_list(clif->delayquit, "clif_delayquit");
+ timer->add_func_list(clif->clearunit_delayed_sub, "clif_clearunit_delayed_sub");
+ timer->add_func_list(clif->delayquit, "clif_delayquit");
clif->delay_clearunit_ers = ers_new(sizeof(struct block_list),"clif.c::delay_clearunit_ers",ERS_OPT_CLEAR);