Jump to content
  • 0

Modify exp rates for specific class only


Question

Posted

Actually I'm using this script:

-    script    FloatingRates    -1,{
OnSat0000:
OnMon0000:
OnInit:
    if ( gettime(4) == 6 || gettime(4) == 0 ) {
        setbattleflag "base_exp_rate", 4000;
        setbattleflag "job_exp_rate", 4000;
    }
    else if ( gettime(4) == 1 && gettime(3) == 0 && gettime(2) == 0 ) {
        setbattleflag "base_exp_rate", 2000;
        setbattleflag "job_exp_rate", 2000;
    }
    end;
}

I want to modify it in such a way that specific classes (like assassin, ninja, etc..) have:

 

exp (base/job) 8000 instead of 4000 if ( gettime(4) == 6 || gettime(4) == 0 )

 

exp (base/job) 4000 instead of 2000 if ( gettime(4) == 1 && gettime(3) == 0 && gettime(2) == 0 )

 

Any suggestion? smile.png

6 answers to this question

Recommended Posts

Posted

Hi Stolao! What onpccalcevent does? I can not find any documentation about it :(

 

doc/script_commands.txt#L971

OnPCStatCalcEvent:

This special label triggers when a player's stats are recalculated, such as when
changing stats, equipment, or maps, as well as when logging in, leveling up, and
mounting a job mount. This can be used to grant additional item bonuses to certain
player groups, for instance.
  • Upvote 1
Posted (edited)

I did this:

-	script	FloatingClassRates	-1,{

	OnRefresh:
	if( Class != 10 || Class != 12 || Class != 16 || Class != 4046 || Class != 4047 || Class != 4048 || Class != 4049 || Class != 23 || Class != 24 || Class != 25 ) {
			sc_end( SC_CASH_PLUSEXP);
		}
		
	OnPCLoginEvent:
		if( Class == 10 || Class == 12 || Class == 16 || Class == 4046 || Class == 4047 || Class == 4048 || Class == 4049 || Class == 23 || Class == 24 || Class == 25 ) {
			
			sc_start( SC_CASH_PLUSEXP, -1, 100 );
			
			addtimer( 60000, strnpcinfo(3) + "::OnRefresh" );
		}
}

and seems that it is working perfectly! In this way I do not have the icon in cooldown all the time neither the annoyng message "your exp is increased by" spammed in chat every minute :)

 

What do you think about it? Any suggestion?

Edited by Nagad
Posted


OnPCStatCalcEvent:

if( Class == Job_Blacksmith

|| Class == Job_Assassin

|| Class == Job_Sage

|| Class == Job_Taekwon

|| Class == Job_Star_Gladiator

|| Class == Job_Star_Gladiator2

|| Class == Job_Soul_Linker

|| Class == Job_SuperNovice

|| Class == Job_Gunslinger

|| Class == Job_Ninja

)

bonus2 bExpAddRace,RC_All,100;

end;

Posted (edited)

In this case, if for example an Assassin become high novice without logging out, will still have the bonus?

 

Is this script consuming high resources?

 

EDIT:


Definitely solved in this way:

-	script	FloatingClassRates	-1,{
	OnRefresh:
	OnPCLoginEvent:
		addtimer( 10000, strnpcinfo(3) + "::OnRefresh" );
		.@boostActive = getstatus( SC_CASH_PLUSEXP,  0 );
		.@classBonusApplies = ( Class == 10 || Class == 12 || Class == 16 || Class == 4046 || Class == 4047 || Class == 4048 || Class == 4049 || Class == 23 || Class == 24 || Class == 25 );
 
		if( .@classBonusApplies && .@boostActive  ) end;
		
		if( .@classBonusApplies )
			sc_start( SC_CASH_PLUSEXP, -1, 100 );
		else if( .@boostActive )
			sc_end( SC_CASH_PLUSEXP );
}

Thanks everyone for your help :)

Edited by Nagad

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...