viewing paste Unknown #1454 | Diff

Posted on the | Last edited on
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
# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /home/lighta/Documents/Myscript/RO/Servs/ra2
# 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: src/map/atcommand.c
--- src/map/atcommand.c Base (BASE)
+++ src/map/atcommand.c Locally Modified (Based On LOCAL)
@@ -2530,8 +2530,9 @@
        clif_displaymessage(fd, msg_txt(1012)); // Please enter an amount (usage: @zeny <amount>).
        return -1;
    }
-
-   new_zeny = sd->status.zeny + zeny;
+   pc_getzeny(sd,zeny,LOG_TYPE_COMMAND);
+/* @TODO all this pretty much useless since already handle well in pc_getzeny or pc_payzeny ...
+   new_zeny = pc_getzeny(sd,zeny,LOG_TYPE_COMMAND);
    if (zeny > 0 && (zeny > MAX_ZENY || new_zeny > MAX_ZENY)) // fix positiv overflow
        new_zeny = MAX_ZENY;
    else if (zeny < 0 && (zeny < -MAX_ZENY || new_zeny < 0)) // fix negativ overflow
@@ -2548,6 +2549,7 @@
            clif_displaymessage(fd, msg_txt(149)); // Unable to increase the number/value.
        return -1;
    }
+ */
 
    return 0;
 }
Index: src/map/battle.c
--- src/map/battle.c Base (BASE)
+++ src/map/battle.c Locally Modified (Based On LOCAL)
@@ -4403,7 +4403,7 @@
            if( sd ) {
                if ( md.damage > sd->status.zeny )
                    md.damage = sd->status.zeny;
-               pc_payzeny(sd, md.damage);
+               pc_payzeny(sd, md.damage,LOG_TYPE_STEAL);
            }
        break;
    }
Index: src/map/buyingstore.c
--- src/map/buyingstore.c Base (BASE)
+++ src/map/buyingstore.c Locally Modified (Based On LOCAL)
@@ -366,17 +366,14 @@
        ARR_FIND( 0, pl_sd->buyingstore.slots, listidx, pl_sd->buyingstore.items[listidx].nameid == nameid );
        zeny = amount*pl_sd->buyingstore.items[listidx].price;
 
-       // log
-       log_zeny(sd, LOG_TYPE_BUYING_STORE, pl_sd, zeny);
-
        // move item
        pc_additem(pl_sd, &sd->status.inventory[index], amount, LOG_TYPE_BUYING_STORE);
        pc_delitem(sd, index, amount, 1, 0, LOG_TYPE_BUYING_STORE);
        pl_sd->buyingstore.items[listidx].amount-= amount;
 
        // pay up
-       pc_payzeny(pl_sd, zeny);
-       pc_getzeny(sd, zeny);
+       pc_payzeny(pl_sd, zeny, LOG_TYPE_BUYING_STORE);
+       pc_getzeny(sd, zeny, LOG_TYPE_BUYING_STORE);
        pl_sd->buyingstore.zenylimit-= zeny;
 
        // notify clients
Index: src/map/clif.c
--- src/map/clif.c Base (BASE)
+++ src/map/clif.c Locally Modified (Based On LOCAL)
@@ -14170,8 +14170,7 @@
        pc_delitem(sd, sd->auction.index, sd->auction.amount, 1, 6, LOG_TYPE_AUCTION);
        sd->auction.amount = 0;
 
-       log_zeny(sd, LOG_TYPE_AUCTION, sd, -zeny);
-       pc_payzeny(sd, zeny);
+       pc_payzeny(sd, zeny, LOG_TYPE_AUCTION);
    }
 }
 
@@ -14215,8 +14214,7 @@
    else if ( CheckForCharServer() ) // char server is down (bugreport:1138)
        clif_Auction_message(fd, 0); // You have failed to bid into the auction
    else {
-       log_zeny(sd, LOG_TYPE_AUCTION, sd, -bid);
-       pc_payzeny(sd, bid);
+       pc_payzeny(sd, bid, LOG_TYPE_AUCTION);
        intif_Auction_bid(sd->status.char_id, sd->status.name, auction_id, bid);
    }
 }
