ADDING DRAGON TO BE SMITHABLE ON YOUR SERVER!
My 3rd Tutorial, Please dont leech it, and please leave your comments on it
What are we gonna edit,
Client.java
Tested on: RichScape V2
A server compatable with smithing or a basic java knoledge to add it manually.
SILAB COMPATIBALL, BECAUSE OF 2 ITEMS... ARE REMOVABLE BUT THIS TUT DOSENT SAY HOW
DIFFICULTY 3/10
CREDITS : 75% ME!
25% to a friend of mine who have helped me a bit
INDEX
Step 1 - Adding the global object.
Step 2 - Item on anvil
Step 3 - Adding the smithing menu
Step 4 - Telling the server that the items are smithable with the BAR
Step 5 - Adding the XP
Step 6 - Adding the required levels for the items.
Step 1;
Ok, first search forIf you dont have one then try and create one, this guide wont tell you how, there is to much to tell you already.Code:public void NewObjects() {
Ok, so we need an anvil, of cours i could program it to use all the anvils but its easier to do this.
Where the # is, thats your co-ords, the 2783 is the ID of the anvil.Code:makeGlobalObject(####, ####, 2783, -3, 10);//anvil
-3 is the direction
//0 = west | -1 = north | -2 = east | -3 = south
And i dont know what 10 is but just leave it, it works.
(you could change the 2783, but be carefull incase you miss something.
END OF STEP 2
Step 2;
Ok in this step we are going to make it so that when you use the object on the anvil it open the smithing menu.
search for this
What is this section? This section tells the game what to do if an object is used on it.Code:else if(useItemID ==
Find the end of them, or the end of your smithing ones and add this one.
What it means...Code:else if(useItemID == 1749 && atObjectID == 2783)//dragon { initSmithing(1749); flushOutStream(); }
If the item 1749 (red d hide) is used on the anvil (2783) open the smithing interface 1749.
Ok, so thats Step 2 for you Nice and easy.
END OF STEP 2
Step 3;
Right, search forThats your SMITHING sectionCode:if(barType ==
Find where it ends.
Right, you need to add this;
The first section shows what to say and what colors for what items, like this code 'if(playerLevel[13] < 90) {
sendQuest("@bla@Plate body@bla@",1101);
} else {
sendQuest("@whi@Plate body@whi@",1101);' means that if the players lvl is less than 90 then say 'plate body' in black, else say it white...
here we have the code that displays the picture and the item id of what to create. 'addItemToSmith(6739,0,1120,1);' '6739' is the item. 0,1120,1 is about the colums, this code about colums is tricky to explain and difficult to get to grips with.
Now on most servers [13] is the smithing skill, if yours is different that need to change. Also on that same line it makes sure youCode:if(barType == 1749) { //Red D Hide if(playerLevel[13] < 90) { sendQuest("@bla@Plate body@bla@",1101); } else { sendQuest("@whi@Plate body@whi@",1101); } if(playerLevel[13] < 90) { sendQuest("@bla@Plate legs@bla@",1099); sendQuest("@bla@Plate skirt@bla@",1100); } else { sendQuest("@whi@Plate legs@whi@",1099); sendQuest("@whi@Plate skirt@whi@",1100); } if(playerLevel[13] < 90) { sendQuest("@bla@Chain body@bla@",1098); } else { sendQuest("@whi@Chain body@whi@",1098); } if(playerLevel[13] < 90) { sendQuest("@bla@Battle axe@bla@",1092); } else { sendQuest("@whi@Battle axe@whi@",1092); } if(playerLevel[13] < 90) { sendQuest("@bla@Square shield@bla@",1104); } else { sendQuest("@whi@Square shield@whi@",1104); } if(playerLevel[13] < 90) { sendQuest("@bla@Full helm@bla@",1103); } else { sendQuest("@whi@Full helm@whi@",1103); } if(playerLevel[13] < 90) { sendQuest("@bla@Long sword@bla@",1086); } else { sendQuest("@whi@Long sword@whi@",1086); } if(playerLevel[13] < 90) { sendQuest("@bla@Scimitar@bla@",1087); sendQuest("@bla@Arrowtips@bla@",1108); } else { sendQuest("@whi@Scimitar@whi@",1087); sendQuest("@whi@Arrowtips@whi@",1108); } if(playerLevel[13] < 90) { sendQuest("@bla@Medium helm@bla@",1102); } else { sendQuest("@whi@Medium helm@whi@",1102); } if(playerLevel[13] < 90) { sendQuest("@bla@Mace@bla@",1093); } else { sendQuest("@whi@Mace@whi@",1093); } if(playerLevel[13] < 90) { sendQuest("@bla@Axe@bla@",1091); } else { sendQuest("@whi@Axe@whi@",1091); } if(playerLevel[13] < 90) { sendQuest("@bla@Dagger@bla@",1094); } else { sendQuest("@whi@Dagger@whi@",1094); } addItemToSmith(1215,0,1119,1); //replace with dragon items! addItemToSmith(6739,0,1120,1); //done addItemToSmith(15151,0,1123,10); //done addItemToSmith(3140,0,1121,1); //done addItemToSmith(1149,0,1122,1); //done addItemToSmith(1434,1,1120,1); //done addItemToSmith(4087,1,1121,1); //done addItemToSmith(15195,1,1122,1); //done addItemToSmith(15157,1,1123,15); //done addItemToSmith(4587,2,1119,1); //done addItemToSmith(4585,2,1121,1); //done addItemToSmith(1187,2,1122,1); //done addItemToSmith(1305,3,1119,1); //done addItemToSmith(1377,1,1120,1); //done sendQuest("",1132); sendQuest("",1096); addItemToSmith(7158,4,1119,1); //done addItemToSmith(5698,1,1119,1); //done addItemToSmith(1434,1,1120,1); sendQuest("",1135); sendQuest("",1134); sendQuest("",11461); sendQuest("",11459); }
have 90 smithing.
The top section is very straight fowards. If you dont have enough items its in the color black, else if you have enough bars its in
white. SIMPLE =)
Here is the slightly tricky bit.
addItemToSmith(6739,0,1120,1); //done
So let me explain it so you can add things like BANDOS to the smithing menu aswell!!!!!
addItemToSmith - Adds the item to the smithing menu.
"""""""""""""""""(6739,#,####,#); - 6739 is the ID of a dragon item.
"""""""""""""""""(####,0,1120,1); - the rest of your data is about what column it goes in.
Ok, thats your smithing menu added, this will open up now when you use the item on the anvil.
But your not done. At the moment it will say 'You do not have a high enough smiuthing level to smith this item' - or something like
that.
END OF STEP 3
Step 4;
Right, at the moment the game dosent recognise the items to smith them.
Search for 'if(removeID ==' If you find more than 1, keep searching untill you find one that looks like its todo with smithing.
Under the MITH one add this code.
This code may look EVIL but its actually really simple =)Code:if(removeID == 1215 || removeID == 1434 || removeID == 1149 || removeID == 1305 || removeID == 4587 || removeID == 1305 || removeID == 15195 || removeID == 1187 || removeID == 1377 || removeID == 3140 || removeID == 4077 || removeID == 4585 || removeID == 6739 || removeID == 15151 || removeID == 4087 || removeID == 5698 || removeID == 7158 || removeID == 15157) { return 1749; }
after each 'removeID ==' you may see some significance, They are all the ID's that are on the smithing menu!
and here again is 'return 1749;' The ID of our Item to smith with.
This area basically tells the game that These items can be smithed with item id '1749''
END OF STEP 4
Step 5;
Ok, you can smith dragon (nearly) but you still dont get any experience. Well thats useless.
Ok, first we need to find wherer the smithing XP is distributed
on mine its under
But yours could be differentCode:public int smithXP(int barType, int barAmount) {
REALLY SIMPLE THIS STEP IS
Basically it asks the game what the bar type is, like this
if (barType == 1749) then we need the second step, the game knows your using this bar now and it wants to give you some
experiance, so lets add ' return barAmount*75;' Yeah, 75 XP per bar needed. The final code for that
END OF STEP 5Code:if (barType == 1749) return barAmount*75;
Step 6;
So its nearly done, you can open up the menu now, select your item, and the XP is programmed in, but there is a slight problem, it
hasnt set a level yet, So, From where you just were on CLIENT.JAVA scroll down untill you see something like;
above this you should see 'return false; This is the end of the section we need to use.Code:public void addItemToSmith(int id, int slot, int column, int amount)
Upwards a bit find something likeUnder it addCode:if(item == 1079 && playerLevel[13] >= 99) { return true; }You may notice that 4585 is metioned twice, dont remove any otherwise the D-Skirt ownt work.Code:if(item == 1215 || item == 6739 || item == 3140 || item == 1149 || item == 15151 || item == 5698 || item == 1377 || item == 4087 || item == 15195 || item == 15157 || item == 4587 || item == 1187 || item == 1305 || item == 1377 || item == 4585 || item == 1434 || item == 4585 && playerLevel[13] >= 100) { return true; }
That code basically means that any of the ITEM ID's listed above can be smithed if the player has level 100 smithing
That is the code to change if you want to change the level, also the items can be added individally for a different level each!
~^~EnD oF tUtOrIaL~^~
Idk on which server it is working. Cuz i use Richscape, and that is working



Reply With Quote![[Tut] How to smith full dragon?[TUT]](http://ragezone.com/hyper728.png)

