FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Beacon/Relic codes translation

 
Post new topic   Reply to topic    Drop Shock Forum Index -> Open Source
View previous topic :: View next topic  
Author Message
thebest992
Advanced


Joined: 16 Jun 2007
Posts: 784
Location: Kingston, ON, Canada

PostPosted: Tue Jun 26, 2012 12:38 pm    Post subject: Beacon/Relic codes translation Reply with quote

//Send Message if PvP Training Planet
if ( ($planet_PvP_train == "Y") AND ($planet_noSha=="N") AND ($relicdata->i_turn_captured != null) ) {
//Send messages
$message = "<b>Captured Beacon</b> provides <b>".(($planetinfo_turn - $relicdata->i_turn_captured)*.75)."</b>fp!";
$sql = "INSERT INTO factions_messages (i_faction, i_owner, t_message) VALUES (?,?,?) ";
$res =& $db->query($sql, Array($relicdata->faction_owner, $relicdata->i_owner, $message) );
if (DB::isError($res)) { ReportDBError($res); }
unset($message,$sql);


Part of the code I was skimming through.


PVP traiing planet would be Eskia.

however the message sent to player says beacon and seems to give FPs but it runs of relic data.


no expert on any coding things but if anyone can help me understand it than it would be great
_________________


In Game Tag: Mr_Hyde
Back to top
View user's profile Send private message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Tue Jun 26, 2012 1:27 pm    Post subject: Reply with quote

I believe the relic code is on line 2267 and around it

if ( ($relicdata->is_beacon == "Y") AND ($myresults != "failed") ) {
//Insert Effect
$table_name = 'deployed_effects';
$fields_values = array(
'i_target' => $iactor,
'i_owner' => $userid,
'c_type' => 'stspd',
'i_planet' => $user_deployedto,
'has_duration' => 'N',
'i_order' => 0
);

$res = $db->autoExecute($table_name, $fields_values, DB_AUTOQUERY_INSERT);
if (DB::isError($res)) { ReportDBError($res, "process_map"); }

$myresults = "okrl";

//Send Message if PvP Training Planet
if ( ($planet_PvP_train == "Y") AND ($planet_noSha=="N") AND ($relicdata->i_turn_captured != null) ) {
//Send messages
$message = "<b>Captured Beacon</b> provides <b>".(($planetinfo_turn - $relicdata->i_turn_captured)*.75)."</b>fp!";
$sql = "INSERT INTO factions_messages (i_faction, i_owner, t_message) VALUES (?,?,?) ";
$res =& $db->query($sql, Array($relicdata->faction_owner, $relicdata->i_owner, $message) );
if (DB::isError($res)) { ReportDBError($res); }
unset($message,$sql);
}
}

that is the entire code or so

I think relic can stand for more than one thing

line 2093 if ($relicdata->is_supplies == "Y") {
line 2178 if ($relicdata->is_beacon == "Y") {
line 2219 if ($relicdata != NULL){ <---- esika/konu relics i think
Back to top
View user's profile Send private message
Sky
Simple


Joined: 23 Jun 2012
Posts: 20

PostPosted: Tue Jun 26, 2012 1:31 pm    Post subject: Reply with quote

tis is relic



if ($planet_relics=="Y") {

$relicdata =& $db->getAll("SELECT r.faction_owner, r.x_pos, r.y_pos, r.i_turn_captured, r.i_owner user_id
FROM deployed_relics r
WHERE r.i_planet = ? ",
array($planetid), DB_FETCHMODE_OBJECT);
if (DB::isError($relicdata)) { ReportDBError($relicdata); }

foreach ($relicdata as $relic){
if ($relic->faction_owner != null){
// if ($planet_relic_train=="Y") { $relicMult = 1.25; } else { $relicMult = 2; }
// $com_bonus = (round((.5/((($faction_levels[$relic->faction_owner]->i_size+1)/10)+1)),2)) * ($planet_maxturn - $relic->i_turn_captured);
// $com_bonus *= $relicMult;

if ($planet_relic_train=="Y") { $com_bonus = 300; } else { $com_bonus = 600; }
$com_bonus = round((((($planet_maxturn - $relic->i_turn_captured) / $planet_maxturn) * $com_bonus) / $faction_levels[$relic->faction_owner]->i_size),2);
if ($planet_relic_train=="N") {
if ( ($faction_levels[$relic->faction_owner]->i_size * $com_bonus) < 100 ) {
$com_bonus = round((100 / $faction_levels[$relic->faction_owner]->i_size),2);
}
}

$factionTD =& $db->getRow("SELECT f.i_tax, f.i_payout FROM factions f WHERE f.id=? ",
array($relic->faction_owner), DB_FETCHMODE_OBJECT);
if (DB::isError($factionTD)) { ReportDBError($factionTD); }

$factionTax = round((($factionTD->i_tax/100) * $com_bonus),2);
$com_bonus = round(($com_bonus - $factionTax),2);

//Give bonus
if ($com_bonus > 0) {
$sqltext = "UPDATE users SET d_commandpoints = (d_commandpoints + ".$com_bonus.") WHERE i_faction=? AND s_password <> 'faction' AND i_days>0 ";
$res =& $db->query($sqltext, Array($relic->faction_owner) );
if (DB::isError($res)) { ReportDBError($res); }

//Send Message
$message = "<b>Captured Relic</b> paid members (w/ TerraDays) <b>".$com_bonus."</b> Command!";
$sql = "INSERT INTO factions_messages (i_faction, i_owner, t_message) VALUES (?,?,?) ";
$res =& $db->query($sql, Array($relic->faction_owner, $relic->user_id,$message) );
if (DB::isError($res)) { ReportDBError($res); }
}

//Make payout
if ($factionTax > 0) {
$factionTax = $faction_levels[$relic->faction_owner]->i_size * $factionTax;
$factionPay = round((($factionTD->i_payout/100) * $factionTax),2);
$factionTax = round(($factionTax - $factionPay),2);

//Give tax
if ($factionTax > 0) {
$sqltext = "UPDATE users SET d_commandpoints = (d_commandpoints + ".$factionTax.") WHERE i_faction=? AND s_password = 'faction' ";
$res =& $db->query($sqltext, Array($relic->faction_owner) );
if (DB::isError($res)) { ReportDBError($res); }

//Send Message
$message = "<b>Captured Relic</b> paid faction <b>".$factionTax."</b> Command!";
$sql = "INSERT INTO factions_messages (i_faction, i_owner, t_message) VALUES (?,?,?) ";
$res =& $db->query($sql, Array($relic->faction_owner, $relic->user_id,$message) );
if (DB::isError($res)) { ReportDBError($res); }
}

//Give single payout
if ($factionPay > 0) {
$sqltext = "UPDATE users SET d_commandpoints = (d_commandpoints + ".$factionPay.") WHERE id=? ";
$res =& $db->query($sqltext, Array($relic->user_id) );
if (DB::isError($res)) { ReportDBError($res); }

//Send Message
$message = "<b>Captured Relic</b> paid capturer <b>".$factionPay."</b> Command!";
$sql = "INSERT INTO factions_messages (i_faction, i_owner, t_message) VALUES (?,?,?) ";
$res =& $db->query($sql, Array($relic->faction_owner, $relic->user_id,$message) );
if (DB::isError($res)) { ReportDBError($res); }
}
}
}
}
unset($relicdata,$relicMult,$factionTax,$factionPay);

//Remove relics
$sqltext = "DELETE FROM deployed_relics WHERE i_planet = ?";
$res =& $db->query($sqltext, Array($planetid) );
if (DB::isError($res)) { ReportDBError($res); }

}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Drop Shock Forum Index -> Open Source All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group