Index: src/map/intif.c
--- src/map/intif.c Base (BASE)
+++ src/map/intif.c Locally Modified (Based On LOCAL)
@@ -1827,8 +1827,7 @@
        clif_Auction_message(sd->fd, 4);
        pc_additem(sd, &auction.item, auction.item.amount, LOG_TYPE_AUCTION);
 
-       log_zeny(sd, LOG_TYPE_AUCTION, sd, zeny);
-       pc_getzeny(sd, zeny);
+       pc_getzeny(sd, zeny, LOG_TYPE_AUCTION);
    }
 }
 
@@ -1925,8 +1924,7 @@
    clif_Auction_message(sd->fd, result);
    if( bid > 0 )
    {
-       log_zeny(sd, LOG_TYPE_AUCTION, sd, bid);
-       pc_getzeny(sd, bid);
+       pc_getzeny(sd, bid, LOG_TYPE_AUCTION);
    }
    if( result == 1 )
    { // To update the list, display your buy list
Index: src/map/mail.c
--- src/map/mail.c Base (BASE)
+++ src/map/mail.c Locally Modified (Based On LOCAL)
@@ -48,9 +48,7 @@
 
    if (flag && sd->mail.zeny > 0)
    {  //Zeny send
-       log_zeny(sd, LOG_TYPE_MAIL, sd, -sd->mail.zeny);
-
-       sd->status.zeny -= sd->mail.zeny;
+       pc_payzeny(sd,sd->mail.zeny,LOG_TYPE_MAIL);
    }
    sd->mail.zeny = 0;
    clif_updatestatus(sd, SP_ZENY);
@@ -140,8 +138,7 @@
 
    if( zeny > 0 )
    {  //Zeny receive
-       log_zeny(sd, LOG_TYPE_MAIL, sd, zeny);
-       pc_getzeny(sd, zeny);
+       pc_getzeny(sd, zeny,LOG_TYPE_MAIL);
    }
 }
 
@@ -170,11 +167,7 @@
 
    if( msg->zeny > 0 )
    {
-       //Zeny receive (due to failure)
-       log_zeny(sd, LOG_TYPE_MAIL, sd, msg->zeny);
-
-       sd->status.zeny += msg->zeny;
-       clif_updatestatus(sd, SP_ZENY);
+       pc_getzeny(sd,msg->zeny,LOG_TYPE_MAIL); //Zeny receive (due to failure)
    }
    
    clif_Mail_send(sd->fd, true);
Index: src/map/mob.c
--- src/map/mob.c Base (BASE)
+++ src/map/mob.c Locally Modified (Based On LOCAL)
@@ -2306,7 +2306,7 @@
                }
            }
            if(zeny) // zeny from mobs [Valaris]
-               pc_getzeny(tmpsd[i], zeny);
+               pc_getzeny(tmpsd[i], zeny, LOG_TYPE_PICKDROP_MONSTER);
        }
    }
 
@@ -2442,7 +2442,7 @@
            if( sd->bonus.get_zeny_num && rnd()%100 < sd->bonus.get_zeny_rate ) {
                i = sd->bonus.get_zeny_num > 0 ? sd->bonus.get_zeny_num : -md->level * sd->bonus.get_zeny_num;
                if (!i) i = 1;
-               pc_getzeny(sd, 1+rnd()%i);
+               pc_getzeny(sd, 1+rnd()%i, LOG_TYPE_OTHER);
            }
        }
 
Index: src/map/npc.c
--- src/map/npc.c Base (BASE)
+++ src/map/npc.c Locally Modified (Based On LOCAL)
@@ -1519,12 +1519,8 @@
    if( pc_inventoryblank(sd) < new_ )
        return 3;   // Not enough space to store items
 
