修改文件
C:\server\src\map\status_effect.h 添加下文信息 805 时游戏官方默认的,我们添加1001 – 1005 并修改 MAX_EFFECTID 为我们定义最大 +1
EFFECT_TOMAHAWK = 805, // Silent status effect inflicted by a Warrior using the "Tomahawk" job ability
ATMA001 = 1001,
ATMA002 = 1002,
ATMA003 = 1003,
ATMA004 = 1004,
ATMA005 = 1005,
// EFFECT_PLACEHOLDER = 806 // Description
// 806-1022
// EFFECT_PLACEHOLDER = 1023 // The client dat file seems to have only this many "slots", results of exceeding that are untested.
};
#define MAX_EFFECTID 1006 // 768 real + 38 custom
重新编译项目,添加下文sql
INSERT INTO `status_effects` (`id`, `name`, `flags`, `type`, `negative_id`, `overwrite`, `block_id`, `remove_id`, `element`, `min_duration`, `sort_key`) VALUES (1001, 'atma01', 32, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT INTO `status_effects` (`id`, `name`, `flags`, `type`, `negative_id`, `overwrite`, `block_id`, `remove_id`, `element`, `min_duration`, `sort_key`) VALUES (1002, 'atma02', 32, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT INTO `status_effects` (`id`, `name`, `flags`, `type`, `negative_id`, `overwrite`, `block_id`, `remove_id`, `element`, `min_duration`, `sort_key`) VALUES (1003, 'atma03', 32, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT INTO `status_effects` (`id`, `name`, `flags`, `type`, `negative_id`, `overwrite`, `block_id`, `remove_id`, `element`, `min_duration`, `sort_key`) VALUES (1004, 'atma04', 32, 0, 0, 0, 0, 0, 0, 0, 0);
INSERT INTO `status_effects` (`id`, `name`, `flags`, `type`, `negative_id`, `overwrite`, `block_id`, `remove_id`, `element`, `min_duration`, `sort_key`) VALUES (1005, 'atma05', 32, 0, 0, 0, 0, 0, 0, 0, 0);
添加一下global下的status文件 随便复制几个 改命为 atma01 – 05。然后游戏内就拥有了此状态,如果你不复制,服务器会报错
但是我们自定义是没有icon的,我们就需要使用命令,以此实现带有图标的技能
-- skillId是技能id,第二个参数图标样式
player:addStatusEffectEx(skillId, xi.effect.ATMA, atmaValue,0 , 86400, availableAtmaSlot)
-- 获取状态
local Effect = player:getStatusEffect(skillId)
-- 设定切图消失状态
Effect:setFlag(xi.effectFlag.ON_ZONE)
Effect:setFlag(xi.effectFlag.INFLUENCE)
清楚所有状态
local effects = player:getStatusEffects()
for k,v in pairs(effects) do
if v:getType() ~= 285 then
player:PrintToPlayer(string.format("shi yong :"..k),22)
player:PrintToPlayer(string.format("shi yong :"..v:getType()),22)
player:delStatusEffect(v:getType())
end
end
特殊说明: 以上文章,均是我实际操作,写出来的笔记资料,不会盗用别人文章!烦请各位,请勿直接盗用!转载记得标注来源!