Item generation

From TheReincarnation
Revision as of 00:41, 9 March 2014 by Frozenwombat (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

[ 6:06pm ] < Laanders > so item generation [ 6:06pm ] < Laanders >

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

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


---

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.