Jump to content
JakeRed

[SRC] Smith Armor

Recommended Posts

Smith Armor

I decided to release this little mod as support to this new forum. Yay i'll be the first one making a source edit in here.

Back on topic...

This little mod will allow WhiteSmiths to have a new skill "Smith Armor" which will allow users to create elemental armors in the same way as they did with weapons. It will work in a similar fashion as to forge new Weapons.

Just check the following screenshots to see how it will work.

screeneAthena044-1.jpg

screeneAthena045-1.jpg

screeneAthena047.jpg

Steps

1- Go to yourserver/src/map/skill.h and find the following:

ALL_REVERSEORCISH,
ALL_WEWISH,
ALL_SONKRAN,
 

And paste below this:

WS_SMITH_ARMOR = 998,
 

Then save the file.

2- Go to yourserver/src/map/skill.c and find the following:

} else {  // Weapon Forging - skill bonuses are straight from kRO website, other things from a jRO calculator [DracoRPG]
 

And replace it with this:

} else if(itemdb_isequiptype(nameid) == 1){  // Weapon Forging - skill bonuses are straight from kRO website, other things from a jRO calculator [DracoRPG]
 

Find this:

if(pc_search_inventory(sd,989) > 0) make_per+= 1000; // Emperium Anvil: +10
 else if(pc_search_inventory(sd,988) > 0) make_per+= 500; // Golden Anvil: +5
 else if(pc_search_inventory(sd,987) > 0) make_per+= 300; // Oridecon Anvil: +3
 else if(pc_search_inventory(sd,986) > 0) make_per+= 0; // Anvil: +0?
 if(battle_config.wp_rate != 100)
  make_per = make_per * battle_config.wp_rate / 100;
}
 

Then paste below this:

else
{ // Calc Smith Armor bonus
 make_per = sd->status.job_level*20 + status->dex*10 + status->luk*10;
 make_per += pc_checkskill(sd,skill_id)*500; // Smithing skills bonus: +5/+10/+15
 if(pc_search_inventory(sd,989) > 0) make_per+= 1000; // Emperium Anvil: +10
 else if(pc_search_inventory(sd,988) > 0) make_per+= 500; // Golden Anvil: +5
 else if(pc_search_inventory(sd,987) > 0) make_per+= 300; // Oridecon Anvil: +3
 else if(pc_search_inventory(sd,986) > 0) make_per+= 0; // Anvil: +0?
 if(battle_config.wp_rate != 100)
  make_per = make_per * battle_config.wp_rate / 100;
}
 

Save this file.

3- Go to yourserver/src/map/itemdb.h and find this:

int itemdb_isequip2(struct item_data *);
 

Paste below this:

int itemdb_isequiptype(int);
 

Save this file.

4- Go to yourserver/src/map/itemdb.c and find this:

/*==========================================
* Alternate version of itemdb_isequip
*------------------------------------------*/
int itemdb_isequip2(struct item_data *data)
{
nullpo_ret(data);
switch(data->type) {
 case IT_WEAPON:
 case IT_ARMOR:
 case IT_AMMO:
  return 1;
 default:
  return 0;
}
}
 

Then paste below this:

/*==========================================
* Return if weapon, armor or ammo. //by JakeRed
*------------------------------------------*/
int itemdb_isequiptype(int nameid)
{
int type=itemdb_type(nameid);
switch (type)
{
 case IT_WEAPON: return 1;
 case IT_ARMOR: return 2;
 case IT_AMMO: return 3;
 default: return 0;
}
}
 

Save this file.

5- Go to yourserver/db/skill_db.txt and find the following:

477,0,6,4,0,0x1,0,10,1,no,0,0,0,weapon,0, WS_WEAPONREFINE,Upgrade Weapon
 

Then paste below this:

998,0,0,0,0,0,0,1,0,no,0,0,0,weapon,0,  WS_SMITH_ARMOR,Smith Armor
 

Save this file.

6- Go to yourserver/db/produce.txt and find this;

//===== Elemental Converters === ItemLV=23 =====
//-- Fire Elemental Converter <-- SA_CREATECON & 1 Blank Scroll, 3 Scorpion Tail
12114,23,1007,1,7433,1,904,3
//-- Water Elemental Converter <-- SA_CREATECON & 1 Blank Scroll, 3 Snail's Shell
12115,23,1007,1,7433,1,946,3
//-- Earth Elemental Converter <-- SA_CREATECON & 1 Blank Scroll, 3 Horn
12116,23,1007,1,7433,1,947,3
//-- Wind Elemental Converter <-- SA_CREATECON & 1 Blank Scroll, 3 Rainbow Shell
12117,23,1007,1,7433,1,1013,3
//==============================================
 

Then paste below this:

//---- Armors -----------------------
//-- Tights <-- WS_SMITH_ARMOR & 1 Porcellio card, 3 Scorpion Tail <--- Examples of recipes for armors
2330,3,998,1,4337,1,904,3
//-- Chain Mail <-- WS_SMITH_ARMOR & 1 Porcellio card, 5 Scorpion Tail <--- Example of recipes for armors
2314,3,998,1,4437,1,904,5
//==============================================
 

