diff --git a/ag/gm/gm_seite.php b/ag/gm/gm_seite.php index 316e4d2..f56058d 100644 --- a/ag/gm/gm_seite.php +++ b/ag/gm/gm_seite.php @@ -35,6 +35,7 @@ include_once(ROOT_PATH.'/gm/include/clan.inc.php'); include_once(ROOT_PATH.'/gm/include/geheim.inc.php'); include_once(ROOT_PATH.'/gm/include/info.inc.php'); include_once(ROOT_PATH.'/gm/include/item.inc.php'); +include_once(ROOT_PATH.'/gm/include/rezept.inc.php'); include_once(ROOT_PATH.'/gm/include/monster.inc.php'); include_once(ROOT_PATH.'/gm/include/npc.inc.php'); include_once(ROOT_PATH.'/gm/include/shop.inc.php'); @@ -124,6 +125,7 @@ function displayOptions(){ "attackentypen" => "Attackentypen bearbeiten", "poll" => "Umfragen bearbeiten", "items" => "Items bearbeiten", + "rezept" => "Rezepte bearbeiten", "clan" => "Clan bearbeiten", "geheim" => "Geheim bearbeiten", "usergroups" => "Nutzergruppen bearbeiten", @@ -180,6 +182,8 @@ if(checkLoginData($_SESSION['user'],$_SESSION['password'])){ displayBannOptions($_REQUEST['action'], $_REQUEST['username'],$_REQUEST['opfer'],$_REQUEST['gamebann'],$_REQUEST['shoutbann'],$_REQUEST['forenbann'],$_REQUEST['anonid']); } else if($_REQUEST['choose'] == 'items'){ displayItems($_REQUEST['action'], $_REQUEST['task'], $_REQUEST['itemid'], $_REQUEST['itemtable'], $_REQUEST['searchstring'],$_REQUEST['s_itemtable'],$_REQUEST['page'], $_REQUEST['data']); + } else if($_REQUEST['choose'] == 'rezept') { + displayRezepte($_REQUEST); } else if($_REQUEST['choose'] == 'faq'){ displayFaq($_REQUEST['action'], $_REQUEST['faqentry'],$_REQUEST['parent'],$_REQUEST['header'],$_REQUEST['body'], $_REQUEST['child']); } else if($_REQUEST['choose'] == 'qnpc'){ diff --git a/ag/gm/include/item.inc.php b/ag/gm/include/item.inc.php index 21f06f1..7e4f8bd 100644 --- a/ag/gm/include/item.inc.php +++ b/ag/gm/include/item.inc.php @@ -358,4 +358,4 @@ function displayItems($action, $task, $itemid, $itemtable, $searchstring, $s_ite echo ''."\n"; } -?> \ No newline at end of file +?> diff --git a/ag/gm/include/rezept.inc.php b/ag/gm/include/rezept.inc.php new file mode 100644 index 0000000..eb7ba1a --- /dev/null +++ b/ag/gm/include/rezept.inc.php @@ -0,0 +1,314 @@ + + + + + + + + +'; + } +?> + + + + +
Rezepte
ItemZutatenAction
'.$set['item']['name'].''.join(',',$dep_item_names).'Edit | Delete
Neues Rezept erstellen
Zum Hauptmenu +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Rezept
Item + +
Zutat : +'; + echo ''; + foreach ($itemsMap as $table) { + foreach ($table as $item) { + $selected = ''; + if($dep_item['table_name'] == $item['table_name'] && $dep_item['id'] == $item['id']) { + $selected = 'selected="selected"'; + } + + echo ''; + } + } + ?> + + +
Zum Rezeptemenu +
Zum Hauptmenu +
+
+User Postfach
'; $status_009 .= 'Meine Items
'; + $status_009 .= 'Crafting
'; $status_009 .= 'Markt
'; $status_009 .= 'Auktions Markt
'; // $status_009 .= 'Shakkys Abzockbar
'; diff --git a/ag/markt.php b/ag/markt.php index 7af8a98..ea24e2e 100644 --- a/ag/markt.php +++ b/ag/markt.php @@ -48,7 +48,7 @@ $as = $_GET['as']; /////////////////////////Item Info if($info) { - $item = mysql_fetch_array(mysql_query("SELECT * FROM item WHERE id='$info' LIMIT 1")); + $item = mysql_fetch_array(mysql_query("SELECT * FROM item WHERE id='$info' and preis>0 LIMIT 1")); $head = "$item[name] Info"; $text .= "Stärke: $item[starke]
"; $text .= "Verteidigung: $item[verteidigung]
"; @@ -97,7 +97,7 @@ $u=1; while($u < count($w_item_anzahl)) { if($w_item_anzahl[$u]) { -$item = mysql_fetch_array(mysql_query("SELECT preis, anzahl, name FROM item WHERE id='$w_item_id[$u]' LIMIT 1")); +$item = mysql_fetch_array(mysql_query("SELECT preis, anzahl, name FROM item WHERE id='$w_item_id[$u]' and preis>0 LIMIT 1")); $item_preis = $item_preis + ($item['preis'] * $w_item_anzahl[$u]); if($item['anzahl'] < $w_item_anzahl[$u]) { @@ -144,7 +144,7 @@ while($u < count($w_item_anzahl)) { if($w_item_anzahl[$u]) { - $item = mysql_fetch_array(mysql_query("SELECT anzahl, name, s_type FROM item WHERE id='$w_item_id[$u]' LIMIT 1")); + $item = mysql_fetch_array(mysql_query("SELECT anzahl, name, s_type FROM item WHERE id='$w_item_id[$u]' and preis>0 LIMIT 1")); $t=0; while($t < $w_item_anzahl[$u]) { if($item['s_type'] != "Trank") { $ru_malss = 1; } @@ -185,9 +185,9 @@ exit; if(!$oder) { $oder = 'level,preis'; } if(!$ords) { $ords = "Trank"; } - $item_name = mysql_query("SELECT * FROM item WHERE $filter AND s_type='$ords' order by $oder ASC LIMIT $pagenum, 10"); + $item_name = mysql_query("SELECT * FROM item WHERE preis>0 and $filter AND s_type='$ords' order by $oder ASC LIMIT $pagenum, 10"); $user = mysql_Fetch_array(mysql_query("SELECT id, geld, item_res FROM user WHERE id='$user_ida[id]' LIMIT 1")); - $user_item = mysql_query("SELECT name, id FROM item "); + $user_item = mysql_query("SELECT name, id FROM item WHERE preis>0"); $GELD = $user['geld']; @@ -242,7 +242,7 @@ exit; } - $Total = mysql_num_rows(mysql_query("SELECT id FROM item WHERE $filter AND s_type='$ords'")); + $Total = mysql_num_rows(mysql_query("SELECT id FROM item WHERE preis>0 and $filter AND s_type='$ords'")); $pages = ceil($Total/10); $z = 1; diff --git a/ag/sets.php b/ag/sets.php new file mode 100644 index 0000000..5263439 --- /dev/null +++ b/ag/sets.php @@ -0,0 +1,176 @@ + + + + + + +'.$dep_item['name'].''; + $enable = false; + } + } +?> + + + + + + +
Rezepte fürs Crafting
ItemZutatenAktion
+ 'ware', 'sp_item' => 'sp_ware', 'wochen_markt' => 'wochen_ware'); + foreach ( $sets as $set ) { + if ($set['id'] == $set_id ) { + $enable = true; + foreach( $set['deps'] as $dep_item ) { + if ( $user_items[$dep_item['table_name']][$dep_item['id']] === NULL ) { + displayErrorMessage("Item konnte nicht erzeugt werden", "Nicht alle Zutaten vorhanden!", displayHistoryBackLink()); + return; + } + } + foreach( $set['deps'] as $dep_item ) { + $rowname = 'item'; + if ( $ware_table[$dep_item['table_name']] == 'ware' ) { $rowname = 'item_id'; }; + db_query('DELETE FROM '.$ware_table[$dep_item['table_name']].' WHERE user = '.$user_ida['id'].' and '.$rowname.' = '.$dep_item['id'].' LIMIT 1'); + if (mysql_affected_rows() == 0) { + // it failed!! (BUG, currently no roll back for the already deleted items) + displayErrorMessage("Item konnte nicht erzeugt werden", "Nicht alle Zutaten vorhanden! (Error-Code:2)", displayHistoryBackLink()); + return; + } + + } + if ( $ware_table[$set['item']['table_name']] == 'ware' ) { + $ru = $set['item']['s_type']=='Trank'?' ':'1'; + db_query('INSERT ware(user,item_id,ru_mal) values('.$user_ida['id'].', '.$set['item']['id'].', \''.$ru.'\')'); + } else { + db_query('INSERT '.$ware_table[$set['item']['table_name']].'(user, item) values('.$user_ida['id'].', '.$set['item']['id'].')'); + } + if ( mysql_affected_rows() > 0 ) { + echo $set['item']['name'].' wurde erfolgreich erzeugt!'; + } else { + echo $set['item']['name'].' konnte nicht erzeugt werden!'; + } + displaySets($user_ida); + } + } + +} + + +if($charm !== NULL && $set !== NULL){ + worker($charm, $set,$user_ida); +} else{ + displaySets($user_ida); +} +