Jump to content
  • 1

Script for bonus accumulation system when performing an action?


Kyunhee

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  12/04/22
  • Last Seen:  

With my brother we have a local server and we wanted to implement a stack system, I give an example of the bonus description

 

When you perform "SW_BASH" you gain a stack of "bash mastery" which will increase the damage of "SW_BASH" (10%) for 10 seconds, you can get up to 3 stacks, each charge has an independent duration / at the end of 10 seconds, you lose all charges

This system would be interesting to implement "combo" we want to give the bonus to cards/items

Something like this was done, but it doesn't work as we thought, what are we doing wrong?

.@d = 0;
     autobonus3 "{ bonus2 bSkillAtk,"SM_BASH",.@d; }",1000,10000,"SM_BASH","{.@d +=10;}";

Thanks in advance

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

@Kyunhee

I've never used autobonus like this but it seems like it could work. The only problem I can see right off the bat is that .@d is a scope variable it's unlikely that bonus script and other script are within scope. Instead, I would try using a character variable. Keep in mind that at the end of the bonuseffect you would need to rest it via a timer or something. You might also have to reapply the bonus I'm unsure if that's done also on attack.

autobonus3 "{bonus2 bSkillAtk,\"SM_BASH\",@SM_BASH_BONUS; if(!@SM_BASH_TIMER){addtimer(10000,\"SM_BASH_NPC::On10Seconds\"); @SM_BASH_TIMER = 1;}}",1000,10000,"SM_BASH","{if(@SM_BASH_BONUS<30){@SM_BASH_BONUS += 10;}}";

-	script	SM_BASH_NPC	-1,{
On10Seconds:
	@SM_BASH_TIMER = 0;
	@SM_BASH_BONUS = 0;
	end;
}

I don't have access to my local test server at the moment so this is all speculation.

Edited by Skorm
Added 30% bonus cap.
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  12/04/22
  • Last Seen:  

first of all thanks.
Just now we have tried to do the tests but nevertheless it gives this error, and crash, we couldn't find the syntax error 

 

 

efc274ad-c8e1-4739-a627-3d24980608fe.jpg

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

1 hour ago, Kyunhee said:

first of all thanks.
Just now we have tried to do the tests but nevertheless it gives this error, and crash, we couldn't find the syntax error

I forgot to escape the quotations.

Edit:
Also as it might not be clear, the first line of what I posted goes within the item_db while the remaining portion of the content is a separate NPC that should be loaded as such. Also, I recommend having @SM_BASH_BONUS = 0; within the equip and unequip script calls and not the main script call as that gets triggered irregularly.

Edited by Skorm
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  12/04/22
  • Last Seen:  

We will work with it, I will update if it gives us results! 

 

We have solved it in another way, although somewhat more complicated but we will leave it here in case anyone is interested.

What has had to be done is to create a dummy passive skill that levels up every time the action is performed , then resets to 0 , it is much easier to manipulate skill levels , although you have to implement a variety to prevent them from stacking with other items that give these bonuses. but that is already balancing and it will be our problem.

In any case, thank you very much for your help as it helped us learn new things!

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