详细内容

独家重磅发布,完美转生与转职合为一体的JS

发布时间:2010/7/22   阅读指数:

首先请进入NPC的JS文件夹内,任意找一个NPC的JS文件然后用文本文档方式打开,将以下内容全部复制并粘贴进去。然后关闭进行保存,无需重启服务器。

/* Job NPC 1002006
 * @Author 
www.lovemxd.com
 */

importPackage(net.sf.odinms.client);
importPackage(net.sf.odinms.tools);
importPackage(java.lang);

var jobName;
var job;
var text11,text30,text00;
var choose;
var initial,virtue;
var camp1,camp2,camp3;

var showjob1 = ["战士","魂骑士","战神"];
var showjob2 = ["法师","炎术士"];
var showjob3 = ["射手","风灵使"];
var showjob4 = ["飞侠","夜行者"];
var showjob5 = ["海盗","奇袭者"];
var showname;
var selectjob;
var campis;

var camp = 1; // 1-3

function start() {
    status = -1;
    action(1, 0, 0);
    campis = Integer.valueOf(cm.getJobId() / 1000);
    campis2 = cm.getJobId() / 1000;
}

function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (mode == 1)
            status++;
        else
            status--;
        if (status == 0) {
            cm.sendNext("你好, 我是#b转职#k与#b重生#k指导员.");
        } else if (status == 1) {
            text11 = "祝贺你达到了#b11级#k. 那么你想选择的 #r第一职业#k 是?#b\r\n";
            text30 = "祝贺你达到了30级. 你想转职为: #b#k\r\n";
            text00 = "祝贺你达到了" + cm.getLevel() + "级. 你是否想转职为 #r";
            if (cm.getLevel() < 200 && (campis2 == 0.0 || campis2 == 1.0 || campis2 == 2.0)) {
                if (cm.getLevel() < 11) {
                    cm.sendOk("对不起, 你至少要达到#b11级#k我才能为你服务.");
                    cm.dispose();
                } else {
                    for(var j=1;j<=5;j++){
                        for(var i=0;i<camp;i++){
                            selectjob = i*1000+100*j;
                            if (j==1)
                                showname = showjob1[i];
                            if (j==2)
                                showname = showjob2[i];
                            if (j==3)
                                showname = showjob3[i];
                            if (j==4)
                                showname = showjob4[i];   
                            if (j==5)
                                showname = showjob5[i];      
                            if (showname == null)
                                break;         
                            text11 += "#L" + selectjob + "#" + showname + "#l \t\t"
                        }
                        text11 +="\r\n";
                    }
                    cm.sendSimple(text11);
                    initial = 11;
                }
            } else if (cm.getLevel() < 30){
                cm.sendOk("对不起, 你必须达到#b30级#k才能进行#r第二次转职#k.");
                cm.dispose();
            } else if (cm.getJob().equals(MapleJob.WARRIOR)) {
                camp1 = 30.110;
                text30 += "#L110#剑客#l\r\n#L120#准骑士#l\r\n#L130#枪战士#l";
                cm.sendSimple(text30);
            } else if (cm.getJob().equals(MapleJob.MAGICIAN)) {
                camp1 = 30.210;
                text30 += "#L210#火毒法师#l\r\n#L220#冰雷法师#l\r\n#L230#牧师#l";
                cm.sendSimple(text30);
            } else if (cm.getJob().equals(MapleJob.BOWMAN)) {
                camp1 = 30.310;
                text30 += "#L310#猎人#l\r\n#L320#弩手#l";
                cm.sendSimple(text30);
            } else if (cm.getJob().equals(MapleJob.THIEF)) {
                camp1 = 30.410;
                text30 += "#L410#刺客#l\r\n#L420#侠客#l";
                cm.sendSimple(text30);
            } else if (cm.getJob().equals(MapleJob.PIRATE)) {
                camp1 = 30.510;
                text30 += "#L510#拳手#l\r\n#L520#火枪手#l";
                cm.sendSimple(text30);
/*
} else if (cm.getJob().equals(MapleJob.DAWNWARRIOR1)) { // 无骑士团的屏蔽掉这里
                camp1 = 31.1110;
                jobName = "魂骑士 Ⅱ";
                job = MapleJob.DAWNWARRIOR2;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.BLAZEWIZARD1)) {
                camp1 = 31.1210;
                jobName = "炎术士 Ⅱ";
                job = MapleJob.BLAZEWIZARD2;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.WINDARCHER1)) {
                camp1 = 31.1310;
                jobName = "风灵使 Ⅱ";
                job = MapleJob.WINDARCHER2;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.NIGHTWALKER1)) {
                camp1 = 31.1410;
                jobName = "夜行者 Ⅱ";
                job = MapleJob.NIGHTWALKER2;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.THUNDERBREAKER1)) {
                camp1 = 31.1510;
                jobName = "奇袭者 Ⅱ";
                job = MapleJob.THUNDERBREAKER2;
                cm.sendYesNo(text00 + jobName);

} else if (cm.getJob().equals(MapleJob.ARAN2)) { // 无战神的屏蔽掉这里
                camp3 = 32.2110;
                jobName = "战神 Ⅱ";
                job = MapleJob.ARAN3;
                cm.sendYesNo(text00 + jobName);
*/
           
            } else if (cm.getLevel() < 70) {
                cm.sendOk("对不起, 你必须达到#b70级#k才能进行#r第三次转职#k.");
                cm.dispose();
            } else if (cm.getJob().equals(MapleJob.FIGHTER)) {
                camp1 = 70.111;
                jobName = "勇士";
                job = MapleJob.CRUSADER;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.PAGE)) {
                camp1 = 70.121;
                jobName = "骑士";
                job = MapleJob.WHITEKNIGHT;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.SPEARMAN)) {
                camp1 = 70.131;
                jobName = "龙骑士";
                job = MapleJob.DRAGONKNIGHT;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.FP_WIZARD)) {
                camp1 = 70.211;
                jobName = "火毒巫师";
                job = MapleJob.FP_MAGE;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.IL_WIZARD)) {
                camp1 = 70.221;
                jobName = "冰雷巫师";
                job = MapleJob.IL_MAGE;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.CLERIC)) {
                camp1 = 70.231;
                jobName = "祭司";
                job = MapleJob.PRIEST;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.HUNTER)) {
                camp1 = 70.311;
                jobName = "猎人";
                job = MapleJob.RANGER;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.CROSSBOWMAN)) {
                camp1 = 70.321;
                jobName = "游侠";
                job = MapleJob.SNIPER;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.ASSASSIN)) {
                camp1 = 70.411;
                jobName = "无影人";
                job = MapleJob.HERMIT;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.BANDIT)) {
                camp1 = 70.421;
                jobName = "独行客";
                job = MapleJob.CHIEFBANDIT;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.BRAWLER)) {
                camp1 = 70.511;
                jobName = "斗士";
                job = MapleJob.MARAUDER;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.GUNSLINGER)) {
                camp1 = 70.521;
                jobName = "大副";
                job = MapleJob.OUTLAW;
                cm.sendYesNo(text00 + jobName);
/*
} else if (cm.getJob().equals(MapleJob.DAWNWARRIOR2)) { // 无骑士团的屏蔽掉这里
                camp1 = 71.1111;
                jobName = "魂骑士 Ⅲ";
                job = MapleJob.DAWNWARRIOR3;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.BLAZEWIZARD2)) {
                camp1 = 71.1211;
                jobName = "炎术士 Ⅲ";
                job = MapleJob.BLAZEWIZARD3;
                    cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.WINDARCHER2)) {
                camp1 = 71.1311;
                jobName = "风灵使 Ⅲ";
                job = MapleJob.WINDARCHER3;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.NIGHTWALKER2)) {
                camp1 = 71.1411;
                jobName = "夜行者 Ⅲ";
                job = MapleJob.NIGHTWALKER3;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.THUNDERBREAKER2)) {
                camp1 = 71.1511;
                jobName = "奇袭者 Ⅲ";
                job = MapleJob.THUNDERBREAKER3;
                cm.sendYesNo(text00 + jobName);
 
} else if (cm.getJob().equals(MapleJob.ARAN3)) { // 无战神的屏蔽掉这里
                camp3 = 72.2111;
                jobName = "战神 Ⅲ";
                job = MapleJob.ARAN4;
                cm.sendYesNo(text00 + jobName);
*/
            } else if (cm.getLevel() < 120) {
                cm.sendOk("对不起, 你必须达到#b120级#k才能进行#r第四次转职#k.");
                cm.dispose();
            } else if (cm.getJob().equals(MapleJob.CRUSADER)) {
                camp1 = 120.112;
                jobName = "英雄";
                job = MapleJob.HERO;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.WHITEKNIGHT)) {
                camp1 = 120.122;
                jobName = "圣骑士";
                job = MapleJob.PALADIN;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.DRAGONKNIGHT)) {
                camp1 = 120.132;
                jobName = "黑骑士";
                job = MapleJob.DARKKNIGHT;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.FP_MAGE)) {
                camp1 = 120.212;
                jobName = "火毒魔导士";
                job = MapleJob.FP_ARCHMAGE;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.IL_MAGE)) {
                camp1 = 120.222;
                jobName = "冰雷魔导士";
                job = MapleJob.IL_ARCHMAGE;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.PRIEST)) {
                camp1 = 120.232;
                jobName = "主教";
                job = MapleJob.BISHOP;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.RANGER)) {
                camp1 = 120.312;
                jobName = "箭神";
                job = MapleJob.BOWMASTER;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.SNIPER)) {
                camp1 = 120.322;
                jobName = "弩神";
                job = MapleJob.CROSSBOWMASTER;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.HERMIT)) {
                camp1 = 120.412;
                jobName = "隐士";
                job = MapleJob.NIGHTLORD;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.CHIEFBANDIT)) {
                camp1 = 120.422;
                jobName = "侠盗";
                job = MapleJob.SHADOWER;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.MARAUDER)) {
                camp1 = 120.512;
                jobName = "冲锋队长";
                job = MapleJob.BUCCANEER;
                cm.sendYesNo(text00 + jobName);
            } else if (cm.getJob().equals(MapleJob.OUTLAW)) {
                camp1 = 120.522;
                jobName = "船长";
                job = MapleJob.CORSAIR;
                cm.sendYesNo(text00 + jobName);
/*
} else if (cm.getJob().equals(MapleJob.ARAN4)) { // 无战神的屏蔽掉这里
                camp3 = 122.2112;
                jobName = "战神 Ⅳ";
                job = MapleJob.ARAN5;
                cm.sendYesNo(text00 + jobName);
*/
            } else if (cm.getLevel() >= 200 || (cm.getLevel() >= 120 && campis == 1)) {//cm.getJobId() == 1111
                getCostAp();
                cm.sendYesNo("啊哈... 伟大的#b#h ##k。你已经通过一个漫长而充满挑战的道路,终于成为了风起云涌的人物。 \r\n如果您能给我#b冒险岛纪念币#k #v4001129#(新建角色时送1个), 我可以用我的乾坤大挪移心法,助你进行投胎转世! 您将成为1级的#b新手#k, 并且清空你的#b技能#k,然后扣除#r"+costAp+"#k个属性点。\r\n#k你当前转生次数为:#r"+cm.getChar().getReborns()+"#k次,你是否想#r转生#k呢?");
                initial = 1;
            //} else if (cm.getLevel() < 200) {
            //    cm.sendOk("对不起, 你已经完成了所有的转职. \r\n\r\n然而在这个世界阴暗的深处, 被#baexr#k封印的魔王正蠢蠢欲动, 它的残忍无人能及,你需要修炼的更加强大才能拯救所有的人. \r\n当你#r200级#k的时候再来找我吧.");
            //    cm.dispose();   
            } else {
                cm.dispose();
            }
        } else if (status == 2) {
            choose = selection;
            setJob();
            if (initial == 11) {
                cm.sendYesNo("你想成为 #r" + jobName + "#k 吗?");
            } else if (camp1 > 30 && camp1 < 31)  {
                cm.sendYesNo("你想成为 #r" + jobName + "#k 吗?");
            } else if (camp2 > 31 && camp2 < 32) {
                cm.changeJob(job);
                cm.sendOk("你去吧. 向着最后的胜利冲刺吧 :)");
                cm.dispose();
            } else if (camp3 > 32 && camp3 < 33) {
                cm.changeJob(job);
                cm.sendOk("你去吧. 也许不久的将来还能见到你 :)");
                cm.dispose();   
            } else if (camp1 > 70 && camp1 < 71) {
                cm.changeJob(job);
                cm.sendOk("你去吧. 向着最后的胜利冲刺吧 :)");
                cm.dispose();
            } else if (camp2 > 71 && camp2 < 72)  {
                cm.changeJob(job);
                cm.sendOk("你去吧. 我已经没什么可以教你的了 :)");
                cm.dispose();
            } else if (camp3 > 72 && camp3 < 73)  {
                cm.changeJob(job);
                cm.sendOk("你去吧. 向着最后的胜利冲刺吧 :)");
                cm.dispose();   
            } else if (camp1 > 120 && camp1 < 121)  {
                cm.changeJob(job);
                setSkill();
                cm.sendOk("你去吧. 我已经没什么可以教你的了 :)");
                cm.dispose();
            } else if (camp3 > 122 && camp3 < 123)  {
                cm.changeJob(job);
                cm.sendOk("你去吧. 我已经没什么可以教你的了 :)");
                setSkill();
                cm.dispose();   
            } else if (initial == 1)  {
                doReborn();
            }
        } else if (status == 3) {
            if (initial == 11) {
                if (virtue == 11.1 && cm.c.getPlayer().getStr() < 35){
                    cm.sendOk("你没有符合最小需求的 #r35 力量#k.");
                    cm.dispose();
                } else if (virtue == 11.2 && cm.c.getPlayer().getInt() < 20){
                    cm.sendOk("你没有符合最小需求的 #r20 智力#k.");
                    cm.dispose();
                } else if (virtue == 11.3 && cm.c.getPlayer().getDex() < 25){
                    cm.sendOk("你没有符合最小需求的 #r25 敏捷#k.");
                    cm.dispose();
                } else if (virtue == 11.4 && cm.c.getPlayer().getLuk() < 25){
                    cm.sendOk("你没有符合最小需求的 #r25 运气#k.");
                    cm.dispose();
                } else if (virtue == 11.5 && cm.c.getPlayer().getDex() < 25){
                    cm.sendOk("你没有符合最小需求的 #r25 敏捷#k.");
                    cm.dispose();
                } else {
                    cm.changeJob(job);
                    cm.sendOk("你去吧. 未来是属于你们的 :)");
                    cm.dispose();
                }
            } else if (camp1 > 30 && camp1 < 31)  {
                cm.changeJob(job);
                cm.sendOk("你去吧. 也许不久的将来还能见到你 :)");
                cm.dispose();
            }
        }
    }
}


