Page 3 of 4

Re: [SHARE] Gracia Raid Boss Map

Posted: Sun Jan 31, 2010 7:41 am
by janiii
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?

Re: [SHARE] Gracia Raid Boss Map

Posted: Sun Jan 31, 2010 1:23 pm
by LaraCroft
index.php

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>
Im not an expert... but...
For me works fine on GE.
:wink:

Re: [SHARE] Gracia Raid Boss Map

Posted: Sun Jan 31, 2010 3:15 pm
by Stake
For calculating position there is another way. :)

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;}
An example for abscissa:

Code: Select all

$this->getPxFromCoord(-131072, 228608, 906, (7/2), $spawnX, true);
Arguments:
$min_coord: minimum coordinate in L2World (above it's -131072).
$max_coord: maximum coordinate in L2World (above it's 228608).
$l_max_coord: width or height of the map's picture (depending on what coord you want to calculate, above it's 906 the width)
$dot_c: width or height of dot's picture above it's 7, so i divided by 2 to calc its middle.
$g_coord: mob's spawn X or Y.
$isRound: true if you want to round the returned number's value, false if not.

Re: [SHARE] Gracia Raid Boss Map

Posted: Wed Feb 03, 2010 12:08 am
by moooo
Download link has a password?

Re: [SHARE] Gracia Raid Boss Map

Posted: Wed Feb 03, 2010 1:31 pm
by nackgr
yes how can we download it?

Re: [SHARE] Gracia Raid Boss Map

Posted: Fri Feb 05, 2010 4:59 pm
by neo25
I've fixed the permission settings for the download on my server. The main link should be working again.

Re: [SHARE] Gracia Raid Boss Map

Posted: Wed Feb 17, 2010 11:40 pm
by CubAfull
my first post :)
ok... thank you for your script but... this code make 2 calls per BOSS and there are many :shock:
so.. if you don't want to kill your MySQL, use this index.php, its realy fast...

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>
This script make only one call to your MySQL and return all the data...

BTW... I change all the images to a new folder "images"

Thank you and sorry for my english :oops:

Re: [SHARE] Gracia Raid Boss Map

Posted: Mon Apr 19, 2010 10:37 am
by quesus
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

Re: [SHARE] Gracia Raid Boss Map

Posted: Mon Apr 19, 2010 10:47 am
by janiii
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
you have to check if the respawn_time is lower than current time. if yes, then boss is spawned.

Re: [SHARE] Gracia Raid Boss Map

Posted: Mon Apr 19, 2010 4:36 pm
by quesus
janiii wrote:
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
you have to check if the respawn_time is lower than current time. if yes, then boss is spawned.
the number (is composed by 13 numbers) is not the same; i tested on two boss

Re: [SHARE] Gracia Raid Boss Map

Posted: Mon Apr 19, 2010 7:57 pm
by janiii
quesus wrote:the number (is composed by 13 numbers) is not the same; i tested on two boss
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()

Code: Select all

if($respawn == "0" || ($respawn/1000 < time()))

Re: [SHARE] Gracia Raid Boss Map

Posted: Tue Apr 20, 2010 7:02 am
by quesus
janiii wrote:
quesus wrote:the number (is composed by 13 numbers) is not the same; i tested on two boss
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()

Code: Select all

if($respawn == "0" || ($respawn/1000 < time()))
Sorry but i'm a beginner and want to learn;

in this way there is a match between respawn time ($respawn/1000) and local time (time()) at the moment that i used the map?

***Edit***: now works, thank's

Re: [SHARE] Gracia Raid Boss Map

Posted: Sun Apr 25, 2010 11:26 am
by surskis
neo25 wrote:
Download - Live Raid Boss Map
Link is dead. Can you reshare it. Thank you.

Sorry for my bad English.

Re: [SHARE] Gracia Raid Boss Map

Posted: Tue May 04, 2010 9:11 pm
by Vader
CubAfull wrote:my first post :)
ok... thank you for your script but... this code make 2 calls per BOSS and there are many :shock:
so.. if you don't want to kill your MySQL, use this index.php, its realy fast...

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>
This script make only one call to your MySQL and return all the data...

BTW... I change all the images to a new folder "images"

Thank you and sorry for my english :oops:
So where do I put this?

Re: [SHARE] Gracia Raid Boss Map

Posted: Sun Jul 25, 2010 5:56 am
by TheClown
link is death, reupload please ^^