Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. Pokemon.get_perfect = (radio, filtros,lat,lng,iv) => {
  2.  
  3. var queryfiltros = "";
  4. var queryiv = "";
  5.  
  6. iv = 100;
  7. var filtroiv = 0;
  8. if (iv === undefined)
  9. {
  10. // No se filtra por IV
  11. }
  12. else
  13. {
  14. if(iv === 0){
  15. // No se filtra por IV
  16. }
  17. else
  18. {
  19. var calciv = iv * 45 / 100;
  20. queryiv = ' WHERE ((individual_attack + individual_defense + individual_stamina) >= ' + calciv + ' OR pokemon_id = 201)';
  21. }
  22. }
  23.  
  24. const query = 'SELECT weather_boosted_condition,individual_attack,move_1,move_2,individual_defense,individual_stamina,longitude,latitude,pokemon_id, disappear_time,cp,cp_multiplier FROM ' + tablename + ' ' + queryiv + ' AND disappear_time > UTC_TIMESTAMP();';
  25. const params ="";
  26.  
  27. // Return promise.
  28. return preparePokemonPromise(query, params);
  29. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement