Programming, Music, Games. Creation.

Phantom Card Stack Bug fix – Maple Story Private Server v117

Guide for newbies :

Go to MapleCharacter.java in src/client folder
Find public void handlecardstack
and replace the code as follows

//

This fixes problem of cards randomly flying around in fixed position when the stack is full, making the player unable to attack.
Found the bug during development of v117 private server, and fixed it myself.
Coded by Bermuda, please redirect to this page if you would like to share.


public void handleCardStack() {
 Skill noir = SkillFactory.getSkill(24120002);
 Skill blanc = SkillFactory.getSkill(24100003);
 MapleStatEffect ceffect = null;
 int advSkillLevel = getTotalSkillLevel(noir);
 boolean isAdv = false;
 if (advSkillLevel > 0) {
 ceffect = noir.getEffect(advSkillLevel);
 isAdv = true;
 } else if (getSkillLevel(blanc) > 0) {
 ceffect = blanc.getEffect(getTotalSkillLevel(blanc));
 } else {
 return;
 }
 if (getJob() == 2412 && getCardStack() == 40){ //maxisbac.wordpress.com - coded by Bermuda.
 this.runningStack=0;//maxisbac.wordpress.com - coded by Bermuda.
 this.cardStack = (byte)(40);//maxisbac.wordpress.com - coded by Bermuda.
 }
 if (getJob() == 2400 && getCardStack() == 20 || getJob() == 2410 && getCardStack() == 20 || getJob() == 2411 && getCardStack() == 20){
 this.runningStack=0;//maxisbac.wordpress.com - coded by Bermuda.
 this.cardStack = (byte)(20);//maxisbac.wordpress.com - coded by Bermuda.
 }
 if (ceffect.makeChanceResult()) {
 if (this.cardStack < (getJob() == 2412 ? 40 : 20)) {
 this.cardStack = (byte)(this.cardStack + 1);
 }
 this.runningStack += 1;
 this.client.getSession().write(CField.gainCardStack(getId(), this.runningStack, isAdv ? 2 : 1, ceffect.getSourceId(), Randomizer.rand(100000, 500000), 1));
 this.client.getSession().write(CField.updateCardStack(this.cardStack));
 }
 }
 //maxisbac.wordpress.com - coded by Bermuda.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s