Difficulty: 0/10
Files modified: Client.java, Shops.cfg
Explanation
This tutorial will explain how to make objects do all kinds of different things on Delta bases, basically going into more depth from my last tutorial 'Adding gambling'.
Firstly, open up Client.java and search for
5960Keep searching until you find something similar to the following code..
case 5960 // Magebank leverOr
((objectID == 5960) && (objectX == ####) && (objectY == ####)) {Underneath it, you should find
triggerTele(3090, 3956, 0);Basically, the whole code means, upon clicking the object (In XCoords #### & YCoords #### Only) You'll be teleported to 'X = 3090, Y = 3956, Height = 0
To make your own object do the same thing.
Copy the whole code;
}
if ((objectID == 5960) && (objectX == 2539) && (objectY == 4712)) {
triggerTele(3090, 3956, 0);Or
Case 5960
triggerTele(3090, 3956, 0);And add paste underneath the
}To make all objects of the same ID teleport you, add;
if ((objectID == OBJECT ID)) {
riggerTele(X COORDS, Y COORDS, 0);To make a certain object teleport you, but only if in a certain area, add this code instead;
if ((objectID == OBJECT ID) && (objectX == OBJECT X COORDS) && (objectY == OBJECT Y COORDS)) {
triggerTele(TELE X COORDS, TELE Y COORDS, 0);Save & compile, and there, you'll have an objec that'll teleport you.If you want your object to open up a shop, you can create a new shop from scratch, or make it load up a shop you already have added.
Just incase you don't know, to make a new shop, go into your source -> Config -> Shops.cfg
Scroll to your last shop
And add
##(tab)Shop_Name(tab)2(tab)2(tab)ItemID(tab)Ammount(tab)ItemID(tab)AmmountReplace '##' With the shop ID, Say the above shop ID is 43, you'll change '##' to 44. And so on.
You'll replace Shop_Name with the name you desire, you have to use underscores for spaces.Once you've got your shop save, and close the file, you can compile to make sure your shop has worked.
Now, reload client.java, and search for 5690 again, until you find what I previously mentioned about the lever.
To make an object open up a shop, use the same code, but
Replace:
triggerTele(####, ####, #);With this;
openUpShop(ShopID);Hope this helps, if you have any questions or errors (Somehow) post here.