-   //Logs (S)hopping Zeny [Lupus]
-   log_zeny(sd, LOG_TYPE_NPC, sd, -(int)z);
-   //Logs
+   pc_payzeny(sd,(int)z,LOG_TYPE_NPC);
 
-   pc_payzeny(sd,(int)z);
-
    for( i = 0; i < n; ++i )
    {
        int nameid = item_list[i*2+1];
@@ -1690,12 +1686,8 @@
    if( z > MAX_ZENY )
        z = MAX_ZENY;
 
-   //Logs (S)hopping Zeny [Lupus]
-   log_zeny(sd, LOG_TYPE_NPC, sd, (int)z);
-   //Logs
+   pc_getzeny(sd, (int)z, LOG_TYPE_NPC);
 
-   pc_getzeny(sd, (int)z);
-
    // custom merchant shop exp bonus
    if( battle_config.shop_exp > 0 && z > 0 && ( skill = pc_checkskill(sd,MC_OVERCHARGE) ) > 0)
    {
Index: src/map/party.c
--- src/map/party.c Base (BASE)
+++ src/map/party.c Locally Modified (Based On LOCAL)
@@ -949,7 +949,7 @@
        pc_gainexp(sd[i], src, base_exp, job_exp, false);
 
        if (zeny) // zeny from mobs [Valaris]
-           pc_getzeny(sd[i],zeny);
+           pc_getzeny(sd[i],zeny,LOG_TYPE_OTHER);
    }
    return 0;
 }
Index: src/map/pc.c
--- src/map/pc.c Base (BASE)
+++ src/map/pc.c Locally Modified (Based On LOCAL)
@@ -3591,7 +3591,7 @@
 /*==========================================
  * attempts to remove zeny from player (sd)
  *------------------------------------------*/
-int pc_payzeny(struct map_session_data *sd,int zeny)
+int pc_payzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type)
 {
    nullpo_ret(sd);
 
@@ -3607,6 +3607,7 @@
    sd->status.zeny -= zeny;
    clif_updatestatus(sd,SP_ZENY);
 
+   log_zeny(sd, type, sd, -zeny);
    if( zeny > 0 && sd->state.showzeny ) {
        char output[255];
        sprintf(output, "Removed %dz.", zeny);
@@ -3706,7 +3707,7 @@
 /*==========================================
  * Attempts to give zeny to player (sd)
  *------------------------------------------*/
-int pc_getzeny(struct map_session_data *sd,int zeny)
+int pc_getzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type)
 {
    nullpo_ret(sd);
 
@@ -3722,6 +3723,7 @@
    sd->status.zeny += zeny;
    clif_updatestatus(sd,SP_ZENY);
 
+   log_zeny(sd, type, sd, zeny);
    if( zeny > 0 && sd->state.showzeny ) {
        char output[255];
        sprintf(output, "Gained %dz.", zeny);
@@ -4574,8 +4576,7 @@
    {
        int amount = md->level*10 + rnd()%100;
 
-       log_zeny(sd, LOG_TYPE_STEAL, sd, amount);
-       pc_getzeny(sd, amount);
+       pc_getzeny(sd, amount, LOG_TYPE_STEAL);
        md->state.steal_coin_flag = 1;
        return 1;
    }
@@ -6651,7 +6652,7 @@
        {
            base_penalty = (unsigned int)((double)sd->status.zeny * (double)battle_config.zeny_penalty / 10000.);
            if(base_penalty)
-               pc_payzeny(sd, base_penalty);
+               pc_payzeny(sd, base_penalty, LOG_TYPE_OTHER); //@TODO that type suck
        }
    }
 
Index: src/map/pc.h
--- src/map/pc.h Base (BASE)
+++ src/map/pc.h Locally Modified (Based On LOCAL)
@@ -695,9 +695,9 @@
 int pc_checkadditem(struct map_session_data*,int,int);
 int pc_inventoryblank(struct map_session_data*);
 int pc_search_inventory(struct map_session_data *sd,int item_id);
-int pc_payzeny(struct map_session_data*,int);
+int pc_payzeny(struct map_session_data*,int, enum e_log_pick_type type);
 int pc_additem(struct map_session_data*,struct item*,int,e_log_pick_type);
-int pc_getzeny(struct map_session_data*,int);
+int pc_getzeny(struct map_session_data*,int, enum e_log_pick_type);
 int pc_delitem(struct map_session_data*,int,int,int,short,e_log_pick_type);
 
 // Special Shop System
Index: src/map/script.c
--- src/map/script.c Base (BASE)
+++ src/map/script.c Locally Modified (Based On LOCAL)
@@ -10346,7 +10346,7 @@
            {// no zeny to cover set fee
                break;
            }
-           pc_payzeny(sd, cd->zeny);
+           pc_payzeny(sd, cd->zeny, LOG_TYPE_NPC);
        }
 
        mapreg_setreg(reference_uid(add_str("$@warpwaitingpc"), i), sd->bl.id);
Index: src/map/skill.c
--- src/map/skill.c Base (BASE)
+++ src/map/skill.c Locally Modified (Based On LOCAL)
@@ -4961,7 +4961,7 @@
        break;
    case SA_FORTUNE:
        clif_skill_nodamage(src,bl,skillid,skilllv,1);
-       if(sd) pc_getzeny(sd,status_get_lv(bl)*100);
+       if(sd) pc_getzeny(sd,status_get_lv(bl)*100,LOG_TYPE_OTHER);
        break;
    case SA_TAMINGMONSTER:
        clif_skill_nodamage(src,bl,skillid,skilllv,1);
@@ -13134,7 +13134,7 @@
                req.zeny = 0; //Zeny is reduced on skill_attack.
            if( sd->status.zeny < req.zeny )
                req.zeny = sd->status.zeny;
-           pc_payzeny(sd,req.zeny);
+           pc_payzeny(sd,req.zeny,LOG_TYPE_OTHER); //@Need proper type
        }
    }
 