function setJob() {
    if (choose == 100) {
        jobName = "战士";
        job = MapleJob.WARRIOR;
        virtue = 11.1;
    } else if (choose == 200) {
        jobName = "法师";
        job = MapleJob.MAGICIAN;
        virtue = 11.2;
    } else if (choose == 300) {
        jobName = "射手";
        job = MapleJob.BOWMAN;
        virtue = 11.3;
    } else if (choose == 400) {
        jobName = "飞侠";
        job = MapleJob.THIEF;
        virtue = 11.4;
    } else if (choose == 500) {
        jobName = "海盗";
        job = MapleJob.PIRATE;
        virtue = 11.5;
    } else if (choose == 1100) {
        jobName = "魂骑士";
        job = MapleJob.DAWNWARRIOR1;
        virtue = 11.1;
    } else if (choose == 1200) {
        jobName = "炎术士";
        job = MapleJob.BLAZEWIZARD1;
        virtue = 11.2;
    } else if (choose == 1300) {
        jobName = "风灵使";
        job = MapleJob.WINDARCHER1;
        virtue = 11.3;
    } else if (choose == 1400) {
        jobName = "夜行者";
        job = MapleJob.NIGHTWALKER1;
        virtue = 11.4;
    } else if (choose == 1500) {
        jobName = "奇袭者";
        job = MapleJob.THUNDERBREAKER1;
        virtue = 11.5;
    } else if (choose == 2100) {
        jobName = "战神";
        job = MapleJob.ARAN2;
        virtue = 11.1;   
    } else if (choose == 110) {
        jobName = "剑客";
        job = MapleJob.FIGHTER;
    } else if (choose == 120) {
        jobName = "准骑士";
        job = MapleJob.PAGE;
    } else if (choose == 130) {
        jobName = "枪战士";
        job = MapleJob.SPEARMAN;
    } else if (choose == 210) {
        jobName = "火毒法师";
        job = MapleJob.FP_WIZARD;
    } else if (choose == 220) {
        jobName = "冰雷法师";
        job = MapleJob.IL_WIZARD;
    } else if (choose == 230) {
        jobName = "牧师";
        job = MapleJob.CLERIC;
    } else if (choose == 310) {
        jobName = "猎人";
        job = MapleJob.HUNTER;
    } else if (choose == 320) {
        jobName = "弩手";
        job = MapleJob.CROSSBOWMAN;
    } else if (choose == 410) {
        jobName = "刺客";
        job = MapleJob.ASSASSIN;
    } else if (choose == 420) {
        jobName = "侠客";
        job = MapleJob.BANDIT;
    } else if (choose == 510) {
        jobName = "拳手";
        job = MapleJob.BRAWLER;
    } else if (choose == 520) {
        jobName = "火枪手";
        job = MapleJob.GUNSLINGER;
    }
}

