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