Advertisement
johnlol

Battle Refine

Jul 23rd, 2023
924
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VeriLog 4.09 KB | Gaming | 0 0
  1. /*
  2. ________________     ______            ________      
  3. ___    |_____  /________  /______      ___  __ \_____
  4. __  /| |  __  /_  __ \_  __ \  _ \     __  /_/ /  __ \
  5. _  ___ / /_/ / / /_/ /  /_/ /  __/     _  _, _// /_/ /
  6. /_/  |_\__,_/  \____//_.___/\___/      /_/ |_| \____/
  7.  
  8. */
  9. //===========================================================
  10. // Battle Refine Script
  11. // Created by: Johnlol
  12. //==================== What it does ==========================
  13. // Refines the players equipment at a 0.01% rate (by default)
  14. // when they kill any monster. This script has went through
  15. // some serious modification to go from the old 100 line
  16. // version to the small one you see in front of you.
  17. //============================================================
  18. -   script  BattleRefine    -1,{
  19.  
  20. OnNPCKillEvent:
  21.  
  22.     if (rand(1,100) == 1) { // You can change the '10000' to increase or decrease the chance of a battle refine.
  23.         set @refine,rand(1,20);
  24.         if (getequipisenableref(@refine) == 1 && getequiprefinerycnt(@refine) < 20) {
  25.             successrefitem(@refine);
  26.             announce "!~Battle Refine~!",bc_self,0xFFFF00;
  27.             specialeffect2 EF_REFINEOK;
  28.         }
  29.     }
  30.     end;
  31. }
  32. /*
  33. -   script  BattleRefine::BattleRefineScript1   -1,{
  34. OnNPCKillEvent:
  35. if (rand(1,100) > 100) // 100% chance to continue the script
  36. end;
  37. for (set .@i,0; .@i<11; set .@i,.@i+1){ // 11: Prevents infinity loop if nothing is equipped
  38. if (.@i<10) set .@j, rand(1,10);
  39. else set .@j, .@i-9;
  40. if (getequipisequiped(.@j) && getequiprefinerycnt(.@j) < 100){
  41. successrefitem .@j;
  42. end;
  43. }
  44. }
  45. end;
  46. }
  47. */
  48.  
  49. /*
  50. -   script  BattleRefine::BattleRefineScript1   -1,{
  51. OnNPCKillEvent:
  52. if (rand(1,100) > 5) end; // 5% chance to continue the script
  53. for (set .@i,0; .@i<20; set .@i,.@i+1) { // 20: Prevents infinity loop if nothing is equipped
  54. set .@j, rand(1,10);
  55. if (getequipisequiped(.@j) && getequiprefinerycnt(.@j) < 100) {
  56. successrefitem .@j;
  57. end;
  58. }
  59. }
  60. end;
  61. }
  62. */
  63. //EQI_HEAD_TOP (1)          - Upper Headear
  64. //EQI_ARMOR (2)             - Armor (jackets, robes)
  65. //EQI_HAND_L (3)            - Left hand (weapons, shields)
  66. //EQI_HAND_R (4)            - Right hand (weapons)
  67. //EQI_GARMENT (5)           - Garment (mufflers, hoods, manteaus)
  68. //EQI_SHOES (6)             - Footgear (shoes, boots)
  69. //EQI_ACC_L (7)             - Accessory 1
  70. //EQI_ACC_R (8)             - Accessory 2
  71. //EQI_HEAD_MID (9)          - Middle Headgear (masks, glasses)
  72. //EQI_HEAD_LOW (10)         - Lower Headgear (beards, some masks)
  73. //EQI_COSTUME_HEAD_LOW (11) - Lower Costume Headgear
  74. //EQI_COSTUME_HEAD_MID (12) - Middle Costume Headgear
  75. //EQI_COSTUME_HEAD_TOP (13) - Upper Costume Headgear
  76. //EQI_COSTUME_GARMENT (14)  - Costume Garment
  77. //EQI_AMMO (15)           - Arrow/Ammunition
  78. //EQI_SHADOW_ARMOR (16)     - Shadow Armor
  79. //EQI_SHADOW_WEAPON (17)    - Shadow Weapon
  80. //EQI_SHADOW_SHIELD (18)    - Shadow Shield
  81. //EQI_SHADOW_SHOES (19)     - Shadow Shoes
  82. //EQI_SHADOW_ACC_R (20)     - Shadow Accessory 2
  83. //EQI_SHADOW_ACC_L (21)     - Shadow Accessory 1
  84.  
  85. //EQI_COMPOUND_ON (-1)      - Item slot that calls this script (In context of item script)
  86. //EQI_ACC_L (0)             - Accessory 1
  87. //EQI_ACC_R (1)             - Accessory 2
  88. //EQI_SHOES (2)             - Footgear (shoes, boots)
  89. //EQI_GARMENT (3)           - Garment (mufflers, hoods, manteaux)
  90. //EQI_HEAD_LOW (4)          - Lower Headgear (beards, some masks)
  91. //EQI_HEAD_MID (5)          - Middle Headgear (masks, glasses)
  92. //EQI_HEAD_TOP (6)          - Upper Headgear
  93. //EQI_ARMOR (7)             - Armor (jackets, robes)
  94. //EQI_HAND_L (8)            - Left hand (weapons, shields)
  95. //EQI_HAND_R (9)            - Right hand (weapons)
  96. //EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear
  97. //EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear
  98. //EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear
  99. //EQI_COSTUME_GARMENT (13)  - Costume Garment
  100. //EQI_AMMO (14)           - Arrow/Ammunition
  101. //EQI_SHADOW_ARMOR (15)     - Shadow Armor
  102. //EQI_SHADOW_WEAPON (16)    - Shadow Weapon
  103. //EQI_SHADOW_SHIELD (17)    - Shadow Shield
  104. //EQI_SHADOW_SHOES (18)     - Shadow Shoes
  105. //EQI_SHADOW_ACC_R (19)     - Shadow Accessory 2
  106. //EQI_SHADOW_ACC_L (20)     - Shadow Accessory 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement