微信扫一扫 分享朋友圈

已有 2740 人浏览分享

[服務器教學] 腳本開發指令詳情

[複製鏈接]

站長

Rank: 12Rank: 12Rank: 12

1733

威望

2880

金錢

106

A幣
主題
1315
帖子
2435
精華
3
綜合社群主題發文量
262
電玩社群主題發文量
1
娛樂社群主題發文量
4
技術社群主題發文量
26
閱讀權限
200
註冊時間
2013-1-28

我是傳奇贊助感謝勳章精華作者勳章

  • TA的每日心情

    2023-10-27 16:33
  • 簽到天數: 381 天

    連續簽到: 1 天

    [LV.9]以壇為家II

    TWAICL 發表於  2022-3-22 18:31:32 | 顯示全部樓層 | 閱讀模式
    0001.png

    以上資料是從對岸蒐集來的,很多功能都有備註,滿方便實用,歡迎挑看選看

    1)兩種不同的NPC

    1. //第一種,沒有其他狀態的NPC
    2. function start() {
    3.     cm.sendOk("I am an NPC without a status.");
    4.     cm.dispose();
    5. }
    6. //沒有其他狀態NPC的另一種寫法
    7. function start() {
    8.     cm.sendOk("Here is another example of an NPC without status.");
    9. }

    10. function action(mode, type, selection) {
    11.     cm.warp(100000000, 0);
    12.     cm.gainItem(4001126, 1);
    13.     cm.sendOk("See? Here, I warped you and gave you an item without using status.");
    14.     cm.dispose();
    15. }
    16. //第二種,帶有狀態的NPC
    17. var status;

    18. function start() {
    19.     status = -1;
    20.     action(1, 0, 0);
    21. }

    22. function action(mode, type, selection) {
    23.     if (mode == 1) {
    24.         status++;
    25.     }else{
    26.         status--;
    27.     }
    28.     if (status == 0) {
    29.         cm.sendNext("Go ahead and press Next so I can proceed to the next status.");
    30.     } else if (status == 1) {
    31.         cm.sendSimple("Would you like to see how I use status again? \r\n #L0# Yes. #l \r\n #L1# No. #l");
    32.     } else if (status == 2) {
    33.         if (selection == 0) {
    34.             cm.sendOk("Here I am, in another status. As you can see from the script, this window is in status 2.");
    35.             cm.dispose();
    36.         } else if (selection == 1) {
    37.             cm.sendOk("Well, sucks to be you, don't it? This window is also in status 2 :) ");
    38.             cm.dispose();
    39.         }
    40.     }
    41. }
    複製代碼



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


    1. #b = Blue text. //藍色文本
    2. #c[itemid]# Shows how many [itemid] the player has in their inventory.//顯示玩家揹包中有多少個itemid的物品
    3. #d = Purple text.//紫色文本
    4. #e = Bold text.//血色文本
    5. #f[imagelocation]# - Shows an image inside the .wz files.//顯示wz文件中的圖片
    6. #g = Green text.//綠色文本
    7. #h # - Shows the name of the player.//顯示玩家名字
    8. #i[itemid]# - Shows a picture of the item.//顯示物品圖片
    9. #k = Black text.//黑色文本
    10. #l - Selection close. //選項關閉,
    11. #m[mapid]# - Shows the name of the map.//顯示地圖名字
    12. #n = Normal text (removes bold).//正常文本
    13. #o[mobid]# - Shows the name of the mob.//顯示怪物名稱
    14. #p[npcid]# - Shows the name of the NPC.//顯示NPC名字
    15. #q[skillid]# - Shows the name of the skill.//顯示技能名字
    16. #r = Red text.//紅色文本
    17. #s[skillid]# - Shows the image of the skill.//顯示技能圖片
    18. #t[itemid]# - Shows the name of the item.//顯示物品名稱
    19. #v[itemid]# - Shows a picture of the item.//顯示物品圖片
    20. #x - Returns "0%" (need more information on this).//這個不知道是啥
    21. #z[itemid]# - Shows the name of the item.//顯示物品名稱
    22. #B[%]# - Shows a 'progress' bar.//顯示進度條
    23. #F[imagelocation]# - Shows an image inside the .wz files.//顯示wz中的圖片
    24. #L[number]# Selection open. //開始一個number的選擇
    25. \r\n - Moves down a line. //換行
    26. \r = Return Carriage //
    27. \n = New Line//新的一行
    28. \t = Tab (4 spaces)
    29. \b = Backwards //向後一格
    複製代碼


    3)cm.[commands] cm的各種調用


    1. dispose
    2. Ends the conversation with an NPC, allows you to talk to NPCs again.
    3. //關閉與NPC的對話,這樣你就能再次跟NPC對話
    4. How to use: cm.dispose();

    5. sendNext
    6. Shows a conversation window with a 'Next' button.
    7. //顯示一段帶有下一項按鈕的對話
    8. How to use: cm.sendNext("[text]");

    9. sendPrev
    10. Shows a conversation window with a 'Prev' (previous) button.
    11. //顯示一段帶有上一項按鈕的對話
    12. How to use: cm.sendPrev("[text]");

    13. sendNextPrev
    14. Shows a conversation window with a 'Next' and 'Prev' button (see above).
    15. //顯示一段帶有上一項和下一項的對話
    16. How to use: cm.sendNextPrev("[text]");

    17. sendOk
    18. Shows a conversation window with an 'Ok' button.
    19. //顯示一段帶有好的按鈕的對話
    20. How to use: cm.sendOk("[text]");

    21. sendYesNo
    22. Shows a conversation window with a 'Yes' and 'No' button, 'No' ends the conversation unless otherwise stated.
    23. //顯示一段帶有是和否按鈕的對話,否按鈕會關閉對話,除非設置了其他的狀態
    24. How to use: cm.sendYesNo("[text]");

    25. sendAcceptDecline
    26. Shows a conversation window with an 'Accept' and 'Decline' button. 'Decline' ends the conversation unless otherwise stated.
    27. //顯示一段帶有接受和關閉按鈕的對話,關閉按鈕會關閉對話框,除非設置了其他狀態
    28. How to use: cm.sendAcceptDecline("[text]");

    29. sendSimple
    30. Shows a conversation window with no buttons.
    31. //顯示一段沒有任何按鈕的簡單對話框
    32. How to use: cm.sendSimple("[text]");

    33. sendStyle
    34. Shows a style-select window.
    35. //顯示一個帶有風格的對話框
    36. How to use: cm.sendStyle("[Text]", [variable]); // You'll need to declare the variable in a Var statement.

    37. warp
    38. Warps the player to a map.
    39. //傳送玩家到一個地圖上。第二個參數不知道是啥
    40. How to use: cm.warp([mapid], [portal]); // Set [portal] as 0 if you want default.

    41. openShop
    42. Opens a shop window.
    43. //打開商店
    44. How to use: cm.openShop([shopid]);

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

    49. gainItem
    50. Gives the player an item/takes an item from a player.
    51. //獲取或者刪除玩家的物品,當數量爲負數的時候就是刪除物品
    52. How to use: cm.gainItem([itemid],[ammount]); // Change [ammount] to -[ammount] to take an item.

    53. changeJob
    54. Changes the job of the player.
    55. //改變玩家的職業
    56. How to use: cm.changeJob([jobid]);

    57. getJob
    58. Finds out what job the player has.
    59. //獲取玩家當前的職業
    60. How to use: cm.getJob();

    61. startQuest
    62. Starts a quest.
    63. //開始一個任務
    64. How to use: cm.startQuest([questid]);

    65. completeQuest
    66. Finishes a quest.
    67. //結束一個任務
    68. How to use: cm.completeQuest([questid]);

    69. forfeitQuest
    70. Forfeits a quest.
    71. //放棄一個任務
    72. How to use: cm.forfeitQuest([questid]);

    73. getMeso
    74. Finds out how many mesos a player has.
    75. //獲取玩家的楓幣數量。就是打怪掉的那個幣。
    76. How to use: cm.getMeso();

    77. gainMeso
    78. Gives a player mesos/takes mesos from a player.
    79. //給與或扣除玩家的楓幣。當數量爲負數時是扣除玩家楓幣。
    80. How to use: cm.gainMeso([ammount]); // use -[ammount] to take mesos.

    81. gainExp
    82. Gives a player exp/takes exp from a player.
    83. //給與或扣除玩家經驗。負數就是扣除經驗。
    84. How to use: cm.gainExp([ammount]); // use -[ammount] to take exp.

    85. getLevel
    86. Finds out the level of the player.
    87. //獲取玩家當前等級
    88. How to use: cm.getLevel();

    89. teachSkill
    90. Teaches a player a skill.
    91. //教玩家技能
    92. How to use: cm.teachSkill([skillid],[skilllevel],[maxskilllevel]);

    93. get[Stat]
    94. Finds out the [Stat] of the player. [Stat] being: HP, MP, STR, DEX, INT, LUK.
    95. //獲取玩家的屬性:血量,魔法,力量,敏捷,智力,幸運。
    96. How to use: cm.get[Stat]();

    97. modifyNX
    98. Gives/Takes the player nx
    99. //給與或刪除玩家的點券,對就是拿RMB買的那個點券。
    100. How to use: cm.gainNX([amount]);
    101. Make it negative to make it take away.
    複製代碼



    4)檢查楓幣,捐贈者,物品,管理員,和性別Checking for mesos, items, donator, gm, and gender


    1. if (cm.getPlayer().isGM()) { //檢查gm

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

    3. if (cm.getJob().equals(net.sf.odinms.client.MapleJob.BOWMAN)) { // checks for Bowman job (list of jobs in below spoiler)

    4. if (cm.getLevel() >= 30) { // checks if level is more than or equal to 30.

    5. if (cm.getChar().getGender() == 0) { // 0 = male, 1 = female
    6. if (cm.getPlayer().getGender() == 0) { // 0 = male, 1 = female

    7. if (cm.getMeso() >= amount) { // >= greater than or equal to, <= less than or equal to,  == is equal to 檢查玩家是否有足夠的楓幣

    8. if (cm.haveItem(itemid, amount)) { // checks if the player has a certain amount of an item 檢查玩家是否有一定數量的某物品

    9. if (cm.getPlayer().getitemQuantity(itemid)); // gets a count of how much a player has of an item  獲得玩家有多少個某個物品。
    複製代碼


    5)職業代碼 job terms and Ids


    1. //這個太難翻譯了 只翻譯我看的懂得
    2. BEGINNER - 0 //新手
    3. WARRIOR - 100 //戰士
    4. FIGHTER - 110 //劍客
    5. CRUSADER - 111 //勇士
    6. HERO - 112 //英雄
    7. PAGE - 120 //準騎士
    8. WHITEKNIGHT - 121 //騎士
    9. PALADIN - 122 //聖騎士
    10. SPEARMAN - 130 //槍戰士
    11. DRAGONKNIGHT - 131 //龍騎士
    12. DARKKNIGHT - 132 //黑騎士
    13. MAGICIAN - 200 //法師
    14. FP_WIZARD - 210 //火毒法師
    15. FP_MAGE - 211 //火毒巫師
    16. FP_ARCHMAGE - 212 //火毒魔導師
    17. IL_WIZARD - 220 //冰雷法師
    18. IL_MAGE - 221 //冰雷巫師
    19. IL_ARCHMAGE - 222 //冰雷魔導師
    20. CLERIC - 230 //牧師
    21. PRIEST - 231 //祭司
    22. BISHOP - 232 //主教
    23. BOWMAN - 300 //弓箭手
    24. HUNTER - 310 //獵人
    25. RANGER - 311 //射手
    26. BOWMASTER - 312 //神射手
    27. CROSSBOWMAN - 320 //弩弓手
    28. SNIPER - 321 //遊俠
    29. CROSSBOWMASTER - 322 //箭神
    30. THIEF - 400 //盜賊
    31. ASSASSIN - 410 //刺客
    32. HERMIT - 411 //無影人
    33. NIGHTLORD - 412 //隱士
    34. BANDIT - 420 //俠客
    35. CHIEFBANDIT - 421 //獨行客
    36. SHADOWER - 422 //俠盜
    37. PIRATE - 500 //海盜
    38. BRAWLER - 510 //拳手
    39. MARAUDER - 511 //鬥士
    40. BUCCANEER - 512 //衝鋒隊長
    41. GUNSLINGER - 520 //火槍手
    42. OUTLAW - 521 //大副
    43. CORSAIR - 522 //船長
    44. MAPLELEAF_BRIGADIER - 800
    45. GM - 500(v55) / 900(v62+)
    46. SUPERGM 510(v55) / 910(v62+)
    47. DAWNWARRIOR1 - 1000
    48. DAWNWARRIOR2 - 1010
    49. DAWNWARRIOR3 - 1011
    50. DAWNWARRIOR4 - 1012
    51. BLAZEWIZARD1 - 1100
    52. BLAZEWIZARD2 - 1110
    53. BLAZEWIZARD3 - 1111
    54. BLAZEWIZARD4 - 1112
    55. WINDARCHER1 - 1200
    56. WINDARCHER2 - 1210
    57. WINDARCHER3 - 1211
    58. WINDARCHER4 - 1212
    59. NIGHTWALKER1 - 1300 //夜行者?
    60. NIGHTWALKER2 - 1310
    61. NIGHTWALKER3 - 1311
    62. NIGHTWALKER4 - 1312
    63. THUNDERBREAKER1 - 1400
    64. THUNDERBREAKER2 - 1410
    65. THUNDERBREAKER3 - 1411
    66. THUNDERBREAKER4 - 1412
    67. ARAN1 - 2100
    68. ARAN2 - 2110
    69. ARAN3 - 2111
    70. ARAN4 - 2112
    複製代碼


    6)各種文本框對應的狀態


    1. -----------
    2. sendNext(); & sendOk();
    3. -----------
    4. Type = 0
    5. If end chat    -    mode = -1
    6. If next/ok    -    mode = 1

    7. -----------
    8. sendNextPrev();
    9. -----------
    10. Type = 0
    11. If end chat    -    mode = -1
    12. If next        -    mode = 1
    13. if back        -    mode = 0

    14. -----------
    15. sendYesNo();
    16. -----------
    17. Type = 1
    18. If end chat    -    mode = -1
    19. If yes        -    mode = 1
    20. If no        -    mode = 0

    21. -----------
    22. sendAcceptDecline();
    23. -----------
    24. Type = 12
    25. If end chat    -    mode = -1
    26. If accept    -    mode = 1
    27. If decline    -    mode = 0

    28. -----------
    29. sendGetText();
    30. -----------
    31. Nothing o____o its something special <3

    32. -----------
    33. sendGetNumber();
    34. -----------
    35. Type = 3
    36. If end chat     -     mode = 0
    37. if ok         -    mode = 1

    38. -----------
    39. sendSimple();
    40. -----------
    41. Type = 4
    42. If end chat     -     mode = 0
    43. if select     -    mode = 1
    複製代碼


    7)一些腳本命令


    1. cm.sendNext("text"); - shows a conversation window with a next button.
    2. cm.sendPrev("text"); - shows a conversation window with a prev button.
    3. cm.sendNextPrev("text"); - shows a conversation window with a next and a prev button.
    4. cm.sendOk("text"); - shows a conversation window with a OK button.
    5. cm.sendYesNo("text"); - shows a conversation window with a yes and no button.
    6. //顯示一個帶有接受和拒絕的對話框
    7. cm.sendAcceptDecline("text"); - shows a conversation window with a accept and decline button.
    8. cm.sendSimple("text"); - shows a conversation window without buttons.
    9. //顯示一個讓玩家選擇範圍內數字的窗口
    10. cm.sendGetNumber("text", defammount, minammount, maxammount) - It makes the player choose a number between minammount and maxammount.
    11. //顯示一個輸入對話框
    12. cm.sendGetText("text") - It makes the player be able to type in a text box.
    13. //
    14. cm.setGetText("text") - It sets the text in a players NPC text box.
    15. cm.getText() - It gets the text typed in the text box.
    16. cm.openShop(SHOPID) - opens a shop by SHOPID
    17. cm.openNpc(NPCID) - starts a new npc conversation with NPCID
    18. cm.changeJob(JOBID) - changes the job of the player to JOBID
    19. cm.getJob() - gets the job of the player
    20. cm.startQuest(QUESTID) - starts a quest by QUESTID
    21. cm.completeQuest(QUESTID) - completes a quest by QUESTID
    22. cm.forfeitQuest(QUESTID) - forfeits a quest by QUESTID
    23. cm.getMeso() - gets the meso of the player
    24. cm.gainMeso(NUMBER) - gives mesos to the player by NUMBER
    25. cm.gainExp(NUMBER) - gives EXP to the player by NUMBER
    26. cm.getNpc() - gets the current npc
    27. cm.getFileName() - probably gets a filename.
    28. cm.getLevel() - gets the level of the player
    29. cm.unequipEverything() - makes the player unequip everything in equipment
    30. cm.teachSkill(SKILLID, SKILLLEVEL, MASTERLEVEL) - teaches the player a skill by SKILLID
    31. cm.getSkill() - gets a skill of the player
    32. cm.clearSkills() - clears the skills of the player
    33. cm.getPlayer() - gets the player
    34. cm.getC() - gets the client
    35. cm.rechargeStars() - recharges the players stars
    36. cm.getEventManager(String event) - probably gets an event manager..
    37. cm.showEffect(String effect) - shows an effect by ID
    38. cm.playSound(String sound) - plays a sound by ID
    39. cm.updateBuddyCapacity(ammount) - uodates the buddy capacity to ammount
    40. cm.getBuddyCapacity() - gets the buddy capacity of a player
    41. cm.setHair(ID) - sets the hair of a player by ID
    42. cm.setFace(ID) - sets the face of a player by ID
    43. cm.setSkin(ID) - sets the skin of a player by ID
    44. cm.warpParty(MAPID) - warps the party to mapID (good for instances)
    45. cm.warpRandom(MAPID) - warps to a random portal by MAPID
    46. 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.
    47. cm.itemQuantity(itemid) - gets quanity of itemid
    48. cm.createMapleSquad(MapleSquadType) - creates a maplesquad by MapleSquadType
    49. cm.getSquadMember(MapleSquadType, number) - gets squadmember by number in MapleSquadType
    50. cm.getSquadState(MapleSquadType) - gets the state of MapleSquadType
    51. cm.setSquadState(MapleSquadType, state) - sets the state of MapleSquadType
    52. cm.checkSquadLeader(MapleSquadType) - checks the leader of MapleSquadType
    53. cm.removeMapleSquad(MapleSquadType) - removes the maplesquad, MapleSquadType
    54. cm.numSquadMembers(MapleSquadType) - gets the number of squadmembers in MapleSquadType
    55. cm.isSquadMember(MapleSquadType) - checks wether a player is a squadmember or not in MapleSquadType
    56. cm.addSquadMember(MapleSquadType) - adds a squadmember to MapleSquadType
    57. cm.removeSquadMember(MapleSquadType, Char) - removes squadmember from MapleSquadType
    58. cm.removeSquadMember(MapleSquadType, Char, ban) - removes squadmember from MapleSquadType with ban
    59. cm.canAddSquadMember(MapleSquadType) - checks if it can add another squadmember into
    60. cm.removeSquadMember(MapleSquadType, Char) - removes squadmember from MapleSquadType
    61. cm.warpSquadMembers(MapleSquadType, mapId) - warps squadmembers of MapleSquadType to mapId
    62. cm.searchItem(ItemName) - searches for ItemName
    63. cm.makeRing(partner, ringId) - makes a ring to you and your partner bt ringId
    64. cm.resetReactors() - resets the reactors
    65. cm.displayGuildRanks() - displays the guild ranks
    66. cm.sendMessage(Player, Message) - sends a message to player
    67. cm.gainFame(amount) - gives/takes fame from player by ammount
    68. cm.maxSkills() - maxes players skills
    69. cm.getSkillLevel(skillid) - gets skill level by skillid from player
    70. cm.giveBuff(skillid) - gives a player the buff of skillid
    71. cm.partyMembersInMap() - checks for the partymembers in the map.
    72. cm.modifyNx(amount) - modifies the nx of the player
    73. cm.getTime(type) - get the time of type. type = h/m/s
    74. cm.addBuddyCapacity(number) - adds the buddycapacity of number
    75. cm.clearKeys() - sets the keys to deafult
    76. //延遲傳送
    77. cm.scheduleWarp(delay, mapid) - warps to mapid in delay
    78. //地圖傳送倒計時
    79. cm.startClock(limit, endMap) - starts a clock that will go down to 0 from limit and then warps to endmap
    80. //獲得玩家名字
    81. cm.getCharByName(name) - gets char by name
    82. cm.warpAllInMap(mapid, portal) - warps all in the map to mapid to portal
    83. cm.createMarriage(partner) - creates marriage with partner
    84. cm.createEngagement(partner) - creates engagement with partner
    85. cm.divorceMarriage() - divorces from partner
    86. cm.changeKeyBinding(key, type, action) - changes key by type by action...
    87. cm.getEquipById(id) - gets equip by id
    88. cm.getNpcTalkTimes() - gets how many times som1 have talked to this npc
    89. cm.setNpcTalkTimes(amount) - sets how many times players have talked to npc by ammount
    90. cm.makeProItem(ITEMID, NUMBER) - makes an item by ITEMID with NUMBER to each stat (xotic)
    91. cm.isGuest() - checks wether a player is guest or not
    92. cm.broadcastMessage(type, message) - broadcasts message by type
    93. cm.setClan(ClanName) - makes player enter ClanName
    94. cm.getAllOnlineNamesFromClan(ClanName) - gets all online members names from clan
    95. cm.getAllOfflineNamesFromClan(ClanName) - gets all offline members names from clan
    96. cm.getOfflineClanCount(ClanName) - counts how many offline in ClanName
    97. cm.getJobById(id) - gets job by id
    98. cm.getPartyMembers() - gets the partymembers in a party
    99. cm.getSender() - gets the sender of ex. a message
    100. cm.removeHiredMerchantItem(id) - removes id from hired merchant
    101. cm.getHiredMerchantMesos() - gets hired merchants mesos
    102. cm.setHiredMerchantMesos(Number) - sets hired merchants mesos by number
    103. cm.getHiredMerchantItems() - gets hired merchants items
    104. cm.sendKeymap(KEY) - sends ? to keymap
    105. cm.removeAll(ItemID) - Removes all of ItemID
    106. //inventoryType揹包類型,-1已裝備欄,1揹包裝備欄
    107. //deleteSolt索引
    108. //deleteQuantity數量
    109. cm.removeSlot(inventoryType, deleteSlot, deleteQuantity)
    複製代碼







    共收到 0 A幣
    打賞榜
    暫無
    暫無
    暫無
    暫無
    ----
    暫無
    ----
    暫無
    ----
    暫無
    ----
    您需要登錄後才可以回帖 登錄 | 註冊會員

    本版積分規則

    2435

    發文

    2880

    金錢

    106

    A幣

    ----------榮譽勳章----------

    我是傳奇 贊助感謝勳章 精華作者勳章

    熱門推薦
    圖文推薦
    • 聯繫我們

    小黑屋|AICL社群娛樂集團

    GMT+8, 2024-3-29 16:16 , 網路刷新 0.111415 秒 .

    歡迎來到 AICL網路社群

    版權AICL社群所有 2011-2021.

    Total:123 Today:213 Online:322