-
Posts
205 -
Joined
-
Last visited
-
Days Won
4
Content Type
Profiles
Forums
Events
Everything posted by Mcfarlin
-
I dont think its worth much. as its really my first actual mod, i was just sharing. I will look at uploading as you suggested. Has anyone used this? If so how is it working for you?
-
And you should be done. If i missed anything or you are having issues with the mod i will be online a lot for the next few days. Inbox me here or post issues and i will help asap. And if anyone would care to edit the attack.php to include the bonuses to both players instead of only the attacker please feel free to do so and post here for everyone. Thx.
-
Now open up attack.php and find $db->free_result($qo); $mydamage = (int) (($r1['weapon'] * $youdata['strength'] / ($odata['guard'] / 1.5)) * (rand(8000, 12000) / 10000)); $hitratio = max(10, min(60 * $ir['agility'] / $odata['agility'], 95)); and replace it with $db->free_result($qo); $ustats = $db->query("SELECT `strength`, `agility`, `guard` FROM `userstats` WHERE `userid` = {$ir['userid']}"); $ugbonus = $db->query("SELECT `gangSTR`, `gangAGI`, `gangGRD` FROM `gangs` WHERE `gangID` = {$ir['gang']}"); $ugnewstat = $db->fetch_row($ugbonus); $ustat = $db->fetch_row($ustats); $unewstr = ($ustat['strength'] * $ugnewstat['gangSTR']); $unewagi = ($ustat['agility'] * $ugnewstat['gangAGI']); $unewgrd = ($ustat['guard'] * $ugnewstat['gangGRD']); $mydamage = (int) (($r1['weapon'] * ($youdata['strength'] * $ugnewstat['gangSTR']) / ($odata['guard'] / 1.5)) * (rand(8000, 12000) / 10000)); $hitratio = max(10, min(60 * ($ir['agility'] * $ugnewstat['gangAGI'])/ $odata['agility'] , 95));
-
Now open up Index.php and find echo "<hr /><h3>Stats Info:</h3>"; After it add $str = $db->query("SELECT `STR` FROM `gangs` WHERE `gangID` ={$ir['gang']}"); $agi = $db->query("SELECT `AGI` FROM `gangs` WHERE `gangID` ={$ir['gang']}"); $grd = $db->query("SELECT `GRD` FROM `gangs` WHERE `gangID` ={$ir['gang']}"); $gbonus = $db->query("SELECT `gangSTR`, `gangAGI`, `gangGRD` FROM `gangs` WHERE `gangID` = {$ir['gang']}"); $gnewstat = $db->fetch_row($gbonus); $stat = $db->fetch_row($stats); $newstr = ($stat['strength'] * $gnewstat['gangSTR']); $newagi = ($stat['agility'] * $gnewstat['gangAGI']); $newgrd = ($stat['guard'] * $gnewstat['gangGRD']); then find echo " <table> <tr> <td><b>Strength:</b> {$ir['strength']} [Ranked: {$ir['strank']}]</td> <td><b>Agility:</b> {$ir['agility']} [Ranked: {$ir['agirank']}]</td> </tr> <tr><td><b>Guard:</b> {$ir['guard']} [Ranked: {$ir['guarank']}]</td><td><b>Labour:</b> {$ir['labour']} [Ranked: {$ir['labrank']}]</td></tr> <tr><td><b>IQ: </b> {$ir['IQ']} [Ranked: {$ir['IQrank']}]</td><td><b>Total stats:</b> {$ts} [Ranked: $tsrank]</td></tr></table>"; and replace it with if($ir['gang']) { echo " <h2>Stronghold Bonuses</h2> <table cellpadding='5' cellspacing='1' border='1'> <tr> <td>Strength</td> <td>Agility</td> <td>Gaurd</td> </tr> <tr> <td>{$groupstr['STR']}%</td> <td>{$groupagi['AGI']}%</td> <td>{$groupgrd['GRD']}%</td> </tr> </table> <small>(NOTE : Bonus to stats will not change your ranking in that stat.)</small><br /> <small>(Bonuses to stats are only for attacking players, they do not come into play if you are attacked.)</small><hr>"; echo " <table> <tr> <td><b>Strength:</b> {$newstr} [Ranked: {$ir['strank']}]</td> <td><b>Agility:</b> {$newagi} [Ranked: {$ir['agirank']}]</td> </tr> <tr><td><b>Guard:</b> {$newgrd} [Ranked: {$ir['guarank']}]</td><td><b>Labour:</b> {$ir['labour']} [Ranked: {$ir['labrank']}]</td></tr> <tr><td><b>IQ: </b> {$ir['IQ']} [Ranked: {$ir['IQrank']}]</td><td><b>Total stats:</b> {$ts} [Ranked: $tsrank]</td></tr></table>"; } else if ($ir['gang'] == 0) { echo " <table> <tr> <td><b>Strength:</b> {$ir['strength']} [Ranked: {$ir['strank']}]</td> <td><b>Agility:</b> {$ir['agility']} [Ranked: {$ir['agirank']}]</td> </tr> <tr><td><b>Guard:</b> {$ir['guard']} [Ranked: {$ir['guarank']}]</td><td><b>Labour:</b> {$ir['labour']} [Ranked: {$ir['labrank']}]</td></tr> <tr><td><b>IQ: </b> {$ir['IQ']} [Ranked: {$ir['IQrank']}]</td><td><b>Total stats:</b> {$ts} [Ranked: $tsrank]</td></tr></table>"; } Index edits are completed.
-
then add upgradestrong.php <?php require_once('globals.php'); echo " <table border='1' cellspacing='1' cellpadding='5'> <tr> <td colspan=3>Upgrades</td> </tr> <tr> <td>Stat</td> <td>Bonus Amount</td> <td>Buy Upgrade</td> </tr> <tr> <td>Strength</td> <td>5%</td> <td><a href='upgradebuy.php?spend=strength'>Buy<a/></td> </tr> <tr> <td>Agility</td> <td>5%</td> <td><a href='upgradebuy.php?spend=agility'>Buy<a/></td> </tr> <tr> <td>Guard</td> <td>5%</td> <td><a href='upgradebuy.php?spend=guard'>Buy<a/></td> </tr> </table>"; ?> And buystronghold.php <?php require_once('globals.php'); $ganginfo = $db->query(" SELECT `gangID`, `gangNAME`, `gangDESC`, `gangPREF`, `gangSUFF`, `gangMONEY`, `gangCRYSTALS`, `gangRESPECT`, `gangPRESIDENT`, `gangVICEPRES`, `gangCAPACITY`, `gangCRIME`, `gangCHOURS`, `gangAMENT`, `gangSTRONGHOLD`, `gangSTR`, `gangAGI`, `gangGRD` , `STR`, `AGI`, `GRD` FROM `gangs` WHERE `gangID` = {$ir['gang']}"); $gangdata = $db->fetch_row($ganginfo); if ($_GET['spend'] == 'house') { if ($ir['gang'] == 0) { echo "You are not in a group to buy a stronghold for!"; exit($h->endpage()); } else if ($gangdata['gangPRESIDENT'] != $userid) { echo "You are not the Leader of your group, only your group leader is able to buy a stronghold."; exit($h->endpage()); } else if ($gangdata['gangCRYSTALS'] < 20000) { echo "Your group does not have the 20,000 Gold Coins needed to buy this stronghold."; exit($h->endpage()); } else if ($gangdata['gangSTRONGHOLD'] == 1) { echo "Your group already owns this stronghold, *** are you just wanting to give up your coins for nothing?"; exit($h->endpage()); } else if ($gangdata['gangSTRONGHOLD'] > 1) { echo "You dont really want to buy a lower stronghold now do you? This would be a step in the wrong direction for your group."; exit($h->endpage()); } else { $db->query( "UPDATE `gangs` SET `gangSTRONGHOLD` = 1, `gangGRD` = 1.05, `GRD` = 5, `gangCRYSTALS` = `gangCRYSTALS` - 20000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 20,000 Gold Coins to buy your group an abandoned House. <br /> This House comes with 5% Guard Boost to all Group members. "; } } if ($_GET['spend'] == 'highrise') { if ($ir['gang'] == 0) { echo "You are not in a group to buy a stronghold for!"; exit($h->endpage()); } else if ($gangdata['gangPRESIDENT'] != $userid) { echo "You are not the Leader of your group, only your group leader is able to buy a stronghold."; exit($h->endpage()); } else if ($gangdata['gangCRYSTALS'] < 20000) { echo "Your group does not have the 20,000 Gold Coins needed to buy this stronghold."; exit($h->endpage()); } else if ($gangdata['gangSTRONGHOLD'] == 2) { echo "Your group already owns this stronghold, *** are you just wanting to give up your coins for nothing?"; exit($h->endpage()); } else if ($gangdata['gangSTRONGHOLD'] > 2) { echo "You dont really want to buy a lower stronghold now do you? This would be a step in the wrong direction for your group."; exit($h->endpage()); } else { $db->query( "UPDATE `gangs` SET `gangSTRONGHOLD` = 2, `gangSTR` = 1.05, `STR` = 5, `gangCRYSTALS` = `gangCRYSTALS` - 20000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 20,000 Gold Coins to buy your group a highrise building. <br /> This House comes with 5% Strenght Boost to all Group members. "; } } if ($_GET['spend'] == 'prison') { if ($ir['gang'] == 0) { echo "You are not in a group to buy a stronghold for!"; exit($h->endpage()); } else if ($gangdata['gangPRESIDENT'] != $userid) { echo "You are not the Leader of your group, only your group leader is able to buy a stronghold."; exit($h->endpage()); } else if ($gangdata['gangCRYSTALS'] < 30000) { echo "Your group does not have the 20,000 Gold Coins needed to buy this stronghold."; exit($h->endpage()); } else if ($gangdata['gangSTRONGHOLD'] == 3) { echo "Your group already owns this stronghold, *** are you just wanting to give up your coins for nothing?"; exit($h->endpage()); } else if ($gangdata['gangSTRONGHOLD'] > 3) { echo "You dont really want to buy a lower stronghold now do you? This would be a step in the wrong direction for your group."; exit($h->endpage()); } else { $db->query( "UPDATE `gangs` SET `gangSTRONGHOLD` = 3, `gangSTR` = 1.05, `gangAGI` = 1.05, `STR` = 5, `AGI` = 5, `gangCRYSTALS` = `gangCRYSTALS` - 30000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 30,000 Gold Coins to buy your group a highrise building. <br /> This House comes with 5% Strenght and 5% Agility Boost to all Group members. "; } } if ($_GET['spend'] == 'base') { if ($ir['gang'] == 0) { echo "You are not in a group to buy a stronghold for!"; exit($h->endpage()); } else if ($gangdata['gangPRESIDENT'] != $userid) { echo "You are not the Leader of your group, only your group leader is able to buy a stronghold."; exit($h->endpage()); } else if ($gangdata['gangCRYSTALS'] < 30000) { echo "Your group does not have the 20,000 Gold Coins needed to buy this stronghold."; exit($h->endpage()); } else if ($gangdata['gangSTRONGHOLD'] == 4) { echo "Your group already owns this stronghold, *** are you just wanting to give up your coins for nothing?"; exit($h->endpage()); } else if ($gangdata['gangSTRONGHOLD'] > 4) { echo "You dont really want to buy a lower stronghold now do you? This would be a step in the wrong direction for your group."; exit($h->endpage()); } else { $db->query( "UPDATE `gangs` SET `gangSTRONGHOLD` = 4, `gangSTR` = 1.05, `gangGRD` = 1.05, `STR`= 5, `GRD`= 5, `gangCRYSTALS` = `gangCRYSTALS` - 30000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 30,000 Gold Coins to buy your group a highrise building. <br /> This House comes with 5% Strenght and 5% Guard Boost to all Group members. "; } } if ($_GET['spend'] == 'bunker') { if ($ir['gang'] == 0) { echo "You are not in a group to buy a stronghold for!"; exit($h->endpage()); } else if ($gangdata['gangPRESIDENT'] != $userid) { echo "You are not the Leader of your group, only your group leader is able to buy a stronghold."; exit($h->endpage()); } else if ($gangdata['gangCRYSTALS'] < 50000) { echo "Your group does not have the 20,000 Gold Coins needed to buy this stronghold."; exit($h->endpage()); } else if ($gangdata['gangSTRONGHOLD'] == 5) { echo "Your group already owns this stronghold, *** are you just wanting to give up your coins for nothing?"; exit($h->endpage()); } else { $db->query( "UPDATE `gangs` SET `gangSTRONGHOLD` = 5, `gangSTR` = 1.05, `gangGRD` = 1.05, `gangAGI` = 1.05, `STR`= 5, `GRD` = 5, `AGI` = 5, `gangCRYSTALS` = `gangCRYSTALS` - 50000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 30,000 Gold Coins to buy your group a highrise building. <br /> This House comes with 5% Strenght, 5% Guard and 5% Agility Boost to all Group members. "; exit($h->endpage()); } } $h->endpage();
-
upgradebuy.php <?php require_once('globals.php'); $ganginfo = $db->query("SELECT `gangID`, `gangNAME`, `gangDESC`, `gangPREF`, `gangSUFF`, `gangMONEY`, `gangCRYSTALS`, `gangRESPECT`, `gangPRESIDENT`, `gangVICEPRES`, `gangCAPACITY`, `gangCRIME`, `gangCHOURS`, `gangAMENT`, `gangSTRONGHOLD`, `gangSTR`, `gangAGI`, `gangGRD`, `STR`, `AGI`, `GRD` FROM `gangs` WHERE `gangID` = {$ir['gang']}"); $gangdata = $db->fetch_row($ganginfo); if ($_GET['spend'] == 'strength') { if ($ir['gang'] == 0) { echo "You are not in a group to buy a stronghold upgrade for for!"; exit($h->endpage()); } if ($gangdata['gangPRESIDENT'] != $userid) { echo "You are not the Leader of your group, only your group leader is able to buy a stronghold upgrade."; exit($h->endpage()); } if ($gangdata['gangCRYSTALS'] < 10000) { echo "Your group does not have the 10,000 Gold Coins needed to buy this stronghold upgrade."; exit($h->endpage()); } if ($gangdata['STR'] == 25) { echo "Your group already has the max in this stat upgrade. 25% limit."; exit($h->endpage()); } else { if ($gangdata['gangSTR'] == 1.00) { $db->query( "UPDATE `gangs` SET `gangSTR` = 1.05, `STR` = `STR` + 5, `gangCRYSTALS` = `gangCRYSTALS` - 10000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 10,000 Gold Coins to buy your group a 5% Strength bonus upgrade."; exit($h->endpage()); } else if ($gangdata['gangSTR'] == 1.05) { $db->query( "UPDATE `gangs` SET `gangSTR` = 1.10, `STR` = `STR` + 5, `gangCRYSTALS` = `gangCRYSTALS` - 10000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 10,000 Gold Coins to buy your group a 5% Strength bonus upgrade."; exit($h->endpage()); } else if ($gangdata['gangSTR'] == 1.10) { $db->query( "UPDATE `gangs` SET `gangSTR` = 1.15, `STR` = `STR` + 5, `gangCRYSTALS` = `gangCRYSTALS` - 10000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 10,000 Gold Coins to buy your group a 5% Strength bonus upgrade."; exit($h->endpage()); } else if ($gangdata['gangSTR'] == 1.15) { $db->query( "UPDATE `gangs` SET `gangSTR` = 1.20, `STR` = `STR` + 5, `gangCRYSTALS` = `gangCRYSTALS` - 10000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 10,000 Gold Coins to buy your group a 5% Strength bonus upgrade."; exit($h->endpage()); } else if ($gangdata['gangSTR'] == 1.20) { $db->query( "UPDATE `gangs` SET `gangSTR` = 1.25, `STR` = `STR` + 5, `gangCRYSTALS` = `gangCRYSTALS` - 10000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 10,000 Gold Coins to buy your group a 5% Strength bonus upgrade."; exit($h->endpage()); } } } if ($_GET['spend'] == 'agility') { if ($ir['gang'] == 0) { echo "You are not in a group to buy a stronghold upgrade for for!"; exit($h->endpage()); } if ($gangdata['gangPRESIDENT'] != $userid) { echo "You are not the Leader of your group, only your group leader is able to buy a stronghold upgrade."; exit($h->endpage()); } if ($gangdata['gangCRYSTALS'] < 10000) { echo "Your group does not have the 10,000 Gold Coins needed to buy this stronghold upgrade."; exit($h->endpage()); } if ($gangdata['AGI'] == 25) { echo "Your group already has the max in this stat upgrade. 25% limit."; exit($h->endpage()); } else { if ($gangdata['gangAGI'] == 1.00) { $db->query( "UPDATE `gangs` SET `gangAGI` = 1.05, `AGI` = `AGI` + 5, `gangCRYSTALS` = `gangCRYSTALS` - 10000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 10,000 Gold Coins to buy your group a 5% Agility bonus upgrade."; exit($h->endpage()); } else if ($gangdata['gangAGI'] == 1.05) { $db->query( "UPDATE `gangs` SET `gangAGI` = 1.10, `AGI` = `AGI` + 5, `gangCRYSTALS` = `gangCRYSTALS` - 10000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 10,000 Gold Coins to buy your group a 5% Agility bonus upgrade."; exit($h->endpage()); } else if ($gangdata['gangAGI'] == 1.10) { $db->query( "UPDATE `gangs` SET `gangAGI` = 1.15, `AGI` = `AGI` + 5, `gangCRYSTALS` = `gangCRYSTALS` - 10000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 10,000 Gold Coins to buy your group a 5% Agility bonus upgrade."; exit($h->endpage()); } else if ($gangdata['gangAGI'] == 1.15) { $db->query( "UPDATE `gangs` SET `gangAGI` = 1.20, `AGI` = `AGI` + 5, `gangCRYSTALS` = `gangCRYSTALS` - 10000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 10,000 Gold Coins to buy your group a 5% Agility bonus upgrade."; exit($h->endpage()); } else if ($gangdata['gangAGI'] == 1.20) { $db->query( "UPDATE `gangs` SET `gangAGI` = 1.25, `AGI` = `AGI` + 5, `gangCRYSTALS` = `gangCRYSTALS` - 10000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 10,000 Gold Coins to buy your group a 5% Agility bonus upgrade."; exit($h->endpage()); } } } if ($_GET['spend'] == 'guard') { if ($ir['gang'] == 0) { echo "You are not in a group to buy a stronghold upgrade for for!"; exit($h->endpage()); } if ($gangdata['gangPRESIDENT'] != $userid) { echo "You are not the Leader of your group, only your group leader is able to buy a stronghold upgrade."; exit($h->endpage()); } if ($gangdata['gangCRYSTALS'] < 10000) { echo "Your group does not have the 10,000 Gold Coins needed to buy this stronghold upgrade."; exit($h->endpage()); } if ($gangdata['GRD'] == 25) { echo "Your group already has the max in this stat upgrade. 25% limit."; exit($h->endpage()); } else { if ($gangdata['gangGRD'] == 1.00) { $db->query( "UPDATE `gangs` SET `gangGRD` = 1.05, `GRD` = `GRD` + 5, `gangCRYSTALS` = `gangCRYSTALS` - 10000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 10,000 Gold Coins to buy your group a 5% Guard bonus upgrade."; exit($h->endpage()); } else if ($gangdata['gangGRD'] == 1.05) { $db->query( "UPDATE `gangs` SET `gangGRD` = 1.10, `GRD` = `GRD` + 5, `gangCRYSTALS` = `gangCRYSTALS` - 10000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 10,000 Gold Coins to buy your group a 5% Guard bonus upgrade."; exit($h->endpage()); } else if ($gangdata['gangGRD'] == 1.10) { $db->query( "UPDATE `gangs` SET `gangGRD` = 1.15, `GRD` = `GRD` + 5, `gangCRYSTALS` = `gangCRYSTALS` - 10000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 10,000 Gold Coins to buy your group a 5% Guard bonus upgrade."; exit($h->endpage()); } else if ($gangdata['gangGRD'] == 1.15) { $db->query( "UPDATE `gangs` SET `gangGRD` = 1.20, `GRD` = `GRD` + 5, `gangCRYSTALS` = `gangCRYSTALS` - 10000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 10,000 Gold Coins to buy your group a 5% Guard bonus upgrade."; exit($h->endpage()); } else if ($gangdata['gangGRD'] == 1.20) { $db->query( "UPDATE `gangs` SET `gangGRD` = 1.25, `GRD` = `GRD` + 5, `gangCRYSTALS` = `gangCRYSTALS` - 10000 WHERE `gangID` = {$ir['gang']}"); echo "You have paid 10,000 Gold Coins to buy your group a 5% Guard bonus upgrade."; exit($h->endpage()); } } } $h->endpage(); ?> next is groupstronghold.php ( you will need five images of your strongholds. Change the names to what you would like them to be called for your game) <?php require_once('globals.php'); echo " <table border='1' cellpadding='5' cellspacing='1'> <tr colspan=4>Strongholds</tr> <tr> <td><img src='images/house.png' height='250px' width='250px'></td> <td>Abandoned House</td> <td>Take this <br />Stronghold</td> <td>+5% def</td> </tr> <tr> <td><img src='images/highrise.png' height='250px' width='250px'></td> <td>Highrise</td> <td>Take this <br />Stronghold</td> <td>+5% str</td> </tr> <tr> <td><img src='images/prison.png' height='250px' width='250px'></td> <td>Prison</td> <td>Take this <br />Stronghold</td> <td>+5% str/agi</td> </tr> <tr> <td><img src='images/base.png' height='250px' width='250px'></td> <td>Base</td> <td>Take this <br />Stronghold</td> <td>+5% def/str</td> </tr> <tr> <td><img src='images/bunker.png' height='250px' width='250px'></td> <td>Bunker</td> <td>Take this <br />Stronghold</td> <td>+5% all</td> </tr> </table> ";
-
Mod Name: Gang Strongholds (PLEASE NOTE CRYSTALS ARE LISTED AS GOLD COINS AND GANGS AS GROUPS IN THESE FILES) you may want to change those to whatever you are using in your game. Mod Status: FREE; Availability: MCCodes Version 2.0.5b Licence/terms off use: General public licence (GPL) About the mod and how it works: Gang Leaders will be able to buy a stronghold for a gang. Strongholds will cost XXX crystals to buy and come with a base stat bonus for all members. (5% STG, AGI ect.) Gang leaders can buy upgrades for the strongholds. Each upgrade will add another 5% to the selected stat bonus for all gang members. (while attacking) Bonuses will be capped at 25%. Bonuses to stats go only to an attacking player, the defending player does not use his or her bonuses while being attacked. Screen Shots: http://postimg.org/image/z7ub3cxrd/ http://s16.postimg.org/r4ewlzdat/pic2.png http://postimg.org/image/55pbexokt/ <--- stats here are without bonus applied. http://s24.postimg.org/pgpei1q05/pic4.png <--- stats in this image are with bonus applied. I currently have the costs set for each of the strongholds and the upgrades, they are easy to edit to fit your needs. First a few SQLs are needed ALTER TABLE `gangs` ADD `gangSTRONGHOLD` INT( 11 ) NOT NULL DEFAULT '0'; ALTER TABLE `gangs` ADD `gangSTR` DECIMAL( 5, 2 ) NOT NULL DEFAULT '1.00'; ALTER TABLE `gangs` ADD `gangAGI` DECIMAL( 5, 2 ) NOT NULL DEFAULT '1.00'; ALTER TABLE `gangs` ADD `gangGRD` DECIMAL( 5, 2 ) NOT NULL DEFAULT '1.00'; ALTER TABLE `gangs` ADD `STR` INT( 2 ) NOT NULL DEFAULT '0'; ALTER TABLE `gangs` ADD `AGI` INT( 2 ) NOT NULL DEFAULT '0'; ALTER TABLE `gangs` ADD `GRD` INT( 2 ) NOT NULL DEFAULT '0'; Then 4 new PHP files. and edits to Index.php and attack.php
-
I will post it as is, if anyone would like to add the bonus to the defending player please feel free. I like it as is and will use it like it is set up in the post. Others may not want it this way, feel free to post your edits to the mod for others. Thx
-
Okay all done and tested. I have it working fully with one tiny thing missing from the original posting. I have not given the bonus to the defender in the attack. Only the attacker will get the bonus from the gangs stronghold in a fight. I want this to cause more fights, gang wars ect. . . Think of it this way, if you have 25% bonus and i have 25% bonus, what then is the point of the bonus in the first place? I feel this way it will matter more and be something players will want to have for the gang they are a part of. Heck might even get you a few more donations to get the crystals needed to buy the upgrades as well. I will test more and post tomorrow in the free mod section.
-
I will PM you how i have done it in the screen shots above. I have this all running on a test server now, and all working 98% all i am missing now is tying the attacked players gang bonus into the attack. Hope to have this done and fully tested so i can post asap for all to have if they would like it. Turned out to be a lot more in depth than i had thought it was going to be to make it to this point i must say. I was never modifying the userstats table, not a smart play i think to play around with that table with active users.
-
I do not get discouraged by feedback so please keep it coming. okay as to your question though. say i have 100 in all stats. STR 100 AGI 100 GRD 100 Then my gang leader buys a stronghold for the gang. this one he got comes with a 5% bonus to Agility. This in turn makes my agility AGI 105 As the gang leader buys upgrades for the stronghold the bonus goes up according. maxing out at 25% on each. so the max i could get from this would be. STR 125 AGI 125 GRD 125 and no if you already have a 5% bonus you will not get 10% on top of that when your gang leader buys an upgrade to the stronghold. If your sharing i am interested in how you have done your version of this. Most importantly how you tied it into userstats. <-- This being the hardest part of it all IMO.
-
Mod Name: Gang Strongholds Progress:99% Completed (Testing Now, will post tomorrow in free mods section) Mod Developers/TradeMark: MCCodes Mod Status: FREE; Availability: MCCodes Version 2.0.5b Licence/terms off use: General public licence (GPL) About the mod and how it works: Gang Leaders will be able to buy a stronghold for a gang. Strongholds will cost XXX crystals to buy and come with a base stat bonus for all members. (5% STG, AGI ect.) Gang leaders can buy upgrades for the strongholds. Each upgrade will add another 5% to the selected stat bonus for all gang members. (while attacking) Bonuses will be capped at 25%. Screen Shots: http://postimg.org/image/z7ub3cxrd/ http://s16.postimg.org/r4ewlzdat/pic2.png http://postimg.org/image/55pbexokt/ <--- stats here are without bonus applied. http://s24.postimg.org/pgpei1q05/pic4.png <--- stats in this image are with bonus applied.
-
Request for Business mod for Version two
Mcfarlin replied to Mcfarlin's topic in Requests & In Production
Just posting an update. The mod has been completed and installed. Few minor tweaks to fit a little better (after thoughts really) NonStopCoding has made a very nice business mod for me as requested. If you are in need of coding work i recommend him if he is willing to do the work for you. Not to say others here are not as good, i just have not had dealings with them. Thx for the mod and good work mate. -
Okay now that i have had a chance to ponder over your suggestion on how this could and should work. I come to realize that my simple version of this is no where near what it should be for this to be a proper mod. But here is what i have it doing. Very simple in comparison to the code/suggested methods you posted. Dont laugh to hard when you see how i was doing this. lmao <?php $chance = mt_rand(1, 25); if ($chance == 3) { echo '<meta http-equiv="refresh" content="2;"> '; echo " <h2>Your Hunt has started.</h2> "; echo " <table cellpadding='0' cellspacing='0'> <tr> <td><img src='images/hunting/hunt1.png'></td> <td><img src='images/hunting/hunt2.png'></td> <td><img src='images/hunting/hunt3.png'></td> </tr> <tr> <td><img src='images/hunting/hunt4.png'></td> <td><img src='images/hunting/hunt5.png'></td> <td><img src='images/hunting/hunt6.png'></td> </tr> <tr> <td><img src='images/hunting/hunt7.png'></td> <td><img src='images/hunting/hunt8.png'></td> <td><img src='images/hunting/hunt9.png'></td> </tr> <tr> <td><img src='images/hunting/hunt10.png'></td> <td><img src='images/hunting/hunt11.png'></td> <td><img src='images/hunting/hunt12.png'></td> </tr> <tr> <td><img src='images/hunting/hunt13.png'></td> <td><img src='images/hunting/hunt14.png'></td> <td><img src='images/hunting/hunt16.png'></td> </tr> <tr> <td><img src='images/hunting/hunt15.png'></td> <td><img src='images/hunting/hunt17.png'></td> <td><img src='images/hunting/hunt18.png'></td> </tr> <tr> <td><img src='images/hunting/hunt19.png'></td> <td><img src='images/hunting/hunt20.png'></td> <td><img src='images/hunting/hunt21.png'></td> </tr> </table> "; } else { echo '<meta http-equiv="refresh" content="5;"> '; echo " <h2>Your Hunt has started.</h2> "; echo " <table cellpadding='0' cellspacing='0'> <tr> <td><img src='images/hunting/woods1.png'></td> <td><img src='images/hunting/woods2.png'></td> <td><img src='images/hunting/woods3.png'></td> </tr> <tr> <td><img src='images/hunting/woods4.png'></td> <td><img src='images/hunting/woods5.png'></td> <td><img src='images/hunting/woods6.png'></td> </tr> <tr> <td><img src='images/hunting/woods7.png'></td> <td><img src='images/hunting/woods8.png'></td> <td><img src='images/hunting/woods9.png'></td> </tr> <tr> <td><img src='images/hunting/woods10.png'></td> <td><img src='images/hunting/woods11.png'></td> <td><img src='images/hunting/woods12.png'></td> </tr> <tr> <td><img src='images/hunting/woods13.png'></td> <td><img src='images/hunting/woods14.png'></td> <td><img src='images/hunting/woods15.png'></td> </tr> <tr> <td><img src='images/hunting/woods16.png'></td> <td><img src='images/hunting/woods17.png'></td> <td><img src='images/hunting/woods18.png'></td> </tr> <tr> <td><img src='images/hunting/woods19.png'></td> <td><img src='images/hunting/woods20.png'></td> <td><img src='images/hunting/woods21.png'></td> </tr> </table>"; } ?> This is just how it is displayed. The links to shoot are not in this posted code, more a demonstration of how i was doing this. I have the woods image split as well as the woods image with the deer included into it. The split images with the deer inside of them are the images that will be links to shoot. As the deer is split into several images the ability to have a critical hit zone and non critical are done that way.
-
Well get me thinking you have. I will play around with this more when I get home this evening.
-
I can and had planned on making more animals to hunt, but as for free mods go i was only going to share the one. as i get better i would like to start making paid mods. Offering up a simple version for a free mod then having a paid mod that is more complex. 1.) simple version you can hunt a deer in the woods. 2.) Complex version you can pick from many animals to hunt from with each having a few different hunts to them. How are you going to determine where the kill shot and non-critical area's of the deer are? Well for a text game this seemed like something not possible when i first had the idea. but i have made this work. When i find or make two images i will showcase the functionality of the mod. if you only need two images, the woods and the deer in the woods, does that mean the deer will always end up in the same place? If so, could a player not just find the kill shot and keep their mouse hovered over that area? For now yes the deer shows up in the same place. I am still looking for images to make the mod more complex so this will be delt with. In the long run it would need several images with the animal in various places on the screen. Until i find someone who can make more images this will not change.
-
I am working on a hunting mod. Almost completed but in need of two images. (nothing like the fishing mod i posted) Any interest in this mod? I need help getting the two images for the mod to be proper. Here is how it works. You click on the hunting page and the page checks to see if you are able to hunt. 1.) Is the user in jail or hospital. 2.) does the user have the energy to go hunting? 3.) does the user have a Hunting rifle ( can be expanded to check for permit as well.) 4.) once those are passed the user is directed to the hunting page. As the page loads the heading states that your hunt has begun. An image of the woods loads and the user waits. At a random time after beginning the hunt a deer will appear in the woods for the user to shoot at. They have to click on the deer to hit the deer. IE if they miss it is a miss and so on, if they hit a non critical area of the deer it will run away. Only if they hit the kill spot will they get the kill. and the hunt ends when they shoot, displaying the outcome based on where they shot. so aiming will count. Now if there is interest in this as a free mod. . . . . as i said i need two images. One of the woods and a second with the deer photoshopped into the woods image.
-
Seeing as that did not work. Removing the extra comma from your stats array did not help. Idk what it is. sorry i want more help.
-
Request for Business mod for Version two
Mcfarlin replied to Mcfarlin's topic in Requests & In Production
Skype add sent -
if (isset($_POST['stat']) && $_POST['amnt']) { if (!isset($statnames[$_POST['stat']])) { die("This stat cannot be trained."); } $stat = $statnames[$_POST['stat']]; if ($_POST['amnt'] > $ir['energy']) { print("You do not have enough energy to train that much.<hr />"); } Should work for you. Just make sure when you add this to your gym file you take out the { } not needed, the code you posted does not have the closing } in it.
-
Simple fishing mod. NO additions to the Users table needed. what it will do. 1.) users must buy a permit to fish. 2.) users must make or buy a fishing pole. 3.) users must find or buy bait. i do not have it limited to xx times per day as my users have to craft the needed items and crafting it limited so for me this is how i limit them. It can be changed to for your needs to limit them. 4.) users fish and have a chance to get 21 outcomes. anything from hooking yourself to catching a fish or even falling in the water. 5.) if they hurt themselves while fishing it will send them to the hospital. 6.) if they break a pole it will take it from them, same as if they lose the bait. they will need to make or buy another one. 7.) the fish they catch are usable items in the game for food, i have them set to give energy, brave, will based on the item. (make your do what you like) What do you need to do for this mod you ask? You will have to make a few items listed below and change the item numbers in the file to your items. Items you will need to make are 1 - Fishing Permit 2 - Fishing Pole 3 - Bait 4 - Soft Shell Turtle 5 - Crappie 6 - Sunfish then add a file called fishing.php and add this code. Once you change the item numbers in the code to your created items you should be set and ready to fish. Fishing.php <-- link to this file on your explore page or wherever you would like it to show up. <?php require_once('globals.php'); if ($ir['hospital']) { echo "Hey Buddy! You cant fish in the hospital fountain. Go back to bed."; exit($h->endpage()); } else if ($ir['jail']) { echo "How exactly do you plan on fishing from jail"; exit($h->endpage()); } $hasbait = $db->query("SELECT `inv_id` FROM `inventory` WHERE `inv_userid`={$userid} AND `inv_qty`>0 AND `inv_itemid`= 356"); // Change this to your item for fishing pole $haspole = $db->query("SELECT `inv_id` FROM `inventory` WHERE `inv_userid`={$userid} AND `inv_qty`>0 AND `inv_itemid`=29"); // change this to your item for bait $haspermit = $rb->query("SELECT `inv_id` FROM `inventory` WHERE `inv_userid`={$userid} AND `inv_qty`>0 AND `inv_itemid`=290 ");// change this to your item for fishing permit if($db->num_rows($haspole) == 0) { echo " You don't have the required item to Fish here. <br /> You will need to make a <u>Fishing Pole</u> first."; exit($h->endpage()); } else if($db->num_rows($hasbait) == 0) { echo " You don't have the required item to Fish here. <br /> You will need to find some <u>Bait</u> to use for bait first."; exit($h->endpage()); } else if($db->num_rows($haspermit) == 0) { echo "You do not have a fishing permit. <br /> You will need to buy one before you can fish here." } $h1reason ='Once Bitten but not Shy at all'; // reason for getting bit by snake $h2reason ='This guy hooked Himself. lol'; // reason for hooking yourself $h3reason ='Bit by a Snake'; // reason for getting bit by snake $time = mt_rand(1, 10); $chance = mt_rand(1, 21); $expgain = mt_rand(1, 50); $expfail = mt_rand(1, 10); $poleloss = 29; $qty = 1; $baitlost = 356; $sturtle = 357; $sunfish = 358; $crappie = 359; if ($chance == 1) // lost pole { item_remove($userid, $poleloss, $qty); $db->query("UPDATE `users` SET `exp` = `exp` - $expfail WHERE `userid` = $userid"); echo "<p>Damn, calm down. It was just a Simple Fishing Pole. <br />Im sre you can make another one.<br /> <small>[lost your pole]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 2) // lost lure { item_remove($userid, $baitlost, $qty); $db->query("UPDATE `users` SET `exp` = `exp` - $expfail WHERE `userid` = $userid"); echo "<p>Easy killer no need to get mad. It was just a little worm. <br /> Im sure you can find another one. <br /><small>[lost your lure]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 3) //broke pole { item_remove($userid, $poleloss, $qty); $db->query("UPDATE `users` SET `exp` = `exp` - $expfail WHERE `userid` = $userid"); echo "<p>Oh man, why did you jerk so hard. <br /> Im sure you can make another one. <br /><small>[broke your pole]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 4) // fell in the water { $db->query("UPDATE `users` SET `exp` = `exp` - $expfail WHERE `userid` = $userid"); echo "<p>Watch your step there skippy. <br /> Now look at you, your all wet. <br /><small>[fell in the water]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 5) // hook yourself { $db->query("UPDATE `users` SET `hospital` = $time , `hospreason` = '$h2reason' WHERE `userid` = $userid"); $db->query("UPDATE `users` SET `exp` = `exp` - $expfail WHERE `userid` = $userid"); echo "<p>DAMN!! thats gotta hurt. <br /> How did you manage to hook yourself anyway. <br /><small>[hooked yourself]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 6) // catch a snapping turtle { echo "<p>Oh you got one. <br /> Yep you got one alright One snapping turtle. <br /> Better just cut him loose.</p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 7) // catch a soft shell turtle { item_add($userid, $sturtle, $qty); $db->query("UPDATE `users` SET `exp` = `exp` + $expgain WHERE `userid` = $userid"); echo "<p>Oh look a little soft shell turtle. <br /> I see some turtle soup in your future. <br /><small>[caught a tutle]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 8) // catch a soft shell turtle { item_add($userid, $sturtle, $qty); $db->query("UPDATE `users` SET `exp` = `exp` + $expgain WHERE `userid` = $userid"); echo "<p>Oh look a decent soft shell turtle. <br /> I see some turtle soup in your future. <br /><small>[caught a tutle]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 9) // catch a soft shell turtle { item_add($userid, $sturtle, $qty); $db->query("UPDATE `users` SET `exp` = `exp` + $expgain WHERE `userid` = $userid"); echo "<p>Oh look a nice soft shell turtle. <br /> I see some turtle soup in your future. <br /><small>[caught a tutle]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 10) // catch a carp { $db->query("UPDATE `users` SET `exp` = `exp` + $expgain WHERE `userid` = $userid"); echo "<p>Oh look a small Carp. <br /> To bad they taste like ****. <br /><small>[caught a small carp]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 11) // catch a carp { $db->query("UPDATE `users` SET `exp` = `exp` + $expgain WHERE `userid` = $userid"); echo "<p>Oh look a decent Carp. <br /> To bad they taste like ****. <br /><small>[caught a decent carp]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 12) // catch a carp { $db->query("UPDATE `users` SET `exp` = `exp` + $expgain WHERE `userid` = $userid"); echo "<p>Oh look a large Carp. <br /> To bad they taste like ****. <br /><small>[caught a large carp]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 13) // catch a sunfish { item_add($userid, $sunfish, $qty); $db->query("UPDATE `users` SET `exp` = `exp` + $expgain WHERE `userid` = $userid"); echo "<p>Oh look a small Sun Fish. <br /> These little guys are tasty. <br /><small>[caught a small Sun Fish]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 14) // catch a sunfish { item_add($userid, $sunfish, $qty); $db->query("UPDATE `users` SET `exp` = `exp` + $expgain WHERE `userid` = $userid"); echo "<p>Oh look a decent Sun Fish. <br /> These little guys are tasty. <br /><small>[caught a decent Sun Fish]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 15) // catch a sunfish { item_add($userid, $sunfish, $qty); $db->query("UPDATE `users` SET `exp` = `exp` + $expgain WHERE `userid` = $userid"); echo "<p>Oh look a large Sun Fish. <br /> These little guys are tasty. <br /><small>[caught a large Sun Fish]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 16) // catch a snake { $db->query("UPDATE `users` SET `exp` = `exp` - $expfail WHERE `userid` = $userid"); echo "<p>You got a bite. Reel it in to find its a damn snake. <br /> better to just let him go. <br /><small>[caught a snake]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 17) // scared by a snake { item_remove($userid, $poleloss, $qty); item_remove($userid, $baitlost, $qty); $db->query("UPDATE `users` SET `exp` = `exp` - $expfail WHERE `userid` = $userid"); echo "<p>Just as you think your getting a bite you look down to see a snake between your legs. <br /> You drop your pole and run. <br /> To bad you left your pole in your rush to get away. <br /><small>[spooked by a snake]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 18) // bit by a snake { $db->query("UPDATE `users` SET `hospital` = $time , `hospreason` = '$h3reason' WHERE `userid` = $userid"); $db->query("UPDATE `users` SET `exp` = `exp` - $expfail WHERE `userid` = $userid"); echo "<p>Just as you think your getting a bite you look down to see a snake between your legs. <br /> You try to get away but your to slow. <br /> Off to the hospital you go for the anti venom. <br /><small>[snakebit]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 19) // catch a crappie { item_add($userid, $crappie, $qty); $db->query("UPDATE `users` SET `exp` = `exp` + $expgain WHERE `userid` = $userid"); echo "<p>Oh look a small crappie. <br /> Some good eating i hear. <br /><small>[caught a small crappie]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 20) // catch a crappie { item_add($userid, $crappie, $qty); $db->query("UPDATE `users` SET `exp` = `exp` + $expgain WHERE `userid` = $userid"); echo "<p>Oh look a decent crappie. <br /> Some good eating i hear. <br /><small>[caught a decent crappie]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } else if ($chance == 21) // catch a crappie { item_add($userid, $crappie, $qty); $db->query("UPDATE `users` SET `exp` = `exp` + $expgain WHERE `userid` = $userid"); echo "<p>Oh look a large crappie. <br /> Some good eating i hear. <br /><small>[caught a large crappie]</small></p>"; echo "<a href='fishingspot1.php'>Try Again</a><br />"; echo "<a href='fishing.php'>Go Back</a>"; } ?>
-
Request for Business mod for Version two
Mcfarlin replied to Mcfarlin's topic in Requests & In Production
If you are up to the task. Worked with you before so i have confidence in your ability to do this. -
Request for Business mod for Version two
Mcfarlin replied to Mcfarlin's topic in Requests & In Production
I can be as simple a clicking on a work link. Just something so they dont get paid without it.