阳光女孩 发表于 2013-4-5 05:04:11

【授人以渔】长篇基础技术介绍——JS 属性文本   [复制链接] nil18 主题       0 好友       148 积分      侠客该用户从未签到    发消息       电梯直达楼主发表于 2013-3-11 18:14:29 |只看该作者 |倒序浏览一键分享 这篇介绍属性文本,属性 文本 就是带有各种效果的文字 ,比如可以点的,有颜色的,下划线的等等 这篇带图,顺便把上篇各种对话框说明下按照这里的讲解 http://forum.ragezone.com/f428/add-learning-npcs-start-finish-643364/ 本帖隐藏的内容一个不需要指定任何状态的NPC function start() {      cm.sendOk("I am an NPC without a status.");      cm.dispose();}   因为不需要状态 直接start 调用就可以 另外一个例子 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();}   点了以后,传送,获得物品,再讲话,结束属性文本 #b = Blue text. 蓝色文本,在这之后的字在没设置其他属性下为蓝色字 如 #b 蓝色字 #c# Shows how many the player has in their inventory. 显示玩家背包里的道具数量 如 #c1002357##d = Purple text. 紫色字体 颜色之间一起用以最后一个为准 #e = Bold text. 粗体如 #b #e 蓝色粗体字#f# - Shows an image inside the .wz files. 显示wz文件中的图片指定路径 可以是物品 技能 地图等等   #g = Green text. 绿色字体 #h # - Shows the name of the player. 显示玩家名称 如 [#h#]你好 #i# - Shows a picture of the item. 显示 物品 图片#k = Black text. 黑色子图#L# Selection open. #l - Selection close.这两个连用 #L0#这是选项1#l#m# - Shows the name of the map.显示地图名称 #n = Normal text (removes bold).恢复正常字体#o# - Shows the name of the mob.显示 怪物名称 #p# - Shows the name of the NPC.显示npc名称 #q# - Shows the name of the skill.显示技能名称 #r = Red text. 红色字体 #s# - Shows the image of the skill.显示技能图片 #t# - Shows the name of the item.显示物品名称 #v# - Shows a picture of the item.显示物品图片 和前面的i可能相同 #x - Returns "0%" (need more information on this).   #z# - Shows the name of the item. 显示物品名称,和前面t同#B[%]# - Shows a 'progress' bar.   显示进度条 #F# - Shows an image inside the .wz files. 同前面f   \r\n - Moves down a line.换行 \r = Return Carriage \n = New Line \t = Tab (4 spaces) 制表符 4个空格 \b = Backwards 回退这里又把前面说一次 dispose结束对话允许再次对话 Ends the conversation with an NPC, allows you to talk to NPCs again. How to use: cm.dispose();sendNext有下一个的窗口 Shows a conversation window with a 'Next' button. How to use: cm.sendNext("");sendPrev有上一个的窗口 Shows a conversation window with a 'Prev' (previous) button. How to use: cm.sendPrev("");sendNextPrev Shows a conversation window with a 'Next' and 'Prev' button (see above). How to use: cm.sendNextPrev("");sendOk Shows a conversation window with an 'Ok' button. How to use: cm.sendOk("");sendYesNo Shows a conversation window with a 'Yes' and 'No' button, 'No' ends the conversation unless otherwise stated. How to use: cm.sendYesNo("");sendAcceptDecline有确认取消的窗口 Shows a conversation window with an 'Accept' and 'Decline' button. 'Decline' ends the conversation unless otherwise stated. How to use: cm.sendAcceptDecline("");sendSimple没有东西的窗口,但是实际是有下一个的 有代码 if (!text.contains("#L")) {       sendNext(text);       return;   } 文本如果没有包括"#L"就是那个有选项的就有NextShows a conversation window with no buttons. How to use: cm.sendSimple("");sendStyle带风格的窗口,一般不常用有需要的风格变量 Shows a style-select window. How to use: cm.sendStyle("", ); // You'll need to declare the variable in a Var statement.warp传送 ,第二个参数 是0的话用默认的传送点 Warps the player to a map. How to use: cm.warp(, ); // Set as 0 if you want default.openShop Opens a shop window. How to use: cm.openShop();haveItem Checks if the player has an item (in their inventories or equipped). How to use: cm.haveItem();gainItem Gives the player an item/takes an item from a player. How to use: cm.gainItem(,); // Change to - to take an item.changeJob Changes the job of the player. How to use: cm.changeJob();getJob Finds out what job the player has. How to use: cm.getJob();startQuest Starts a quest. How to use: cm.startQuest();completeQuest Finishes a quest. How to use: cm.completeQuest();forfeitQuest Forfeits a quest. How to use: cm.forfeitQuest();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(); // use - to take mesos.gainExp Gives a player exp/takes exp from a player. How to use: cm.gainExp(); // use - 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(,,);get Finds out the of the player. being: HP, MP, STR, DEX, INT, LUK. How to use: cm.get();modifyNX Gives/Takes the player nx How to use: cm.gainNX(); Make it negative to make it take away.send函数返回接收 -----------sendNext(); & sendOk();-----------Type = 0If end chat    -    mode = -1   结束对话后下次收到-1 If next/ok    -    mode = 1按ok或下一个-----------sendNextPrev();-----------Type = 0If end chat    -    mode = -1结束对话 If next      -    mode = 1 下一个 if back      -    mode = 0 返回-----------sendYesNo();-----------Type = 1If end chat    -    mode = -1If yes      -    mode = 1If no      -    mode = 0   -----------sendAcceptDecline();-----------Type = 12If end chat    -    mode = -1If accept    -    mode = 1If decline    -    mode = 0   -----------sendGetText();-----------Nothing o____o its something special <3   -----------sendGetNumber();-----------Type = 3    If end chat   -   mode = 0if ok         -    mode = 1   -----------sendSimple();-----------Type = 4If end chat   -   mode = 0if select   -    mode = 1 选择这里再介绍 几个js的语法 数组var x=; 访问就是 x[下标] 下表从0开始 x就是1 比如 item = ;   function start() {      cm.sendSimple("Which would you like? \r\n #L0# Golden Maple Leaf #l \r\n #L1# Maple Coin #l \r\n #L2# Maple Leaf #l");}   function action(mode, type, selection) {      if (mode == 1) {          cm.gainItem(item, 1);      }      cm.dispose();}   可以避免 用switchMath 是js的内部函数,见我前面那个贴的连接 var rand = Math.floor(Math.random()*100);   字典 var x={"x":1,"y":2}; 访问和数组很象x["x"]就是1还有cm的一些函数返回本身是类的对象,直接继续点下去访问 如 cm.getPlayer().getJob() 下面看些截图   普通字体,下一步,选项   yesno            字体 换行   显示地图名字   

阳光女孩 发表于 2013-4-5 05:04:16

【授人以渔】长篇基础技术介绍——JS 属性文本   [复制链接] nil18 主题       0 好友       148 积分      侠客该用户从未签到    发消息       电梯直达楼主发表于 2013-3-11 18:14:29 |只看该作者 |倒序浏览一键分享 这篇介绍属性文本,属性 文本 就是带有各种效果的文字 ,比如可以点的,有颜色的,下划线的等等 这篇带图,顺便把上篇各种对话框说明下按照这里的讲解 http://forum.ragezone.com/f428/add-learning-npcs-start-finish-643364/ 本帖隐藏的内容一个不需要指定任何状态的NPC function start() {      cm.sendOk("I am an NPC without a status.");      cm.dispose();}   因为不需要状态 直接start 调用就可以 另外一个例子 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();}   点了以后,传送,获得物品,再讲话,结束属性文本 #b = Blue text. 蓝色文本,在这之后的字在没设置其他属性下为蓝色字 如 #b 蓝色字 #c# Shows how many the player has in their inventory. 显示玩家背包里的道具数量 如 #c1002357##d = Purple text. 紫色字体 颜色之间一起用以最后一个为准 #e = Bold text. 粗体如 #b #e 蓝色粗体字#f# - Shows an image inside the .wz files. 显示wz文件中的图片指定路径 可以是物品 技能 地图等等   #g = Green text. 绿色字体 #h # - Shows the name of the player. 显示玩家名称 如 [#h#]你好 #i# - Shows a picture of the item. 显示 物品 图片#k = Black text. 黑色子图#L# Selection open. #l - Selection close.这两个连用 #L0#这是选项1#l#m# - Shows the name of the map.显示地图名称 #n = Normal text (removes bold).恢复正常字体#o# - Shows the name of the mob.显示 怪物名称 #p# - Shows the name of the NPC.显示npc名称 #q# - Shows the name of the skill.显示技能名称 #r = Red text. 红色字体 #s# - Shows the image of the skill.显示技能图片 #t# - Shows the name of the item.显示物品名称 #v# - Shows a picture of the item.显示物品图片 和前面的i可能相同 #x - Returns "0%" (need more information on this).   #z# - Shows the name of the item. 显示物品名称,和前面t同#B[%]# - Shows a 'progress' bar.   显示进度条 #F# - Shows an image inside the .wz files. 同前面f   \r\n - Moves down a line.换行 \r = Return Carriage \n = New Line \t = Tab (4 spaces) 制表符 4个空格 \b = Backwards 回退这里又把前面说一次 dispose结束对话允许再次对话 Ends the conversation with an NPC, allows you to talk to NPCs again. How to use: cm.dispose();sendNext有下一个的窗口 Shows a conversation window with a 'Next' button. How to use: cm.sendNext("");sendPrev有上一个的窗口 Shows a conversation window with a 'Prev' (previous) button. How to use: cm.sendPrev("");sendNextPrev Shows a conversation window with a 'Next' and 'Prev' button (see above). How to use: cm.sendNextPrev("");sendOk Shows a conversation window with an 'Ok' button. How to use: cm.sendOk("");sendYesNo Shows a conversation window with a 'Yes' and 'No' button, 'No' ends the conversation unless otherwise stated. How to use: cm.sendYesNo("");sendAcceptDecline有确认取消的窗口 Shows a conversation window with an 'Accept' and 'Decline' button. 'Decline' ends the conversation unless otherwise stated. How to use: cm.sendAcceptDecline("");sendSimple没有东西的窗口,但是实际是有下一个的 有代码 if (!text.contains("#L")) {       sendNext(text);       return;   } 文本如果没有包括"#L"就是那个有选项的就有NextShows a conversation window with no buttons. How to use: cm.sendSimple("");sendStyle带风格的窗口,一般不常用有需要的风格变量 Shows a style-select window. How to use: cm.sendStyle("", ); // You'll need to declare the variable in a Var statement.warp传送 ,第二个参数 是0的话用默认的传送点 Warps the player to a map. How to use: cm.warp(, ); // Set as 0 if you want default.openShop Opens a shop window. How to use: cm.openShop();haveItem Checks if the player has an item (in their inventories or equipped). How to use: cm.haveItem();gainItem Gives the player an item/takes an item from a player. How to use: cm.gainItem(,); // Change to - to take an item.changeJob Changes the job of the player. How to use: cm.changeJob();getJob Finds out what job the player has. How to use: cm.getJob();startQuest Starts a quest. How to use: cm.startQuest();completeQuest Finishes a quest. How to use: cm.completeQuest();forfeitQuest Forfeits a quest. How to use: cm.forfeitQuest();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(); // use - to take mesos.gainExp Gives a player exp/takes exp from a player. How to use: cm.gainExp(); // use - 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(,,);get Finds out the of the player. being: HP, MP, STR, DEX, INT, LUK. How to use: cm.get();modifyNX Gives/Takes the player nx How to use: cm.gainNX(); Make it negative to make it take away.send函数返回接收 -----------sendNext(); & sendOk();-----------Type = 0If end chat    -    mode = -1   结束对话后下次收到-1 If next/ok    -    mode = 1按ok或下一个-----------sendNextPrev();-----------Type = 0If end chat    -    mode = -1结束对话 If next      -    mode = 1 下一个 if back      -    mode = 0 返回-----------sendYesNo();-----------Type = 1If end chat    -    mode = -1If yes      -    mode = 1If no      -    mode = 0   -----------sendAcceptDecline();-----------Type = 12If end chat    -    mode = -1If accept    -    mode = 1If decline    -    mode = 0   -----------sendGetText();-----------Nothing o____o its something special <3   -----------sendGetNumber();-----------Type = 3    If end chat   -   mode = 0if ok         -    mode = 1   -----------sendSimple();-----------Type = 4If end chat   -   mode = 0if select   -    mode = 1 选择这里再介绍 几个js的语法 数组var x=; 访问就是 x[下标] 下表从0开始 x就是1 比如 item = ;   function start() {      cm.sendSimple("Which would you like? \r\n #L0# Golden Maple Leaf #l \r\n #L1# Maple Coin #l \r\n #L2# Maple Leaf #l");}   function action(mode, type, selection) {      if (mode == 1) {          cm.gainItem(item, 1);      }      cm.dispose();}   可以避免 用switchMath 是js的内部函数,见我前面那个贴的连接 var rand = Math.floor(Math.random()*100);   字典 var x={"x":1,"y":2}; 访问和数组很象x["x"]就是1还有cm的一些函数返回本身是类的对象,直接继续点下去访问 如 cm.getPlayer().getJob() 下面看些截图   普通字体,下一步,选项   yesno            字体 换行   显示地图名字   

阳光女孩 发表于 2013-4-5 05:04:41

学习学习多谢楼主

afangjiachen 发表于 2013-4-5 10:35:43

...看看吧

qiuhuan111 发表于 2013-4-5 11:05:19

RE: 108服务端免费使用方法【大家低调,勿转~~~!】 [修改]

白夜行 发表于 2013-4-5 11:08:15


我看看

ws1102050 发表于 2013-4-5 14:20:22

看了LZ的帖子,我只想说一句很好很强大!

clannxy 发表于 2013-4-5 14:22:24

喵了个咪咪的。 好久没来发现最近成绩大大的喵。

q14710229 发表于 2013-4-5 15:32:40

我来看看吧、、、、、、

_ ̄―_ ̄― 发表于 2013-4-5 15:43:24

额额额额额
页: 5 6 7 8 9 10 11 12 13 14 [15] 16 17 18 19 20 21 22 23 24
查看完整版本: 108服务端免费使用方法【大家低调,勿转~~~!】