gunship 发表于 2011-6-30 11:59

求代码查错/优化,自制必杀技,为什么我的犯罪代码无效?

本帖最后由 gunship 于 2011-6-30 13:45 编辑

自己作了一个必杀技,想法是用必杀技攻击非战斗状态的非邪恶NPC被探测到时触发犯罪,犯罪代码(红色部分)不知怎么的无效,其他正常,求高人援手,感谢!
......
......
if(skill == 0)
return
else
set timer to timer + getsecondspassed
if (skill == 1)
player.pickidle
if (timer > 0.3)
   victim.playsound WPNHitHand
   player.PushActorAway victim15

   if (victim.getdead == 0)&&(victim.getactorvalue health > 0)/*另一个quest脚本中已经判断victim不为空且为actor才被传递*/
   if (victim.iscreature)
      if (victim.getactorvalue health) < power
       ModPCMiscStat 5 1
      endif
   elseif (victim.isactorevil == 0) && (victim.iscreature == 0)&&(victim.isincombat == 0)
      messagebox "CrimeExecute"
      if ((victim.getactorvalue health) < power)
       ModPCMiscStat 32 1
       ModPCMiscStat 6 1
       messageboxex "victimdead"
       if player.IsActorDetected
      messagebox "beendetectvictimdead"
      player.ModCrimeGold 1000
       endif
      else
       ModPCMiscStat 31 1
       messageboxex "victimlive"
       if player.IsActorDetected
      messagebox "beendetectvictimlive"
      player.ModCrimeGold 20
       endif
      endif
   endif
    endif

   victim.modactorvalue2 health (0-power)   
   victim.startcombat player
   set timer to 0
   set skill to 0
endif
elseif (skill == 2)
........

gunship 发表于 2011-6-30 13:03

自己顶一下,这些条件函数OBWIKI上解释的都不太详细,加个查错MessageBox再看看
页: [1]
查看完整版本: 求代码查错/优化,自制必杀技,为什么我的犯罪代码无效?