冒险岛外挂论坛:冒险岛单机脚本开发

最近在研究冒险岛的脚本开发,网上没找到啥资料,今天大佬给了个网站学习,做个笔记。
1)两种不同的NPC

//第一种,没有其他状态的NPCfunction start() { cm.sendOk("I am an NPC without a status."); cm.dispose();}//没有其他状态NPC的另一种写法function start() { cm.sendOk("Here is another example of an NPC without status.");}function action(mode, type, selection) { cm.warp(100000000, 0); cm.gainItem(4001126, 1); cm.sendOk("See? Here, I warped you and gave you an item without using status."); cm.dispose();} //第二种,带有状态的NPCvar status;function start() { status = -1; action(1, 0, 0);}function action(mode, type, selection) { if (mode == 1) { status++; }else{ status--; } if (status == 0) { cm.sendNext("Go ahead and press Next so I can proceed to the next status."); } else if (status == 1) { cm.sendSimple("Would you like to see how I use status again? \r\n #L0# Yes. #l \r\n #L1# No. #l"); } else if (status == 2) { if (selection == 0) { cm.sendOk("Here I am, in another status. As you can see from the script, this window is in status 2."); cm.dispose(); } else if (selection == 1) { cm.sendOk("Well, sucks to be you, don't it? This window is also in status 2 :) "); cm.dispose(); } }}

2)NPC Color codes/Item pictures/etcnpc 文字颜色和物品图片等等

#b = Blue text. //蓝色文本#c[itemid]# Shows how many [itemid] the player has in their inventory.//显示玩家背包中有多少个itemid的物品#d = Purple text.//紫色文本#e = Bold text.//血色文本#f[imagelocation]# - Shows an image inside the .wz files.//显示wz文件中的图片#g = Green text.//绿色文本#h # - Shows the name of the player.//显示玩家名字#i[itemid]# - Shows a picture of the item.//显示物品图片#k = Black text.//黑色文本#l - Selection close. //选项关闭,#m[mapid]# - Shows the name of the map.//显示地图名字#n = Normal text (removes bold).//正常文本#o[mobid]# - Shows the name of the mob.//显示怪物名称#p[npcid]# - Shows the name of the NPC.//显示NPC名字#q[skillid]# - Shows the name of the skill.//显示技能名字#r = Red text.//红色文本#s[skillid]# - Shows the image of the skill.//显示技能图片#t[itemid]# - Shows the name of the item.//显示物品名称#v[itemid]# - Shows a picture of the item.//显示物品图片#x - Returns "0%" (need more information on this).//这个不知道是啥#z[itemid]# - Shows the name of the item.//显示物品名称#B[%]# - Shows a 'progress' bar.//显示进度条#F[imagelocation]# - Shows an image inside the .wz files.//显示wz中的图片#L[number]# Selection open. //开始一个number的选择\r\n - Moves down a line. //换行\r = Return Carriage //\n = New Line//新的一行\t = Tab (4 spaces)\b = Backwards //向后一格

3)cm.[commands] cm的各种调用

