For those interested in adding a trade system, here is my really sloppy attempt and how you can do it. Hopefully the author will consider adding it and that I'm not out of line for posting this 8)
Notes...
- You can send troops or gold. Simply click the user as if you were to do a raid/spy run. You should see the trade area above the raid/spy run area. You can trade with anyone thus can have traitors

- It will tax you depending on your size (smaller = no tax, bigger than 2x caps to 76% tax and will only let you send 2x their size in amount). You will see a notice like raid/spy runs show but it won't be seen in history (requires more than adding code to do that me thinks). I also made it cost 5 turns to send gold and 1 to send troops... to lazy to make that editable but its easy enough to change in the code.
- I leave it to you to figure out how to add this to your code. Not sure if I'm allowed to post my version. Files to edit are function_conquest_village.php, conquest.php and a template modification.
add these functions to function_conquest_village.php
PHP Code:
function run_sendtroops($player, $village)
{
global $vbulletin, $settings, $passcolor, $failcolor;
if ($player[pTurns] < 1)
{
return '<font color="'.$failcolor.'">You can not trade as you do not have enough turns available.</font>';
}
$troops = $vbulletin->input->clean_gpc('p', "troopamount", TYPE_UINT);
if (!is_numeric($troops) && !is_int($troops))
{
return '<font color="'.$failcolor.'">Please enter an appropriate value.</font>';
}
elseif ($player[pTroops] == 0)
{
return '<font color="'.$failcolor.'">You can not send troops because you don\'t have any!</font>';
}
elseif ($troops >= $player[pTroops])
{
return '<font color="'.$failcolor.'">You can not send all of your troops or more than what you have!</font>';
}
if ($player[pTroops] >= ($village[pTroops]*2)) $sendtax = .77;
elseif ($player[pTroops] >= ($village[pTroops]+1)) $sendtax = 1 - pow(0.75, (($player[pTroops]/$village[pTroops])*2.5));
else $sendtax = 0;
if ($player[pTroops] > ($village[pTroops]*2) && ($troops > ($village[pTroops]*2)))
{
$troops = $village[pTroops]*2;
$transferTotal = $troops - ($troops * $sendtax);
}
else $transferTotal = $troops - ($troops * $sendtax);
$transferTotal = ceil($transferTotal);
$troopsLost = ceil($troops * $sendtax);
$playerNewTroops = $player[pTroops] - $troops;
$villageNewTroops = $village[pTroops] + $transferTotal;
// for debugging purposes
//return '<font color="'.$failcolor.'">FAIL FAIL FAIL ALERT! '
//.'<br />tax: '.$sendtax
//.'<br />troops to send: '.$troops
//.'<br />after tax: '.$transferTotal
//.'<br />troops lost: '.$troopsLost
//.'<br />playerNewTotal: '.$playerNewTroops
//.'<br />villageNewTotal: '.$villageNewTroops.'</font>';
$newTurnCount = $player[pTurns] - 1;
$vbulletin->db->query_write("UPDATE IGNORE ".TABLE_PREFIX."conquest_players SET pTurns = '".$newTurnCount."' WHERE playerID = ".$player[playerID]."");
$vbulletin->db->query_write("UPDATE IGNORE ".TABLE_PREFIX."conquest_players SET pTroops = '".$playerNewTroops."' WHERE playerID = ".$player[playerID]."");
$vbulletin->db->query_write("UPDATE IGNORE ".TABLE_PREFIX."conquest_players SET pTroops = '".$villageNewTroops."' WHERE playerID = ".$village[playerID]."");
//send_notice(1, $player, $village, $lootRatio);
if($troopLost != 0)
{
$randomMessageChoice = mt_rand(1,3);
switch ($randomMessageChoice)
{
case 1: return '<font color="'.$passcolor.'">You have sent '.$troops.' troops but '.$troopsLost.' ran away.</font>';
case 2: return '<font color="'.$passcolor.'">You have sent '.$troops.' troops but '.$troopsLost.' got lost along the way.</font>';
default: return '<font color="'.$passcolor.'">You have sent '.$troops.' troops but '.$troopsLost.' troops failed to make it there.</font>';
}
}
else return '<font color="'.$passcolor.'">You have sent '.$troops.' troops.</font>';
}
function run_sendgold($player, $village)
{
global $vbulletin, $settings, $passcolor, $failcolor;
if ($player[pTurns] < 5)
{
return '<font color="'.$failcolor.'">You can not trade as you do not have enough turns available.</font>';
}
$gold = $vbulletin->input->clean_gpc('p', "goldamount", TYPE_UINT);
if (!is_numeric($gold) && !is_int($troops))
{
return '<font color="'.$failcolor.'">Please enter an appropriate value.</font>';
}
elseif ($player[pGold] == 0)
{
return '<font color="'.$failcolor.'">You can not send gold because you don\'t have any!</font>';
}
elseif ($gold > $player[pGold])
{
return '<font color="'.$failcolor.'">You can not send more gold than what you have!</font>';
}
if ($player[pTroops] >= ($village[pTroops]*2)) $sendtax = .77;
elseif ($player[pTroops] >= ($village[pTroops]+1)) $sendtax = 1 - pow(0.75, (($player[pTroops]/$village[pTroops])*2.5));
else $sendtax = 0;
if ($player[pTroops] > ($village[pTroops]*2) && ($gold > ($village[pTroops]*2)))
{
$gold = $village[pTroops]*2;
$transferTotal = $gold - ($gold * $sendtax);
}
else $transferTotal = $gold - ($gold * $sendtax);
$transferTotal = ceil($transferTotal);
$goldLost = ceil($gold * $sendtax);
$playerNewGold = $player[pGold] - $gold;
$villageNewGold = $village[pGold] + $transferTotal;
// for debugging purposes
//return '<font color="'.$failcolor.'">FAIL FAIL FAIL ALERT! '
//.'<br />tax: '.$sendtax
//.'<br />gold to send: '.$gold
//.'<br />after tax: '.$transferTotal
//.'<br />gold lost: '.$goldLost
//.'<br />playerNewTotal: '.$playerNewGold
//.'<br />villageNewTotal: '.$villageNewGold.'</font>';
$newTurnCount = $player[pTurns] - 5;
$vbulletin->db->query_write("UPDATE IGNORE ".TABLE_PREFIX."conquest_players SET pTurns = '".$newTurnCount."' WHERE playerID = ".$player[playerID]."");
$vbulletin->db->query_write("UPDATE IGNORE ".TABLE_PREFIX."conquest_players SET pGold = '".$playerNewGold."' WHERE playerID = ".$player[playerID]."");
$vbulletin->db->query_write("UPDATE IGNORE ".TABLE_PREFIX."conquest_players SET pGold = '".$villageNewGold."' WHERE playerID = ".$village[playerID]."");
//send_notice(1, $player, $village, $lootRatio);
if ($goldLost != 0)
{
$randomMessageChoice = mt_rand(1,3);
switch ($randomMessageChoice)
{
case 1: return '<font color="'.$passcolor.'">You have sent '.$gold.' gold but '.$goldLost.' was taken as draconian tax.</font>';
case 2: return '<font color="'.$passcolor.'">You have sent '.$gold.' gold but '.$goldLost.' was stolen by steelzepplin.</font>';
default: return '<font color="'.$passcolor.'">You have sent '.$gold.' gold but '.$goldLost.' was taxed and lost during the transfer.</font>';
}
}
else return '<font color="'.$passcolor.'">You have sent '.$gold.' gold.</font>';
}
add this check to conquest.php
PHP Code:
// ########################################################################
// IS USER SENDING TROOPS?
if ($village = fetch_village($vbulletin->input->clean_gpc('p', 'sendtroops', TYPE_UINT)))
{
$noticeTEXT = run_sendtroops($player, $village);
$player = fetch_player($vbulletin->userinfo[userid]);
}
// ########################################################################
// IS USER SENDING GOLD?
if ($village = fetch_village($vbulletin->input->clean_gpc('p', 'sendgold', TYPE_UINT)))
{
$noticeTEXT = run_sendgold($player, $village);
$player = fetch_player($vbulletin->userinfo[userid]);
}
modify the conquest_village template for each theme used to have this above the raid/spy run area
HTML Code:
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr><td class="tcat" align="center">Trading</td></tr>
<tr><td class="alt1" align="center">
<table cellpadding="5" cellspacing="0" border="0" width="100%" align="center">
<tr>
<td width="50%" valign="top">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="center">Send Troops</td>
</tr>
<tr>
<td class="alt1" align="center"><form action="$filename?do=village&pid=$village[playerID]" method="post">
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<input type="hidden" name="sendtroops" value="$village[playerID]" />
<input name="troopamount" type="text" size="10" />
<input type="submit" value="Send">
</form></td>
</tr>
</table>
</td>
<td width="50%" valign="top">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="center">Send Gold</td>
</tr>
<tr>
<td class="alt1" align="center"><form action="$filename?do=village&pid=$village[playerID]" method="post">
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<input type="hidden" name="sendgold" value="$village[playerID]" />
<input name="goldamount" type="text" size="10" />
<input type="submit" value="Send">
</form></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="50%" align="center"><strong>Performing a troop trade cost 1 turn</strong></strong></td>
<td width="50%" align="center"><strong>Performing a gold trade cost 5 turns</strong></strong></td>
</tr>
</table>
</td></tr>
</table>
It isn't pretty but it works which is all I cared about when doing this.
Just wanted to add thanks for the author for this mod! It is awesome and I have wasted too many hours on it