找回密码
 register

QQ登录

只需一步,快速开始

查看: 21|回复: 2

雪舞专用引擎动态库回调使用\文件加载教程 V20250605版 先锋测试版

[复制链接]

雪舞专用引擎动态库回调使用\文件加载教程 V20250605版 先锋测试版

[复制链接]
  • 打卡等级:热心大叔
  • 打卡总天数:207
  • 打卡月天数:6
  • 打卡总奖励:205
  • 最近打卡:2025-06-06 16:52:14
Waylee

主题

0

回帖

2万

积分

仙帝

积分
21656
Waylee 2025-6-5 21:37 | 显示全部楼层 |阅读模式 | Google Chrome | Windows 10

马上注册,查看网站隐藏内容!!

您需要 登录 才可以下载或查看,没有账号?register

×

更新版本:雪舞天龙八部动态库 V20250605
不适用其他版本

\home\tlbb\Public\Data\Script\NewScript\CallBack.lua

x768990_g_ScriptId = 768990

--伤害回调
--参数值:场景ID、施暴者、受害者、伤害值、是否暴击、技能ID
--返回值:伤害数值、是否暴击
function x768990_G_GetCDDamage(sceneId,selfId,targetId,nDamage,bCritical,nskillId)
    local vv = nDamage
    if targetId < 15000 then
        -- vv = nDamage * 5 --临时显示用代码
        --print(" LUA PRINT 伤害值:"..floor(vv).." 是否暴击:"..bCritical.." 使用的技能ID: "..nskillId)
    end
    x768990_NotifyTip(sceneId,selfId, "施暴者:"..selfId.." 受害者"..targetId.." 伤害值:"..floor(vv).." 是否暴击:"..bCritical.." 使用的技能ID: "..nskillId)

    --篡改值
    -- nDamage = 1
    -- bCritical = 1
    -- nDamage = 10000

    return nDamage,bCritical
end

--穿戴回调
--返回值:0允许穿戴 其他值禁止穿戴
--返回值:-1或者0不修改等级,其他值(>0)为篡改后的等级
function x768990_UesEquip(sceneId,selfId,nBagPos,nEquipPoint)
    x768990_NotifyTip(sceneId, selfId, "穿戴装备 nBagPos:"..nBagPos.." nEquipPoint:"..nEquipPoint)

    return 0,0
end
--**********************************
--装备穿戴完毕
--**********************************
function x768990_UesEquipFinish(sceneId,selfId,nEquipPoint,nBagPos)
    if nEquipPoint == 0 then

    end
    --x768990_NotifyTip(sceneId, selfId, "穿戴已经完成 nEquipPoint:"..nEquipPoint.." nBagPos:"..nBagPos)
end 

--**********************************
--装备卸下 
--0将玩家踢下线 1允许卸下 2禁止卸下 
--**********************************
function x768990_UnEquip(sceneId,selfId,nEquipPoint,nBagPos)
    if nBagPos == 1 then
        --x768990_NotifyTip(sceneId, selfId, "装备卸下 nBagPos:"..nEquipPoint.." nEquipPoint:"..nBagPos)
        return 2
    end

    --x768990_NotifyTip(sceneId,selfId,"装备卸下 nEquipPoint:"..nEquipPoint.." nBagPos:"..nBagPos);
    return 0;
end

--**********************************
--装备卸下完毕
--**********************************
function x768990_UnEquipFinish(sceneId,selfId,nEquipPoint,nBagPos)
    --x768990_NotifyTip(sceneId,selfId,"装备卸下完毕 nEquipPoint:"..nEquipPoint.." nBagPos:"..nBagPos);
end

--**********************************
--创建帮派回调
--返回值:1允许、-1拒绝
--**********************************
function x768990_CreatGuild(sceneId,selfId) 
    if GetLevel(sceneId,selfId) < 119 then
        -- x768990_NotifyTip(sceneId,selfId,"创建帮会条件未满足:需要角色等级达到119级。");
        -- return -1
    end
    return 1
