Jump to content
  • 0

Is it possible? this script idea ***SOLVE*** Credit by Poring King


TheUse

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  07/01/24
  • Last Seen:  

I'm trying to write a script that sets the characters in the account when they reach level 99, job 50, to receive a status bonus. For example, if the character in the account has the Knight job, level 99, job 50, they will receive a 10% bonus to attack power for all characters in the account. Can anyone help me?

*** Solve in last comment ***

Edited by TheUse
Solve
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  407
  • Reputation:   55
  • Joined:  07/24/12
  • Last Seen:  

6 hours ago, TheUse said:

I'm trying to write a script that sets the characters in the account when they reach level 99, job 50, to receive a status bonus. For example, if the character in the account has the Knight job, level 99, job 50, they will receive a 10% bonus to attack power for all characters in the account. Can anyone help me?

Yes, that's possible. Please send me a private message if you're interested.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  63
  • Topics Per Day:  0.02
  • Content Count:  1016
  • Reputation:   191
  • Joined:  11/27/14
  • Last Seen:  

21 hours ago, TheUse said:

I'm trying to write a script that sets the characters in the account when they reach level 99, job 50, to receive a status bonus. For example, if the character in the account has the Knight job, level 99, job 50, they will receive a 10% bonus to attack power for all characters in the account. Can anyone help me?

Yes it is possible 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  07/01/24
  • Last Seen:  

7 minutes ago, Poring King said:

Yes it is possible 

Could you give me some advice or examples?

this my script but it not work

-    script    99_50BonusStats    -1,{
    OnPCLoginEvent:
        if( BaesLevel == 99 || BaseJob == Job_Monk ){
            99_50BonusStats = 1;    
            bonus_script "{ bonus bLuk, 100; }",512,getcharid(3);
            end;
            }
    }

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  63
  • Topics Per Day:  0.02
  • Content Count:  1016
  • Reputation:   191
  • Joined:  11/27/14
  • Last Seen:  

//===== rAthena Script ========================================
//= Bonus Attack Power for Knight/Lord Knight
//===== By: Poring King v1 ====================================
//= Date: 2024-08-17
//=============================================================
prontera,150,150,4	script	AttackPowerBonus	100,{
	// Check if the player has a Knight or Lord Knight character with Base Level 99 and Job Level 50
	set .@account_id, getcharid(3);
	set .@has_knight_lord_knight, 0;
	set .@bonus_given, 0;

	query_sql("SELECT `class` FROM `char` WHERE `account_id` = "+.@account_id+" AND `base_level` = 99 AND `job_level` = 50", .@classes);

	for (set .@i, 0; .@i < getarraysize(.@classes); set .@i, .@i + 1) {
		if (.@classes[.@i] == 4008 || .@classes[.@i] == 4019) { // Knight or Lord Knight class ID
			set .@has_knight_lord_knight, 1;
			break;
		}
	}

	if (.@has_knight_lord_knight) {
		// Check if the bonus has already been given
			// Grant 10% attack power bonus
			specialeffect2 EF_BLESSING;
			bonus bAtkRate, 10;
			set .@bonus_given, 1;
	}

	if (.@bonus_given) {
		mes "Congratulations! You've received a 10% attack power bonus for having a max-level Knight or Lord Knight.";
	} else if (.@has_knight_lord_knight) {
		mes "It looks like you've already received the bonus.";
	} else {
		mes "Sorry, you don't have a max-level Knight or Lord Knight on your account.";
	}

	close;
}

Try

  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  07/01/24
  • Last Seen:  

58 minutes ago, Poring King said:
//===== rAthena Script ========================================
//= Bonus Attack Power for Knight/Lord Knight
//===== By: Poring King v1 ====================================
//= Date: 2024-08-17
//=============================================================
prontera,150,150,4	script	AttackPowerBonus	100,{
	// Check if the player has a Knight or Lord Knight character with Base Level 99 and Job Level 50
	set .@account_id, getcharid(3);
	set .@has_knight_lord_knight, 0;
	set .@bonus_given, 0;

	query_sql("SELECT `class` FROM `char` WHERE `account_id` = "+.@account_id+" AND `base_level` = 99 AND `job_level` = 50", .@classes);

	for (set .@i, 0; .@i < getarraysize(.@classes); set .@i, .@i + 1) {
		if (.@classes[.@i] == 4008 || .@classes[.@i] == 4019) { // Knight or Lord Knight class ID
			set .@has_knight_lord_knight, 1;
			break;
		}
	}

	if (.@has_knight_lord_knight) {
		// Check if the bonus has already been given
			// Grant 10% attack power bonus
			specialeffect2 EF_BLESSING;
			bonus bAtkRate, 10;
			set .@bonus_given, 1;
	}

	if (.@bonus_given) {
		mes "Congratulations! You've received a 10% attack power bonus for having a max-level Knight or Lord Knight.";
	} else if (.@has_knight_lord_knight) {
		mes "It looks like you've already received the bonus.";
	} else {
		mes "Sorry, you don't have a max-level Knight or Lord Knight on your account.";
	}

	close;
}

