Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified locale/de/LC_MESSAGES/quest.mo
Binary file not shown.
176 changes: 94 additions & 82 deletions locale/de/LC_MESSAGES/quest.po

Large diffs are not rendered by default.

Binary file modified locale/fr/LC_MESSAGES/quest.mo
Binary file not shown.
176 changes: 94 additions & 82 deletions locale/fr/LC_MESSAGES/quest.po

Large diffs are not rendered by default.

174 changes: 93 additions & 81 deletions locale/quest.pot

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion mapadroid/db/DbPogoProtoSubmit.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,16 @@ def quest(self, origin: str, quest_proto: dict, mitm_mapper):
reward_type = reward.get("type", None)
item_item = item.get("item", None)
item_amount = item.get("amount", None)
stardust = reward.get("stardust", None)
pokemon_id = encounter.get("pokemon_id", None)

if reward_type == 4:
item_amount = reward.get('candy', {}).get('amount', 0)
pokemon_id = reward.get('candy', {}).get('pokemon_id', 0)
elif reward_type == 12:
item_amount = reward.get('mega_resource', {}).get('amount', 0)
pokemon_id = reward.get('mega_resource', {}).get('pokemon_id', 0)

stardust = reward.get("stardust", None)
form_id = encounter.get("pokemon_display", {}).get("form_value", 0)
costume_id = encounter.get("pokemon_display", {}).get("costume_value", 0)
target = goal.get("target", None)
Expand Down
13 changes: 12 additions & 1 deletion mapadroid/utils/questGen.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ def generate_quest(quest):
pokemon_costume = quest['quest_pokemon_costume_id']
if pokemon_form != '00':
pokemon_asset_bundle = form_mapper(int(pokemon_id), pokemon_form)
elif quest_reward_type == _('Energy'):
item_type = _('Mega Energy')
if quest['quest_pokemon_id'] and int(quest['quest_pokemon_id']) > 0:
pokemon_name = i8ln(pokemonname(str(quest['quest_pokemon_id'])))
pokemon_id = quest['quest_pokemon_id']
else:
pokemon_name = ''
item_amount = quest['quest_item_amount']

