jass看少了常常会忘记一些概念,新建此笔记用于记录。
一、GetConvertedPlayerId和GetPlayerId的区别
GetConvertedPlayerId,即(...)的玩家ID,输出的值是从1到16。
而GetPlayerId,即(...)的玩家ID-1,输出的值是从0-15。
所以,当看到local integer ID=GetPlayerId(GetOwningPlayer(u))+1时,定义的整数ID取值是从1开始。
二、给单位创建物品
if ((GetPlayerName(GetOwningPlayer(GetTriggerUnit())) == "会飞的羊")) then
call UnitAddItemByIdSwapped('I00X',GetEnteringUnit())
else
endif