你微笑时最美 发表于 2023-9-7 18:34:58

天龙八部端游添加脚本,天龙大佬帮我看看函数加的有没有问题,摸索着自己加的

本帖最后由 你微笑时最美 于 2023-9-10 19:42 编辑

天龙问题5(已解决):有关客户端axp文件内更新文件的问题,可以自己配置一个登录器,然后采用补丁的形式进行替换,
解决Interface.axp报错的问题,并不需要进行解包在打包的方式,也就不会出错了。

问题6(已解决):下面为正确添加方法。自己尝试过来的。

--新的元宝商店
x888902_g_scriptId = 888902
--元宝商店列表 要与客户端界面对应
x888902_g_shoplist = {}
x888902_g_shoplist = {188, 189, 197, 132, 216}    --大卖场
x888902_g_shoplist = {180, 215, 178, 193,194}   --宝石商城,添加"大理宝石斋--149",czf,2009.07.21
x888902_g_shoplist = {195, 135, 152, 208}   --珍兽商城
x888902_g_shoplist = {136, 137, 144, 210}    --南北杂货
x888902_g_shoplist = {120, 181, 145, 134}   --形象广场
x888902_g_shoplist = {190}    --花舞人间
x888902_g_shoplist = {146}      --武功秘籍
x888902_g_shoplist = {156, 157, 158, 159, 160, 161, 162, 163} --打造图
x888902_g_shoplist = {149}   --我要更强大
x888902_g_shoplist = {149}   --我要更有魅力
x888902_g_shoplist = {149}   --我要打造极品装备
x888902_g_shoplist = {149}    --我要打造极品珍兽
x888902_g_shoplist = {149}   --我要移动的更快
x888902_g_shoplist = {149}   --我要向别人表白
x888902_g_shoplist = {149}    --我要学习新技能
--绑定元宝店
x888902_g_shoplist = {153,212}    --我要学习新技能
x888902_g_shoplist = {191,212,213}    --我要学习新技能
x888902_g_shoplist = {123,124,192}    --我要学习新技能
x888902_g_shoplist = {209,211}    --我要学习新技能
--**********************************
--醒目提示
--**********************************
function x888902_NotifyTip( sceneId, selfId, Msg )
BeginEvent( sceneId )
AddText( sceneId, Msg )
EndEvent( sceneId )
DispatchMissionTips( sceneId, selfId )
end
--**********************************
-- 检查此随身NPC的功能
-- op是请求类别,比如1代表元宝相关的随身操作……
--**********************************
function x888902_OpenYuanbaoShop( sceneId, selfId, targetId , shopA ,shopB )
-- TryRecieveItem( sceneId, selfId, 10100002, 1 )
    if targetId == 9999 then
   if shopA == 1 then
      local HaveYuanBao = YuanBao(sceneId,selfId,-1,3,0)
   if HaveYuanBao < 200 then
       BroadMsgByChatPipe(sceneId, selfId, "@*;SrvMsg;DBD:元宝不足,无法自动购买血药", 0);
       return
   end
   YuanBao(sceneId,selfId,-1,2,200)
   TryRecieveItem( sceneId, selfId, 31000001, 1 )
elseif shopA == 2 then
      local HaveYuanBao = YuanBao(sceneId,selfId,-1,3,0)
   if HaveYuanBao < 200 then
       BroadMsgByChatPipe(sceneId, selfId, "@*;SrvMsg;DBD:元宝不足,无法自动购买蓝药", 0);
       return
   end
   YuanBao(sceneId,selfId,-1,2,200)
   TryRecieveItem( sceneId, selfId, 31000003, 1 )      
else
      local HaveYuanBao = YuanBao(sceneId,selfId,-1,3,0)
   if HaveYuanBao < 11 then
       BroadMsgByChatPipe(sceneId, selfId, "@*;SrvMsg;DBD:元宝不足,无法自动购买珍兽药", 0);
       return
   end
   YuanBao(sceneId,selfId,-1,2,11)
   TryRecieveItem( sceneId, selfId, 30607001, 1 )
end
   return