disposeEnds the conversation with an NPC, allows you to talk to NPCs again.//关闭与NPC的对话,这样你就能再次跟NPC对话How to use: cm.dispose();sendNextShows a conversation window with a 'Next' button.//显示一段带有下一项按钮的对话How to use: cm.sendNext("[text]");sendPrevShows a conversation window with a 'Prev' (previous) button.//显示一段带有上一项按钮的对话How to use: cm.sendPrev("[text]");sendNextPrevShows a conversation window with a 'Next' and 'Prev' button (see above).//显示一段带有上一项和下一项的对话How to use: cm.sendNextPrev("[text]");sendOkShows a conversation window with an 'Ok' button.//显示一段带有好的按钮的对话How to use: cm.sendOk("[text]");sendYesNoShows a conversation window with a 'Yes' and 'No' button, 'No' ends the conversation unless otherwise stated.//显示一段带有是和否按钮的对话,否按钮会关闭对话,除非设置了其他的状态How to use: cm.sendYesNo("[text]");sendAcceptDeclineShows a conversation window with an 'Accept' and 'Decline' button. 'Decline' ends the conversation unless otherwise stated.//显示一段带有接受和关闭按钮的对话,关闭按钮会关闭对话框,除非设置了其他状态How to use: cm.sendAcceptDecline("[text]");sendSimpleShows a conversation window with no buttons.//显示一段没有任何按钮的简单对话框How to use: cm.sendSimple("[text]");sendStyleShows a style-select window.//显示一个带有风格的对话框How to use: cm.sendStyle("[Text]", [variable]); // You'll need to declare the variable in a Var statement.warpWarps the player to a map.//传送玩家到一个地图上。第二个参数不知道是啥How to use: cm.warp([mapid], [portal]); // Set [portal] as 0 if you want default.openShopOpens a shop window.//打开商店How to use: cm.openShop([shopid]);haveItemChecks if the player has an item (in their inventories or equipped).//检查玩家是否有某个物品How to use: cm.haveItem([itemid]);gainItemGives the player an item/takes an item from a player.//获取或者删除玩家的物品,当数量为负数的时候就是删除物品How to use: cm.gainItem([itemid],[ammount]); // Change [ammount] to -[ammount] to take an item.changeJobChanges the job of the player.//改变玩家的职业How to use: cm.changeJob([jobid]);getJobFinds out what job the player has.//获取玩家当前的职业How to use: cm.getJob();startQuestStarts a quest.//开始一个任务How to use: cm.startQuest([questid]);completeQuestFinishes a quest.//结束一个任务How to use: cm.completeQuest([questid]);forfeitQuestForfeits a quest.//放弃一个任务How to use: cm.forfeitQuest([questid]);getMesoFinds out how many mesos a player has.//获取玩家的枫币数量。就是打怪掉的那个币。How to use: cm.getMeso();gainMesoGives a player mesos/takes mesos from a player.//给与或扣除玩家的枫币。当数量为负数时是扣除玩家枫币。How to use: cm.gainMeso([ammount]); // use -[ammount] to take mesos.gainExpGives a player exp/takes exp from a player.//给与或扣除玩家经验。负数就是扣除经验。How to use: cm.gainExp([ammount]); // use -[ammount] to take exp.getLevelFinds out the level of the player.//获取玩家当前等级How to use: cm.getLevel();teachSkillTeaches a player a skill.//教玩家技能How to use: cm.teachSkill([skillid],[skilllevel],[maxskilllevel]);get[Stat]Finds out the [Stat] of the player. [Stat] being: HP, MP, STR, DEX, INT, LUK.//获取玩家的属性:血量,魔法,力量,敏捷,智力,幸运。How to use: cm.get[Stat]();modifyNXGives/Takes the player nx//给与或删除玩家的点券,对就是拿RMB买的那个点券。How to use: cm.gainNX([amount]);Make it negative to make it take away.

4)检查枫币,捐赠者,物品,管理员,和性别Checking for mesos, items, donator, gm, and gender

if (cm.getPlayer().isGM()) { //检查gmif (cm.getChar().isDonator() == true) { // checks for donatorif (cm.getJob().equals(net.sf.odinms.client.MapleJob.BOWMAN)) { // checks for Bowman job (list of jobs in below spoiler)if (cm.getLevel() >= 30) { // checks if level is more than or equal to 30.if (cm.getChar().getGender() == 0) { // 0 = male, 1 = femaleif (cm.getPlayer().getGender() == 0) { // 0 = male, 1 = femaleif (cm.getMeso() >= amount) { // >= greater than or equal to, <= less than or equal to, == is equal to 检查玩家是否有足够的枫币if (cm.haveItem(itemid, amount)) { // checks if the player has a certain amount of an item 检查玩家是否有一定数量的某物品if (cm.getPlayer().getitemQuantity(itemid)); // gets a count of how much a player has of an item 获得玩家有多少个某个物品。

5)职业代码 job terms and Ids

//这个太难翻译了 只翻译我看的懂得BEGINNER - 0 //新手WARRIOR - 100 //战士FIGHTER - 110 //剑客CRUSADER - 111 //勇士HERO - 112 //英雄PAGE - 120 //准骑士WHITEKNIGHT - 121 //骑士PALADIN - 122 //圣骑士SPEARMAN - 130 //枪战士DRAGONKNIGHT - 131 //龙骑士DARKKNIGHT - 132 //黑骑士MAGICIAN - 200 //法师FP_WIZARD - 210 //火毒法师FP_MAGE - 211 //火毒巫师FP_ARCHMAGE - 212 //火毒魔导师IL_WIZARD - 220 //冰雷法师IL_MAGE - 221 //冰雷巫师IL_ARCHMAGE - 222 //冰雷魔导师CLERIC - 230 //牧师PRIEST - 231 //祭司BISHOP - 232 //主教BOWMAN - 300 //弓箭手HUNTER - 310 //猎人RANGER - 311 //射手BOWMASTER - 312 //神射手CROSSBOWMAN - 320 //弩弓手SNIPER - 321 //游侠CROSSBOWMASTER - 322 //箭神THIEF - 400 //盗贼ASSASSIN - 410 //刺客HERMIT - 411 //无影人NIGHTLORD - 412 //隐士BANDIT - 420 //侠客CHIEFBANDIT - 421 //独行客SHADOWER - 422 //侠盗PIRATE - 500 //海盗BRAWLER - 510 //拳手MARAUDER - 511 //斗士BUCCANEER - 512 //冲锋队长GUNSLINGER - 520 //火枪手OUTLAW - 521 //大副CORSAIR - 522 //船长MAPLELEAF_BRIGADIER - 800GM - 500(v55) / 900(v62+)SUPERGM 510(v55) / 910(v62+)DAWNWARRIOR1 - 1000DAWNWARRIOR2 - 1010DAWNWARRIOR3 - 1011DAWNWARRIOR4 - 1012BLAZEWIZARD1 - 1100BLAZEWIZARD2 - 1110BLAZEWIZARD3 - 1111BLAZEWIZARD4 - 1112WINDARCHER1 - 1200WINDARCHER2 - 1210WINDARCHER3 - 1211WINDARCHER4 - 1212NIGHTWALKER1 - 1300 //夜行者?NIGHTWALKER2 - 1310NIGHTWALKER3 - 1311NIGHTWALKER4 - 1312THUNDERBREAKER1 - 1400THUNDERBREAKER2 - 1410THUNDERBREAKER3 - 1411THUNDERBREAKER4 - 1412ARAN1 - 2100ARAN2 - 2110ARAN3 - 2111ARAN4 - 2112

