[Release] Doofus - Negative exp fixer (SIMPLE)

Try testing it :]
This actually does work in-game. The first chat doesn't go away until the player had made a selection of either yes (reset exp to 0) or no (closes chat).

@evilsinxd
Once again, make your own thread then.

I'm lazy to test lols =x .
But by looking at it it doesnt seem to be working o_O .
I may be wrong .. Sorry if its so :]
 
I'm lazy to test lols =x .
But by looking at it it doesnt seem to be working o_O .
I may be wrong .. Sorry if its so :]

If you don't wanna test it, feel free to go onto my server (info on my sig).
Go to Doofus NPC @ Henesys Marketplace. &Click him yourself :]

I just dunwan SPAM ragezone =D so merge the thread should better.

How about NOT posting anything at all to prevent it?
 
one with exp check is always better lol
use this function (dont forget to compile) if you dont have it yet
Code:
public int getExp() {
                return getPlayer().getExp();
        }

npc script:

Code:
var status = 0;

function start() {
 status = -1;
 action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0) {
			cm.sendOk("OK then, see you next time!");
   			cm.dispose();
   			return;
  		}
		if (mode == 1)
   			status++;
  		else
   			status--;
  		if (status == 0) {
  		    cm.sendYesNo("Hey there, if you have negative exp, i will fix it for you\r\nShall i?");
  		} else {
  		    if (cm.getExp() < 0) {
  		        cm.setExp(0);
  		        cm.sendOk("Ok, i fixed it, have fun!");
  		        cm.dispose();
  		    } else {
  		        cm.sendOk("You don't have negative exp!");
  		        cm.dispose();
  		    }
  		}
  	}
}
 
one with exp check is always better lol
use my getExp function if you havent got it yet (check my releases, its in the exp seller thread)

Code:
var status = 0;

function start() {
 status = -1;
 action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0) {
			cm.sendOk("OK then, see you next time!");
   			cm.dispose();
   			return;
  		}
		if (mode == 1)
   			status++;
  		else
   			status--;
  		if (status == 0) {
                                               cm.sendYesNo("Hey there, if you have negative exp, i will fix it for you\r\nShall i?");
                                           } else {
                                               if (cm.getExp() < 0) {
                                                   cm.setExp(0);
                                                   cm.sendOk("Ok, i fixed it, have fun!");
                                                   cm.dispose();
                                               } else {
                                                   cm.sendOk("You don't have negative exp!");
                                                   cm.dispose();
                                               }
                                           }
                     }
}
won't the players complain about a loss of exp ? why not convert it to positive. or issue a level up if needed.
 
thats also possible
then you would get something like

Code:
if (cm.getExp() < 0) {
    cm.setExp(-(cm.getExp()));
    cm.sendOk("Ok, i fixed it, have fun!");
    cm.dispose();
}
 
Back