Jump to content
  • 0

SC_CLAN select rate


Gaspar145

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  05/06/19
  • Last Seen:  

I'm working on a system to select the game mode, but I'm encountering some errors. The first one is that it's not working; I select the rate, and the script doesn't change the rate. However, I have no idea what I might have done wrong or forgotten. Can someone please help me?

First, I made the NPC that gives the selection:
 

-    script    RateSelect    -1,{
    OnSetRate:
    OnPCLoginEvent:
        switch(individual_rate) {
            case 1:
                .@clan_level = .low_rate_clan_level;
                .@exp_rate_bonus = .low_rate_exp_bonus;
                .@drop_rate_bonus = .low_rate_drop_bonus;
                break;
            case 2:
                .@clan_level = .mid_rate_clan_level;
                .@exp_rate_bonus = .mid_rate_exp_bonus;
                .@drop_rate_bonus = .mid_rate_drop_bonus;
                break;
            case 3:
                .@clan_level = .high_rate_clan_level;
                .@exp_rate_bonus = .high_rate_exp_bonus;
                .@drop_rate_bonus = .high_rate_drop_bonus;
                break;
            default:
                mes "Select your game mode, for more information about bonuses, visit our discord:";
                mes "BE CAREFUL: YOU CANNOT CHANGE LATER!";
                mes "[Rates EXP/Drop %]";
                mes "- Low Rates:" + .low_rate_exp_bonus + ", " + .low_rate_drop_bonus + ".";
                mes "- Mid Rates:" + .mid_rate_exp_bonus + ", " + .mid_rate_drop_bonus + ".";
                mes "- High Rates:" + .high_rate_exp_bonus + ", " + .high_rate_drop_bonus + ".";
                individual_rate = select("- Low Rate:- Mid Rate:- High Rate");
                close2;
                goto OnSetRate;
        }

        sc_start .@clan_level, INFINITE_TICK, .@exp_rate_bonus ;
    end;

    OnInit:
        .low_rate_exp_bonus = 250;
        .mid_rate_exp_bonus = 50;
        .high_rate_exp_bonus = 1; // EXP 1x in God mode

        .low_rate_drop_bonus = 250;
        .mid_rate_drop_bonus = 50;
        .high_rate_drop_bonus = 1; // Drop Rate 1x in God mode

        .low_rate_clan_level = SC_CLAN_EASY;
        .mid_rate_clan_level = SC_CLAN_NORMAL;
        .high_rate_clan_level = SC_CLAN_GOD;
}


Then I added the SC_ in status.cpp following the expboost:

case SC_CLAN_EASY:
            tick = INFINITE_TICK;
            val1 = 0; // EXP and Drop Rate 250x
            break;
        case SC_CLAN_NORMAL:
            tick = INFINITE_TICK;
            val1 = 0; // EXP and Drop Rate 50x
            break;
        case SC_CLAN_GOD:
            tick = INFINITE_TICK;
            val1 = 0; // EXP and Drop Rate 1x
            if (sd->status.base_level >= 260) {
                pc_bonus(sd, SP_ATK_RATE, 10);
                pc_bonus(sd, SP_MATK_RATE, 10);
            }
            break;



Next, I added them to script_constants:

cpp
Copy code

Quote

export_constant(SC_CLAN_EASY);
export_constant(SC_CLAN_NORMAL);
export_constant(SC_CLAN_GOD);


Then I added them to status.hpp as expboost:


 

Quote

  SC_EXPBOOST,
    SC_CLAN_EASY,
    SC_CLAN_NORMAL,
    SC_CLAN_GOD,


Then I added them, I believe, so that when using an expboost, the effect is cumulative, that is, it does not interfere with them:

 

Quote

if (sd->sc.getSCE(SC_CLAN_EASY)) {
        bonus += sd->sc.getSCE(SC_EXPBOOST)->val1;
        if (battle_config.vip_bm_increase && pc_isvip(sd)) // Increase Battle Manual EXP rate for VIP
            bonus += (sd->sc.getSCE(SC_EXPBOOST)->val1 / battle_config.vip_bm_increase);
    }

    if (sd->sc.getSCE(SC_CLAN_NORMAL)) {
        bonus += sd->sc.getSCE(SC_EXPBOOST)->val1;
        if (battle_config.vip_bm_increase && pc_isvip(sd)) // Increase Battle Manual EXP rate for VIP
            bonus += (sd->sc.getSCE(SC_EXPBOOST)->val1 / battle_config.vip_bm_increase);
    }

    if (sd->sc.getSCE(SC_CLAN_GOD)) {
        bonus += sd->sc.getSCE(SC_EXPBOOST)->val1;
        if (battle_config.vip_bm_increase && pc_isvip(sd)) // Increase Battle Manual EXP rate for VIP
            bonus += (sd->sc.getSCE(SC_EXPBOOST)->val1 / battle_config.vip_bm_increase);
    }


Then I added them to status.yml:

  - Status: claneasy
    Icon: EFST_GOLDENMACECLAN
    Flags:
      NoRemoveOnDead: true
      NoClearbuff: true
      NoDispell: true
      NoBanishingBuster: true
      NoClearance: true
    EndOnEnd:
      Clan_Info: true
  - Status: clannormal
    Icon: EFST_CROSSBOWCLAN
    Flags:
      NoRemoveOnDead: true
      NoClearbuff: true
      NoDispell: true
      NoBanishingBuster: true
      NoClearance: true
    EndOnEnd:
      Clan_Info: true
  - Status: clangod
    Icon: EFST_ARCWANDCLAN
    Flags:
      NoRemoveOnDead: true
      NoClearbuff: true
      NoDispell: true
      NoBanishingBuster: true
      NoClearance: true
    EndOnEnd:
      Clan_Info: true


However, when selecting the rates, it does not set the rates, it simply does not work, I believe I did something wrong.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  06/11/23
  • Last Seen:  

You've set val1 to 0 in `status.cpp`. Try removing them.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  05/06/19
  • Last Seen:  

Posted (edited)

I made the changes based on SC_EXPBOOST and it didn't work, it doesn't give any bonus.

First Test:

case SC_CLAN_EASY:
			tick = INFINITE_TICK;
			if (val1 < 0)
				val1 = 0;
			break;
		case SC_CLAN_NORMAL:
			tick = INFINITE_TICK;
			if (val1 < 0)
				val1 = 0;
			break;
		case SC_CLAN_GOD:
			tick = INFINITE_TICK;
			if (val1 < 0)
				val1 = 0;
			if (sd->status.base_level >= 260) {
				pc_bonus(sd, SP_ATK_RATE, 10);
				pc_bonus(sd, SP_MATK_RATE, 10);
			}
			break;



Second test:
 

case SC_CLAN_EASY:
            tick = INFINITE_TICK;
          
                val1 = 250;
            break;
 
        case SC_CLAN_NORMAL:
            tick = INFINITE_TICK;
           
                val1 = 50;
            break;
        case SC_CLAN_GOD:
            tick = INFINITE_TICK;
 
                val1 = 1;
            if (sd->status.base_level >= 260) {
                pc_bonus(sd, SP_ATK_RATE, 10);
                pc_bonus(sd, SP_MATK_RATE, 10);
            }
            break;
 

it doesn't change the earned exp, in this case, it doesn't add the bonus, and also, it doesn't give the buff icon that I set to give in status.yml
Edited by Gaspar145
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...