搜索
查看: 429|回复: 4

[求助] 技能回调报错,请各位大佬看看

[复制链接]
发表于 2022-3-31 10:48:19 | 显示全部楼层 |阅读模式
function on_MagAttackTarge(TagActor, Actor, MagicID)
        local actorname = Actor:getCharName()       
        local TagActorName = TagActor:getCharName()
        local zxu =  Actor:getRace()
         if zxu == 0 then
            local AExt0 = TagActor:getVal_U(6) --取物品变量0的值(存储宝石物品IDX)
        local AExt1 = TagActor:getVal_U(7) --取物品变量0的值(存储宝石物品IDX)
        local AExt2 = TagActor:getVal_U(8) --取物品变量0的值(存储宝石物品IDX)
                local BAExt0 = Actor:getVal_U(6) --取物品变量0的值(存储宝石物品IDX)
        local BAExt1 = Actor:getVal_U(7) --取物品变量0的值(存储宝石物品IDX)
        local BAExt2 = Actor:getVal_U(8) --取物品变量0的值(存储宝石物品IDX)
               
               
                local ndata = TagActor:getJob()               
                local Andata = Actor:getJob()       
          if ndata == 1 then       
          if (MagicID == 91 or MagicID == 11) then
            if (AExt0 == 1046  or AExt1 == 1046 or AExt2 == 1046)then
             if math.random(1,100) < 10 then
           Actor:setActorStatus(2,1)
                TagActor:sendMsg(2,"冰冻buff生效,对手冰冻1秒", -1, -1)               
                      end
               end
          end
     end


这段报错:            local AExt0 = TagActor:getVal_U(6) --取物品变量0的值(存储宝石物品IDX)

原因为何?

发表于 2022-3-31 12:57:07 | 显示全部楼层
你只检测了比攻击者为主号对象,没有检测攻击者为主号对象吧,如果攻击者我英雄,则取英雄攻击者的U变量,这个肯定报错。
 楼主| 发表于 2022-3-31 16:51:25 | 显示全部楼层
参谋长 发表于 2022-3-31 12:57
你只检测了比攻击者为主号对象,没有检测攻击者为主号对象吧,如果攻击者我英雄,则取英雄攻击者的U变量, ...

我写迷糊了
没注意那个对象
应该是要检测攻击我的是什么··没想到检测到自己了
 楼主| 发表于 2022-3-31 16:57:48 | 显示全部楼层
参谋长 发表于 2022-3-31 12:57
你只检测了比攻击者为主号对象,没有检测攻击者为主号对象吧,如果攻击者我英雄,则取英雄攻击者的U变量, ...

还是报错
我检测了攻击者为主号
然后读取我的变量
结果报错!
 楼主| 发表于 2022-3-31 17:00:48 | 显示全部楼层
参谋长 发表于 2022-3-31 12:57
你只检测了比攻击者为主号对象,没有检测攻击者为主号对象吧,如果攻击者我英雄,则取英雄攻击者的U变量, ...

原来宝宝也会调用技能攻击回调!!!!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|HGEM2论坛

GMT+8, 2024-9-22 12:50 , Processed in 0.467634 second(s), 13 queries .

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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