R1D3XITY
PLEASE REGISTER!
VOTE FOR DARK ERA PVP!
IP:DARKERAPVP.NO-IP.BIZ
VISIT OUR WEBCLIENT SERVICES SITE
http://317wcs.webs.com/
R1D3XITY
PLEASE REGISTER!
VOTE FOR DARK ERA PVP!
IP:DARKERAPVP.NO-IP.BIZ
VISIT OUR WEBCLIENT SERVICES SITE
http://317wcs.webs.com/
R1D3XITY
Would you like to react to this message? Create an account in a few clicks or log in to continue.


THE BEST RSPS FORUMS
 
HomePortalMAKING REQUIREMENTS FOR SHOP 2vtuxyhLatest imagesGallerySearchRegisterLog in
Server Ip:DarkEraPvP.No-Ip.Biz Join Dark Era PvP Now!
Latest Client Notice: Dark Era PvP Client Version 3 is now AVAILABLE! Get It Now!

 

 MAKING REQUIREMENTS FOR SHOP

Go down 
AuthorMessage
R1dl3r
Administrator
Administrator
R1dl3r


Posts : 108
Join date : 2009-12-03
Age : 33
Location : sd.ca.usa

MAKING REQUIREMENTS FOR SHOP Empty
PostSubject: MAKING REQUIREMENTS FOR SHOP   MAKING REQUIREMENTS FOR SHOP EmptyThu Dec 03, 2009 9:47 pm

Ok, so this is something I made up on my own, and its really simple, yes, but I though it would probably bring some new ideas to your head.

Mmk..Soo:
Codes will be in the tags, be sure to read everything. Also watch out for methods and stuff, if you need to make changes, make sure you do. Not all servers use the same methods. Example: Some servers will use sendMessage("Blah blah"); or sM("Blah blah"); It varies.

The red is things you'll need to change, and things you'll want to be careful about.

In all the codes, I have not filled out the NPC ID near the top of each code, which is the NPC ID that is the shop. The WanneShop ID I have also not filled out, it will be the shop ID usually found in Shops.cfg.

In client.java, where your wanneshop codes that look like this are:

Code:

Quote :
else if (NPCID == $$$) {
// Throwing shop
PutNPCCoords = true;
WanneShop = ##; // Shop number.
}


Ok, so now we add one that needs a requirement. When I did this, I made it so it required a quest. (Was delta :/)

For a quest requirement, use this template:

Code:

Quote :
else if (NPCID == 1083) {
// NPC
PutNPCCoords = true;


if(q4 == 15){ WanneShop = @@; // Shop
}
else {
sM("You must complete 'Quest Namer' to buy from *NPC Name*");
}
}

sM You might have to change to whatever your send message method is.

Quote :
q4 == 15

For that, q4 is the quest identifier, making it require whatever is next from quest number 4. Change this if you must. The 15 is for the quest step, you'll have a similar code inside your quest steps. Whatever the finished step is, in most cases, 15, change it here.


To make it so you need a certain player right to do this:

Code:

Quote :
else if (NPCID ==####) {
// NPC
PutNPCCoords = true;


if (playerRights == 1) { WanneShop = ##; // Shop
}
else {
sM("You must be a 'Rank' to use this shop.");
}
}

Code:
if (playerRights == 1)

That is obviously, what playerRight the user must have. Change the method/number as you must/wish.


To make an item requirement:

Code:

Quote :
else if (NPCID == ####) {
// NPC
PutNPCCoords = true;


if(playerHasItem(####, $) { WanneShop = ##; // Shop
}
else {
sM("You musthave a 'Item' to use this shop.");
}
}


if(playerHasItem(####, $)

The #### is the item ID, the $ is the amount, usually being '1'.

Optional for that: To make the item be deleted (a good idea would be maybe to give donators tickets that allow you to use a shop one time, use your imagination!) use this layout:

Code:

Quote :
else if (NPCID == ####) {
// NPC
PutNPCCoords = true;


if(playerHasItem(####, $) {
WanneShop = ##; // Shop
deleteItem(####, getItemSlot(####), $);
}
else {
sM("You musthave a 'Item' to use this shop.");
}
}

deleteItem(####, getItemSlot(####), $);

#### Both times is the item ID. The must be the same. $ is the amount to be deleted.


THAT'S ALL FOR THIS TUTORIAL!
REMEMBER THAT DELTA SOURCES USES
Code:
sM
INSTEAD OF
Code:
sendMessage
Back to top Go down
https://r1d3xity.darkbb.com
 
MAKING REQUIREMENTS FOR SHOP
Back to top 
Page 1 of 1
 Similar topics
-
» Read This First Before Making Clans!!!
» Making Your Client To A WebClient!
» ADDING AND MAKING NPC DIALOGUES
» pk shop glitch
» barrows shop.

Permissions in this forum:You cannot reply to topics in this forum
R1D3XITY  :: RS2 Development :: RS2 317 Related Boards :: RS2 317 Protocol Tutorials-
Jump to: