db: update from upstream 1.08, apply patches
This commit is contained in:
40
db/apply_quest_delta.py
Executable file
40
db/apply_quest_delta.py
Executable file
@@ -0,0 +1,40 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os.path
|
||||||
|
import codecs
|
||||||
|
import csv
|
||||||
|
|
||||||
|
import _pathfix
|
||||||
|
|
||||||
|
from mhapi.db import MHDB
|
||||||
|
|
||||||
|
|
||||||
|
def apply_update(db, row):
|
||||||
|
quest = db.get_quest(row["id"])
|
||||||
|
if quest.goal == row["goal"]:
|
||||||
|
print "quest", row["id"], row["name"], "already updated, skipping"
|
||||||
|
return
|
||||||
|
cur = db.cursor()
|
||||||
|
cur.execute("""UPDATE quests SET
|
||||||
|
goal=?
|
||||||
|
WHERE _id=?
|
||||||
|
AND name=?""",
|
||||||
|
(row["goal"], row["id"], row["name"]))
|
||||||
|
if cur.rowcount == 1:
|
||||||
|
print "quest", row["id"], row["name"], "goal updated:", row["goal"]
|
||||||
|
else:
|
||||||
|
print "ERROR", "quest", row["id"], row["name"], "update failed"
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
db = MHDB()
|
||||||
|
delta_file_path = os.path.join(_pathfix.db_path, "delta",
|
||||||
|
"quests.csv")
|
||||||
|
|
||||||
|
with open(delta_file_path) as f:
|
||||||
|
reader = csv.DictReader(f)
|
||||||
|
for row in reader:
|
||||||
|
apply_update(db, row)
|
||||||
|
|
||||||
|
db.commit()
|
||||||
|
db.close()
|
||||||
@@ -12,7 +12,8 @@ import difflib
|
|||||||
|
|
||||||
import _pathfix
|
import _pathfix
|
||||||
|
|
||||||
from mhapi.db import MHDB, Quest
|
from mhapi.db import MHDB
|
||||||
|
from mhapi.model import Quest
|
||||||
|
|
||||||
QuestMonster = namedtuple("QuestMonster", "id name")
|
QuestMonster = namedtuple("QuestMonster", "id name")
|
||||||
|
|
||||||
@@ -36,8 +37,7 @@ def set_unstable(db, quest_id, monster_id, value):
|
|||||||
|
|
||||||
def check_quests(db):
|
def check_quests(db):
|
||||||
quests = db.get_quests()
|
quests = db.get_quests()
|
||||||
for quest_row in quests:
|
for quest in quests:
|
||||||
quest = Quest(quest_row)
|
|
||||||
if not quest.name:
|
if not quest.name:
|
||||||
assert quest.hub == "Event"
|
assert quest.hub == "Event"
|
||||||
#print "WARN: skipping non localized event quest: %d" \
|
#print "WARN: skipping non localized event quest: %d" \
|
||||||
@@ -66,6 +66,8 @@ def _parse_monster(name):
|
|||||||
name = name.strip()
|
name = name.strip()
|
||||||
#print name,
|
#print name,
|
||||||
|
|
||||||
|
assert name
|
||||||
|
|
||||||
name = lstrip(name, "and ")
|
name = lstrip(name, "and ")
|
||||||
name = lstrip(name, "a ")
|
name = lstrip(name, "a ")
|
||||||
name = lstrip(name, "an ")
|
name = lstrip(name, "an ")
|
||||||
@@ -160,7 +162,7 @@ def parse_goal_monster_names(goal, errors):
|
|||||||
parts = goal.split(",")
|
parts = goal.split(",")
|
||||||
else:
|
else:
|
||||||
parts = goal.split(" and ")
|
parts = goal.split(" and ")
|
||||||
return [_parse_monster(p) for p in parts]
|
return [_parse_monster(p) for p in parts if p.strip()]
|
||||||
|
|
||||||
|
|
||||||
def get_goal_monsters(db, goal, errors):
|
def get_goal_monsters(db, goal, errors):
|
||||||
@@ -188,7 +190,7 @@ def get_goal_monsters(db, goal, errors):
|
|||||||
if m is None:
|
if m is None:
|
||||||
errors.append("ERROR: can't find monster '%s'" % name)
|
errors.append("ERROR: can't find monster '%s'" % name)
|
||||||
continue
|
continue
|
||||||
monsters.append(QuestMonster(m["_id"], name))
|
monsters.append(QuestMonster(m.id, name))
|
||||||
return monsters
|
return monsters
|
||||||
|
|
||||||
|
|
||||||
@@ -216,7 +218,7 @@ def check_hunts(db, quest):
|
|||||||
monsters = db.get_quest_monsters(quest.id)
|
monsters = db.get_quest_monsters(quest.id)
|
||||||
for m in monsters:
|
for m in monsters:
|
||||||
monster = db.get_monster(m["monster_id"])
|
monster = db.get_monster(m["monster_id"])
|
||||||
qm = QuestMonster(monster["_id"], monster["name"])
|
qm = QuestMonster(monster.id, monster.name)
|
||||||
if m["unstable"] == "yes":
|
if m["unstable"] == "yes":
|
||||||
db_expected_unstable.add(qm)
|
db_expected_unstable.add(qm)
|
||||||
else:
|
else:
|
||||||
@@ -269,7 +271,7 @@ if __name__ == '__main__':
|
|||||||
db_file = os.path.join(db_path, "mh4u.db")
|
db_file = os.path.join(db_path, "mh4u.db")
|
||||||
db = MHDB(db_file)
|
db = MHDB(db_file)
|
||||||
|
|
||||||
ALL_NAMES = [row["name"] for row in db.get_monster_names()]
|
ALL_NAMES = db.get_monster_names()
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
sys.stdout = get_utf8_writer(sys.stdout)
|
sys.stdout = get_utf8_writer(sys.stdout)
|
||||||
|
|||||||
8
db/delta/quest-monsters.csv
Normal file
8
db/delta/quest-monsters.csv
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
413,"Escaped Convicts",missing Cephadrome
|
||||||
|
444,"Monster Hunter!",marked unstable when shouldn't be
|
||||||
|
524,"Tower of Trouble",missing Silver Rathalos
|
||||||
|
525,"Royal Restoration",missing Gold Rathian
|
||||||
|
536,"Rollin' Rollin' Rollin'",missing Konchu
|
||||||
|
557,"Twilight of the Gods",should be Apex Diablos
|
||||||
|
570,"Looming Shadows","Hunt a Shrouded Nerscylla"
|
||||||
|
702,"Bonus: A Bigger Boat",Gold Rathian should not be there
|
||||||
|
2
db/delta/quests.csv
Normal file
2
db/delta/quests.csv
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
id,name,goal
|
||||||
|
253,"Advanced: One-man Army","Hunt a Nerscylla and a Kecha Wacha"
|
||||||
|
411
db/delta/weapons-final.csv
Normal file
411
db/delta/weapons-final.csv
Normal file
@@ -0,0 +1,411 @@
|
|||||||
|
id,name,final
|
||||||
|
5019,"Blood Shock",1
|
||||||
|
5030,"Cliffsword Titanius",1
|
||||||
|
5093,"Rathflame Glinsword",1
|
||||||
|
5121,"Garuga Engetsu",1
|
||||||
|
5125,"Avidya Great Sword",1
|
||||||
|
5131,"Plesioth Pelagis",1
|
||||||
|
5134,"Xiphias Gladius",1
|
||||||
|
5137,"Emperor Thundersword",1
|
||||||
|
5141,"Grand Pincer",1
|
||||||
|
5145,"Vulca Vendetta",1
|
||||||
|
5149,"Doomedge "Hrunting"",1
|
||||||
|
5153,"Rogue Sedition",1
|
||||||
|
5158,"Dreaming Dalamadur",1
|
||||||
|
5161,"King Frostsword",1
|
||||||
|
5163,"Akantor Broadsword+",1
|
||||||
|
5165,"Ukanlos Skycleaver",1
|
||||||
|
5167,"Black Fatalis Blade",1
|
||||||
|
5168,"Düster/Éclat",1
|
||||||
|
5169,"Grand Shamshir",1
|
||||||
|
5170,"Eldaora's Death",2
|
||||||
|
5172,"Ostracon Oblivion",1
|
||||||
|
5173,"Flame Fatalis Blade",1
|
||||||
|
5174,"Fatalis Legacy",1
|
||||||
|
5182,"Daora's Deathmaker",1
|
||||||
|
5190,"Teostra del Sol",1
|
||||||
|
5192,"テンマノツルギ",1
|
||||||
|
5194,"天地・轟断剣",1
|
||||||
|
5196,"キャプテンJバスター",1
|
||||||
|
5197,"仁剣【侠客立ち】",1
|
||||||
|
5198,"Universal Chrome",1
|
||||||
|
5199,"Black Belt Blade",1
|
||||||
|
5200,"G Blade",1
|
||||||
|
5201,"Commemoration Sword",1
|
||||||
|
5202,"アモンの剣",1
|
||||||
|
5226,"Weiss Crescent",1
|
||||||
|
5295,"Vilcurviscera+",1
|
||||||
|
5313,"Dark Matter",1
|
||||||
|
5317,"Premium Hairblade",1
|
||||||
|
5321,"Onamuchi",1
|
||||||
|
5325,"Euros",1
|
||||||
|
5329,"Doomblade "Slave"",1
|
||||||
|
5332,"Kibamaru",1
|
||||||
|
5336,"Zealous Sedition",1
|
||||||
|
5341,"Clouded Dalamadur",1
|
||||||
|
5344,"Dragonwood Cutblade",1
|
||||||
|
5346,"Akantor Strongsword",1
|
||||||
|
5348,"Ukanlos Skydicer",1
|
||||||
|
5350,"Fatalis Zaggespanon",1
|
||||||
|
5352,"Thunderclap+",1
|
||||||
|
5353,"Chaos/Loi",1
|
||||||
|
5355,"Susano Blade",1
|
||||||
|
5356,"Phantom Mirage",1
|
||||||
|
5357,"Eldaora's Raid",1
|
||||||
|
5359,"Headsman's Requite",1
|
||||||
|
5360,"Fatalis Fotia",1
|
||||||
|
5361,"Fatalis Ascencia",1
|
||||||
|
5371,"Imperial Shimmer",1
|
||||||
|
5373,"鉄砕牙D",1
|
||||||
|
5375,"Eternal Gate",1
|
||||||
|
5377,"速報隊専用剣【空狐】",1
|
||||||
|
5379,"EX Susano-o",1
|
||||||
|
5380,"覇王剣",1
|
||||||
|
5381,"Wing of Judgment",1
|
||||||
|
5382,"Chainslaughter",1
|
||||||
|
5383,"Fan Club Bamboo Rod",1
|
||||||
|
5439,"Coctura Balgang",1
|
||||||
|
5499,"Mortal Heart",1
|
||||||
|
5505,"Master Odyssey",1
|
||||||
|
5509,"Melynx Tool",1
|
||||||
|
5514,"Plesiperse Spike+",1
|
||||||
|
5517,"Kirin Bolt Maximus",1
|
||||||
|
5521,"Yaegaki",1
|
||||||
|
5525,"Chalcomatia",1
|
||||||
|
5534,"Cursed Rajang Club",1
|
||||||
|
5537,"Serevento",1
|
||||||
|
5541,"Panja Sedition",1
|
||||||
|
5546,"Bescaled Dalamadur",1
|
||||||
|
5548,"Icemaster Kirin",1
|
||||||
|
5550,"Ukanlos Skyhatchet",1
|
||||||
|
5552,"True Fatalis Sword",1
|
||||||
|
5554,"True Ruiner Sword",1
|
||||||
|
5555,"Lügen/Vérité",1
|
||||||
|
5556,"Eldaora's Sturm",1
|
||||||
|
5558,"Kyrie Ruin",1
|
||||||
|
5559,"W. Fatalis Sword",1
|
||||||
|
5567,"Daora's Maelstrom",1
|
||||||
|
5574,"Teostra's Emblem",1
|
||||||
|
5576,"Master's Blade",1
|
||||||
|
5577,"雷剣コロドライト",1
|
||||||
|
5579,"EX Ame-no-habakiri",1
|
||||||
|
5582,"Master Sword G",1
|
||||||
|
5583,"Black Belt Sword",1
|
||||||
|
5584,"Ms. M.H. Puppet",1
|
||||||
|
5585,"イナズマワークス",1
|
||||||
|
5586,"Star Knight Sword",1
|
||||||
|
5587,"刃折れの剣",1
|
||||||
|
5637,"Psammophages",1
|
||||||
|
5682,"Stygian Superbia",1
|
||||||
|
5704,"Jade Battlefanzers",1
|
||||||
|
5707,"Savortooths",1
|
||||||
|
5710,"Felyne and Melynx++",1
|
||||||
|
5714,"Dual Dragons "Angst"",1
|
||||||
|
5717,"Wunderkirins",1
|
||||||
|
5721,"Doomfang "Envoys"",1
|
||||||
|
5725,"Megiddo Breakers",1
|
||||||
|
5729,"Serre Sedition",1
|
||||||
|
5733,"Agnaktor Inferno",1
|
||||||
|
5738,"Amber Dalamadur",1
|
||||||
|
5740,"Ritual Eidolons",1
|
||||||
|
5742,"Akantor Shadow Claws",1
|
||||||
|
5744,"Ukanlos Skyrippers",1
|
||||||
|
5747,"Twinbane Twilight",1
|
||||||
|
5750,"Sinistrus Dextraos",1
|
||||||
|
5751,"Inferno/Paradis",1
|
||||||
|
5753,"Suzuka Otakemaru",1
|
||||||
|
5754,"Twin Elders",1
|
||||||
|
5756,"Eternal Leavetakers",1
|
||||||
|
5757,"Ultimus Apocalypse",1
|
||||||
|
5765,"Blizzard and Blaze",1
|
||||||
|
5767,"大海賊Jエッジ",1
|
||||||
|
5768,"紅蓮爆炎刃",1
|
||||||
|
5769,"ギガントピストル",1
|
||||||
|
5772,"Chum-Chum Scarecrows",1
|
||||||
|
5773,"範馬刃牙流格闘術",1
|
||||||
|
5774,"Fan Club Fans",1
|
||||||
|
5801,"Bleeding Bludgeon",1
|
||||||
|
5896,"Meteorgalore",1
|
||||||
|
5909,"Armored Gigagogue",1
|
||||||
|
5915,"Gold Cat Crusher",1
|
||||||
|
5919,"Nadeshiko",1
|
||||||
|
5923,"Gaia Horizon",1
|
||||||
|
5927,"Doomhammer "Blood"",1
|
||||||
|
5931,"Qadar Sedition",1
|
||||||
|
5936,"Agonized Dalamadur",1
|
||||||
|
5938,"Ukanlos Skysmasher",1
|
||||||
|
5940,"Fatalis Demolisher",1
|
||||||
|
5941,"Vergehen/Naissance",1
|
||||||
|
5942,"Genie's Expanse",1
|
||||||
|
5943,"Eldaora's Colossus",1
|
||||||
|
5945,"Desmos Admonition",1
|
||||||
|
5946,"Fatalis Iregard",1
|
||||||
|
5947,"Fatalis Ruiner",1
|
||||||
|
5955,"Teostra del Torre",1
|
||||||
|
5962,"Daora's Hyperborea",1
|
||||||
|
5964,"Swinging Scarluq",1
|
||||||
|
5965,"Pride of Harth",1
|
||||||
|
5967,"ギガサンダーワークス",1
|
||||||
|
5969,"鬼ノ現身",1
|
||||||
|
5970,"Black Belt Hammer",1
|
||||||
|
5971,"Portsmark",1
|
||||||
|
5972,"Teddybear",1
|
||||||
|
5974,"Ham of Hams",1
|
||||||
|
5996,"Lunar Chordmaker",1
|
||||||
|
6053,"Naja Alluvion",1
|
||||||
|
6076,"Aria Rhota",1
|
||||||
|
6081,"Klick-Klack",1
|
||||||
|
6085,"Maqam Sedition",1
|
||||||
|
6090,"Bloodied Dalamadur",1
|
||||||
|
6092,"Dragonwood Godflute",1
|
||||||
|
6094,"Akantor Dark Melody",1
|
||||||
|
6096,"Ukanlos Skysinger",1
|
||||||
|
6098,"Fatalis Menace Lute",1
|
||||||
|
6099,"Grimm/Joie",1
|
||||||
|
6101,"Denden Doomsounder",1
|
||||||
|
6102,"Genie's Ocarina",1
|
||||||
|
6103,"Eldaora's Taus",1
|
||||||
|
6105,"Onyx Terpsichore",1
|
||||||
|
6106,"Fatalis Menace Soul",1
|
||||||
|
6107,"Fatalis Ancient Lute",1
|
||||||
|
6116,"Daora's Baphophone",1
|
||||||
|
6117,"銀の匙",1
|
||||||
|
6118,"ブリッツワークス",1
|
||||||
|
6119,"Megaphone",1
|
||||||
|
6120,"Handmade Frog",1
|
||||||
|
6122,"Queen's Flute",1
|
||||||
|
6123,"Hunter Master",1
|
||||||
|
6143,"Le Paladin",1
|
||||||
|
6198,"Shuraba Lance",1
|
||||||
|
6228,"Garuga Incessance",1
|
||||||
|
6231,"Sharq Assawlt",1
|
||||||
|
6237,"Esmeralda's Tide",1
|
||||||
|
6240,"Naar Thunderlance",1
|
||||||
|
6244,"Giant Hermitaur Lance",1
|
||||||
|
6248,"Aidion Crown",1
|
||||||
|
6251,"Nero's Atrocity",1
|
||||||
|
6257,"White Catastrophe",1
|
||||||
|
6261,"Hadad Sedition",1
|
||||||
|
6266,"Generous Dalamadur",1
|
||||||
|
6268,"Ukanlos Skysweeper",1
|
||||||
|
6270,"True Fatalis Lance",1
|
||||||
|
6272,"True Ruiner Lance",1
|
||||||
|
6274,"Sabertooth",1
|
||||||
|
6275,"Luzifer/Sage",1
|
||||||
|
6276,"Eldaora's Fang",1
|
||||||
|
6278,"Aether Geghard",1
|
||||||
|
6279,"W. Fatalis Lance",1
|
||||||
|
6287,"Daora's Regulus",1
|
||||||
|
6295,"Teostra's Fire",1
|
||||||
|
6297,"特捜隊専用槍【百狐】",1
|
||||||
|
6332,"Blood Thunder",1
|
||||||
|
6405,"Nux Cannon",1
|
||||||
|
6410,"Hypnos",1
|
||||||
|
6413,"Felicitous Felyoshka",1
|
||||||
|
6419,"Sea Abyss",1
|
||||||
|
6423,"Amatsuhiko",1
|
||||||
|
6427,"Doomlance "Greed"",1
|
||||||
|
6431,"Violet Buster",1
|
||||||
|
6433,"Mighty Cornpopper",1
|
||||||
|
6437,"Tamarod Sedition",1
|
||||||
|
6442,"Unchained Dalamadur",1
|
||||||
|
6444,"Akantor Cannonlance",1
|
||||||
|
6446,"Ukanlos Cannonlance",1
|
||||||
|
6448,"True Fatalis Gunlance",1
|
||||||
|
6452,"Seltas Fortitude",1
|
||||||
|
6453,"Mauer/Guerre",1
|
||||||
|
6454,"Venomous Perfume",1
|
||||||
|
6455,"Eldaora's Brigia",1
|
||||||
|
6457,"Auguring Prophet",1
|
||||||
|
6458,"Hellruin Gunlance",1
|
||||||
|
6459,"W. Fatalis Gunlance",1
|
||||||
|
6470,"Daora's Tempest",1
|
||||||
|
6473,"プラチナクラウン",1
|
||||||
|
6476,"Bamboo Dragonsbane",1
|
||||||
|
6477,"ボルティックワークス",1
|
||||||
|
6503,"Azure Straybloom",1
|
||||||
|
6517,"Stygian Vanagloria",1
|
||||||
|
6526,"Notched Diavolo",1
|
||||||
|
6538,"Chief Bruiser Axe",1
|
||||||
|
6555,"Axe of Gaia",1
|
||||||
|
6576,"Illuyanka",1
|
||||||
|
6578,"Grimmig Katze",1
|
||||||
|
6582,"Yamatsumi",1
|
||||||
|
6586,"Archbeast Kirin",1
|
||||||
|
6590,"Helios Crusher",1
|
||||||
|
6594,"Doomaxe "Downpour"",1
|
||||||
|
6598,"Baraq Sedition",1
|
||||||
|
6603,"Praying Dalamadur",1
|
||||||
|
6605,"Bitterbeast Kirin",1
|
||||||
|
6607,"Akantor Divider",1
|
||||||
|
6609,"Ceadeed Axe",1
|
||||||
|
6611,"True Fatalis's End",1
|
||||||
|
6613,"True Ruiner's Bane",1
|
||||||
|
6614,"Frevel/Sursis",1
|
||||||
|
6615,"Eldaora's Farasa",1
|
||||||
|
6617,"Wicked Conqueror",1
|
||||||
|
6618,"Fatalis Force",1
|
||||||
|
6627,"Daora's Janah",1
|
||||||
|
6629,"大海賊Jアックス",1
|
||||||
|
6631,"特報隊専用斧【仙狐】",1
|
||||||
|
6633,"EX Izanagi",1
|
||||||
|
6671,"Desert Rose",1
|
||||||
|
6677,"Le Salut",1
|
||||||
|
6681,"Watatsumi",1
|
||||||
|
6685,"Lightbreak C. Blade",1
|
||||||
|
6692,"Chernobog's Scythe",1
|
||||||
|
6697,"Maximinsect",1
|
||||||
|
6701,"Garuda Sedition",1
|
||||||
|
6704,"Ceadeus Regalia",1
|
||||||
|
6706,"Daora's Thwartoise",1
|
||||||
|
6708,"Teostra's Nova",1
|
||||||
|
6713,"Patient Dalamadur",1
|
||||||
|
6715,"Akantor Severance",1
|
||||||
|
6717,"True Fatalis Charger",1
|
||||||
|
6719,"True Ruiner Reaver",1
|
||||||
|
6721,"Cera Cediment",1
|
||||||
|
6722,"Elends/Essor",1
|
||||||
|
6724,"Demonlord Supersurge",1
|
||||||
|
6725,"Eldaora Casca",1
|
||||||
|
6727,"Promised Nadir",1
|
||||||
|
6728,"Fatalis Mien",1
|
||||||
|
6730,"Grandstar Axe",1
|
||||||
|
6732,"伝説Jレガシー",1
|
||||||
|
6733,"チャージフォックス",1
|
||||||
|
6740,"Highest of Glaives",1
|
||||||
|
6746,"Reaper's Stroke",1
|
||||||
|
6752,"Le Miracle",1
|
||||||
|
6758,"Emperor Boltbrute",1
|
||||||
|
6763,"Midnight Glaive",1
|
||||||
|
6768,"Mind Stick "Wizard"",1
|
||||||
|
6773,"Hermit Scissors",1
|
||||||
|
6779,"Nightmare",1
|
||||||
|
6783,"Cannibal Happa",1
|
||||||
|
6787,"Paralyzing Vine",1
|
||||||
|
6791,"Fimbulvetr",1
|
||||||
|
6795,"Lana Sedition",1
|
||||||
|
6799,"Lightbreak Press",1
|
||||||
|
6803,"Icephantom",1
|
||||||
|
6809,"Demonlord Grudgel",1
|
||||||
|
6815,"Bounding Dalamadur",1
|
||||||
|
6821,"Universus",1
|
||||||
|
6824,"Daora's Samudra",1
|
||||||
|
6827,"Ukanlos Skytraveler",1
|
||||||
|
6831,"True Fatalis Dyaus",1
|
||||||
|
6834,"Mind Stick "Fiend"",1
|
||||||
|
6837,"Medusa Mirror",1
|
||||||
|
6840,"Iörovellir",1
|
||||||
|
6843,"Tyrant Rod",1
|
||||||
|
6846,"Anubis",1
|
||||||
|
6849,"Wehmut/Merveille",1
|
||||||
|
6852,"Hazy Caster",1
|
||||||
|
6855,"Eldaora's Samudra",1
|
||||||
|
6858,"Limbo Lacrimosa",1
|
||||||
|
6861,"Hellruin Glaive "Omen"",1
|
||||||
|
6864,"Fatalis Overlord",1
|
||||||
|
6865,"クリマ・タクト",1
|
||||||
|
6866,"Clockwork",1
|
||||||
|
6867,"断罪の銃棍J",1
|
||||||
|
6894,"Orcus Barqus",1
|
||||||
|
6908,"Vert Shooter+",1
|
||||||
|
6927,"L'Éden",1
|
||||||
|
6937,"Garuga Espringal",1
|
||||||
|
6943,"Plesioth Drencher",1
|
||||||
|
6948,"Blood Injection",1
|
||||||
|
6954,"Arctica Cannon",1
|
||||||
|
6960,"Lightbreak Gun",1
|
||||||
|
6963,"Blitz Kirin King",1
|
||||||
|
6969,"Blue Burst",1
|
||||||
|
6973,"Doomgun "Dementia"",1
|
||||||
|
6977,"Diamond Crest",1
|
||||||
|
6979,"Felyne Heavendoll",1
|
||||||
|
6984,"Nether Phloxion",1
|
||||||
|
6988,"Vayu Sedition",1
|
||||||
|
6991,"Frigid Kirin King",1
|
||||||
|
6995,"Demonlord Cannon",1
|
||||||
|
7000,"Buoyant Dalamadur",1
|
||||||
|
7002,"Daora's Hornet",1
|
||||||
|
7004,"Ukanlos Skylighter",1
|
||||||
|
7006,"Dark Parasol",1
|
||||||
|
7008,"Gobul Ganador",1
|
||||||
|
7011,"Heavy Grisfire",1
|
||||||
|
7012,"Fäulnis/Vertu",1
|
||||||
|
7013,"Genie's Lamp",1
|
||||||
|
7014,"Eldaora's Hornet",1
|
||||||
|
7015,"Bethorned Dystopia",1
|
||||||
|
7016,"Dith Valor",1
|
||||||
|
7017,"Absolute Bowgun",1
|
||||||
|
7019,"Demon's Island",1
|
||||||
|
7022,"God's Archipelago",1
|
||||||
|
7024,"Kettleblower Deluxe",1
|
||||||
|
7026,"Hexed Shaka Bow",1
|
||||||
|
7027,"Frilly Pink Parasol",1
|
||||||
|
7028,"Arm Cannon",1
|
||||||
|
7041,"Empress's Doublefleur",1
|
||||||
|
7059,"Gravios Gigacannon",1
|
||||||
|
7064,"Captain Verde",1
|
||||||
|
7068,"Orcus Quarcus",1
|
||||||
|
7070,"Stygian Humilitas",1
|
||||||
|
7079,"Livid Griscannon",1
|
||||||
|
7084,"Lightbreak Cannon",1
|
||||||
|
7088,"Griffon Blazooka",1
|
||||||
|
7093,"Eigoh",1
|
||||||
|
7097,"Cartilage Blaster 0
|
||||||
|
7108,"Arzuros Yokozuna",1
|
||||||
|
7112,"Precision Pico Peco",1
|
||||||
|
7116,"Le Déluge",1
|
||||||
|
7122,"Azure Buster",1
|
||||||
|
7125,"Monodevilblaster",1
|
||||||
|
7129,"Furia Sedition",1
|
||||||
|
7132,"Daora's Ceti",1
|
||||||
|
7135,"Teostra's Firestorm",1
|
||||||
|
7138,"Lunastra's Firestorm",1
|
||||||
|
7143,"Militant Dalamadur",1
|
||||||
|
7146,"Altheos Aetheria",1
|
||||||
|
7149,"Vor Blaster",1
|
||||||
|
7151,"Akantor Skysounder",1
|
||||||
|
7153,"Ukanlos Skyblaster",1
|
||||||
|
7154,"Verrat/Foi",1
|
||||||
|
7155,"Kamaeleon",1
|
||||||
|
7156,"Eldaora's Delphinidae",1
|
||||||
|
7157,"Trembling Lordship",1
|
||||||
|
7158,"Destiny's Arm",1
|
||||||
|
7159,"Fatalis Enslaver",1
|
||||||
|
7181,"Artemis Moonmaker",1
|
||||||
|
7188,"Golden Ray",1
|
||||||
|
7200,"Garuga Oyumi",1
|
||||||
|
7213,"Soaring Grisbow",1
|
||||||
|
7221,"Crystal Lode",1
|
||||||
|
7227,"Splattika",1
|
||||||
|
7235,"Wide Weblivion",1
|
||||||
|
7238,"Viand Bowfish",1
|
||||||
|
7244,"Uranus Herald",1
|
||||||
|
7253,"Charonian Patientia",1
|
||||||
|
7259,"L'Innocence",1
|
||||||
|
7263,"Great Kelbi Deershot",1
|
||||||
|
7267,"Tamanoya",1
|
||||||
|
7272,"Great Purple Emperor II",1
|
||||||
|
7275,"Fluctus",1
|
||||||
|
7278,"Gigantomachy",1
|
||||||
|
7282,"Kama Sedition",1
|
||||||
|
7286,"Archbeast Paragon",1
|
||||||
|
7289,"Daora's Toxotes",1
|
||||||
|
7294,"Enraged Dalamadur",1
|
||||||
|
7296,"Courageous Wish",1
|
||||||
|
7299,"Heedful Elizabeth",1
|
||||||
|
7301,"Akantor Chaos Bow",1
|
||||||
|
7302,"Ukanlos Bow",1
|
||||||
|
7303,"Ukanlos Skyflier",1
|
||||||
|
7305,"Exterminator Bow II",1
|
||||||
|
7307,"Cera Cyclord",1
|
||||||
|
7308,"Verzweiflung/Désir",1
|
||||||
|
7309,"Genie's Grimoire",1
|
||||||
|
7310,"Eldaora's Sagittarii",1
|
||||||
|
7312,"Calamitous Cupid",1
|
||||||
|
7313,"Red Heaven Ruiner",1
|
||||||
|
7314,"Victory and Glory",1
|
||||||
|
7317,"Bamboo Kaguya",1
|
||||||
|
7319,"黒カブト",1
|
||||||
|
7322,"Sacred Bow G",1
|
||||||
|
7323,"Seahorse Harp",1
|
||||||
|
7324,"Emperor's Speech",1
|
||||||
|
Can't render this file because it contains an unexpected character in line 12 and column 16.
|
37
db/fix_weapon_final.py
Executable file
37
db/fix_weapon_final.py
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import _pathfix
|
||||||
|
|
||||||
|
from mhapi.db import MHDB
|
||||||
|
from mhapi.util import get_utf8_writer
|
||||||
|
|
||||||
|
|
||||||
|
stdout = get_utf8_writer(sys.stdout)
|
||||||
|
|
||||||
|
|
||||||
|
def set_weapon_final(db, weapon, value):
|
||||||
|
print >>stdout, "weapon_final", weapon.id, weapon.name, value
|
||||||
|
cur = db.cursor()
|
||||||
|
cur.execute("""UPDATE weapons SET
|
||||||
|
final=? WHERE _id=?""",
|
||||||
|
(value, weapon.id))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
db = MHDB()
|
||||||
|
|
||||||
|
weapons = db.get_weapons()
|
||||||
|
for weapon in weapons:
|
||||||
|
children = db.get_weapons_by_parent(weapon.id)
|
||||||
|
if children:
|
||||||
|
# has children, should not be final
|
||||||
|
if weapon["final"] == 1:
|
||||||
|
set_weapon_final(db, weapon, 0)
|
||||||
|
elif weapon["final"] == 0:
|
||||||
|
# else no children, should be final
|
||||||
|
set_weapon_final(db, weapon, 1)
|
||||||
|
|
||||||
|
db.commit()
|
||||||
|
db.close()
|
||||||
BIN
db/mh4u.db
BIN
db/mh4u.db
Binary file not shown.
@@ -5,7 +5,7 @@ import codecs
|
|||||||
|
|
||||||
import _pathfix
|
import _pathfix
|
||||||
|
|
||||||
from mhapi.db import MHDB, Quest
|
from mhapi.db import MHDB
|
||||||
|
|
||||||
|
|
||||||
RANK_NUM = dict(LR=0, HR=1, G=2)
|
RANK_NUM = dict(LR=0, HR=1, G=2)
|
||||||
@@ -21,32 +21,31 @@ def set_quest_ranks(db):
|
|||||||
for quest in quests:
|
for quest in quests:
|
||||||
if not quest["name"]:
|
if not quest["name"]:
|
||||||
assert quest["hub"] == "Event"
|
assert quest["hub"] == "Event"
|
||||||
print "WARN: skipping non localized event quest: %d" % quest["_id"]
|
print "WARN: skipping non localized event quest: %d" % quest.id
|
||||||
continue
|
continue
|
||||||
set_quest_rank(db, quest)
|
set_quest_rank(db, quest)
|
||||||
|
|
||||||
|
|
||||||
def set_quest_rank(db, quest_row):
|
def set_quest_rank(db, quest):
|
||||||
quest_id = quest_row["_id"]
|
quest_id = quest.id
|
||||||
hub = quest_row["hub"]
|
hub = quest.hub
|
||||||
stars = quest_row["stars"]
|
stars = quest.stars
|
||||||
rank_stars_guess = guess_rank(hub, stars)
|
rank_stars_guess = guess_rank(hub, stars)
|
||||||
if isinstance(rank_stars_guess, tuple):
|
if isinstance(rank_stars_guess, tuple):
|
||||||
rewards = db.get_quest_rewards(quest_id)
|
rewards = db.get_quest_rewards(quest_id)
|
||||||
rank = guess_quest_rank_from_rewards(db, rewards)
|
rank = guess_quest_rank_from_rewards(db, rewards)
|
||||||
if rank is None:
|
if rank is None:
|
||||||
print "WARN: quest '%s' has no flesh rewards, assuming lower rank"\
|
print "WARN: quest '%s' has no flesh rewards, assuming lower rank"\
|
||||||
% (quest_row["name"].encode("utf8"),)
|
% (quest.name.encode("utf8"),)
|
||||||
rank = rank_stars_guess[0]
|
rank = rank_stars_guess[0]
|
||||||
elif rank not in rank_stars_guess:
|
elif rank not in rank_stars_guess:
|
||||||
print "ERROR: quest '%s' reward guess '%s' not in stars guess '%s'"\
|
print "ERROR: quest '%s' reward guess '%s' not in stars guess '%s'"\
|
||||||
% (quest_row["name"], rank, rank_stars_guess)
|
% (quest.name, rank, rank_stars_guess)
|
||||||
else:
|
else:
|
||||||
rank = rank_stars_guess
|
rank = rank_stars_guess
|
||||||
|
|
||||||
assert rank in "LR HR G".split()
|
assert rank in "LR HR G".split()
|
||||||
|
|
||||||
quest = Quest(quest_row)
|
|
||||||
quest.rank = rank
|
quest.rank = rank
|
||||||
print quest.one_line_u()
|
print quest.one_line_u()
|
||||||
cur = db.cursor()
|
cur = db.cursor()
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ def set_creation_cost(db, item_id, creation_cost):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
db = MHDB()
|
db = MHDB()
|
||||||
delta_file_path = os.path.join(_pathfix.db_path, "weapons-delta.csv")
|
delta_file_path = os.path.join(_pathfix.db_path, "delta", "weapons.csv")
|
||||||
|
|
||||||
with open(delta_file_path) as f:
|
with open(delta_file_path) as f:
|
||||||
reader = csv.DictReader(f)
|
reader = csv.DictReader(f)
|
||||||
|
|||||||
Reference in New Issue
Block a user