Try

Thank you very much, I will try it. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  07/01/24
  • Last Seen:  

3 hours ago, Poring King said:
//===== rAthena Script ========================================
//= Bonus Attack Power for Knight/Lord Knight
//===== By: Poring King v1 ====================================
//= Date: 2024-08-17
//=============================================================
prontera,150,150,4	script	AttackPowerBonus	100,{
	// Check if the player has a Knight or Lord Knight character with Base Level 99 and Job Level 50
	set .@account_id, getcharid(3);
	set .@has_knight_lord_knight, 0;
	set .@bonus_given, 0;

	query_sql("SELECT `class` FROM `char` WHERE `account_id` = "+.@account_id+" AND `base_level` = 99 AND `job_level` = 50", .@classes);

	for (set .@i, 0; .@i < getarraysize(.@classes); set .@i, .@i + 1) {
		if (.@classes[.@i] == 4008 || .@classes[.@i] == 4019) { // Knight or Lord Knight class ID
			set .@has_knight_lord_knight, 1;
			break;
		}
	}

	if (.@has_knight_lord_knight) {
		// Check if the bonus has already been given
			// Grant 10% attack power bonus
			specialeffect2 EF_BLESSING;
			bonus bAtkRate, 10;
			set .@bonus_given, 1;
	}

	if (.@bonus_given) {
		mes "Congratulations! You've received a 10% attack power bonus for having a max-level Knight or Lord Knight.";
	} else if (.@has_knight_lord_knight) {
		mes "It looks like you've already received the bonus.";
	} else {
		mes "Sorry, you don't have a max-level Knight or Lord Knight on your account.";
	}

	close;
}

Try

if use        bonus bAtkRate, 10;    <------- not effect for my server

but i try to use      bonus_script "{ bonus bAtkRate, 10; }",512;   <--------- Bonus will be effective for my server

and It doesn't effect the bonus for every character automatically. You have to talk with npc ( all character in your ID ) to show effect bonus. But it's okay, I'm very happy with this script. Thanks Poring King for helping.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  63
  • Topics Per Day:  0.02
  • Content Count:  1016
  • Reputation:   191
  • Joined:  11/27/14
  • Last Seen:  

If you want to automatically attach to player . 

  1. Remove physical npc by removing the coordinates
  2. Use character log in syntax like OnPCLoginEvent . With in this event put all the code that you want to do when player log in 

I see this usefull in near future so i made it more advance . I will add it to my future script . Thanks for the idea
 

If your request has been solve dont forget to MARK it Solve by clicking Vote right side of profile . So other player with same problem will see this on top . If you appreciate the help you can simply click the vote lower right of the comments

Edited by Poring King
  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  07/01/24
  • Last Seen:  

2 hours ago, Poring King said:

If you want to automatically attach to player . 

  1. Remove physical npc by removing the coordinates
  2. Use character log in syntax like OnPCLoginEvent . With in this event put all the code that you want to do when player log in 

I see this usefull in near future so i made it more advance . I will add it to my future script . Thanks for the idea
 

If your request has been solve dont forget to MARK it Solve by clicking Vote right side of profile . So other player with same problem will see this on top . If you appreciate the help you can simply click the vote lower right of the comments

Thank you for your advice. I'm trying to learn something new like coding. I have very little knowledge in this field, but I'm trying to learn it. And my knowledge of the language is not very good. I use Google Translate to help me. I hope it helps you understand what I'm asking. I love this game very much. I've known it since I was 20 years old. Now I'm 42 years old and I still can't stop playing it. Now I play it with my children. I'm very happy. I'm happy to play with my children and learn coding at the same time. Finally, if I have new ideas, I'll try to write them first. If it's good or if I made a mistake, I'll tell you. Thank you for the knowledge.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  63
  • Topics Per Day:  0.02
  • Content Count:  1016
  • Reputation:   191
  • Joined:  11/27/14
  • Last Seen:  

15 hours ago, TheUse said:

Thank you for your advice. I'm trying to learn something new like coding. I have very little knowledge in this field, but I'm trying to learn it. And my knowledge of the language is not very good. I use Google Translate to help me. I hope it helps you understand what I'm asking. I love this game very much. I've known it since I was 20 years old. Now I'm 42 years old and I still can't stop playing it. Now I play it with my children. I'm very happy. I'm happy to play with my children and learn coding at the same time. Finally, if I have new ideas, I'll try to write them first. If it's good or if I made a mistake, I'll tell you. Thank you for the knowledge.

I advise you to go to your server files go to doc folder and read each one of the file try to focus on reading how to use syntax and the rAthena script language which is you can find on script_commands . Its very user friendly

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