Update: Here are my edits that made my Map Server not to turn on so, I cannot really test the edit:
src/map/pc.h
unsigned int canuseitem_tick; // [skotlex]
unsigned int canusecashfood_tick;
Becomes like this:
unsigned int canuseitem_tick; // [skotlex]
unsigned int warpgodelay_tick;
unsigned int canusecashfood_tick;
src/map/pc.c
sd->canuseitem_tick = tick;
sd->canusecashfood_tick = tick;
Becomes like this:
sd->canuseitem_tick = tick;
sd->warpgodelay_tick = tick;
sd->canusecashfood_tick = tick;
src/map/pc.c
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);
else return;
Becomes like this:
void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int hp, unsigned int sp)
{
unsigned int tick = gettick();
int warpgodelaycd = 5000; //This is the delay in milliseconds
sd->warpgodelay_tick = tick+warpgodelaycd; //This is the timer
if (sp) clif_updatestatus(sd,SP_SP);
if (hp) clif_updatestatus(sd,SP_HP);
else return;
src/map/atcommand.c
ACMD_FUNC(go)
{
int i;
int town;
char map_name[MAP_NAME_LENGTH];
int m;
Becomes like this:
ACMD_FUNC(go)
{
unsigned int tick = gettick();
int i;
int town;
char map_name[MAP_NAME_LENGTH];
int m;
src/map/atcommand.c
};
nullpo_retr(-1, sd);
if( map[sd->bl.m].flag.nogo && battle_config.any_warp_GM_min_level > pc_isGM(sd) ) {
clif_displaymessage(sd->fd,"You can not use @go on this map.");
return 0;
}
Becomes like this:
};
nullpo_retr(-1, sd);
if(DIFF_TICK(sd->warpgodelay_tick,tick)>0)
{
clif_displaymessage(fd,"There is a 5 seconds delay in using @go command");
return 0;
}
if( map[sd->bl.m].flag.nogo && battle_config.any_warp_GM_min_level > pc_isGM(sd) ) {
clif_displaymessage(sd->fd,"You can not use @go on this map.");
return 0;
}
src/map/atcommand.c
ACMD_FUNC(mapmove)
{
unsigned int tick = gettick();
char map_name[MAP_NAME_LENGTH_EXT];
unsigned short mapindex;
int x = 0, y = 0;
int m = -1;
Becomes like this:
ACMD_FUNC(mapmove)
{
unsigned int tick = gettick();
char map_name[MAP_NAME_LENGTH_EXT];
unsigned short mapindex;
int x = 0, y = 0;
int m = -1;
src/map/atcommand.c
nullpo_retr(-1, sd);
memset(map_name, '0', sizeof(map_name));
if (!message || !*message ||
Becomes like this:
memset(map_name, '0', sizeof(map_name));
if(DIFF_TICK(sd->warpgodelay_tick,tick)>0)
{
clif_displaymessage(fd,"There is a 5 seconds delay in using @warp command");
return -1;
}
if (!message || !*message ||
src/map/unit.c
int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, short skill_lv, int casttime, int castcancel)
{
struct unit_data *ud;
struct status_data *tstatus;
Becomes like this:
int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, short skill_lv, int casttime, int castcancel)
{
int warpgodelaycd = 5000; //This is a delay in miliseconds
struct unit_data *ud;
struct status_data *tstatus;
src/map/unit.c
if (!src->prev) return 0; //Warped away!
}
if( casttime > 0 )
{
ud->skilltimer = add_timer( tick+casttime, skill_castend_id, src->id, 0 );
if( sd && pc_checkskill(sd,SA_FREECAST) > 0 )
Becomes like this:
if (!src->prev) return 0; //Warped away!
}
sd->warpgodelay_tick= tick+warpgodelaycd ;//The delay when they use skill
if( casttime > 0 )
{
ud->skilltimer = add_timer( tick+casttime, skill_castend_id, src->id, 0 );
if( sd && pc_checkskill(sd,SA_FREECAST) > 0 )