Jump to content
  • 0

Modify exp rates for specific class only


Nagad

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   0
  • Joined:  06/04/15
  • Last Seen:  

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

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   0
  • Joined:  06/04/15
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Try using onpccalcevent combined with a class check and the item bonus for exp (on phone can't write)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   0
  • Joined:  06/04/15
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   0
  • Joined:  06/04/15
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  


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;

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