Skip to content

Commit 771ca2a

Browse files
authored
Merge pull request #83 from RubenatorX/patch-8
Add range type and ammo type info
2 parents 3af8ed5 + 360bf26 commit 771ca2a

File tree

1 file changed

+70
-1
lines changed

1 file changed

+70
-1
lines changed

Program.cs

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="Program.cs" company="Windower Team">
1+
// <copyright file="Program.cs" company="Windower Team">
22
// Copyright © 2013-2018 Windower Team
33
//
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -350,6 +350,75 @@ private static void PostProcess()
350350

351351
model.item_descriptions.Add(item_description);
352352
}
353+
354+
const uint ammo_slot = 8;
355+
const uint cor_job_flag = (1 << 17);
356+
IReadOnlyDictionary<uint, string> range_slot_skills = new Dictionary<uint, string>
357+
{
358+
{25,"Archery"},
359+
{26,"Marksmanship"},
360+
{48,"Fishing"}
361+
};
362+
foreach (var item in model.items)
363+
{
364+
if (!item.ContainsKey("slots") || !item.ContainsKey("skill") || !range_slot_skills.ContainsKey(item.skill)) continue;
365+
string skill = range_slot_skills[item.skill];
366+
bool ammo = item.slots == ammo_slot;
367+
if (skill == "Archery")
368+
{
369+
if (ammo)
370+
{
371+
item.ammo_type = "Arrow";
372+
}
373+
else
374+
{
375+
item.range_type = "Bow";
376+
}
377+
}
378+
else if (skill == "Marksmanship")
379+
{
380+
if (ammo)
381+
{
382+
if (item.ja.Contains("ブレット") || item.en.Contains("Bullet"))
383+
{
384+
item.ammo_type = "Bullet";
385+
}
386+
else if (item.ja.Contains("シェル") || item.en.Contains("Shell"))
387+
{
388+
item.ammo_type = "Shell";
389+
}
390+
else if (item.ja.Contains("ボルト") || item.en.Contains("Bolt"))
391+
{
392+
item.ammo_type = "Bolt";
393+
}
394+
}
395+
else {
396+
if (item.delay >= 700 && item.delay < 999)
397+
{
398+
item.range_type = "Cannon";
399+
}
400+
else if (item.delay > 450 || (item.jobs & cor_job_flag) == cor_job_flag)
401+
{
402+
item.range_type = "Gun";
403+
}
404+
else
405+
{
406+
item.range_type = "Crossbow";
407+
}
408+
}
409+
}
410+
else if (skill == "Fishing")
411+
{
412+
if (ammo)
413+
{
414+
item.ammo_type = "Bait";
415+
}
416+
else
417+
{
418+
item.range_type = "Fishing Rod";
419+
}
420+
}
421+
}
353422

354423
// Move item grammar into separate table
355424
model.items_grammar = new List<dynamic>();

0 commit comments

Comments
 (0)