Você está na página 1de 2

PokemonGoMITM = require '.

/lib/pokemon-go-mitm'
server = new PokemonGoMITM port: 8081

coughtIDs = []
server.addResponseHandler "CatchPokemon", (data) ->
if "status" of data
if data.status == "CATCH_SUCCESS"
coughtIDs.push data.captured_pokemon_id
data.capture_award.activity_type[1] = "ACTIVITY_POKEDEX_ENTRY_NEW"
data.capture_award.xp[1] = 500
data.capture_award.candy[1] = 0
data.capture_award.stardust[1] = 0
console.log("dataflata")
console.log(JSON.stringify(data,null,4))
data
server.addResponseHandler "GetInventory", (data) ->
if "success" of data
if data.success
for item in data.inventory_delta.inventory_items
if "pokemon_data" of item.inventory_item_data
if item.inventory_item_data.pokemon_data.id in coughtIDs
item.inventory_item_data.pokemon_data.pokemon_id = "MEWTWO"
item.inventory_item_data.pokemon_data.cp =
Math.floor(Math.random() *(1000)+3000)
item.inventory_item_data.pokemon_data.stamina = 221
item.inventory_item_data.pokemon_data.stamina_max = 221
item.inventory_item_data.pokemon_data.weight_kg = 122.28
item.inventory_item_data.pokemon_data.height_m = 2.07
item.inventory_item_data.pokemon_data.move_1 = "PSYCHIC"
item.inventory_item_data.pokemon_data.move_2 = "PSYSTRIKE"
item.inventory_item_data.pokemon_data.individual_attack =
30
item.inventory_item_data.pokemon_data.individual_defense =
20
item.inventory_item_data.pokemon_data.individual_stamina =
15
if "pokedex_entry" of item.inventory_item_data
item.inventory_item_data.pokedex_entry.times_encountered = 1
item.inventory_item_data.pokedex_entry.times_captured = 1
item.inventory_item_data.pokedex_entry.pokemon_id = "MEWTWO"
if "candy" of item.inventory_item_data
item.inventory_item_data.candy.family_id = "FAMILY_MEWTWO"
item.inventory_item_data.candy.candy = 3
data

server.addResponseHandler "GetMapObjects", (data) ->


if "map_cells" of data
cal = new Date()
now = cal.getTime()
for cell in data.map_cells
for mon in cell.catchable_pokemons
mon.pokemon_id = "MEWTWO"

for mon in cell.wild_pokemons


mon.pokemon_data.pokemon_id = "MEWTWO"
data
server.addResponseHandler "Encounter", (data) ->
if "status" of data
if data.status == "ENCOUNTER_SUCCESS"
data.wild_pokemon.pokemon_data.pokemon_id = "MEWTWO"
data.wild_pokemon.pokemon_data.cp = 8000
data.wild_pokemon.pokemon_data.weight_kg = 122
data.wild_pokemon.pokemon_data.height_m = 2
data.capture_probability.capture_probability['0'] = 0.0
data.capture_probability.capture_probability['1'] = 0.0
data.capture_probability.capture_probability['2'] = 0.1

data

ignore = ['GetInventory', 'GetMapObjects', 'CatchPokemon', 'Encounter']

server.addRequestHandler "*", (data, action) ->


console.log "[<-] Request for #{action} ", data, "\n" unless not
(action in ignore)
data

server.addResponseHandler "*", (data, action) ->


console.log "[->] Response for #{action} ", JSON.stringify(data, null,
4), "\n" unless not (action in ignore)
data

Você também pode gostar