4u: add shop weapons to planner

main
Bryce Allen 5 years ago
parent c2d967b7f3
commit 57f7060794

Binary file not shown.

@ -0,0 +1,38 @@
Iron Sword,1500
Buster Sword,2550
Giant Jawblade,5250
Ravager Blade,5250
Iron Katana,1500
Canine Katana,3300
Eager Cleaver,10950
Hunter's Knife,1500
Assassin's Dagger,3300
Chief Kris,4200
Matched Slicers,1500
Chief's Scythes,3300
Dual Hatchets,4200
War Hammer,1500
War Mace,2550
Bone Bludgeon+,4200
Iron Striker+,5250
Metal Bagpipe,1500
Hunter's Horn,4200
Heavy Bagpipe+,5250
Iron Lance,1500
Knight Lance,2550
Rampart,5250
Spiked Javelin,6450
Iron Gunlance,1500
Jaggid Gunlance,4200
Defender's Gunlance,6450
Bone Axe,1950
Wild Axe,4200
Power Gasher,5250
Elite Blad,1950
Bone Staff,3300
Cross Bowgun,2550
Cross Bowgun+,4200
Bone Shooter,2100
Bone Shooter+,5400
Hunter's Bow I,1500
Hunter's Stoutbow I,4200
1 Iron Sword 1500
2 Buster Sword 2550
3 Giant Jawblade 5250
4 Ravager Blade 5250
5 Iron Katana 1500
6 Canine Katana 3300
7 Eager Cleaver 10950
8 Hunter's Knife 1500
9 Assassin's Dagger 3300
10 Chief Kris 4200
11 Matched Slicers 1500
12 Chief's Scythes 3300
13 Dual Hatchets 4200
14 War Hammer 1500
15 War Mace 2550
16 Bone Bludgeon+ 4200
17 Iron Striker+ 5250
18 Metal Bagpipe 1500
19 Hunter's Horn 4200
20 Heavy Bagpipe+ 5250
21 Iron Lance 1500
22 Knight Lance 2550
23 Rampart 5250
24 Spiked Javelin 6450
25 Iron Gunlance 1500
26 Jaggid Gunlance 4200
27 Defender's Gunlance 6450
28 Bone Axe 1950
29 Wild Axe 4200
30 Power Gasher 5250
31 Elite Blad 1950
32 Bone Staff 3300
33 Cross Bowgun 2550
34 Cross Bowgun+ 4200
35 Bone Shooter 2100
36 Bone Shooter+ 5400
37 Hunter's Bow I 1500
38 Hunter's Stoutbow I 4200

@ -0,0 +1,39 @@
#!/usr/bin/env python2
import os.path
import codecs
import csv
import _pathfix
from mhapi.db import MHDB
def set_buy(db, item_id, buy):
print "buy", item_id, buy
cur = db.cursor()
cur.execute("""UPDATE items SET
buy=? WHERE _id=?""",
(buy, item_id))
def set_buy_by_name(db, name, buy):
cur = db.cursor()
cur.execute("""UPDATE items SET
buy=? WHERE name=?""",
(buy, name))
rowid = cur.lastrowid
print "buy", rowid, name, buy
if __name__ == '__main__':
db = MHDB(game="4u")
delta_file_path = os.path.join(_pathfix.db_path, "mh4u", "weapon_shop.csv")
with open(delta_file_path) as f:
reader = csv.reader(f)
for row in reader:
name = row[0]
value = int(row[1])
set_buy_by_name(db, name, value)
db.commit()
db.close()

@ -641,6 +641,11 @@ def get_costs(db, weapon):
for item in weapon.create_components: for item in weapon.create_components:
create_cost["components"][item.name] = item.quantity create_cost["components"][item.name] = item.quantity
costs = [create_cost] + costs costs = [create_cost] + costs
if weapon.buy:
buy_cost = dict(zenny=int(weapon.buy),
path=[weapon],
components={})
costs = [buy_cost] + costs
return costs return costs
@ -678,6 +683,10 @@ class ItemStars(object):
costs = get_costs(self.db, weapon) costs = get_costs(self.db, weapon)
# find least 'expensive' path # find least 'expensive' path
for c in costs: for c in costs:
# don't calculate stars from buy cost (buys aren't available
# until after item is craftable, sometimes much later)
if not c["components"]:
continue
current_stars = self._get_component_stars(c) current_stars = self._get_component_stars(c)
for k, v in current_stars.iteritems(): for k, v in current_stars.iteritems():
if v is None: if v is None:

Loading…
Cancel
Save