Jump to content
  • 0

[solved] autospell mammonite should not casted while 0 zeny


jamesandrew

Question


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.07
  • Content Count:  58
  • Reputation:   3
  • Joined:  06/21/23
  • Last Seen:  

This script is not working. I'm still getting auto spell mammo even though my zeny is 0
Is there an item script to check player zeny?
image.png.a8223d4b8e93d33f149bf410a8f8bd07.png

Edited by jamesandrew
solved
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  233
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

4 hours ago, xJohn said:

 

5609,Chung_Hairband,Chung Hairband,4,0,,500,,5,,1,0xFFFFFFFF,63,2,256,,60,0,583,{ bonus bLuk,3; bonus bMdef,4; /* bonus3 bAutoSpellWhenHit,"MC_MAMMONITE",5,5; */ if(zeny >=500) { bonus3 bAutoSpellWhenHit,"MC_MAMMONITE",5,5; } },{},{}

5573,Bogy_Horn,Dokebi Horn,4,20,,100,,1,,1,0xFFFFFFFF,63,2,256,,75,1,554,{ bonus2 bAddMonsterDropItemGroup,IG_Jewel,100; /* bonus3 bAutoSpell,"MC_MAMMONITE",5,70; */ if(zeny >=500) { bonus3 bAutoSpell,"MC_MAMMONITE",5,70; } },{},{}

This won't work as expected. The script is only run on onequip. So, the code you provide leads to the bonus3 only to be applied when the player has 500 zeny or more at the time he equips the item, but it doesn't check it on every autospell trigger.

That means if mammonite consumes the last 500 zeny the following casts will still be done, since the check doesn't happen at the time of the casting.

The solution would be either to instead of just providing a skill name, you could provide a script on each trigger like autobonus works or a parameter to tell the function it should check skill requirements before casting it.
But those are things that need a source change.

What could work but is kinda messy would be this:

autobonus2("{ if(zeny >=500) bonus3(bAutoSpellWhenHit,\"MC_MAMMONITE\",5,5); }", 1000, 1000);

I didn't test it but what it should do in theory is to check on each hit if the player has at least 500 zeny and if he does, apply the bonus for 1 second to check if it should trigger mammonite according to its chance.
But this is very speculative. It could easily be that the bonus3 doesn't work on the attack that triggered the attachment via autobonus, but instead only on the successive attacks because of the way the state flow is organized.

Edited by Winterfox
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  233
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

You should write a git issue to make the rathena team aware of that. https://github.com/rathena/rathena/issues

Edited by Winterfox
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.01
  • Content Count:  19
  • Reputation:   4
  • Joined:  04/18/23
  • Last Seen:  

 

14 hours ago, jamesandrew said:

This script is not working. I'm still getting auto spell mammo even though my zeny is 0
Is there an item script to check player zeny?
image.png.a8223d4b8e93d33f149bf410a8f8bd07.png

5609,Chung_Hairband,Chung Hairband,4,0,,500,,5,,1,0xFFFFFFFF,63,2,256,,60,0,583,{ bonus bLuk,3; bonus bMdef,4; /* bonus3 bAutoSpellWhenHit,"MC_MAMMONITE",5,5; */ if(zeny >=500) { bonus3 bAutoSpellWhenHit,"MC_MAMMONITE",5,5; } },{},{}

5573,Bogy_Horn,Dokebi Horn,4,20,,100,,1,,1,0xFFFFFFFF,63,2,256,,75,1,554,{ bonus2 bAddMonsterDropItemGroup,IG_Jewel,100; /* bonus3 bAutoSpell,"MC_MAMMONITE",5,70; */ if(zeny >=500) { bonus3 bAutoSpell,"MC_MAMMONITE",5,70; } },{},{}

Edited by xJohn
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.07
  • Content Count:  58
  • Reputation:   3
  • Joined:  06/21/23
  • Last Seen:  

Hey thanks for the input guys. I appreciate it.
@Winterfox awesome, your script is working. I've just tested it.
 

 

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
Answer this question...

×   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...