forked from pokepark/PokemonRaidBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ae9ca2
commit 42ec093
Showing
2 changed files
with
37 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
<?php | ||
/** | ||
* Get pokemon form name. | ||
* @param $pokedex_id | ||
* @param $pokemon_form_id | ||
* @return string | ||
*/ | ||
function get_pokemon_form_name($pokedex_id, $pokemon_form_id) | ||
{ | ||
debug_log($pokedex_id.'-'.$pokemon_form_id, 'Finding Pokemon form name for:'); | ||
|
||
// Make sure $dex_id is numeric | ||
if(is_numeric($pokedex_id) && is_numeric($pokemon_form_id)) { | ||
// Get raid level from database | ||
$rs = my_query( | ||
" | ||
SELECT pokemon_form_name | ||
FROM pokemon | ||
WHERE pokedex_id = {$pokedex_id} | ||
AND pokemon_form_id = '{$pokemon_form_id}' | ||
" | ||
); | ||
|
||
while ($level = $rs->fetch()) { | ||
$pokemon_form_name = $level['pokemon_form_name']; | ||
} | ||
debug_log($pokemon_form_name, 'Per db, level is:'); | ||
} else { | ||
debug_log('Faulty dex_id or form_id, defaulting to normal.'); | ||
$pokemon_form_name = 'normal'; | ||
} | ||
|
||
return $pokemon_form_name; | ||
} | ||
?> | ||
<?php | ||
/** | ||
* Get pokemon form name. | ||
* @param $pokedex_id | ||
* @param $pokemon_form_id | ||
* @return string | ||
*/ | ||
function get_pokemon_form_name($pokedex_id, $pokemon_form_id) | ||
{ | ||
debug_log($pokedex_id.'-'.$pokemon_form_id, 'Finding Pokemon form name for:'); | ||
|
||
$pokemon_form_name = 'normal'; | ||
// Make sure $dex_id is numeric | ||
if(is_numeric($pokedex_id) && is_numeric($pokemon_form_id)) { | ||
// Get raid level from database | ||
$rs = my_query( | ||
" | ||
SELECT pokemon_form_name | ||
FROM pokemon | ||
WHERE pokedex_id = {$pokedex_id} | ||
AND pokemon_form_id = '{$pokemon_form_id}' | ||
LIMIT 1 | ||
" | ||
); | ||
|
||
$level = $rs->fetch(); | ||
$pokemon_form_name = $level['pokemon_form_name']; | ||
|
||
debug_log($pokemon_form_name, 'Per db, level is:'); | ||
} else { | ||
debug_log('Faulty dex_id or form_id, defaulting to normal.'); | ||
} | ||
|
||
return $pokemon_form_name; | ||
} | ||
?> |