Save this file and recompile your server, if everything is correct it will not show any error.

In produce.txt change the recipes and add as many recipes as you want to your skill.

In step 2 you can change the chances of sucess and also if you want to ask for other items besides (Golden Anvil, Emperium Anvil,Oridecon Anvil) .

Now that we ended with our server side modifications, we need to modify the Client, so here are the steps to modify the client side.

1- Go to yourdatafolder/lua files/skillid.lua and find this:

KN_CHARGEATK = 1001,
CR_SHRINK = 1002,
AS_SONICACCEL = 1003,
 

Above add this:

WS_SMITH_ARMOR = 998,
 

Save your file.

2- Go to yourdatafolder/lua files/skilltreeview.lua and find this:

[JOBID.JT_BLACKSMITH_H] = {
 [21] = SKID.WS_CARTBOOST,
 [28] = SKID.WS_CARTTERMINATION,
 [22] = SKID.WS_MELTDOWN,
 [25] = SKID.WS_OVERTHRUSTMAX,
 [23] = SKID.WS_WEAPONREFINE
},
 

And replace it with this:

[JOBID.JT_BLACKSMITH_H] = {
 [21] = SKID.WS_CARTBOOST,
 [28] = SKID.WS_CARTTERMINATION,
 [22] = SKID.WS_MELTDOWN,
 [25] = SKID.WS_OVERTHRUSTMAX,
 [35] = SKID.WS_SMITH_ARMOR,
 [23] = SKID.WS_WEAPONREFINE
},
 

Save your file.

3- Go to yourdatafolder/lua files/skillinfolist.lua and find:

[sKID.WS_WEAPONREFINE] = {
 "WS_WEAPONREFINE";
 SkillName = "Weapon Refine",
 MaxLv= 10,
 _NeedSkillList = {
  { SKID.BS_WEAPONRESEARCH,10 }
 }
},
 

Paste below this:

[sKID.WS_SMITH_ARMOR] = {
 "WS_SMITH_ARMOR";
 SkillName = "Smith Armor",
 MaxLv = 1,
 _NeedSkillList = {
  { SKID.WS_WEAPONREFINE,10 }
 }
},
 

Save the file.

4- Go to yourdatafolder/lua files/skilldescript.lua and find:

[sKID.WS_WEAPONREFINE] = {[/b]
[b]  "Weapon Refine",
 "Max Level:^777777 10 ^000000",
 "Type:^000099 Passive ^000000",
 "Target:^777777 Self ^000000",
 "Effect:^777777 Enables you to refine weapons. Unlike Forging, this skill doesn't depend on DEX and LUK, but only on the character's job level.",
 "At job level 50, you have about the same chances of upgrading as Hollgrehenn.",
 "At job 70, you have an about 10% better success chance than Hollgrehenn.",
 "For level 1 Weapons, Phracon is needed.",
 "For level 2 Weapons, Emveretarcon is needed.",
 "For level 3/4 Weapons, Oridecon is needed. ^000000",
 "[LV 1]^777777 Up to +1 ^000000",
 "[LV 2]^777777 Up to +2 ^000000",
 "[LV 3]^777777 Up to +3 ^000000",
 "[LV 4]^777777 Up to +4 ^000000",
 "[LV 5]^777777 Up to +5 ^000000",
 "[LV 6]^777777 Up to +6 ^000000",
 "[LV 7]^777777 Up to +7 ^000000",
 "[LV 8]^777777 Up to +8 ^000000",
 "[LV 9]^777777 Up to +9 ^000000",
 "[LV 10]^777777 Up to +10 ^000000",
},
 

Paste below this:

[sKID.WS_SMITH_ARMOR] = {[/b]
[b]  "Smith Armor",
 "Max Level:^777777 1 ^000000",
 "Type:^000099 Passive ^000000",
 "Catalyst:^777777 Varies ^000000",
 "Effect:^777777 Allows character to forge Armors using a hammer. Skill Value is (5*SkillLV)%. Anvil, JobLV, DEX and LUK (in this order) further increase this chance. ^000000",
 "^000000[LV 1]^777777",
 "Tights",
 "1 Porcellio Card",
 "3 Scorpion Tails",
 "Chain Mail",
 "1 Porcellio Card",
 "5 Scorpion Tails",
 "^6699ffForging formula:",
 "Base % chance: Skill Value + JobLV * 0.2 + DEX * 0.1 + LUK * 0.1 + 50",
 "Normal Anvil   +0%",
 "Oridecon Anvil +3%",
 "Golden Anvil   +5%",
 "Emperium Anvil +10%",
 "LV 1 Weapon -0%",
 "LV 2 Weapon -20%",
 "LV 3 Weapon -30%",
 "Per Star Crumb -15%",
 "Elemental Stone -20% ^000000",
},
 

Save the file.

