[RELEASE]PHP Drop Finder, who diplay Map Name ect

07/08/2015 15:16 Trayne01#1
Hello E*PvP,
I finished my PHP Script, this script allow your players to find every mobs who drop the item that they are looking for. I think some screenshoots are better than a long text, so:

In first you have to enter the item name:
[Only registered and activated users can see links. Click Here To Register...]

And, the script will display the mobs list, and the maps where the monsters are:
[Only registered and activated users can see links. Click Here To Register...]

You can test this script here: [Only registered and activated users can see links. Click Here To Register...]
But pls note that our database is still in french, we will make an english one soon, so u have to enter french item name (exemple: "Poudre Alchimique Mgique" or "Epée d'argent"), it will too display french mobs


So, how to install?

First, you have to run the SQL server script in the archive (download bellow)

If you use french Sdata, and so a french databse (french or other languages that often use ''s), i recommand u to uncoment this part:
PHP Code:
--'Uncomment this bellow if you get problems with '' 's
UPDATE PS_GameDefs
.dbo.Items
SET ItemName 
REPLACE(ItemName'''''_')

UPDATE PS_GameDefs.dbo.Skills
SET SkillName 
REPLACE(SkillName'''''_')

UPDATE PS_GameDefs.dbo.Mobs
SET MobName 
REPLACE(MobName'''''_')

UPDATE PS_GameDefs.dbo.ProductList
SET ProductName 
REPLACE(ProductName'''''_'
These quotes can cause some problems on ur logs

The episo 6 map ids are 102 103 104, you can change it if you want, it's at the end of the sql file, but don't forget to edit the dbo.MapNames table too ;)

So, next, simply put both php file in your web server

don't dorget to edit the db file:

PHP Code:
$host='151.80.XXX.XXX';  // <-- IP Adresse of the server where your DB is hosted
$user='Shaiya'// <-- Your DB UserName
$pass='Shaiya123'// <-- Your DB Password 
Credits/thanks to:

Changelog:
-- v1
* Initial Release

-- v2
* Adding Armor and Wepeon support
* Now displaying Map Name

-- v3 (work under progress, thanks to [Only registered and activated users can see links. Click Here To Register...])
* Fixed security issues
* Better search engine
I'm open for any suggestions

DOWNLOAD: (V2)
07/09/2015 04:05 GM.Triest#2
Thank you for this release!
I edited the code a little bit so that it shows the HP, Mob Level, Mob Ele and it shows the drops in order by drop rate.


Code:
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>Drop Finder</title>
	</head>
	<body>
	<center>
<?
function str_replace_assoc(array $replace, $subject) { 
   return str_replace(array_keys($replace), array_values($replace), $subject);    
} 
header('Content-Type: text/html; charset=UTF-8');

include ('db.php');
//include	('query.php');
Echo ('Return to <a href="form.php">form</a><br/><br/>');
//Par Marc Faussurier, Copie interdite
if (isset($_POST['Var1']))://Champs obligatoires
 {
	$DisplayItemName=$_POST['Var1'];
		$replace = array( 
			"'" => "_",
			"é" => "e",
			"è" => "e",
			"ê" => "e",
			"î" => "i",
			//"ï" => "i",
			"à" => "a",
			"û" => "u",
			"ô" => "o"
			); 
	//$newstr = utf8_encode(str_replace_assoc($replace,$_POST['Var1']));
	$newstr = str_replace_assoc($replace,$_POST['Var1']);

	$ItemName=$newstr; //On déclare les variables et on double les appostrophe pour éviter les confilts SQL Srv

	
	$CheckItemNumber="SELECT Grade from dbo.Items WHERE ItemName like '$ItemName'";
	$retour=odbc_exec($conn,$CheckItemNumber);
		if (odbc_num_rows($retour)==0)
			{
				echo ("The desired item ($newstr or $ItemName) is not present in our databases, please check the spelling and try again");
			}
		else 
		{
		$MobID="USE PS_GameDefs
		SELECT dbo.Mobs.MobID, dbo.Mobs.MobName, dbo.Mobs.HP, dbo.Mobs.Level, dbo.Mobs.Attrib, dbo.MobItems.DropRate, dbo.MobItems.ItemOrder, dbo.MapNames.MapName
			FROM dbo.MobItems 
			INNER JOIN Mobs ON dbo.Mobs.MobID = dbo.MobItems.MobID 
				  JOIN MapNames ON dbo.Mobs.MapID = dbo.MapNames.MapID
		WHERE Grade = (SELECT TOP 1 Grade FROM PS_GameDefs.dbo.Items WHERE ItemName like '$ItemName') ORDER BY dbo.MobItems.DropRate DESC";
		$ele = array(0 => 'None', 1 => 'Fire', 2=> 'Water', 3=> 'Earth', 4=> 'Wind');
		//La requête SQL qui va trouver les drop et assosier les ID des monstres à leurs noms
		$res12=odbc_exec($conn,$MobID);//On lance la requête


		//while( $row = odbc_fetch_array($res12) ) { 
		//	print_r($row); 
			//print_r('<br/>');
			
		if (odbc_num_rows($res12)!=0)
		{
			echo "<center>List of Monster: $DisplayItemName
				  <table cellspacing=1 cellpadding=2 border=1 style=\"border-style:hidden;\">
				  <tr>
				  <th>Name Monster</th>
				  <th>Mob HP</th>
				  <th>Mob Level</th>
				  <th>Mob Ele</th>
				  <th>Drop Percentage Rate</th>
				  <th>Map Name</th>
				  </tr>";
		  if (odbc_num_rows($res12)>0)
		  {
			odbc_fetch_array($res12);
					
					echo "<tr>";
					echo "<td>";				
					echo utf8_encode($row['MobName']);//On encode en utf-8 le résultat au format donné par SQL Server
					echo "</td>";
					echo "<td>";
					echo $nombre_format_francais = number_format($row['HP'], 2, '.', ',');
					echo "</td>";
					echo "<td>";
					echo ($row['Level']);
					echo "</td>";
					echo "<td>";
					echo ($ele[$row['Attrib']]);
					echo "</td>";
					echo "<td>";
					$DropRate=$row['DropRate'];
						if ($row['ItemOrder'] > 4)//On vérifie si l'ItemOrder est plus grand que 4
						{
							$DropRate=($DropRate/100000);//Car si il est plus, grand, c'est plus en pourcentage mais en millions qu'on exprime le resultat, on le converti donc.
						}
						if ($DropRate > 100)
						{
							$DropRate=100;
						}
					echo (($DropRate)." %");
					echo "</td>";
					echo "<td>";
					echo ($row['MapName']);
					echo "</td>";
					echo "</tr>";
				
			echo "</table></center>";  
		  }
		  else {
			  
		  
			while($row = odbc_fetch_array($res12))
				{	
					echo "<tr>";
					echo "<td><center>";				
					echo utf8_encode($row['MobName']);//On encode en utf-8 le résultat au format donné par SQL Server
					echo "</center></td>";
					echo "<td><center>";
					echo $nombre_format_francais = number_format($row['HP'], 2, '.', ',');
					echo "</center></td>";
					echo "<td><center>";
					echo ($row['Level']);
					echo "</center></td>";
					echo "<td>";
					echo ($ele[$row['Attrib']]);
					echo "</td>";
					echo "<td><center>";
					$DropRate=$row['DropRate'];
						if ($row['ItemOrder'] > 4)//On vérifie si l'ItemOrder est plus grand que 4
						{
							$DropRate=($DropRate/100000);//Car si il est plus, grand, c'est plus en pourcentage mais en millions qu'on exprime le resultat, on le converti donc.
						}
						if ($DropRate > 100)
						{
							$DropRate=100;
						}
					echo (($DropRate)." %");
					echo "</center></td>";
					echo "<td><center>";
					echo ($row['MapName']);
					echo "</center></td>";
					echo "</tr>";
				}
			echo "</table></center>";
			}
		}
		else	
		{
			$var1=$_POST['Var1'];
			echo("There's currently no mobs/bosses droping '$var1'.");
		}
		
		
		//} 
		}
 }

 

Elseif($_POST['Var1']==0): //Champs obligatoires non remplis
 {
	echo("Thank you for filling in the required fields.");
 }
endif;
?>
	<center>
	</body>
</html>
07/09/2015 11:57 Trayne01#3
Relly nice
[Only registered and activated users can see links. Click Here To Register...]
but you just missed to close quotes:
PHP Code:
Echo ('Return to <a href="form.php">form</a><br/><br); 
So we have
PHP Code:
Echo ('Return to <a href="form.php">form</a><br/><br'); 
Otherwise, thanks ! It should be helpfull
07/09/2015 15:20 SkuulCandy#4
Good job Trayne, but i has change/edit the ' missing ;)
05/31/2016 22:47 white95260#5
The desired object is not present in our databases, thank you to check the spelling and try again, why ?

Problem ODBC... Help me
06/09/2016 23:56 ruggix#6
i have a problem
[Only registered and activated users can see links. Click Here To Register...]
why??
06/10/2016 09:28 Garrett_Thief#7
Quote:
Originally Posted by ruggix View Post
i have a problem
[Only registered and activated users can see links. Click Here To Register...]
why??
Open you php.ini and find this:

short_open_tag = Off change on On, and restart you Web server.
06/19/2016 15:02 krysys08#8
i can use this to find item drop rate for europe server?i think no but anyone can extract from client item list drop from official shaiya europe ep 7?because i need to see the drop rate of items... i don't know if its possible....
06/22/2016 05:48 [GM]Zeroo#9
Quote:
Originally Posted by krysys08 View Post
i can use this to find item drop rate for europe server?i think no but anyone can extract from client item list drop from official shaiya europe ep 7?because i need to see the drop rate of items... i don't know if its possible....
This displays what is on database, unless you setup a local server with the same files of it.
06/24/2016 18:57 krysys08#10
ah ok thanks i need something like this but for official server so its not possible...
09/13/2017 19:09 RebirthEpic#11
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\dropfinderUS\proc.php:9) in C:\xampp\htdocs\dropfinderUS\proc.php on line 13

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\dropfinderUS\proc.php:9) in C:\xampp\htdocs\dropfinderUS\db.php on line 9
Return to form


Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.Items'., SQL state S0002 in SQLExecDirect in C:\xampp\htdocs\dropfinderUS\proc.php on line 40

Warning: odbc_num_rows(): supplied argument is not a valid ODBC result resource in C:\xampp\htdocs\dropfinderUS\proc.php on line 41
The desired object (Apple ou Apple) is not present in our databases, thank you to check the spelling and try again
09/14/2017 07:40 Trayne01#12
Quote:
Originally Posted by RebirthEpic View Post
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\dropfinderUS\proc.php:9) in C:\xampp\htdocs\dropfinderUS\proc.php on line 13

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\dropfinderUS\proc.php:9) in C:\xampp\htdocs\dropfinderUS\db.php on line 9
Return to form


Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.Items'., SQL state S0002 in SQLExecDirect in C:\xampp\htdocs\dropfinderUS\proc.php on line 40

Warning: odbc_num_rows(): supplied argument is not a valid ODBC result resource in C:\xampp\htdocs\dropfinderUS\proc.php on line 41
The desired object (Apple ou Apple) is not present in our databases, thank you to check the spelling and try again

Put '@' before session_start or idk on line 13. Try to replace dbo.Items by PS_GameDefs.dbo.Items

If you still have issues , you should take the updated DrpFinder from here : [Only registered and activated users can see links. Click Here To Register...]