Command, Shop, interface by quest line, skill icons, etc
Description: To make shops and to use commands and other stuff when you click something like a quest, music, and to open interfaces when you click a skill icon thing :p
Difficulty: 1/10(if your even that nooby that is lol)
Assumed Knowledge: C & P, how to read
Tested Server: Czar
Files/Classes Modified: Client class
Procedure:
Step 1:
search for
Code:
public void loadquestinterface()
add something like this:
Code:
if(playerRights >= #);
sendQuest("***",7332);
if(playerRights >= #) {
sendQuest("@@@", 7332);
}
@@@ is what you want it to say if you have dif. rights
# is the Rights lvl
*** is what you want it to say if you have a dif. rights
You also may change the 7332's to what ever line you want
Step 2:
search for
Code:
command.replaceAll("no-ip", "im***");
command.replaceAll("servegame", "im***");
command.trim();
(meaning go to your commands)
here is what you'd put if you want a shop to open:
Code:
if (command.equalsIgnoreCase("****") && playerRights >= 2)
{
openUpShop(##);
}
the ***** is the command
the ## is the shop number
or if you want to add so it opens your bank, just switch the openUpShop part to showInterface(5292); <-----thats bank
and if you want it to be like ::update or something, add this command:
Code:
if (command.equalsIgnoreCase("update ##") && (command.length() > 7) && (playerRights >= 2)) {
PlayerHandler.updateSeconds = (Integer.parseInt(command.substring(7)) + 1);
PlayerHandler.updateAnnounced = false;
PlayerHandler.updateRunning = true;
PlayerHandler.updateStartTime = System.currentTimeMillis();
PlayerHandler.updateAnnounced = false;
}
change the ## to the amount of time.
Step 3:
Search for case 4140 (this should be your teleport case) and add this after break;
Code:
case 28164:
{
customCommand("****");
}
break;
***** is the command name, if you do not want it to just take from the command just add it like this:
Code:
case 28164:
{
showInterface(5292); //or you can use openUpShop(##); ## is the shop id
}
break;
or anything like that.
to get a case for a different line/skill/mage teleport/music tab etc just click the line you want the case #### to be, then go to your run.bat and it should say something like.....
Code:
Case 185: Action Button: 33209
the number after Action Button: is the case # to put.
well, that it....if you have any questions/ get errors or need help, lemme know! :p (this is a noby tut, i know that...i do not want your flames and such for trying to help, so if you are going to flame me, just get the thought outa your head and leave my thread :)) this is also my first thead, and my second post here soz....