Loading...

 

SUBSCRIBE TO BLOG

RESULT

 

Content

 

Heroes - offers



Now and then you can get a hero offer. Here is a description how hero offers works. Hero offers is something that is being debated and is likely to see some changes.

On turn 1 all players get a hero offer for 500 gold.

Here is the calculation hero offer calculation after turn 1. I will let the code speak for itself.

MoreHeroesThan5 = (numberofheroes - 4);
if(MoreHeroesThan5 < 1) {MoreHeroesThan5 = 1;}
newherochance = currentgold - (NumberOfHeroes * NumberOfHeroes * 100 * MoreHeroesThan5)

if((currentgold > 400) && (newherochance < 400)) {newherochance = 500;} // Always a 10% chance - assuming enough gold
if((newherochance > 1150) && (numberofheroes > 0)) {newherochance = 1150;} // Maximum 75% chance if 1+ heroes

if(rand(400,1000) < newherochance)
{
hero = rand(400, currentgold);
if(hero > 1200) {hero = 1200;} //Max cost for the hero is 1200


$availablegold = $currentgold - $hero;
if ($availablegold > 500)
{
$minrand=0;
$maxrand=1;
}
if ($availablegold > 1000)
{
$minrand=1;
$maxrand=2;
}
if ($availablegold > 1500)
{
$minrand=1;
$maxrand=3;
}
if ($availablegold > 2000)
{
$minrand=2;
$maxrand=3;
}
if ($availablegold > 2500)
{
$minrand=2;
$maxrand=4;
}
if ($availablegold > 3500)
{
$minrand=3;
$maxrand=4;
}

$maxnumberofallies = rand($minrand,$maxrand);
availablegold = currentgold - hero;

wizard[0] = rand(200, 400);
medusa[0] = rand(250, 500);
elemental[0] = rand(250, 500);
ghost[0] = rand(250, 500);
demon[0] = rand(600, 900);
devil[0] = rand(550, 950);
archon[0] = rand(700, 1200);
dragon[0] = rand(800, 1250);

wizard[1] = 22;
medusa[1] = 20;
elemental[1] = 24;
ghost[1] = 21;
demon[1] = 25;
devil[1] = 26;
archon[1] = 27;
dragon[1] = 28;

alliearray = array(wizard, medusa, elemental, ghost, demon, devil, archon, dragon);

shuffle(alliearray); // Only one type of allie in the same offer
for (i=0;i maxnumberofallies ;i++)
{
// shuffle(alliearray);
newally = alliearray[0];

if (availablegold < newally[0])
{
continue;
}
allycontent[] = newally[1];
availablegold=availablegold-newally[0];
}

herocost = currentgold - availablegold;
}


Help & Support Follow us
Site map
About Warbarons
Credits
Terms of usage
Privacy policy
Press
Contact support
Wiki
Subscribe to blog
Be a fan on facebook
Share on Twitter

 
Your invitation is sent to your friends.

 

Friend invitation