end
local bCheck = x888902_YuanbaoShopCheckOp(sceneId,selfId);   
if bCheck > 0 then
if shopA > 0 and shopA < 105 and x888902_g_shoplist ~= nil then
   --PrintStr(x888902_g_shoplist)
   if targetId == -1 then
    DispatchYuanbaoShopItem( sceneId, selfId, x888902_g_shoplist)
   else
    DispatchNpcYuanbaoShopItem( sceneId, selfId, targetId , x888902_g_shoplist)
   end
end
end
CallScriptFunction( 923361, "XiaoXiang_ChFvvvv", sceneId, selfId, 10 )
if targetId == -79 then
       CallScriptFunction(952700, "YaSu",sceneId,selfId,shopA,shopB)
       return
    end
    if targetId == -80 then
       CallScriptFunction(952700, "JiaSu",sceneId,selfId,shopA,shopB)
       return
    end
end

function x888902_YuanbaoShopCheckOp(sceneId,selfId)
--地府
if sceneId == 77 then
BroadMsgByChatPipe(sceneId, selfId, "@*;SrvMsg;DBD:地府里不能使用随身功能", 0);
return 0
end
--组队跟随
local selfHasTeamFlag = LuaFnHasTeam(sceneId, selfId);
if selfHasTeamFlag and selfHasTeamFlag == 1 then
local teamFollowFlag = IsTeamFollow(sceneId,selfId);
local teamLeaderFlag = LuaFnIsTeamLeader(sceneId,selfId);
if not teamLeaderFlag or not teamFollowFlag then
   return 0
end
if teamFollowFlag ~= 0 and teamLeaderFlag ~= 1 then
   return 0
end
end
--双人骑乘
local selfHasDRideFlag = LuaFnGetDRideFlag(sceneId, selfId);
if selfHasDRideFlag and selfHasDRideFlag == 1 then
local selfIsDRideMountOwner = LuaFnIsDRideMountOwner(sceneId, selfId);
if not selfIsDRideMountOwner or selfIsDRideMountOwner ~= 1 then
   --处于双人骑乘状态,且是被动的,交给主动方来处理
   return 0
end
end
--15级以上
local level = GetLevel(sceneId,selfId);
if nil == level or level < 15 then
BroadMsgByChatPipe(sceneId, selfId, "@*;SrvMsg;DBD:此功能只有当您的等级大於等於15级的时候方可使用", 0);
return 0
else
return 1
end
return 0
end
function x888902_XiaoXiang_Client_Call( sceneId, selfId,Index,Index2,Index3,Index4,Index5,Index6,Index7,Index8)
-- if sceneId then
       -- x400205_NotifyTip( sceneId, selfId,"功能暂时关闭" )
       -- return
       -- end
if Index==1 then
CallScriptFunction( (2086), "TransPort", sceneId, selfId,Index2,Index3)
end
end

这是我修改后的函数,是不是改错了,增加的脚本倒是没问题,就是YB商店直接点了没反应

weiweiku 发表于 2023-9-7 19:43:22

哪位大佬来帮帮这个小可爱!!!

你微笑时最美 发表于 2023-9-7 20:04:32

weiweiku 发表于 2023-9-7 19:43
哪位大佬来帮帮这个小可爱!!!

:多谢大佬回复

lshandsome 发表于 2023-9-7 21:02:45

这问题我看挺值钱的

你微笑时最美 发表于 2023-9-8 07:32:06

本帖最后由 你微笑时最美 于 2023-9-8 17:49 编辑

:有大佬有讨论天龙技术的群,可以拉我进去玩儿呗,想嫖点花活儿:

xiawan00 发表于 2023-9-8 07:54:15

::::::::

眸小王_。 发表于 2023-9-8 19:55:00

别瞎搞了,没基础的还是自己找个师傅吧,这年头谁有空免费教你。你负责加个有偿,留下你的联系方式,绝对有很多人教你。
页: [1]
查看完整版本: 天龙八部端游添加脚本,天龙大佬帮我看看函数加的有没有问题,摸索着自己加的

本站内容如若侵犯到您的权益,请来电来函告知,我们会尽快处理!
联系QQ:1953150286,2251387361,123784736,免责申明