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