end

--**********************************
--升级等级限制回调 
--返回值:1允许、0拒绝
--**********************************
function x768990_OnHumanLevelUpCheck(sceneId,selfId)

    --放行允许升级
    return 1
end

-- 元宝扣除回调
function x768990_CostYuanBao( sceneId, selfId, Msg )
    --print("-----------------------------------------",sceneId, selfId, Msg )
end

--珍兽死亡事件
function x768990_HumanPetDie(sceneId, myObjId, KillerObjID, KillerPetObjID)
    -- AddGlobalCountNews(sceneId,format("殘暴的#{_INFOUSR%s}在#{_INFOUSR%s}兇殘的殺死了#{_INFOUSR%s}的人見人愛車見車爆胎的#{_INFOUSR%s},真令人痛心。上帝眷恋它。",
    -- GetName(sceneId,KillerObjID),GetSceneName(sceneId),GetName(sceneId,myObjId),GetName(sceneId,KillerPetObjID)))    
end

--珍兽宝宝出战回调
function x768990_OnPetObjCreate(sceneId, selfId,nIndex, m_uHighSection, m_uLowSection)
    --print("x768990_OnPetObjCreate..............",sceneId, selfId,nIndex, m_uHighSection, m_uLowSection)
    --local DataID = LuaFnGetPet_DataID( sceneId, selfId, nIndex)
    --AddGlobalCountNews(sceneId,format("隐世宗门的#{_INFOUSR%s}在#{_INFOUSR%s}开心的陪着宝宝#{_INFOUSR%s}溜街,它的高位ID:%d,低位ID:%d。",
    --GetName(sceneId,selfId),GetSceneName(sceneId),GetPetName( DataID )  ,m_uHighSection,m_uLowSection))   

    LuaFnRefreshPetData(sceneId, selfId,m_uHighSection,m_uLowSection);

    --刷新珍兽MD数据
    LuaFnRefreshPetObject(sceneId, selfId,m_uHighSection, m_uLowSection)
end

--**********************************
--宠物休息
--**********************************
function x768990_OnPetRelax(sceneId,selfId,pgH, pgL)
    --print(".........x768990_OnPetRelax..............",sceneId,selfId,pgH, pgL)

    LuaFnRefreshPetData(sceneId, selfId,pgH,pgL);
    LuaFnRefreshPetObject(sceneId, selfId,pgH, pgL)
end

--自带元宝商店消费事件回调
function x768990_YuanbaoShopYuanbaoCost(sceneId, selfId,nYuanBao)
    if LuaFnIsObjValid(sceneId, selfId) ~= 1 or LuaFnIsCanDoScriptLogic(sceneId,selfId) ~= 1 then
        return -1;
    end
    --参数检查
    if nYuanBao == nil or nYuanBao < 0 then
        nYuanBao = 0;
    end

    local Count = GetMissionData(sceneId,selfId,284) + nYuanBao;
    --上限检查
    if Count > 2100000000 then
        Count = 2100000000;
    end
    SetMissionData(sceneId,selfId,284, Count)
    x768990_NotifyTip( sceneId, selfId, "您已经累计消费"..Count.."元宝!" );
    return 1;
end

--摘除宝石检查
function x768990_GemBindCancel( sceneId, selfId, BagIndex,GemIndex,MaterialIndex )
    -- if GemIndex == nil or GemIndex < 0 or GemIndex > 99 then
        -- x768990_NotifyTip( sceneId, selfId, "没有获得宝石Index。" );
        -- return
    -- end
    -- LuaFnSetItemBLock(sceneId,selfId, GemIndex, 0)

    --读取宝石ID
    -- local GemId = LuaFnGetItemTableIndexByIndex( sceneId, selfId, GemIndex )
    -- if GemId == 50102001 then
        -- --强制解绑宝石
        -- LuaFnSetItemBLock(sceneId,selfId, GemIndex, 0)
        -- x768990_NotifyTip( sceneId, selfId, "宝石ID"..tostring(GemId).."符合解绑要求,系统以为您解绑。" );
    -- else
        -- x768990_NotifyTip( sceneId, selfId, "宝石ID"..tostring(GemId).."不符合解绑要求。" );
    -- end
    --调试

end

--瞬移类技能回调
--fX X坐标 
--fZ Z坐标
--DataIndex BUFF索引ID
function x768990_callback_StdImpact009(sceneId,selfId,fX,fZ,DataIndex)
    x768990_NotifyTip( sceneId, selfId, "fX:"..tostring(fX).."   fZ:"..tostring(fZ).."   DataIndex:"..tostring(DataIndex) );

    -- fX = 88;
    -- fZ = 99;
    return fX,fZ
end

--**********************************
--百分比修正类BUFF回调 原名:HealthIncrement
--**********************************
function x768990_callback_StdImpact005(sceneId, selfId, nskillId, ImpactID, Increment, targetId)

    --print(sceneId, selfId, nskillId, ImpactID, Increment, targetId)

    -- x768990_NotifyTip(sceneId, selfId, 
    -- "场景ID:" .. tostring(sceneId) ..
    -- " 施法者:" .. tostring(selfId) ..
    -- " 技能id:" .. tostring(nskillId) ..
    -- " buffid:" .. tostring(ImpactID) ..
    -- " 原治疗量:" .. tostring(Increment) ..
    -- " 被奶者:" .. tostring(targetId)
    -- )

    return Increment
end

function x768990_callback_StdImpact010(sceneId,ObjID,CasterObjID,DataIndex,skillId,CasterLogicCount)
    print(sceneId,ObjID,CasterObjID,DataIndex,skillId,CasterLogicCount)
    return 1
end

--超长字符串参数传递
function x768990_Client_Msg(sceneId, selfId, cParam3)
    local FG = LuaSplit(cParam3, ",")
    local scriptid = FG[2]
    local funcname = FG[3]

    print("Client_Msg:",sceneId, selfId,scriptid,funcname,FG[4],FG[5],FG[6],FG[7],FG[8],FG[9],FG[10],FG[11],FG[12],FG[13],FG[14],FG[15],FG[16],FG[17],FG[18])

end

--**********************************
-- 群体技能半径影响
-- radius 半径(米)
--**********************************
function x768990_callback_SkillRadius(sceneId,selfId,nskillId,radius) 
    -- x768990_NotifyTip( sceneId, selfId, "技能(ID):"..tostring(nskillId).."   技能半径(米):"..tostring(radius));
    return radius
end

--**********************************
-- 群体技能人数影响
-- defaultTargetCount  默认寻找到的目标数量
-- maxTargetCount      最大攻击目标数量(返回值 安全范围:0~255)
-- targetData          目标数据
-- getTargetID         获取目标ObjID的函数
--**********************************
function  x768990_callback_SkillTargetCount(sceneId, selfId, skillId, defaultTargetCount, maxTargetCount, targetData, getTargetID) 
    -- x768990_NotifyTip(sceneId, selfId, "技能(ID): " .. tostring(skillId) ..
        -- "   寻找到目标数:" .. tostring(defaultTargetCount) ..
        -- "   最大目标数:" .. tostring(maxTargetCount))

    --maxTargetCount = 20 --修改数量

    local nMax = 0
    for i = 0, maxTargetCount - 1 do
        local targetID = getTargetID(sceneId, selfId, targetData, i)
        if targetID ~= nil and targetID > 0 and targetID <= 29999 then --检查有效值
            -- x768990_NotifyTip(sceneId, selfId, "名字:" .. GetName(sceneId, targetID) ..
                -- " 目标血量:" .. GetHp(sceneId, targetID) ..
                -- " ObjID:" .. targetID)
            -- print(targetID) --终端输出
            -- nMax = nMax + 1
        end
    end
    --x768990_NotifyTip(sceneId, selfId, "获取到有效obj的数量 " .. tostring(nMax))

    -- 返回调整后的目标数量
    return maxTargetCount
end

--命中闪避修正
--selfId        施暴者 
--targetId      受害者          
--bHit          是否命中     1命中,0闪避
--nHitRate      命中率          返回值: 可修改,调整命中概率(範圍0~100)
--nRand         命中随机数    返回值: 可修改,nRand < nHitRate 时为命中状态
--nSkillID      技能ID 
function x768990_IsHit(sceneId,selfId,targetId,bHit,nHitRate,nRand,nSkillID)
    -- x768990_NotifyTip(sceneId, selfId,"   被攻擊Obj:" .. tostring(targetId) ..
        -- "   当前是否命中:" .. tostring(bHit) ..
        -- "   命中率:" .. tostring(nHitRate)..
        -- "   随机值:" .. tostring(nRand)..
        -- "   技能(ID): " .. tostring(nSkillID))

    --nHitRate = nHitRate+100
    --返命中率 和 命中隨機值
    return nHitRate,nRand
end

--暴击回调
--IsCriticalHit     是否是会心一击
--nCriticalRate     会心率,或者叫暴击率,调整暴击概率改这个哦 值范围(0~9999)
--nRand             随机数,决定你是否暴击,当 nRand < nCriticalRate 时暴击,值范围(0~99)
--nSkillID          技能ID
function x768990_IsCriticalHit(sceneId,selfId,targetId,IsCriticalHit,nCriticalRate,nRand,nSkillID)
    -- x768990_NotifyTip(sceneId, selfId,"   受害者:" .. tostring(targetId) ..
        -- "   是否暴击:" .. tostring(IsCriticalHit) ..
        -- "   暴击率:" .. tostring(nCriticalRate)..
        -- "   随机值:" .. tostring(nRand)..
        -- "   技能ID: " .. tostring(nSkillID))

    --nCriticalRate = nCriticalRate+100
    --返回暴击率 和 暴击随机数
    return nCriticalRate,nRand
end

--技能后置行为拦截(在其他引擎条件判断结束后再判断此回调)
--放行:0  拦截:其他值都是拦截 (需要配合技能放行白名单,免疫nil值和异常值)
function x768990_callback_SkillStart(sceneId,selfId,nTargetID,nSkillID,nPosX,nPosY,nDir,nMenPai)
    x768990_NotifyTip(sceneId, selfId,"技能回调   施法者:" .. tostring(selfId) ..
        "   受害者:" .. (nTargetID) ..
        "   技能ID:" .. tostring(nSkillID) ..
        "   坐标:" .. tostring(nPosX)..","..tostring(nPosY)..
        "   方向:" .. tostring(nDir)..
        "   门派:" .. tostring(nMenPai)
        )

      -- if LuaFnCanUseSkill(sceneId, selfId,392) < 0 then
        -- return 2;
      -- end

    --技能拦截 or 放行
    return 0
end

--**********************************
-- 陷阱回调 (Fade In)
-- selfId       施暴者
-- targetId         受害者
-- nDataID      陷阱ID
-- nPowerPer    额外伤害(百分比增伤)
-- trapData:    陷阱数据对象
-- getData:     获取陷阱数据
-- setData:     设置陷阱数据
--**********************************
function x768990_OnSpecialFadeIn(sceneId,selfId,targetId,nDataID,nPowerPer,SpecialData,getData,setData)
    -- print(sceneId,selfId,targetId,nDataID,nPowerPer,user_data,getData,setData)

    -- AddGlobalCountNews(sceneId,
    -- "#r   陷阱索引:"..nDataID..
    -- "#r 0 持续时间:"..getData(sceneId,selfId,SpecialData,0).. --持续时间
    -- "#r 1 间隔时间:"..getData(sceneId,selfId,SpecialData,1).. --陷阱间隔时间
    -- "#r 2 已过时间:"..getData(sceneId,selfId,SpecialData,2).. --已经过的间隔时间
    -- "#r 8 激发次数:"..getData(sceneId,selfId,SpecialData,8)   --可以激发的次数
    -- )

    --if GetMissionData(sceneId,selfId,500) == 1 then
        --setData(sceneId,selfId, SpecialData,8,10) --设置可激发次数
        --SetMissionData(sceneId,selfId,500,0) 
    --end

    -- nPowerPer = 100000

    -- x768990_NotifyTip(sceneId,selfId,"施暴者:"..GetName(sceneId,selfId).." 受害者:"..
    -- GetName(sceneId,targetId).."]使用 "..nDataID.." 号陷阱增加 "..nPowerPer.."% 伤害")

    return nPowerPer
