Difference between revisions of "Item generation"

From TheReincarnation
Jump to: navigation, search
(Created page with "[ 6:06pm ] < Laanders > so item generation [ 6:06pm ] < Laanders > #guild item generation [ 6:06pm ] < Laanders > my $guild_percentage = 0.1 * sqrt($mage->getGuilds() / $mage->ge...")
 
m
Line 1: Line 1:
[
+
guild (Library) item generation
6:06pm
+
* $guild_percentage = 0.1 * sqrt($mage->getGuilds() / $mage->getLand());
] <
 
Laanders
 
>
 
so item generation
 
[
 
6:06pm
 
] <
 
Laanders
 
>
 
#guild item generation
 
[
 
6:06pm
 
] <
 
Laanders
 
>
 
my $guild_percentage = 0.1 * sqrt($mage->getGuilds() / $mage->getLand());
 
[
 
6:07pm
 
] <
 
Laanders
 
>
 
that's base chance from guilds
 
[
 
6:07pm
 
] <
 
Laanders
 
>
 
then there are bonuses separately
 
[
 
6:07pm
 
] <
 
Laanders
 
>
 
#bonus item generation
 
[
 
6:07pm
 
] <
 
Laanders
 
>
 
my $bonus_percentage = $mage->{mage_generatebonus};
 
[
 
6:09pm
 
] <
 
Laanders
 
>
 
finally it's a random roll, which if it's below the guild_percentage base chance gives one result, and it it's not but still below base + bonuses, it gives a different result
 
[
 
6:09pm
 
] <
 
Laanders
 
>
 
if ($rand < $guild_percentage) {
 
[
 
6:09pm
 
] <
 
Laanders
 
>
 
%item_hash = item::GenerateLesserItems(1,1);
 
[
 
6:09pm
 
] <
 
Laanders
 
>
 
} elsif ($rand < $guild_percentage + $bonus_percentage) {
 
[
 
6:09pm
 
] <
 
Laanders
 
>
 
%item_hash = item::GenerateLesserItems(1);
 
[
 
6:11pm
 
] <
 
Laanders
 
>
 
the different is if the roll was low enough to be under the base chance, you can get also nobooty items
 
[
 
6:12pm
 
] <
 
Laanders
 
>
 
*difference
 
[
 
6:12pm
 
] <
 
Laanders
 
>
 
if the roll just succeeded because of bonuses, you can only get normal items
 
[
 
6:13pm
 
] <
 
Laanders
 
>
 
and not MI or compass
 
  
 +
bonus item generation
 +
* $bonus_percentage = $mage->{mage_generatebonus};
  
 +
random roll
 +
* if ($rand < $guild_percentage) {
 +
* %item_hash = item::GenerateLesserItems(1,1);
 +
* } elsif ($rand < $guild_percentage + $bonus_percentage) {
 +
* %item_hash = item::GenerateLesserItems(1);
 +
* }
  
---
+
if the roll just succeeded because of bonuses, you can only get normal items and not MI or compass
 
 
Please note this was copy/pasted from an IRC conversation and as such, formatting errors may have altered the code in ways that make it difficult to read.
 

Revision as of 04:35, 18 August 2014

guild (Library) item generation

  • $guild_percentage = 0.1 * sqrt($mage->getGuilds() / $mage->getLand());

bonus item generation

  • $bonus_percentage = $mage->{mage_generatebonus};

random roll

  • if ($rand < $guild_percentage) {
  •  %item_hash = item::GenerateLesserItems(1,1);
  • } elsif ($rand < $guild_percentage + $bonus_percentage) {
  •  %item_hash = item::GenerateLesserItems(1);
  • }

if the roll just succeeded because of bonuses, you can only get normal items and not MI or compass