Getting Skill Type ID

● ARCHIVED · READ-ONLY
Started by alcreator440 6 posts View original ↗
  1. Can someone tell me how to get the skill type id of a current action. Similar to how I use this line for elements: if (this.item().damage.elementId === 2) {

    I'm trying to get a certain animation to not play if the user is using a certain skill type. The line below is the application:
    <Custom Confirm Effect>
    if (target.result().isHit()) {
    if (this.isPhysical()) {
    target.startAnimation(61);
    }
    }
    </Custom Confirm Effect>
  2. $dataSkills[skill_Id].stypeId
  3. In a Game_Action context:
    Code:
    this.item().stypeId
  4. caethyril said:
    In a Game_Action context:
    Code:
    this.item().stypeId
    Sorry for the late reply but could you give me a quick example on how to use that line?
  5. alcreator440 said:
    Sorry for the late reply but could you give me a quick example on how to use that line?
    Sure! Let's say you want the animation to play for all skill types except type #1 (you can check which type is which number on the Types tab in the database). Then try this:
    Code:
    <Custom Confirm Effect>
    if (target.result().isHit()) {
      if (this.isPhysical()) {
        if (this.item().stypeId !== 1) {
          target.startAnimation(61);
        }
      }
    }
    </Custom Confirm Effect>
    The new if statement says "is the skill type not equal to 1?", i.e. animation #61 should now play only with physical hits from skills not of type 1. :kaojoy:

    As an aside, you can write things more compactly here if you want by using the logical "and" operator:
    Code:
    <Custom Confirm Effect>
    if (target.result().isHit() && this.isPhysical() && this.item().stypeId !== 1) {
      target.startAnimation(61);
    }
    </Custom Confirm Effect>
    It's mostly a style thing, the two should be functionally equivalent~
  6. caethyril said:
    Sure! Let's say you want the animation to play for all skill types except type #1 (you can check which type is which number on the Types tab in the database). Then try this:
    Code:
    <Custom Confirm Effect>
    if (target.result().isHit()) {
      if (this.isPhysical()) {
        if (this.item().stypeId !== 1) {
          target.startAnimation(61);
        }
      }
    }
    </Custom Confirm Effect>
    The new if statement says "is the skill type not equal to 1?", i.e. animation #61 should now play only with physical hits from skills not of type 1. :kaojoy:

    As an aside, you can write things more compactly here if you want by using the logical "and" operator:
    Code:
    <Custom Confirm Effect>
    if (target.result().isHit() && this.isPhysical() && this.item().stypeId !== 1) {
      target.startAnimation(61);
    }
    </Custom Confirm Effect>
    It's mostly a style thing, the two should be functionally equivalent~
    Thank you! It works perfectly.