Welcome!

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!

Fix for pet food

Status
Not open for further replies.
Junior Spellweaver
Joined
Jun 25, 2008
Messages
166
Reaction score
0
credit to RMZero213
nx food bug:
if you use your nx food to level up your pet, when you have 26100 closeness,
your pet will be level 30 and when you'll get 30000 closeness your pet will be level 31 and you wont be able to use commands..
so this is how you fix it. very very simple...
open UseCashItemHandler.java
and replace this line
Code:
while (c.getPlayer().getPet().getCloseness() >= ExpTable.getClosenessNeededForLevel(c.getPlayer().getPet().getLevel())) {

with this one
Code:
while (c.getPlayer().getPet().getCloseness() >= ExpTable.getClosenessNeededForLevel(c.getPlayer().getPet().getLevel() + 1)) {

if you want to add chek level and closeness:

add those lines[if you already hace one just replace]
Code:
int closeness = c.getPlayer().getPet().getCloseness();
          int level= c.getPlayer().getPet().getLevel();

before line if(bla bla bla)

replace your if(bla bla bla)
with this
Code:
if ( closeness < 30000 || level < 30) {

add those lines
Code:
else {
                            c.getPlayer().getPet().setFullness(100);
                            c.getPlayer().getPet().setCloseness(c.getPlayer().getPet().getCloseness() + 0);
                            c.getSession().write(MaplePacketCreator.updatePet(c.getPlayer().getPet().getPosition(), c.getPlayer().getPet().getItemId(), c.getPlayer().getPet().getUniqueId(), c.getPlayer().getPet().getName(), c.getPlayer().getPet().getLevel(), c.getPlayer().getPet().getCloseness(), c.getPlayer().getPet().getFullness(), true));
                        }


after those lines
Code:
c.getPlayer().getPet().setLevel(c.getPlayer().getPet().getLevel()+1);
					c.getSession().write(MaplePacketCreator.updatePet(c.getPlayer().getPet().getPosition(), c.getPlayer().getPet().getItemId(), c.getPlayer().getPet().getUniqueId(), c.getPlayer().getPet().getName(), c.getPlayer().getPet().getLevel(), c.getPlayer().getPet().getCloseness(), c.getPlayer().getPet().getFullness(), true));
					c.getSession().write(MaplePacketCreator.showPetLevelUp());
				}
			}


its should look like this
Code:
int closeness = c.getPlayer().getPet().getCloseness();
                                int level= c.getPlayer().getPet().getLevel();
                                if ( closeness < 30000 || level < 30) {
                                c.getPlayer().getPet().setFullness(100);
				c.getPlayer().getPet().setCloseness(c.getPlayer().getPet().getCloseness() + 100);
				c.getSession().write(MaplePacketCreator.updatePet(c.getPlayer().getPet().getPosition(), c.getPlayer().getPet().getItemId(), c.getPlayer().getPet().getUniqueId(), c.getPlayer().getPet().getName(), c.getPlayer().getPet().getLevel(), c.getPlayer().getPet().getCloseness(), c.getPlayer().getPet().getFullness(), true));
				//log.info("To be sent: {}", MaplePacketCreator.commandResponse(player.getId(), (byte) 1, true, true));
				c.getPlayer().getMap().broadcastMessage(c.getPlayer(), MaplePacketCreator.commandResponse(c.getPlayer().getId(), (byte) 1,  true, true), true);
				while (c.getPlayer().getPet().getCloseness() >= ExpTable.getClosenessNeededForLevel(c.getPlayer().getPet().getLevel() + 1)) {
					c.getPlayer().getPet().setLevel(c.getPlayer().getPet().getLevel()+1);
					c.getSession().write(MaplePacketCreator.updatePet(c.getPlayer().getPet().getPosition(), c.getPlayer().getPet().getItemId(), c.getPlayer().getPet().getUniqueId(), c.getPlayer().getPet().getName(), c.getPlayer().getPet().getLevel(), c.getPlayer().getPet().getCloseness(), c.getPlayer().getPet().getFullness(), true));
					c.getSession().write(MaplePacketCreator.showPetLevelUp());
				}
			} else {
                            c.getPlayer().getPet().setFullness(100);
                            c.getPlayer().getPet().setCloseness(c.getPlayer().getPet().getCloseness() + 0);
                            c.getSession().write(MaplePacketCreator.updatePet(c.getPlayer().getPet().getPosition(), c.getPlayer().getPet().getItemId(), c.getPlayer().getPet().getUniqueId(), c.getPlayer().getPet().getName(), c.getPlayer().getPet().getLevel(), c.getPlayer().getPet().getCloseness(), c.getPlayer().getPet().getFullness(), true));
                        }
                         }
 
Master Summoner
Member
Joined
Apr 20, 2008
Messages
578
Reaction score
76
Re: [RELEASE]Fix for pet food

Ha, you actually released it o.o Well the top part atleast.

Alas for the rest, I still think this is better o.o

Code:
				if (c.getPlayer().getPet() == null) {
					return;
				}
				c.getPlayer().getPet().setFullness(100);
				if (c.getPlayer().getPet().getCloseness() >= 30000 || c.getPlayer().getPet().getCloseness() + 100 >= 30000) {
					c.getPlayer().getPet().setCloseness(30000);
				} else {
					c.getPlayer().getPet().setCloseness(c.getPlayer().getPet().getCloseness() + 100);
				}
				c.getSession().write(MaplePacketCreator.updatePet(c.getPlayer().getPet().getPosition(), c.getPlayer().getPet().getItemId(), c.getPlayer().getPet().getUniqueId(), c.getPlayer().getPet().getName(), c.getPlayer().getPet().getLevel(), c.getPlayer().getPet().getCloseness(), c.getPlayer().getPet().getFullness(), true));
				//log.info("To be sent: {}", MaplePacketCreator.commandResponse(player.getId(), (byte) 1, true, true));
				c.getPlayer().getMap().broadcastMessage(c.getPlayer(), MaplePacketCreator.commandResponse(c.getPlayer().getId(), (byte) 1,  true, true), true);
				while (c.getPlayer().getPet().getCloseness() >= ExpTable.getClosenessNeededForLevel(c.getPlayer().getPet().getLevel() + 1)) {
					c.getPlayer().getPet().setLevel(c.getPlayer().getPet().getLevel()+1);
					c.getSession().write(MaplePacketCreator.updatePet(c.getPlayer().getPet().getPosition(), c.getPlayer().getPet().getItemId(), c.getPlayer().getPet().getUniqueId(), c.getPlayer().getPet().getName(), c.getPlayer().getPet().getLevel(), c.getPlayer().getPet().getCloseness(), c.getPlayer().getPet().getFullness(), true));
					c.getSession().write(MaplePacketCreator.showPetLevelUp());
				}
 
Junior Spellweaver
Joined
Jun 25, 2008
Messages
166
Reaction score
0
Re: [RELEASE]Fix for pet food

hmm..? i think its the same thing.. doing the same action... mine is better :D [jk]
my 150 message! :)
 
Junior Spellweaver
Joined
Jul 28, 2008
Messages
131
Reaction score
0
Re: [RELEASE]Fix for pet food

Any proof that it works ? if so

Thnx!!
 
Junior Spellweaver
Joined
Jun 25, 2008
Messages
166
Reaction score
0
Re: [RELEASE]Fix for pet food

o.o if i use it and zero use it, it works...
i can post a ss o.o
 
Junior Spellweaver
Joined
Jul 28, 2008
Messages
131
Reaction score
0
Re: [RELEASE]Fix for pet food

Lol sweeet , *uses*
 
Initiate Mage
Joined
Jul 14, 2008
Messages
45
Reaction score
0
Re: [RELEASE]Fix for pet food

Sweet post... the realease section is coming out with some decent some stuff now...
 
Skilled Illusionist
Joined
Apr 12, 2008
Messages
397
Reaction score
0
Re: [RELEASE]Fix for pet food

LOL, i just banned a person, or well, a person named Whee d/c'd when i did !ban...
 
Junior Spellweaver
Joined
Mar 21, 2008
Messages
169
Reaction score
0
Re: [RELEASE]Fix for pet food

Hey why not add a drop down message saying Your pet has reached the highest level! :biggrinth
 
Junior Spellweaver
Joined
Apr 4, 2008
Messages
157
Reaction score
11
Re: [RELEASE]Fix for pet food

This makes no sence, whatsoever. This could be better explained. It took me a while to figure it out.


Other then that, good release.
 
Initiate Mage
Joined
Jun 10, 2008
Messages
71
Reaction score
1
Re: [RELEASE]Fix for pet food

thx dis is wat i was missing thx alot
 
Status
Not open for further replies.
Back
Top