# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /home/lighta/Documents/Myscript/RO/Servs/rathena
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: athena-start
--- athena-start Base (BASE)
+++ athena-start Locally Modified (Based On LOCAL)
@@ -45,13 +45,22 @@
check_files
exec ./${L_SRV}&
+ echo $! > .${L_SRV}.pid
exec ./${C_SRV}&
+ echo $! > .${C_SRV}.pid
exec ./${M_SRV}&
+ echo $! > .${M_SRV}.pid
echo "Now Started Athena."
;;
'stop')
- ps ax | grep -E "${L_SRV}|${C_SRV}|${M_SRV}" | awk '{print $1}' | xargs kill
+ for i in .${L_SRV}.pid .${C_SRV}.pid .${M_SRV}.pid
+ do
+ if [ -e ./$i ]; then
+ kill $(cat $i)
+ rm $i
+ fi
+ done
;;
'restart')
$0 stop
Index: conf/battle/skill.conf
--- conf/battle/skill.conf Base (BASE)
+++ conf/battle/skill.conf Locally Modified (Based On LOCAL)
Index: src/char/inter.c
--- src/char/inter.c Base (BASE)
+++ src/char/inter.c Locally Modified (Based On LOCAL)
@@ -378,10 +378,10 @@
unsigned char *geoip_cache;
void geoip_readdb(void){
struct stat bufa;
- FILE *db=fopen("./db/GeoIP.dat","r");
+ FILE *db=fopen("./db/GeoIP.dat","rb");
fstat(fileno(db), &bufa);
geoip_cache = (unsigned char *) malloc(sizeof(unsigned char) * bufa.st_size);
- if(fread(geoip_cache, sizeof(unsigned char), bufa.st_size, db) != bufa.st_size) { ShowError("geoip_cache reading didn't read all elements"); }
+ if(fread(geoip_cache, sizeof(unsigned char), bufa.st_size, db) != bufa.st_size) { ShowError("geoip_cache reading didn't read all elements \n"); }
fclose(db);
ShowStatus("Finished Reading "CL_GREEN"GeoIP"CL_RESET" Database.\n");
}
Index: src/common/core.c
--- src/common/core.c Base (BASE)
+++ src/common/core.c Locally Modified (Based On LOCAL)
@@ -20,7 +20,7 @@
#ifndef _WIN32
#include <unistd.h>
#else
-#include "../common/winapi.h" // Console close event handling
+#include "winapi.h" // Console close event handling
#endif
Index: src/common/grfio.c
--- src/common/grfio.c Base (BASE)
+++ src/common/grfio.c Locally Modified (Based On LOCAL)
@@ -403,7 +403,7 @@
declen = ftell(in);
fseek(in,0,SEEK_SET);
buf2 = (unsigned char *)aMalloc(declen+1); // +1 for resnametable zero-termination
- if(fread(buf2, 1, declen, in) != declen) printf("An error occured in fread grfio_reads, fname=%s \n",fname);
+ if(fread(buf2, 1, declen, in) != declen) ShowError("An error occured in fread grfio_reads, fname=%s \n",fname);
fclose(in);
if( size )
@@ -425,7 +425,7 @@
int fsize = entry->srclen_aligned;
unsigned char *buf = (unsigned char *)aMalloc(fsize);
fseek(in, entry->srcpos, 0);
- if(fread(buf, 1, fsize, in) != fsize) printf("An error occured in fread in grfio_reads, grfname=%s\n",grfname);
+ if(fread(buf, 1, fsize, in) != fsize) ShowError("An error occured in fread in grfio_reads, grfname=%s\n",grfname);
fclose(in);
buf2 = (unsigned char *)aMalloc(entry->declen+1); // +1 for resnametable zero-termination
Index: src/login/login.c
--- src/login/login.c Base (BASE)
+++ src/login/login.c Locally Modified (Based On LOCAL)
Index: src/map/atcommand.c
--- src/map/atcommand.c Base (BASE)
+++ src/map/atcommand.c Locally Modified (Based On LOCAL)
@@ -2538,7 +2538,9 @@
if((ret=pc_getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL)) == 1)
clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value.
}
- else if((ret=pc_payzeny(sd,-zeny,LOG_TYPE_COMMAND,NULL)) == 1){
+ 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.
}
if(!ret) clif_displaymessage(fd, msg_txt(176)); //ret=0 mean cmd success
@@ -7585,14 +7587,14 @@
ACMD_FUNC(mapflag) {
#define checkflag( cmd ) if ( map[ sd->bl.m ].flag.cmd ) clif_displaymessage(sd->fd,#cmd)
#define setflag( cmd ) \
- if ( strcmp( flag_name , #cmd ) == 0 && ( flag == 0 || flag == 1 ) ){\
+ if ( strcmp( flag_name , #cmd ) == 0 ){\
map[ sd->bl.m ].flag.cmd = flag;\
sprintf(atcmd_output,"[ @mapflag ] %s flag has been set to %s",#cmd,flag?"On":"Off");\
clif_displaymessage(sd->fd,atcmd_output);\
return 0;\
}
unsigned char flag_name[100];
- int flag=9,i;
+ int flag=0,i;
nullpo_retr(-1, sd);
memset(flag_name, '\0', sizeof(flag_name));
Index: src/map/clif.c
--- src/map/clif.c Base (BASE)
+++ src/map/clif.c Locally Modified (Based On LOCAL)
@@ -5946,6 +5946,7 @@
int fd;
nullpo_retv(sd);
+ ShowInfo("Asked clif_item_skill \n");
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x147));
@@ -10175,9 +10176,6 @@
return;
}
- if (sd->sc.opt1 > 0 && sd->sc.opt1 != OPT1_STONEWAIT && sd->sc.opt1 != OPT1_BURNING)
- return;
-
//This flag enables you to use items while in an NPC. [Skotlex]
if (sd->npc_id) {
if (sd->npc_id != sd->npc_item_flag)
@@ -10192,6 +10190,7 @@
if(n <0 || n >= MAX_INVENTORY)
return;
+ ShowInfo("Passed clif_parse_UseItem \n");
if (!pc_useitem(sd,n))
clif_useitemack(sd,n,0,false); //Send an empty ack packet or the client gets stuck.
}
Index: src/map/homunculus.h
--- src/map/homunculus.h Base (BASE)
+++ src/map/homunculus.h Locally Modified (Based On LOCAL)
Index: src/map/pc.c
--- src/map/pc.c Base (BASE)
+++ src/map/pc.c Locally Modified (Based On LOCAL)
@@ -4008,6 +4008,7 @@
int nameid;
nullpo_ret(sd);
+ ShowInfo("In pc_isUseItem \n");
item = sd->inventory_data[n];
nameid = sd->status.inventory[n].nameid;
@@ -4181,13 +4182,23 @@
if( !pc_isUseitem(sd,n) )
return 0;
- //Prevent mass item usage. [Skotlex]
- if( DIFF_TICK(sd->canuseitem_tick, tick) > 0 ||
- (itemdb_iscashfood(sd->status.inventory[n].nameid) && DIFF_TICK(sd->canusecashfood_tick, tick) > 0)
- )
+ // Store information for later use before it is lost (via pc_delitem) [Paradox924X]
+ nameid = sd->inventory_data[n]->nameid;
+
+ if (nameid != ITEMID_NAUTHIZ && sd->sc.opt1 > 0 && sd->sc.opt1 != OPT1_STONEWAIT && sd->sc.opt1 != OPT1_BURNING)
return 0;
- if( sd->sc.count && (
+ ShowInfo("nameid = %d\n",nameid);
+ if( sd->sc.count){
+ if((nameid == ITEMID_NAUTHIZ) && ( //bugreport 6751
+ sd->sc.data[SC_FREEZE] ||
+ sd->sc.data[SC_STUN] ||
+ sd->sc.data[SC_DEEPSLEEP] ||
+ sd->sc.data[SC_STONE] ||
+ sd->sc.data[SC_CRYSTALIZE]
+ )
+ ) ; //let us continue
+ else if(
sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] ||
(sd->sc.data[SC_GRAVITATION] && sd->sc.data[SC_GRAVITATION]->val3 == BCT_SELF) ||
sd->sc.data[SC_TRICKDEAD] ||
@@ -4196,11 +4207,16 @@
sd->sc.data[SC__MANHOLE] ||
sd->sc.data[SC_KAGEHUMI] ||
(sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOITEM)
- ))
+ )
return 0;
+ }
+ ShowInfo("We passed status check \n");
- // Store information for later use before it is lost (via pc_delitem) [Paradox924X]
- nameid = sd->inventory_data[n]->nameid;
+ //Prevent mass item usage. [Skotlex]
+ if( DIFF_TICK(sd->canuseitem_tick, tick) > 0 ||
+ (itemdb_iscashfood(nameid) && DIFF_TICK(sd->canusecashfood_tick, tick) > 0)
+ )
+ return 0;
/* Items with delayed consume are not meant to work while in mounts except reins of mount(12622) */
if( sd->inventory_data[n]->flag.delay_consume ) {
@@ -4252,6 +4268,8 @@
}
}
+ ShowInfo("We reach here \n");
+
sd->itemid = sd->status.inventory[n].nameid;
sd->itemindex = n;
if(sd->catch_target_class != -1) //Abort pet catching.
@@ -4277,11 +4295,13 @@
potion_flag = 3; //Even more effective potions.
}
+ ShowInfo("We reach canuseitem \n");
//Update item use time.
sd->canuseitem_tick = tick + battle_config.item_use_interval;
if( itemdb_iscashfood(nameid) )
sd->canusecashfood_tick = tick + battle_config.cashfood_use_interval;
+ ShowInfo("We reached run_script \n");
run_script(script,0,sd->bl.id,fake_nd->bl.id);
potion_flag = 0;
return 1;
Index: src/map/script.c
--- src/map/script.c Base (BASE)
+++ src/map/script.c Locally Modified (Based On LOCAL)
@@ -10727,12 +10727,12 @@
{
int m,i;
const char *str;
- const char *val=NULL;
+ int val=0;
str=script_getstr(st,2);
i=script_getnum(st,3);
if(script_hasdata(st,4)){
- val=script_getstr(st,4);
+ val=script_getnum(st,4);
}
m = map_mapname2mapid(str);
if(m >= 0) {
@@ -10742,20 +10742,20 @@
case MF_NOSAVE: map[m].flag.nosave = 1; break;
case MF_NOBRANCH: map[m].flag.nobranch = 1; break;
case MF_NOPENALTY: map[m].flag.noexppenalty = 1; map[m].flag.nozenypenalty = 1; break;
- case MF_NOZENYPENALTY: map[m].flag.nozenypenalty = 1; break;
+ case MF_NOZENYPENALTY: map[m].flag.nozenypenalty = 1; break;
case MF_PVP:
map[m].flag.pvp = 1;
if( !battle_config.pk_mode ) {
map_foreachinmap(script_mapflag_pvp_sub,m,BL_PC);
}
break;
- case MF_PVP_NOPARTY: map[m].flag.pvp_noparty = 1; break;
- case MF_PVP_NOGUILD: map[m].flag.pvp_noguild = 1; break;
+ case MF_PVP_NOPARTY: map[m].flag.pvp_noparty = 1; break;
+ 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);
break;
- case MF_GVG_NOPARTY: map[m].flag.gvg_noparty = 1; break;
+ case MF_GVG_NOPARTY: map[m].flag.gvg_noparty = 1; break;
case MF_NOTRADE: map[m].flag.notrade = 1; break;
case MF_NOSKILL: map[m].flag.noskill = 1; break;
case MF_NOWARP: map[m].flag.nowarp = 1; break;
@@ -10774,34 +10774,34 @@
case MF_CLOUDS2: map[m].flag.clouds2 = 1; break;
case MF_FIREWORKS: map[m].flag.fireworks = 1; break;
case MF_GVG_CASTLE: map[m].flag.gvg_castle = 1; break;
- case MF_GVG_DUNGEON: map[m].flag.gvg_dungeon = 1; break;
- case MF_NIGHTENABLED: map[m].flag.nightenabled = 1; break;
+ case MF_GVG_DUNGEON: map[m].flag.gvg_dungeon = 1; break;
+ case MF_NIGHTENABLED: map[m].flag.nightenabled = 1; break;
case MF_NOBASEEXP: map[m].flag.nobaseexp = 1; break;
case MF_NOJOBEXP: map[m].flag.nojobexp = 1; break;
case MF_NOMOBLOOT: map[m].flag.nomobloot = 1; break;
case MF_NOMVPLOOT: map[m].flag.nomvploot = 1; break;
case MF_NORETURN: map[m].flag.noreturn = 1; break;
case MF_NOWARPTO: map[m].flag.nowarpto = 1; break;
- case MF_NIGHTMAREDROP: map[m].flag.pvp_nightmaredrop = 1; break;
+ case MF_NIGHTMAREDROP: map[m].flag.pvp_nightmaredrop = 1; break;
case MF_RESTRICTED:
- map[m].zone |= 1<<((int)atoi(val)+1);
+ map[m].zone |= 1<<(val+1);
map[m].flag.restricted=1;
break;
- case MF_NOCOMMAND: map[m].nocommand = (!val || atoi(val) <= 0) ? 100 : atoi(val); break;
+ case MF_NOCOMMAND: map[m].nocommand = (val <= 0) ? 100 : val; break;
case MF_NODROP: map[m].flag.nodrop = 1; break;
- case MF_JEXP: map[m].jexp = (!val || atoi(val) < 0) ? 100 : atoi(val); break;
- case MF_BEXP: map[m].bexp = (!val || atoi(val) < 0) ? 100 : atoi(val); break;
+ case MF_JEXP: map[m].jexp = (val <= 0) ? 100 : val; break;
+ case MF_BEXP: map[m].bexp = (val <= 0) ? 100 : val; break;
case MF_NOVENDING: map[m].flag.novending = 1; break;
case MF_LOADEVENT: map[m].flag.loadevent = 1; break;
case MF_NOCHAT: map[m].flag.nochat = 1; break;
- case MF_NOEXPPENALTY: map[m].flag.noexppenalty = 1; break;
+ case MF_NOEXPPENALTY: map[m].flag.noexppenalty = 1; break;
case MF_GUILDLOCK: map[m].flag.guildlock = 1; break;
case MF_TOWN: map[m].flag.town = 1; break;
case MF_AUTOTRADE: map[m].flag.autotrade = 1; break;
case MF_ALLOWKS: map[m].flag.allowks = 1; break;
- case MF_MONSTER_NOTELEPORT: map[m].flag.monster_noteleport = 1; break;
- case MF_PVP_NOCALCRANK: map[m].flag.pvp_nocalcrank = 1; break;
- case MF_BATTLEGROUND: map[m].flag.battleground = (!val || atoi(val) < 0 || atoi(val) > 2) ? 1 : atoi(val); break;
+ case MF_MONSTER_NOTELEPORT: map[m].flag.monster_noteleport = 1; break;
+ case MF_PVP_NOCALCRANK: map[m].flag.pvp_nocalcrank = 1; break;
+ case MF_BATTLEGROUND: map[m].flag.battleground = (val <= 0 || val > 2) ? 1 : val; break;
case MF_RESET: map[m].flag.reset = 1; break;
}
}
@@ -10813,12 +10813,12 @@
{
int m,i;
const char *str;
- const char *val=NULL;
+ int val=0;
str=script_getstr(st,2);
i=script_getnum(st,3);
if(script_hasdata(st,4)){
- val=script_getstr(st,4);
+ val=script_getnum(st,4);
}
m = map_mapname2mapid(str);
if(m >= 0) {
@@ -10828,7 +10828,7 @@
case MF_NOSAVE: map[m].flag.nosave = 0; break;
case MF_NOBRANCH: map[m].flag.nobranch = 0; break;
case MF_NOPENALTY: map[m].flag.noexppenalty = 0; map[m].flag.nozenypenalty = 0; break;
- case MF_NOZENYPENALTY: map[m].flag.nozenypenalty = 0; break;
+ case MF_NOZENYPENALTY: map[m].flag.nozenypenalty = 0; break;
case MF_PVP:
map[m].flag.pvp = 0;
clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
@@ -10839,7 +10839,7 @@
map[m].flag.gvg = 0;
clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
break;
- case MF_GVG_NOPARTY: map[m].flag.gvg_noparty = 0; break;
+ case MF_GVG_NOPARTY: map[m].flag.gvg_noparty = 0; break;
case MF_NOTRADE: map[m].flag.notrade = 0; break;
case MF_NOSKILL: map[m].flag.noskill = 0; break;
case MF_NOWARP: map[m].flag.nowarp = 0; break;
@@ -10858,17 +10858,17 @@
case MF_CLOUDS2: map[m].flag.clouds2 = 0; break;
case MF_FIREWORKS: map[m].flag.fireworks = 0; break;
case MF_GVG_CASTLE: map[m].flag.gvg_castle = 0; break;
- case MF_GVG_DUNGEON: map[m].flag.gvg_dungeon = 0; break;
- case MF_NIGHTENABLED: map[m].flag.nightenabled = 0; break;
+ case MF_GVG_DUNGEON: map[m].flag.gvg_dungeon = 0; break;
+ case MF_NIGHTENABLED: map[m].flag.nightenabled = 0; break;
case MF_NOBASEEXP: map[m].flag.nobaseexp = 0; break;
case MF_NOJOBEXP: map[m].flag.nojobexp = 0; break;
case MF_NOMOBLOOT: map[m].flag.nomobloot = 0; break;
case MF_NOMVPLOOT: map[m].flag.nomvploot = 0; break;
case MF_NORETURN: map[m].flag.noreturn = 0; break;
case MF_NOWARPTO: map[m].flag.nowarpto = 0; break;
- case MF_NIGHTMAREDROP: map[m].flag.pvp_nightmaredrop = 0; break;
+ case MF_NIGHTMAREDROP: map[m].flag.pvp_nightmaredrop = 0; break;
case MF_RESTRICTED:
- map[m].zone ^= 1<<((int)atoi(val)+1);
+ map[m].zone ^= 1<<(val+1);
if (map[m].zone == 0){
map[m].flag.restricted=0;
}
@@ -10880,14 +10880,14 @@
case MF_NOVENDING: map[m].flag.novending = 0; break;
case MF_LOADEVENT: map[m].flag.loadevent = 0; break;
case MF_NOCHAT: map[m].flag.nochat = 0; break;
- case MF_NOEXPPENALTY: map[m].flag.noexppenalty = 0; break;
+ case MF_NOEXPPENALTY: map[m].flag.noexppenalty = 0; break;
case MF_GUILDLOCK: map[m].flag.guildlock = 0; break;
case MF_TOWN: map[m].flag.town = 0; break;
case MF_AUTOTRADE: map[m].flag.autotrade = 0; break;
case MF_ALLOWKS: map[m].flag.allowks = 0; break;
- case MF_MONSTER_NOTELEPORT: map[m].flag.monster_noteleport = 0; break;
- case MF_PVP_NOCALCRANK: map[m].flag.pvp_nocalcrank = 0; break;
- case MF_BATTLEGROUND: map[m].flag.battleground = 0; break;
+ case MF_MONSTER_NOTELEPORT: map[m].flag.monster_noteleport = 0; break;
+ case MF_PVP_NOCALCRANK: map[m].flag.pvp_nocalcrank = 0; break;
+ case MF_BATTLEGROUND: map[m].flag.battleground = 0; break;
case MF_RESET: map[m].flag.reset = 0; break;
}
}
Index: src/map/skill.c
--- src/map/skill.c Base (BASE)
+++ src/map/skill.c Locally Modified (Based On LOCAL)
@@ -7315,7 +7315,7 @@
clif_skill_nodamage(src,bl,skillid,skilllv,
sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
if (hd)
- skill_blockhomun_start(hd, skillid, skill_get_time2(skillid,skilllv));
+ skill_blockhomun_start(hd, skillid, skill_get_cooldown(skillid,skilllv));
break;
case NPC_DRAGONFEAR:
Index: src/map/status.c
--- src/map/status.c Base (BASE)
+++ src/map/status.c Locally Modified (Based On LOCAL)
@@ -1542,6 +1542,7 @@
status = src?status_get_status_data(src):&dummy_status;
+ ShowInfo("Try useskill = %d\n",skill_num);
if (src && src->type != BL_PC && status_isdead(src))
return 0;