Author Topic: [DELTA] Object Thieving! [DELTA]  (Read 139 times)

Offline The Unholy

  • Steel Member
  • *
  • Posts: 36
  • Rep 4
    • View Profile
[DELTA] Object Thieving! [DELTA]
« on: March 29, 2011, 08:00:18 pm »
Difficulty: 1/10
Files edited: Client.Java
Credits: The Unholy

This tutorial will teach you how to add thieving on objects, and in this case, stalls  :tf:

Open up Client.java and search for:
Code: [Select]
if(Piety){
You should see:
Code: [Select]
if(Piety){
playerLevel[5] -= 2;
}
}

Underneath that, add this rather awesome piece of code!:

Code: [Select]
public void TheifStall(String stallName, String message, int lvlReq, int XPamount, int item, int itemAmount, int emote) {
if(System.currentTimeMillis() - lastAction < actionInterval) return; //adds timer
 if(playerLevel[17] >= lvlReq) { //checks for level requirements
   actionInterval = 2000; //timer
   lastAction = System.currentTimeMillis();
   setAnimation(emote); //plays emote
   sM("You take from the stall.."); //sends message
   sM(message); //sends stall-specific message
   addItem(item, itemAmount); //adds stall-specific item
   addSkillXP(XPamount, 17); //adds stall-specific exp
  }
  else if(playerLevel[17] < lvlReq) { //if you have a lower thief level than needed
  sM("You need a theiving level of "+lvlReq+" to steal from this stall."); // it sends this (stall-specific) message
 }

Now search for:
Code: [Select]
addItem(Item.randompartyroom(), 1);}
}

Under that method add:
Code: [Select]
if(objectID == 4876){
if(misc.random(3)==1){
TheifStall("General stall", "and recieve some coins", 1, 50*playerLevel[17], 995, misc.random(3125), 0x340);
}}
if(objectID == 4877){
if(misc.random(3)==1){
TheifStall("Magic stall", "and recieve some coins", 41, 100*playerLevel[17], 995, misc.random(6250), 0x340);
}}
if(objectID == 4878){
if(misc.random(3)==1){
TheifStall("Scimitar stall", "and recieve some coins", 72, 200*playerLevel[17], 995, misc.random(12500), 0x340);
}}
if(objectID == 4874){
if(misc.random(3)==1){
TheifStall("Crafting stall", "and recieve some coins", 93, 400*playerLevel[17], 995, misc.random(25500), 0x340);
}}

TheifStall("STALL NAME", "MESSAGE SENT", LEVEL REQUIRED, EXPERIENCE GAIN, ITEM RECIEVED, ITEM AMOUNT, ANIMATION);

To add more stalls, simply copy the method, example.

Code: [Select]
if(objectID == OBJECTID){
if(misc.random(3)==1){
TheifStall("STALL NAME", "MESSAGE SENT", LEVEL REQUIRED, EXPERIENCE GAIN, ITEM RECIEVED, ITEM AMOUNT, ANIMATION);

Have fun with your object thieving! Guess this could be considered a snippet, but since I've explained the code I guess it's not.  :fp:

Note 'misc.random(#);' means a random amount between 0 and the said number.  :tf:

« Last Edit: March 29, 2011, 08:03:30 pm by The Unholy »

Share on Bluesky Share on Facebook


Offline Sajon

  • Rune Member
  • *
  • Posts: 166
  • Rep -1
  • Never Back down
  • Location: United Kingdom
    • View Profile
Re: [DELTA] Object Thieving! [DELTA]
« Reply #1 on: March 29, 2011, 08:02:53 pm »
nice i just start to code :P

Offline The Unholy

  • Steel Member
  • *
  • Posts: 36
  • Rep 4
    • View Profile
Re: [DELTA] Object Thieving! [DELTA]
« Reply #2 on: March 29, 2011, 08:24:45 pm »
Haha, if you use Delta as a base, you can expect many tutorials from me to help you  :uj:

Offline AdotSells

  • Firecape Member
  • *
  • Posts: 300
  • Rep 4
    • View Profile
Re: [DELTA] Object Thieving! [DELTA]
« Reply #3 on: March 31, 2011, 04:32:07 pm »
Nice Mate nice :)

Offline Zeroeh.

  • Iron Member
  • *
  • Posts: 18
  • Rep 0
    • View Profile
Re: [DELTA] Object Thieving! [DELTA]
« Reply #4 on: April 01, 2011, 10:28:14 am »
You're unstoppable!
Great tutorials mate!
My way;
Code: [Select]
switch(objectID) {
case 4876:
if(misc.random(3)== 1){
TheifStall("General stall", "and recieve some coins", 1, 50*playerLevel[17], 995, misc.random(3125), 0x340);
break;

case 4877:
if(misc.random(3)== 1){
TheifStall("Magic stall", "and recieve some coins", 41, 100*playerLevel[17], 995, misc.random(6250), 0x340);
break;

case 4878:
if(misc.random(3)== 1){
TheifStall("Scimitar stall", "and recieve some coins", 72, 200*playerLevel[17], 995, misc.random(12500), 0x340);
break;

case 4874:
if(misc.random(3)== 1){
TheifStall("Crafting stall", "and recieve some coins", 93, 400*playerLevel[17], 995, misc.random(25500), 0x340);
break;

Cleaner.

Offline The Unholy

  • Steel Member
  • *
  • Posts: 36
  • Rep 4
    • View Profile
Re: [DELTA] Object Thieving! [DELTA]
« Reply #5 on: April 01, 2011, 04:18:10 pm »
My response; I don't care.  :<3: