Вход Регистрация
Файл: kill.php
Строк: 53
<?
// если убили
                    
unset($from["attack"]);
                    if (
$info[2]=='f') {addjournalall($loc,$to["title"]." погибла",$toid);} else {addjournalall($loc,$to["title"]." погиб",$toid);}                    // добавляем труп с вещами в локацию
                    
if ($toid=="npc.cast") {$id "item.stand.castle"; } else {
                    
$id "item.stand.died.".rand(5,9999); }
                    if (
$id =="item.stand.castle") {$item="портал|портал в замок";} else { $item="труп (".$to["title"].")|";}
                        if (
substr($toid,0,5)=='user.'){
                        
$klan_id=1;
                        if ( isset(
$to["klan_i"]) ){
                            
$klan_id split("|",$to["klan_i"]);
                            
$klan_id $klan_id[0]+1;
                        }
                    }
                    if (
substr($toid,0,5)=='user.' && !$to["crim"]) $item.="$klan_id|"; else $item.="0|";
                    
// его предметы
                    
if ($to["items"]) foreach (array_keys($to["items"]) as $i$item.=$i."=".str_replace("|",":",$to["items"][$i]).",";
                                        
//Процент выпадания шмота с монстра
                    
if (isset ($to["bonus"])) {
                    if (
$kills &&
                    
rand(0,100)>$to["bonus"]){ unset ($to["items"]);
                    }
                    }
                    
//именной шмот
                    
if ($kills) foreach (array_keys($to["items"]) as $i) if (strpos($i,".weapon.imen.")) $to["bank"][$i]=$to["items"][$i]; else $item.=$i."=".str_replace("|",":",$to["items"][$i]).",";
                            
// его шкура и т.д.
                    
$osv_t=$to["osvej"];
                    if ( 
substr($fromid,0,9)=='npc.guard' && $to["osvej"]) $osv_t='';
                    
$item.="|".$osv_t;
                    
$game["loc"][$loc][$id]=$item;
                    
// удалить труп через пару минут
                    
$game["loc_del"][$loc][$id]=time()+$time_objects_destroy;
                            
// статус игрока
                    
if (substr($toid,0,5)=='user.') {
                        unset(
$to["equip"]);    // все бросаем
                        
unset($to["items"]);
                        unset(
$to["attack"]);
            
calcparam($toid);    // пересчитаем параметры
                        
$to["ghost"]=1;
          if (!isset(
$to["st"])) $to["st"]="0|0|0|0|0|0|0|0|0|0|0|0";  
          
$st=split("|",$to["st"]);
                    
$st[4]++;
                    
$to["st"]=implode("|",$st);
          
addjournal($toid,"Вы погибли!");
            } else {    
// npc, проверим респавн
                            
if ($to["respawn"]) {
                                unset(
$to["attack"]);
                                unset(
$to["owner"]);
                                unset(
$to["follow"]);
                                unset(
$to["guard"]);
                                unset(
$to["time_owner"]);
                                
$to["life"]=$to["life_max"];
                                
$to["mana"]=$to["mana_max"];
                                
$respawn=split("|",$to["respawn"]);
                                
$game["loc_add"][$respawn[0]][$toid]=array("time"=>time()+rand($respawn[1],$respawn[2]),"item"=>$game["loc"][$loc][$toid]);
                                }
                            
// удаляем npc
                            
unset($game["loc"][$loc][$toid]);
                            }
                    
// экспа и уровень
                    
if (substr($fromid,0,5)=='user.')
                    {
                    
//обновляем статистику            
                    
if (!isset($from["st"])) $from["st"]="0|0|0|0|0|0|0|0|0|0|0|0";  
          
$st=split("|",$from["st"]);
                    if ( 
substr($toid,0,5)=='user.') {$st[0]++;$st[2]++;} else {$st[1]++;$st[3]++;}
                    
$from["st"]=implode("|",$st);

                    if ( 
substr($toid,0,5)!='user.'// || ($to["lag"]!=$from["lag"] && $from["lag"]!=0) )
                        
{
             
//if ( substr($toid,0,5)=='user.' && $towar[13]==5) {$towar[13]=0; addjournal($fromid,"Слишком слабый противник");}

                        
$skills=split("|",$from["skills"]);
                        
$skills[3]+=$towar[13];
                        
addjournal($fromid,"Опыт +".$towar[13]);
                        if (
$skills[3]>=$fromwar[13]*$points_levelup) {$skills[3]-=$fromwar[13]*$points_levelup$skills[4]+=1$from["skills"]=implode("|",$skills); addjournal($fromid,"Вы получили 1 очко опыта!");calcparam($fromid);}
                            else 
$from["skills"]=implode("|",$skills);
                        }
                    }
?>
Онлайн: 0
Реклама