Changeset 307 for minimanager/creature.php
- Timestamp:
- Mar 13, 2008, 8:18:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/creature.php
r304 r307 11 11 require_once("header.php"); 12 12 valid_login(1); 13 include_once("./scripts/get_lib.php"); 13 14 14 15 // return npcflag … … 190 191 function do_search() { 191 192 global $lang_global, $lang_creature, $output, $mangos_db, $realm_id, $creature_datasite, $sql_search_limit, 192 $creature_type, $creature_npcflag ;193 $creature_type, $creature_npcflag, $language; 193 194 194 195 if( … … 219 220 else $custom_search = ""; 220 221 221 $where = "WHERE entry > 0 ";222 $where = "WHERE creature_template.entry > 0 "; 222 223 if($custom_search != "") $where .= "AND $custom_search "; 223 if(isset($entry)) $where .= "AND entry = '$entry' ";224 if(isset($name)) $where .= "AND nameLIKE '%$name%' ";224 if(isset($entry)) $where .= "AND creature_template.entry = '$entry' "; 225 if(isset($name)) $where .= "AND IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) LIKE '%$name%' "; 225 226 if(isset($level)) $where .= "AND minlevel <= $level AND maxlevel >= $level "; 226 227 if(isset($health)) $where .= "AND minhealth <= $health AND maxhealth >= $health "; … … 235 236 if(isset($spell)) $where .= "AND (spell1 = '$spell' OR spell2 = '$spell' OR spell3 = '$spell' OR spell4 = '$spell') "; 236 237 237 if($where == "WHERE entry > 0 ") redirect("creature.php?error=1"); 238 239 $result = $sql->query("SELECT entry,name,maxlevel,maxhealth,rank,npcflag FROM creature_template $where ORDER BY entry LIMIT $sql_search_limit"); 238 if($where == "WHERE creature_template.entry > 0 ") redirect("creature.php?error=1"); 239 240 $deplang = get_lang_id(); 241 $result = $sql->query("SELECT creature_template.entry, IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) as name,maxlevel,maxhealth,rank,npcflag FROM creature_template LEFT JOIN locales_creature ON creature_template.entry = locales_creature.entry $where ORDER BY creature_template.entry LIMIT $sql_search_limit"); 240 242 $total_found = $sql->num_rows($result); 241 243 … … 679 681 function edit() { 680 682 global $lang_global, $lang_creature, $output, $mangos_db, $realm_id, $creature_datasite,$item_datasite, 681 $quest_datasite, $lang_id_tab, $spell_datasite, $lang_item ;682 683 $quest_datasite, $lang_id_tab, $spell_datasite, $lang_item,$language; 684 require_once("./scripts/get_lib.php"); 683 685 if (!isset($_GET['entry'])) redirect("creature.php?error=1"); 684 686 … … 687 689 688 690 $entry = $sql->quote_smart($_GET['entry']); 689 $result = $sql->query("SELECT * FROM creature_template WHERE entry = '$entry'"); 691 $deplang = get_lang_id(); 692 $result = $sql->query("SELECT `creature_template`.`entry`,`modelid_A`,`modelid_A2`,`modelid_H`,`modelid_H2`, IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) as name,`subname`,`minlevel`,`maxlevel`,`minhealth`,`maxhealth`,`minmana`,`maxmana`,`armor`,`faction_A`,`faction_H`,`npcflag`,`speed`,`rank`,`mindmg`,`maxdmg`,`dmgschool`,`attackpower`,`baseattacktime`,`rangeattacktime`,`flags`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`class`,`race`,`minrangedmg`,`maxrangedmg`,`rangedattackpower`,`type`,`civilian`,`flag1`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`RacialLeader`,`RegenHealth`,`equipment_id`,`ScriptName` FROM creature_template LEFT JOIN locales_creature ON creature_template.entry = locales_creature.entry WHERE creature_template.entry = '$entry'"); 693 690 694 691 695 if ($mob = $sql->fetch_assoc($result)){ … … 1218 1222 </div>"; 1219 1223 1220 require_once("scripts/get_lib.php");1221 1222 1224 if($mob['lootid']){ 1223 1225 $output .= "<div id=\"pane5\"> … … 1284 1286 $result1 = $sql->query("SELECT quest FROM creature_questrelation WHERE id = {$mob['entry']}"); 1285 1287 while ($quest = $sql->fetch_row($result1)){ 1286 $query1 = $sql->query("SELECT QuestLevel, Title FROM quest_template WHEREentry ='$quest[0]'");1288 $query1 = $sql->query("SELECT QuestLevel,IFNULL(".($deplang<>0?"title_loc$deplang":"NULL").",`title`) as title FROM quest_template LEFT JOIN locales_quest ON quest_template.entry = locales_quest.entry WHERE quest_template.entry ='$quest[0]'"); 1287 1289 $quest_templ = $sql->fetch_row($query1); 1288 1290 … … 1299 1301 $result1 = $sql->query("SELECT quest FROM creature_involvedrelation WHERE id = {$mob['entry']}"); 1300 1302 while ($quest = $sql->fetch_row($result1)){ 1301 $query1 = $sql->query("SELECT QuestLevel, Title FROM quest_template WHEREentry ='$quest[0]'");1303 $query1 = $sql->query("SELECT QuestLevel,IFNULL(".($deplang<>0?"title_loc$deplang":"NULL").",`title`) as title FROM quest_template LEFT JOIN locales_quest ON quest_template.entry = locales_quest.entry WHERE quest_template.entry ='$quest[0]'"); 1302 1304 $quest_templ = $sql->fetch_row($query1); 1303 1305 … … 1548 1550 function do_update() { 1549 1551 global $mangos_db, $realm_id; 1552 $deplang = get_lang_id(); 1550 1553 1551 1554 if (!isset($_POST['opp_type']) || $_POST['opp_type'] === '') redirect("creature.php?error=1"); … … 1827 1830 $sql_query = "UPDATE creature_template SET "; 1828 1831 1829 $result = $sql->query("SELECT * FROM creature_template WHEREentry = '$entry'");1832 $result = $sql->query("SELECT `creature_template`.`entry`,`modelid_A`,`modelid_A2`,`modelid_H`,`modelid_H2`, IFNULL(".($deplang<>0?"name_loc$deplang":"NULL").",`name`) as name,`subname`,`minlevel`,`maxlevel`,`minhealth`,`maxhealth`,`minmana`,`maxmana`,`armor`,`faction_A`,`faction_H`,`npcflag`,`speed`,`rank`,`mindmg`,`maxdmg`,`dmgschool`,`attackpower`,`baseattacktime`,`rangeattacktime`,`flags`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`class`,`race`,`minrangedmg`,`maxrangedmg`,`rangedattackpower`,`type`,`civilian`,`flag1`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`RacialLeader`,`RegenHealth`,`equipment_id`,`ScriptName` FROM creature_template LEFT JOIN locales_creature ON creature_template.entry = locales_creature.entry WHERE creature_template.entry = '$entry'"); 1830 1833 if ($mob_templ = $sql->fetch_assoc($result)){ 1831 1834 if ($mob_templ['modelid_A'] != $modelid_A) $sql_query .= "modelid_A='$modelid_A',";
Note:
See TracChangeset
for help on using the changeset viewer.