game/adminion/mod/dungeon_bots.php

578 lines
22 KiB
PHP

<?
if(!defined('GAME')){
die();
}
if(isset($_GET['delete_dungeon_id'])){
$delete_dungeon_id = intval($_GET['delete_dungeon_id']);
mysql_query("DELETE FROM `dungeon_room` WHERE `id`='".$delete_dungeon_id."'");
die("<script>window.location = 'index.php?mod=dungeon_list';</script>");
}
if(isset($_GET['id_bot'])){
$_POST['botSelect'] = $_GET['id_bot'];
}
$Query = mysql_query("SELECT id, login FROM test_bot ORDER BY id ASC");
$dungeon_bots = '';
while($row = mysql_fetch_assoc($Query)){
$dungeon_bots .= '<option value="'.$row['id'].'" '.($row['id']==$_POST['botSelect'] ? 'selected' : '').'>'.$row['login'].'</option>';
}
$Query = mysql_query("SELECT id, dungeon_id, dungeon_name FROM dungeon_room ORDER BY active, dungeon_id ASC");
$dungeon_list = '';
while($row = mysql_fetch_assoc($Query)){
$dungeon_list .= '<option value="'.$row['dungeon_id'].'" '.($row['dungeon_id']==$_POST['dunSelect'] ? 'selected' : '').'>'.$row['dungeon_name'].'</option>';
}
?><script src="https://<? echo $c['img']; ?>/js/jx/jquery.js" type="text/javascript"></script>
<div align="left">
<h3 style="text-align:left;">Ïåùåðíûå æèòåëè</h3>
</div>
<form method="post" action="../../adminion/mod/index.php?mod=dungeon_bots">
<table>
<tbody>
<tr>
<td>Ïî ïåùåðå:
<select name="dunSelect">
<option selected value="0">Âñå</option>
<?php echo $dungeon_list; ?>
</select>&nbsp; &nbsp; &nbsp; &nbsp;
</td>
<td>
Áîò:
<select name="botSelect">
<option disabled selected value="0">âûáåðèòå íóæíîãî áîòà...</option>
<?php echo $dungeon_bots; ?>
</select>
</td>
<td>
<input type="submit" value="âûáðàòü">
</td>
</tr>
</tbody>
</table>
</form>
<?
if ( $_POST['botSelect'] != '0' ) {
$sBot = mysql_fetch_assoc(mysql_query("SELECT * FROM test_bot WHERE id='".$_POST['botSelect']."' ORDER BY id ASC"));
}
if( isset($sBot) ){
?>
<script>
var CharacterBased = ['minAtack','maxAtack','zona','zonb','s1','s2','s3','s4','hpAll','m1','m2','m3','m4','m5','m6','m7','m8','m9','m10','za','zm','zma','mib1','mab1','mib2','mab2','mib3','mab3','mib4','mab4','pza','pzm'];
var CharacterInfo = {
'exp' : 'Ïîëó÷àåìûé îïûò (%)',
'align_bs' : 'Ñëóæèòåëü çàêîíà',
'nopryh' : 'Ïðÿìîå ïîïîäàíèå',
'puti':'Çàïðåò ïåðåìåùåíèÿ',
'align':'Ñêëîííîñòü',
'hpAll':'Óðîâåíü æèçíè (HP)',
'mpAll':'Óðîâåíü ìàíû',
'enAll':'Óðîâåíü ýíåðãèè',
'sex':'Ïîë',
'lvl':'Óðîâåíü',
'zona':'Äîï çîíû àòàêè',
'zonb':'Çîí çàùèòû âñåãî',
's1':'Ñèëà',
's2':'Ëîâêîñòü',
's3':'Èíòóèöèÿ',
's4':'Âûíîñëèâîñòü',
's5':'Èíòåëëåêò',
's6':'Ìóäðîñòü',
's7':'Äóõîâíîñòü',
's8':'Âîëÿ',
's9':'Ñâîáîäà äóõà',
's10':'Áîæåñòâåííîñòü',
's11':'Ýíåðãèÿ',
'm1':'Ìô. êðèòè÷åñêîãî óäàðà (%)',
'm2':'Ìô. ïðîòèâ êðèòè÷åñêîãî óäàðà (%)',
'm3':'Ìô. ìîùíîñòè êðèò. óäàðà (%)',
'm4':'Ìô. óâåðòûâàíèÿ (%)',
'm5':'Ìô. ïðîòèâ óâåðòûâàíèÿ (%)',
'm6':'Ìô. êîíòðóäàðà (%)',
'm7':'Ìô. ïàðèðîâàíèÿ (%)',
'm8':'Ìô. áëîêà ùèòîì (%)',
'm9':'Ìô. óäàðà ñêâîçü áðîíþ (%)',
'm10':'Ìô. ìîùíîñòè óðîíà',
'm11':'Ìô. ìîùíîñòè ìàãèè ñòèõèé',
'm11a':'Ìô. ìîùíîñòè ìàãèè',
'm14':'Ìô. àáñ. êðèòè÷åñêîãî óäàðà (%)',
'm15':'Ìô. àáñ. óâåðòûâàíèÿ (%)',
'm16':'Ìô. àáñ. ïàðèðîâàíèÿ (%)',
'm17':'Ìô. àáñ. êîíòðóäàðà (%)',
'm18':'Ìô. àáñ. áëîêà ùèòîì (%)',
'm19':'Ìô. àáñ. ìàãè÷åñêèé ïðîìàõ (%)',
'm20':'Ìô. óäà÷à (%)',
'a1':'Ìàñòåðñòâî âëàäåíèÿ íîæàìè, êèíæàëàìè',
'a2':'Ìàñòåðñòâî âëàäåíèÿ òîïîðàìè, ñåêèðàìè',
'a3':'Ìàñòåðñòâî âëàäåíèÿ äóáèíàìè, ìîëîòàìè',
'a4':'Ìàñòåðñòâî âëàäåíèÿ ìå÷àìè',
'a5':'Ìàñòåðñòâî âëàäåíèÿ ìàãè÷åñêèìè ïîñîõàìè',
'a6':'Ìàñòåðñòâî âëàäåíèÿ ëóêàìè',
'a7':'Ìàñòåðñòâî âëàäåíèÿ àðáàëåòàìè',
'aall':'Ìàñòåðñòâî âëàäåíèÿ îðóæèåì',
'mall':'Ìàñòåðñòâî âëàäåíèÿ ìàãèåé ñòèõèé',
'm2all':'Ìàñòåðñòâî âëàäåíèÿ ìàãèåé',
'mg1':'Ìàñòåðñòâî âëàäåíèÿ ìàãèåé îãíÿ',
'mg2':'Ìàñòåðñòâî âëàäåíèÿ ìàãèåé âîçäóõà',
'mg3':'Ìàñòåðñòâî âëàäåíèÿ ìàãèåé âîäû',
'mg4':'Ìàñòåðñòâî âëàäåíèÿ ìàãèåé çåìëè',
'mg5':'Ìàñòåðñòâî âëàäåíèÿ ìàãèåé Ñâåòà',
'mg6':'Ìàñòåðñòâî âëàäåíèÿ ìàãèåé Òüìû',
'mg7':'Ìàñòåðñòâî âëàäåíèÿ ñåðîé ìàãèåé',
'mib1':'Áðîíÿ ãîëîâû (ìèí)',
'mab1':'Áðîíÿ ãîëîâû (ìàêñ)',
'mib2':'Áðîíÿ êîðïóñà (ìèí)',
'mab2':'Áðîíÿ êîðïóñà (ìàêñ)',
'mib3':'Áðîíÿ ïîÿñà (ìèí)',
'mab3':'Áðîíÿ ïîÿñà (ìàêñ)',
'mib4':'Áðîíÿ íîã (ìèí)',
'mab4':'Áðîíÿ íîã (ìàêñ)',
'tj':'Òÿæåëàÿ áðîíÿ',
'lh':'Ëåãêàÿ áðîíÿ',
'minAtack':'Ìèíèìàëüíûé óðîí',
'maxAtack':'Ìàêñèìàëüíûé óðîí',
'pa1':'Ìô. ìîùíîñòè êîëþùåãî óðîíà',
'pa2':'Ìô. ìîùíîñòè ðóáÿùåãî óðîíà',
'pa3':'Ìô. ìîùíîñòè äðîáÿùèé óðîíà',
'pa4':'Ìô. ìîùíîñòè ðåæóùèé óðîíà',
'pm1':'Ìô. ìîùíîñòè ìàãèè îãíÿ',
'pm2':'Ìô. ìîùíîñòè ìàãèè âîçäóõà',
'pm3':'Ìô. ìîùíîñòè ìàãèè âîäû',
'pm4':'Ìô. ìîùíîñòè ìàãèè çåìëè',
'pm5':'Ìô. ìîùíîñòè ìàãèè Ñâåòà',
'pm6':'Ìô. ìîùíîñòè ìàãèè Òüìû',
'pm7':'Ìô. ìîùíîñòè ñåðîé ìàãèè',
'za':'Çàùèòà îò óðîíà',
'zm':'Çàùèòà îò ìàãèè ñòèõèé',
'zma':'Çàùèòà îò ìàãèè',
'za1':'Çàùèòà îò êîëþùåãî óðîíà',
'za2':'Çàùèòà îò ðóáÿùåãî óðîíà',
'za3':'Çàùèòà îò äðîáÿùåãî óðîíà',
'za4':'Çàùèòà îò ðåæóùåãî óðîíà',
'zm1':'Çàùèòà îò ìàãèè îãíÿ',
'zm2':'Çàùèòà îò ìàãèè âîçäóõà',
'zm3':'Çàùèòà îò ìàãèè âîäû',
'zm4':'Çàùèòà îò ìàãèè çåìëè',
'zm5':'Çàùèòà îò ìàãèè Ñâåòà',
'zm6':'Çàùèòà îò ìàãèè Òüìû',
'zm7':'Çàùèòà îò ñåðîé ìàãèè',
'mg2static_points':'Óðîâåíü çàðÿäà (Âîçäóõ)',
'magic_cast':'Äîïîëíèòåëüíûé êàñò çà õîä',
'min_heal_proc':'Ýôôåêò ëå÷åíèÿ (%)',
'notravma':'Çàùèòà îò òðàâì',
'zaproc':'Çàùèòà îò óðîíà (%)',
'zmproc':'Çàùèòà îò ìàãèè ñòèõèé (%)',
'zm2proc':'Çàùèòà îò ìàãèè Âîçäóõà (%)',
'pza':'Ïîíèæåíèå çàùèòû îò óðîíà',
'pzm':'Ïîíèæåíèå çàùèòû îò ìàãèè',
'pza1':'Ïîíèæåíèå çàùèòû îò êîëþùåãî óðîíà',
'pza2':'Ïîíèæåíèå çàùèòû îò ðóáÿùåãî óðîíà',
'pza3':'Ïîíèæåíèå çàùèòû îò äðîáÿùåãî óðîíà',
'pza4':'Ïîíèæåíèå çàùèòû îò ðåæóùåãî óðîíà',
'pzm1':'Ïîíèæåíèå çàùèòû îò ìàãèè îãíÿ',
'pzm2':'Ïîíèæåíèå çàùèòû îò ìàãèè âîçäóõà',
'pzm3':'Ïîíèæåíèå çàùèòû îò ìàãèè âîäû',
'pzm4':'Ïîíèæåíèå çàùèòû îò ìàãèè çåìëè',
'pzm5':'Ïîíèæåíèå çàùèòû îò ìàãèè Ñâåòà',
'pzm6':'Ïîíèæåíèå çàùèòû îò ìàãèè Òüìû',
'pzm7':'Ïîíèæåíèå çàùèòû îò ñåðîé ìàãèè',
'speedhp':'Ðåãåíåðàöèÿ çäîðîâüÿ (%)',
'speedmp':'Ðåãåíåðàöèÿ ìàíû (%)',
'tya1':'Êîëþùèå àòàêè',
'tya2':'Ðóáÿùèå àòàêè',
'tya3':'Äðîáÿùèå àòàêè',
'tya4':'Ðåæóùèå àòàêè',
'tym1':'Îãíåííûå àòàêè',
'tym2':'Ýëåêòðè÷åñêèå àòàêè',
'tym3':'Ëåäÿíûå àòàêè',
'tym4':'Çåìëÿíûå àòàêè',
'tym5':'Àòàêè Ñâåòà',
'tym6':'Àòàêè Òüìû',
'tym7':'Ñåðûå àòàêè',
'pog':'Ïîãëîùåíèå óðîíà',
'pog2':'Ïîãëîùåíèå óðîíà',
'pog2p':'Ïðîöåíò ïîãëîùåíèå óðîíà',
'pog2mp':'Öåíà ïîãëîùåíèå óðîíà',
'maxves':'Óâåëè÷èâàåò ðþêçàê',
'min_use_mp':'Óìåíüøàåò ðàñõîä ìàíû',
'bonusexp':'Óâåëè÷èâàåò ïîëó÷àåìûé îïûò',
'speeden':'Ðåãåíåðàöèÿ ýíåðãèè (%)',
'yza' : 'Óÿçâèìîñòü ôèçè÷åñêîìó óðîíà (%)',
'yzm' : 'Óÿçâèìîñòü ìàãèè ñòèõèé (%)',
'yzma' : 'Óÿçâèìîñòü ìàãèè (%)',
'yza1' : 'Óÿçâèìîñòü êîëþùåìó óðîíà (%)',
'yza2' : 'Óÿçâèìîñòü ðóáÿùåìó óðîíà (%)',
'yza3' : 'Óÿçâèìîñòü äðîáÿùåìó óðîíà (%)',
'yza4' : 'Óÿçâèìîñòü ðåæóùåìó óðîíà (%)',
'yzm1' : 'Óÿçâèìîñòü ìàãèè îãíÿ (%)',
'yzm2' : 'Óÿçâèìîñòü ìàãèè âîçäóõà (%)',
'yzm3' : 'Óÿçâèìîñòü ìàãèè âîäû (%)',
'yzm4' : 'Óÿçâèìîñòü ìàãèè çåìëè (%)',
'yzm5' : 'Óÿçâèìîñòü ìàãèè (%)',
'yzm6' : 'Óÿçâèìîñòü ìàãèè (%)',
'yzm7' : 'Óÿçâèìîñòü ìàãèè (%)',
'rep': 'Ðåïóòàöèÿ Ðûöàðÿ',
'hpProc':'Óðîâåíü æèçíè (%)',
'mpProc':'Óðîâåíü ìàíû (%)'
};
function linkGif (th){
$('#linkGo').attr('href', 'https://img.new-combats.com/i/obraz/0/'+$('input[name=obraz]').val()).html('Open '+$(th).val()).click();
}
function linkPng (th){
var t = $('input[name=obraz]').val(); t = t.split('.');
$('#linkGo').attr('href', 'https://img.new-combats.com/chars/0/'+t[0]+'.png').html('Open '+$(th).val()).click();
}
</script>
<form method="post" action="../../adminion/mod/index.php?mod=dungeon_bots"><hr>
<table valign="top" width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" >
<table width="400px">
<tbody>
<tr>
<td>ID: &nbsp; </td>
<td><input name="id_bot" value="<?=$sBot['id'];?>" type="text"></td>
</tr>
<tr>
<td>Ëîãèí: &nbsp; </td>
<td><input name="login" value="<?=$sBot['login'];?>" type="text"></td>
</tr>
<tr>
<td>Èìÿ: &nbsp; </td>
<td><input name="name" value="<?=$sBot['name'];?>" type="text"></td>
</tr>
<tr>
<td>Óðîâåíü: &nbsp; </td>
<td><input name="level" value="<?=$sBot['level'];?>" type="text"></td>
</tr>
<tr>
<td>Ñêëîííîñòü: &nbsp; </td>
<td><select name="align">
<option <? if($sBot['align']==0){ echo "selected"; } ?> value="0">Áåç ñêëîííîñòè</option>
<option <? if($sBot['align']==1){ echo "selected"; } ?> value="1">Ñâåòëûé</option>
<option <? if($sBot['align']==2){ echo "selected"; } ?> value="2">Õàîñíèê</option>
<option <? if($sBot['align']==3){ echo "selected"; } ?> value="3">Òåìíûé</option>
<option <? if($sBot['align']==7){ echo "selected"; } ?> value="7">Íåéòðàëüíûé</option>
<option <? if($sBot['align']==9){ echo "selected"; } ?> value="9">Ìàðî÷íûé</option>
<option <? if($sBot['align']==10){ echo "selected"; } ?> value="10">Çàùèòíèê</option>
</select></td>
</tr>
<tr>
<td>Ïîë: &nbsp; </td>
<td><select name="sex"><option <? if($sBot['sex']==0){ echo "selected"; } ?> value="0">Ìóæñêîé</option><option <? if($sBot['sex']==1){ echo "selected"; } ?> value="1">Æåíñêèé</option></select></td>
</tr>
<tr>
<td>Îáðàç: &nbsp; </td> <!-- Hors.gif -->
<td><input name="obraz" value="<?=$sBot['obraz'];?>" type="text"> <input type="button" value="GIF" onclick="linkGif(this)"> <input type="button" value="PNG" onclick="linkPng(this)"> <a style="font-size:11px;" id="linkGo" target="_blank" href="javascript:void();">&nbsp;</a></td>
</tr>
<tr>
<td>Ãîðîä: &nbsp; </td>
<td><input name="city_reg" value="<?=$sBot['city_reg'];?>" type="text"> {thiscity}</td>
</tr>
<tr>
<td>Ñòàòû: &nbsp; </td>
<td><textarea style="min-height:60px;width: 270px;" id="statsLoad" name="stats" type="text"><?=$sBot['stats'];?></textarea></td>
</tr>
<tr>
<td>Èñïîëüçóåìûå ïðåäìåòû: &nbsp; </td>
<td><textarea style="min-height:42px;width: 270px;" id="useItemLoad" name="itemsUse" type="text"><?=$sBot['itemsUse'];?></textarea></td>
</tr>
<tr>
<td>Èñïîëüçóåìûå ïðèåìû: &nbsp; </td>
<td><textarea style="min-height:42px;width: 270px;" name="priemUse" type="text"><?=$sBot['priemUse'];?></textarea></td>
</tr>
<tr>
<td>Äðîï: &nbsp; </td>
<td><textarea style="min-height:42px;width: 270px;" id="dropLoad" name="p_items" type="text"><?=$sBot['p_items'];?></textarea></td>
</tr>
<tr>
<td></td>
<td>
<input type="hidden" name="botSelect" value="<?=$_POST['botSelect']?>">
<input type="hidden" name="dunSelect" value="<?=$_POST['dunSelect']?>">
<input type="submit" style="padding: 5px 12px;background: rgb(234, 234, 234);font-size: 14px;" value="Ñîõðàíèòü">
</td>
</tr>
</tbody>
</table>
</td>
<td valign="top" width="55%" align="left">
<style>.brown {
border-color:#9C8265;
color:brown;
font-weight:bold;
}</style>
<input type="button" id="editStat" value="Ðåäàêòèðîâàòü õàðàêòåðèñòèê"> <input type="button" id="editDrop" value="Ðåäàêòèðîâàòü äðîï"> <input type="button" id="editUseItem" value="Îáìóíäèðîâàíèå">
<div id="editorStats"></div>
<div id="editorDrop"></div>
<div id="editorUseItem"></div>
<script>
function loadItemInfo(th){
$.post('/adminion/lib/loadItemInfo.php', {item_id:$(th).parent('td').children('.items').val()}, function(data){
$(th).html(data);
});
}
function loadListItems(th){
$.post('/adminion/lib/loadItemInfo.php', {getListItems:true}, function(data){
$(th).html(data);
});
}
function StatsUp(){
var s1 = parseInt($('.stats[name=s1]').val()) * 6;
var s2 = parseInt($('.stats[name=s2]').val()) * 6;
var s3 = parseInt($('.stats[name=s3]').val()) * 4;
var s4 = (parseInt($('.stats[name=s4]').val()) * 6)+30;
var s5 = (parseInt($('.stats[name=s5]').val()) * 1);
var s6 = (parseInt($('.stats[name=s6]').val()) * 10);
var hpAll = parseInt($('.stats[name=hpAll]').val())+s4;
var mpAll = parseInt($('.stats[name=mpAll]').val())+s6;
var maxAtack = parseInt($('.stats[name=maxAtack]').val());
var minAtack = parseInt($('.stats[name=minAtack]').val());
var m1 = parseInt($('.stats[name=m1]').val())+s3;
var m2 = parseInt($('.stats[name=m2]').val())+s3;
var m3 = parseInt($('.stats[name=m3]').val());
var m4 = parseInt($('.stats[name=m4]').val())+s2;
var m5 = parseInt($('.stats[name=m5]').val())+s2;
var m7 = parseInt($('.stats[name=m7]').val());
var m10 = parseInt($('.stats[name=m10]').val());
var m11 = parseInt($('.stats[name=m11]').val());
var m14 = parseInt($('.stats[name=m14]').val());
var m15 = parseInt($('.stats[name=m15]').val());
var za = parseInt($('.stats[name=s4]').val()) * 1.5;
var zm = parseInt($('.stats[name=s4]').val()) * 1.5;
var zma = parseInt($('.stats[name=s4]').val()) * 1.5;
if (s1 >= 100) m10 += 25;
else if (s1 >= 75) m10 += 17;
else if (s1 >= 50) m10 += 10;
else if (s1 >= 25) m10 += 5;
if (s1 >= 125) {
maxAtack += 10;
minAtack += 10;
}
if (s5 >= 125) m11 += 35;
else if (s5 >= 100) m11 += 25;
else if (s5 >= 75) m11 += 17;
else if (s5 >= 50) m11 += 10;
else if (s5 >= 25) m11 += 5;
if (parseInt($('.stats[name=s4]').val()) >= 100) hpAll += 250;
else if (parseInt($('.stats[name=s4]').val()) >= 75) hpAll += 175;
else if (parseInt($('.stats[name=s4]').val()) >= 50) hpAll += 100;
else if (parseInt($('.stats[name=s4]').val()) >= 25) hpAll += 50;
if (parseInt($('.stats[name=s6]').val()) >= 100) mpAll += 250;
else if (parseInt($('.stats[name=s6]').val()) >= 75) mpAll += 175;
else if (parseInt($('.stats[name=s6]').val()) >= 50) mpAll += 100;
else if (parseInt($('.stats[name=s6]').val()) >= 25) mpAll += 50;
if (parseInt($('.stats[name=s2]').val()) >= 125) {
m7 += 15;
m4 += 105;
m2 += 40;
m15 += 5;
} else if (parseInt($('.stats[name=s2]').val()) >= 100) {
m7 += 15;
m4 += 105;
m2 += 40;
} else if (parseInt($('.stats[name=s2]').val()) >= 75) {
m7 += 15;
m4 += 35;
m2 += 15;
} else if (parseInt($('.stats[name=s2]').val()) >= 50) {
m7 += 5;
m4 += 35;
m2 += 15;
} else if (parseInt($('.stats[name=s2]').val()) >= 25) {
m7 += 5;
}
if (parseInt($('.stats[name=s3]').val()) >= 125) {
m3 += 25;
m1 += 105;
m5 += 45;
m14 += 5;
} else if (parseInt($('.stats[name=s3]').val()) >= 100) {
m3 += 25;
m1 += 105;
m5 += 45;
} else if (parseInt($('.stats[name=s3]').val()) >= 75) {
m3 += 25;
m1 += 35;
m5 += 15;
} else if (parseInt($('.stats[name=s3]').val()) >= 50) {
m3 += 10;
m1 += 35;
m5 += 15;
} else if (parseInt($('.stats[name=s3]').val()) >= 25) {
m3 +=10;
}
if (parseInt($('.stats[name=s4]').val()) >= 125) za += 25;
$('.stats[name=minAtack]').val(minAtack);
$('.stats[name=maxAtack]').val(maxAtack);
$('.stats[name=m1]').val(m1);
$('.stats[name=m2]').val(m2);
$('.stats[name=m3]').val(m3);
$('.stats[name=m4]').val(m4);
$('.stats[name=m5]').val(m5);
$('.stats[name=m7]').val(m7);
$('.stats[name=m10]').val(m10);
$('.stats[name=hpAll]').val(hpAll);
$('.stats[name=mpAll]').val(mpAll);
}
function StatsDown(){
}
// Õàðàêòåðèñòèêè
$('#add_save').live('click', function(){
StatsDown();
result = '';
$('#editorStats #listInputs .stats').each(function(){
if (result != '') result +='|';
result += $(this).attr('name')+'='+$(this).val()+'';
});
$('#statsLoad').val(result);
$('#editorStats').html('');
});
$('#add_attr').live('click', function(){
$('#listInputs .need').append('<tr><td><span style="font-size:11px;" class="'+$('#add_list').val() +'">'+ CharacterInfo[$('#add_list').val()] +':</span></td><td> <input class="stats" value="0" type="text" name="'+ $('#add_list').val() +'"/><input type="button" name="'+$('#add_list').val() +'" class="delete" value="X"><br/></td></tr>');
});
$('#listInputs .delete').live('click', function() {
$(this).parent().parent().remove();
});
$('#editStat').live('click', function() {
if ($('#editorStats').html() != '') {
$('#editorStats').html('');
} else {
var text = '';
$.each(CharacterBased, function( n, row ){
if (row=='zonb') {
text += '<tr><td><span style="font-size:11px;" class="'+row+'">'+CharacterInfo[row] + ':</span></td><td> <select class="stats brown" name="'+row+'"><option value="1">3</option><option value="0">2</option><option value="-1">1</option></select> <input type="button" name="'+row+'" class="delete" value="X"><br/></td></tr>';
} else {
text += '<tr><td><span style="font-size:11px;" class="'+row+'">'+CharacterInfo[row] + ':</span></td><td> <input class="stats brown" value="1" type="text" name="'+row+'"><input type="button" name="'+row+'" class="delete" value="X"><br/></td></tr>';
}
});
var add_list = '';
$.each(CharacterInfo, function( k , v ){
add_list += '<option value="'+k+'">'+v+'</option>';
});
$('#editorStats').html(' <div id="listInputs" ><table class="need" width="400px" valign="top" align="left" border="0" cellspacing="0" cellpadding="0"> '+text + ' </table><table><tr><td colspan="2"><hr></td></tr><tr><td><input type="button" value="Äîáàâèòü" name="add" id="add_attr"></td><td> <select id="add_list">'+add_list+'</select> <br/> </td></tr><tr><td colspan="2"><hr></td></tr><tr><td colspan="2"><input type="button" value="Âíåñòè èçìåíåíèÿ" style="color:brown;" name="add" id="add_save"></td></tr></table></div> ');
text='';
stats = $('#statsLoad').val();
stats = stats.split('|');
stats.sort();
$.each(stats, function( n, row ){
row = row.split('=');
if ( $('input[name='+row[0]+'].stats').val() > 0 || row[0]=='zonb'){
if (row[0]=='zonb') {
$('select[name='+row[0]+'].stats').val(row[1]);
$('select[name='+row[0]+'].stats').removeClass('brown');
} else {
$('input[name='+row[0]+'].stats').val(row[1]);
$('input[name='+row[0]+'].stats').removeClass('brown');
}
} else {
text += '<tr><td><span style="font-size:11px;" class="'+row[0]+'">'+CharacterInfo[row[0]] + ':</span></td><td> <input class="stats" value="' + row[1] + '" type="text" name="'+row[0]+'"><input type="button" name="'+row[0]+'" class="delete" value="X"><br/></td></tr>';
}
});
$('#listInputs .need').append(text);
StatsUp();
}
});
// Äðîï ïðåäìåòîâ
$('#add_saveDrop').live('click', function(){
result = '';
$('#editorDrop #listInputs td').each(function() {
if (result != '') result +='|';
result += $(this).children('input[name=itemsId]').val()+'='+$(this).children('input[name=itemsPerc]').val()+'';
if ($(this).children('input[name=itemsQuest]').val()) result += '='+$(this).children('input[name=itemsQuest]').val()+'';
});
$('#dropLoad').val(result);
$('#editorDrop').html('');
});
$('#editDrop').live('click', function() {
if ($('#editorDrop').html() != '') {
$('#editorDrop').html('');
} else {
var text = '';
drop = $('#dropLoad').val();
drop = drop.split('|');
drop.sort();
$.each(drop, function( n, row ){
row = row.split('='); //
if (row[1] == undefined) row[1] = '';
if (row[2] == undefined) row[2] = '';
if (row[0] !='') {
text += '<tr><td><input class="items" value="' + row[0] + '" type="text" name="itemsId" size="7"> <input size="5" class="itemsPerc" value="' + row[1] + '" type="text" name="itemsPerc"><input class="itemsQuest" size="14" value="' + row[2] + '" type="text" name="itemsQuest"><input type="button" name="delete" class="delete" value="X"> <a target="_blank" href="javascript:void(0);" id="'+ row[0] +'" onclick="loadItemInfo(this);">[load]</a> <br/></td></tr>';
}
});
$('#editorDrop').html(' <div id="listInputs" ><table class="need" width="100%" valign="top" align="left" border="0" cellspacing="0" cellpadding="0"> '+text + ' </table><br/><hr/><input type="button" value="Âíåñòè èçìåíåíèÿ" style="color:brown;" name="add" id="add_saveDrop"> </div> ');
}
});
// Îáìóíäèðîâàíèå
$('#add_saveUseItem').live('click', function(){
result = '';
$('#editorUseItem #listInputs td').each(function() {
if (result != '') result +=',';
result += $(this).children('input[name=itemsId]').val();
});
$('#useItemLoad').val(result);
$('#editorUseItem').html('');
});
$('#add_useitem').live('click', function(){
$('#editorUseItem #listInputs .need').append('<tr><td><input class="items useItem" value="0" type="text" name="itemsId" size="7"> <input type="button" name="delete" class="delete" value="X"> <br/></td></tr>');
});
$('#editUseItem').live('click', function() {
if ($('#editorUseItem').html() != '') {
$('#editorUseItem').html('');
} else {
var text = '';
useItem = $('#useItemLoad').val();
useItem = useItem.split(',');
useItem.sort();
$.each(useItem, function( n, row ){
text += '<tr><td><input class="items useItem" value="' + row + '" type="text" name="itemsId" size="7"> <input type="button" name="delete" class="delete" value="X"> <a href="javascript:void(0);" id="'+ row +'" onclick="loadItemInfo(this);">[load]</a> or <a target="_blank" href="https://lib.new-combats.com/items_info.php?id='+ row +'" id="'+ row +'">[lib]</a> <br/></td></tr>';
});
$('#editorUseItem').html(' <div id="listInputs" ><table class="need" width="100%" valign="top" align="left" border="0" cellspacing="0" cellpadding="0"> '+text + ' </table><hr><input type="button" value="Äîáàâèòü åùå ïðåäìåò" name="add" id="add_useitem"> <br/><hr/><input type="button" value="Âíåñòè èçìåíåíèÿ" style="color:brown;" name="add" id="add_saveUseItem"> </div> ');
}
});
$(document).ready(function(){
});
</script>
</td>
</tr>
<tr>
<td align="right">
</td>
<td align="right">
<div id="testS"></div>
</td>
</tr>
</tbody>
</table>
</form>
<?
}
?>