Jump to content

Disable Skill when having 2 Items in inventory.


Recommended Posts


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.02
  • Content Count:  40
  • Reputation:   1
  • Joined:  06/24/22
  • Last Seen:  

  - Id: 55073
    AegisName: _Cocodrilo_Charm
    Name: Cocodrilo Charm
    Type: Charm
    Buy: 948
    Weight: 10
    Trade:
      NoSell: true
      NoDrop: true
    Script: |
      bonus bDef2,1;
      bonus bAllStats,5;
      bonus bAddMaxWeight,10000;
      bonus2 bAddClass,Class_All,10;
      bonus2 bMagicAddClass,Class_All,10;
      skill 257,5;
      skill 249,5;
      if ( countitem( 55073 ) >= 2){
      message strcharinfo(0),"You can only use 1x "+getitemname(55073)+"! All same charm(s) has been disabled.";
      bonus bAllStats,-5;
      bonus bAddMaxWeight,-10000;
      bonus2 bAddClass,Class_All,-10;
      bonus2 bMagicAddClass,Class_All,-10;
      }


Hello in my item script, I want to disable the skill 249,5; and skill 257,5; when a player have the same item. I tried disabling it with this skill 249,-5; also tried with skill 249,0; but nothing works.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.01
  • Content Count:  147
  • Reputation:   36
  • Joined:  05/15/20
  • Last Seen:  

2 hours ago, rizsu0107 said:

  - Id: 55073
    AegisName: _Cocodrilo_Charm
    Name: Cocodrilo Charm
    Type: Charm
    Buy: 948
    Weight: 10
    Trade:
      NoSell: true
      NoDrop: true
    Script: |
      bonus bDef2,1;
      bonus bAllStats,5;
      bonus bAddMaxWeight,10000;
      bonus2 bAddClass,Class_All,10;
      bonus2 bMagicAddClass,Class_All,10;
      skill 257,5;
      skill 249,5;
      if ( countitem( 55073 ) >= 2){
      message strcharinfo(0),"You can only use 1x "+getitemname(55073)+"! All same charm(s) has been disabled.";
      bonus bAllStats,-5;
      bonus bAddMaxWeight,-10000;
      bonus2 bAddClass,Class_All,-10;
      bonus2 bMagicAddClass,Class_All,-10;
      }


Hello in my item script, I want to disable the skill 249,5; and skill 257,5; when a player have the same item. I tried disabling it with this skill 249,-5; also tried with skill 249,0; but nothing works.

  - Id: 55073
    AegisName: _Cocodrilo_Charm
    Name: Cocodrilo Charm
    Type: Charm
    Buy: 948
    Weight: 10
    Trade:
      NoSell: true
      NoDrop: true
    Script: |
      if ( countitem( 55073 ) < 2){
      bonus bDef2,1;
      bonus bAllStats,5;
      bonus bAddMaxWeight,10000;
      bonus2 bAddClass,Class_All,10;
      bonus2 bMagicAddClass,Class_All,10;
      skill 257,5;
      skill 249,5;
      } else {
      message strcharinfo(0),"You can only use 1x "+getitemname(55073)+"! All same charm(s) has been disabled.";
      bonus bDef2,1;
      }

Try this.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.02
  • Content Count:  40
  • Reputation:   1
  • Joined:  06/24/22
  • Last Seen:  

5 hours ago, KazumaSatou said:
  - Id: 55073
    AegisName: _Cocodrilo_Charm
    Name: Cocodrilo Charm
    Type: Charm
    Buy: 948
    Weight: 10
    Trade:
      NoSell: true
      NoDrop: true
    Script: |
      if ( countitem( 55073 ) < 2){
      bonus bDef2,1;
      bonus bAllStats,5;
      bonus bAddMaxWeight,10000;
      bonus2 bAddClass,Class_All,10;
      bonus2 bMagicAddClass,Class_All,10;
      skill 257,5;
      skill 249,5;
      } else {
      message strcharinfo(0),"You can only use 1x "+getitemname(55073)+"! All same charm(s) has been disabled.";
      bonus bDef2,1;
      }

Try this.

The skill is still there.

image.png.653ccfe2fb91409ac8e239199fe2d746.png

image.png.5f55e14b419d0211c6ad4ad7df5ad6df.png

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  461
  • Reputation:   61
  • Joined:  08/28/12
  • Last Seen:  

Maybe change the flag for skill:
Flag constants:
    0 - SKILL_PERM
    1 - SKILL_TEMP
    2 - SKILL_TEMPLEVEL
    3 - SKILL_PERM_GRANT

Like skill 249,5,1;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.02
  • Content Count:  40
  • Reputation:   1
  • Joined:  06/24/22
  • Last Seen:  

On 8/5/2023 at 5:25 PM, WhiteEagle said:

Maybe change the flag for skill:
Flag constants:
    0 - SKILL_PERM
    1 - SKILL_TEMP
    2 - SKILL_TEMPLEVEL
    3 - SKILL_PERM_GRANT

Like skill 249,5,1;

omg it works. thank you so much!
image.png.53c4542bd8a5cb78ca6206e083c21103.png

 

Edited by rizsu0107
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.02
  • Content Count:  40
  • Reputation:   1
  • Joined:  06/24/22
  • Last Seen:  

On 8/5/2023 at 5:25 PM, WhiteEagle said:

Maybe change the flag for skill:
Flag constants:
    0 - SKILL_PERM
    1 - SKILL_TEMP
    2 - SKILL_TEMPLEVEL
    3 - SKILL_PERM_GRANT

Like skill 249,5,1;

hello again, how about for this script. how can I disable it if having 2 of the same item?
image.png.2c7efcd42ed0902aeed8ce9e6cca509a.png

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.02
  • Content Count:  40
  • Reputation:   1
  • Joined:  06/24/22
  • Last Seen:  

10 minutes ago, rizsu0107 said:

hello again, how about for this script. how can I disable it if having 2 of the same item?
image.png.2c7efcd42ed0902aeed8ce9e6cca509a.png

solved

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...