6)各种文本框对应的状态

----------- sendNext(); & sendOk(); ----------- Type = 0 If end chat - mode = -1 If next/ok - mode = 1 ----------- sendNextPrev(); ----------- Type = 0 If end chat - mode = -1 If next - mode = 1 if back - mode = 0 ----------- sendYesNo(); ----------- Type = 1 If end chat - mode = -1 If yes - mode = 1 If no - mode = 0 ----------- sendAcceptDecline(); ----------- Type = 12 If end chat - mode = -1 If accept - mode = 1 If decline - mode = 0 ----------- sendGetText(); ----------- Nothing o____o its something special <3 ----------- sendGetNumber(); ----------- Type = 3 If end chat - mode = 0 if ok - mode = 1 ----------- sendSimple(); ----------- Type = 4 If end chat - mode = 0 if select - mode = 1

7)一些脚本命令

cm.sendNext("text"); - shows a conversation window with a next button.cm.sendPrev("text"); - shows a conversation window with a prev button.cm.sendNextPrev("text"); - shows a conversation window with a next and a prev button.cm.sendOk("text"); - shows a conversation window with a OK button.cm.sendYesNo("text"); - shows a conversation window with a yes and no button.//显示一个带有接受和拒绝的对话框cm.sendAcceptDecline("text"); - shows a conversation window with a accept and decline button.cm.sendSimple("text"); - shows a conversation window without buttons.//显示一个让玩家选择范围内数字的窗口cm.sendGetNumber("text", defammount, minammount, maxammount) - It makes the player choose a number between minammount and maxammount.//显示一个输入对话框cm.sendGetText("text") - It makes the player be able to type in a text box.//cm.setGetText("text") - It sets the text in a players NPC text box.cm.getText() - It gets the text typed in the text box.cm.openShop(SHOPID) - opens a shop by SHOPIDcm.openNpc(NPCID) - starts a new npc conversation with NPCIDcm.changeJob(JOBID) - changes the job of the player to JOBIDcm.getJob() - gets the job of the playercm.startQuest(QUESTID) - starts a quest by QUESTIDcm.completeQuest(QUESTID) - completes a quest by QUESTIDcm.forfeitQuest(QUESTID) - forfeits a quest by QUESTIDcm.getMeso() - gets the meso of the playercm.gainMeso(NUMBER) - gives mesos to the player by NUMBERcm.gainExp(NUMBER) - gives EXP to the player by NUMBERcm.getNpc() - gets the current npccm.getFileName() - probably gets a filename.cm.getLevel() - gets the level of the playercm.unequipEverything() - makes the player unequip everything in equipmentcm.teachSkill(SKILLID, SKILLLEVEL, MASTERLEVEL) - teaches the player a skill by SKILLIDcm.getSkill() - gets a skill of the playercm.clearSkills() - clears the skills of the playercm.getPlayer() - gets the playercm.getC() - gets the clientcm.rechargeStars() - recharges the players starscm.getEventManager(String event) - probably gets an event manager..cm.showEffect(String effect) - shows an effect by IDcm.playSound(String sound) - plays a sound by IDcm.updateBuddyCapacity(ammount) - uodates the buddy capacity to ammountcm.getBuddyCapacity() - gets the buddy capacity of a playercm.setHair(ID) - sets the hair of a player by IDcm.setFace(ID) - sets the face of a player by IDcm.setSkin(ID) - sets the skin of a player by IDcm.warpParty(MAPID) - warps the party to mapID (good for instances)cm.warpRandom(MAPID) - warps to a random portal by MAPIDcm.spawnMonster(ID, HP, MP, LVL, EXP, Boss?, Undead?, ammount, x, y); - spawns AMMOUNT mob by ID at X,Y with HP, MP, LVL, EXP. Put 1 in boss if you want it to be boss and 1 in undead if you want it to be undead.cm.itemQuantity(itemid) - gets quanity of itemidcm.createMapleSquad(MapleSquadType) - creates a maplesquad by MapleSquadTypecm.getSquadMember(MapleSquadType, number) - gets squadmember by number in MapleSquadTypecm.getSquadState(MapleSquadType) - gets the state of MapleSquadTypecm.setSquadState(MapleSquadType, state) - sets the state of MapleSquadTypecm.checkSquadLeader(MapleSquadType) - checks the leader of MapleSquadTypecm.removeMapleSquad(MapleSquadType) - removes the maplesquad, MapleSquadTypecm.numSquadMembers(MapleSquadType) - gets the number of squadmembers in MapleSquadTypecm.isSquadMember(MapleSquadType) - checks wether a player is a squadmember or not in MapleSquadTypecm.addSquadMember(MapleSquadType) - adds a squadmember to MapleSquadTypecm.removeSquadMember(MapleSquadType, Char) - removes squadmember from MapleSquadTypecm.removeSquadMember(MapleSquadType, Char, ban) - removes squadmember from MapleSquadType with bancm.canAddSquadMember(MapleSquadType) - checks if it can add another squadmember intocm.removeSquadMember(MapleSquadType, Char) - removes squadmember from MapleSquadTypecm.warpSquadMembers(MapleSquadType, mapId) - warps squadmembers of MapleSquadType to mapIdcm.searchItem(ItemName) - searches for ItemNamecm.makeRing(partner, ringId) - makes a ring to you and your partner bt ringIdcm.resetReactors() - resets the reactorscm.displayGuildRanks() - displays the guild rankscm.sendMessage(Player, Message) - sends a message to playercm.gainFame(amount) - gives/takes fame from player by ammountcm.maxSkills() - maxes players skillscm.getSkillLevel(skillid) - gets skill level by skillid from playercm.giveBuff(skillid) - gives a player the buff of skillidcm.partyMembersInMap() - checks for the partymembers in the map.cm.modifyNx(amount) - modifies the nx of the playercm.getTime(type) - get the time of type. type = h/m/scm.addBuddyCapacity(number) - adds the buddycapacity of numbercm.clearKeys() - sets the keys to deafult//延迟传送cm.scheduleWarp(delay, mapid) - warps to mapid in delay//地图传送倒计时cm.startClock(limit, endMap) - starts a clock that will go down to 0 from limit and then warps to endmap//获得玩家名字cm.getCharByName(name) - gets char by namecm.warpAllInMap(mapid, portal) - warps all in the map to mapid to portalcm.createMarriage(partner) - creates marriage with partnercm.createEngagement(partner) - creates engagement with partnercm.divorceMarriage() - divorces from partnercm.changeKeyBinding(key, type, action) - changes key by type by action...cm.getEquipById(id) - gets equip by idcm.getNpcTalkTimes() - gets how many times som1 have talked to this npccm.setNpcTalkTimes(amount) - sets how many times players have talked to npc by ammountcm.makeProItem(ITEMID, NUMBER) - makes an item by ITEMID with NUMBER to each stat (xotic)cm.isGuest() - checks wether a player is guest or notcm.broadcastMessage(type, message) - broadcasts message by typecm.setClan(ClanName) - makes player enter ClanNamecm.getAllOnlineNamesFromClan(ClanName) - gets all online members names from clancm.getAllOfflineNamesFromClan(ClanName) - gets all offline members names from clancm.getOfflineClanCount(ClanName) - counts how many offline in ClanNamecm.getJobById(id) - gets job by idcm.getPartyMembers() - gets the partymembers in a partycm.getSender() - gets the sender of ex. a messagecm.removeHiredMerchantItem(id) - removes id from hired merchantcm.getHiredMerchantMesos() - gets hired merchants mesoscm.setHiredMerchantMesos(Number) - sets hired merchants mesos by numbercm.getHiredMerchantItems() - gets hired merchants itemscm.sendKeymap(KEY) - sends ? to keymapcm.removeAll(ItemID) - Removes all of ItemID//inventoryType背包类型,-1已装备栏,1背包装备栏//deleteSolt索引//deleteQuantity数量cm.removeSlot(inventoryType, deleteSlot, deleteQuantity)

冒险岛破功地址:00B064B8

相关推荐

相关文章