Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: db/item_db.txt
- ===================================================================
- --- db/item_db.txt (revision 15050)
- +++ db/item_db.txt (working copy)
- @@ -5,11 +5,11 @@
- //
- // Healing Items
- //=============================================================
- -501,Red_Potion,Red Potion,0,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(45,65),0; },{},{}
- -502,Orange_Potion,Orange Potion,0,200,,100,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(105,145),0; },{},{}
- -503,Yellow_Potion,Yellow Potion,0,550,,130,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(175,235),0; },{},{}
- -504,White_Potion,White Potion,0,1200,,150,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(325,405),0; },{},{}
- -505,Blue_Potion,Blue Potion,0,5000,,150,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal 0,rand(40,60); },{},{}
- +501,Red_Potion,Red Potion,0,50,,70,,,,,0xFFFFFFFF,7,2,,5,1,1,,{ itemheal rand(45,65),0; },{},{}
- +502,Orange_Potion,Orange Potion,0,200,,100,,,,,0xFFFFFFFF,7,2,,,1,1,,{ itemheal rand(105,145),0; },{},{}
- +503,Yellow_Potion,Yellow Potion,0,550,,130,,,,,0xFFFFFFFF,7,2,,6,1,1,,{ itemheal rand(175,235),0; },{},{}
- +504,White_Potion,White Potion,0,1200,,150,,,,,0xFFFFFFFF,7,2,,7,1,1,,{ itemheal rand(325,405),0; },{},{}
- +505,Blue_Potion,Blue Potion,0,5000,,150,,,,,0xFFFFFFFF,7,2,,8,1,1,,{ itemheal 0,rand(40,60); },{},{}
- 506,Green_Potion,Green Potion,0,40,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_end SC_Poison; sc_end SC_Silence; sc_end SC_Blind; sc_end SC_Confusion; },{},{}
- 507,Red_Herb,Red Herb,0,18,,30,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(18,28),0; },{},{}
- 508,Yellow_Herb,Yellow Herb,0,40,,50,,,,,0xFFFFFFFF,7,2,,,,,,{ itemheal rand(38,58),0; },{},{}
- Index: db/refine_db.txt
- ===================================================================
- --- db/refine_db.txt (revision 15050)
- +++ db/refine_db.txt (working copy)
- @@ -8,3 +8,11 @@
- 3, 5,6, 100,100,100,100,100,100, 60, 40, 20, 20, // Lv.2 Weapons
- 5, 8,5, 100,100,100,100,100, 60, 50, 20, 20, 20, // Lv.3 Weapons
- 7,13,4, 100,100,100,100, 60, 40, 40, 20, 20, 10, // Lv.4 Weapons
- +//==================================================================
- +// - Potion Refining -
- +// By Squishyyy
- +// EffeciencyBonus for safe upgrade,EffeciencyBonus after safe limit,SafeLimit,Lv1,Lv2,Lv3...
- +100,100,4, 100,100,100,100, 60, 40, 40, 20, 20, 10, // Red Potions lv 5
- +100,100,4, 100,100,100,100, 60, 40, 40, 20, 20, 10, // Yellow Potions lv 6
- +100,100,4, 100,100,100,100, 60, 40, 40, 20, 20, 10, // White Potions lv 7
- +100,100,4, 100,100,100,100, 60, 40, 40, 20, 20, 10, // Blue Potions lv 8
- \ No newline at end of file
- Index: db/skill_db.txt
- ===================================================================
- --- db/skill_db.txt (revision 15050)
- +++ db/skill_db.txt (working copy)
- @@ -642,7 +642,9 @@
- //697,9,6,4,0,0x1,0,1,1,yes,0,0x2,0,magic,0, ALL_REVERSEORCISH,Reverse Orcish
- 698,0,6,4,0,0x01,0,1,1,no,0,0x2,0,none,0, ALL_WEWISH,Christmas Carol
- //699,0,0,0,0,0,0,9,0,no,0,0x2,0,none,0, ALL_SONKRAN,ALL_SONKRAN
- +999,0,6,4,0,0x1,0,10,1,no,0,0,0,weapon,0, CR_POTIONREFINE,Potion Refine
- +
- 1001,9,6,1,-1,0,0,1,1,no,0,0x1,0,weapon,0, KN_CHARGEATK,Charge Attack
- 1002,0,6,4,0,0x1,0,1,0,no,0,0x1,0,weapon,2, CR_SHRINK,Shrink
- 1003,0,0,0,0,0,0,1,0,no,0,0x1,0,weapon,0, AS_SONICACCEL,Sonic Acceleration
- Index: db/skill_require_db.txt
- ===================================================================
- --- db/skill_require_db.txt (revision 15050)
- +++ db/skill_require_db.txt (working copy)
- @@ -436,6 +436,8 @@
- 698,0,0,1,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //ALL_WEWISH#Christmas Carol
- +999,0,0,5,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //CR_POTIONREFINE#Potion Refine
- +
- 1001,0,0,40,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //KN_CHARGEATK#ƒ`ƒƒ?[ƒWƒAƒ^ƒbƒN#
- 1002,0,0,15,0,0,0,99,0,0,shield,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //CR_SHRINK#ƒVƒ…ƒŠƒ“ƒN#
- 1004,0,0,15,0,0,0,99,2,1,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //AS_VENOMKNIFE#ƒxƒiƒ€ƒiƒCƒt#
- Index: db/skill_tree.txt
- ===================================================================
- --- db/skill_tree.txt (revision 15050)
- +++ db/skill_tree.txt (working copy)
- @@ -1303,6 +1303,7 @@
- 4019,479,5,234,5,235,5,236,5,237,5,0,0 //CR_FULLPROTECTION#Full Protection#
- 4019,490,10,229,5,230,5,0,0,0,0,0,0 //CR_ACIDDEMONSTRATION#Acid Demonstration#
- 4019,491,2,0,0,0,0,0,0,0,0,0,0 //CR_CULTIVATION#Cultivation#
- +4019,999,10,228,5,0,0,0,0,0,0,0,0 //CR_REFINEPOTION#Potion Refine#
- 4019,410,1,0,0,0,0,0,0,0,0,0,0 //WE_CALLBABY#Call Baby#
- 4019,446,1,0,0,0,0,0,0,0,0,0,0 //AM_BERSERKPITCHER#Berserk Pitcher#
- 4019,496,1,228,10,0,0,0,0,0,0,0,0 //AM_TWILIGHT1#Twilight Alchemy 1#
- Index: src/map/clif.c
- ===================================================================
- --- src/map/clif.c (revision 15050)
- +++ src/map/clif.c (working copy)
- @@ -5500,8 +5500,49 @@
- int fd;
- int skilllv;
- int wlv;
- +// int ref;
- int refine_item[5];
- + nullpo_retr(0, sd);
- + skilllv = pc_checkskill(sd,CR_POTIONREFINE);
- + fd=sd->fd;
- +
- + refine_item[0] = pc_search_inventory(sd,507);
- + refine_item[1] = pc_search_inventory(sd,508);
- + refine_item[2] = pc_search_inventory(sd,509);
- + refine_item[3] = pc_search_inventory(sd,510);
- +
- + WFIFOHEAD(fd, MAX_INVENTORY * 13 + 4);
- + WFIFOW(fd,0)=0x221;
- + for(i=c=0;i<MAX_INVENTORY;i++){
- + if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].refine < skilllv &&
- + sd->status.inventory[i].identify && (sd->status.inventory[i].nameid >= 501 && sd->status.inventory[i].nameid < 506) &&
- + (wlv=itemdb_wlv(sd->status.inventory[i].nameid)) >=0){
- + WFIFOW(fd,c*13+ 4)=i+2;
- + WFIFOW(fd,c*13+ 6)=sd->status.inventory[i].nameid;
- + WFIFOW(fd,c*13+ 8)=0; //TODO: Wonder what are these for? Perhaps ID of weapon's crafter if any?
- + WFIFOW(fd,c*13+10)=0;
- + WFIFOB(fd,c*13+12)=c;
- + c++;
- + }
- + }
- + WFIFOW(fd,2)=c*13+4;
- + WFIFOSET(fd,WFIFOW(fd,2));
- + if (c > 0) {
- + sd->menuskill_id = CR_POTIONREFINE;
- + sd->menuskill_val = skilllv;
- + }
- + return 0;
- +}
- +
- +int clif_equip_refine_list(struct map_session_data *sd)
- +{
- + int i,c;
- + int fd;
- + int skilllv;
- + int wlv;
- + int refine_item[5];
- +
- nullpo_ret(sd);
- skilllv = pc_checkskill(sd,WS_WEAPONREFINE);
- @@ -5517,7 +5558,8 @@
- WFIFOW(fd,0)=0x221;
- for(i=c=0;i<MAX_INVENTORY;i++){
- if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].refine < skilllv &&
- - sd->status.inventory[i].identify && (wlv=itemdb_wlv(sd->status.inventory[i].nameid)) >=1 &&
- + sd->status.inventory[i].identify && !(sd->status.inventory[i].nameid >= 501 && sd->status.inventory[i].nameid < 506) &&
- + (wlv=itemdb_wlv(sd->status.inventory[i].nameid)) >=1 &&
- refine_item[wlv]!=-1 && !(sd->status.inventory[i].equip&0x0022)){
- WFIFOW(fd,c*13+ 4)=i+2;
- WFIFOW(fd,c*13+ 6)=sd->status.inventory[i].nameid;
- @@ -10357,7 +10399,7 @@
- {
- int idx;
- - if (sd->menuskill_id != WS_WEAPONREFINE) //Packet exploit?
- + if (sd->menuskill_id != WS_WEAPONREFINE && sd->menuskill_id != CR_POTIONREFINE) //Packet exploit?
- return;
- if (pc_istrading(sd)) {
- //Make it fail to avoid shop exploits where you sell something different than you see.
- @@ -10366,10 +10408,17 @@
- return;
- }
- idx = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
- + if (sd->menuskill_id == WS_WEAPONREFINE)
- + {
- skill_weaponrefine(sd, idx-2);
- sd->menuskill_val = sd->menuskill_id = 0;
- + }
- + else if (sd->menuskill_id == CR_POTIONREFINE)
- + {
- + skill_potionrefine(sd, idx-2);
- + sd->menuskill_val = sd->menuskill_id = 0;
- + }
- }
- -
- /*==========================================
- *
- *------------------------------------------*/
- @@ -14316,7 +14365,7 @@
- /// 0: Displays 'value' for 5 seconds.
- /// 1: Incremental counter (1 tick/second), negated 'value' specifies start value (e.g. using -10 lets the counter start at 10).
- /// 2: Decremental counter (1 tick/second), negated 'value' specifies start value (does not stop when reaching 0, but overflows).
- -/// 3: Decremental counter (1 tick/second), 'value' specifies start value (stops when reaching 0, displays at most 2 digits).
- +/// 3: Decremental counter (2 ticks/second), 'value' specifies start value (stops when reaching 0, displays at most 2 digits).
- /// value:
- /// Except for type 3 it is interpreted as seconds for displaying as DD:HH:MM:SS, HH:MM:SS, MM:SS or SS (leftmost '00' is not displayed).
- void clif_showdigit(struct map_session_data* sd, unsigned char type, int value)
- Index: src/map/clif.h
- ===================================================================
- --- src/map/clif.h (revision 15050)
- +++ src/map/clif.h (working copy)
- @@ -384,6 +384,7 @@
- int clif_item_identified(struct map_session_data *sd,int idx,int flag);
- int clif_item_repair_list(struct map_session_data *sd, struct map_session_data *dstsd);
- int clif_item_repaireffect(struct map_session_data *sd, int nameid, int flag);
- +int clif_equip_refine_list(struct map_session_data *sd);
- int clif_item_refine_list(struct map_session_data *sd);
- int clif_item_skill(struct map_session_data *sd,int skillid,int skilllv);
- Index: src/map/itemdb.c
- ===================================================================
- --- src/map/itemdb.c (revision 15050)
- +++ src/map/itemdb.c (working copy)
- @@ -371,7 +371,8 @@
- case IT_ARMOR:
- case IT_PETEGG:
- case IT_PETARMOR:
- - return 0;
- + case IT_HEALING:
- + return 0;
- default:
- return 1;
- }
- Index: src/map/pc.c
- ===================================================================
- --- src/map/pc.c (revision 15050)
- +++ src/map/pc.c (working copy)
- @@ -6207,8 +6207,9 @@
- *------------------------------------------*/
- int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
- {
- - int i, bonus;
- -
- + int i, index, bonus;
- + for(index = 0; index < ARRAYLENGTH(sd->status.inventory) && sd->status.inventory[index].refine; index++)
- + {
- if(hp) {
- bonus = 100 + (sd->battle_status.vit<<1)
- + pc_checkskill(sd,SM_RECOVERY)*10
- @@ -6216,6 +6217,20 @@
- // A potion produced by an Alchemist in the Fame Top 10 gets +50% effect [DracoRPG]
- if (potion_flag > 1)
- bonus += bonus*(potion_flag-1)*50/100;
- +
- + if(sd->inventory_data[index]->type == IT_HEALING) {
- + int r,wlv = sd->inventory_data[index]->wlv;
- + struct item *id=&sd->status.inventory[index];
- +
- + if (wlv >= MAX_REFINE_BONUS)
- + wlv = MAX_REFINE_BONUS - 1;
- + bonus = (r=sd->status.inventory[index].refine)*potionrefinebonus[wlv][0];
- + if((r-=potionrefinebonus[wlv][2])>0) //Overrefine bonus.
- + id->refine = r*potionrefinebonus[wlv][0];
- + bonus += bonus;
- + }
- + }
- +
- //All item bonuses.
- bonus += sd->itemhealrate2;
- //Item Group bonuses
- Index: src/map/skill.c
- ===================================================================
- --- src/map/skill.c (revision 15050)
- +++ src/map/skill.c (working copy)
- @@ -4324,9 +4324,13 @@
- // Weapon Refining [Celest]
- case WS_WEAPONREFINE:
- if(sd)
- + clif_equip_refine_list(sd);
- + break;
- + // Potion Refining (Squishyyy)
- + case CR_POTIONREFINE:
- + if(sd)
- clif_item_refine_list(sd);
- break;
- -
- case MC_VENDING:
- if(sd)
- { //Prevent vending of GMs with unnecessary Level to trade/drop. [Skotlex]
- @@ -9338,7 +9342,7 @@
- void skill_weaponrefine (struct map_session_data *sd, int idx)
- {
- int i = 0, ep = 0, per;
- - int material[5] = { 0, 1010, 1011, 984, 984 };
- + int material[5] = { 985, 1010, 1011, 984, 984 };
- struct item *item;
- nullpo_retv(sd);
- @@ -9403,7 +9408,61 @@
- }
- }
- }
- +//==========================================
- +/* Potion Refine - Squishyyy
- +*------------------------------------------*/
- +void skill_potionrefine (struct map_session_data *sd, int idx)
- +{
- + int i = 0, ep = 0, per;
- + int material[4] = { 507, 508, 509, 510 };
- + struct item *item;
- + nullpo_retv(sd);
- +
- + if (idx >= 0 && idx < MAX_INVENTORY)
- + {
- + struct item_data *ditem = sd->inventory_data[idx];
- + item = &sd->status.inventory[idx];
- +
- + if(item->nameid > 0 && ditem->type == IT_HEALING)
- + {
- + if( item->refine >= sd->menuskill_val
- + || item->refine >= MAX_REFINE // if it's no longer refineable
- + //|| ditem->flag.no_refine // if the item isn't refinable
- + || (i = pc_search_inventory(sd, material [ditem->wlv-5])) < 0 )
- + {
- + clif_skill_fail(sd,sd->menuskill_id,0,0);
- + return;
- + }
- +
- + per = percentrefinery [ditem->wlv][(int)item->refine];
- + per += (((signed int)sd->status.job_level)-50)/2;
- +
- + pc_delitem(sd, i, 1, 0, 0);
- + if (per > rand() % 100) {
- + item->refine++;
- + if(item->equip) {
- + ep = item->equip;
- + pc_unequipitem(sd,idx,3);
- + }
- + clif_refine(sd->fd,0,idx,item->refine);
- + clif_delitem(sd,idx,1,3);
- + clif_additem(sd,idx,1,0);
- + if (ep)
- + pc_equipitem(sd,idx,ep);
- + clif_misceffect(&sd->bl,3);
- + } else {
- + item->refine = 0;
- + if(item->equip)
- + pc_unequipitem(sd,idx,3);
- + clif_refine(sd->fd,1,idx,item->refine);
- + pc_delitem(sd,idx,1,0,2);
- + clif_misceffect(&sd->bl,2);
- + clif_emotion(&sd->bl, E_OMG);
- + }
- + }
- + }
- +}
- /*==========================================
- *
- *------------------------------------------*/
- Index: src/map/skill.h
- ===================================================================
- --- src/map/skill.h (revision 15050)
- +++ src/map/skill.h (working copy)
- @@ -319,6 +319,7 @@
- void skill_repairweapon(struct map_session_data *sd, int idx);
- void skill_identify(struct map_session_data *sd,int idx);
- void skill_weaponrefine(struct map_session_data *sd,int idx); // [Celest]
- +void skill_potionrefine(struct map_session_data *sd,int idx); //Squishyyy
- int skill_autospell(struct map_session_data *md,int skillid);
- int skill_calc_heal(struct block_list *src, struct block_list *target, int skill_id, int skill_lv, bool heal);
- @@ -994,6 +995,7 @@
- ALL_REVERSEORCISH,
- ALL_WEWISH,
- ALL_SONKRAN,
- + CR_POTIONREFINE = 999,
- KN_CHARGEATK = 1001,
- CR_SHRINK,
- @@ -1321,6 +1323,7 @@
- RETURN_TO_ELDICASTES,
- ALL_BUYING_STORE,
- +
- HLIF_HEAL = 8001,
- HLIF_AVOID,
- HLIF_BRAIN,
- Index: src/map/status.c
- ===================================================================
- --- src/map/status.c (revision 15050)
- +++ src/map/status.c (working copy)
- @@ -53,7 +53,8 @@
- static int sp_coefficient[CLASS_COUNT];
- static int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE]; //[blackhole89]
- static int refinebonus[MAX_REFINE_BONUS][3]; // ¸˜Bƒ{[ƒiƒXƒe[ƒuƒ‹(refine_db.txt)
- -int percentrefinery[5][MAX_REFINE+1]; // ¸˜B¬Œ÷—¦(refine_db.txt)
- +int potionrefinebonus[MAX_REFINE_BONUS][3];//potion refining - Squishyyy
- +int percentrefinery[10][MAX_REFINE+1]; // ¸˜B¬Œ÷—¦(refine_db.txt)
- static int atkmods[3][MAX_WEAPON_TYPE]; // •ŠíATKƒTƒCƒYC³(size_fix.txt)
- static char job_bonus[CLASS_COUNT][MAX_LEVEL];
- @@ -614,9 +615,10 @@
- {
- if (lv >= 0 && lv < 5 && type >= 0 && type < 3)
- return refinebonus[lv][type];
- + if (lv >= 0 && lv < 5 && type == 0)
- + return potionrefinebonus[lv][type];
- return 0;
- }
- -
- //Sets HP to given value. Flag is the flag passed to status_heal in case
- //final value is higher than current (use 2 to make a healing effect display
- //on players) It will always succeed (overrides Berserk block), but it can't kill.
- @@ -7817,7 +7819,8 @@
- percentrefinery[i][j]=0; //Slot MAX+1 always has 0% success chance [Skotlex]
- refinebonus[i][0]=0; // stats per safe-upgrade
- refinebonus[i][1]=0; // stats after safe-limit
- - refinebonus[i][2]=10; // safe limit
- + refinebonus[i][2]=0; // safe limit
- + refinebonus[i][3]=10;
- }
- // read databases
- Index: src/map/status.h
- ===================================================================
- --- src/map/status.h (revision 15050)
- +++ src/map/status.h (working copy)
- @@ -13,7 +13,7 @@
- //Use this to refer the max refinery level [Skotlex]
- #define MAX_REFINE 10
- -#define MAX_REFINE_BONUS 5
- +#define MAX_REFINE_BONUS 6
- extern unsigned long StatusChangeFlagTable[];
- @@ -930,7 +930,8 @@
- extern int current_equip_item_index;
- extern int current_equip_card_id;
- -extern int percentrefinery[5][MAX_REFINE+1]; //The last slot always has a 0% success chance [Skotlex]
- +extern int percentrefinery[10][MAX_REFINE+1]; //The last slot always has a 0% success chance [Skotlex]
- +extern int potionrefinebonus[MAX_REFINE_BONUS][3];
- //Mode definitions to clear up code reading. [Skotlex]
- enum e_mode
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement