切换风格

默认晚霞 雪山 粉色心情 伦敦 花卉 绿野仙踪 加州 白云 星空 薰衣草 城市 简约黑色 龙珠
回复 4

10

主题

17

帖子

479

积分

大区版主

漫步烟雨

Rank: 7Rank: 7Rank: 7

积分
479
人气
25 点
钻石粒
417 粒
贡献
0 点
论坛币
89 个
爱心
0 点

论坛审核会员论坛注册会员

QQ
[1.12.2][ECMA] 女仆预览NPC[复制链接]
发表于 2020-2-4 07:03:41 | 显示全部楼层 |阅读模式
脚本例子
脚本版本: 0.1
适用版本: 1.12.2 
编写语言: ECMA
最后更新: 2020-02-04
代码版权: 强版权

请注册论坛会员,已便查看高清图片!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
本帖最后由 Rain_Effect 于 2020-2-4 07:09 编辑

该脚本基于 车万女仆(Touhou Little Maid) 模组进行制作!
  1. 游戏版本: 1.12.2
  2. CustomNPCs版本: 任意
  3. TouhouLittleMaid版本: 1.1.9或更高
复制代码


预览图:
2020-02-04 06-15-31.gif

代码如下:
function interact(e){
    //检查手里是否为模型卷
    if(e.player.mainhandItem.name=="touhou_little_maid:maid_model_coupon"){
        //获得模型卷的模型数据
        var maid = e.player.mainhandItem.itemNbt.getCompound("tag").getString("ModelData").split(":");
        var maidId = maidGet(maid[1]);
        var maidStatus = ((maidId!=-1)?Maid[maidId]:{name: "无名氏", disc: "无称号"});
        //修改NPC女仆模型为模型卷内数据
        var nbt1 = e.npc.entityNbt;
        var nbt2 = nbt1.getCompound("NpcModelData");
        var nbt3 = nbt2.getCompound("ExtraData");
        nbt3.setString("ModelId", maid.join(":"));
        nbt2.setCompound("ExtraData", nbt3);
        nbt1.setCompound("NpcModelData", nbt2);
        nbt1.setString("Texture", maid.join(":textures/entity/") + ".png");
        e.npc.setEntityNbt(nbt1);
        //设置名称
        e.npc.display.setName(maidStatus.name);
        e.npc.display.setTitle("§7" + maidStatus.disc + "§r");
        //刷新NPC女仆数据
        e.npc.updateClient();
    }else{
        e.npc.sayTo(e.player, "请使用女仆模型卷右键我预览皮肤。");
    }
}

function maidGet(id){for(var i=0;i<Maid.length;i++){if(Maid[i].id==id) return i;}return -1;}

var Maid = [
{id: "hakurei_reimu", name: "博丽灵梦", disc: "乐园的巫女"},
{id: "yakumo_ran", name: "八云蓝", disc: "隙间妖怪的式神"},
{id: "inubashiri_momizi", name: "犬走椛", disc: "下端哨戒天狗"},
{id: "komeiji_satori", name: "古明地觉", disc: "怨灵也为之惧怯的少女"},
{id: "reisen_udongein_inaba", name: "铃仙·优昙华院·因幡", disc: "狂气的月兔"},
{id: "yasaka_kanako", name: "八坂神奈子", disc: "山坂与湖水的化身"},
{id: "sekibanki", name: "赤蛮奇", disc: "辘轳首的怪奇"},
{id: "hata_no_kokoro", name: "秦心", disc: "表情丰富的扑克脸"},
{id: "kawasiro_nitori", name: "河城荷取", disc: "超妖怪弹头"},
{id: "kochiya_sanae", name: "东风谷早苗", disc: "山上的新人神明"},
{id: "izayoi_sakuya", name: "十六夜咲夜", disc: "红魔馆的女仆"},
{id: "nagae_iku", name: "永江衣玖", disc: "美丽的绯之衣"},
{id: "cirno", name: "琪露诺", disc: "冰之妖精"},
{id: "daiyousei", name: "大妖精", disc: "新月般的妖精"},
{id: "houraisan_kaguya", name: "蓬莱山辉夜", disc: "永远的公主"},
{id: "moriya_suwako", name: "泄矢诹访子", disc: "土著神的顶点"},
{id: "wakasagihime", name: "若鹭姬", disc: "栖息于淡水的人鱼"},
{id: "flandre_scarlet", name: "芙兰朵露·斯卡蕾特", disc: "恶魔之妹"},
{id: "fujiwara_no_mokou", name: "藤原妹红", disc: "蓬莱的人之形"},
{id: "kisume", name: "琪斯美", disc: "可怕的水井妖怪"},
{id: "chen", name: "橙", disc: "凶兆的黑猫"},
{id: "ibuki_suika", name: "伊吹萃香", disc: "小小的百鬼夜行"},
{id: "star_sapphire", name: "斯塔萨菲雅", disc: "倾泻而下的星之光"},
{id: "konpaku_youmu", name: "魂魄妖梦", disc: "半人半灵的园艺师"},
{id: "luna_child", name: "露娜切露德", disc: "静谧的月之光"},
{id: "remilia_scarlet", name: "蕾米莉亚·斯卡蕾特", disc: "红色恶魔"},
{id: "sunny_milk", name: "桑尼米尔克", disc: "闪耀的日之光"},
{id: "alice_margatroid", name: "爱丽丝·玛格特洛依德", disc: "七色的人偶使"},
{id: "alice", name: "爱丽丝", disc: "死之少女"},
{id: "patchouli_knowledge", name: "帕秋莉·诺蕾姬", disc: "不动的大图书馆"},
{id: "hong_meiling", name: "红美铃", disc: "华人小姑娘"},
{id: "koakuma", name: "小恶魔", disc: "???"},
{id: "letty_whiterock", name: "蕾蒂·霍瓦特洛克", disc: "冬天的遗忘之物"},
{id: "lunasa_prismriver", name: "露娜萨·普莉兹姆利巴", disc: "骚灵提琴手"},
{id: "merlin_prismriver", name: "梅露兰·普莉兹姆利巴", disc: "骚灵小号手"},
{id: "lyrica_prismriver", name: "莉莉卡·普莉兹姆利巴", disc: "骚灵键盘手"},
{id: "kirisame_marisa", name: "雾雨魔理沙", disc: "普通的魔法使"},
{id: "hinanawi_tenshi", name: "比那名居天子", disc: "非想非非想天之女"},
{id: "lily_white", name: "莉莉霍瓦特", disc: "运送春天的妖精"},
{id: "lily_black", name: "莉莉霍瓦特(黑)", disc: "带走快乐的妖精"},
{id: "komeiji_koishi", name: "古明地恋", disc: "紧闭的恋之瞳"},
{id: "reiuji_utsuho", name: "灵乌路空", disc: "难以驾驭的神之火"},
{id: "kaenbyou_rin", name: "火焰猫燐", disc: "地狱的轮祸"},
{id: "rumia", name: "露米娅", disc: "宵暗的妖怪"},
{id: "matara_okina", name: "摩多罗隐岐奈", disc: "究极的绝对秘神"},
{id: "mystia_lorelei", name: "米斯蒂娅·萝蕾拉", disc: "夜雀妖怪"},
{id: "kitcho_yachie", name: "吉吊八千慧", disc: "鬼杰组组长"},
{id: "saigyouji_yuyuko", name: "西行寺幽幽子", disc: "华胥的亡灵"},
{id: "yorigami_shion", name: "依神紫苑", disc: "最凶最恶的双子之姐"},
{id: "kisin_sagume", name: "稀神探女", disc: "招来口舌之祸的女神"},
{id: "yukari_yakumo", name: "八云紫", disc: "境界的妖怪"},
{id: "tewi_inaba", name: "因幡帝", disc: "幸运的白兔"},
{id: "wriggle_nightbug", name: "莉格露·奈特巴格", disc: "暗中蠢动的光虫"},
{id: "keine_kamishirasawa", name: "上白泽慧音", disc: "吞食历史的半兽"},
{id: "yagokoro_eirin", name: "八意永琳", disc: "月之头脑"},
{id: "mima", name: "魅魔", disc: "恶灵小姐"},
{id: "kazami_yuka", name: "风见幽香", disc: "四季的鲜花之主"},
{id: "onozuka_komachi", name: "小野塚小町", disc: "三途河的引航人"},
{id: "shikieiki_yamaxanadu", name: "四季映姬·亚玛萨那度", disc: "乐园的最高裁判长"},
{id: "syameimaru_aya", name: "射命丸文", disc: "传统的幻想记者"},
{id: "medicine_melancholy", name: "梅蒂欣·梅兰可莉", disc: "小小的甜蜜毒药"},
{id: "aki_sizuha", name: "秋静叶", disc: "寂寞与终焉的象征"},
{id: "kagiyama_hina", name: "键山雏", disc: "秘神流雏"},
{id: "kurodani_yamame", name: "黑谷山女", disc: "昏暗洞窟中明亮的网"},
{id: "hoshiguma_yugi", name: "星熊勇仪", disc: "人所谈论的怪力乱神"},
{id: "minoriko_aki", name: "秋穰子", disc: "丰裕与收成的象征"},
{id: "mizuhashi_parsee", name: "水桥帕露西", disc: "地壳下的嫉妒心"},
{id: "nazrin", name: "娜兹玲", disc: "探宝的小小大将"},
{id: "murasa_minamitsu", name: "村纱水蜜", disc: "水难事故的念缚灵"},
{id: "tatara_kogasa", name: "多多良小伞", disc: "愉快的遗忘之伞"},
{id: "houjuu_nue", name: "封兽鵺", disc: "未确认幻想飞行少女"},
{id: "hijiri_byakuren", name: "圣白莲", disc: "被封印的大魔法师"},
{id: "kumoi_ichirin", name: "云居一轮", disc: "守护与被守护的大轮"},
{id: "toramaru_shou", name: "寅丸星", disc: "毘沙门天的弟子"},
{id: "toyosatomimi_no_miko", name: "丰聪耳神子", disc: "圣德道士"},
{id: "kaku_seiga", name: "霍青娥", disc: "穿墙的邪仙"},
{id: "mononobe_no_futo", name: "物部布都", disc: "古代日本的尸解仙"},
{id: "hutatsuiwa_mamizou", name: "二岩猯藏", disc: "狸猫怪 十变化"},
{id: "miyako_yoshika", name: "宫古芳香", disc: "忠诚的尸体"},
{id: "kasodani_kyouko", name: "幽谷响子", disc: "诵经的山彦"},
{id: "soga_no_toziko", name: "苏我屠自古", disc: "神明后裔的亡灵"},
{id: "imaizumi_kagerou", name: "今泉影狼", disc: "竹林的狼人"},
{id: "kijin_seija", name: "鬼人正邪", disc: "逆袭的天邪鬼"},
{id: "sukuna_shinmyoumaru", name: "少名针妙丸", disc: "小人的后裔"},
{id: "horikawa_raiko", name: "堀川雷鼓", disc: "梦幻的打击乐手"}
];




