viewing paste noseige | Diff

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418
# 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;
Viewed 1346 times, submitted by lighta.