function setSkill() {
    if (cm.getJob().equals(MapleJob.HERO)) {
        cm.teachSkill(1120003,0,30);
        cm.teachSkill(1120004,0,30);
        cm.teachSkill(1120005,0,30);
        cm.teachSkill(1121001,0,20);
        cm.teachSkill(1121002,0,30);
        cm.teachSkill(1121006,0,30);
        cm.teachSkill(1121008,0,30);
        //cm.teachSkill(1121010,0,30); // 葵花宝典[无效]
        //cm.teachSkill(1121000,0,20); // 冒险岛勇士
        //cm.teachSkill(1121011,0,5);  // 勇士的意志
    } else if (cm.getJob().equals(MapleJob.PALADIN)) {
        cm.teachSkill(1220005,0,30);
        cm.teachSkill(1220006,0,30);
        cm.teachSkill(1220010,0,10);
        cm.teachSkill(1221001,0,30);
        cm.teachSkill(1221002,0,30);
        cm.teachSkill(1221003,0,20);
        cm.teachSkill(1221004,0,20);
        cm.teachSkill(1221007,0,30);
        cm.teachSkill(1221009,0,30);
        cm.teachSkill(1221011,0,30);
        //cm.teachSkill(1221000,0,30);
        //cm.teachSkill(1221012,0,5);
    } else if (cm.getJob().equals(MapleJob.DARKKNIGHT)) {
        cm.teachSkill(1320005,0,30);
        cm.teachSkill(1320006,0,30);
        cm.teachSkill(1321007,0,10);
        cm.teachSkill(1320008,0,25);
        cm.teachSkill(1320009,0,25);
        cm.teachSkill(1321001,0,30);
        cm.teachSkill(1321002,0,30);
        cm.teachSkill(1321003,0,30);
        //cm.teachSkill(1321000,0,20);
        //cm.teachSkill(1321010,0,5);
    } else if (cm.getJob().equals(MapleJob.FP_ARCHMAGE)) {
        cm.teachSkill(2121001,0,30);
        cm.teachSkill(2121002,0,30);
        cm.teachSkill(2121003,0,30);
        cm.teachSkill(2121004,0,30);
        cm.teachSkill(2121005,0,30);
        cm.teachSkill(2121006,0,30);
        cm.teachSkill(2121007,0,30);
        //cm.teachSkill(2121000,0,20);
        //cm.teachSkill(2121008,0,5);
    } else if (cm.getJob().equals(MapleJob.IL_ARCHMAGE)) {
        cm.teachSkill(2221001,0,30);
        cm.teachSkill(2221002,0,30);
        cm.teachSkill(2221003,0,30);
        cm.teachSkill(2221004,0,30);
        cm.teachSkill(2221005,0,30);
        cm.teachSkill(2221006,0,30);
        cm.teachSkill(2221007,0,30);
        //cm.teachSkill(2221000,0,20);
        //cm.teachSkill(2221008,0,5);
    } else if (cm.getJob().equals(MapleJob.BISHOP)) {
        cm.teachSkill(2321000,0,20);
        cm.teachSkill(2321001,0,30);
        cm.teachSkill(2321002,0,30);
        cm.teachSkill(2321003,0,30);
        cm.teachSkill(2321004,0,30);
        cm.teachSkill(2321005,0,30);
        cm.teachSkill(2321006,0,10);
        cm.teachSkill(2321007,0,30);
        cm.teachSkill(2321008,0,30);
        //cm.teachSkill(2321009,0,5);
    } else if (cm.getJob().equals(MapleJob.BOWMASTER)) {
        cm.teachSkill(3120005,0,30);
        cm.teachSkill(3121002,0,30);
        cm.teachSkill(3121003,0,30);
        cm.teachSkill(3121004,0,30);
        cm.teachSkill(3121006,0,30);
        cm.teachSkill(3121007,0,30);
        cm.teachSkill(3121008,0,30);
        //cm.teachSkill(3121000,0,20);
        //cm.teachSkill(3121009,0,5);
    } else if (cm.getJob().equals(MapleJob.CROSSBOWMASTER)) {
        cm.teachSkill(3220004,0,30);
        cm.teachSkill(3221001,0,30);
        cm.teachSkill(3221002,0,30);
        cm.teachSkill(3221003,0,30);
        cm.teachSkill(3221005,0,30);
        cm.teachSkill(3221006,0,30);
        cm.teachSkill(3221007,0,30);
        //cm.teachSkill(3221000,0,20);
        //cm.teachSkill(3221008,0,5);
    } else if (cm.getJob().equals(MapleJob.NIGHTLORD)) {
        cm.teachSkill(4120002,0,30);
        cm.teachSkill(4121003,0,30);
        cm.teachSkill(4121006,0,30);
        cm.teachSkill(4121007,0,30);
        cm.teachSkill(4121008,0,30);
        //cm.teachSkill(4120005,0,30); // 武器用毒液
        //cm.teachSkill(4121004,0,30); // 忍者伏击
        //cm.teachSkill(4121000,0,30);
        //cm.teachSkill(4121009,0,5);
    } else if (cm.getJob().equals(MapleJob.SHADOWER)) {
        cm.teachSkill(4220002,0,30);
        cm.teachSkill(4220005,0,30);
        cm.teachSkill(4221001,0,30);
        cm.teachSkill(4221007,0,30);
        //cm.teachSkill(4221004,0,30); // 忍者伏击
        //cm.teachSkill(4221006,0,30); // 烟幕弹
        //cm.teachSkill(4221003,0,30); // 挑衅
        //cm.teachSkill(4221000,0,20);
        //cm.teachSkill(4221008,0,5);
    } else if (cm.getJob().equals(MapleJob.BUCCANEER)) {
        cm.teachSkill(5121001,0,30);
        cm.teachSkill(5121002,0,30);
        cm.teachSkill(5121003,0,20);
        cm.teachSkill(5121004,0,30);
        cm.teachSkill(5121005,0,30);
        cm.teachSkill(5121007,0,30);
        cm.teachSkill(5121009,0,20);
        cm.teachSkill(5121010,0,30);
        //cm.teachSkill(5121000,0,20);
        //cm.teachSkill(5121008,0,5);
    } else if (cm.getJob().equals(MapleJob.CORSAIR)) {
        cm.teachSkill(5220001,0,30);
        cm.teachSkill(5220002,0,20);
        cm.teachSkill(5220011,0,20);
        cm.teachSkill(5221003,0,30);
        cm.teachSkill(5221004,0,30);
        cm.teachSkill(5221006,0,10);
        cm.teachSkill(5221007,0,30);
        cm.teachSkill(5221008,0,30);
        cm.teachSkill(5221009,0,20);
        //cm.teachSkill(5221000,0,20);
        //cm.teachSkill(5221010,0,5);
/*
} else if (cm.getJob().equals(MapleJob.ARAN5)) { // 无战神的屏蔽掉这里
        cm.teachSkill(21120001,0,30);
        cm.teachSkill(21120002,0,30);
        cm.teachSkill(21120004,0,30);
        cm.teachSkill(21120005,0,30);
        cm.teachSkill(21120006,0,30);
        cm.teachSkill(21120007,0,30);
        cm.teachSkill(21120009,0,30);
        cm.teachSkill(21120010,0,30);
        cm.teachSkill(21121000,0,30);
        cm.teachSkill(21121003,0,30);
        //cm.teachSkill(21121008,0,5);
*/
    }
}