end

--交易确认回调
--返回值: 允许交易:0 阻止交易:任何其他数
--获取物品信息:local item_id, count = GetData(sceneId, id1, "ITEM", i)
--获取珍兽信息:local pet_id_H, pet_id_L = GetData(sceneId, id1, "PET", i)
function x768990_ExchangeConfirmation(sceneId, selfId, targetId, GetData)
    local Allow = 0 --默认允许交易

    -- --物品、珍兽信息
    -- for i = 0, 4 do
        -- local item_id, count = GetData(sceneId, selfId, "ITEM", i)
        -- if item_id > 0 then
            -- AddGlobalCountNews( sceneId,tostring(i) .. " 物品ID:" .. tostring(item_id) .. " 物品数量:" .. tostring(count))
        -- end
    -- end
    -- for i = 0, 4 do
        -- local pet_id_H, pet_id_L = GetData(sceneId, selfId, "PET", i)
        -- if pet_id_H > 0 then
            -- AddGlobalCountNews( sceneId,tostring(i) .. " 珍兽高位:" .. tostring(pet_id_H) .. " 珍兽低位:" .. tostring(pet_id_L))
        -- end
    -- end
    -- if Allow ~= 0 then
        -- x768990_NotifyTip(sceneId,selfId,"存在违禁品,请检查交易物品后再次尝试。") --弹出提示信息
    -- end

    --交易是否拦截
    return Allow
end

--////////////////////////////////////////////////
--BUFF持续时间 @雪舞 WAYLEE.NET
--参数说明:
-- selfId           发送者(创建BUFF的人)
-- targetId         接收者(这个BUFF作用给谁)
-- continuance      持续时间
-- DataIndex        BUFF索引ID
-- nSkillId         技能ID(并非所有BUFF都有技能ID)
--////////////////////////////////////////////////
x768991_g_ScriptId = 768991

function x768990_callback_BuffTime(sceneId,selfId, targetId, continuance, DataIndex, nSkillId)
    x768990_NotifyTip( sceneId, selfId, "持续时间回调 selfId :"..tostring(selfId)..
    "   targetId:"..tostring(targetId)..
    "   continuance:"..tostring(continuance)..
    "   DataIndex:"..tostring(DataIndex)..
    "   nSkillId:"..tostring(nSkillId)  );

    return continuance
end

--**********************************
--醒目提醒
--**********************************
function x768990_NotifyTip( sceneId, selfId, Msg )
    BeginEvent( sceneId )
        AddText( sceneId, Msg )
    EndEvent( sceneId )
    DispatchMissionTips( sceneId, selfId )
end

\home\tlbb\Public\Data\Script\scene.lua

--**********************************
--离开场景回调(雪舞版)
--sceneId:当前场景ID(传送前) selfId:玩家ID
--**********************************
function x888888_OnScenePlayerLeave(sceneId,selfId) 
    print("-------离开场景回调.........",sceneId,selfId)
    return 1;
end

run.sh

ulimit -n 65535
if ps aux | grep -w "./ShareMemory" | grep -v grep > /dev/null 2>&1;then
    echo " ShareMemory  is running !!!!!!"
