Ignore:
Timestamp:
Mar 13, 2008, 8:18:42 PM (17 years ago)
Author:
george
Message:

Aktualizace na minimanager 0.1.6g.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • minimanager/creature.php

    r304 r307  
    1111require_once("header.php");
    1212valid_login(1);
     13include_once("./scripts/get_lib.php");
    1314
    1415// return npcflag
     
    190191function do_search() {
    191192 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;
    193194
    194195 if(
     
    219220        else $custom_search = "";
    220221
    221  $where = "WHERE entry > 0 ";
     222 $where = "WHERE creature_template.entry > 0 ";
    222223 if($custom_search != "") $where .= "AND $custom_search ";
    223  if(isset($entry)) $where .= "AND entry = '$entry' ";
    224  if(isset($name)) $where .= "AND name LIKE '%$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%' ";
    225226 if(isset($level)) $where .= "AND minlevel <= $level AND maxlevel >= $level ";
    226227 if(isset($health)) $where .= "AND minhealth <= $health AND maxhealth >= $health ";
     
    235236 if(isset($spell)) $where .= "AND (spell1 = '$spell' OR spell2 = '$spell' OR spell3 = '$spell' OR spell4 = '$spell') ";
    236237
    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");
    240242 $total_found = $sql->num_rows($result);
    241243
     
    679681function edit() {
    680682 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");
    683685 if (!isset($_GET['entry'])) redirect("creature.php?error=1");
    684686
     
    687689
    688690 $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
    690694
    691695 if ($mob = $sql->fetch_assoc($result)){
     
    12181222    </div>";
    12191223
    1220 require_once("scripts/get_lib.php");
    1221 
    12221224if($mob['lootid']){
    12231225$output .= "<div id=\"pane5\">
     
    12841286        $result1 = $sql->query("SELECT quest FROM creature_questrelation WHERE id = {$mob['entry']}");
    12851287        while ($quest = $sql->fetch_row($result1)){
    1286                 $query1 = $sql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$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]'");
    12871289                $quest_templ = $sql->fetch_row($query1);
    12881290
     
    12991301        $result1 = $sql->query("SELECT quest FROM creature_involvedrelation WHERE id = {$mob['entry']}");
    13001302        while ($quest = $sql->fetch_row($result1)){
    1301                 $query1 = $sql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$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]'");
    13021304                $quest_templ = $sql->fetch_row($query1);
    13031305
     
    15481550function do_update() {
    15491551 global $mangos_db, $realm_id;
     1552 $deplang = get_lang_id();
    15501553
    15511554 if (!isset($_POST['opp_type']) || $_POST['opp_type'] === '') redirect("creature.php?error=1");
     
    18271830        $sql_query = "UPDATE creature_template SET  ";
    18281831
    1829         $result = $sql->query("SELECT * FROM creature_template WHERE entry = '$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'");
    18301833        if ($mob_templ = $sql->fetch_assoc($result)){
    18311834                if ($mob_templ['modelid_A'] != $modelid_A) $sql_query .= "modelid_A='$modelid_A',";
Note: See TracChangeset for help on using the changeset viewer.