Index: src/map/trade.c
--- src/map/trade.c Base (BASE)
+++ src/map/trade.c Locally Modified (Based On LOCAL)
@@ -580,20 +580,11 @@
 
    if( sd->deal.zeny || tsd->deal.zeny )
    {
-       sd->status.zeny += tsd->deal.zeny - sd->deal.zeny;
-       tsd->status.zeny += sd->deal.zeny - tsd->deal.zeny;
+       pc_getzeny(sd,tsd->deal.zeny - sd->deal.zeny,LOG_TYPE_TRADE);
+       pc_getzeny(tsd,sd->deal.zeny - tsd->deal.zeny,LOG_TYPE_TRADE);
 
-       //Logs Zeny (T)rade [Lupus]
-       if( sd->deal.zeny )
-           log_zeny(tsd, LOG_TYPE_TRADE, sd, sd->deal.zeny);
-       if( tsd->deal.zeny )
-           log_zeny(sd, LOG_TYPE_TRADE, tsd, tsd->deal.zeny);
-
        sd->deal.zeny = 0;
        tsd->deal.zeny = 0;
-
-       clif_updatestatus(sd, SP_ZENY);
-       clif_updatestatus(tsd, SP_ZENY);
    }
    
    sd->state.deal_locked = 0;
Index: src/map/vending.c
--- src/map/vending.c Base (BASE)
+++ src/map/vending.c Locally Modified (Based On LOCAL)
@@ -168,13 +168,10 @@
        }
    }
 
-   //Logs (V)ending Zeny [Lupus]
-   log_zeny(vsd, LOG_TYPE_VENDING, sd, (int)z);
-
-   pc_payzeny(sd, (int)z);
+   pc_payzeny(sd, (int)z, LOG_TYPE_VENDING);
    if( battle_config.vending_tax )
        z -= z * (battle_config.vending_tax/10000.);
-   pc_getzeny(vsd, (int)z);
+   pc_getzeny(vsd, (int)z, LOG_TYPE_VENDING);
 
    for( i = 0; i < count; i++ )
    {
Viewed 1368 times, submitted by lighta.