Newbie Spellweaver
- Joined
- Dec 27, 2004
- Messages
- 16
- Reaction score
- 0
I was looking at l2x, and they have a LOT of custom pets, like frogs, bats, orcs, etc. I was curious as to how we can make our own custom pets..?
Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!
Join Today!mmmmAdrien said:I dident still try but i think u have to change l2npc to l2pet and with eclipse use that an item spawn that mob like with hatchling
/ // all the items ids that this handler knowns
private static final int[] _itemIds = { 2375, 3500, 3501, 3502, 4422, 4423, 4424, 69000, 69001, [COLOR="red"]place itemID for item used to summon here[/COLOR] **;
/* (non-Javadoc)
* @see net.sf.l2j.gameserver.handler.IItemHandler#useItem(net.sf.l2j.gameserver.model.L2PcInstance, net.sf.l2j.gameserver.model.L2ItemInstance)
*/
public void useItem(L2PlayableInstance playable, L2ItemInstance item)
{
if (!(playable instanceof L2PcInstance))
return;
L2PcInstance activeChar = (L2PcInstance)playable;
int npcId;
if (activeChar.getPet() != null)
{
if (Config.DEBUG) _log.fine("player has a pet already. ignore use item");
return;
**
if (activeChar.isMounted())
return;
switch (item.getItemId())
{
// wolf pet a
case 2375:
npcId = 12077;
break;
// hatchling of wind
case 3500:
npcId = 12311;
break;
// hatchling of star
case 3501:
npcId = 12312;
break;
// hatchling of twilight
case 3502:
npcId = 12313;
break;
// wind strider
case 4422:
npcId = 12526;
break;
// Star strider
case 4423:
npcId = 12527;
break;
// Twilight strider
case 4424:
npcId = 12528;
break;
//new pet ID goes here
case [COLOR="red"]item used to sumon ID[/COLOR]:
npcId = [COLOR="red"]new NPC id[/COLOR];
**
L2ItemInstance food = null;
switch (getTemplate().npcId)
{
// wolf
case 12077:
food = getInventory().findItemByItemId(2515);
break;
//hatchling of wind
case 12311:
food = getInventory().findItemByItemId(4038);
break;
// hatchling of star
case 12312:
food = getInventory().findItemByItemId(4038);
break;
// hatchling of twilight
case 12313:
food = getInventory().findItemByItemId(4038);
break;
// wind strider
case 12526:
food = getInventory().findItemByItemId(5168);
break;
// Star strider
case 12527:
food = getInventory().findItemByItemId(5168);
break;
// Twilight strider
case 12528:
food = getInventory().findItemByItemId(5168);
break;
//new pet
case [COLOR="red"]new pet ID[/COLOR]:
food = getInventory().findItemByItemId(5168); //you can place any id for the food, I just use the ID for wolf food to keep it simple