forked from pokepark/PokemonRaidBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_pokemon_form_name.php
36 lines (32 loc) · 1004 Bytes
/
get_pokemon_form_name.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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:');
$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;
}
?>