var newAp,newStr,newDex,newInt,newLuk;
var costAp;
var maxReborns = 5;

function getCostAp() {
    if (campis == 1) {
        costAp = 1000;
    } else {
        costAp = 600;
    }
}

function doReborn() {
    var p = cm.getPlayer();
    newStr =  p.getStr();
    newDex =  p.getDex();
 newInt =  p.getInt();
 newLuk =  p.getLuk();
    var totStat = newStr + newDex + newInt + newLuk - 16;
    maxReborns = p.getVip() * 30 + 10;
    if (p.getReborns() >= maxReborns) {
        cm.sendOk("你达到了转生次数上限!");
        cm.dispose();
    }
    if (!cm.haveItem(4001129)) {
        cm.sendOk("你没有带来#b冒险岛纪念币#k!");
        cm.dispose();
    } else {
        if(p.getRemainingAp() >= costAp){
            newAp = p.getRemainingAp() - costAp;
            newStat();
        } else {
            newAp = 0;
            costAp = costAp - p.getRemainingAp();
            if (totStat >= costAp) {
                for (var i = 0; i <= costAp; i++) {
                    if (newStr > 4) {
                        newStr -=1;
                        costAp -=1;
                    }
                    if (newDex > 4) {
                        newDex -=1;
                        costAp -=1;
                    }
                    if (newInt > 4) {
                        newInt -=1;
                        costAp -=1;
                    }
                    if (newLuk > 4) {
                        newLuk -=1;
                        costAp -=1;
                    }
                }
                newStat();
            } else {
                getCostAp();
                cm.sendOk("属性点不够,无法转生!请确保你的AP点数或属性总和-16后达到#b"+costAp+"#k.");
                cm.dispose();
            }
        }
       
    }
}

