adding dragonfire shield to smithing
Description: able to smith a dragonfire shield.
Difficulty: 1/10
Assumed Knowledge: adding new items and reading.
Tested Server: hiyascape v2 will work with all
Files/Classes Modified: client.java and item.cfg
so lets get started shallwe?:s
in item.cfg add these if you dont have them
Code:
item = 15187 draconic_visage a_powerfull_visage_of_a_dragon. 20700 1 1 0 0 0 0 0 0 0 0 0 0 0 0
item = 15186 Dragonfire_shield fire_breathing_shield! 20000000 100 100 0 0 0 -10 -5 70 75 72 10 72 7 0 0 0 0
item = 1540 Anti-dragon_shield This_provides_partial_protection_from_dragon-breath_attacks. 2000 1500 2000 0 0 0 0 0 7 9 8 2 8 0 0
save/close
open up client.java
search for
this case is called item used on another item exactly what we need :)
scroll down untill you see something similar to this
Code:
if (itemUsed == 5340 && useWith == 5312) { //By System
deleteItem(5312, getItemSlot(5312), 1);
addItem(995, 5);
addSkillXP(15, 19);
}
its okay if you dont have it, its just an example.
under the } press enter and past this in!
Code:
if (itemUsed == 1540 && useWith == 15187) { // By Tom(zedex)myself!
if(playerLevel[13] >= 90) {
if(playerHasItemAmount(2347, 1)==false)
{
sendMessage("You do not have a Hammer in your inventory.");
}
deleteItem(1540, getItemSlot(1540), 1);
deleteItem(15343, getItemSlot(15343), 1);
addItem(15186, 1);
addSkillXP(370, 13);
} else {
sendMessage("You need 90 smithing to start making a dragonfire shield!");
}
}
explanations:
Code:
if (itemUsed == 1540 && useWith == 15187) { // By Tom(zedex)myself!
if(playerLevel[13] >= 90) {
the if itemuser == 1540 is the id of antidragon shield and the && usewith == 15187 is the draconic visage
ifplayer[13] is the smithing skill, the >= 90) is the lvl of the skill that is smithing you need to put them toghetor.
Code:
if(playerHasItemAmount(2347, 1)==false)
{
sendMessage("You do not have a Hammer in your inventory.");
}
that means if you dont have the hammer in your inventory you cant put them toghetor..
Code:
deleteItem(1540, getItemSlot(1540), 1);
deleteItem(15343, getItemSlot(15343), 1);
addItem(15186, 1);
addSkillXP(370, 13);
this means it will remove the draconic visage and antifire shield from your inventory and will replace both with a dragonfire shield.
addskillxp(370, 13); this will add how many xp to your smithing :s
Code:
} else {
sendMessage("You need 90 smithing to start making a dragonfire shield!");
}
}
you probably know ;)
credits: 100% me zedex ranger;)
reminder: you can use this aswell with godsword hilt or shards anyitem for minigames etc.. even use uhhhh bones with a godsword and you get a item for example XD