This pet's system has been sold by someone called 'Ryan Phillips'.
I have the permission of the other creator to release this.
Ryan Phillips is not the original creator, he only wants to take all credits, and sell this.
When i confronted him with this, he tried to RAT me.
Create a new class called Pets.java in Players, don't forget to change imports & package.
Code:
package server.entity.player;
import server.Server;
import server.entity.npcs.*;
import server.entity.player.Client;
/**
*
* @author Tokashi
*
*/
public class Pets {
public void pickUp(Client c, int Type) {
if (c.inWild){
c.sendMessage("How did you get a pet in the wilderness?");
}
for (int i = 0; i < NPCHandler.maxNPCs; i++) {
if (NPCHandler.npcs[i] == null)
continue;
}
for (int i = 0; i < NPCHandler.maxNPCs; i++) {
if (NPCHandler.npcs[i] != null) {
if (NPCHandler.npcs[i].npcType == Type) {
if (NPCHandler.npcs[i].spawnedBy == c.playerId && NPCHandler.npcs[i].spawnedBy > 0) {
NPCHandler.npcs[i].absX = 0;
NPCHandler.npcs[i].absY = 0;
NPCHandler.npcs[i] = null;
break;
}
}
}
}
}
int[][] Pets = {
{3505, 7583}, //Hell Kitten
{3506, 7584}, //Lazy Hellcat
{766, 1560}, //Hell Kitten
{3507, 7585}, //Wily hellcat
{765, 1559}, //Pet Kitten
{764, 1558}, //Pet Kitten
{763, 1557}, //Pet Kitten
{762, 1556}, //Pet Kitten
{761, 1555}, //Pet Kitten
{768, 1561}, //Pet Kitten
{769, 1562}, //Pet Kitten
{770, 1563}, //Pet Kitten
{771, 1564}, //Pet Kitten
{772, 1565}, //Pet Kitten
{773, 1566}, //Pet Kitten
{4000, 12500}, //Prince
{4001, 12501}, //Ele Jr
{4002, 12502}, //Bandos
{4003, 12503}, //Arma
{4004, 12504}, //Zammy
{4005, 12505}, //Sara
{4006, 12506}, //Dag Sup
{4007, 12507}, //Dag Pri
{4008, 12508}, //Dag Rex
};
public void pickUpClean(Client c, int id) {
for (int i = 0; i < Pets.length; i++)
if (Pets[i][0] == id)
c.getItems().addItem(Pets[i][1], 1);
for (int i = 0; i < NPCHandler.maxNPCs; i++) {
if (NPCHandler.npcs[i] == null)
continue;
if (NPCHandler.npcs[i].npcType == id) {
NPCHandler.npcs[i].absX = 0;
NPCHandler.npcs[i].absY = 0;
}
}
c.hasNpc = false;
}
public void dropPet(Client c, int itemId) {
if (!c.hasNpc && c.summonId < 1) {
c.turnPlayerTo(c.absX, c.absY-1);
Server.npcHandler.spawnNpc3(c, Server.npcHandler.summonItemId(itemId), c.absX, c.absY-1, c.heightLevel, 0, 120, 25, 200, 200, true, false, true);
c.getPA().followPlayer();
c.getItems().deleteItem(itemId, 1);
c.hasNpc = true;
} else {
c.sendMessage("You already have a pet following you.");
return;
}
}
}
In your ActionHandler class, search for this:
Code:
public void firstClickNpc(int npcType) {
Add this under the switch:
Code:
//pets pickup
case 3506:
case 3507:
case 761:
case 760:
case 762:
case 763:
case 764:
case 765:
case 766:
case 767:
case 768:
case 769:
case 770:
case 771:
case 772:
case 773:
case 3505:
case 4000:
case 4001:
case 4002:
case 4003:
case 4004:
case 4005:
case 4006:
case 4007:
case 4008:
c.getSummon().pickUpClean(c, c.summonId);
c.hasNpc = false;
c.summonId = 0;
break;
If i missed anything, please let me know.
Do not buy this from Ryan Phillips, he is a huge fraud.
This wasn't hard to do.
The models are in the attachment, make sure to put them in your Raw folder in your cache.
Credits:
Me
Tokashi
Need a reliable programmer for your website?
Add me on skype and let's talk!
(Cheap and active, 24/7 support)
Why are people so concerned about the credits? If I wrote this some time in the past I would try and act like I didn't - it's absolutely terrible. Just look at your nested loop in pickup - jesus christ! c.getSummon().pickUp(c, id) what's the point of passing in these arguments? Now for a second let us pretend that this was worth keeping - you would declare "hasNpc" "summonedNpc" etc INSIDE the pets class (c.getSummoning().pickUp(); - since WHERE ELSE BESIDES THE SUMMONING HANDLER DO YOU NEED THOSE VARIABLES? It makes no sense to put them inside the Client class and then pass in the client into each method). It should work something like (inside pets)
currentPet = createNpc(args...)
instead of passing the Client in to set it's summoned npc to it - return it and then no need to increase the scope of your variables
pet pick-ups shouldn't pass in c.summonedId - it should pass in what you are switching
There truly are so many things wrong with this, I would recommend just deleting it and rewriting it (It will take less time to do so than correcting all the things wrong with this)