冒险岛单机脚本开发

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

//第一种,没有其他状态的NPC
function 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();
} 
//第二种,带有状态的NPC
var 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的各种调用

dispose
Ends the conversation with an NPC, allows you to talk to NPCs again.
//关闭与NPC的对话,这样你就能再次跟NPC对话
How to use: cm.dispose();

sendNext
Shows a conversation window with a 'Next' button.
//显示一段带有下一项按钮的对话
How to use: cm.sendNext("[text]");

sendPrev
Shows a conversation window with a 'Prev' (previous) button.
//显示一段带有上一项按钮的对话
How to use: cm.sendPrev("[text]");

sendNextPrev
Shows a conversation window with a 'Next' and 'Prev' button (see above).
//显示一段带有上一项和下一项的对话
How to use: cm.sendNextPrev("[text]");

sendOk
Shows a conversation window with an 'Ok' button.
//显示一段带有好的按钮的对话
How to use: cm.sendOk("[text]");

sendYesNo
Shows a conversation window with a 'Yes' and 'No' button, 'No' ends the conversation unless otherwise stated.
//显示一段带有是和否按钮的对话,否按钮会关闭对话,除非设置了其他的状态
How to use: cm.sendYesNo("[text]");

sendAcceptDecline
Shows a conversation window with an 'Accept' and 'Decline' button. 'Decline' ends the conversation unless otherwise stated.
//显示一段带有接受和关闭按钮的对话,关闭按钮会关闭对话框,除非设置了其他状态
How to use: cm.sendAcceptDecline("[text]");

sendSimple
Shows a conversation window with no buttons.
//显示一段没有任何按钮的简单对话框
How to use: cm.sendSimple("[text]");

sendStyle
Shows a style-select window.
//显示一个带有风格的对话框
How to use: cm.sendStyle("[Text]", [variable]); // You'll need to declare the variable in a Var statement.

warp
Warps the player to a map.
//传送玩家到一个地图上。第二个参数不知道是啥
How to use: cm.warp([mapid], [portal]); // Set [portal] as 0 if you want default.

openShop
Opens a shop window.
//打开商店
How to use: cm.openShop([shopid]);

haveItem
Checks if the player has an item (in their inventories or equipped).
//检查玩家是否有某个物品
How to use: cm.haveItem([itemid]);

gainItem
Gives 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.

changeJob
Changes the job of the player.
//改变玩家的职业
How to use: cm.changeJob([jobid]);

getJob
Finds out what job the player has.
//获取玩家当前的职业
How to use: cm.getJob();

startQuest
Starts a quest.
//开始一个任务
How to use: cm.startQuest([questid]);

completeQuest
Finishes a quest.
//结束一个任务
How to use: cm.completeQuest([questid]);

forfeitQuest
Forfeits a quest.
//放弃一个任务
How to use: cm.forfeitQuest([questid]);

getMeso
Finds out how many mesos a player has.
//获取玩家的枫币数量。就是打怪掉的那个币。
How to use: cm.getMeso();

gainMeso
Gives a player mesos/takes mesos from a player.
//给与或扣除玩家的枫币。当数量为负数时是扣除玩家枫币。
How to use: cm.gainMeso([ammount]); // use -[ammount] to take mesos.

gainExp
Gives a player exp/takes exp from a player.
//给与或扣除玩家经验。负数就是扣除经验。
How to use: cm.gainExp([ammount]); // use -[ammount] to take exp.

getLevel
Finds out the level of the player.
//获取玩家当前等级
How to use: cm.getLevel();

teachSkill
Teaches 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]();

modifyNX
Gives/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()) { //检查gm

if (cm.getChar().isDonator() == true) { // checks for donator

if (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 = female
if (cm.getPlayer().getGender() == 0) { // 0 = male, 1 = female

if (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 - 800
GM - 500(v55) / 900(v62+)
SUPERGM 510(v55) / 910(v62+)
DAWNWARRIOR1 - 1000
DAWNWARRIOR2 - 1010
DAWNWARRIOR3 - 1011
DAWNWARRIOR4 - 1012
BLAZEWIZARD1 - 1100
BLAZEWIZARD2 - 1110
BLAZEWIZARD3 - 1111
BLAZEWIZARD4 - 1112
WINDARCHER1 - 1200
WINDARCHER2 - 1210
WINDARCHER3 - 1211
WINDARCHER4 - 1212
NIGHTWALKER1 - 1300 //夜行者?
NIGHTWALKER2 - 1310
NIGHTWALKER3 - 1311
NIGHTWALKER4 - 1312
THUNDERBREAKER1 - 1400
THUNDERBREAKER2 - 1410
THUNDERBREAKER3 - 1411
THUNDERBREAKER4 - 1412
ARAN1 - 2100
ARAN2 - 2110
ARAN3 - 2111
ARAN4 - 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 SHOPID
cm.openNpc(NPCID) - starts a new npc conversation with NPCID
cm.changeJob(JOBID) - changes the job of the player to JOBID
cm.getJob() - gets the job of the player
cm.startQuest(QUESTID) - starts a quest by QUESTID
cm.completeQuest(QUESTID) - completes a quest by QUESTID
cm.forfeitQuest(QUESTID) - forfeits a quest by QUESTID
cm.getMeso() - gets the meso of the player
cm.gainMeso(NUMBER) - gives mesos to the player by NUMBER
cm.gainExp(NUMBER) - gives EXP to the player by NUMBER
cm.getNpc() - gets the current npc
cm.getFileName() - probably gets a filename.
cm.getLevel() - gets the level of the player
cm.unequipEverything() - makes the player unequip everything in equipment
cm.teachSkill(SKILLID, SKILLLEVEL, MASTERLEVEL) - teaches the player a skill by SKILLID
cm.getSkill() - gets a skill of the player
cm.clearSkills() - clears the skills of the player
cm.getPlayer() - gets the player
cm.getC() - gets the client
cm.rechargeStars() - recharges the players stars
cm.getEventManager(String event) - probably gets an event manager..
cm.showEffect(String effect) - shows an effect by ID
cm.playSound(String sound) - plays a sound by ID
cm.updateBuddyCapacity(ammount) - uodates the buddy capacity to ammount
cm.getBuddyCapacity() - gets the buddy capacity of a player
cm.setHair(ID) - sets the hair of a player by ID
cm.setFace(ID) - sets the face of a player by ID
cm.setSkin(ID) - sets the skin of a player by ID
cm.warpParty(MAPID) - warps the party to mapID (good for instances)
cm.warpRandom(MAPID) - warps to a random portal by MAPID
cm.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 itemid
cm.createMapleSquad(MapleSquadType) - creates a maplesquad by MapleSquadType
cm.getSquadMember(MapleSquadType, number) - gets squadmember by number in MapleSquadType
cm.getSquadState(MapleSquadType) - gets the state of MapleSquadType
cm.setSquadState(MapleSquadType, state) - sets the state of MapleSquadType
cm.checkSquadLeader(MapleSquadType) - checks the leader of MapleSquadType
cm.removeMapleSquad(MapleSquadType) - removes the maplesquad, MapleSquadType
cm.numSquadMembers(MapleSquadType) - gets the number of squadmembers in MapleSquadType
cm.isSquadMember(MapleSquadType) - checks wether a player is a squadmember or not in MapleSquadType
cm.addSquadMember(MapleSquadType) - adds a squadmember to MapleSquadType
cm.removeSquadMember(MapleSquadType, Char) - removes squadmember from MapleSquadType
cm.removeSquadMember(MapleSquadType, Char, ban) - removes squadmember from MapleSquadType with ban
cm.canAddSquadMember(MapleSquadType) - checks if it can add another squadmember into
cm.removeSquadMember(MapleSquadType, Char) - removes squadmember from MapleSquadType
cm.warpSquadMembers(MapleSquadType, mapId) - warps squadmembers of MapleSquadType to mapId
cm.searchItem(ItemName) - searches for ItemName
cm.makeRing(partner, ringId) - makes a ring to you and your partner bt ringId
cm.resetReactors() - resets the reactors
cm.displayGuildRanks() - displays the guild ranks
cm.sendMessage(Player, Message) - sends a message to player
cm.gainFame(amount) - gives/takes fame from player by ammount
cm.maxSkills() - maxes players skills
cm.getSkillLevel(skillid) - gets skill level by skillid from player
cm.giveBuff(skillid) - gives a player the buff of skillid
cm.partyMembersInMap() - checks for the partymembers in the map.
cm.modifyNx(amount) - modifies the nx of the player
cm.getTime(type) - get the time of type. type = h/m/s
cm.addBuddyCapacity(number) - adds the buddycapacity of number
cm.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 name
cm.warpAllInMap(mapid, portal) - warps all in the map to mapid to portal
cm.createMarriage(partner) - creates marriage with partner
cm.createEngagement(partner) - creates engagement with partner
cm.divorceMarriage() - divorces from partner
cm.changeKeyBinding(key, type, action) - changes key by type by action...
cm.getEquipById(id) - gets equip by id
cm.getNpcTalkTimes() - gets how many times som1 have talked to this npc
cm.setNpcTalkTimes(amount) - sets how many times players have talked to npc by ammount
cm.makeProItem(ITEMID, NUMBER) - makes an item by ITEMID with NUMBER to each stat (xotic)
cm.isGuest() - checks wether a player is guest or not
cm.broadcastMessage(type, message) - broadcasts message by type
cm.setClan(ClanName) - makes player enter ClanName
cm.getAllOnlineNamesFromClan(ClanName) - gets all online members names from clan
cm.getAllOfflineNamesFromClan(ClanName) - gets all offline members names from clan
cm.getOfflineClanCount(ClanName) - counts how many offline in ClanName
cm.getJobById(id) - gets job by id
cm.getPartyMembers() - gets the partymembers in a party
cm.getSender() - gets the sender of ex. a message
cm.removeHiredMerchantItem(id) - removes id from hired merchant
cm.getHiredMerchantMesos() - gets hired merchants mesos
cm.setHiredMerchantMesos(Number) - sets hired merchants mesos by number
cm.getHiredMerchantItems() - gets hired merchants items
cm.sendKeymap(KEY) - sends ? to keymap
cm.removeAll(ItemID) - Removes all of ItemID
//inventoryType背包类型,-1已装备栏,1背包装备栏
//deleteSolt索引
//deleteQuantity数量
cm.removeSlot(inventoryType, deleteSlot, deleteQuantity) 

冒险岛破功地址:00B064B8

  • 4
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 9
    评论
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值