Re: [SHARE] Gracia Raid Boss Map
Posted: Sun Jan 31, 2010 7:41 am
what does not work exactly? do you some sql query error? tried the script from LaraCroft?TheClown wrote:mm test but dont work in epilogue
what does not work exactly? do you some sql query error? tried the script from LaraCroft?TheClown wrote:mm test but dont work in epilogue
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Live Raid Boss Map</title></head><body><?phpset_time_limit(0);require"connection.php";echo "<div style=position:absolute;top:0px;left:0px><img src=kamael.jpg></div>";//Raid Boss data$query_raidbosses=mysql_query("SELECT boss_id,loc_x,loc_y,respawn_time FROM raidboss_spawnlist");$online= mysql_num_rows($query_raidbosses);while ($res=mysql_fetch_array($query_raidbosses)) { $id=$res['boss_id']; $valx=$res['loc_x']; $valy=$res['loc_y']; $respawn=$res['respawn_time']; $boss_name=mysql_query("SELECT name FROM npc WHERE id='$id'"); $name = mysql_fetch_row( $boss_name ); $boss_level=mysql_query("SELECT level FROM npc WHERE id='$id'"); $level = mysql_fetch_row( $boss_level ); if($respawn > 0) { $respawntime = date('D M j G:ia T',($respawn / 1000)); $respawn_time = 'will respawn '.$respawntime.''; } $x=116+($valx+107823)/200; $y=2580+($valy-255420 )/200; if($respawn == "0") echo "<div style=\"position:absolute;top:".$y."px;left:".$x."px\"><img src=up.png title=\"Level $level[0] $name[0] is Alive!\"></div><center>";else echo "<div style=\"position:absolute;top:".$y."px;left:".$x."px\"><img src=down.png title=\"Level $level[0] $name[0] ".$respawn_time."\"></div><center>";}//Grand boss data$query_grandbosses=mysql_query("SELECT boss_id,loc_x,loc_y,respawn_time FROM grandboss_data");$grandonline= mysql_num_rows($query_grandbosses);while ($grandres=mysql_fetch_array($query_grandbosses)) { $grandid=$grandres['boss_id']; $grandvalx=$grandres['loc_x']; $grandvaly=$grandres['loc_y']; $grandrespawn=$grandres['respawn_time']; $grandboss_name=mysql_query("SELECT name FROM npc WHERE id='$grandid'"); $grandname = mysql_fetch_row( $grandboss_name ); $grandboss_level=mysql_query("SELECT level FROM npc WHERE id='$grandid'"); $grandlevel = mysql_fetch_row( $grandboss_level ); if($grandrespawn > 0) { $grandrespawntime = date('d/m/Y H:ia T',($grandrespawn / 1000)); $grandrespawn_time = 'respawn em '.$grandrespawntime.''; } $grandx=116+($grandvalx+107823)/200; $grandy=2580+($grandvaly-255420 )/200; // Boss data$databoss= date('Y,m,d,H,i,s',($grandrespawn / 1000));// data$data= date("Y,m,d,H,i,s"); if($databoss <= $data) echo "<div style=\"position:absolute;top:".$grandy."px;left:".$grandx."px\"><img src=up2.png title=\"Level $grandlevel[0] $grandname[0] is Alive!\"></div><center>";else echo "<div style=\"position:absolute;top:".$grandy."px;left:".$grandx."px\"><img src=down2.png title=\"Level $grandlevel[0] $grandname[0] ".$grandrespawn_time."\"></div><center>";}mysql_close();?></body></html>
Code: Select all
public function getPxFromCoord($min_coord, $max_coord, $l_max_coord, $dot_c, $g_coord, $isRound){ if($max_coord < $min_coord){$max_coord = $min_coord;} if($min_coord < 0){$min_coord *= -1;} if($max_coord < 0){$max_coord *= -1;} $r_val = (($l_max_coord - $dot_c) / ($min_coord + $max_coord)) * ($g_coord + $min_coord); if($isRound) return round($r_val); else return $r_val;}
Code: Select all
$this->getPxFromCoord(-131072, 228608, 906, (7/2), $spawnX, true);
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Raid Boss Status</title></head><body><?phprequire"connection.php"; $query_raidbosses=mysql_query("SELECT raidboss_spawnlist.loc_x, raidboss_spawnlist.loc_y, raidboss_spawnlist.respawn_time, npc.name, npc.levelFROM raidboss_spawnlist, npcWHERE raidboss_spawnlist.boss_id=npc.id"); echo "<div style=position:absolute;top:0px;left:0px><img src=images/kamael.jpg></div>";while ($res=mysql_fetch_array($query_raidbosses)) { $valx=$res['loc_x']; $valy=$res['loc_y']; $respawn=$res['respawn_time']; $name = $res['name']; $level = $res['level']; if($respawn > 0) { $respawntime = date('D M j G:ia T',($respawn / 1000)); $respawn_time = 'will respawn '.$respawntime.''; } $x=116+($valx+107823)/200; $y=2580+($valy-255420 )/200; if($respawn == "0") echo "<div style=\"position:absolute;top:".$y."px;left:".$x."px\"><img src=images/up.png title=\"Level $level $name is Alive!\"></div><center>";else echo "<div style=\"position:absolute;top:".$y."px;left:".$x."px\"><img src=images/down.png title=\"Level $level $name ".$respawn_time."\"></div><center>"; } mysql_close();?></body></html>
you have to check if the respawn_time is lower than current time. if yes, then boss is spawned.quesus wrote:Hi to all community,
when the boss respawn, the respawn time is not 0 but a long number and remain that until you kill another mob so the mobs dot is always red.
How fix that?
I'm working on Epilouge.
Sorry for my english
the number (is composed by 13 numbers) is not the same; i tested on two bossjaniii wrote:you have to check if the respawn_time is lower than current time. if yes, then boss is spawned.quesus wrote:Hi to all community,
when the boss respawn, the respawn time is not 0 but a long number and remain that until you kill another mob so the mobs dot is always red.
How fix that?
I'm working on Epilouge.
Sorry for my english
the respawn_time is the unix time from 1970 in miliseconds. the rb is spawned if respawn_time is 0 OR if respawn_time/1000 < time()quesus wrote:the number (is composed by 13 numbers) is not the same; i tested on two boss
Code: Select all
if($respawn == "0" || ($respawn/1000 < time()))
Sorry but i'm a beginner and want to learn;janiii wrote:the respawn_time is the unix time from 1970 in miliseconds. the rb is spawned if respawn_time is 0 OR if respawn_time/1000 < time()quesus wrote:the number (is composed by 13 numbers) is not the same; i tested on two boss
Code: Select all
if($respawn == "0" || ($respawn/1000 < time()))
Link is dead. Can you reshare it. Thank you.neo25 wrote:
Download - Live Raid Boss Map
So where do I put this?CubAfull wrote:my first post![]()
ok... thank you for your script but... this code make 2 calls per BOSS and there are many![]()
so.. if you don't want to kill your MySQL, use this index.php, its realy fast...
This script make only one call to your MySQL and return all the data...Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Raid Boss Status</title></head><body><?phprequire"connection.php"; $query_raidbosses=mysql_query("SELECT raidboss_spawnlist.loc_x, raidboss_spawnlist.loc_y, raidboss_spawnlist.respawn_time, npc.name, npc.levelFROM raidboss_spawnlist, npcWHERE raidboss_spawnlist.boss_id=npc.id"); echo "<div style=position:absolute;top:0px;left:0px><img src=images/kamael.jpg></div>";while ($res=mysql_fetch_array($query_raidbosses)) { $valx=$res['loc_x']; $valy=$res['loc_y']; $respawn=$res['respawn_time']; $name = $res['name']; $level = $res['level']; if($respawn > 0) { $respawntime = date('D M j G:ia T',($respawn / 1000)); $respawn_time = 'will respawn '.$respawntime.''; } $x=116+($valx+107823)/200; $y=2580+($valy-255420 )/200; if($respawn == "0") echo "<div style=\"position:absolute;top:".$y."px;left:".$x."px\"><img src=images/up.png title=\"Level $level $name is Alive!\"></div><center>";else echo "<div style=\"position:absolute;top:".$y."px;left:".$x."px\"><img src=images/down.png title=\"Level $level $name ".$respawn_time."\"></div><center>"; } mysql_close();?></body></html>
BTW... I change all the images to a new folder "images"
Thank you and sorry for my english