DarkSheep个人小站

  • 首页
  • 阿里云
    • 优惠活动
    • 应用教程
  • 博主日常
    • 陈年往事
    • 时光相册
    • 阴晴风雨
    • 学思笔记
  • 魔兽地图
    • 源图速递
    • 汉化发布
    • 地图攻略
    • 汉化笔记
    • 汉化教程
    • 编辑器教程
DarkSheep个人小站
人如蝼蚁,命若尘埃,却依旧想在这世间留下痕迹
  1. 首页
  2. 魔兽地图
  3. 汉化笔记
  4. 正文

关于汉化地图添加平台商城JASS研究

2018年05月12日 227点热度 0人点赞 2条评论

以下研究目前仅停留在理论,未实践。

1、首先在endglobals下面加上一句:

native DzAPI_Map_HasMallItem takes player whichPlayer, string key returns boolean

2、其次需要剥丝抽茧般一层一层找到VIP或者特权的对应触发。例如:

function InitTrig_dialog takes nothing returns nothing
set gg_trg_dialog=CreateTrigger()  //激活触发
call TriggerRegisterEnterRectSimple(gg_trg_dialog,gg_rct________226)  //触发事件
call TriggerAddCondition(gg_trg_dialog,Condition(function Trig_dialog_Conditions))  //触发条件
call TriggerAddAction(gg_trg_dialog,function Trig_dialog_Actions)  //触发动作
endfunction

在上面最关键的是触发条件:function Trig_dialog_Conditions,因此我们根据它再次定位。

function Trig_dialog_Conditions takes nothing returns boolean
if(not Trig_dialog_Func001C())then //触发条件1
return false
endif
if(not Trig_dialog_Func002C())then  //触发条件2
return false
endif
return true
endfunction

这里的条件又分成了2个条件,并且要同时满足。我们一个个来,先定位Trig_dialog_Func001C:

function Trig_dialog_Func001C takes nothing returns boolean
if(not(GetPlayerController(GetOwningPlayer(GetEnteringUnit()))==MAP_CONTROL_USER))then  //触发玩家是否用户
return false
endif
if(not(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)==true))then  //触发单位是否英雄
return false
endif
if(not(GetHeroLevel(GetTriggerUnit())>=1))then  //判断英雄等级是否大于等于1
return false
endif
return true
endfunction

虽然对上面这种not的写法很迷糊,但是根据常理应该是以上三个判断条件都需要满足。且还需要满足Trig_dialog_Func002C中的条件才能触发,所以我们继续往下看。

function Trig_dialog_Func002C takes nothing returns boolean
if((GetPlayerName(GetOwningPlayer(GetTriggerUnit()))=="Dark"))then  //判断玩家的触发单位的名字
return true
endif
if((GetPlayerName(GetOwningPlayer(GetTriggerUnit()))=="Sheep"))then  //同上
return true
endif
return false
endfunction

我们通常在游戏一个玩家通常对应一个名字,所以上面的条件是二选一。由此可见,我们可以在以上触发中“做文章”。

function Trig_dialog_Func002C takes nothing returns boolean

if (DzAPI_Map_HasMallItem(GetOwningPlayer(GetTriggerUnit()), "DSEXRRPG01") == true) then
return true
endif

if((GetPlayerName(GetOwningPlayer(GetTriggerUnit()))=="Dark"))then
return true
endif
if((GetPlayerName(GetOwningPlayer(GetTriggerUnit()))=="Sheep"))then
return true
endif
return false
endfunction


测试结果:

1、前7次尝试

if (DzAPI_Map_HasMallItem(GetTriggerPlayer(), "DSEXRRPG01") == true) then //失败

if (DzAPI_Map_HasMallItem(Player(0), "DSEXRRPG01") == true) then //失败

if (DzAPI_Map_HasMallItem(GetOwningPlayer(GetTriggerUnit()), "DSEXRRPG01") == true) then //失败

2、第8次尝试,增加

globals
constant boolean LIBRARY_DzAPI=ture //失败

3、第9次尝试,删除其他条件。//失败

if((GetPlayerName(GetOwningPlayer(GetTriggerUnit()))=="FlySheep"))then
return true
endif
if((GetPlayerName(GetOwningPlayer(GetTriggerUnit()))=="陈丨丨丨"))then
return true
endif
if((GetPlayerName(GetOwningPlayer(GetTriggerUnit()))=="倚鹤望君归"))then
return true
endif
if((GetPlayerName(GetOwningPlayer(GetTriggerUnit()))=="poca3"))then
return true
endif


2018/05/13 晚。开始着手研究触发的动作。但结果:并没什么用……

function Trig_dialog_Actions takes nothing returns nothing
call IssueImmediateOrderBJ(GetAttacker(),"stop")
set udg_unit=GetEnteringUnit()
call DialogDisplayBJ(true,udg_dialog,GetOwningPlayer(GetEnteringUnit()))
endfunction


2018/05/14 我也是拼了。自己在WE上试着写触发。

事件
单位 - 任意单位进入 矩形区域 000 <预设>
条件
((触发单位) 是 英雄) 等于 TRUE
((触发单位) 的等级) 大于或等于 6
Or - 任意条件成立
条件
(((触发单位) 的所有者) 的名字) 等于 WorldEdit
(获取 ((触发单位) 的所有者) 是否拥有:DSEXRRPG01 对应的商城道具.) 等于 TRUE
动作
单位 - 杀死 (触发单位)

我似乎抓住了希望……

  1. 更新地图同时发布道具(道具的KEY只支持大写,和地图写的KEY要对应)
  2. 登录地图测试服--->自定义房间创建地图--->同步完成后点发布地图
  3. 用作者之家的帐号登录地图测试服--->查看平台背包确认是否获得道具-->进入游戏大厅的地图--->进游戏看看有效果么
标签: 暂无
最后更新:2020年01月21日

DarkSheep

打赏 点赞
< 上一篇
下一篇 >

文章评论

  • 強殖甲

    滿酷漢化地圖的網站
    加油

    2019年03月15日
    回复
    • DarkSheep

      @強殖甲 哇 看你的昵称 想当年我也看过强殖装甲的 :)

      2019年03月16日
      回复
  • 取消回复

    DarkSheep

    一点点打赏是我更新下去的动力之一哟~

    关于肥羊
    打赏肥羊
    标签聚合
    肥羊镇最后的30分钟 肥羊镇的暴虐魔王 五月的肥羊斗兽场 魔兽编辑器教程 肥羊神教的暗黑地牢 魔兽地图汉化新教程 肥羊修罗场 肥羊毁灭记 命运进行曲ORPG 肥羊世纪的咸鱼生活 阿里云 肥羊们的征途 德州电锯杀羊狼 肥羊营地的BOSS战 肥羊竞技场 肥羊遗迹城 绝地羊岛:快活战场 神域镇魂曲 神秘咸鱼岛 肥羊围城RPG
    友情链接
    咸鱼小站

    COPYRIGHT © 2020 DarkSheep个人小站. ALL RIGHTS RESERVED.

    THEME KRATOS MADE BY VTROIS

    赣ICP备20000111号-1