else
    ###### start ShareMemory ######
    cd /home/tlbb/Server/
    ./shm clear > /dev/null 2>&1
    rm -rf exit.cmd quitserver.cmd
    #echo -e "\n"
    ./shm start > /dev/null 2>&1
    #echo -e "\n"
    echo " start ShareMemory ......"

    #until  [ "$STATUS" ]
    #FILE=`ls -l -lt /home/tlbb/Server/Log/ShareMemory* | head -n 1 | awk '{print$9}' `
    #do
    #  STATUS=`tail -1 $FILE | grep "Loop...Start" | egrep -vi 'grep|tail' `
    #done

    sleep 8
    echo " ShareMemory started completely !!!!!!"

    ###### start World ######
    cd /home/tlbb/Server/
    unset LD_PRELOAD
    export LD_PRELOAD="/home/tlbb/Server/libWorldServer.so"
    ./World > /dev/null 2>&1 &
    echo " start World ......"
    sleep 5
    echo " World started completely !!!!!!"

    ###### start Login ######
    unset LD_PRELOAD
    export LD_PRELOAD="/home/tlbb/Server/libLoginServer.so"
    ./Login > /dev/null 2>&1 &
    echo " start Login ......"
    sleep 1
    echo " Login started completely !!!!!!"

    ##内存异常捕获配置
    export ASAN_OPTIONS=halt_on_error=0:abort_on_error=0:log_path='/home/tlbb/Server/assert_core.log'
    unset LD_PRELOAD
    export LD_PRELOAD="/home/tlbb/Server/libTianlongEx.so"
    ###### start Server ######
    cd /home/tlbb/Server/
    ./Server > /dev/null 2>&1 &
    echo " start Server ......"
    unset LD_PRELOAD
    #until
    #[ "$?" = "1" ]
    #do
    #  ps aux | grep -w "./Server -loadscriptonce" | grep -v grep >/dev/null 2>&1
    #done

    sleep 15
    echo " Server started completely !!!!!!"
    exit
fi

需要更新的txt表文件
\tlbb\Public\Config

  • ItemEnhance.txt                   强化表
  • ScriptSkillTable.txt              技能回调白名单
  • XinFaStudySpend_V1.txt        心法学习
  • XiuLianDetial.txt                 修炼表

\tlbb\Server\Config

  • AttrLevelUpTable.txt              升级属性表 20门派
  • BaseConfig.ini                    预留待定
  • BaseValueTable.ini                基础属性表
  • Filt.txt                              说话拦截表
  • ServerMaxlevel.txt            动态升级拦截表
  • StallInfo.txt                     摆摊要求表

表格参考下载: 加载的文件V20250605.zip (45.64 KB, 下载次数: 4)


  • 打卡等级:热心大叔
  • 打卡总天数:207
  • 打卡月天数:6
  • 打卡总奖励:205
  • 最近打卡:2025-06-06 16:52:14
楼主
Waylee 楼主

主题

0

回帖

2万

积分

仙帝

积分
21656
Waylee 2025-6-5 22:15 | 显示全部楼层 | Google Chrome | Windows 10
//第一个窗口输入:
cd /home/tlbb/Server
./shm start

//第二个窗口输入:
cd /home/tlbb/Server
./Login

//第三个窗口输入:
cd /home/tlbb/Server
./World

//第四个窗口输入:
cd /home/tlbb/Server
unset LD_PRELOAD
export LD_PRELOAD="/home/tlbb/Server/libTianlongEx.so"
./Server
  • 打卡等级:常驻代表
  • 打卡总天数:38
  • 打卡月天数:7
  • 打卡总奖励:38
  • 最近打卡:2025-06-07 02:34:10
Jvzi

主题

0

回帖

217

积分

金丹

积分
217
Jvzi 2025-6-6 11:23 | 显示全部楼层 | Google Chrome | Windows 10

您需要登录后才可以回帖 登录 | register

本版积分规则

雪舞知识库 | 浙ICP备15015590号-1 | 萌ICP备20232229号|浙公网安备33048102000118号 |网站地图|天天打卡

GMT+8, 2025-6-7 04:31 , Processed in 0.109107 second(s), 8 queries , Redis On.

Powered by XueWu Licensed

Copyright © Tencent Cloud.

快速回复 返回顶部 返回列表