SiniSoul
July 27th, 2010, 15:38
Created 100% By SiniSoul
L33chers Beware...
Base: Palidino
|| Introduction ||
Im releasing this tutorial because the community seems dull and this is a skill I really don't care that you have. Its not like my Fishing or Barbarian Fishing but this is pretty l33t. I converted this from my Infinity base to Palidino so that people can use it.
IF I SEE THIS ANYWHERE ELSE OTHER THEN RUNELOCUS I WILL HAVE THIS TOPIC REMOVED.
IF PEOPLE TAKE CREDIT FOR THIS I WILL REMOVE IT, NO QUESTIONS ASKED.
Want a video of it in action (a little outdated but...): VIDEO (Only the registered members can see the link.)
Im pretty sure this is the best FireMaking out there. It will delete the fire and spawn all the FireObjects within a array that is classified with the player. I set the max array to 5000 to Minimize lag but you can change it if you wish.
|| Acknowledgments ||
My imports are not the same as yours. CHANGE THEM TO FIT YOURS.
package Yoursource.Skills.Firemaking.Firemaking; WRONG
package Yousource.Skills.Firemaking; RIGHT
On imports you do need to specify the specific file, just not on packages.
import Yoursource.Skills.Firemaking.Firemaking; RIGHT
Yea its a bit messy, get over it.
NO ANNOTATIONS D: i really...yea I know what my stuff does.
|| STEP ONE ||
INSERT THIS CODE
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Yousource.Skills.Firemaking;
import Yousource.players.Player;
import Yousource.io.Frames;
import Yousource.Engine;
import Yousource.players.items.PlayerItems;
import Yousource.util.Misc;
/**
*
* @author SiniSoul
*/
public class Firemaking {
public PlayerItems pi = new PlayerItems();
private int XPRATE = 1;
public final FireObject[] FireObjects = new FireObject[5000];
private final Frames Frames = new Frames();
private final int[] LOGS = {1511, 1521, 1519, 1517, 1515, 1513};
private final int[] REQ = {1, 15, 30, 45, 60, 75};
private final int TINDERBOX = 590;
private final int ASH = 592;
private final int EMOTE = 733;
private int TYPE = -1;
private int ATTEMPT = 0;
public Firemaking() {
}
public void playerProcess(Player p) {
FiremakingPlayerProcess(p);
FireSpotsProcess();
}
@SuppressWarnings("static-access")
public void Fire(Player p, int log, int tinder) {
System.out.println("STEP A");
if(p.FM.ATTEMPT == 0) {
System.out.println("STEP A1");
if(tinder == TINDERBOX) {
System.out.println("STEP A2");
for(int i = 0; i < LOGS.length; i ++) {
System.out.println("STEP A3");
if(LOGS[i] == log) {
if(levelCheck(p, i)) {
System.out.println("STEP A4");
p.FM.TYPE = i;
} else {
p.FM.TYPE = -1;
}
} else {
continue;
}
}
}
}
}
private boolean levelCheck(Player p, int i) {
if(p.skillLvl[11] >= REQ[i]) {
return true;
} else {
Frames.sendMessage(p, levelCheckString(i));
return false;
}
}
private String levelCheckString(int i) {
switch (i) {
case 0:
return "If You Get This Tell SiniSoul";
case 1:
return "You Need 15 Firemaking To Do This.";
case 2:
return "You Need 30 Firemaking To Do This.";
case 3:
return "You Need 45 Firemaking To Do This.";
case 4:
return "You Need 60 Firemaking To Do This.";
case 5:
return "You Need 75 Firemaking To Do This.";
}
return null;
}
@SuppressWarnings("static-access")
private void FiremakingPlayerProcess(Player p) {
if(p.FM.ATTEMPT == 0) {
if(p.FM.TYPE > -1) {
System.out.println("STEP B");
attempt(p);
}
if(p.FM.ATTEMPT == -10) {
p.FM.ATTEMPT = 0;
}
}
}
@SuppressWarnings("static-access")
private void attempt(Player p) {
p.FM.ATTEMPT = 1;
int a = p.skillLvl[11];
double b = ((a * .25)-TYPE);
double c = Misc.random(30) + b;
if(c > 20) {
System.out.println("STEP C");
succeed(p);
} else {
System.out.println("STEP D");
p.requestAnim(EMOTE, 0);
fail(p);
}
}
@SuppressWarnings("static-access")
private void fail(Player p) {
System.out.println("STEP E");
p.FM.ATTEMPT = 0;
}
@SuppressWarnings("static-access")
private void succeed(Player p) {
System.out.println("STEP F");
pi.deleteItem(p, LOGS[p.FM.TYPE], pi.getItemSlot(p, LOGS[p.FM.TYPE]), 1);
xp(p, p.FM.TYPE);
p.frames.resetAnimations(p);
p.reqWalkQueue(p.absX -1, p.absY);
CreateFireSpot(p);
p.FM.TYPE = -1;
p.FM.ATTEMPT = 0;
p.frames.resetAnimations(p);
}
private void CreateFireSpot(Player p) {
for(int i = 0; i < FireObjects.length; i++) {
if(FireObjects[i] != null) {
continue;
}
if(FireObjects[i] == null) {
FireObjects[i] = new FireObject(p, p.absX, p.absY, p.heightLevel, 50);
break;
}
}
}
public void FireSpotsProcess() {
for(FireObject FO: FireObjects) {
if(FO == null) {
continue;
}
if(FO.TIMER == -1) {
continue;
}
if(FO.TIMER > 0) {
FO.TIMER --;
System.out.println(FO.TIMER);
}
if(FO.TIMER == 0) {
Engine.items.createGlobalItem(ASH, 1, FO.x, FO.y, FO.h);
Frames.deleteStaticObject(FO.h, FO.x, FO.y);
FO.TIMER = -1;
FO = null;
}
}
}
private void xp(Player p, int i) {
switch (i) {
case 0:
p.addSkillXP(40 * XPRATE, 11);
break;
case 1:
p.addSkillXP(60 * XPRATE, 11);
break;
case 2:
p.addSkillXP(90 * XPRATE, 11);
break;
case 3:
p.addSkillXP(135 * XPRATE, 11);
break;
case 4:
p.addSkillXP(202.5 * XPRATE, 11);
break;
case 5:
p.addSkillXP(303.75 * XPRATE, 11);
break;
}
}
}
INTO A FOLDER CALLED:
Yousource.Skills.Firemaking.*
Save it as Firemaking.java
|| STEP TWO ||
Put this code in to the folder too:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Yoursource.Skills.Firemaking;
import Yoursource.players.Player;
/**
*
* @author SiniSoul
*/
public class FireObject {
public Player p;
private int OBJECT = 2732;
public int TIMER = -1;
public int x = 0;
public int y = 0;
public int h = 0;
private int TYPE = 10;
private int FACE = 0;
public FireObject (Player _p, int _x, int _y, int _h, int _TIMER) {
p = _p;
x = _x;
y = _y;
h = _h;
TIMER = _TIMER;
createFireObject();
}
private void createFireObject() {
p.frames.deleteObject(p, x, y);
p.frames.createGlobalObject(2733, h, x, y, FACE, TYPE);
p.frames.createGlobalObject(OBJECT, h, x, y, FACE, TYPE);
}
}
Save it as FireObject.java
|| STEP THREE ||
Open Player.java
add this import...
import Yousource.Skills.Firemaking.Firemaking;
And put this anywhere something isn't called.
public Firemaking FM = new Firemaking();
Ctrl + F ( process() )
And in the process() {
Add this:
this.FM.playerProcess(this);
|| STEP FOUR ||
Open Frames.java
Insert This.
public void resetAnimations(Player p) {
p.stream.createFrame(114);
}
public void deleteObject(Player p, int objectX, int objectY) {
sendCoords(p, (objectX - ((p.mapRegionX - 6) * 8)), (objectY - ((p.mapRegionY - 6) * 8)));
p.stream.createFrame(196);
p.stream.writeByteC(0);
p.stream.writeByteC(0);
}
public void deleteGlobalObject(int objectX, int objectY) {
for(Player p: Engine.players) {
if (p == null) continue;
sendCoords(p, (objectX - ((p.mapRegionX - 6) * 8)), (objectY - ((p.mapRegionY - 6) * 8)));
p.stream.createFrame(196);
p.stream.writeByteC(0);
p.stream.writeByteC(0);
}
}
public void deleteStaticObject(int height, int objectX, int objectY) {
for (Player p : Engine.players) {
if (p == null)
continue;
if (p.heightLevel == height)
createObject(p, 6951, height, objectX, objectY, -1, 10);
}
}
Well...I think thats it...If I missed anything I will be on all day today and just drop me a PM or contact me at SiniSoul@live.com.
Thanks, Please...Don't Leech.
L33chers Beware...
Base: Palidino
|| Introduction ||
Im releasing this tutorial because the community seems dull and this is a skill I really don't care that you have. Its not like my Fishing or Barbarian Fishing but this is pretty l33t. I converted this from my Infinity base to Palidino so that people can use it.
IF I SEE THIS ANYWHERE ELSE OTHER THEN RUNELOCUS I WILL HAVE THIS TOPIC REMOVED.
IF PEOPLE TAKE CREDIT FOR THIS I WILL REMOVE IT, NO QUESTIONS ASKED.
Want a video of it in action (a little outdated but...): VIDEO (Only the registered members can see the link.)
Im pretty sure this is the best FireMaking out there. It will delete the fire and spawn all the FireObjects within a array that is classified with the player. I set the max array to 5000 to Minimize lag but you can change it if you wish.
|| Acknowledgments ||
My imports are not the same as yours. CHANGE THEM TO FIT YOURS.
package Yoursource.Skills.Firemaking.Firemaking; WRONG
package Yousource.Skills.Firemaking; RIGHT
On imports you do need to specify the specific file, just not on packages.
import Yoursource.Skills.Firemaking.Firemaking; RIGHT
Yea its a bit messy, get over it.
NO ANNOTATIONS D: i really...yea I know what my stuff does.
|| STEP ONE ||
INSERT THIS CODE
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Yousource.Skills.Firemaking;
import Yousource.players.Player;
import Yousource.io.Frames;
import Yousource.Engine;
import Yousource.players.items.PlayerItems;
import Yousource.util.Misc;
/**
*
* @author SiniSoul
*/
public class Firemaking {
public PlayerItems pi = new PlayerItems();
private int XPRATE = 1;
public final FireObject[] FireObjects = new FireObject[5000];
private final Frames Frames = new Frames();
private final int[] LOGS = {1511, 1521, 1519, 1517, 1515, 1513};
private final int[] REQ = {1, 15, 30, 45, 60, 75};
private final int TINDERBOX = 590;
private final int ASH = 592;
private final int EMOTE = 733;
private int TYPE = -1;
private int ATTEMPT = 0;
public Firemaking() {
}
public void playerProcess(Player p) {
FiremakingPlayerProcess(p);
FireSpotsProcess();
}
@SuppressWarnings("static-access")
public void Fire(Player p, int log, int tinder) {
System.out.println("STEP A");
if(p.FM.ATTEMPT == 0) {
System.out.println("STEP A1");
if(tinder == TINDERBOX) {
System.out.println("STEP A2");
for(int i = 0; i < LOGS.length; i ++) {
System.out.println("STEP A3");
if(LOGS[i] == log) {
if(levelCheck(p, i)) {
System.out.println("STEP A4");
p.FM.TYPE = i;
} else {
p.FM.TYPE = -1;
}
} else {
continue;
}
}
}
}
}
private boolean levelCheck(Player p, int i) {
if(p.skillLvl[11] >= REQ[i]) {
return true;
} else {
Frames.sendMessage(p, levelCheckString(i));
return false;
}
}
private String levelCheckString(int i) {
switch (i) {
case 0:
return "If You Get This Tell SiniSoul";
case 1:
return "You Need 15 Firemaking To Do This.";
case 2:
return "You Need 30 Firemaking To Do This.";
case 3:
return "You Need 45 Firemaking To Do This.";
case 4:
return "You Need 60 Firemaking To Do This.";
case 5:
return "You Need 75 Firemaking To Do This.";
}
return null;
}
@SuppressWarnings("static-access")
private void FiremakingPlayerProcess(Player p) {
if(p.FM.ATTEMPT == 0) {
if(p.FM.TYPE > -1) {
System.out.println("STEP B");
attempt(p);
}
if(p.FM.ATTEMPT == -10) {
p.FM.ATTEMPT = 0;
}
}
}
@SuppressWarnings("static-access")
private void attempt(Player p) {
p.FM.ATTEMPT = 1;
int a = p.skillLvl[11];
double b = ((a * .25)-TYPE);
double c = Misc.random(30) + b;
if(c > 20) {
System.out.println("STEP C");
succeed(p);
} else {
System.out.println("STEP D");
p.requestAnim(EMOTE, 0);
fail(p);
}
}
@SuppressWarnings("static-access")
private void fail(Player p) {
System.out.println("STEP E");
p.FM.ATTEMPT = 0;
}
@SuppressWarnings("static-access")
private void succeed(Player p) {
System.out.println("STEP F");
pi.deleteItem(p, LOGS[p.FM.TYPE], pi.getItemSlot(p, LOGS[p.FM.TYPE]), 1);
xp(p, p.FM.TYPE);
p.frames.resetAnimations(p);
p.reqWalkQueue(p.absX -1, p.absY);
CreateFireSpot(p);
p.FM.TYPE = -1;
p.FM.ATTEMPT = 0;
p.frames.resetAnimations(p);
}
private void CreateFireSpot(Player p) {
for(int i = 0; i < FireObjects.length; i++) {
if(FireObjects[i] != null) {
continue;
}
if(FireObjects[i] == null) {
FireObjects[i] = new FireObject(p, p.absX, p.absY, p.heightLevel, 50);
break;
}
}
}
public void FireSpotsProcess() {
for(FireObject FO: FireObjects) {
if(FO == null) {
continue;
}
if(FO.TIMER == -1) {
continue;
}
if(FO.TIMER > 0) {
FO.TIMER --;
System.out.println(FO.TIMER);
}
if(FO.TIMER == 0) {
Engine.items.createGlobalItem(ASH, 1, FO.x, FO.y, FO.h);
Frames.deleteStaticObject(FO.h, FO.x, FO.y);
FO.TIMER = -1;
FO = null;
}
}
}
private void xp(Player p, int i) {
switch (i) {
case 0:
p.addSkillXP(40 * XPRATE, 11);
break;
case 1:
p.addSkillXP(60 * XPRATE, 11);
break;
case 2:
p.addSkillXP(90 * XPRATE, 11);
break;
case 3:
p.addSkillXP(135 * XPRATE, 11);
break;
case 4:
p.addSkillXP(202.5 * XPRATE, 11);
break;
case 5:
p.addSkillXP(303.75 * XPRATE, 11);
break;
}
}
}
INTO A FOLDER CALLED:
Yousource.Skills.Firemaking.*
Save it as Firemaking.java
|| STEP TWO ||
Put this code in to the folder too:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Yoursource.Skills.Firemaking;
import Yoursource.players.Player;
/**
*
* @author SiniSoul
*/
public class FireObject {
public Player p;
private int OBJECT = 2732;
public int TIMER = -1;
public int x = 0;
public int y = 0;
public int h = 0;
private int TYPE = 10;
private int FACE = 0;
public FireObject (Player _p, int _x, int _y, int _h, int _TIMER) {
p = _p;
x = _x;
y = _y;
h = _h;
TIMER = _TIMER;
createFireObject();
}
private void createFireObject() {
p.frames.deleteObject(p, x, y);
p.frames.createGlobalObject(2733, h, x, y, FACE, TYPE);
p.frames.createGlobalObject(OBJECT, h, x, y, FACE, TYPE);
}
}
Save it as FireObject.java
|| STEP THREE ||
Open Player.java
add this import...
import Yousource.Skills.Firemaking.Firemaking;
And put this anywhere something isn't called.
public Firemaking FM = new Firemaking();
Ctrl + F ( process() )
And in the process() {
Add this:
this.FM.playerProcess(this);
|| STEP FOUR ||
Open Frames.java
Insert This.
public void resetAnimations(Player p) {
p.stream.createFrame(114);
}
public void deleteObject(Player p, int objectX, int objectY) {
sendCoords(p, (objectX - ((p.mapRegionX - 6) * 8)), (objectY - ((p.mapRegionY - 6) * 8)));
p.stream.createFrame(196);
p.stream.writeByteC(0);
p.stream.writeByteC(0);
}
public void deleteGlobalObject(int objectX, int objectY) {
for(Player p: Engine.players) {
if (p == null) continue;
sendCoords(p, (objectX - ((p.mapRegionX - 6) * 8)), (objectY - ((p.mapRegionY - 6) * 8)));
p.stream.createFrame(196);
p.stream.writeByteC(0);
p.stream.writeByteC(0);
}
}
public void deleteStaticObject(int height, int objectX, int objectY) {
for (Player p : Engine.players) {
if (p == null)
continue;
if (p.heightLevel == height)
createObject(p, 6951, height, objectX, objectY, -1, 10);
}
}
Well...I think thats it...If I missed anything I will be on all day today and just drop me a PM or contact me at SiniSoul@live.com.
Thanks, Please...Don't Leech.