Skip to content

Commit

Permalink
[+] Item.SetItemTypeName(type, name) 扩展自定义物品类别名称
Browse files Browse the repository at this point in the history
[+] Item.GetItemTypeName(type) 获取扩展自定义物品类别名称
[+] Item.SetItemTypeEquipPlace(type, place) 扩展自定义物品类别装备位置
[+] Item.GetItemTypeEquipPlace(type) 获取扩展自定义物品类别装备位置
[+] Protocol.GetIp(fd) 获取IP
[+] Protocol.SendToFd(fd) 发送封包到指定的连接
[+] Protocol.GetFdByCharIndex(charIndex) 获取fd
[+] Item.SetItemTypeEquipLevelForJob(job, type, level) 扩展自定义物品类别职业装备等级
[+] Item.GetItemTypeEquipLevelForJob(job, type) 获取扩展自定义物品类别职业装备等级
[#] 修复登录800次后崩端的问题
  • Loading branch information
Muscipular committed Mar 26, 2023
1 parent be2905a commit 6aadba9
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 2 deletions.
1 change: 1 addition & 0 deletions Const.lua
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ CONST.CHAR_WindowBuffer2 = 0x0000008C / 4 + 0x7BC / 4;
CONST.CHAR_WindowBuffer3 = 0x0000008C / 4 + 0x7BC / 4 + 1;
CONST.CHAR_ENEMY_ID = 0x0000006C / 4 + 0x7BC / 4;
CONST.CHAR_ItemIndexes = 0x4CC / 4;
CONST.CHAR_MoveSpeed = 482;

--RECIPE START
CONST.ITEM_RECIPE_ID = 0x0;
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ useModule('Welcome') --
8. manaPool 血魔池
9. bag 背包切换
10. autoRegister 自动注册
11. petExt/charExt/itemExt 公共扩展模块
11. ~~petExt/charExt/itemExt 公共扩展模块(已废弃)~~
12. petLottery 宠物抽奖
13. petRebirth 宠物转生
14. autoUnlock 自动解锁崩端导致的卡号
Expand Down Expand Up @@ -172,3 +172,4 @@ useModule('Welcome') --
- `Recipe.RemoveRecipe` 删除配方
- `regGlobalEvent` 注册全局事件,代替Delegate,Delegate也是包装这个方法
- `removeGlobalEvent` 移除注册事件
- 更多接口参考 [docs.lua](docs.lua)
52 changes: 52 additions & 0 deletions docs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,41 @@ function Pet.GetUUID() end

Item = {}

---扩展自定义物品类别名称
---@param type number 类型
---@param name string 名称
---@return boolean
function Item.SetItemTypeName(type, name) end

---获取扩展自定义物品类别名称
---@param type number 类型
---@return string 名称
function Item.GetItemTypeName(type) end

---扩展自定义物品类别装备位置
---@param type number 类型
---@param place string 位置
---@return boolean
function Item.SetItemTypeEquipPlace(type, place) end

---获取扩展自定义物品类别装备位置
---@param type number 类型
---@return {number} 位置
function Item.GetItemTypeEquipPlace(type) end

---扩展自定义物品类别职业装备等级
---@param job number 职业ID
---@param type number 类型
---@param level number 等级
---@return boolean
function Item.SetItemTypeEquipLevelForJob(job, type, level) end

---获取扩展自定义物品类别职业装备等级
---@param job number 职业ID
---@param type number 类型
---@return {number} 位置
function Item.GetItemTypeEquipLevelForJob(job, type) end

function Item.GetData(ItemIndex, Dataline) end

function Item.SetData(ItemIndex, Dataline, value) end
Expand Down Expand Up @@ -507,3 +542,20 @@ function Tech.SetTechMagicAttribute(techId, earth, water, fire, wind) end
---@vararg number|string data,根据封包内容而定,数字及字符串无须进行封包编码,会默认处理
---@return number 返回少于0为失败,其他可视为成功
function Protocol.Send(charIndex, header, ...) end

---发送封包到客户端
---@param fd number
---@param header string 封包头
---@vararg number|string data,根据封包内容而定,数字及字符串无须进行封包编码,会默认处理
---@return number 返回少于0为失败,其他可视为成功
function Protocol.SendToFd(fd, header, ...) end

---获取客户端IP
---@param fd number
---@return string ip
function Protocol.GetIp(fd) end

---获取fd
---@param charIndex number
---@return number fd
function Protocol.GetFdByCharIndex(charIndex) end
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_HookVer = '0.2.26'
_HookVer = '0.2.27'
if getHookVer == nil then
error(string.format('[ERR] HOOK not load %s', _HookVer))
end
Expand Down

0 comments on commit 6aadba9

Please sign in to comment.