声明:
  • 你不能转载本帖。
  • 你不能声称作者是自己。


回复

使用道具 举报

5

主题

23

帖子

358

积分

注册会员

Rank: 2

积分
358
人气
7 点
钻石粒
263 粒
贡献
0 点
论坛币
96 个
爱心
0 点

论坛注册会员

发表于 2020-2-4 14:37:46 | 显示全部楼层
您是觉得无聊吗
回复

使用道具 举报

20

主题

36

帖子

588

积分

萌新

Ko no Hueihuea da!!!!!!!!!!!!!

Rank: 10Rank: 10Rank: 10

积分
588
人气
29 点
钻石粒
78 粒
贡献
10 点
论坛币
92 个
爱心
0 点

论坛审核会员论坛注册会员

QQ
发表于 2020-2-15 20:17:17 | 显示全部楼层
您是觉得无聊吗
回复

使用道具 举报

0

主题

3

帖子

29

积分

论坛萌新

Rank: 1

积分
29
人气
0 点
钻石粒
34 粒
贡献
0 点
论坛币
8 个
爱心
0 点
发表于 2020-3-3 12:07:28 | 显示全部楼层

您是觉得无聊吗
回复

使用道具 举报

16

主题

53

帖子

390

积分

注册会员

Rank: 2

积分
390
人气
7 点
钻石粒
335 粒
贡献
0 点
论坛币
75 个
爱心
0 点

论坛注册会员

发表于 2020-3-4 11:41:24 | 显示全部楼层
有点无聊呀qwq
小浩喜欢男孩子嘛!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|自定义NPC脚本中文论坛 ( 蜀ICP备17005795号-3 )

GMT+8, 2020-9-19 07:51 , Processed in 0.090687 second(s), 32 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

返回顶部