• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Npc fix for dboor

Joined
Oct 20, 2013
Messages
1
Reaction score
0
Can someone give me the fix for the NPC for dboors?

It works but if i m using it with more than 1,000,000,000,000,000 resources it gives me the value 0 back , my server is pretty fast so i need it to work.

PHP:
<?function getNextLink()    {        $text = '»';        if ($this->pageIndex + 1 == $this->pageCount)        {            return $text;        }        $link = '';        if (0 < $this->selectedTabIndex)        {            $link .= 't=' . $this->selectedTabIndex;        }        if ($link != '')        {            $link .= '&';        }        $link .= 'p=' . ($this->pageIndex + 1);        $link = 'build.php?id=' . $this->buildingIndex . '&' . $link;        return '<a href="' . $link . '">' . $text . '</a>';    }    function getPreviousLink()    {        $text = '«';        if ($this->pageIndex == 0)        {            return $text;        }        $link = '';        if (0 < $this->selectedTabIndex)        {            $link .= 't=' . $this->selectedTabIndex;        }        if (1 < $this->pageIndex)        {            if ($link != '')            {                $link .= '&';            }            $link .= 'p=' . ($this->pageIndex - 1);        }        $link = 'build.php?id=' . $this->buildingIndex . '&' . $link;        return '<a href="' . $link . '">' . $text . '</a>';    }    function getResourceGoldExchange ($neededResources, $itemId, $buildingIndex, $multiple = FALSE)    {        if ( ( ($this->data['gold_num'] < $this->gameMetadata['plusTable'][6]['cost']) || ($this->isResourcesAvailable ($neededResources) && !$multiple)))        {            return '';        }        $s1               = 0;        $s2               = 0;        $exchangeResource = '';        foreach ($neededResources as $k => $v)        {            $s1 += $v;            $s2 += $this->resources[$k]['current_value'];            if ($exchangeResource != '')            {                $exchangeResource .= '&';            }            $exchangeResource .= 'r' . $k . '=' . $v;        }        $canExchange = $s1 <= $s2;        if ( ($multiple && $canExchange))        {            $num              = floor ($s2 / $s1);            $exchangeResource = '';            foreach ($neededResources as $k => $v)            {                if ($exchangeResource != '')                {                    $exchangeResource .= '&';                }                $exchangeResource .= 'r' . $k . '=' . $v * $num;            }        }        return '<a href="build.php?bid=17&t=3&rid=' . $buildingIndex . '&' . $exchangeResource . '">[NPC]</a>';    }}$p = new GPage();$p->run();?>
 
Back
Top