5- Go to yourdatafolder/textures/À¯ÀúÀÎÅÍÆäÀ̽º/item/ and paste the icon for the skill provided in the following link:

http://www.mediafire...om165c1&thumb=4

Test it and it must to work correctly.

In order to get the skill Smith Armor it will be necessary to get Weapon Refine level 10.

Change your killdescript.lua according to your likings.

PS: If you dont know how to compile a server use the Wiki and "learn".

PS2: It seems i'm unable to upload files compressed, so i had to upload it to mediafire.

Regards,

Client Side:

http://www.mediafire...iadvqrec1yhgrjy

Diff files:

Smith_Armor_eAthena-trunk_14993.patch

Smith_Armor_RR_Mod_rev_79.patch

Smith_Armor_3CeAM-trunk_652.patch

Edited by Emistry
fix img link
  • Upvote 10
Link to comment
Share on other sites

First post updated.

Added Diff files, lua files and also the icon into a compressed 7zip file as requested.

Regards,

Edited by JakeRed
Link to comment
Share on other sites

The whole adding of the function itemdb_isequiptype seems a bit pointless. You only used it once:

} else if(itemdb_isequiptype(nameid) == 1){

So you might as well remove the function and just run:

} else if( itemdb_type(nameid) == IT_WEAPON ) {

Otherwise, nice idea :D

Link to comment
Share on other sites

Nice post sir, I like your tutorial on every step is in Codebox. But sir can I request a simple tutorial like this. How to make a new skill with the spr. I really can't find step by step guide like this.

Link to comment
Share on other sites

The whole adding of the function itemdb_isequiptype seems a bit pointless. You only used it once:

} else if(itemdb_isequiptype(nameid) == 1){

So you might as well remove the function and just run:

} else if( itemdb_type(nameid) == IT_WEAPON ) {

Otherwise, nice idea wink.png

Thank you for point out that, the function itemdb_isequiptype is one of the remains of a really old system that i made for crafting back on 2006, i just simply did copy and paste so i didn't think about to recode it.

Nice post sir, I like your tutorial on every step is in Codebox. But sir can I request a simple tutorial like this. How to make a new skill with the spr. I really can't find step by step guide like this.

Thank you pojiejapan, But this is not a place for request,

If you want to create new skils by yourself, you're forced to learn C at some degree to understand how does eathena skills works since depending on the skills, it would be programmed in any or other way; so there is no way to create a guide which will cover the 100% about making new skills for eAthena.

Regards,

Link to comment
Share on other sites

Elemental Stuffs doesn't have slots right?.

Sure they have.

Forged equipment can't have slots, because of the infos about the forger is saved in the places of the slots, so no space is left for card ID's or something else.

Equipment with an attack or defence element are still able to be slotted or forged.

Link to comment
Share on other sites

Sure they have.

Forged equipment can't have slots, because of the infos about the forger is saved in the places of the slots, so no space is left for card ID's or something else.

Equipment with an attack or defence element are still able to be slotted or forged.

Thanks for clearing that up.. :)

Link to comment
Share on other sites

Very nicely created. +10

Just a suggestion: You should make a 'Manual' book like they have for creator's recipes. In this manual for the Whitesmith, the Forge Manual, it'll say Armors: (it'll list the amount of armors you can create), then it'll list the items needed for the specified Armor :)

Link to comment
Share on other sites

add to db/skill_tree.txt

4011,998,1,0,0,0,0,0,0,0,0,0,0 //WS_SMITHARMOR#Smith Armor#

thnx to Heler

Edited by nndsl
  • Upvote 1
Link to comment
Share on other sites

add to db/skill_tree.txt

4011,998,1,0,0,0,0,0,0,0,0,0,0 //WS_SMITHARMOR#Smith Armor#

thnx to Heler

yeah u right :)

btw whats gonna happened if i change

} else if(itemdb_isequiptype(nameid) == 1){

to

} else if( itemdb_type(nameid) == IT_WEAPON ) {

can be use for weapon too??

Link to comment
Share on other sites

Why did you choose the ID 998 instead of the ID 700 (which is the last valid entry for SkillID's after ALL_SONKRAN)?

Just a doubt.

Sorry for my bad english.

because the next IDs are reserved for future skills coming from official server..better reserved IDs if making custom skill..

@topic

Great!

Link to comment
Share on other sites

And where can I see the ID's available to create a custom skill?

Because to me the ID 700 was completely empty and could be used in the SRC.

I have seen no signs of future skills there.

Because soon appear on 1001's of other ID skills. So how could I know?

Edited by bodebruno
Link to comment
Share on other sites

Sorry to revive a dead topic. But I could use some help. I am currently trying to use this on my server, and everything works fine except I can not add skill points into this skill.

Once I hit apply, its as if nothing happens. I've been reading around and some people say that it is my skill_db or that it is my lua/lub files, but i've done exactly what is in this guide to no avail. If anyone has any tips, i would much appreciate it.

EDIT: problem was solved. I had to put this skill into db/skill_tree.

Thanks for a great mod!

Edited by rocky6861
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.