Jump to content
  • 0

Floating Rates


Ron

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  62
  • Reputation:   0
  • Joined:  07/13/12
  • Last Seen:  

I tried working on this on my own, but I cant seem to configure it..

Basically; A Floating Rates script that activates when there is say... 50+ players, and it deactivates when there is < 35 players.

It would also randomize the rates between 5x ~ 10x

Any ideas? Any help would be appreciated.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  63
  • Reputation:   3
  • Joined:  07/12/12
  • Last Seen:  

I have never made a script like this before, but I think I know how you can do it.

1. You have the floating script and it works right?

2. You could make an NPC that is like onhour or onclock that it checks sql on how many players are online, so like you said if it was 50+ it would use enablenpc on floating rates or disable it if its less than 35.

This is an interesting script, hope my advice helps.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

@PokemonRO: You're right about event labels, but that wouldn't quite be accurate enough. o:

@Ron:

I'm sure you've seen Lupus' script already (I hope you have, at least), so you should know that rate manipulation involves setting battleflags and reloading the mob database afterward. That part's easy.

So all that's really left is to track player count - which can be done either when a player logs in or out. Create an OnPCLoginEvent label and another for OnPCLogoutEvent, followed by:

getusers(1) // for login
getusers(1) - 1 // for logout

Do some conditionals, and you should know where to go from there.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  62
  • Reputation:   0
  • Joined:  07/13/12
  • Last Seen:  

Yes, Heres the script I currently use;

- script FloatingRates -1,{

OnPCLoginEvent:

OnPCLogoutEvent:

if (getusers(1) >= 2) {

if (getbattleflag("base_exp_rate")==7000 && getbattleflag("job_exp_rate")==7000) {

set $@brate,rand(7000,10000);

set $@jrate,rand(7000,10000);

setbattleflag "base_exp_rate", $@brate;

setbattleflag "job_exp_rate", $@jrate;

announce "Rates have changed due to player peak! Current Rates: "+($@brate/100)+"x"+($@jrate/100)+"x"+($@drate/100)+"x",bc_blue|bc_all;

}

} else if (getusers(1) < 1) {

if (getbattleflag("base_exp_rate")>70000 || getbattleflag("job_exp_rate")>70000) {

set $@brate,7000;

set $@jrate,7000;

setbattleflag "base_exp_rate", $@brate;

setbattleflag "job_exp_rate", $@jrate;

announce "Rates have returned to normal! Current Rates: "+($@brate/100)+"x"+($@jrate/100)+"x"+($@drate/100)+"x",bc_blue|bc_all;

}

}

end;

}

Basically for some reason it just does not work! Like...

When 2 players are online.. Sometimes it shows the floating rates, then other times it'll show it has ended!

When 1 player is online, it gives either or message also.

t

And when I tried to switch them around, it would give the either or same message regardless.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

You have to separate the event labels, for the reason I posted. o_o

When you calculate "getusers(1)" when a player logs out, that still includes the attached player, so you need to subtract one from that value.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  62
  • Reputation:   0
  • Joined:  07/13/12
  • Last Seen:  

I do not understand, Can you dumb it down a bit?

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