|
Like Kris said and i tried to say before there is no need.
I disagree with Arham about putting morphing stuff in the enum. They're so unique and there's only like 2 pets that have morphing options. Storing it in the enum is pointless IMO. Can be done but it really won't be any help. Morphism has unique settings (For example a small chance of morphing your pet into a golden version or whatever).. which'd need to be written separately anyways.
I hadn't really read your method for the morphing. I agree with Arham, it's a bit much rn. Personally I'd make a little immutable map and store it in there. E.g. map.get(orange_vetion_id) would return purple and vice versa. Of course the only exception would be the golden version but that is just one/two lines.
I also advise you not to make a new object over and over. There's simply no point. Referring to:
Just make a final static object in the class and refer to the same random object.Code:if (new Random().nextInt(1000) == 0) {
Code:private static final Random RANDOM = new Random(); method() { if (pet == Pet.CHIN && RANDOM.nextInt(1000) == 0) { morphId = goldenId; return; } morphId = IMMUTABLE_MAP.get(petId); }
private Pet(final int itemId, final int npcId, final int hiddenNpcId, final Class<? extends Dialogue> dialogue)
First is regular npc id - the one with right click options. The second is the npc without the right click options.
Basically the pet will only show the right click options to its owner - the rest of the player won't even be able to examine the pets. That's how it is in OSRS.
thanks
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |