I'm running a Ragnarok project which I will be releasing in some time, and I was planning to have up to Level 5 and Level 6 Weapons and Shields.
So, first, I came up to think about how can I do that, so I realized I can't modify source to have 'em. Or at least, I don't know how to do it.
But, it's okay, that's not the problem, because I have found that making a script which increase atk or matk would work, depending on the weapon or defense or damage taken depending on armor or shield.
So, I added this to item scripts: (one by one)
Spoiler
All kind of weapons:
bonus2 bAddRace,RC_All,(getrefine()*3); #Weapon Level 1 - +3% dmg for each refine.
bonus2 bAddRace,RC_All,(getrefine()*6); #Weapon Level 2 - +6% dmg for each refine.
bonus2 bAddRace,RC_All,(getrefine()*9); #Weapon Level 3 - +9% dmg for each refine.
bonus2 bAddRace,RC_All,(getrefine()*12); #Weapon Level 4 - +12% dmg for each refine.
bonus2 bAddRace,RC_All,(getrefine()*15); #Weapon Level 5 - +15% dmg for each refine.
bonus2 bAddRace,RC_All,(getrefine()*18); #Weapon Level 6 - +18% dmg for each refine.
Staves, Rods & Books:
bonus2 bMagicAddRace,RC_All,(getrefine()*3); #Weapon Level 1 - +3% magic dmg for each refine.
bonus2 bMagicAddRace,RC_All,(getrefine()*6); #Weapon Level 2 - +6% magic dmg for each refine.
bonus2 bMagicAddRace,RC_All,(getrefine()*9); #Weapon Level 3 - +9% magic dmg for each refine.
bonus2 bMagicAddRace,RC_All,(getrefine()*12); #Weapon Level 4 - +12% magic dmg for each refine.
bonus2 bMagicAddRace,RC_All,(getrefine()*15); #Weapon Level 5 - +15% magic dmg for each refine.
bonus2 bMagicAddRace,RC_All,(getrefine()*18); #Weapon Level 6 - +18% magic dmg for each refine.
Alright, that works good so far, has nothing to do with the actual weapon level that would be a max of Weapon Level 4 on item_db.
I also modified refine_db.yml so items won't gain any bonus at all by themselves through refining process. So refine_db.yml has ZERO (0) atk or def bonus on all cases.
For armors and shields I used another scripts so it would be a balanced thing:
Spoiler
{ .@r = getrefine(); if(.@r>=1) { bonus2 bSubRace,RC_All,3; } if(.@r>=6) { bonus2 bSubRace,RC_All,4; } if(.@r>=11) { bonus2 bSubRace,RC_All,5; } if(.@r>=16) { bonus2 bSubRace,RC_All,6; } if(.@r=20) { bonus2 bSubRace,RC_All,7; } } #Shield Level 1 // +1 to +5 =3% // +6 to +10 =7% // +11 to +15 =12% // +16 to +19 =18% // +20 =25% total dmg taken reduction. { .@r = getrefine(); if(.@r>=1) { bonus2 bSubRace,RC_All,5; } if(.@r>=6) { bonus2 bSubRace,RC_All,6; } if(.@r>=11) { bonus2 bSubRace,RC_All,7; } if(.@r>=16) { bonus2 bSubRace,RC_All,8; } if(.@r=20) { bonus2 bSubRace,RC_All,9; } } #Shield Level 2 // +1 to +5 =5% // +6 to +10 =11% // +11 to +15 =18% // +16 to +19 =26% // +20 =35% total dmg taken reduction. { .@r = getrefine(); if(.@r>=1) { bonus2 bSubRace,RC_All,7; } if(.@r>=6) { bonus2 bSubRace,RC_All,8; } if(.@r>=11) { bonus2 bSubRace,RC_All,9; } if(.@r>=16) { bonus2 bSubRace,RC_All,10; } if(.@r=20) { bonus2 bSubRace,RC_All,11; } } #Shield Level 3 // +1 to +5 =7% // +6 to +10 =15% // +11 to +15 =24% // +16 to +19 =34% // +20 =45% total dmg taken reduction. { .@r = getrefine(); if(.@r>=1) { bonus2 bSubRace,RC_All,9; } if(.@r>=6) { bonus2 bSubRace,RC_All,10; } if(.@r>=11) { bonus2 bSubRace,RC_All,11; } if(.@r>=16) { bonus2 bSubRace,RC_All,12; } if(.@r=20) { bonus2 bSubRace,RC_All,13; } } #Shield Level 4 // +1 to +5 =9% // +6 to +10 =19% // +11 to +15 =30% // +16 to +19 =42% // +20 =55% total dmg taken reduction. { .@r = getrefine(); if(.@r>=1) { bonus2 bSubRace,RC_All,11; } if(.@r>=6) { bonus2 bSubRace,RC_All,12; } if(.@r>=11) { bonus2 bSubRace,RC_All,13; } if(.@r>=16) { bonus2 bSubRace,RC_All,14; } if(.@r=20) { bonus2 bSubRace,RC_All,15; } } #Shield Level 5 // +1 to +5 =11% // +6 to +10 =23% // +11 to +15 =36% // +16 to +19 =50% // +20 =65% total dmg taken reduction. { .@r = getrefine(); if(.@r>=1) { bonus2 bSubRace,RC_All,13; } if(.@r>=6) { bonus2 bSubRace,RC_All,14; } if(.@r>=11) { bonus2 bSubRace,RC_All,15; } if(.@r>=16) { bonus2 bSubRace,RC_All,16; } if(.@r=20) { bonus2 bSubRace,RC_All,17; } } #Shield Level 6 // +1 to +5 =13% // +6 to +10 =27% // +11 to +15 =42% // +16 to +19 =58% // +20 =75% total dmg taken reduction.
You can upgrade 4 pieces of equipment (Headgear, Armor, Garment & Shield) to +20
Resulting in a total bonus of: #4 Pieces of Armor // +1 to +5 =20% // +6 to +10 =60% // +11 to +15 =120% // +16 to +19 =180% // +20 =280% total armor/hard def % bonus.
Alright, I've tested those scripts and are working perfectly, values and that all works for the server class, mobs and other setups. Damage are balanced between players, mob and other players and when I do upgrade the items, bonuses are working just fine.
So, the purpose of this post is about the refining NPCs. 'Cause I want the Blacksmiths NPCs to be able to refine up to Level 5 and 6 weapons and shields. As the emulator can't read those values, I thought about making a whole new NPC that read for the items IDs (I would add one by one) and then returning those values as a custom way to read Item Level.
Also, custom upgrade rates are needed for this, 'cause refine_db.yml won't read level 5 or 6, so I thought about making the npc pick a random number from 1 to 100.
For example:
-Blacksmith NPC first read the item ID to check its "item level" which would then lead to another part of the script:
if item id (1103,1106,1125,1127,1135) Those are weapons level 1. goto R_WeaponLevel1
if item id (1116,1117,1124) Those are weapons level 3. goto R_WeaponLevel3
if item id (1138,1140) Those are weapons level 6. goto R_WeaponLevel6
if item id (2102) Guard goto R_ShieldLevel1
if item id (2148) Rosa Shield goto R_ShieldLevel6
if item id (2302) Cotton Shirt goto R_ArmorLevel1
if item id (2342) Legion Plate Armor goto R_ArmorLevel6
At the end we'll have R_WeaponLevel1, R_WeaponLevel2, R_WeaponLevel3, R_WeaponLevel4, R_WeaponLevel5, R_WeaponLevel6, R_ShieldLevel1, R_ShieldLevel2, R_ShieldLevel3, R_ShieldLevel4, R_ShieldLevel5, R_ShieldLevel6, R_ArmorLevel1, R_ArmorLevel2, R_ArmorLevel3, R_ArmorLevel4, R_ArmorLevel5, R_ArmorLevel6.
-Now NPC would ask for the upgrade items and zeny required to do the upgrade attempt:
-Now that NPC checked for the items and zeny, it would probably check item's current upgrade level. (I don't know how's that on script language)
-Then depending on +x current upgrade, it would pick a random number from 1 to 100 depending on these customs rates I've made so far: (remember the numbers colors to reference examples given down)
So, if we're upgrading for instance a #1138 which is Mysteltainn (Level 6 Sword) from +6 to +7, if the npc picks a number from 1 to 80 upgrade will result in success, but if it picks from 81 to 100 then the upgrade would fail. NPC would take Refined Bradium and 31700z. After this, if success, npc can do @refine 2 +1 (As if GM command)
If we're upgrading #2148 which is Rosa Shield (Level 6 Shield) from +15 to +16, the npc would pick a number, if its from 1 to 45 upgrade will result in success, but if it picks from 46 to 100then the upgrade would fail. NPC would take Carnium and 31700z. After this, if success, npc can do @refine 32 +1 (As if GM command)
If we're upgrading #2302 which is Cotton Shirt (Level 1 Armor) from +19 to +20, the npc would pick a number, if its from 1 to 25upgrade will result in success, but if it picks from 26 to 100then the upgrade would fail. NPC would take Carnium and 31700z. After this, if success, npc can do @refine 16 +1 (As if GM command)
So that's the NPC I do want for refining but I do not know how to do it. If you have read so far, let me thank you for your spent time and thank you as well if you do decide to help me making the script or at least telling me how can I do it.
Question
JulianD
Greetings community,
I'm running a Ragnarok project which I will be releasing in some time, and I was planning to have up to Level 5 and Level 6 Weapons and Shields.
So, first, I came up to think about how can I do that, so I realized I can't modify source to have 'em. Or at least, I don't know how to do it.
But, it's okay, that's not the problem, because I have found that making a script which increase atk or matk would work, depending on the weapon or defense or damage taken depending on armor or shield.
So, I added this to item scripts: (one by one)
All kind of weapons:
bonus2 bAddRace,RC_All,(getrefine()*3); #Weapon Level 1 - +3% dmg for each refine.
bonus2 bAddRace,RC_All,(getrefine()*6); #Weapon Level 2 - +6% dmg for each refine.
bonus2 bAddRace,RC_All,(getrefine()*9); #Weapon Level 3 - +9% dmg for each refine.
bonus2 bAddRace,RC_All,(getrefine()*12); #Weapon Level 4 - +12% dmg for each refine.
bonus2 bAddRace,RC_All,(getrefine()*15); #Weapon Level 5 - +15% dmg for each refine.
bonus2 bAddRace,RC_All,(getrefine()*18); #Weapon Level 6 - +18% dmg for each refine.
Staves, Rods & Books:
bonus2 bMagicAddRace,RC_All,(getrefine()*3); #Weapon Level 1 - +3% magic dmg for each refine.
bonus2 bMagicAddRace,RC_All,(getrefine()*6); #Weapon Level 2 - +6% magic dmg for each refine.
bonus2 bMagicAddRace,RC_All,(getrefine()*9); #Weapon Level 3 - +9% magic dmg for each refine.
bonus2 bMagicAddRace,RC_All,(getrefine()*12); #Weapon Level 4 - +12% magic dmg for each refine.
bonus2 bMagicAddRace,RC_All,(getrefine()*15); #Weapon Level 5 - +15% magic dmg for each refine.
bonus2 bMagicAddRace,RC_All,(getrefine()*18); #Weapon Level 6 - +18% magic dmg for each refine.
Alright, that works good so far, has nothing to do with the actual weapon level that would be a max of Weapon Level 4 on item_db.
I also modified refine_db.yml so items won't gain any bonus at all by themselves through refining process. So refine_db.yml has ZERO (0) atk or def bonus on all cases.
For armors and shields I used another scripts so it would be a balanced thing:
{ .@r = getrefine(); if(.@r>=1) { bonus2 bSubRace,RC_All,3; } if(.@r>=6) { bonus2 bSubRace,RC_All,4; } if(.@r>=11) { bonus2 bSubRace,RC_All,5; } if(.@r>=16) { bonus2 bSubRace,RC_All,6; } if(.@r=20) { bonus2 bSubRace,RC_All,7; } } #Shield Level 1 // +1 to +5 =3% // +6 to +10 =7% // +11 to +15 =12% // +16 to +19 =18% // +20 =25% total dmg taken reduction.
{ .@r = getrefine(); if(.@r>=1) { bonus2 bSubRace,RC_All,5; } if(.@r>=6) { bonus2 bSubRace,RC_All,6; } if(.@r>=11) { bonus2 bSubRace,RC_All,7; } if(.@r>=16) { bonus2 bSubRace,RC_All,8; } if(.@r=20) { bonus2 bSubRace,RC_All,9; } } #Shield Level 2 // +1 to +5 =5% // +6 to +10 =11% // +11 to +15 =18% // +16 to +19 =26% // +20 =35% total dmg taken reduction.
{ .@r = getrefine(); if(.@r>=1) { bonus2 bSubRace,RC_All,7; } if(.@r>=6) { bonus2 bSubRace,RC_All,8; } if(.@r>=11) { bonus2 bSubRace,RC_All,9; } if(.@r>=16) { bonus2 bSubRace,RC_All,10; } if(.@r=20) { bonus2 bSubRace,RC_All,11; } } #Shield Level 3 // +1 to +5 =7% // +6 to +10 =15% // +11 to +15 =24% // +16 to +19 =34% // +20 =45% total dmg taken reduction.
{ .@r = getrefine(); if(.@r>=1) { bonus2 bSubRace,RC_All,9; } if(.@r>=6) { bonus2 bSubRace,RC_All,10; } if(.@r>=11) { bonus2 bSubRace,RC_All,11; } if(.@r>=16) { bonus2 bSubRace,RC_All,12; } if(.@r=20) { bonus2 bSubRace,RC_All,13; } } #Shield Level 4 // +1 to +5 =9% // +6 to +10 =19% // +11 to +15 =30% // +16 to +19 =42% // +20 =55% total dmg taken reduction.
{ .@r = getrefine(); if(.@r>=1) { bonus2 bSubRace,RC_All,11; } if(.@r>=6) { bonus2 bSubRace,RC_All,12; } if(.@r>=11) { bonus2 bSubRace,RC_All,13; } if(.@r>=16) { bonus2 bSubRace,RC_All,14; } if(.@r=20) { bonus2 bSubRace,RC_All,15; } } #Shield Level 5 // +1 to +5 =11% // +6 to +10 =23% // +11 to +15 =36% // +16 to +19 =50% // +20 =65% total dmg taken reduction.
{ .@r = getrefine(); if(.@r>=1) { bonus2 bSubRace,RC_All,13; } if(.@r>=6) { bonus2 bSubRace,RC_All,14; } if(.@r>=11) { bonus2 bSubRace,RC_All,15; } if(.@r>=16) { bonus2 bSubRace,RC_All,16; } if(.@r=20) { bonus2 bSubRace,RC_All,17; } } #Shield Level 6 // +1 to +5 =13% // +6 to +10 =27% // +11 to +15 =42% // +16 to +19 =58% // +20 =75% total dmg taken reduction.
{ .@r = getrefine(); if(.@r>=1) { bonus bDefRate,5; } if(.@r>=6) { bonus bDefRate,10; } if(.@r>=11) { bonus bDefRate,15; } if(.@r>=16) { bonus bDefRate,15; } if(.@r=20) { bonus bDefRate,25; } } #Any Piece of Armor // +1 to +5 =5% // +6 to +10 =15% // +11 to +15 =30% // +16 to +19 =45% // +20 =70% total armor/hard def % bonus.
You can upgrade 4 pieces of equipment (Headgear, Armor, Garment & Shield) to +20
Resulting in a total bonus of: #4 Pieces of Armor // +1 to +5 =20% // +6 to +10 =60% // +11 to +15 =120% // +16 to +19 =180% // +20 =280% total armor/hard def % bonus.
Alright, I've tested those scripts and are working perfectly, values and that all works for the server class, mobs and other setups. Damage are balanced between players, mob and other players and when I do upgrade the items, bonuses are working just fine.
So, the purpose of this post is about the refining NPCs. 'Cause I want the Blacksmiths NPCs to be able to refine up to Level 5 and 6 weapons and shields. As the emulator can't read those values, I thought about making a whole new NPC that read for the items IDs (I would add one by one) and then returning those values as a custom way to read Item Level.
Also, custom upgrade rates are needed for this, 'cause refine_db.yml won't read level 5 or 6, so I thought about making the npc pick a random number from 1 to 100.
For example:
-Blacksmith NPC first read the item ID to check its "item level" which would then lead to another part of the script:
if item id (1103,1106,1125,1127,1135) Those are weapons level 1. goto R_WeaponLevel1
if item id (1116,1117,1124) Those are weapons level 3. goto R_WeaponLevel3
if item id (1138,1140) Those are weapons level 6. goto R_WeaponLevel6
if item id (2102) Guard goto R_ShieldLevel1
if item id (2148) Rosa Shield goto R_ShieldLevel6
if item id (2302) Cotton Shirt goto R_ArmorLevel1
if item id (2342) Legion Plate Armor goto R_ArmorLevel6
At the end we'll have R_WeaponLevel1, R_WeaponLevel2, R_WeaponLevel3, R_WeaponLevel4, R_WeaponLevel5, R_WeaponLevel6, R_ShieldLevel1, R_ShieldLevel2, R_ShieldLevel3, R_ShieldLevel4, R_ShieldLevel5, R_ShieldLevel6, R_ArmorLevel1, R_ArmorLevel2, R_ArmorLevel3, R_ArmorLevel4, R_ArmorLevel5, R_ArmorLevel6.
-Now NPC would ask for the upgrade items and zeny required to do the upgrade attempt:
Items needed for refining:
Weapons: / Lv1 Phracon / Lv2 Emveretarcon / Lv3 Rough Oridecon / Lv4 Oridecon / Lv5 Bradium / Lv6 Refined Bradium
Armors: / Lv1 Iron / Lv2 Steel / Lv3 Rough Elunium / Lv4 Elunium / Lv5 Carnium / Lv6 Carnium
Shields: / Lv1 Iron / Lv2 Steel / Lv3 Rough Elunium / Lv4 Elunium / Lv5 Carnium / Lv6 Carnium
Zeny required:
Weapons: / Lv1 1000 / Lv2 2200 / Lv3 4400 / Lv4 8800 / Lv5 17600 / Lv6 31700
Armors: / Lv1 800 / Lv2 1760 / Lv3 3520 / Lv4 7040 / Lv5 14080 / Lv6 25360
Shields: / Lv1 1500 / Lv2 3300 / Lv3 6600 / Lv4 13200 / Lv5 26400 / Lv6 47550
-Now that NPC checked for the items and zeny, it would probably check item's current upgrade level. (I don't know how's that on script language)
-Then depending on +x current upgrade, it would pick a random number from 1 to 100 depending on these customs rates I've made so far: (remember the numbers colors to reference examples given down)
Refine Level: +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20
Armor & Shield: 100 100 100 100 100 95 90 85 80 75 70 65 60 55 50 45 40 35 30 25
Weapon Level 1: 100 100 100 100 100 100 100 100 100 100 95 90 85 80 75 70 65 60 55 50
Weapon Level 2: 100 100 100 100 100 100 100 100 95 90 85 80 75 70 65 60 55 50 45 40
Weapon Level 3: 100 100 100 100 100 100 95 90 85 80 75 70 65 60 55 50 45 40 35 30
Weapon Level 4: 100 100 100 100 100 95 90 85 80 75 70 65 60 55 50 45 40 35 30 25
Weapon Level 5: 100 100 100 100 95 90 85 80 75 70 65 60 55 50 45 40 35 30 25 20
Weapon Level 6: 100 100 100 95 90 85 80 75 70 65 60 55 50 45 40 35 30 25 20 15
So, if we're upgrading for instance a #1138 which is Mysteltainn (Level 6 Sword) from +6 to +7, if the npc picks a number from 1 to 80 upgrade will result in success, but if it picks from 81 to 100 then the upgrade would fail. NPC would take Refined Bradium and 31700z. After this, if success, npc can do @refine 2 +1 (As if GM command)
If we're upgrading #2148 which is Rosa Shield (Level 6 Shield) from +15 to +16, the npc would pick a number, if its from 1 to 45 upgrade will result in success, but if it picks from 46 to 100 then the upgrade would fail. NPC would take Carnium and 31700z. After this, if success, npc can do @refine 32 +1 (As if GM command)
If we're upgrading #2302 which is Cotton Shirt (Level 1 Armor) from +19 to +20, the npc would pick a number, if its from 1 to 25 upgrade will result in success, but if it picks from 26 to 100 then the upgrade would fail. NPC would take Carnium and 31700z. After this, if success, npc can do @refine 16 +1 (As if GM command)
So that's the NPC I do want for refining but I do not know how to do it. If you have read so far, let me thank you for your spent time and thank you as well if you do decide to help me making the script or at least telling me how can I do it.
Thank you very much, I appreciate it.
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.