This commit is contained in:
aixianling
2024-12-13 13:41:02 +08:00
commit 06658f112f
3887 changed files with 2687822 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
--lua script
--ʹ<>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD>ѧϰ<D1A7><CFB0><EFBFBD><EFBFBD>
--#include "data\config\item\SkillBookItem.txt" once
--[[
--<2D><><EFBFBD><EFBFBD>buff<66><66><EFBFBD><EFBFBD>Ʒ
--sysarg:ʵ<><CAB5><EFBFBD>ָ<EFBFBD><D6B8>
--itemidx: <20><>Ʒ<EFBFBD><C6B7>ID
--itemPtr: <20><>Ʒ<EFBFBD><C6B7>ָ<EFBFBD><D6B8>
--ItemTable: <20><><EFBFBD>õIJ<C3B5><C4B2><EFBFBD><EFBFBD>б<EFBFBD>
--]]
function UseBookLearnSkill(sysarg,count,itemidx,itemPtr,ItemTable) --<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>count<6E><74>Ч
local nJop = Actor.getIntProperty(sysarg, PROP_ACTOR_VOCATION)
if nJop == 0 or nJop == ItemTable.jop_id then
local curSkillLv = Actor.getSkillLevel(sysarg,ItemTable.skill_id)
if curSkillLv < ItemTable.skill_Level then
if curSkillLv ~= (ItemTable.skill_Level - 1) then
Actor.sendTipmsg( sysarg,OldLang.Script.UseSkillBook001,ttFlyTip )
return
end
local canLearn = true
if ItemTable.needConsume and Actor.removeItemByPtr(sysarg,itemPtr,1,true, OldLang.Log.UseSkillBook, 167) <= 0 then
canLearn = false
end
if canLearn then
Actor.startLearnSkill(sysarg,ItemTable.skill_id,ItemTable.skill_Level)
return true
end
elseif curSkillLv >= ItemTable.skill_Level then
Actor.sendTipmsg( sysarg,OldLang.Script.UseSkillBook002,ttFlyTip )
end
else
Actor.sendTipmsg( sysarg,OldLang.Script.UseSkillBook003,ttFlyTip )
end
end
function BookLeanrnSkillInit(sysarg)
for i = 1,table.getn(SkillBoolConfig) do
local x = SkillBoolConfig[i]
GlobalItemFn[x.item_id] = { func = UseBookLearnSkill, params = x }
end
end
table.insert(InitFnTable,BookLeanrnSkillInit)