Skip to content

Instantly share code, notes, and snippets.

@valarauca
Last active December 16, 2021 20:50
Show Gist options
  • Save valarauca/76f08fe84ed19eb117bf26e713d54971 to your computer and use it in GitHub Desktop.
Save valarauca/76f08fe84ed19eb117bf26e713d54971 to your computer and use it in GitHub Desktop.
herblore xp per chaos druid (fuzzy)
\\ No the language doesnt have a case statement
\\ all xp values have their decimal truncated b/c troll doesnt
\\ have robust floating point support.
function herbloreXPRoll(x) =
if 32>=x then
\\ clean + attack potion
27
else if 56>=x then
\\ clean + anti-poison
41
else if 74>=x then
\\ clean + serum 207
55
else if 88>=x then
\\ clean + combat potion
90
else if 99>=x then
\\ clean + prayer potion
95
else if 107>=x then
\\ clean + super attack
108
else if 113>=x then
\\ clean + super energy
127
else if 119>=x then
\\ clean + super strength
136
else if 123>=x then
\\ clean + super defense
162
else if 126>=x then
\\ clean + anti-fire
170
else if 128>=x then
\\ clean + ranging pot
176
else
0
compositional herbloreTrunc(0,herbloreXPRoll,+)
function dropRoll(x) =
if 46>=x then
\\ 46 out of 128 1x herb roll
1
else if 81>=x then
\\ 35 out of 128 2x herb roll
2
else
0
function HerbloreDropXP(x) = sum call herbloreTrunc(call dropRoll(x) d128)
call HerbloreDropXP(1d128)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment