web300.php0000644000175000001440000015316212350073242012316 0ustar jonathanusers rpg
=3) echo("style=display:none;");?>> action
"); echo("
inventory
"); echo("
skills
"); echo("
profile
"); echo("
message
"); echo("
logout
"); } break; } case 2:{ echo("
Secret diary
"); break; } case 3:{ echo(3); break; } case 4:{ echo(4); break; } default: echo(""); } ?>
=3) echo("style=width:1000px;");?>> admin page
"); exit(); } switch($_GET[m]) { case 1: { if($_SESSION[id]) { $tm=time(); $online=time()-60; $_SESSION[id]=sql_guard($_SESSION[id]); $query="select * from tb_mem where id='$_SESSION[id]'"; $q=@mysql_fetch_array(mysql_query($query)); if(!$q[id]) { $_SESSION[id]=""; exit("");} @mysql_query("update tb_mem set login='$tm' where id='$_SESSION[id]'"); switch($_GET[m2]) { case 1: // action { echo("
*$q[path]
"); if($q[exp]>=$q[lv]*30) { $lv_n=$q[lv]+1; echo("

level up! $q[lv] -> $lv_n


"); echo(" "); echo(" "); echo(" "); echo("
"); if($_GET[up]==1) @mysql_query("update tb_mem set str=str+3 where id='$_SESSION[id]'"); if($_GET[up]==2) @mysql_query("update tb_mem set dex=dex+3 where id='$_SESSION[id]'"); if($_GET[up]==3) @mysql_query("update tb_mem set lnt=lnt+3 where id='$_SESSION[id]'"); if($_GET[up]==1 || $_GET[up]==2 || $_GET[up]==3) { @mysql_query("update tb_mem set mhp=mhp+25 where id='$_SESSION[id]'"); @mysql_query("update tb_mem set mmp=mmp+25 where id='$_SESSION[id]'"); @mysql_query("update tb_mem set hp=mhp where id='$_SESSION[id]'"); @mysql_query("update tb_mem set mhp=mmp where id='$_SESSION[id]'"); @mysql_query("update tb_mem set exp=0 where id='$_SESSION[id]'"); @mysql_query("update tb_mem set lv=lv+1 where id='$_SESSION[id]'"); echo(""); } exit(); } echo("
"); if($q[path]=="undead_town")echo(""); if($q[path]=="human_town")echo(""); if($q[path]=="hacker_town")echo(""); echo(""); if($q[path]=="undead_town")echo(""); if($q[path]=="human_town")echo(""); if($q[path]=="hacker_town")echo(""); echo("
?
?
"); if($_POST[act]=="Hotel") { $cost=$q[lv]*20; if($cost<=$q[gold]) { $manager_msg="thanks

gold : ".number_format($q[gold])." - ".number_format($cost); @mysql_query("update tb_mem set gold=gold-$cost where id='$_SESSION[id]'"); @mysql_query("update tb_mem set hp=mhp where id='$_SESSION[id]'"); @mysql_query("update tb_mem set mp=mmp where id='$_SESSION[id]'"); } if($cost>$q[gold]) $manager_msg="get out"; echo("
$manager_msg
Hotel manager
"); } if($_POST[act]=="undead_town") { @mysql_query("update tb_mem set path='undead_town' where id='$_SESSION[id]'"); exit(""); } if($_POST[act]=="human_town") { @mysql_query("update tb_mem set path='human_town' where id='$_SESSION[id]'"); exit(""); } if($_POST[act]=="Hunt" || $_POST[act]=="dungeon" || $_GET[att]) { $mon="monster".rand(1,$q[lv]); if($q[lv]>=22) $mon="monster".rand(1,22); $mon_str=($q[lv]*3)+rand(1,$q[lv]); $mon_dex=($q[lv]*3)+rand(1,$q[lv]); $mon_lnt=($q[lv]*3)+rand(1,$q[lv]); $mon_mhp=($q[lv]*20)+rand(1,$q[lv])*5; $mon_hp=$mon_mhp; $mon_mmp=rand(1,$q[lv])*20; $mon_mp=$mon_mmp; if($_POST[act]=="dungeon") { $mon="dragon"; $mon_str=1000; $mon_dex=1000; $mon_lnt=1000; $mon_mhp=100000; $mon_hp=100000; $mon_mmp=100000; $mon_mp=100000; } if($_GET[att]) { $_GET[att]=sql_guard($_GET[att]); $query=@mysql_fetch_array(mysql_query("select * from tb_mem where id='$_GET[att]' and id<>'admin'")); if($query[id]) { if($query[id]==$_SESSION[id]) exit(""); if($query[country]==$q[country]) exit(""); $mon="$query[id]"; $mon_str=$query[str]; $mon_dex=$query[dex]; $mon_lnt=$query[lnt]; $mon_mhp=$query[mhp]; $mon_hp=$query[mhp]; $mon_mmp=$query[mmp]; $mon_mp=$query[mmp]; } if(!$query[id]) exit(""); } echo("
"); echo(""); $turn=1; while(1) { $turn_time=$turn*1000; $turn_skill=$turn*1200; $dem=($q[str]+$q[dex]+$q[lnt])-$mon_dex; if($dem<=0) $dem=1; $mdem=($mon_str+$mon_dex+$mon_lnt)-$q[dex]; if($mdem<=0) $mdem=1; if($q[mp]>=round($q[mmp]/10) && $q[mmp]>=10 && $q[hp]<=$q[mhp]-$q[mmp]/10) { $q[mp]=$q[mp]-round($q[mmp]/10); $q[hp]=$q[hp]+round($q[mmp]/10); } if($q[mp]>=round($q[mmp]/8) && $q[mmp]>=100 && $mdem>=round($q[mmp]/8)) { $q[mp]=$q[mp]-round($q[mmp]/8); $mdem=$mdem-round($q[mmp]/8); } if($q[mp]>=round($q[mmp]/7) && $q[mmp]>=200) { $q[mp]=$q[mp]-round($q[mmp]/7); $mon_hp=$mon_hp-round($q[mmp]/7); $q[hp]=$q[hp]+round($q[mmp]/7); } if($q[mmp]>=500) { $q[str]=$q[str]+round($q[mmp]/20); $q[dex]=$q[dex]+round($q[mmp]/20); $q[lnt]=$q[lnt]+round($q[mmp]/20); $dem=($q[str]+$q[dex]+$q[lnt])-$mon_dex; if($dem<=0) $dem=1; $mdem=($mon_str+$mon_dex+$mon_lnt)-$q[dex]; if($mdem<=0) $mdem=1; } // player if($q[str]>=10 && rand(1,100)<=round(($q[str]/400)*100)) { $dem=$dem+round($q[str]*1.5)-$mon_dex; if($dem<=0) $dem=1; $mon_hp=$mon_hp-$dem; echo(""); } if($q[str]>=20 && rand(1,100)<=round(($q[str]/500)*100)) { $dem=$dem+round($q[str]*2)-$mon_dex; if($dem<=0) $dem=1; $mon_hp=$mon_hp-$dem; echo(""); } if($q[dex]>=20 && rand(1,100)<=round(($q[dex]/500)*100)) { $mdem=0; echo(""); } if($q[dex]>=30 && rand(1,100)<=round(($q[dex]/50)*100)) { $dem=$dem+round($q[dex]*1.5)-$mon_dex; if($dem<=0) $dem=1; $mon_hp=$mon_hp-$dem; echo(""); } if($q[lnt]>=15 && rand(1,100)<=round(($q[lnt]/500)*100)) { $dem=$dem+round($q[lnt]*1.5)-$mon_lnt; if($dem<=0) $dem=1; $mon_hp=$mon_hp-$dem; echo(""); } if($q[lnt]>=20 && rand(1,100)<=round(($q[lnt]/400)*100)) { if($mon_dex>$q[lnt]*3) $mon_dex=$mon_dex-$q[lnt]*3; if($mon_dex<$q[lnt]*3) { $dem=($q[lnt]*3)-$mon_lnt; if($dem<=0) $dem=1; $mon_hp=$mon_hp-$dem; } echo(""); } // monster if($mon_str>=10 && rand(1,100)<=round($mon_str/50)*100) { $mdem=$mdem+round($mon_str*1.5)-$q[dex]; if($mdem<=0) $mdem=1; $q[hp]=$q[hp]-$mdem; echo(""); } $q[hp]=$q[hp]-$mdem; $mon_hp=$mon_hp-$dem; $p_hp_per="width:".($q[hp]/$q[mhp])*100; $p_mp_per="width:".($q[mp]/$q[mmp])*100; $m_hp_per="width:".($mon_hp/$mon_mhp)*100; $m_mp_per="width:".($mon_mp/$mon_mmp)*100; $p_hp_per.="px;"; $p_mp_per.="px;"; $m_hp_per.="px;"; $m_mp_per.="px;"; if($q[hp]<=0) $p_hp_per="display:none;"; if($mon_hp<=0) $m_hp_per="background:black;"; echo(""); echo(""); echo(""); if($mon_hp<=0 || $q[hp]<=0) { @mysql_query("update tb_mem set hp='$q[hp]' where id='$_SESSION[id]'"); @mysql_query("update tb_mem set mp='$q[mp]' where id='$_SESSION[id]'"); if($q[hp]>0 && $mon_hp<=0) { // win $add_exp=$q[lv]*2; $add_gold=rand(1,50)*$q[lv]; echo(""); @mysql_query("update tb_mem set exp=exp+$add_exp where id='$_SESSION[id]'"); @mysql_query("update tb_mem set gold=gold+$add_gold where id='$_SESSION[id]'"); if($_GET[att]) { @mysql_query("update tb_mem set kills=kills+1 where id='$_SESSION[id]'"); @mysql_query("delete from tb_mem where id='$_GET[att]' and id<>'admin'"); @mysql_query("delete from tb_inven where id='$_GET[att]' and id<>'admin'"); } $get_item=rand(1,50); $tm=time(); if($get_item==1 && rand(1,10)==1) { echo("
"); @mysql_query("insert into tb_inven values('$tm','$_SESSION[id]','$_SERVER[REMOTE_ADDR]','randompotion');"); } if($get_item==2) { echo("
"); @mysql_query("insert into tb_inven values('$tm','$_SESSION[id]','$_SERVER[REMOTE_ADDR]','HPpotion');"); } if($get_item==3) { $tm=time(); echo("
"); @mysql_query("insert into tb_inven values('$tm','$_SESSION[id]','$_SERVER[REMOTE_ADDR]','MPpotion');"); } if($get_item==4) { $tm=time(); echo("
"); @mysql_query("insert into tb_inven values('$tm','$_SESSION[id]','$_SERVER[REMOTE_ADDR]','randomexp');"); } if($get_item==5) { $tm=time(); echo("
"); @mysql_query("insert into tb_inven values('$tm','$_SESSION[id]','$_SERVER[REMOTE_ADDR]','randomgold');"); } break; } if($q[hp]<=0) { echo(""); @mysql_query("delete from tb_mem where id='$_SESSION[id]' and id<>'admin'"); @mysql_query("delete from tb_inven where id='$_SESSION[id]' and id<>'admin'"); if($_GET[att]) @mysql_query("update tb_mem set kills=kills+1 where id='$_GET[att]'"); $_SESSION[id]=""; exit(); } } $turn++; } echo("
HUNT

$q[id]
$q[str] $q[dex] $q[lnt]
VS
$mon
$mon_str $mon_dex $mon_lnt
"); } if(!$_POST[act]) { $query=@mysql_query("select id,lv,country from tb_mem where path='$q[path]' and id<>'admin' and login>='$online' and lv>1 order by lv desc"); echo("
Online
"); while($d=@mysql_fetch_array($query)) { echo(" $d[id] Lv:$d[lv]"); if($d[country]!=$q[country]) echo(" Attack"); echo(" "); } echo("
"); } break; } case 2: // inventory { echo("
inventory
"); if($_POST[inven] && strlen($_POST[inven])==32 && $_POST[cmd]=="Send" && $_POST[user]) { $_POST[inven]=sql_guard($_POST[inven]); $_POST[user]=sql_guard($_POST[user]); $query=@mysql_fetch_array(mysql_query("select item,tm from tb_inven where md5(tm)='$_POST[inven]'")); $user=@mysql_fetch_array(mysql_query("select id from tb_mem where id='$_POST[user]'")); if($query[item] && $user[id]) { @mysql_query("update tb_inven set id='$user[id]' where id='$_SESSION[id]' and tm='$query[tm]'"); echo("
Done!
"); } } if($_POST[inven] && strlen($_POST[inven])==32 && $_POST[cmd]=="Use") { $_POST[inven]=sql_guard($_POST[inven]); $query=@mysql_fetch_array(mysql_query("select item,tm from tb_inven where md5(tm)='$_POST[inven]'")); if($query[item]=="HPpotion") { echo("
HP + 10"); @mysql_query("update tb_mem set mhp=mhp+10 where id='$_SESSION[id]'"); } if($query[item]=="MPpotion") { echo("
MP + 10"); exit(); @mysql_query("update tb_mem set mmp=mmp+10 where id='$_SESSION[id]'"); } if($query[item]=="randomexp") { $rnd=rand(1,100); echo("Exp + $rnd"); @mysql_query("update tb_mem set exp=exp+$rnd where id='$_SESSION[id]'"); } if($query[item]=="randomgold") { $rnd=rand(1,1000); echo("
Gold + $rnd"); @mysql_query("update tb_mem set gold=gold+$rnd where id='$_SESSION[id]'"); } if($query[item]=="randompotion") { $rnd=rand(1,10); if($rnd==1){@mysql_query("update tb_mem set str=str+1 where id='$_SESSION[id]'");echo("
str + 1!
");} if($rnd==2){@mysql_query("update tb_mem set dex=dex+1 where id='$_SESSION[id]'");echo("
dex + 1!
");} if($rnd==3){@mysql_query("update tb_mem set lnt=lnt+1 where id='$_SESSION[id]'");echo("
int + 1!
");} if($rnd==4){@mysql_query("update tb_mem set exp=exp+100 where id='$_SESSION[id]'");echo("
exp + 100!
");} if($rnd==5){@mysql_query("update tb_mem set gold=gold+500 where id='$_SESSION[id]'");echo("
gold + 500!
");} if($rnd==6){@mysql_query("update tb_mem set mhp=mhp+100 where id='$_SESSION[id]'");echo("
hp + 100!
");} if($rnd==7){@mysql_query("update tb_mem set mmp=mmp+100 where id='$_SESSION[id]'");echo("
mp + 100!
");} if($rnd==8){@mysql_query("update tb_mem set str=str+2 where id='$_SESSION[id]'");echo("
str + 2!
");} if($rnd==9){@mysql_query("update tb_mem set dex=dex+2 where id='$_SESSION[id]'");echo("
dex + 2!
");} if($rnd==10){@mysql_query("update tb_mem set lnt=lnt+2 where id='$_SESSION[id]'");echo("
int + 2!
");} echo("
"); } if($query[item]) @mysql_query("delete from tb_inven where id='$_SESSION[id]' and tm='$query[tm]' limit 1"); } echo("
"); break; } case 3: // skills { echo("
"); $dem=round($q[str]*1.5); $ch=($q[str]/400)*100; if($ch>100) $ch=100; $color='gray'; if($q[str]>10) $color='white'; echo(""); $dem=round($q[str]*2); $ch=($q[str]/500)*100; if($ch>100) $ch=100; $color='gray'; if($q[str]>20) $color='white'; echo(""); $dem=0; $ch=($q[dex]/500)*100; if($ch>100) $ch=100; $color='gray'; if($q[dex]>20) $color='white'; echo(""); $dem=round($q[dex]*1.5); $ch=($q[dex]/50)*100; if($ch>100) $ch=100; $color='gray'; if($q[dex]>30) $color='white'; echo(""); $dem=round($q[lnt]*1.5); $ch=($q[lnt]/500)*100; if($ch>100) $ch=100; $color='gray'; if($q[lnt]>15) $color='white'; echo(""); $dem=round($q[lnt]*3); $ch=($q[lnt]/400)*100; if($ch>100) $ch=100; $color='gray'; if($q[lnt]>20) $color='white'; echo(""); echo("
Passive
SkillTypeDamageChance
DashPhysics".number_format($dem)."$ch%
Double edgePhysics".number_format($dem)."$ch%
DodgeNoneNone$ch%
Fast attackPhysics".number_format($dem)."$ch%
Magic missileMagic".number_format($dem)."$ch%
Melting armorMagicArmor - ".number_format($dem)."$ch%
"); $eff=round($q[mmp]/10); $color='gray'; if($q[mmp]>10) $color='white'; echo(""); $eff=round($q[mmp]/8); $color='gray'; if($q[mmp]>100) $color='white'; echo(""); $eff=round($q[mmp]/7); $color='gray'; if($q[mmp]>200) $color='white'; echo(""); $eff=round($q[mmp]/20); $color='gray'; if($q[mmp]>500) $color='white'; echo(""); echo("
Active (auto)
SkillTypeEffectMana cost
HealNonehp + $eff$eff
Mana ShieldNoneShield + $eff$eff
VampirePureHP + $eff
Damage $eff
$eff
RealizeNoneAll stat + $effNone
"); break; } case 4: // profile { $exp_n=$q[lv]*30; $exp=($q[exp]/$exp_n)*100; $exp_n=number_format($exp_n); $exp=number_format($exp); $gold=number_format($q[gold]); $hp=number_format($q[hp]); $mhp=number_format($q[mhp]); $mp=number_format($q[mp]); $mmp=number_format($q[mmp]); $str=number_format($q[str]); $dex=number_format($q[dex]); $lnt=number_format($q[lnt]); echo("
$_SESSION[id] - $q[country]