if not quest['task']:
quest_task = questtask(
Expand Down Expand Up @@ -83,7 +91,8 @@ def questreward(quest_reward_type):
type = {
2: _("Item"),
3: _("Stardust"),
7: _("Pokemon")
7: _("Pokemon"),
12: _("Energy")
}
return type.get(quest_reward_type, "nothing")

Expand Down Expand Up @@ -178,6 +187,8 @@ def questtask(typeid, condition, target, quest_template):
text = _('Win a level 3 or higher raid')
if re.search(r'"raid_level": \[2, 3, 4, 5\]', condition) is not None:
text = _('Win a level 2 or higher raid')
if re.search(r'"raid_level": \[6\]', condition) is not None:
text = _('Win a Mega raid')
else:
text = _("Battle in {0} Raids")
elif typeid == 10:
Expand Down
17 changes: 10 additions & 7 deletions mapadroid/webhook/webhookworker.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,23 +180,26 @@ def __construct_quest_payload(self, quest):
quest_conditions = json.loads(quest["quest_condition"].replace("'", '"'))
quest_condition = []
quest_rewards = []
a_quest_type = quest["quest_reward_type_raw"]
a_quest_reward_type = quest["quest_reward_type_raw"]
a_quest_reward = {}
quest_rewards.append(a_quest_reward)
a_quest_reward["info"] = {}
a_quest_reward["type"] = a_quest_type
a_quest_reward["type"] = a_quest_reward_type

if a_quest_type == 2:
if a_quest_reward_type == 2:
a_quest_reward["info"]["item_id"] = quest["item_id"]
a_quest_reward["info"]["amount"] = int(quest["item_amount"])
if a_quest_type == 3:
if a_quest_reward_type == 3:
a_quest_reward["info"]["amount"] = int(quest["item_amount"])
if a_quest_type == 7:
if a_quest_reward_type == 7:
a_quest_reward["info"]["pokemon_id"] = int(quest["pokemon_id"])
a_quest_reward["info"]["pokemon_form"] = int(quest["pokemon_form"])
a_quest_reward["info"]["pokemon_costume"] = int(quest.get("pokemon_costume", '0'))
a_quest_reward["info"]["shiny"] = 0
a_quest_reward["info"]["form"] = int(quest["pokemon_form"])
elif a_quest_reward_type == 12:
a_quest_reward["info"]["pokemon_id"] = int(quest["pokemon_id"])
a_quest_reward["info"]["amount"] = int(quest["item_amount"])

for a_quest_condition in quest_conditions:
# Quest condition for special type of pokemon.
Expand Down Expand Up @@ -329,10 +332,10 @@ def __prepare_raid_data(self, raid_data):
raid_payload["form"] = raid["form"]

if raid["is_ex_raid_eligible"] is not None:
raid_payload["is_ex_raid_eligible"] = raid["is_ex_raid_eligible"]
raid_payload["is_ex_raid_eligible"] = raid["is_ex_raid_eligible"] != 0

if raid["is_exclusive"] is not None:
raid_payload["is_exclusive"] = raid["is_exclusive"]
raid_payload["is_exclusive"] = raid["is_exclusive"] != 0

if raid["gender"] is not None:
raid_payload["gender"] = raid["gender"]
Expand Down
48 changes: 39 additions & 9 deletions static/madmin/static/js/madmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,15 @@ new Vue({
quests: 40,
mons: 67
}
}
},
cellUpdateTimeout: 50000
}
},
computed: {
sortedGeofences() {
return Object.values(this.layers.dyn.geofences).sort(function (x, y) {
return x.name.localeCompare(y.name, "en", {sensitivity: "base"});
});
}
},
computed: {
Expand Down Expand Up @@ -341,6 +349,9 @@ new Vue({
clearInterval(cleanupInterval);
}
},
'settings.cellUpdateTimeout': function (newVal) {
this.updateStoredSetting('settings-cellUpdateTimeout', newVal);
},
'settings.routes.coordinateRadius': {
deep: true,
handler: function () {
Expand Down Expand Up @@ -998,33 +1009,42 @@ new Vue({
return;
}

var $this = this;

this.mapGuardedFetch("cellupdates", "get_cells" + urlFilter, function (res) {
const now = Math.round((new Date()).getTime() / 1000);

res.data.forEach(function (cell) {
const id = cell["id"];

var noSkip = true;
var notTooOld = true;
if (this.cellupdates[id]) {
if (this.cellupdates[id]["updated"] === cell["updated"]) {
return;
noSkip = false;
} else {
map.removeLayer(leaflet_data.cellupdates[id]);
delete leaflet_data.cellupdates[id];
}

map.removeLayer(leaflet_data.cellupdates[id]);
delete leaflet_data.cellupdates[id];
}
// 86400
if($this.settings.cellUpdateTimeout > 0 && now - cell.updated > $this.settings.cellUpdateTimeout) {
notTooOld = false;
}

this.cellupdates[id] = cell;
if (noSkip && notTooOld) {
$this.cellupdates[id] = cell;

leaflet_data.cellupdates[id] =
L.polygon(cell["polygon"], {
leaflet_data.cellupdates[id] = L.polygon(cell["polygon"], {
id: id,
pane: layerOrders.cells.pane,
pmIgnore: true
})
.setStyle(this.getCellStyle(now, cell["updated"]))
.bindPopup(this.build_cell_popup, { className: "cellpopup" });

this.mapAddLayer(leaflet_data.cellupdates[id], layerOrders.cells.bringTo);
this.mapAddLayer(leaflet_data.cellupdates[id], layerOrders.cells.bringTo);
}

}, this);
});
Expand Down Expand Up @@ -1228,6 +1248,11 @@ new Vue({
var size = [30, 30]
var anchor = [30, 30]
break;
case 12:
var image = 'https://raw.githubusercontent.com/whitewillem/PogoAssets/resized/icons_large/rewards/reward_mega_energy.png'
var size = [30, 30]
var anchor = [30, 30]
break;
}

var icon = L.icon({
Expand Down Expand Up @@ -1263,6 +1288,10 @@ new Vue({
var rewardtext = quest_pokemon_name;
var size = "150%";
break;
case 12:
var image = 'https://raw.githubusercontent.com/whitewillem/PogoAssets/resized/icons_large/rewards/reward_mega_energy.png'
var rewardtext = `${quest_item_amount} ${quest_item_type} ${quest_pokemon_name}`;
break;
}

return `
Expand Down Expand Up @@ -1916,6 +1945,7 @@ new Vue({
this.settings.routes.coordinateRadius.raids = this.getStoredSetting("settings-coordinateRadius-raids", 490);
this.settings.routes.coordinateRadius.quests = this.getStoredSetting("settings-coordinateRadius-quests", 40);
this.settings.routes.coordinateRadius.mons = this.getStoredSetting("settings-coordinateRadius-mons", 67);
this.settings.cellUpdateTimeout = this.getStoredSetting('settings-cellUpdateTimeout', 0);
for (const index of Object.keys(this.layers.stat)) {
this.layers.stat[index] = this.getStoredSetting("layer-stat-" + index, false);
}
Expand Down
8 changes: 8 additions & 0 deletions static/madmin/templates/quests.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@
case 7:
var rewardtext = monname;
break;
case 12:
var rewardtext = monname + " " + quest_item_name + '<br>Amount: ' + quest_item_amount;
break;
}
return rewardtext;
}
Expand All @@ -123,6 +126,11 @@
var url = `${iconBasePath}/pokemon_icon_${String.prototype.padStart.call(quest_pokemon_id, 3, 0)}_${quest_pokemon_form_id}${costume}.png`;
var image = `<img class="mr-3" src="${url}" width="50">`;
break;
case 12:
var url = 'https://raw.githubusercontent.com/whitewillem/PogoAssets/resized/icons_large/rewards/reward_mega_energy.png'
var image = `<img class="mr-3" src="${url}" width="50">`;
break;

}
return image;
}
Expand Down