Update rebirth NPC to allow for path selection
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
@author wejrox
|
||||
*/
|
||||
var status;
|
||||
var jobId = 0;
|
||||
|
||||
function start() {
|
||||
status = -1;
|
||||
@@ -50,7 +51,7 @@ function action(mode, type, selection) {
|
||||
} else if (status === 2) {
|
||||
if (selection === 0) {
|
||||
if (cm.getChar().getLevel() === 200) {
|
||||
cm.sendYesNo("Are you sure you want to be reborn?");
|
||||
cm.sendSimple("I see... and which path would you like to take? \r\n\r\n #L0##bExplorer (Beginner)#l \r\n #L1##bCygnus Knight (Noblesse)#l \r\n #L2##bAran (Legend)#l");
|
||||
} else {
|
||||
cm.sendOk("You are not level 200, please come back when you hit level 200.");
|
||||
cm.dispose();
|
||||
@@ -59,8 +60,19 @@ function action(mode, type, selection) {
|
||||
cm.sendOk("See you soon!")
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (status === 3 && type === 1) {
|
||||
cm.getChar().executeReborn();
|
||||
} else if (status === 3) {
|
||||
// 0 => beginner, 1000 => noblesse, 2000 => legend
|
||||
// makes this very easy :-)
|
||||
jobId = selection * 1000;
|
||||
|
||||
var job = "";
|
||||
if (selection === 0) job = "Beginner";
|
||||
else if (selection === 1) job = "Noblesse";
|
||||
else if (selection === 2) job = "Legend";
|
||||
cm.sendYesNo("Are you sure you want to be reborn as a " + job + "?");
|
||||
}
|
||||
else if (status === 4 && type === 1) {
|
||||
cm.getChar().executeRebornAsId(jobId);
|
||||
cm.sendOk("You have now been reborn. That's a total of #r" + cm.getChar().getReborns() + "#k rebirths");
|
||||
cm.dispose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user