Lv: $q[lv]
Exp: $exp% ($q[exp]/".$exp_n.")
Gold: ".number_format($q[gold])."


"); break; } case 5: // message { echo("
Message

"); if($_POST[id] && $_POST[msg]) { if(eregi("admin",$_POST[id])) exit("Access Denied"); $tm=time(); $_POST[id]=sql_guard($_POST[id]); $_POST[msg]=sql_guard($_POST[msg]); $query=@mysql_fetch_array(mysql_query("select id from tb_mem where id='$_POST[id]'")); if($query[id]) { @mysql_query("insert into tb_msg values('$tm','$_SESSION[id]','$query[id]','$_POST[msg]')"); exit("Done!
"); } } $query=@mysql_query("select * from tb_msg where id='$_SESSION[id]' and id<>'admin' order by tm desc limit 0,5"); while($d=@mysql_fetch_array($query)) { $tm=date('H:i:s',$d[tm]); $d[msg]=htmlspecialchars($d[msg]); echo("[$tm]<$d[wid]> $d[msg]
"); } echo("
ID
"); break; } case 6: { if($_POST[cmd]=="Logout") { $_SESSION[id]=""; echo("
bye~~
"); echo(""); exit(); } echo("
"); echo("
"); break; } } } if(!$_SESSION[id]) { if($_GET[a]=="l" && $_POST[id] && $_POST[pw]) { $_POST[id]=sql_guard($_POST[id]); $_POST[pw]=md5($_POST[pw]); $q=@mysql_fetch_array(mysql_query("select id from tb_mem where id='$_POST[id]' and pw='$_POST[pw]'")); if($q[id]) { $_SESSION[id]="$q[id]"; exit(""); } } if($_GET[a]=="s" && $_POST[country] && $_POST[id] && $_POST[pw]) { if(eregi("admin",$_POST[id])) exit("

access denied

"); $_POST[country]=sql_guard($_POST[country]); $_POST[id]=sql_guard($_POST[id]); $_POST[id]=trim($_POST[id]); $_POST[id]=str_replace(" ","",$_POST[id]); $_POST[pw]=md5($_POST[pw]); for($i=0;$ian account already exists

"); if(!$q[id]) { if($_POST[country]=="human") $country="human_town"; if($_POST[country]=="undead") $country="undead_town"; if(!$country) {$country="hacker_town"; $_POST[country]="hacker"; } $tm=time(); $str=rand(10,20); $dex=rand(10,20); $lnt=rand(10,20); @mysql_query("insert into tb_mem values('$_POST[id]','$_POST[pw]','$_SERVER[REMOTE_ADDR]',10,10,10,10,'$str','$dex','$lnt',1,0,0,0,'$country',0,'$_POST[country]','$tm')"); echo('Done!'); echo(""); exit(); } } echo("
Login

ID PW
"); echo("
Account Sign up

Country
ID PW
Hint : index.phps
"); } break; } case 2: { if($_SESSION[id]) { if($_GET[m2]==1) { echo("
Secret diary

"); if($_POST[msg]) { $tm=time(); $_POST[msg]=sql_guard($_POST[msg]); @mysql_query("insert into tb_board values('$tm','$_SESSION[id]','$_POST[msg]','$_SERVER[REMOTE_ADDR]');"); } $q=@mysql_query("select * from tb_board where ip='$_SERVER[REMOTE_ADDR]' order by tm desc limit 0,7"); while($d=@mysql_fetch_array($q)) { $tm=date('m-d H:i:s',$d[tm]); $memo=substr($d[memo],0,50); echo("

[$tm]<$d[id]>$memo

"); } echo("
"); } } break; } case 3: { echo("
Rank

"); $query=@mysql_query("select * from tb_mem order by lv desc limit 0,5"); $rank=1; while($d=@mysql_fetch_array($query)) { if($d[id]=="admin") $d[path]="****"; if(eregi("'|\"",$d[id])) $d[id]="****"; $stat=number_format($d[str]+$d[dex]+$d[lnt]); echo(""); $rank++; } echo("
rankcountryidlvstatpath
$rank$d[country]$d[id]$d[lv]$stat$d[path]
"); break; } case 4: { echo("
First name

Last name

E-mail address

Message

"); break; } } ?>