Gah...

Nov 11, 2005 23:58

// Item equipped give stats now?
$DB->query("select * from ibf_infernoequip where eowner='{$member['id']}' and eitem='{$ibforums->input['id']}'");
if($DB->get_num_rows() > 0){
// increase now
$DB->query("update ibf_members set hp=hp+'{$upgrade['en_statsup']}',hpm=hpm+'{$upgrade['en_statsup']}',mp=mp+'{$upgrade['en_statsup']}',mpm=mpm+'{$upgrade['en_statsup']}',str=str+'{$upgrade['en_statsup']}',def=def+'{$upgrade['en_statsup']}',money=money-'{$upgrade['en_cost']}' where id='{$member['id']}'");
}

// record it for later possible item transfer, unequip/equip or sell - we don't want any bugs now do we :P
$DB->query("insert into ibf_infernouprecord values('','{$member['id']}','{$ibforums->input['id']}','{$upgrade['en_statsup']}')");

$member['money']=$member['money']-$upgrade['en_cost'];

// wait you gotta pay ;)
$DB->query("update ibf_members set money='{$member['money']}' where id='{$ibforums->member['id']}'");

// Thats a wrap, redirect and naff off :P
$print->redirect_screen("Item Upgraded", "act=rpg&code=Synthesis",0);
}

function SendItem(){
global $DB, $ibforums, $std, $print;

$to=$ibforums->input['itemto'];
$item=$ibforums->input['TheItem']; // (Item is grabbed via ID)

// You chose an item right?
if($item=="None"){
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_choose_item' ) );
}

// Check Member Where Sending To (ofcourse, not ourselves :P)
$DB->query("select * from ibf_members where id='{$ibforums->member['id']}'");
$member=$DB->fetch_row();

if(strToLower($to) == strToLower($member['name'])){
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'senditemtoself' ) );
}

$DB->query("SELECT * FROM ibf_members where name='{$to}'");
if(!$gto=$DB->fetch_row()){
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'member_notfound' ) );
}

// Check members inventory
$DB->query("select * from ibf_infernostock where owner='{$gto['id']}'");
while($checkI=$DB->fetch_row()){
if($checkI['item']==$item){
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'member_hasitem' ) );
}}

// Check you havn't equipped this item
$DB->query("select * from ibf_infernoequip where eowner='{$member['id']}'");
while($checkE=$DB->fetch_row()){
if($checkE['eitem']==$item){
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'item_is_equipped' ) );
}}

// Check you have the item
$DB->query("select * from ibf_infernostock where owner='{$member['id']}' and item='{$item}'");
if($DB->get_num_rows() == 0){
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_own_item_ts' ) );
}

// Ok, send item is good to go :D

// Lets take it from your inventory (no you do not get your money back, lol :P)
$DB->query("delete from ibf_infernostock where owner='{$member['id']}' and item='{$item}'");

Been looking at this code for 2 hours now, using it as a reference to write my own code for Psychotic Fox. I really need to find someoneelse that can help me with this, im gettin a headache... At least I figured the first half out...
Previous post Next post
Up