function newStat() {
    p.setLevel(1);
    cm.gainItem(4001129,-1);
    cm.gainReborns(1);
    if (campis == 0) {
        cm.changeJob(MapleJob.BEGINNER);
    }
    if (campis == 1) {
        cm.changeJob(MapleJob.NOBLESSE);
       
    }
    if (campis == 2) {
        cm.changeJob(MapleJob.LEGEND);
    }
    var statup = new java.util.ArrayList();
    var p = cm.getPlayer();
    p.setStr(newStr);
    p.setDex(newDex);
    p.setInt(newInt);
    p.setLuk(newLuk);
    p.setRemainingAp(newAp);
    statup.add(new Pair(MapleStat.STR, Integer.valueOf(newStr)));
    statup.add(new Pair(MapleStat.DEX, Integer.valueOf(newDex)));
    statup.add(new Pair(MapleStat.INT, Integer.valueOf(newInt)));
    statup.add(new Pair(MapleStat.LUK, Integer.valueOf(newLuk)));
    statup.add(new Pair(MapleStat.AVAILABLEAP, Integer.valueOf(newAp)));
    statup.add(new Pair(MapleStat.EXP, Integer.valueOf(0)));
    statup.add(new Pair(MapleStat.LEVEL, Integer.valueOf(1)));
    statup.add(new Pair(MapleStat.JOB, Integer.valueOf(campis*1000)));
    p.getClient().getSession().write(MaplePacketCreator.updatePlayerStats(statup));
    //cm.unequipEverything();
    //cm.clearSkills();
    cm.sendOk("#b您做得非常好#k, 为你成功#e投胎转世#n高兴吧!");
    cm.dispose();
}

本文来源于心动冒险岛(www.lnshengyou.com),如需转载[独家重磅发布,完美转生与转职合为一体的JS],请写明出处

上一篇:龙骑职业纯手动从1级升级到74级
下一篇:开放083版本后我的商人旅途宣布失败
返回顶部