src/map/pc.h
int invincible_timer;
unsigned int canlog_tick;
unsigned int canuseitem_tick; // [skotlex]
+ unsigned int warpgodelay_tick;
unsigned int canusecashfood_tick;
unsigned int canequip_tick; // [inkfish]
unsigned int cantalk_tick;
unsigned int cansendmail_tick; // [Mail System Flood Protection]
unsigned int ks_floodprotect_tick; // [Kill Steal Protection]
src/map/pc.c
sd->canuseitem_tick = tick;
+ sd->warpgodelay_tick = tick;
sd->canusecashfood_tick = tick;
sd->canequip_tick = tick;
sd->cantalk_tick = tick;
sd->cansendmail_tick = tick;
src/map/pc.c
/*==========================================
* Invoked when a player has received damage
*------------------------------------------*/
void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int hp, unsigned int sp)
{
+ unsigned int tick = gettick();
+ int warpgodelaycd = 10000; //This is the delay in milliseconds you can set what ever delay you want
+ 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
/*==========================================
* @rura, @warp, @mapmove
*------------------------------------------*/
ACMD_FUNC(mapmove)
{
+ unsigned int tick = gettick();
char map_name[MAP_NAME_LENGTH_EXT];
unsigned short mapindex;
short x = 0, y = 0;
int m = -1;
nullpo_retr(-1, sd);
memset(map_name, '\0', sizeof(map_name));
if (!message || !*message ||
(sscanf(message, "%15s %hd %hd", map_name, &x, &y) < 3 &&
sscanf(message, "%15[^,],%hd,%hd", map_name, &x, &y) < 1)) {
clif_displaymessage(fd, "Please, enter a map (usage: @warp/@rura/@mapmove <mapname> <x> <y>).");
return -1;
}
+ if(DIFF_TICK(sd->warpgodelay_tick,tick)>0)
{
//This is for computing the delay if the cooldown or delay is not yet finish restrict using @warp
+ clif_displaymessage(fd,"There is a 10 seconds delay in using @warp command");
return 0;
}
/*==========================================
* @go [city_number or city_name] - Updated by Harbin
*------------------------------------------*/
ACMD_FUNC(go)
{
+ unsigned int tick = gettick();
int i;
int town;
char map_name[MAP_NAME_LENGTH];
int m;
const struct {
char map[MAP_NAME_LENGTH];
int x, y;
} data[] = {
{ MAP_PRONTERA, 156, 191 }, // 0=Prontera
{ MAP_MORROC, 156, 93 }, // 1=Morroc
{ MAP_GEFFEN, 119, 59 }, // 2=Geffen
{ MAP_PAYON, 162, 233 }, // 3=Payon
{ MAP_ALBERTA, 192, 147 }, // 4=Alberta
{ MAP_IZLUDE, 128, 114 }, // 5=Izlude
{ MAP_ALDEBARAN, 140, 131 }, // 6=Al de Baran
{ MAP_LUTIE, 147, 134 }, // 7=Lutie
{ MAP_COMODO, 209, 143 }, // 8=Comodo
{ MAP_YUNO, 157, 51 }, // 9=Yuno
{ MAP_AMATSU, 198, 84 }, // 10=Amatsu
{ MAP_GONRYUN, 160, 120 }, // 11=Gonryun
{ MAP_UMBALA, 89, 157 }, // 12=Umbala
{ MAP_NIFLHEIM, 21, 153 }, // 13=Niflheim
{ MAP_LOUYANG, 217, 40 }, // 14=Louyang
{ MAP_NOVICE, 53, 111 }, // 15=Training Grounds
{ MAP_JAIL, 23, 61 }, // 16=Prison
{ MAP_JAWAII, 249, 127 }, // 17=Jawaii
{ MAP_AYOTHAYA, 151, 117 }, // 18=Ayothaya
{ MAP_EINBROCH, 64, 200 }, // 19=Einbroch
{ MAP_LIGHTHALZEN, 158, 92 }, // 20=Lighthalzen
{ MAP_EINBECH, 70, 95 }, // 21=Einbech
{ MAP_HUGEL, 96, 145 }, // 22=Hugel
{ MAP_RACHEL, 130, 110 }, // 23=Rachel
{ MAP_VEINS, 216, 123 }, // 24=Veins
{ MAP_MOSCOVIA, 223, 184 }, // 25=Moscovia
{ MAP_MELLINA, 86, 32 }, // 26=Mellina
};
nullpo_retr(-1, sd);
+if(DIFF_TICK(sd->warpgodelay_tick,tick)>0)
{
//This is for computing the delay if the cooldown or delay is not yet finish restrict using @go
+ clif_displaymessage(fd,"There is a 10 seconds delay in using @go command");
return 0;
}
ung may mga (+) po add ko yan.