WarCraft 板


LINE

这个构想是hobill先想到,他用的方式是jass 但他的做法需要自己取得填进去item type 临时找不到他,所以我整个jass是直接重写,无法跟他的比较 用法很简单,把Jass整个贴到触发器初始区 然後直接在合成的部分设定如下 (也就是说,使用者只需要贴上Jass,然後利用gui介面就可以使用) 如:古尔+古尔=罗 set ItemStuff[0]=罗 set ItemStuff[1]=古尔 set ItemStuff[2]=古尔 Custom script:call DoItemCompose() 重复的物品只需要重复设一次即可,当然event是unit 得到物品 利用到的变数只有一个 ItemStuff[5] as Type of Item 如果合成配方可能会超过5个,自己修改Jass中所有5这个数字及ItemStuff的容量 最後,因为其中一些东西是我的地图专用变数,所以我贴上来有作修改 可能会有没删乾净或修改完整导致有bug,请加分说一下我再改 使用前在地图中提到是ItemCompose Jass Powered by gyd会更感激 ======================================================================= Jass部分,断行部分请自行组合 稍微解说流程 判断得到的道具是不是合成表内容 -X> 清空ItemStuff内容(a) ↓ 逐一拿出ItemStuff(loop)→如果ItemStuff不是no item type -X> 合成,do a ↓ 计算该合成原料数量 ↓ 计算该合成原料拥有量 ↓ 拥有量超过需要量 -X> 合成条件不足,离开,do a ↓ 继续做下一个原料 //道具合成函式:DoItemCompose() function ClearItemsArray takes nothing returns nothing //每次合成结束就清空一次原料阵列,这个function总共被呼叫三次,包括合成失败 set bj_forLoopAIndex = 1 set bj_forLoopAIndexEnd = 5 loop exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd set udg_ItemStuff[GetForLoopIndexA()] = GetItemTypeId(null) set bj_forLoopAIndex = bj_forLoopAIndex + 1 endloop endfunction function ItemManipulatedCheck takes nothing returns boolean if ( GetItemTypeId(GetManipulatedItem()) == udg_ItemStuff[1] ) then return true endif if ( GetItemTypeId(GetManipulatedItem()) == udg_ItemStuff[2] ) then return true endif if ( GetItemTypeId(GetManipulatedItem()) == udg_ItemStuff[3] ) then return true endif if ( GetItemTypeId(GetManipulatedItem()) == udg_ItemStuff[4] ) then return true endif if ( GetItemTypeId(GetManipulatedItem()) == udg_ItemStuff[5] ) then return true endif return false endfunction function DoItemCompose takes nothing returns nothing // 针对每个原料 if ( not ItemManipulatedCheck() ) then call ClearItemsArray() return else endif set bj_forLoopBIndex = 1 set bj_forLoopBIndexEnd = 5 local integer tempInt = 0 loop exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd // 如果是no-item就离开回圈 exitwhen udg_ItemStuff[GetForLoopIndexB()] == GetItemTypeId(null) set tempInt = 0 // 计算需要量 set bj_forLoopAIndex = 1 set bj_forLoopAIndexEnd = 5 loop exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd if ( udg_ItemStuff[GetForLoopIndexA()] == udg_ItemStuff[GetForLoopIndexB()] ) then set tempInt = ( tempInt + 1 ) else endif set bj_forLoopAIndex = bj_forLoopAIndex + 1 endloop // 计算拥有量 set bj_forLoopAIndex = 1 set bj_forLoopAIndexEnd = 6 loop exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd if ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == udg_ItemStuff[GetForLoopIndexB()]) then set tempInt = ( tempInt - 1 ) else endif set bj_forLoopAIndex = bj_forLoopAIndex + 1 endloop // 如果任何一个条件失败就结束 if ( tempInt > 0 ) then // 结束前清空原料的阵列 call ClearItemsArray() return else endif set bj_forLoopBIndex = bj_forLoopBIndex + 1 endloop set bj_forLoopAIndex = 1 set bj_forLoopAIndexEnd = 5 loop exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd call RemoveItem( GetItemOfTypeFromUnitBJ(GetTriggerUnit(), udg_ItemStuff[GetForLoopIndexA()]) ) set bj_forLoopAIndex = bj_forLoopAIndex + 1 endloop call UnitAddItemByIdSwapped( udg_ItemStuff[0], GetTriggerUnit() ) call AddSpecialEffectTargetUnitBJ( "origin", GetTriggerUnit(), "Abilities\\Spells\\Items\\AIlm\\AIlmTarget.mdl" ) call DestroyEffectBJ( GetLastCreatedEffectBJ() ) // 结束前清空原料的阵列 call ClearItemsArray() endfunction --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.223.204.171
1F:推 Kendai:推 05/04 13:55
2F:推 Ricrollp:看不懂......>< 05/04 13:56
3F:→ gyd:简单说就是,把jass放进去,你只需要控制gui就可以合成 05/04 13:58
4F:→ gyd:物品的check(包括数量),remove,create都自动做好 05/04 14:00
5F:推 jhunfong:原po有玩暗黑吗...Lo Gul 05/04 14:01
6F:→ slycsboy:HOBILL的也跟他讨论过XD 这个系统整个简化 超赞 05/04 14:02
7F:推 cycu0315:推 05/04 14:02
8F:推 SvcChaos:push 05/04 15:01
9F:推 BlueLex:推 05/04 15:13
10F:→ blackjack0s:想推不能推... 05/04 17:03
11F:推 wix3000:推 我的地图有用类似的了,用触发直接写会lag 05/04 23:42
12F:推 wu2183:推 05/06 23:10
※ 编辑: gyd 来自: 218.171.58.70 (05/07 08:46)







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:Soft_Job站内搜寻

TOP