Skip to content

🐛 Effect subType > 0 breaks/disables lua script #7784

@UmeboshiXI

Description

@UmeboshiXI

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my issue will be ignored.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have searched existing issues to see if the issue has already been opened, and I have checked the commit log to see if the issue has been resolved since my server was last updated.

OS / platform the server is running (if known)

I'm not sure if this is intended or a bug. Correct me if I'm wrong.

If you set an effect's subType lua side to anything other than 0, luautils OnEffectGain, OnEffectTick, OnEffectLose no longer function in the effect's script.

This greatly limits where it can be used lua side(Can't be used in effect scripts) and only functions if implemented in core functions.

base

Steps to reproduce

Example:

  1. !exec target:addStatusEffect(xi.effect.POISON, 10, 3, 60, 0)
  • 10/tick poison, 60 seconds, subType 0
  1. !reset to clear effect.
  2. !exec target:addStatusEffect(xi.effect.POISON, 10, 3, 60, 1)
  • 10/tick poison, 60 seconds, subType 1
  1. See effect no longer ticks. If you add a print in any catagory in POISON's effect script, it will not trigger.

Note: If you retreive the effect's power/tick/subtype etc from another script elsewhere such as a mob skill or weaponskill with

local exampleEffect = target:getStatusEffect(xi.effect.POISON, 1) -- subType 1

  if exampleEffect then
      print('EFFECT: subType  = ', exampleEffect :getSubType())
      print('EFFECT: power    = ', exampleEffect :getPower())
      print('EFFECT: subPower = ', exampleEffect :getSubPower())
  end

it will properly print the effect's parameters correctly with whatever power/subpower/subtype it had when applied.

Expected behavior

Should be able to use lua binding effect:getSubType() in effect lua conditionals instead of only being used in core.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions