vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Major Additions - Realm Conquest System (https://vborg.vbsupport.ru/showthread.php?t=211920)

therogueforums 07-26-2009 06:41 PM

Quote:

Originally Posted by Dutch_Boy (Post 1855876)
Read his post before you ask stupid questions ;) :P

Give him the time to bring out a kick ass update :)

Excuse me? Read his post, before you make stupid remarks. ;)

He was asking on a possible time frame on when we could expect the updates. We all know Jaxel is mega busy with other projects, but it doesn't mean he can't give us a ballpark figure of when he might be able to update this mod.

yotsume 07-27-2009 07:05 AM

The fact that the demo site shows a database error message is not good for me so Ill just tag this as a maybe for the future...

Thesdale 08-01-2009 01:35 AM

Awesome mod! We use it at http://www.weplayciv.com and it's very popular with our players.

However there is a SEVERE error in how the AR and DR are calculated. Using the supplied formulas the effect of a promotion affects every unit in the army, not a single unit. Also to note in the original formula, natural attack/defense bonus of the Civ is not calculated unless the player has a promotion (multiply by zero issue). Thus the most efficient use of converting gold to AR/DR is to purchase level 1 or 2 promotions. Forget upgrades as the bonus is massively less than spending the equivalent on promotions. Like I'm talking many thousands of AR/DR points.

So with that in mind I've created new formulas to calculate both ratings correctly, where a promotion is only applied to a single unit and upgrades affect the entire army. This has fixed all the inbalance for us. :)

The below code replaces the same functions in functions_conquest.php in your Conquest folder in the forums.

Code:

function fetch_offense($player)
{
        global $vbulletin;

        $weapons = $vbulletin->db->query_read("SELECT * FROM ".TABLE_PREFIX."conquest_stock AS conquest_stock
                LEFT JOIN ".TABLE_PREFIX."conquest_weapons AS conquest_weapons ON conquest_stock.stockID = conquest_weapons.weaponID
                WHERE conquest_stock.playerID = ".$player[playerID]." AND conquest_stock.stockType = 'weapon'
                ORDER BY conquest_weapons.wPower DESC
        ");
        $count = array();

        while ($weapon = $vbulletin->db->fetch_array($weapons))
        {
                for ($i = 0; $i < $weapon[stockCount]; $i++)
                {
                        array_push($count, ($player[oPower] * ($weapon[wPower] / 100)));
                }
        }

        $power = 1 + ((array_sum(array_slice($count, 0, $player[pTroops])) + ($player[pTroops] * $player[oPower])) * ((100 + $player[nOffense]) / 100));

        return $power;
}

function fetch_defense($player)
{
        global $vbulletin;

        $armours = $vbulletin->db->query_read("SELECT * FROM ".TABLE_PREFIX."conquest_stock AS conquest_stock
                LEFT JOIN ".TABLE_PREFIX."conquest_armours AS conquest_armours ON conquest_stock.stockID = conquest_armours.armourID
                WHERE conquest_stock.playerID = ".$player[playerID]." AND conquest_stock.stockType = 'armour'
                ORDER BY conquest_armours.aPower DESC
        ");
        $count = array();

        while ($armour = $vbulletin->db->fetch_array($armours))
        {
                for ($i = 0; $i < $armour[stockCount]; $i++)
                {
                        array_push($count, ($player[dPower] * ($armour[aPower] / 100)));
                }
        }

        $power = 1 + ((array_sum(array_slice($count, 0, $player[pTroops])) + ($player[pTroops] * $player[dPower])) * ((100 + $player[nDefense]) / 100));

        return $power;
}


Thesdale 08-01-2009 11:24 PM

Another thing we found in our previous game is that 90% of players gravitated to 3 out of 10 nations. This caused a huge inbalance in player numbers leaving most nations with a couple of players and prime targets against the bigger nations.

So I implemented the following if .... else .... then statement around the join nation button to help spread players across all nations. Basically, if the player percentage of that nation is lower than a set threshold then the join button is active, otherwise you get a message saying recruitment disabled for that nation. For us I used 20% of all players in the game as the threshold, but you can change it to whatever works for the number of nations you have. For example, with 3 nations you would probably want to set this threshold to 50%, so no nation has more than half the total players.

In style manager open conquest_enlist_bit and find the form submission for joining a nation. Replace it with this:

Code:

                        <if condition="$nation[AVGplayerID] < 20">
                                <form action="$filename?do=homebase" method="post">
                                <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
                                <input type="hidden" name="joinrequest" value="$nation[nationID]" />
                                <input type="submit" value="<phrase 1="$nation[nName]">$vbphrase[conquest_enlist_join]</phrase>" />
                                </form>
                        <else />
                                Recruitment disabled. Join other Civ.
                        </if>


xoclanes 08-02-2009 04:10 AM

usergroup permissions dont work to me, when I setup it always its resets to "no" again :S and creates another admintrator usergroup in each try... :S:S

Hornstar 08-02-2009 06:30 AM

@ Thesdale, thanks for your code. I would love to see some of those implemented in the next update as I think they are great. Thanks.

PAKIDIL 08-02-2009 07:09 AM

allowing chmd 777 to the directory dont you think its risky in term of hacking the forum ?

blogthea 08-02-2009 05:57 PM

can't wait for the new version! Keep up the good work

Hornstar 08-02-2009 09:53 PM

Search did not come up with anything, but has anyone had any issues with users having 4 billion gold after about 10 minutes of them using this?

xoclanes 08-02-2009 09:56 PM

Quote:

Originally Posted by xoclanes (Post 1859944)
usergroup permissions dont work to me, when I setup it always its resets to "no" again :S and creates another admintrator usergroup in each try... :S:S

any clue about this issue? :(


All times are GMT. The time now is 09:08 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01386 seconds
  • Memory Usage 1,751KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete