Changeset 19 for minimanager/creature.php
- Timestamp:
- Aug 13, 2007, 9:05:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/creature.php
r5 r19 51 51 global $lang_global, $lang_creature, $output, $mangos_db, $realm_id, $creature_type; 52 52 53 $ mysql = new MySQL;54 $ mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);55 56 $result = $ mysql->query("SELECT count(*) FROM creature_template");57 $tot_items = $ mysql->result($result, 0);58 $ mysql->close();53 $sql = new SQL; 54 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 55 56 $result = $sql->query("SELECT count(*) FROM creature_template"); 57 $tot_items = $sql->result($result, 0); 58 $sql->close(); 59 59 60 60 $output .= "<center> … … 195 195 } 196 196 197 $ mysql = new MySQL;198 $ mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);199 200 if ($_POST['npcflag'] != '') $npcflag = $ mysql->quote_smart($_POST['npcflag']);201 if ($_POST['type'] != '') $type = $ mysql->quote_smart($_POST['type']);202 if ($_POST['rank'] != '') $rank = $ mysql->quote_smart($_POST['rank']);203 if ($_POST['family'] != '') $family = $ mysql->quote_smart($_POST['family']);204 if ($_POST['entry'] != '') $entry = $ mysql->quote_smart($_POST['entry']);205 if ($_POST['name'] != '') $name = $ mysql->quote_smart($_POST['name']);206 if ($_POST['level'] != '') $level = $ mysql->quote_smart($_POST['level']);207 if ($_POST['health'] != '') $health = $ mysql->quote_smart($_POST['health']);208 if ($_POST['faction'] != '') $faction = $ mysql->quote_smart($_POST['faction']);209 if ($_POST['spell'] != '') $spell = $ mysql->quote_smart($_POST['spell']);210 if ($_POST['lootid'] != '') $lootid = $ mysql->quote_smart($_POST['lootid']);211 if ($_POST['ScriptName'] != '') $ScriptName = $ mysql->quote_smart($_POST['ScriptName']);212 if ($_POST['custom_search'] != '') $custom_search = $ mysql->quote_smart($_POST['custom_search']);197 $sql = new SQL; 198 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 199 200 if ($_POST['npcflag'] != '') $npcflag = $sql->quote_smart($_POST['npcflag']); 201 if ($_POST['type'] != '') $type = $sql->quote_smart($_POST['type']); 202 if ($_POST['rank'] != '') $rank = $sql->quote_smart($_POST['rank']); 203 if ($_POST['family'] != '') $family = $sql->quote_smart($_POST['family']); 204 if ($_POST['entry'] != '') $entry = $sql->quote_smart($_POST['entry']); 205 if ($_POST['name'] != '') $name = $sql->quote_smart($_POST['name']); 206 if ($_POST['level'] != '') $level = $sql->quote_smart($_POST['level']); 207 if ($_POST['health'] != '') $health = $sql->quote_smart($_POST['health']); 208 if ($_POST['faction'] != '') $faction = $sql->quote_smart($_POST['faction']); 209 if ($_POST['spell'] != '') $spell = $sql->quote_smart($_POST['spell']); 210 if ($_POST['lootid'] != '') $lootid = $sql->quote_smart($_POST['lootid']); 211 if ($_POST['ScriptName'] != '') $ScriptName = $sql->quote_smart($_POST['ScriptName']); 212 if ($_POST['custom_search'] != '') $custom_search = $sql->quote_smart($_POST['custom_search']); 213 213 else $custom_search = ""; 214 214 … … 230 230 if($where == "WHERE entry > 0 ") redirect("creature.php?error=1"); 231 231 232 $result = $ mysql->query("SELECT entry,name,maxlevel,maxhealth,rank,npcflag FROM creature_template $where ORDER BY entry LIMIT $sql_search_limit");233 $total_found = $ mysql->num_rows($result);232 $result = $sql->query("SELECT entry,name,maxlevel,maxhealth,rank,npcflag FROM creature_template $where ORDER BY entry LIMIT $sql_search_limit"); 233 $total_found = $sql->num_rows($result); 234 234 235 235 $output .= "<center> … … 243 243 $output .= "<table class=\"lined\"> 244 244 <tr> 245 <t d width=\"10%\" class=\"head\">{$lang_creature['entry']}</td>246 <t d width=\"40%\" class=\"head\">{$lang_creature['name']}</td>247 <t d width=\"10%\" class=\"head\">{$lang_creature['level']}</td>248 <t d width=\"10%\" class=\"head\">{$lang_creature['health']}</td>249 <t d width=\"10%\" class=\"head\">{$lang_creature['rank']}</td>250 <t d width=\"20%\" class=\"head\">{$lang_creature['npc_flag']}</td>245 <th width=\"10%\">{$lang_creature['entry']}</th> 246 <th width=\"40%\">{$lang_creature['name']}</th> 247 <th width=\"10%\">{$lang_creature['level']}</th> 248 <th width=\"10%\">{$lang_creature['health']}</th> 249 <th width=\"10%\">{$lang_creature['rank']}</th> 250 <th width=\"20%\">{$lang_creature['npc_flag']}</th> 251 251 </tr>"; 252 252 253 253 for ($i=1; $i<=$total_found; $i++){ 254 $creature = $ mysql->fetch_row($result);254 $creature = $sql->fetch_row($result); 255 255 256 256 $output .= "<tr> … … 265 265 $output .= "</table></center><br />"; 266 266 267 $ mysql->close();267 $sql->close(); 268 268 } 269 269 … … 597 597 598 598 <td>".makeinfocell($lang_creature['class'],$lang_creature['class_desc'])."</td> 599 <td colspan=\"2\"><select name=\"class\">599 <td><select name=\"class\"> 600 600 <option value=\"0\">0 - {$lang_creature['none']}</option> 601 601 <option value=\"1\">1 - {$lang_id_tab['warrior']}</option> … … 611 611 612 612 <td>".makeinfocell($lang_creature['race'],$lang_creature['race_desc'])."</td> 613 <td colspan=\"2\"><select name=\"race\">613 <td><select name=\"race\"> 614 614 <option value=\"0\">0 - {$lang_creature['none']}</option> 615 615 <option value=\"1\">1 - {$lang_id_tab['human']}</option> … … 623 623 <option value=\"10\">10 - {$lang_id_tab['bloodelf']}</option> 624 624 <option value=\"11\">11 - {$lang_id_tab['draenei']}</option> 625 </select></td> 625 </select></td> 626 627 <td>".makeinfocell($lang_creature['RacialLeader'],$lang_creature['RacialLeader_desc'])."</td> 628 <td><input type=\"checkbox\" name=\"RacialLeader\" value=\"1\" /></td> 626 629 </tr> 627 630 <tr> … … 681 684 if (!isset($_GET['entry'])) redirect("creature.php?error=1"); 682 685 683 $ mysql = new MySQL;684 $ mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);685 686 $entry = $ mysql->quote_smart($_GET['entry']);687 $result = $ mysql->query("SELECT * FROM creature_template WHERE entry = '$entry'");688 689 if ($mob = $ mysql->fetch_assoc($result)){686 $sql = new SQL; 687 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 688 689 $entry = $sql->quote_smart($_GET['entry']); 690 $result = $sql->query("SELECT * FROM creature_template WHERE entry = '$entry'"); 691 692 if ($mob = $sql->fetch_assoc($result)){ 690 693 691 694 $output .= "<script type=\"text/javascript\" src=\"js/tab.js\"></script> … … 935 938 unset($family); 936 939 937 $result1 = $ mysql->query("SELECT COUNT(*) FROM creature WHERE id = '{$mob['entry']}'");938 $output .= "<tr><td colspan=\"6\">{$lang_creature['creature_swapned']} : ".$ mysql->result($result1, 0)." {$lang_creature['times']}.</td></tr>940 $result1 = $sql->query("SELECT COUNT(*) FROM creature WHERE id = '{$mob['entry']}'"); 941 $output .= "<tr><td colspan=\"6\">{$lang_creature['creature_swapned']} : ".$sql->result($result1, 0)." {$lang_creature['times']}.</td></tr> 939 942 940 943 </table> … … 1095 1098 1096 1099 $output .= "<td>".makeinfocell($lang_creature['class'],$lang_creature['class_desc'])."</td> 1097 <td colspan=\"2\"><select name=\"class\">1100 <td><select name=\"class\"> 1098 1101 <option value=\"0\" {$class[0]}>0 - {$lang_creature['none']}</option> 1099 1102 <option value=\"1\" {$class[1]}>1 - {$lang_id_tab['warrior']}</option> … … 1112 1115 $race[$mob['race']] = " selected=\"selected\" "; 1113 1116 1114 $output .= "<td>".makeinfocell($lang_creature['race'],$lang_creature['race_desc'])."</td>1115 <td colspan=\"2\"><select name=\"race\">1117 $output .= "<td>".makeinfocell($lang_creature['race'],$lang_creature['race_desc'])."</td> 1118 <td><select name=\"race\"> 1116 1119 <option value=\"0\" {$race[0]}>0 - {$lang_creature['none']}</option> 1117 1120 <option value=\"1\" {$race[1]}>1 - {$lang_id_tab['human']}</option> … … 1125 1128 <option value=\"10\" {$race[10]}>10 - {$lang_id_tab['bloodelf']}</option> 1126 1129 <option value=\"11\" {$race[11]}>11 - {$lang_id_tab['draenei']}</option> 1127 </select></td> 1130 </select></td>"; 1131 1132 if ($mob['RacialLeader']) $RacialLeader = "checked"; 1133 else $RacialLeader = ""; 1134 1135 $output .= "<td>".makeinfocell($lang_creature['RacialLeader'],$lang_creature['RacialLeader_desc'])."</td> 1136 <td><input type=\"checkbox\" name=\"RacialLeader\" value=\"1\" $RacialLeader /></td> 1128 1137 </tr> 1129 1138 <tr> … … 1176 1185 $row_flag = 0; 1177 1186 $output .= "<table class=\"hidden\" align=\"center\"><tr>"; 1178 $result1 = $ mysql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM creature_loot_template WHERE entry = {$mob['lootid']} ORDER BY ChanceOrRef DESC");1179 while ($item = $ mysql->fetch_row($result1)){1187 $result1 = $sql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM creature_loot_template WHERE entry = {$mob['lootid']} ORDER BY ChanceOrRef DESC"); 1188 while ($item = $sql->fetch_row($result1)){ 1180 1189 $cel_counter++; 1181 1190 $tooltip = get_item_name($item[0])." ($item[0])<br />{$lang_creature['drop_chance']}: $item[1]%<br />{$lang_creature['quest_drop_chance']}: $item[2]%<br />{$lang_creature['drop_chance']}: $item[3]-$item[4]<br />{$lang_creature['quest_freeforall']}: $item[5]"; … … 1220 1229 <tr class=\"large_bold\"><td colspan=\"2\" class=\"hidden\" align=\"left\">{$lang_creature['start_quests']}:</td></tr>"; 1221 1230 1222 $result1 = $ mysql->query("SELECT quest FROM creature_questrelation WHERE id = {$mob['entry']}");1223 while ($quest = $ mysql->fetch_row($result1)){1224 $query1 = $ mysql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$quest[0]'");1225 $quest_templ = $ mysql->fetch_row($query1);1231 $result1 = $sql->query("SELECT quest FROM creature_questrelation WHERE id = {$mob['entry']}"); 1232 while ($quest = $sql->fetch_row($result1)){ 1233 $query1 = $sql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$quest[0]'"); 1234 $quest_templ = $sql->fetch_row($query1); 1226 1235 1227 1236 $output .= "<tr><td width=\"5%\"><input type=\"checkbox\" name=\"del_questrelation[]\" value=\"$quest[0]\" /></td> … … 1235 1244 <tr class=\"large_bold\"><td colspan=\"2\" class=\"hidden\" align=\"left\">{$lang_creature['ends_quests']}:</td></tr>"; 1236 1245 1237 $result1 = $ mysql->query("SELECT quest FROM creature_involvedrelation WHERE id = {$mob['entry']}");1238 while ($quest = $ mysql->fetch_row($result1)){1239 $query1 = $ mysql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$quest[0]'");1240 $quest_templ = $ mysql->fetch_row($query1);1246 $result1 = $sql->query("SELECT quest FROM creature_involvedrelation WHERE id = {$mob['entry']}"); 1247 while ($quest = $sql->fetch_row($result1)){ 1248 $query1 = $sql->query("SELECT QuestLevel,Title FROM quest_template WHERE entry ='$quest[0]'"); 1249 $quest_templ = $sql->fetch_row($query1); 1241 1250 1242 1251 $output .= "<tr><td width=\"5%\"><input type=\"checkbox\" name=\"del_involvedrelation[]\" value=\"$quest[0]\" /></td> … … 1261 1270 $row_flag = 0; 1262 1271 $output .= "<table class=\"hidden\" align=\"center\"><tr>"; 1263 $result1 = $ mysql->query("SELECT item, maxcount, incrtime FROM npc_vendor WHERE entry = {$mob['entry']}");1264 while ($item = $ mysql->fetch_row($result1)){1272 $result1 = $sql->query("SELECT item, maxcount, incrtime FROM npc_vendor WHERE entry = {$mob['entry']}"); 1273 while ($item = $sql->fetch_row($result1)){ 1265 1274 $cel_counter++; 1266 1275 if (!$item[1]) $count = "{$lang_creature['unlimited']}"; … … 1303 1312 $row_flag = 0; 1304 1313 $output .= "<table class=\"hidden\" align=\"center\"><tr>"; 1305 $result1 = $ mysql->query("SELECT spell, spellcost, reqskill, reqskillvalue, reqlevel FROM npc_trainer WHERE entry = {$mob['entry']} ORDER BY reqlevel");1306 while ($spell = $ mysql->fetch_row($result1)){1314 $result1 = $sql->query("SELECT spell, spellcost, reqskill, reqskillvalue, reqlevel FROM npc_trainer WHERE entry = {$mob['entry']} ORDER BY reqlevel"); 1315 while ($spell = $sql->fetch_row($result1)){ 1307 1316 $cel_counter++; 1308 1317 $tooltip = "{$lang_creature['spell_id']} : $spell[0]<br />{$lang_creature['cost']} : $spell[1](c)<br />{$lang_creature['req_skill']} : $spell[2]<br />{$lang_creature['req_skill_lvl']} : $spell[3]<br />{$lang_creature['req_level']} $spell[4]"; … … 1350 1359 $row_flag = 0; 1351 1360 $output .= "<table class=\"hidden\" align=\"center\"><tr>"; 1352 $result1 = $ mysql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM skinning_loot_template WHERE entry = {$mob['skinloot']} ORDER BY ChanceOrRef DESC");1353 while ($item = $ mysql->fetch_row($result1)){1361 $result1 = $sql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM skinning_loot_template WHERE entry = {$mob['skinloot']} ORDER BY ChanceOrRef DESC"); 1362 while ($item = $sql->fetch_row($result1)){ 1354 1363 $cel_counter++; 1355 1364 $tooltip = get_item_name($item[0])." ($item[0])<br />{$lang_creature['drop_chance']}: $item[1]%<br />{$lang_creature['quest_drop_chance']}: $item[2]%<br />{$lang_creature['drop_chance']}: $item[3]-$item[4]<br />{$lang_creature['quest_freeforall']}: $item[5]"; … … 1399 1408 $row_flag = 0; 1400 1409 $output .= "<table class=\"hidden\" align=\"center\"><tr>"; 1401 $result1 = $ mysql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM pickpocketing_loot_template WHERE entry = {$mob['pickpocketloot']} ORDER BY ChanceOrRef DESC");1402 while ($item = $ mysql->fetch_row($result1)){1410 $result1 = $sql->query("SELECT item,ChanceOrRef,QuestChanceOrGroup,mincount,maxcount,quest_freeforall FROM pickpocketing_loot_template WHERE entry = {$mob['pickpocketloot']} ORDER BY ChanceOrRef DESC"); 1411 while ($item = $sql->fetch_row($result1)){ 1403 1412 $cel_counter++; 1404 1413 $tooltip = get_item_name($item[0])." ($item[0])<br />{$lang_creature['drop_chance']}: $item[1]%<br />{$lang_creature['quest_drop_chance']}: $item[2]%<br />{$lang_creature['drop_chance']}: $item[3]-$item[4]<br />{$lang_creature['quest_freeforall']}: $item[5]"; … … 1455 1464 </table></center>"; 1456 1465 1457 $ mysql->close();1466 $sql->close(); 1458 1467 } else { 1459 $ mysql->close();1468 $sql->close(); 1460 1469 error($lang_creature['item_not_found']); 1461 1470 exit(); … … 1473 1482 if (!isset($_POST['entry']) || $_POST['entry'] === '') redirect("creature.php?error=1"); 1474 1483 1475 $ mysql = new MySQL;1476 $ mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);1477 1478 $entry = $ mysql->quote_smart($_POST['entry']);1479 if (isset($_POST['modelid_m']) && $_POST['modelid_m'] != '') $modelid_m = $ mysql->quote_smart($_POST['modelid_m']);1484 $sql = new SQL; 1485 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 1486 1487 $entry = $sql->quote_smart($_POST['entry']); 1488 if (isset($_POST['modelid_m']) && $_POST['modelid_m'] != '') $modelid_m = $sql->quote_smart($_POST['modelid_m']); 1480 1489 else $modelid_m = 0; 1481 if (isset($_POST['modelid_f']) && $_POST['modelid_f'] != '') $modelid_f = $ mysql->quote_smart($_POST['modelid_f']);1490 if (isset($_POST['modelid_f']) && $_POST['modelid_f'] != '') $modelid_f = $sql->quote_smart($_POST['modelid_f']); 1482 1491 else $modelid_f = 0; 1483 if (isset($_POST['name']) && $_POST['name'] != '') $name = $ mysql->quote_smart($_POST['name']);1492 if (isset($_POST['name']) && $_POST['name'] != '') $name = $sql->quote_smart($_POST['name']); 1484 1493 else $name = ""; 1485 if (isset($_POST['subname']) && $_POST['subname'] != '') $subname = $ mysql->quote_smart($_POST['subname']);1494 if (isset($_POST['subname']) && $_POST['subname'] != '') $subname = $sql->quote_smart($_POST['subname']); 1486 1495 else $subname = ""; 1487 if (isset($_POST['minlevel']) && $_POST['minlevel'] != '') $minlevel = $ mysql->quote_smart($_POST['minlevel']);1496 if (isset($_POST['minlevel']) && $_POST['minlevel'] != '') $minlevel = $sql->quote_smart($_POST['minlevel']); 1488 1497 else $minlevel = 0; 1489 if (isset($_POST['maxlevel']) && $_POST['maxlevel'] != '') $maxlevel = $ mysql->quote_smart($_POST['maxlevel']);1498 if (isset($_POST['maxlevel']) && $_POST['maxlevel'] != '') $maxlevel = $sql->quote_smart($_POST['maxlevel']); 1490 1499 else $maxlevel = 0; 1491 if (isset($_POST['minhealth']) && $_POST['minhealth'] != '') $minhealth = $ mysql->quote_smart($_POST['minhealth']);1500 if (isset($_POST['minhealth']) && $_POST['minhealth'] != '') $minhealth = $sql->quote_smart($_POST['minhealth']); 1492 1501 else $minhealth = 0; 1493 if (isset($_POST['maxhealth']) && $_POST['maxhealth'] != '') $maxhealth = $ mysql->quote_smart($_POST['maxhealth']);1502 if (isset($_POST['maxhealth']) && $_POST['maxhealth'] != '') $maxhealth = $sql->quote_smart($_POST['maxhealth']); 1494 1503 else $maxhealth = 0; 1495 if (isset($_POST['minmana']) && $_POST['minmana'] != '') $minmana = $ mysql->quote_smart($_POST['minmana']);1504 if (isset($_POST['minmana']) && $_POST['minmana'] != '') $minmana = $sql->quote_smart($_POST['minmana']); 1496 1505 else $minmana = 0; 1497 if (isset($_POST['maxmana']) && $_POST['maxmana'] != '') $maxmana = $ mysql->quote_smart($_POST['maxmana']);1506 if (isset($_POST['maxmana']) && $_POST['maxmana'] != '') $maxmana = $sql->quote_smart($_POST['maxmana']); 1498 1507 else $maxmana = 0; 1499 if (isset($_POST['armor']) && $_POST['armor'] != '') $armor = $ mysql->quote_smart($_POST['armor']);1508 if (isset($_POST['armor']) && $_POST['armor'] != '') $armor = $sql->quote_smart($_POST['armor']); 1500 1509 else $armor = 0; 1501 if (isset($_POST['faction']) && $_POST['faction'] != '') $faction = $ mysql->quote_smart($_POST['faction']);1510 if (isset($_POST['faction']) && $_POST['faction'] != '') $faction = $sql->quote_smart($_POST['faction']); 1502 1511 else $faction = 0; 1503 if (isset($_POST['npcflag'])) $npcflag = $ mysql->quote_smart($_POST['npcflag']);1512 if (isset($_POST['npcflag'])) $npcflag = $sql->quote_smart($_POST['npcflag']); 1504 1513 else $npcflag = 0; 1505 if (isset($_POST['speed']) && $_POST['speed'] != '') $speed = $ mysql->quote_smart($_POST['speed']);1514 if (isset($_POST['speed']) && $_POST['speed'] != '') $speed = $sql->quote_smart($_POST['speed']); 1506 1515 else $speed = 0; 1507 if (isset($_POST['rank']) && $_POST['rank'] != '') $rank = $ mysql->quote_smart($_POST['rank']);1516 if (isset($_POST['rank']) && $_POST['rank'] != '') $rank = $sql->quote_smart($_POST['rank']); 1508 1517 else $rank = 0; 1509 if (isset($_POST['mindmg']) && $_POST['mindmg'] != '') $mindmg = $ mysql->quote_smart($_POST['mindmg']);1518 if (isset($_POST['mindmg']) && $_POST['mindmg'] != '') $mindmg = $sql->quote_smart($_POST['mindmg']); 1510 1519 else $mindmg = 0; 1511 if (isset($_POST['maxdmg']) && $_POST['maxdmg'] != '') $maxdmg = $ mysql->quote_smart($_POST['maxdmg']);1520 if (isset($_POST['maxdmg']) && $_POST['maxdmg'] != '') $maxdmg = $sql->quote_smart($_POST['maxdmg']); 1512 1521 else $maxdmg = 0; 1513 if (isset($_POST['attackpower']) && $_POST['attackpower'] != '') $attackpower = $ mysql->quote_smart($_POST['attackpower']);1522 if (isset($_POST['attackpower']) && $_POST['attackpower'] != '') $attackpower = $sql->quote_smart($_POST['attackpower']); 1514 1523 else $attackpower = 0; 1515 if (isset($_POST['baseattacktime']) && $_POST['baseattacktime'] != '') $baseattacktime = $ mysql->quote_smart($_POST['baseattacktime']);1524 if (isset($_POST['baseattacktime']) && $_POST['baseattacktime'] != '') $baseattacktime = $sql->quote_smart($_POST['baseattacktime']); 1516 1525 else $baseattacktime = 0; 1517 if (isset($_POST['rangeattacktime']) && $_POST['rangeattacktime'] != '') $rangeattacktime = $ mysql->quote_smart($_POST['rangeattacktime']);1526 if (isset($_POST['rangeattacktime']) && $_POST['rangeattacktime'] != '') $rangeattacktime = $sql->quote_smart($_POST['rangeattacktime']); 1518 1527 else $rangeattacktime = 0; 1519 if (isset($_POST['flags']) && $_POST['flags'] != '') $flags = $ mysql->quote_smart($_POST['flags']);1528 if (isset($_POST['flags']) && $_POST['flags'] != '') $flags = $sql->quote_smart($_POST['flags']); 1520 1529 else $flags = 0; 1521 if (isset($_POST['dynamicflags']) && $_POST['dynamicflags'] != '') $dynamicflags = $ mysql->quote_smart($_POST['dynamicflags']);1530 if (isset($_POST['dynamicflags']) && $_POST['dynamicflags'] != '') $dynamicflags = $sql->quote_smart($_POST['dynamicflags']); 1522 1531 else $dynamicflags = 0; 1523 if (isset($_POST['size']) && $_POST['size'] != '') $size = $ mysql->quote_smart($_POST['size']);1532 if (isset($_POST['size']) && $_POST['size'] != '') $size = $sql->quote_smart($_POST['size']); 1524 1533 else $size = 0; 1525 if (isset($_POST['family']) && $_POST['family'] != '') $family = $ mysql->quote_smart($_POST['family']);1534 if (isset($_POST['family']) && $_POST['family'] != '') $family = $sql->quote_smart($_POST['family']); 1526 1535 else $family = 0; 1527 if (isset($_POST['bounding_radius']) && $_POST['bounding_radius'] != '') $bounding_radius = $ mysql->quote_smart($_POST['bounding_radius']);1536 if (isset($_POST['bounding_radius']) && $_POST['bounding_radius'] != '') $bounding_radius = $sql->quote_smart($_POST['bounding_radius']); 1528 1537 else $bounding_radius = 0; 1529 if (isset($_POST['trainer_type']) && $_POST['trainer_type'] != '') $trainer_type = $ mysql->quote_smart($_POST['trainer_type']);1538 if (isset($_POST['trainer_type']) && $_POST['trainer_type'] != '') $trainer_type = $sql->quote_smart($_POST['trainer_type']); 1530 1539 else $trainer_type = 0; 1531 if (isset($_POST['trainer_spell']) && $_POST['trainer_spell'] != '') $trainer_spell = $ mysql->quote_smart($_POST['trainer_spell']);1540 if (isset($_POST['trainer_spell']) && $_POST['trainer_spell'] != '') $trainer_spell = $sql->quote_smart($_POST['trainer_spell']); 1532 1541 else $trainer_spell = 0; 1533 if (isset($_POST['class']) && $_POST['class'] != '') $class = $ mysql->quote_smart($_POST['class']);1542 if (isset($_POST['class']) && $_POST['class'] != '') $class = $sql->quote_smart($_POST['class']); 1534 1543 else $class = 0; 1535 if (isset($_POST['race']) && $_POST['race'] != '') $race = $ mysql->quote_smart($_POST['race']);1544 if (isset($_POST['race']) && $_POST['race'] != '') $race = $sql->quote_smart($_POST['race']); 1536 1545 else $race = 0; 1537 if (isset($_POST['minrangedmg']) && $_POST['minrangedmg'] != '') $minrangedmg = $ mysql->quote_smart($_POST['minrangedmg']);1546 if (isset($_POST['minrangedmg']) && $_POST['minrangedmg'] != '') $minrangedmg = $sql->quote_smart($_POST['minrangedmg']); 1538 1547 else $minrangedmg = 0; 1539 if (isset($_POST['maxrangedmg']) && $_POST['maxrangedmg'] != '') $maxrangedmg = $ mysql->quote_smart($_POST['maxrangedmg']);1548 if (isset($_POST['maxrangedmg']) && $_POST['maxrangedmg'] != '') $maxrangedmg = $sql->quote_smart($_POST['maxrangedmg']); 1540 1549 else $maxrangedmg = 0; 1541 if (isset($_POST['rangedattackpower']) && $_POST['rangedattackpower'] != '') $rangedattackpower = $ mysql->quote_smart($_POST['rangedattackpower']);1550 if (isset($_POST['rangedattackpower']) && $_POST['rangedattackpower'] != '') $rangedattackpower = $sql->quote_smart($_POST['rangedattackpower']); 1542 1551 else $rangedattackpower = 0; 1543 if (isset($_POST['combat_reach']) && $_POST['combat_reach'] != '') $combat_reach = $ mysql->quote_smart($_POST['combat_reach']);1552 if (isset($_POST['combat_reach']) && $_POST['combat_reach'] != '') $combat_reach = $sql->quote_smart($_POST['combat_reach']); 1544 1553 else $combat_reach = 0; 1545 if (isset($_POST['type']) && $_POST['type'] != '') $type = $ mysql->quote_smart($_POST['type']);1554 if (isset($_POST['type']) && $_POST['type'] != '') $type = $sql->quote_smart($_POST['type']); 1546 1555 else $type = 0; 1547 if (isset($_POST['civilian']) && $_POST['civilian'] != '') $civilian = $ mysql->quote_smart($_POST['civilian']);1556 if (isset($_POST['civilian']) && $_POST['civilian'] != '') $civilian = $sql->quote_smart($_POST['civilian']); 1548 1557 else $civilian = 0; 1549 if (isset($_POST['flag1']) && $_POST['flag1'] != '') $flag1 = $ mysql->quote_smart($_POST['flag1']);1558 if (isset($_POST['flag1']) && $_POST['flag1'] != '') $flag1 = $sql->quote_smart($_POST['flag1']); 1550 1559 else $flag1 = 0; 1551 if (isset($_POST['equipmodel1']) && $_POST['equipmodel1'] != '') $equipmodel1 = $ mysql->quote_smart($_POST['equipmodel1']);1560 if (isset($_POST['equipmodel1']) && $_POST['equipmodel1'] != '') $equipmodel1 = $sql->quote_smart($_POST['equipmodel1']); 1552 1561 else $equipmodel1 = 0; 1553 if (isset($_POST['equipmodel2']) && $_POST['equipmodel2'] != '') $equipmodel2 = $ mysql->quote_smart($_POST['equipmodel2']);1562 if (isset($_POST['equipmodel2']) && $_POST['equipmodel2'] != '') $equipmodel2 = $sql->quote_smart($_POST['equipmodel2']); 1554 1563 else $equipmodel2 = 0; 1555 if (isset($_POST['equipmodel3']) && $_POST['equipmodel3'] != '') $equipmodel3 = $ mysql->quote_smart($_POST['equipmodel3']);1564 if (isset($_POST['equipmodel3']) && $_POST['equipmodel3'] != '') $equipmodel3 = $sql->quote_smart($_POST['equipmodel3']); 1556 1565 else $equipmodel3 = 0; 1557 if (isset($_POST['equipinfo1']) && $_POST['equipinfo1'] != '') $equipinfo1 = $ mysql->quote_smart($_POST['equipinfo1']);1566 if (isset($_POST['equipinfo1']) && $_POST['equipinfo1'] != '') $equipinfo1 = $sql->quote_smart($_POST['equipinfo1']); 1558 1567 else $equipinfo1 = 0; 1559 if (isset($_POST['equipinfo2']) && $_POST['equipinfo2'] != '') $equipinfo2 = $ mysql->quote_smart($_POST['equipinfo2']);1568 if (isset($_POST['equipinfo2']) && $_POST['equipinfo2'] != '') $equipinfo2 = $sql->quote_smart($_POST['equipinfo2']); 1560 1569 else $equipinfo2 = 0; 1561 if (isset($_POST['equipinfo3']) && $_POST['equipinfo3'] != '') $equipinfo3 = $ mysql->quote_smart($_POST['equipinfo3']);1570 if (isset($_POST['equipinfo3']) && $_POST['equipinfo3'] != '') $equipinfo3 = $sql->quote_smart($_POST['equipinfo3']); 1562 1571 else $equipinfo3 = 0; 1563 if (isset($_POST['equipslot1']) && $_POST['equipslot1'] != '') $equipslot1 = $ mysql->quote_smart($_POST['equipslot1']);1572 if (isset($_POST['equipslot1']) && $_POST['equipslot1'] != '') $equipslot1 = $sql->quote_smart($_POST['equipslot1']); 1564 1573 else $equipslot1 = 0; 1565 if (isset($_POST['equipslot2']) && $_POST['equipslot2'] != '') $equipslot2 = $ mysql->quote_smart($_POST['equipslot2']);1574 if (isset($_POST['equipslot2']) && $_POST['equipslot2'] != '') $equipslot2 = $sql->quote_smart($_POST['equipslot2']); 1566 1575 else $equipslot2 = 0; 1567 if (isset($_POST['equipslot3']) && $_POST['equipslot3'] != '') $equipslot3 = $ mysql->quote_smart($_POST['equipslot3']);1576 if (isset($_POST['equipslot3']) && $_POST['equipslot3'] != '') $equipslot3 = $sql->quote_smart($_POST['equipslot3']); 1568 1577 else $equipslot3 = 0; 1569 if (isset($_POST['lootid']) && $_POST['lootid'] != '') $lootid = $ mysql->quote_smart($_POST['lootid']);1578 if (isset($_POST['lootid']) && $_POST['lootid'] != '') $lootid = $sql->quote_smart($_POST['lootid']); 1570 1579 else $lootid = 0; 1571 if (isset($_POST['pickpocketloot']) && $_POST['pickpocketloot'] != '') $pickpocketloot = $ mysql->quote_smart($_POST['pickpocketloot']);1580 if (isset($_POST['pickpocketloot']) && $_POST['pickpocketloot'] != '') $pickpocketloot = $sql->quote_smart($_POST['pickpocketloot']); 1572 1581 else $pickpocketloot = 0; 1573 if (isset($_POST['skinloot']) && $_POST['skinloot'] != '') $skinloot = $ mysql->quote_smart($_POST['skinloot']);1582 if (isset($_POST['skinloot']) && $_POST['skinloot'] != '') $skinloot = $sql->quote_smart($_POST['skinloot']); 1574 1583 else $skinloot = 0; 1575 if (isset($_POST['resistance1']) && $_POST['resistance1'] != '') $resistance1 = $ mysql->quote_smart($_POST['resistance1']);1584 if (isset($_POST['resistance1']) && $_POST['resistance1'] != '') $resistance1 = $sql->quote_smart($_POST['resistance1']); 1576 1585 else $resistance1 = 0; 1577 if (isset($_POST['resistance2']) && $_POST['resistance2'] != '') $resistance2 = $ mysql->quote_smart($_POST['resistance2']);1586 if (isset($_POST['resistance2']) && $_POST['resistance2'] != '') $resistance2 = $sql->quote_smart($_POST['resistance2']); 1578 1587 else $resistance2 = 0; 1579 if (isset($_POST['resistance3']) && $_POST['resistance3'] != '') $resistance3 = $ mysql->quote_smart($_POST['resistance3']);1588 if (isset($_POST['resistance3']) && $_POST['resistance3'] != '') $resistance3 = $sql->quote_smart($_POST['resistance3']); 1580 1589 else $resistance3 = 0; 1581 if (isset($_POST['resistance4']) && $_POST['resistance4'] != '') $resistance4 = $ mysql->quote_smart($_POST['resistance4']);1590 if (isset($_POST['resistance4']) && $_POST['resistance4'] != '') $resistance4 = $sql->quote_smart($_POST['resistance4']); 1582 1591 else $resistance4 = 0; 1583 if (isset($_POST['resistance5']) && $_POST['resistance5'] != '') $resistance5 = $ mysql->quote_smart($_POST['resistance5']);1592 if (isset($_POST['resistance5']) && $_POST['resistance5'] != '') $resistance5 = $sql->quote_smart($_POST['resistance5']); 1584 1593 else $resistance5 = 0; 1585 if (isset($_POST['resistance6']) && $_POST['resistance6'] != '') $resistance6 = $ mysql->quote_smart($_POST['resistance6']);1594 if (isset($_POST['resistance6']) && $_POST['resistance6'] != '') $resistance6 = $sql->quote_smart($_POST['resistance6']); 1586 1595 else $resistance6 = 0; 1587 if (isset($_POST['spell1']) && $_POST['spell1'] != '') $spell1 = $ mysql->quote_smart($_POST['spell1']);1596 if (isset($_POST['spell1']) && $_POST['spell1'] != '') $spell1 = $sql->quote_smart($_POST['spell1']); 1588 1597 else $spell1 = 0; 1589 if (isset($_POST['spell2']) && $_POST['spell2'] != '') $spell2 = $ mysql->quote_smart($_POST['spell2']);1598 if (isset($_POST['spell2']) && $_POST['spell2'] != '') $spell2 = $sql->quote_smart($_POST['spell2']); 1590 1599 else $spell2 = 0; 1591 if (isset($_POST['spell3']) && $_POST['spell3'] != '') $spell3 = $ mysql->quote_smart($_POST['spell3']);1600 if (isset($_POST['spell3']) && $_POST['spell3'] != '') $spell3 = $sql->quote_smart($_POST['spell3']); 1592 1601 else $spell3 = 0; 1593 if (isset($_POST['spell4']) && $_POST['spell4'] != '') $spell4 = $ mysql->quote_smart($_POST['spell4']);1602 if (isset($_POST['spell4']) && $_POST['spell4'] != '') $spell4 = $sql->quote_smart($_POST['spell4']); 1594 1603 else $spell4 = 0; 1595 if (isset($_POST['mingold']) && $_POST['mingold'] != '') $mingold = $ mysql->quote_smart($_POST['mingold']);1604 if (isset($_POST['mingold']) && $_POST['mingold'] != '') $mingold = $sql->quote_smart($_POST['mingold']); 1596 1605 else $mingold = 0; 1597 if (isset($_POST['maxgold']) && $_POST['maxgold'] != '') $maxgold = $ mysql->quote_smart($_POST['maxgold']);1606 if (isset($_POST['maxgold']) && $_POST['maxgold'] != '') $maxgold = $sql->quote_smart($_POST['maxgold']); 1598 1607 else $maxgold = 0; 1599 if (isset($_POST['AIName']) && $_POST['AIName'] != '') $AIName = $ mysql->quote_smart($_POST['AIName']);1608 if (isset($_POST['AIName']) && $_POST['AIName'] != '') $AIName = $sql->quote_smart($_POST['AIName']); 1600 1609 else $AIName = ""; 1601 if (isset($_POST['MovementType']) && $_POST['MovementType'] != '') $MovementType = $ mysql->quote_smart($_POST['MovementType']);1610 if (isset($_POST['MovementType']) && $_POST['MovementType'] != '') $MovementType = $sql->quote_smart($_POST['MovementType']); 1602 1611 else $MovementType = 0; 1603 if (isset($_POST['InhabitType']) && $_POST['InhabitType'] != '') $InhabitType = $mysql->quote_smart($_POST['InhabitType']);1612 if (isset($_POST['InhabitType']) && $_POST['InhabitType'] != '') $InhabitType = $sql->quote_smart($_POST['InhabitType']); 1604 1613 else $InhabitType = 0; 1605 if (isset($_POST['ScriptName']) && $_POST['ScriptName'] != '') $ScriptName = $ mysql->quote_smart($_POST['ScriptName']);1614 if (isset($_POST['ScriptName']) && $_POST['ScriptName'] != '') $ScriptName = $sql->quote_smart($_POST['ScriptName']); 1606 1615 else $ScriptName = ""; 1607 1608 if (isset($_POST['ChanceOrRef']) && $_POST['ChanceOrRef'] != '') $ChanceOrRef = $mysql->quote_smart($_POST['ChanceOrRef']); 1616 if (isset($_POST['RacialLeader']) && $_POST['RacialLeader'] != '') $RacialLeader = $sql->quote_smart($_POST['RacialLeader']); 1617 else $RacialLeader = 0; 1618 1619 if (isset($_POST['ChanceOrRef']) && $_POST['ChanceOrRef'] != '') $ChanceOrRef = $sql->quote_smart($_POST['ChanceOrRef']); 1609 1620 else $ChanceOrRef = 0; 1610 if (isset($_POST['QuestChanceOrGroup']) && $_POST['QuestChanceOrGroup'] != '') $QuestChanceOrGroup = $ mysql->quote_smart($_POST['QuestChanceOrGroup']);1621 if (isset($_POST['QuestChanceOrGroup']) && $_POST['QuestChanceOrGroup'] != '') $QuestChanceOrGroup = $sql->quote_smart($_POST['QuestChanceOrGroup']); 1611 1622 else $QuestChanceOrGroup = 0; 1612 if (isset($_POST['mincount']) && $_POST['mincount'] != '') $mincount = $ mysql->quote_smart($_POST['mincount']);1623 if (isset($_POST['mincount']) && $_POST['mincount'] != '') $mincount = $sql->quote_smart($_POST['mincount']); 1613 1624 else $mincount = 0; 1614 if (isset($_POST['maxcount']) && $_POST['maxcount'] != '') $maxcount = $ mysql->quote_smart($_POST['maxcount']);1625 if (isset($_POST['maxcount']) && $_POST['maxcount'] != '') $maxcount = $sql->quote_smart($_POST['maxcount']); 1615 1626 else $maxcount = 0; 1616 if (isset($_POST['quest_freeforall']) && $_POST['quest_freeforall'] != '') $quest_freeforall = $ mysql->quote_smart($_POST['quest_freeforall']);1627 if (isset($_POST['quest_freeforall']) && $_POST['quest_freeforall'] != '') $quest_freeforall = $sql->quote_smart($_POST['quest_freeforall']); 1617 1628 else $quest_freeforall = 0; 1618 if (isset($_POST['item']) && $_POST['item'] != '') $item = $ mysql->quote_smart($_POST['item']);1629 if (isset($_POST['item']) && $_POST['item'] != '') $item = $sql->quote_smart($_POST['item']); 1619 1630 else $item = 0; 1620 if (isset($_POST['del_loot_items']) && $_POST['del_loot_items'] != '') $del_loot_items = $ mysql->quote_smart($_POST['del_loot_items']);1631 if (isset($_POST['del_loot_items']) && $_POST['del_loot_items'] != '') $del_loot_items = $sql->quote_smart($_POST['del_loot_items']); 1621 1632 else $del_loot_items = NULL; 1622 1633 1623 if (isset($_POST['involvedrelation']) && $_POST['involvedrelation'] != '') $involvedrelation = $ mysql->quote_smart($_POST['involvedrelation']);1634 if (isset($_POST['involvedrelation']) && $_POST['involvedrelation'] != '') $involvedrelation = $sql->quote_smart($_POST['involvedrelation']); 1624 1635 else $involvedrelation = 0; 1625 if (isset($_POST['del_involvedrelation']) && $_POST['del_involvedrelation'] != '') $del_involvedrelation = $ mysql->quote_smart($_POST['del_involvedrelation']);1636 if (isset($_POST['del_involvedrelation']) && $_POST['del_involvedrelation'] != '') $del_involvedrelation = $sql->quote_smart($_POST['del_involvedrelation']); 1626 1637 else $del_involvedrelation = NULL; 1627 if (isset($_POST['questrelation']) && $_POST['questrelation'] != '') $questrelation = $ mysql->quote_smart($_POST['questrelation']);1638 if (isset($_POST['questrelation']) && $_POST['questrelation'] != '') $questrelation = $sql->quote_smart($_POST['questrelation']); 1628 1639 else $questrelation = 0; 1629 if (isset($_POST['del_questrelation']) && $_POST['del_questrelation'] != '') $del_questrelation = $ mysql->quote_smart($_POST['del_questrelation']);1640 if (isset($_POST['del_questrelation']) && $_POST['del_questrelation'] != '') $del_questrelation = $sql->quote_smart($_POST['del_questrelation']); 1630 1641 else $del_questrelation = NULL; 1631 1642 1632 if (isset($_POST['del_vendor_item']) && $_POST['del_vendor_item'] != '') $del_vendor_item = $ mysql->quote_smart($_POST['del_vendor_item']);1643 if (isset($_POST['del_vendor_item']) && $_POST['del_vendor_item'] != '') $del_vendor_item = $sql->quote_smart($_POST['del_vendor_item']); 1633 1644 else $del_vendor_item = NULL; 1634 if (isset($_POST['vendor_item']) && $_POST['vendor_item'] != '') $vendor_item = $ mysql->quote_smart($_POST['vendor_item']);1645 if (isset($_POST['vendor_item']) && $_POST['vendor_item'] != '') $vendor_item = $sql->quote_smart($_POST['vendor_item']); 1635 1646 else $vendor_item = 0; 1636 if (isset($_POST['vendor_maxcount']) && $_POST['vendor_maxcount'] != '') $vendor_maxcount = $ mysql->quote_smart($_POST['vendor_maxcount']);1647 if (isset($_POST['vendor_maxcount']) && $_POST['vendor_maxcount'] != '') $vendor_maxcount = $sql->quote_smart($_POST['vendor_maxcount']); 1637 1648 else $vendor_maxcount = 0; 1638 if (isset($_POST['vendor_incrtime']) && $_POST['vendor_incrtime'] != '') $vendor_incrtime = $ mysql->quote_smart($_POST['vendor_incrtime']);1649 if (isset($_POST['vendor_incrtime']) && $_POST['vendor_incrtime'] != '') $vendor_incrtime = $sql->quote_smart($_POST['vendor_incrtime']); 1639 1650 else $vendor_incrtime = 0; 1640 1651 1641 if (isset($_POST['skin_ChanceOrRef']) && $_POST['skin_ChanceOrRef'] != '') $skin_ChanceOrRef = $ mysql->quote_smart($_POST['skin_ChanceOrRef']);1652 if (isset($_POST['skin_ChanceOrRef']) && $_POST['skin_ChanceOrRef'] != '') $skin_ChanceOrRef = $sql->quote_smart($_POST['skin_ChanceOrRef']); 1642 1653 else $skin_ChanceOrRef = 0; 1643 if (isset($_POST['skin_QuestChanceOrGroup']) && $_POST['skin_QuestChanceOrGroup'] != '') $skin_QuestChanceOrGroup = $ mysql->quote_smart($_POST['skin_QuestChanceOrGroup']);1654 if (isset($_POST['skin_QuestChanceOrGroup']) && $_POST['skin_QuestChanceOrGroup'] != '') $skin_QuestChanceOrGroup = $sql->quote_smart($_POST['skin_QuestChanceOrGroup']); 1644 1655 else $skin_QuestChanceOrGroup = 0; 1645 if (isset($_POST['skin_mincount']) && $_POST['skin_mincount'] != '') $skin_mincount = $ mysql->quote_smart($_POST['skin_mincount']);1656 if (isset($_POST['skin_mincount']) && $_POST['skin_mincount'] != '') $skin_mincount = $sql->quote_smart($_POST['skin_mincount']); 1646 1657 else $skin_mincount = 0; 1647 if (isset($_POST['skin_maxcount']) && $_POST['skin_maxcount'] != '') $skin_maxcount = $ mysql->quote_smart($_POST['skin_maxcount']);1658 if (isset($_POST['skin_maxcount']) && $_POST['skin_maxcount'] != '') $skin_maxcount = $sql->quote_smart($_POST['skin_maxcount']); 1648 1659 else $skin_maxcount = 0; 1649 if (isset($_POST['skin_quest_freeforall']) && $_POST['skin_quest_freeforall'] != '') $skin_quest_freeforall = $ mysql->quote_smart($_POST['skin_quest_freeforall']);1660 if (isset($_POST['skin_quest_freeforall']) && $_POST['skin_quest_freeforall'] != '') $skin_quest_freeforall = $sql->quote_smart($_POST['skin_quest_freeforall']); 1650 1661 else $skin_quest_freeforall = 0; 1651 if (isset($_POST['skin_item']) && $_POST['skin_item'] != '') $skin_item = $ mysql->quote_smart($_POST['skin_item']);1662 if (isset($_POST['skin_item']) && $_POST['skin_item'] != '') $skin_item = $sql->quote_smart($_POST['skin_item']); 1652 1663 else $skin_item = 0; 1653 if (isset($_POST['del_skin_items']) && $_POST['del_skin_items'] != '') $del_skin_items = $ mysql->quote_smart($_POST['del_skin_items']);1664 if (isset($_POST['del_skin_items']) && $_POST['del_skin_items'] != '') $del_skin_items = $sql->quote_smart($_POST['del_skin_items']); 1654 1665 else $del_skin_items = NULL; 1655 1666 1656 if (isset($_POST['pp_ChanceOrRef']) && $_POST['pp_ChanceOrRef'] != '') $pp_ChanceOrRef = $ mysql->quote_smart($_POST['pp_ChanceOrRef']);1667 if (isset($_POST['pp_ChanceOrRef']) && $_POST['pp_ChanceOrRef'] != '') $pp_ChanceOrRef = $sql->quote_smart($_POST['pp_ChanceOrRef']); 1657 1668 else $pp_ChanceOrRef = 0; 1658 if (isset($_POST['pp_QuestChanceOrGroup']) && $_POST['pp_QuestChanceOrGroup'] != '') $pp_QuestChanceOrGroup = $ mysql->quote_smart($_POST['pp_QuestChanceOrGroup']);1669 if (isset($_POST['pp_QuestChanceOrGroup']) && $_POST['pp_QuestChanceOrGroup'] != '') $pp_QuestChanceOrGroup = $sql->quote_smart($_POST['pp_QuestChanceOrGroup']); 1659 1670 else $pp_QuestChanceOrGroup = 0; 1660 if (isset($_POST['pp_mincount']) && $_POST['pp_mincount'] != '') $pp_mincount = $ mysql->quote_smart($_POST['pp_mincount']);1671 if (isset($_POST['pp_mincount']) && $_POST['pp_mincount'] != '') $pp_mincount = $sql->quote_smart($_POST['pp_mincount']); 1661 1672 else $pp_mincount = 0; 1662 if (isset($_POST['pp_maxcount']) && $_POST['pp_maxcount'] != '') $pp_maxcount = $ mysql->quote_smart($_POST['pp_maxcount']);1673 if (isset($_POST['pp_maxcount']) && $_POST['pp_maxcount'] != '') $pp_maxcount = $sql->quote_smart($_POST['pp_maxcount']); 1663 1674 else $pp_maxcount = 0; 1664 if (isset($_POST['pp_quest_freeforall']) && $_POST['pp_quest_freeforall'] != '') $pp_quest_freeforall = $ mysql->quote_smart($_POST['pp_quest_freeforall']);1675 if (isset($_POST['pp_quest_freeforall']) && $_POST['pp_quest_freeforall'] != '') $pp_quest_freeforall = $sql->quote_smart($_POST['pp_quest_freeforall']); 1665 1676 else $pp_quest_freeforall = 0; 1666 if (isset($_POST['pp_item']) && $_POST['pp_item'] != '') $pp_item = $ mysql->quote_smart($_POST['pp_item']);1677 if (isset($_POST['pp_item']) && $_POST['pp_item'] != '') $pp_item = $sql->quote_smart($_POST['pp_item']); 1667 1678 else $pp_item = 0; 1668 if (isset($_POST['del_pp_items']) && $_POST['del_pp_items'] != '') $del_pp_items = $ mysql->quote_smart($_POST['del_pp_items']);1679 if (isset($_POST['del_pp_items']) && $_POST['del_pp_items'] != '') $del_pp_items = $sql->quote_smart($_POST['del_pp_items']); 1669 1680 else $del_pp_items = NULL; 1670 1681 1671 if (isset($_POST['trainer_spell']) && $_POST['trainer_spell'] != '') $trainer_spell = $ mysql->quote_smart($_POST['trainer_spell']);1682 if (isset($_POST['trainer_spell']) && $_POST['trainer_spell'] != '') $trainer_spell = $sql->quote_smart($_POST['trainer_spell']); 1672 1683 else $trainer_spell = 0; 1673 if (isset($_POST['spellcost']) && $_POST['spellcost'] != '') $spellcost = $ mysql->quote_smart($_POST['spellcost']);1684 if (isset($_POST['spellcost']) && $_POST['spellcost'] != '') $spellcost = $sql->quote_smart($_POST['spellcost']); 1674 1685 else $spellcost = 0; 1675 if (isset($_POST['reqskill']) && $_POST['reqskill'] != '') $reqskill = $ mysql->quote_smart($_POST['reqskill']);1686 if (isset($_POST['reqskill']) && $_POST['reqskill'] != '') $reqskill = $sql->quote_smart($_POST['reqskill']); 1676 1687 else $reqskill = 0; 1677 if (isset($_POST['reqskillvalue']) && $_POST['reqskillvalue'] != '') $reqskillvalue = $ mysql->quote_smart($_POST['reqskillvalue']);1688 if (isset($_POST['reqskillvalue']) && $_POST['reqskillvalue'] != '') $reqskillvalue = $sql->quote_smart($_POST['reqskillvalue']); 1678 1689 else $reqskillvalue = 0; 1679 if (isset($_POST['reqlevel']) && $_POST['reqlevel'] != '') $reqlevel = $ mysql->quote_smart($_POST['reqlevel']);1690 if (isset($_POST['reqlevel']) && $_POST['reqlevel'] != '') $reqlevel = $sql->quote_smart($_POST['reqlevel']); 1680 1691 else $reqlevel = 0; 1681 if (isset($_POST['del_trainer_spell']) && $_POST['del_trainer_spell'] != '') $del_trainer_spell = $ mysql->quote_smart($_POST['del_trainer_spell']);1692 if (isset($_POST['del_trainer_spell']) && $_POST['del_trainer_spell'] != '') $del_trainer_spell = $sql->quote_smart($_POST['del_trainer_spell']); 1682 1693 else $del_trainer_spell = NULL; 1683 1694 … … 1703 1714 1704 1715 if ($_POST['opp_type'] == "add_new"){ 1705 $sql = "INSERT INTO creature_template ( entry, modelid_m, modelid_f, name, subname, minlevel,1716 $sql_query = "INSERT INTO creature_template ( entry, modelid_m, modelid_f, name, subname, minlevel, 1706 1717 maxlevel, minhealth, maxhealth, minmana, maxmana, armor, faction, npcflag, speed, rank, mindmg, 1707 1718 maxdmg, attackpower, baseattacktime, rangeattacktime, flags, dynamicflags, size, family, … … 1710 1721 equipinfo3, equipslot1, equipslot2, equipslot3, lootid, pickpocketloot, skinloot, resistance1, 1711 1722 resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, 1712 mingold, maxgold, AIName, MovementType, InhabitType, ScriptName) VALUES ( '$entry', '$modelid_m', '$modelid_f', '$name',1723 mingold, maxgold, AIName, MovementType, InhabitType, RacialLeader, ScriptName) VALUES ( '$entry', '$modelid_m', '$modelid_f', '$name', 1713 1724 '$subname', '$minlevel', '$maxlevel', '$minhealth', '$maxhealth', '$minmana', '$maxmana', '$armor', '$faction', '$npcflag', 1714 1725 '$speed', '$rank', '$mindmg', '$maxdmg', '$attackpower', '$baseattacktime', '$rangeattacktime', '$flags', … … 1718 1729 '$equipslot2', '$equipslot3', '$lootid', '$pickpocketloot', '$skinloot', '$resistance1', '$resistance2', 1719 1730 '$resistance3', '$resistance4', '$resistance5', '$resistance6', '$spell1', '$spell2', '$spell3', '$spell4', 1720 '$mingold', '$maxgold', '$AIName', '$MovementType', '$InhabitType', '$ ScriptName' )";1731 '$mingold', '$maxgold', '$AIName', '$MovementType', '$InhabitType', '$RacialLeader', '$ScriptName' )"; 1721 1732 1722 1733 } elseif ($_POST['opp_type'] == "edit"){ 1723 1734 1724 $sql = "UPDATE creature_template SET "; 1725 1726 $result = $mysql->query("SELECT * FROM creature_template WHERE entry = '$entry'"); 1727 if ($mob_templ = $mysql->fetch_assoc($result)){ 1728 if ($mob_templ['modelid_m'] != $modelid_m) $sql .= "modelid_m='$modelid_m',"; 1729 if ($mob_templ['modelid_f'] != $modelid_f) $sql .= "modelid_f='$modelid_f',"; 1730 if ($mob_templ['name'] != $name) $sql .= "name='$name',"; 1731 if ($mob_templ['subname'] != $subname) $sql .= "subname='$subname',"; 1732 if ($mob_templ['minlevel'] != $minlevel) $sql .= "minlevel='$minlevel',"; 1733 if ($mob_templ['maxlevel'] != $maxlevel) $sql .= "maxlevel='$maxlevel',"; 1734 if ($mob_templ['minhealth'] != $minhealth) $sql .= "minhealth='$minhealth',"; 1735 if ($mob_templ['maxhealth'] != $maxhealth) $sql .= "maxhealth='$maxhealth',"; 1736 if ($mob_templ['minmana'] != $minmana) $sql .= "minmana='$minmana',"; 1737 if ($mob_templ['maxmana'] != $maxmana) $sql .= "maxmana='$maxmana',"; 1738 if ($mob_templ['armor'] != $armor) $sql .= "armor='$armor',"; 1739 if ($mob_templ['faction'] != $faction) $sql .= "faction='$faction',"; 1740 if ($mob_templ['npcflag'] != $npcflag) $sql .= "npcflag='$npcflag',"; 1741 if ($mob_templ['speed'] != $speed) $sql .= "speed='$speed',"; 1742 if ($mob_templ['rank'] != $rank) $sql .= "rank='$rank',"; 1743 if ($mob_templ['mindmg'] != $mindmg) $sql .= "mindmg='$mindmg',"; 1744 if ($mob_templ['maxdmg'] != $maxdmg) $sql .= "maxdmg='$maxdmg',"; 1745 if ($mob_templ['attackpower'] != $attackpower) $sql .= "attackpower='$attackpower',"; 1746 if ($mob_templ['baseattacktime'] != $baseattacktime) $sql .= "baseattacktime='$baseattacktime',"; 1747 if ($mob_templ['rangeattacktime'] != $rangeattacktime) $sql .= "rangeattacktime='$rangeattacktime',"; 1748 if ($mob_templ['flags'] != $flags) $sql .= "flags='$flags',"; 1749 if ($mob_templ['dynamicflags'] != $dynamicflags) $sql .= "dynamicflags='$dynamicflags',"; 1750 if ($mob_templ['size'] != $size) $sql .= "size='$size',"; 1751 if ($mob_templ['family'] != $family) $sql .= "family='$family',"; 1752 if ($mob_templ['bounding_radius'] != $bounding_radius) $sql .= "bounding_radius='$bounding_radius',"; 1753 if ($mob_templ['trainer_type'] != $trainer_type) $sql .= "trainer_type='$trainer_type',"; 1754 if ($mob_templ['trainer_spell'] != $trainer_spell) $sql .= "trainer_spell='$trainer_spell',"; 1755 if ($mob_templ['class'] != $class) $sql .= "class='$class',"; 1756 if ($mob_templ['race'] != $race) $sql .= "race='$race',"; 1757 if ($mob_templ['minrangedmg'] != $minrangedmg) $sql .= "minrangedmg='$minrangedmg',"; 1758 if ($mob_templ['maxrangedmg'] != $maxrangedmg) $sql .= "maxrangedmg='$maxrangedmg',"; 1759 if ($mob_templ['rangedattackpower'] != $rangedattackpower) $sql .= "rangedattackpower='$rangedattackpower',"; 1760 if ($mob_templ['combat_reach'] != $combat_reach) $sql .= "combat_reach='$combat_reach',"; 1761 if ($mob_templ['type'] != $type) $sql .= "type='$type',"; 1762 if ($mob_templ['civilian'] != $civilian) $sql .= "civilian='$civilian',"; 1763 if ($mob_templ['flag1'] != $flag1) $sql .= "flag1='$flag1',"; 1764 if ($mob_templ['equipmodel1'] != $equipmodel1) $sql .= "equipmodel1='$equipmodel1',"; 1765 if ($mob_templ['equipmodel2'] != $equipmodel2) $sql .= "equipmodel2='$equipmodel2',"; 1766 if ($mob_templ['equipmodel3'] != $equipmodel3) $sql .= "equipmodel3='$equipmodel3',"; 1767 if ($mob_templ['equipinfo1'] != $equipinfo1) $sql .= "equipinfo1='$equipinfo1',"; 1768 if ($mob_templ['equipinfo2'] != $equipinfo2) $sql .= "equipinfo2='$equipinfo2',"; 1769 if ($mob_templ['equipinfo3'] != $equipinfo3) $sql .= "equipinfo3='$equipinfo3',"; 1770 if ($mob_templ['equipslot1'] != $equipslot1) $sql .= "equipslot1='$equipslot1',"; 1771 if ($mob_templ['equipslot2'] != $equipslot2) $sql .= "equipslot2='$equipslot2',"; 1772 if ($mob_templ['equipslot3'] != $equipslot3) $sql .= "equipslot3='$equipslot3',"; 1773 if ($mob_templ['lootid'] != $lootid) $sql .= "lootid='$lootid',"; 1774 if ($mob_templ['pickpocketloot'] != $pickpocketloot) $sql .= "pickpocketloot='$pickpocketloot',"; 1775 if ($mob_templ['skinloot'] != $skinloot) $sql .= "skinloot='$skinloot',"; 1776 if ($mob_templ['resistance1'] != $resistance1) $sql .= "resistance1='$resistance1',"; 1777 if ($mob_templ['resistance2'] != $resistance2) $sql .= "resistance2='$resistance2',"; 1778 if ($mob_templ['resistance3'] != $resistance3) $sql .= "resistance3='$resistance3',"; 1779 if ($mob_templ['resistance4'] != $resistance4) $sql .= "resistance4='$resistance4',"; 1780 if ($mob_templ['resistance5'] != $resistance5) $sql .= "resistance5='$resistance5',"; 1781 if ($mob_templ['resistance6'] != $resistance6) $sql .= "resistance6='$resistance6',"; 1782 if ($mob_templ['spell1'] != $spell1) $sql .= "spell1='$spell1',"; 1783 if ($mob_templ['spell2'] != $spell2) $sql .= "spell2='$spell2',"; 1784 if ($mob_templ['spell3'] != $spell3) $sql .= "spell3='$spell3',"; 1785 if ($mob_templ['spell4'] != $spell4) $sql .= "spell4='$spell4',"; 1786 if ($mob_templ['mingold'] != $mingold) $sql .= "mingold='$mingold',"; 1787 if ($mob_templ['maxgold'] != $maxgold) $sql .= "maxgold='$maxgold',"; 1788 if ($mob_templ['AIName'] != $AIName) $sql .= "AIName='$AIName',"; 1789 if ($mob_templ['MovementType'] != $MovementType) $sql .= "MovementType='$MovementType',"; 1790 if ($mob_templ['InhabitType'] != $InhabitType) $sql .= "InhabitType='$InhabitType',"; 1791 if ($mob_templ['ScriptName'] != $ScriptName) $sql .= "ScriptName='$ScriptName',"; 1792 1793 $mysql->free_result($result); 1735 $sql_query = "UPDATE creature_template SET "; 1736 1737 $result = $sql->query("SELECT * FROM creature_template WHERE entry = '$entry'"); 1738 if ($mob_templ = $sql->fetch_assoc($result)){ 1739 if ($mob_templ['modelid_m'] != $modelid_m) $sql_query .= "modelid_m='$modelid_m',"; 1740 if ($mob_templ['modelid_f'] != $modelid_f) $sql_query .= "modelid_f='$modelid_f',"; 1741 if ($mob_templ['name'] != $name) $sql_query .= "name='$name',"; 1742 if ($mob_templ['subname'] != $subname) $sql_query .= "subname='$subname',"; 1743 if ($mob_templ['minlevel'] != $minlevel) $sql_query .= "minlevel='$minlevel',"; 1744 if ($mob_templ['maxlevel'] != $maxlevel) $sql_query .= "maxlevel='$maxlevel',"; 1745 if ($mob_templ['minhealth'] != $minhealth) $sql_query .= "minhealth='$minhealth',"; 1746 if ($mob_templ['maxhealth'] != $maxhealth) $sql_query .= "maxhealth='$maxhealth',"; 1747 if ($mob_templ['minmana'] != $minmana) $sql_query .= "minmana='$minmana',"; 1748 if ($mob_templ['maxmana'] != $maxmana) $sql_query .= "maxmana='$maxmana',"; 1749 if ($mob_templ['armor'] != $armor) $sql_query .= "armor='$armor',"; 1750 if ($mob_templ['faction'] != $faction) $sql_query .= "faction='$faction',"; 1751 if ($mob_templ['npcflag'] != $npcflag) $sql_query .= "npcflag='$npcflag',"; 1752 if ($mob_templ['speed'] != $speed) $sql_query .= "speed='$speed',"; 1753 if ($mob_templ['rank'] != $rank) $sql_query .= "rank='$rank',"; 1754 if ($mob_templ['mindmg'] != $mindmg) $sql_query .= "mindmg='$mindmg',"; 1755 if ($mob_templ['maxdmg'] != $maxdmg) $sql_query .= "maxdmg='$maxdmg',"; 1756 if ($mob_templ['attackpower'] != $attackpower) $sql_query .= "attackpower='$attackpower',"; 1757 if ($mob_templ['baseattacktime'] != $baseattacktime) $sql_query .= "baseattacktime='$baseattacktime',"; 1758 if ($mob_templ['rangeattacktime'] != $rangeattacktime) $sql_query .= "rangeattacktime='$rangeattacktime',"; 1759 if ($mob_templ['flags'] != $flags) $sql_query .= "flags='$flags',"; 1760 if ($mob_templ['dynamicflags'] != $dynamicflags) $sql_query .= "dynamicflags='$dynamicflags',"; 1761 if ($mob_templ['size'] != $size) $sql_query .= "size='$size',"; 1762 if ($mob_templ['family'] != $family) $sql_query .= "family='$family',"; 1763 if ($mob_templ['bounding_radius'] != $bounding_radius) $sql_query .= "bounding_radius='$bounding_radius',"; 1764 if ($mob_templ['trainer_type'] != $trainer_type) $sql_query .= "trainer_type='$trainer_type',"; 1765 if ($mob_templ['trainer_spell'] != $trainer_spell) $sql_query .= "trainer_spell='$trainer_spell',"; 1766 if ($mob_templ['class'] != $class) $sql_query .= "class='$class',"; 1767 if ($mob_templ['race'] != $race) $sql_query .= "race='$race',"; 1768 if ($mob_templ['minrangedmg'] != $minrangedmg) $sql_query .= "minrangedmg='$minrangedmg',"; 1769 if ($mob_templ['maxrangedmg'] != $maxrangedmg) $sql_query .= "maxrangedmg='$maxrangedmg',"; 1770 if ($mob_templ['rangedattackpower'] != $rangedattackpower) $sql_query .= "rangedattackpower='$rangedattackpower',"; 1771 if ($mob_templ['combat_reach'] != $combat_reach) $sql_query .= "combat_reach='$combat_reach',"; 1772 if ($mob_templ['type'] != $type) $sql_query .= "type='$type',"; 1773 if ($mob_templ['civilian'] != $civilian) $sql_query .= "civilian='$civilian',"; 1774 if ($mob_templ['flag1'] != $flag1) $sql_query .= "flag1='$flag1',"; 1775 if ($mob_templ['equipmodel1'] != $equipmodel1) $sql_query .= "equipmodel1='$equipmodel1',"; 1776 if ($mob_templ['equipmodel2'] != $equipmodel2) $sql_query .= "equipmodel2='$equipmodel2',"; 1777 if ($mob_templ['equipmodel3'] != $equipmodel3) $sql_query .= "equipmodel3='$equipmodel3',"; 1778 if ($mob_templ['equipinfo1'] != $equipinfo1) $sql_query .= "equipinfo1='$equipinfo1',"; 1779 if ($mob_templ['equipinfo2'] != $equipinfo2) $sql_query .= "equipinfo2='$equipinfo2',"; 1780 if ($mob_templ['equipinfo3'] != $equipinfo3) $sql_query .= "equipinfo3='$equipinfo3',"; 1781 if ($mob_templ['equipslot1'] != $equipslot1) $sql_query .= "equipslot1='$equipslot1',"; 1782 if ($mob_templ['equipslot2'] != $equipslot2) $sql_query .= "equipslot2='$equipslot2',"; 1783 if ($mob_templ['equipslot3'] != $equipslot3) $sql_query .= "equipslot3='$equipslot3',"; 1784 if ($mob_templ['lootid'] != $lootid) $sql_query .= "lootid='$lootid',"; 1785 if ($mob_templ['pickpocketloot'] != $pickpocketloot) $sql_query .= "pickpocketloot='$pickpocketloot',"; 1786 if ($mob_templ['skinloot'] != $skinloot) $sql_query .= "skinloot='$skinloot',"; 1787 if ($mob_templ['resistance1'] != $resistance1) $sql_query .= "resistance1='$resistance1',"; 1788 if ($mob_templ['resistance2'] != $resistance2) $sql_query .= "resistance2='$resistance2',"; 1789 if ($mob_templ['resistance3'] != $resistance3) $sql_query .= "resistance3='$resistance3',"; 1790 if ($mob_templ['resistance4'] != $resistance4) $sql_query .= "resistance4='$resistance4',"; 1791 if ($mob_templ['resistance5'] != $resistance5) $sql_query .= "resistance5='$resistance5',"; 1792 if ($mob_templ['resistance6'] != $resistance6) $sql_query .= "resistance6='$resistance6',"; 1793 if ($mob_templ['spell1'] != $spell1) $sql_query .= "spell1='$spell1',"; 1794 if ($mob_templ['spell2'] != $spell2) $sql_query .= "spell2='$spell2',"; 1795 if ($mob_templ['spell3'] != $spell3) $sql_query .= "spell3='$spell3',"; 1796 if ($mob_templ['spell4'] != $spell4) $sql_query .= "spell4='$spell4',"; 1797 if ($mob_templ['mingold'] != $mingold) $sql_query .= "mingold='$mingold',"; 1798 if ($mob_templ['maxgold'] != $maxgold) $sql_query .= "maxgold='$maxgold',"; 1799 if ($mob_templ['AIName'] != $AIName) $sql_query .= "AIName='$AIName',"; 1800 if ($mob_templ['MovementType'] != $MovementType) $sql_query .= "MovementType='$MovementType',"; 1801 if ($mob_templ['InhabitType'] != $InhabitType) $sql_query .= "InhabitType='$InhabitType',"; 1802 if ($mob_templ['ScriptName'] != $ScriptName) $sql_query .= "ScriptName='$ScriptName',"; 1803 if ($mob_templ['RacialLeader'] != $RacialLeader) $sql_query .= "RacialLeader='$RacialLeader',"; 1804 1805 $sql->free_result($result); 1794 1806 unset($mob_templ); 1795 1807 1796 if (($sql == "UPDATE creature_template SET ")&&(!$item)&&(!$del_loot_items)1808 if (($sql_query == "UPDATE creature_template SET ")&&(!$item)&&(!$del_loot_items) 1797 1809 &&(!$del_questrelation)&&(!$questrelation)&&(!$del_involvedrelation)&&(!$involvedrelation) 1798 1810 &&(!$del_vendor_item)&&(!$vendor_item)&&(!$del_skin_items)&&(!$skin_item) 1799 1811 &&(!$del_pp_items)&&(!$pp_item)&&(!$trainer_spell)&&(!$del_trainer_spell)){ 1800 $ mysql->close();1812 $sql->close(); 1801 1813 redirect("creature.php?action=edit&entry=$entry&error=6"); 1802 1814 } else { 1803 if ($sql != "UPDATE creature_template SET "){1804 $sql [strlen($sql)-1] = " ";1805 $sql .= " WHERE entry = '$entry';\n";1806 } else $sql = "";1815 if ($sql_query != "UPDATE creature_template SET "){ 1816 $sql_query[strlen($sql_query)-1] = " "; 1817 $sql_query .= " WHERE entry = '$entry';\n"; 1818 } else $sql_query = ""; 1807 1819 } 1808 1820 1809 1821 if ($trainer_spell){ 1810 $sql .= "INSERT INTO npc_trainer (entry, spell, spellcost, reqskill, reqskillvalue, reqlevel)1822 $sql_query .= "INSERT INTO npc_trainer (entry, spell, spellcost, reqskill, reqskillvalue, reqlevel) 1811 1823 VALUES ($entry,$trainer_spell,$spellcost,$reqskill ,$reqskillvalue ,$reqlevel);\n"; 1812 1824 } … … 1814 1826 if ($del_trainer_spell){ 1815 1827 foreach($del_trainer_spell as $spell_id) 1816 $sql .= "DELETE FROM npc_trainer WHERE entry = $entry AND spell = $spell_id;\n";1828 $sql_query .= "DELETE FROM npc_trainer WHERE entry = $entry AND spell = $spell_id;\n"; 1817 1829 } 1818 1830 1819 1831 if ($item){ 1820 $sql .= "INSERT INTO creature_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall)1832 $sql_query .= "INSERT INTO creature_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall) 1821 1833 VALUES ($lootid,$item,'$ChanceOrRef', '$QuestChanceOrGroup' ,$mincount ,$maxcount ,$quest_freeforall);\n"; 1822 1834 } … … 1824 1836 if ($del_loot_items){ 1825 1837 foreach($del_loot_items as $item_id) 1826 $sql .= "DELETE FROM creature_loot_template WHERE entry = $lootid AND item = $item_id;\n";1838 $sql_query .= "DELETE FROM creature_loot_template WHERE entry = $lootid AND item = $item_id;\n"; 1827 1839 } 1828 1840 1829 1841 if ($skin_item){ 1830 $sql .= "INSERT INTO skinning_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall)1842 $sql_query .= "INSERT INTO skinning_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall) 1831 1843 VALUES ($skinloot,$skin_item,'$skin_ChanceOrRef', '$skin_QuestChanceOrGroup' ,$skin_mincount ,$skin_maxcount ,$skin_quest_freeforall);\n"; 1832 1844 } … … 1834 1846 if ($del_skin_items){ 1835 1847 foreach($del_skin_items as $item_id) 1836 $sql .= "DELETE FROM skinning_loot_template WHERE entry = $skinloot AND item = $item_id;\n";1848 $sql_query .= "DELETE FROM skinning_loot_template WHERE entry = $skinloot AND item = $item_id;\n"; 1837 1849 } 1838 1850 1839 1851 if ($pp_item){ 1840 $sql .= "INSERT INTO pickpocketing_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall)1852 $sql_query .= "INSERT INTO pickpocketing_loot_template (entry, item, ChanceOrRef, QuestChanceOrGroup, mincount, maxcount, quest_freeforall) 1841 1853 VALUES ($pickpocketloot,$pp_item,'$pp_ChanceOrRef', '$pp_QuestChanceOrGroup' ,$pp_mincount ,$pp_maxcount ,$pp_quest_freeforall);\n"; 1842 1854 } … … 1844 1856 if ($del_pp_items){ 1845 1857 foreach($del_pp_items as $item_id) 1846 $sql .= "DELETE FROM pickpocketing_loot_template WHERE entry = $pickpocketloot AND item = $item_id;\n";1858 $sql_query .= "DELETE FROM pickpocketing_loot_template WHERE entry = $pickpocketloot AND item = $item_id;\n"; 1847 1859 } 1848 1860 1849 1861 if ($questrelation){ 1850 $sql .= "INSERT INTO creature_questrelation (id, quest) VALUES ($entry,$questrelation);\n";1862 $sql_query .= "INSERT INTO creature_questrelation (id, quest) VALUES ($entry,$questrelation);\n"; 1851 1863 } 1852 1864 1853 1865 if ($involvedrelation){ 1854 $sql .= "INSERT INTO creature_involvedrelation (id, quest) VALUES ($entry,$involvedrelation);\n";1866 $sql_query .= "INSERT INTO creature_involvedrelation (id, quest) VALUES ($entry,$involvedrelation);\n"; 1855 1867 } 1856 1868 1857 1869 if ($del_questrelation){ 1858 1870 foreach($del_questrelation as $quest_id) 1859 $sql .= "DELETE FROM creature_questrelation WHERE id = $entry AND quest = $quest_id;\n";1871 $sql_query .= "DELETE FROM creature_questrelation WHERE id = $entry AND quest = $quest_id;\n"; 1860 1872 } 1861 1873 1862 1874 if ($del_involvedrelation){ 1863 1875 foreach($del_involvedrelation as $quest_id) 1864 $sql .= "DELETE FROM creature_involvedrelation WHERE id = $entry AND quest = $quest_id;\n";1876 $sql_query .= "DELETE FROM creature_involvedrelation WHERE id = $entry AND quest = $quest_id;\n"; 1865 1877 } 1866 1878 1867 1879 if ($del_vendor_item){ 1868 1880 foreach($del_vendor_item as $item_id) 1869 $sql .= "DELETE FROM npc_vendor WHERE entry = $entry AND item = $item_id;\n";1881 $sql_query .= "DELETE FROM npc_vendor WHERE entry = $entry AND item = $item_id;\n"; 1870 1882 } 1871 1883 1872 1884 if ($vendor_item){ 1873 $sql .= "INSERT INTO npc_vendor (entry, item, maxcount, incrtime)1885 $sql_query .= "INSERT INTO npc_vendor (entry, item, maxcount, incrtime) 1874 1886 VALUES ($entry,$vendor_item,$vendor_maxcount,$vendor_incrtime);\n"; 1875 1887 } 1876 1888 1877 1889 } else { 1878 $ mysql->close();1890 $sql->close(); 1879 1891 redirect("creature.php?error=5"); 1880 1892 } 1881 1893 } else { 1882 $ mysql->close();1894 $sql->close(); 1883 1895 redirect("creature.php?error=5"); 1884 1896 } 1885 1897 1886 1898 if ( isset($_POST['backup_op']) && ($_POST['backup_op'] == 1) ){ 1887 $ mysql->close();1899 $sql->close(); 1888 1900 Header("Content-type: application/octet-stream"); 1889 1901 Header("Content-Disposition: attachment; filename=creatureid_$entry.sql"); 1890 echo $sql ;1902 echo $sql_query; 1891 1903 exit(); 1892 1904 redirect("creature.php?action=edit&entry=$entry&error=4"); 1893 1905 } else { 1894 $sql = explode(';',$sql);1895 foreach($sql as $tmp_query) if(($tmp_query)&&($tmp_query != "\n")) $result = $mysql->query($tmp_query);1896 $ mysql->close();1906 $sql_query = explode(';',$sql_query); 1907 foreach($sql_query as $tmp_query) if(($tmp_query)&&($tmp_query != "\n")) $result = $sql->query($tmp_query); 1908 $sql->close(); 1897 1909 } 1898 1910 … … 1934 1946 else redirect("creature.php?error=1"); 1935 1947 1936 $ mysql = new MySQL;1937 $ mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);1938 1939 $result = $ mysql->query("SELECT guid FROM creature WHERE id = '$entry'");1940 while ($guid = $ mysql->fetch_row($result)){1941 $ mysql->query("DELETE FROM creature_movement WHERE id = '$guid'");1948 $sql = new SQL; 1949 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 1950 1951 $result = $sql->query("SELECT guid FROM creature WHERE id = '$entry'"); 1952 while ($guid = $sql->fetch_row($result)){ 1953 $sql->query("DELETE FROM creature_movement WHERE id = '$guid'"); 1942 1954 } 1943 $ mysql->query("DELETE FROM creature WHERE id = '$entry'");1944 $ mysql->query("DELETE FROM creature_template WHERE entry = '$entry'");1945 $ mysql->query("DELETE FROM creature_onkill_reputation WHERE creature_id = '$entry'");1946 $ mysql->query("DELETE FROM creature_involvedrelation WHERE id = '$entry'");1947 $ mysql->query("DELETE FROM creature_questrelation WHERE id = '$entry'");1948 $ mysql->query("DELETE FROM npc_vendor WHERE entry = '$entry'");1949 $ mysql->query("DELETE FROM npc_trainer WHERE entry = '$entry'");1950 $ mysql->query("DELETE FROM npc_gossip WHERE npc_guid = '$entry'");1951 1952 $ mysql->close();1955 $sql->query("DELETE FROM creature WHERE id = '$entry'"); 1956 $sql->query("DELETE FROM creature_template WHERE entry = '$entry'"); 1957 $sql->query("DELETE FROM creature_onkill_reputation WHERE creature_id = '$entry'"); 1958 $sql->query("DELETE FROM creature_involvedrelation WHERE id = '$entry'"); 1959 $sql->query("DELETE FROM creature_questrelation WHERE id = '$entry'"); 1960 $sql->query("DELETE FROM npc_vendor WHERE entry = '$entry'"); 1961 $sql->query("DELETE FROM npc_trainer WHERE entry = '$entry'"); 1962 $sql->query("DELETE FROM npc_gossip WHERE npc_guid = '$entry'"); 1963 1964 $sql->close(); 1953 1965 redirect("creature.php"); 1954 1966 } … … 1964 1976 else redirect("creature.php?error=1"); 1965 1977 1966 $ mysql = new MySQL;1967 $ mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);1968 1969 $result = $ mysql->query("SELECT guid FROM creature WHERE id = '$entry'");1970 while ($guid = $ mysql->fetch_row($result)){1971 $ mysql->query("DELETE FROM creature_movement WHERE id = '$guid'");1978 $sql = new SQL; 1979 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 1980 1981 $result = $sql->query("SELECT guid FROM creature WHERE id = '$entry'"); 1982 while ($guid = $sql->fetch_row($result)){ 1983 $sql->query("DELETE FROM creature_movement WHERE id = '$guid'"); 1972 1984 } 1973 1985 1974 $ mysql->query("DELETE FROM creature WHERE id = '$entry'");1975 $ mysql->close();1986 $sql->query("DELETE FROM creature WHERE id = '$entry'"); 1987 $sql->close(); 1976 1988 redirect("creature.php?action=edit&entry=$entry&error=4"); 1977 1989 }
Note:
See TracChangeset
for help on using the changeset viewer.