找回密码
 register

QQ登录

只需一步,快速开始

搜索
查看: 25|回复: 0

[软件分享] 战旗功能 令旗脚本

[复制链接]
  • 打卡等级:本地老炮
  • 打卡总天数:375
  • 打卡月天数:23
  • 打卡总奖励:373
  • 最近打卡:2025-12-23 12:42:07
Waylee 发表于 2025-12-22 22:23 | 显示全部楼层 |阅读模式 | Google Chrome | Windows 10

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

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

×

8e084144ec4f7ba5134e30a66e2f71fd.webp

ZhanQI_HuiTiao.lua

--旅途战旗回调
x956809_g_scriptId = 956808
x956808_g_BUFFID = 11085
function x956808_OnCharacterTimer(sceneId,objId,dataId,uTime)
    local MonsterX, MonsterZ = GetWorldPos(sceneId,objId)
    local nHumanCount = LuaFnGetCopyScene_HumanCount(sceneId)
    for i = 0, nHumanCount - 1 do
    local nHumanId = LuaFnGetCopyScene_HumanObjId(sceneId,i)
        if LuaFnIsObjValid(sceneId, nHumanId) == 1 and LuaFnIsCanDoScriptLogic(sceneId, nHumanId) == 1 and LuaFnIsCharacterLiving(sceneId, nHumanId) == 1 then
        local humanX, humanZ = GetWorldPos(sceneId,nHumanId)
        local distance = sqrt((humanX-MonsterX)^2+(humanZ-MonsterZ)^2)
            if distance < 10 then
                if LuaFnHaveImpactOfSpecificDataIndex(sceneId,nHumanId,x956808_g_BUFFID) == 0 then
                    LuaFnSendSpecificImpactToUnit(sceneId,objId,objId,nHumanId,x956808_g_BUFFID,0)
                end
            end
        end
    end
end

Summon_WarBanner.lua

--by:旅途
--战旗召唤处理脚本
x956807_g_scriptId = 956807
x956807_g_iTemID = 38000220
x956807_g_nMonsterTable = {nMonsterID = 54884,nBaseAI = 3,AIScript = 8,nScriptID = 956808}
function x956807_IsSkillLikeScript(sceneId,selfId)
    return 1
end
function x956807_CancelImpacts(sceneId,selfId)
    return 0
end
function x956807_OnConditionCheck(sceneId,selfId )
    if LuaFnVerifyUsedItem(sceneId,selfId) ~= 1 then
        return 0
    end
    local ItemTableIndex = LuaFnGetItemIndexOfUsedItem(sceneId,selfId)
    if ItemTableIndex ~= x956807_g_iTemID then
        x956807_NotifyFailTips(sceneId,selfId,"未开放道具")
        return
    end
    local MonsterCallBack = x956807_CallBack(sceneId,selfId)
    if MonsterCallBack == 0 then
        x956807_NotifyFailTips(sceneId,selfId,"十米内已经召唤了战旗,请离远一点")
        return
    end
    return 1
end
function x956807_OnDeplete(sceneId,selfId )
    if LuaFnDepletingUsedItem(sceneId,selfId ) > 0 then
        return 1
    end
    x956807_NotifyFailTips(sceneId,selfId,"道具扣除失败,请检查是否加锁。")
    return 0
end
function x956807_OnActivateOnce(sceneId,selfId)
    local x,z = GetWorldPos(sceneId,selfId)
    if x956807_g_nMonsterTable.nMonsterID ~= nil then
        local MonsterId = LuaFnCreateMonster(sceneId,x956807_g_nMonsterTable.nMonsterID,x,z,x956807_g_nMonsterTable.nBaseAI,x956807_g_nMonsterTable.AIScript,x956807_g_nMonsterTable.nScriptID)
        SetCharacterTitle(sceneId,MonsterId,GetName(sceneId,selfId).."专属")
        SetMonsterFightWithNpcFlag(sceneId,MonsterId,0)
        SetCharacterTimer(sceneId,MonsterId,1000)
        SetCharacterDieTime(sceneId,MonsterId,180000)
    end
end
--**********************************
function x956807_OnActivateEachTick(sceneId,selfId )
    return 1
end
function x956807_CallBack(sceneId,selfId)
    local selfX, selfZ = GetWorldPos(sceneId,selfId)
    local nMonsterCount = GetMonsterCount(sceneId)
    for i=0, nMonsterCount-1 do
    local nMonsterId = GetMonsterObjID(sceneId,i)
    local MonsterDataID = GetMonsterDataID(sceneId, nMonsterId)
        if MonsterDataID == 54884 then
        local MonsterX,MonsterZ = GetWorldPos(sceneId,nMonsterId)
        local distance = sqrt((selfX-MonsterX)^2+(selfZ-MonsterZ)^2)
            if distance < 10 then
                return 0
            end
        end
    end
    return 1
end
function x956807_NotifyFailTips(sceneId,selfId,Tip)
    BeginEvent(sceneId)
        AddText( sceneId,Tip)
    EndEvent(sceneId)
    DispatchMissionTips(sceneId,selfId)
end

以下内容不能直接复制,请在你服务端找一个类似的道具和buff然后参考修改.
因为网站不支持[tab],会导致复制后乱码 服务器无法识别

54884   玄武令旗    1   25  243 0   10  3   -1  8   20  1   0.1 0   0   706 331 706 331 2996    802 0   0   246 49  3   3   1800    0   0   0   60  0   0   60  0   0   60  0   0   60  0   -1  -1  8826    1   -1  -1  0   100 set:CommonNPCHeader48 image:CommonNPCHeader48_5 1200    2400    -1  -1  -1  -1  -1  -1  -1  0   12  10  0   0   2   1   0   0   4   -1

154 0   召唤战旗    召唤战旗    召唤战旗    0   180000  3000    -1      -1  0   0       -1  0   0       -1  0   0   -1  0   0   |生效一次的附加效果1 -1  |引导周期的附加效果1 -1  |生效一次的附加效果2 -1  |引导周期的附加效果2 -1      0       0       0       0       0       0       0       0                   

116 116 -1  召唤战旗    Food_1  -1  0   0   1   0   1   -1  -1  -1  0   0   145             143 143 -1  0   3   0   0   -1  -1  -1  -1  -1  -1  -1  0   -1      -1  0   1200    -1  -1  1   0   -1  0   0   0   100 -1  0   -1  0   0   0   0   0   0   154 154 154 154 154 154 154 154 154 154 154 154 154 154 154 190 召唤战令旗   0   1   100 0   1   

38000220    3   80  0   202 CircularTaskTool13_4    战旗召唤令   #Y使用后即可在脚下召唤#G战旗#Y在战旗周围10码范围内,所有的玩家都会持续回血。(右键点击即可使用)    15  0   0   10  1   956807  116 1   -1  -1  -1  4   战旗召唤令   1   0   2005    -1  1   
您需要登录后才可以回帖 登录 | register

本版积分规则

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

GMT+8, 2025-12-23 13:50 , Processed in 0.099678 second(s), 6 queries , Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2025 Discuz! Team.

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