Mob banish on touch + GMS-like cosmetics + Clear missing names
Fixed erroneous clean slate scroll block on equipments having certain properties. Implemented a log for bought cash items from Cash Shop. Implemented mob's player banish by touch (e. g. used by mobs from the Hypnotize quest). Thoroughly revised stylist/surgeon NPCs, adding several missing GMS-like cosmetic contents. Thoroughly revised String.wz names having missing item content throughout the WZ files. Revised missing name info for several faces throughout the WZ files. Solved a possible deadlock case related with a player vision's spawn object method. Fixed an issue with "Movement allowed only within account" items being given as "Untradeable" by NPCs. Happy Holidays and Great New Year everyone!!!
This commit is contained in:
73
tools/MapleCashCosmeticsChecker/build.xml
Normal file
73
tools/MapleCashCosmeticsChecker/build.xml
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See commented blocks below for -->
|
||||
<!-- some examples of how to customize the build. -->
|
||||
<!-- (If you delete it and reopen the project it will be recreated.) -->
|
||||
<!-- By default, only the Clean and Build commands use this build script. -->
|
||||
<!-- Commands such as Run, Debug, and Test only use this build script if -->
|
||||
<!-- the Compile on Save feature is turned off for the project. -->
|
||||
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
|
||||
<!-- in the project's Project Properties dialog box.-->
|
||||
<project name="MapleCashCosmeticsChecker" default="default" basedir=".">
|
||||
<description>Builds, tests, and runs the project MapleCashCosmeticsChecker.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
<!--
|
||||
|
||||
There exist several targets which are by default empty and which can be
|
||||
used for execution of your tasks. These targets are usually executed
|
||||
before and after some main targets. They are:
|
||||
|
||||
-pre-init: called before initialization of project properties
|
||||
-post-init: called after initialization of project properties
|
||||
-pre-compile: called before javac compilation
|
||||
-post-compile: called after javac compilation
|
||||
-pre-compile-single: called before javac compilation of single file
|
||||
-post-compile-single: called after javac compilation of single file
|
||||
-pre-compile-test: called before javac compilation of JUnit tests
|
||||
-post-compile-test: called after javac compilation of JUnit tests
|
||||
-pre-compile-test-single: called before javac compilation of single JUnit test
|
||||
-post-compile-test-single: called after javac compilation of single JUunit test
|
||||
-pre-jar: called before JAR building
|
||||
-post-jar: called after JAR building
|
||||
-post-clean: called after cleaning build products
|
||||
|
||||
(Targets beginning with '-' are not intended to be called on their own.)
|
||||
|
||||
Example of inserting an obfuscator after compilation could look like this:
|
||||
|
||||
<target name="-post-compile">
|
||||
<obfuscate>
|
||||
<fileset dir="${build.classes.dir}"/>
|
||||
</obfuscate>
|
||||
</target>
|
||||
|
||||
For list of available properties check the imported
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
|
||||
Another way to customize the build is by overriding existing main targets.
|
||||
The targets of interest are:
|
||||
|
||||
-init-macrodef-javac: defines macro for javac compilation
|
||||
-init-macrodef-junit: defines macro for junit execution
|
||||
-init-macrodef-debug: defines macro for class debugging
|
||||
-init-macrodef-java: defines macro for class execution
|
||||
-do-jar: JAR building
|
||||
run: execution of project
|
||||
-javadoc-build: Javadoc generation
|
||||
test-report: JUnit report generation
|
||||
|
||||
An example of overriding the target for project execution could look like this:
|
||||
|
||||
<target name="run" depends="MapleCashCosmeticsChecker-impl.jar">
|
||||
<exec dir="bin" executable="launcher.exe">
|
||||
<arg file="${dist.jar}"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
Notice that the overridden target depends on the jar target and not only on
|
||||
the compile target as the regular run target does. Again, for a list of available
|
||||
properties which you can use, check the target you are overriding in the
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
-->
|
||||
</project>
|
||||
4
tools/MapleCashCosmeticsChecker/lib/care/amoria/face.txt
Normal file
4
tools/MapleCashCosmeticsChecker/lib/care/amoria/face.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Male VIP: Champion Focus, Irritable Face, Motivated Look, Perplexed Stare, Dramatic Face, Rebel's Fire, Alert Face, Babyface Pout, Sad Innocence, Worrisome Glare
|
||||
Male REG: Pensive Look, Shade of Cool, Alert Face, Cool Guy Gaze, Leisure Look, Sad Innocence, Look of Wonder
|
||||
Female VIP: Athena's Grace, Hera's Radiance, Fearful Stare, Leisure Look, Strong Stare, Angel Glow, Babyface Pout, Pucker Up Face, Dollface Look, Soul's Window
|
||||
Female REG: Glitzy Face, Demure Poise Eyes, Fearful Stare, Babyface Pout, Dollface Look, Gentle Glow, Athena's Grace
|
||||
4
tools/MapleCashCosmeticsChecker/lib/care/amoria/hair.txt
Normal file
4
tools/MapleCashCosmeticsChecker/lib/care/amoria/hair.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Male VIP: Casanova, Eternal Elegance, Fuzz, Jun Pyo Hair, Metro, Natural, Rockie, Romance, Saturday Special, Super Suave, Windy Hair
|
||||
Male EXP: Antagonist, Explosion, w/ Bald Spot, Bowl Cut, Trip Scratch, Rebel, Fireball, Toben, Monkey, Head
|
||||
Female VIP: Angelica, Ballroom Classic, Carla, Caspia, Daisy Do, The Honeybun, Victorian Wrap, Darling Diva, Cecelia Twist, Classy Sass, Lana
|
||||
Female EXP: Connie, Bridget, Sammy, Carla, Stella, Angelica, Polly, Housewife, Rollered Hair
|
||||
4
tools/MapleCashCosmeticsChecker/lib/care/ariant/face.txt
Normal file
4
tools/MapleCashCosmeticsChecker/lib/care/ariant/face.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Male VIP: Insomniac Daze, Motivated Look, Fearful Glance, Rebel's Fire, Alert Face, Curious Dog
|
||||
Male REG: Edge of Emotion, Fearful Glance, Anger's Blaze, Dramatic Face, Smart Aleck, Perplexed Stare
|
||||
Female VIP: Look of Death, Motivated Look, Keen Look, Strong Stare, Pucker Up Face, Soul's Window
|
||||
Female REG: Kitty Cat, Poker Face, Look of Death, Wide-eyed Girl, Beauty Stare, Hypnotized Look, Leisure Look
|
||||
4
tools/MapleCashCosmeticsChecker/lib/care/ariant/hair.txt
Normal file
4
tools/MapleCashCosmeticsChecker/lib/care/ariant/hair.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Male VIP: Afro (small), Cabana Boy, Dreadlocks, Kravitz Locks, Line Scratch, Mane, Matinee Idol, Natural, Tornade Hair
|
||||
Male REG: Afro (small), Cabana Boy, Dreadlocks, Dreamcatcher, Hobo, Kravitz Locks, Line Scratch, Mane, Matinee Idol, Natural, Tornade Hair
|
||||
Female VIP: Bridget, Celeb, Edgy, Lana, Penelope, Rae, Boyish, Desert Flower, Tighty Bun
|
||||
Female REG: Boyish, Bridget, Celeb, Curly Stream, Dashing Damsel, Desert Flower, Lana, Oh So Windy, Palm Tree Hair, Penelope, Rae, Tighty Bun
|
||||
4
tools/MapleCashCosmeticsChecker/lib/care/cbd/face.txt
Normal file
4
tools/MapleCashCosmeticsChecker/lib/care/cbd/face.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Male VIP: Fierce Edge, Insomniac Daze, Overjoyed Smile, Shuteye, Alert Face, Curious Dog
|
||||
Male REG: Intense Stare, Demure Poise, Leisure Look, Insomniac Daze, Alert Face, Babyface Pout, Overjoyed Smile
|
||||
Female VIP: Compassion Look, Hypnotized Look, Look of Death, Shuteye, Pucker Up Face, Soul's Window
|
||||
Female REG: Glamorous Edge, Demure Poise Eyes, Leisure Look, Strong Stare, Curious Look, Beauty Stare, Compassion Look
|
||||
4
tools/MapleCashCosmeticsChecker/lib/care/cbd/hair.txt
Normal file
4
tools/MapleCashCosmeticsChecker/lib/care/cbd/hair.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Male VIP: Acorn, w/ Bald Spot, Fireball, Julian Hair, Old Man 'Do, Preppy Spike, Rebel, Toben, Vincent
|
||||
Male REG: Astro, Fireball, Julian Hair, Mane, Metrosexual, Old Man 'Do, Romance, Slick Dean, Exotica
|
||||
Female VIP: Apple Hair, Bowlcut, Connie, Disheveled, Ellie, Grandma ma', Miru, Monica, Veronica
|
||||
Female REG: Apple Hair, Bowlcut, Ellie, Grandma ma', Holla' Back Do, Monica, Oh So Windy, Sonara Wave, Tall Bun, School Girl Hair
|
||||
@@ -0,0 +1,4 @@
|
||||
Male VIP: Motivated Look, Perplexed Stare, Fearful Glance, Dramatic Face, Rebel's Fire, Alert Face, Babyface Pout, Sad Innocence, Worrisome Glare, Curious Dog, Look of Wonder, Eye of the Lion, Child's Play, Sarcastic Face
|
||||
Male REG: Ghostface Stare, Undecided Face, Worrisome Glare, Curious Dog, Motivated Look, Child's Play, Alert Face
|
||||
Female VIP: Motivated Look, Fearful Stare, Leisure Look, Strong Stare, Angel Glow, Babyface Pout, Pucker Up Face, Dollface Look, Hopeless Gaze, Soul's Window, Curious Look, Wide-eyed Girl, Innocent Look, Tender Love
|
||||
Female REG: Gentle Glow, Kitty Cat, Motivated Look, Hopeless Gaze, Keen Look, Leisure Look, Curious Look
|
||||
@@ -0,0 +1,6 @@
|
||||
Male VIP: Aran Cut, Catalyst, Acorn, Topknot, Wind, Shaggy Wax, The Coco
|
||||
Male REG: Aran Cut, Catalyst, Evan Hair (M), Acorn, Shaggy Wax, The Coco, The Mo Rawk, Topknot, Wind
|
||||
Male EXP: Aran Cut, Acorn, Shaggy Wax, The Coco, The Mo Rawk, Topknot, Wind, Buzz
|
||||
Female VIP: Angelica, Aran Hair, Chantelle, Crazy Medusa, Fourtail Braids, Frizzle Dizzle, Full Bangs
|
||||
Female REG: Angelica, Aran Hair, Chantelle, Crazy Medusa, Evan Hair (F), Fourtail Braids, Full Bangs, Rainbow, Stella
|
||||
Female EXP: Angelica, Aran Hair, Chantelle, Crazy Medusa, Fourtail Braids, Full Bangs, Stella, Head
|
||||
@@ -0,0 +1,4 @@
|
||||
Male VIP:
|
||||
Male REG:
|
||||
Female VIP:
|
||||
Female REG:
|
||||
@@ -0,0 +1,6 @@
|
||||
Male VIP: Antagonist, Aran Cut, Cornrow, Dragon Tail, Rockstar, Short Top Tail, Male Runway Hair
|
||||
Male REG: Antagonist, Aran Cut, Cornrow, Dragon Tail, Dual Blade Hair, Hontas, Lucky Charms, Rockstar, Short Top Tail
|
||||
Male EXP: Antagonist, Aran Cut, Cornrow, Dragon Tail, Hontas, Lucky Charms, Short Top Tail, Head
|
||||
Female VIP: Aran Hair, Bridget, Gardener, Pei Pei, Penelope, Shaggy Dog, Ravishing Raven
|
||||
Female REG: Annie, Aran Hair, Curly Stream, Gardener, Pei Pei, Penelope, Ravishing Raven, Shaggy Dog, Super Diva
|
||||
Female EXP: Annie, Aran Hair, Curly Stream, Gardener, Pei Pei, Penelope, Shaggy Dog, Rollered Hair
|
||||
@@ -0,0 +1,4 @@
|
||||
Male VIP: Motivated Look, Perplexed Stare, Fearful Glance, Dramatic Face, Rebel's Fire, Alert Face, Babyface Pout, Sad Innocence, Worrisome Glare, Curious Dog, Look of Wonder, Cool Guy Gaze
|
||||
Male REG: Hypnotized Look, Edge of Emotion, Insomniac Daze, Dramatic Face, Perplexed Stare, Sad Innocence, Overjoyed Smile
|
||||
Female VIP: Motivated Look, Fearful Stare, Leisure Look, Strong Stare, Angel Glow, Babyface Pout, Pucker Up Face, Dollface Look, Hopeless Gaze, Soul's Window, Curious Look, Wisdom Glance
|
||||
Female REG: Glamorous Edge, Kitty Cat, Leisure Look, Hopeless Gaze, Angel Glow, Pucker Up Face, Glitzy Face
|
||||
@@ -0,0 +1,6 @@
|
||||
Male VIP: Afro (big), Bowl Cut, Fuzz, Hector Hair, Julian Hair, Tentacle Hair, Trip Scratch, Urban Dragon
|
||||
Male REG: Afro (big), Bowl Cut, Bubba GoaTee, Fuzz, Hector Hair, Grooovy Do, Julian Hair, Hip Hop Cut, Rise N Shine, Robot, Tentacle Hair, The Mo Rawk, Urban Dragon
|
||||
Male EXP: Afro (big), Bowl Cut, Bubba GoaTee, Fuzz, Grooovy Do, Julian Hair, Rise N Shine, Robot, Tentacle Hair, The Mo Rawk, Urban Dragon, Buzz
|
||||
Female VIP: Apple Hair, Candy Heart, Eye-skimming Bang, Female Runway Hair, Lovely Ladyhawk, Naomi, Pigtails, Ayu
|
||||
Female REG: Apple Hair, Ayu, Bohemian Hair, Candy Heart, Eye-skimming Bang, Female Runway Hair, Jean, Lovely Ladyhawk, Naomi, Pigtails, Rastafari, Sonara Wave, Tall Bun, Minnie
|
||||
Female EXP: Apple Hair, Ayu, Bohemian Hair, Candy Heart, Eye-skimming Bang, Female Runway Hair, Jean, Lovely Ladyhawk, Pigtails, Rastafari, Tall Bun, Minnie, Head
|
||||
@@ -0,0 +1,4 @@
|
||||
Male VIP: Motivated Look, Perplexed Stare, Fearful Glance, Rebel's Fire, Alert Face, Babyface Pout, Sad Innocence, Curious Dog, Smart Aleck, Child's Play, Sarcastic Face
|
||||
Male REG: Demure Poise, Shade of Cool, Sad Innocence, Look of Wonder, Leisure Look, Alert Face, Cool Guy Gaze
|
||||
Female VIP: Hypnotized Look, Motivated Look, Keen Look, Strong Stare, Babyface Pout, Pucker Up Face, Hopeless Gaze, Soul's Window, Look of Death, Innocent Look, Tender Love
|
||||
Female REG: Gentle Glow, Poker Face, Athena's Grace, Compassion Look, Fearful Stare, Wisdom Glance, Wide-eyed Girl
|
||||
@@ -0,0 +1,4 @@
|
||||
Male VIP: Buddha Fire, Cozy Amber, Dreadlocks, Gruff & Tough, Monkey, Puffy Fro, Shaggy Dragon, Urban Dragon
|
||||
Male EXP: Alex, Buddha Fire, Cozy Amber, Dreadlocks, Exotica, Gruff & Tough, Kongfu Braids, Monkey, Puffy Fro, Rising Rocker, Shaggy Dragon, The Curl, Urban Dragon, Buzz
|
||||
Female VIP: Chantelle, Cutey Doll, Housewife, Lady Mariko, Lori, Ming Ming, Pei Pei, Tighty Bun
|
||||
Female EXP: Chantelle, Cutey Doll, Demolishing Diva, Housewife, Lady Mariko, Lori, Ming Ming, Onna's Honor, Pei Pei, Perfect Stranger, Spunky Do, Tighty Bun, Short Twin Tails, Head
|
||||
4
tools/MapleCashCosmeticsChecker/lib/care/nlc/face.txt
Normal file
4
tools/MapleCashCosmeticsChecker/lib/care/nlc/face.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Male VIP: Curious Dog, Motivated Look, Perplexed Stare, Fearful Glance, Dramatic Face, Rebel's Fire, Alert Face, Babyface Pout, Worrisome Glare
|
||||
Male REG: Undecided Face, Shade of Cool, Intense Stare, Perplexed Stare, Worrisome Glare, Cool Guy Gaze, Insomniac Daze
|
||||
Female VIP: Beauty Stare, Fearful Stare, Leisure Look, Strong Stare, Angel Glow, Babyface Pout, Pucker Up Face, Hopeless Gaze, Soul's Window
|
||||
Female REG: Demure Poise Eyes, Glitzy Face, Hypnotized Look, Motivated Look, Gentle Glow, Dollface Look, Soul's Window
|
||||
4
tools/MapleCashCosmeticsChecker/lib/care/nlc/hair.txt
Normal file
4
tools/MapleCashCosmeticsChecker/lib/care/nlc/hair.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Male VIP: Afro (big), Hector Hair, Messy Spike, Roving Rockstar, Spiky Shag, The Coco, Unbalanced
|
||||
Male EXP: Afro (big), Alex, Evan Hair (M), Fury, Hector Hair, Messy Spike, Roving Rockstar, Spiky Shag, The Coco, Tribal Buzz, Unbalanced, Head
|
||||
Female VIP: Eye-skimming Bang, Fluffy Dolly, Low Cut Bob, Messy Pigtails, Model's Ambition, Roxy, Sunflower Power
|
||||
Female EXP: Demolishing Diva, Eye-skimming Bang, Evan Hair (F), Fluffy Dolly, Low Cut Bob, Maiden's Weave, Messy Pigtails, Model's Ambition, Roxy, Streaky Siren, Sunflower Power, Rollered Hair
|
||||
4
tools/MapleCashCosmeticsChecker/lib/care/orbis/face.txt
Normal file
4
tools/MapleCashCosmeticsChecker/lib/care/orbis/face.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Male VIP: Motivated Look, Perplexed Stare, Fearful Glance, Dramatic Face, Rebel's Fire, Alert Face, Babyface Pout, Sad Innocence, Worrisome Glare, Curious Dog, Look of Wonder, Child's Play, Sarcastic Face
|
||||
Male REG: Pensive Look, Fearful Glance, Cool Guy Gaze, Overjoyed Smile, Child's Play, Hypnotized Look, Dramatic Face
|
||||
Female VIP: Motivated Look, Fearful Stare, Leisure Look, Strong Stare, Angel Glow, Babyface Pout, Pucker Up Face, Dollface Look, Hopeless Gaze, Soul's Window, Curious Look, Innocent Look, Tender Love
|
||||
Female REG: Gentle Glow, Poker Face, Compassion Look, Angel Glow, Wisdom Glance, Soul's Window, Dollface Look
|
||||
6
tools/MapleCashCosmeticsChecker/lib/care/orbis/hair.txt
Normal file
6
tools/MapleCashCosmeticsChecker/lib/care/orbis/hair.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
Male VIP: Clean-Cut Short Hair, Foil Perm, Messy Spike, Metrosexual, Mohecan Shaggy Do, Spiky Shag, Tristan
|
||||
Male REG: Baldie, Clean-Cut Short Hair, Foil Perm, Messy Spike, Metrosexual, Mohecan Shaggy Do, Neon Cactus, Receding Hair, Spiky Shag, Tristan, Updo
|
||||
Male EXP: Baldie, Clean-Cut Short Hair, Foil Perm, Messy Spike, Mohecan Shaggy Do, Receding Hair, Spiky Shag, Tristan, Updo
|
||||
Female VIP: Bow Hair, Caspia, Monica, Princessa, Rose, The Honeybun, Top Tied Hair
|
||||
Female REG: Bow Hair, Caspia, Dashing Damsel, Lilin Hair, Monica, Princess Warrior, Princessa, Rose, Short Twin Tails, The Honeybun, Top Tied Hair, Bowl Cut
|
||||
Female EXP: Bow Hair, Caspia, Lilin Hair, Monica, Princess Warrior, Princessa, Rose, Short Twin Tails, Top Tied Hair, Bowl Cut
|
||||
4
tools/MapleCashCosmeticsChecker/lib/care/showa/face.txt
Normal file
4
tools/MapleCashCosmeticsChecker/lib/care/showa/face.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Male VIP: Fierce Edge, Motivated Look, Fearful Glance, Rebel's Fire, Alert Face, Curious Dog
|
||||
Male REG: Ghostface Stare, Intense Stare, Shuteye, Motivated Look, Fierce Edge, Irritable Face, Overjoyed Smile
|
||||
Female VIP: Compassion Look, Motivated Look, Keen Look, Strong Stare, Pucker Up Face, Soul's Window
|
||||
Female REG: Glitzy Face, Glamorous Edge, Motivated Look, Leisure Look, Look of Death, Shuteye, Beauty Stare
|
||||
4
tools/MapleCashCosmeticsChecker/lib/care/showa/hair.txt
Normal file
4
tools/MapleCashCosmeticsChecker/lib/care/showa/hair.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Male VIP: Dreamcatcher, Clean-Cut Short Hair, Dragon Tail, Gruff & Tough, Matinee Idol, Metrosexual, Mohecan Shaggy Do, Puffy Fro, Short Top Tail, Tristan
|
||||
Male REG: Clean-Cut Short Hair, Dragon Tail, Dreamcatcher, Gruff & Tough, Lion Hair, Matinee Idol, Metrosexual, Mohecan Shaggy Do, Puffy Fro, Short Top Tail, Spiky Tail, Tristan
|
||||
Female VIP: Candy Heart, Dambi, Fourtail Braids, Lady Mariko, Mary, Polly, Princessa, Sammy, Short Shaggy Hair, Top Tied Hair
|
||||
Female REG: Candy Heart, Dambi, Fourtail Braids, Jean, Lady Mariko, Onna's Honor, Paula, Princess Warrior, Princessa, Short Shaggy Hair, Streaky Siren, Top Tied Hair, Palm Tree Hair
|
||||
10
tools/MapleCashCosmeticsChecker/lib/colors.txt
Normal file
10
tools/MapleCashCosmeticsChecker/lib/colors.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
amoria 0 1 3 4 5 7
|
||||
ariant 0 1 3 6 7
|
||||
cbd 2 3 4 7
|
||||
henesys 0 1 2 4 6 7
|
||||
kerning
|
||||
ludi 2 3 4 5 7
|
||||
mulung 0 1 3 5 6 7
|
||||
nlc 1 2 3 4 5 6 7
|
||||
orbis 1 3 4 7
|
||||
showa 0 1 2 3 4 5 7
|
||||
213
tools/MapleCashCosmeticsChecker/lib/result.txt
Normal file
213
tools/MapleCashCosmeticsChecker/lib/result.txt
Normal file
@@ -0,0 +1,213 @@
|
||||
# Report File autogenerated from the MapleCashCosmeticsChecker feature by Ronan Lana.
|
||||
# Generated data takes into account several data info from the server source files and the server-side WZ.xmls.
|
||||
|
||||
Found 42 entries with missing cosmetic entries.
|
||||
NPC 1012103:VIP
|
||||
30060, 30140, 30200, 30210, 30310, 33040, 33100
|
||||
31150, 31300, 31350, 31700, 31740, 34050, 34110
|
||||
|
||||
NPC 1012104:EXP
|
||||
30030, 30140, 30200, 30210, 30310, 30610, 33040, 33100
|
||||
31070, 31150, 31300, 31350, 31430, 31700, 34050, 34110
|
||||
|
||||
NPC 1012104:REG
|
||||
30060, 30140, 30200, 30210, 30310, 30610, 33040, 33100
|
||||
31070, 31080, 31150, 31300, 31350, 31700, 34050, 34110
|
||||
|
||||
NPC 1052004:VIP
|
||||
20000, 20001, 20003, 20004, 20005, 20006, 20007, 20008, 20012, 20014, 20015, 20022, 20028, 20031
|
||||
21000, 21001, 21002, 21003, 21004, 21005, 21006, 21007, 21008, 21012, 21013, 21014, 21023, 21026
|
||||
|
||||
NPC 1052005:REG
|
||||
20000, 20005, 20008, 20012, 20016, 20022, 20032
|
||||
21000, 21002, 21008, 21014, 21020, 21024, 21029
|
||||
|
||||
NPC 1052100:VIP
|
||||
30040, 30130, 30780, 30850, 30860, 30920, 33040
|
||||
31090, 31140, 31330, 31440, 31760, 31880, 34050
|
||||
|
||||
NPC 1052101:EXP
|
||||
30130, 30430, 30520, 30770, 30780, 30850, 30920, 33040
|
||||
31060, 31140, 31330, 31520, 31760, 31880, 34010, 34050
|
||||
|
||||
NPC 1052101:REG
|
||||
30040, 30130, 30520, 30770, 30780, 30850, 30920, 33040
|
||||
31060, 31140, 31330, 31440, 31520, 31750, 31760, 31880, 34050
|
||||
|
||||
NPC 2010001:VIP
|
||||
30230, 30260, 30280, 30340, 30490
|
||||
31110, 31220, 31230, 31630, 31790
|
||||
|
||||
NPC 2010002:VIP
|
||||
20000, 20001, 20003, 20004, 20005, 20006, 20007, 20008, 20012, 20014, 20022, 20028, 20031
|
||||
21000, 21001, 21002, 21003, 21004, 21005, 21006, 21007, 21008, 21012, 21014, 21023, 21026
|
||||
|
||||
NPC 2012007:EXP
|
||||
30230, 30280, 30340, 30490, 30530, 30740
|
||||
31110, 31220, 31230, 31710, 31790, 31890, 31930
|
||||
|
||||
NPC 2012007:REG
|
||||
30230, 30260, 30280, 30340, 30490, 30530, 30630, 30740
|
||||
31110, 31220, 31230, 31630, 31650, 31710, 31790, 31890, 31930
|
||||
|
||||
NPC 2012009:REG
|
||||
20003, 20011, 20021, 20022, 20023, 20027, 20031
|
||||
21004, 21007, 21010, 21012, 21020, 21021, 21030
|
||||
|
||||
NPC 2040019:REG
|
||||
20001, 20003, 20007, 20013, 20021, 20023, 20025
|
||||
21002, 21004, 21006, 21008, 21022, 21027, 21029
|
||||
|
||||
NPC 2041007:VIP
|
||||
30160, 30190, 30250, 30640, 30660, 30840, 30870, 30990
|
||||
31270, 31290, 31550, 31680, 31810, 31830, 31840, 31870
|
||||
|
||||
NPC 2041009:EXP
|
||||
30030, 30190, 30220, 30250, 30540, 30610, 30620, 30640, 30650, 30660, 30840, 30990
|
||||
31170, 31270, 31430, 31510, 31540, 31550, 31600, 31680, 31810, 31830, 31840, 31870
|
||||
|
||||
NPC 2041009:REG
|
||||
30190, 30220, 30250, 30540, 30610, 30620, 30640, 30650, 30660, 30840, 30870, 30940, 30990
|
||||
31170, 31270, 31290, 31510, 31540, 31550, 31600, 31640, 31680, 31810, 31830, 31840, 31870
|
||||
|
||||
NPC 2041010:VIP
|
||||
20000, 20001, 20003, 20004, 20005, 20006, 20007, 20008, 20011, 20012, 20014, 20031
|
||||
21000, 21001, 21002, 21003, 21004, 21005, 21006, 21007, 21008, 21010, 21012, 21014
|
||||
|
||||
NPC 2090100:VIP
|
||||
30150, 30240, 30370, 30420, 30640, 30710, 30750, 30810
|
||||
31140, 31160, 31180, 31300, 31460, 31470, 31660, 31910
|
||||
|
||||
NPC 2090101:EXP
|
||||
30030, 30150, 30240, 30370, 30420, 30550, 30600, 30640, 30700, 30710, 30720, 30750, 30810, 30830
|
||||
31140, 31160, 31180, 31210, 31300, 31430, 31460, 31470, 31660, 31690, 31800, 31890, 31910, 31940
|
||||
|
||||
NPC 2090104:REG
|
||||
20002, 20005, 20007, 20011, 20014, 20017, 20029
|
||||
21001, 21010, 21013, 21018, 21020, 21021, 21030
|
||||
|
||||
NPC 2090104:VIP
|
||||
20000, 20001, 20004, 20005, 20006, 20007, 20009, 20012, 20022, 20028, 20031
|
||||
21000, 21003, 21005, 21006, 21008, 21009, 21011, 21012, 21023, 21024, 21026
|
||||
|
||||
NPC 2100005:REG
|
||||
30150, 30170, 30180, 30320, 30330, 30410, 30460, 30680, 30800, 30820, 30900
|
||||
31090, 31190, 31330, 31340, 31400, 31420, 31520, 31620, 31650, 31660, 34000
|
||||
|
||||
NPC 2100006:VIP
|
||||
30150, 30170, 30180, 30320, 30330, 30410, 30460, 30820, 30900
|
||||
31040, 31090, 31190, 31330, 31340, 31400, 31420, 31620, 31660
|
||||
|
||||
NPC 2100008:VIP
|
||||
20000, 20004, 20005, 20012, 20013, 20031
|
||||
21000, 21003, 21006, 21009, 21012, 21024
|
||||
|
||||
NPC 2100009:REG
|
||||
20001, 20003, 20009, 20010, 20025, 20031
|
||||
21002, 21009, 21011, 21013, 21016, 21029, 21030
|
||||
|
||||
NPC 9120100:VIP
|
||||
30260, 30280, 30340, 30710, 30780, 30800, 30810, 30820, 30920
|
||||
31000, 31030, 31100, 31350, 31460, 31550, 31770, 31790, 31850
|
||||
|
||||
NPC 9120101:REG
|
||||
30260, 30280, 30340, 30360, 30710, 30780, 30790, 30800, 30810, 30820, 30920
|
||||
31350, 31410, 31460, 31540, 31550, 31710, 31720, 31770, 31790, 31800, 31850, 34000
|
||||
|
||||
NPC 9120102:VIP
|
||||
20000, 20004, 20005, 20012, 20020, 20031
|
||||
21000, 21003, 21006, 21012, 21021, 21024
|
||||
|
||||
NPC 9120103:REG
|
||||
20000, 20016, 20019, 20020, 20021, 20024, 20026
|
||||
21000, 21002, 21009, 21016, 21022, 21025, 21027
|
||||
|
||||
NPC 9201015:VIP
|
||||
30050, 30300, 30410, 30450, 30510, 30570, 30580, 30590, 30660, 30910
|
||||
31150, 31220, 31260, 31310, 31420, 31480, 31490, 31580, 31590, 31610, 31630
|
||||
|
||||
NPC 9201016:EXP
|
||||
30000, 30020, 30110, 30130, 30160, 30190, 30240, 30270, 30430
|
||||
31000, 31030, 31050, 31070, 31090, 31150, 31310, 31910, 34010
|
||||
|
||||
NPC 9201018:VIP
|
||||
20000, 20001, 20003, 20004, 20005, 20006, 20007, 20008, 20018, 20019
|
||||
21001, 21002, 21003, 21004, 21005, 21006, 21007, 21012, 21018, 21019
|
||||
|
||||
NPC 9201019:REG
|
||||
20002, 20005, 20007, 20011, 20014, 20027, 20029
|
||||
21001, 21005, 21007, 21017, 21018, 21020, 21022
|
||||
|
||||
NPC 9201063:EXP
|
||||
30250, 30400, 30430, 30440, 30490, 30730, 30830, 30870, 30880, 33100
|
||||
31320, 31450, 31560, 31570, 31690, 31720, 31730, 31830, 34010
|
||||
|
||||
NPC 9201064:VIP
|
||||
30250, 30490, 30730, 30870, 30880, 33100
|
||||
31320, 31450, 31560, 31730, 31830
|
||||
|
||||
NPC 9201069:VIP
|
||||
20000, 20001, 20003, 20004, 20005, 20006, 20008, 20012, 20031
|
||||
21001, 21002, 21003, 21004, 21005, 21006, 21008, 21012, 21016
|
||||
|
||||
NPC 9201070:REG
|
||||
20001, 20008, 20011, 20013, 20024, 20029, 20032
|
||||
21000, 21007, 21011, 21012, 21017, 21020, 21022
|
||||
|
||||
NPC 9270023:REG
|
||||
20002, 20005, 20006, 20013, 20017, 20021, 20024
|
||||
21002, 21003, 21014, 21016, 21017, 21021, 21027
|
||||
|
||||
NPC 9270024:VIP
|
||||
20005, 20012, 20013, 20020, 20021, 20026
|
||||
21006, 21009, 21011, 21012, 21021, 21025
|
||||
|
||||
NPC 9270036:VIP
|
||||
30000, 30020, 30110, 30120, 30270, 30290, 30310, 30670, 30840
|
||||
31010, 31050, 31110, 31120, 31240, 31250, 31280, 31670, 31810
|
||||
|
||||
NPC 9270037:REG
|
||||
30110, 30180, 30260, 30290, 30300, 30350, 30470, 30720, 30840
|
||||
31110, 31200, 31250, 31280, 31600, 31640, 31670, 31810, 34020
|
||||
|
||||
Unused cosmetics: 22
|
||||
30010 Zeta
|
||||
30070 Back
|
||||
30080 Buzzcut
|
||||
30090 Mohawk
|
||||
30100 Fantasy
|
||||
30480 Babby Cut
|
||||
30560 Grand Lionman
|
||||
30690 Metro Man
|
||||
30760 Bowling Ball
|
||||
30890 Eastern Mystery
|
||||
30930 Boy Band Cut
|
||||
30950 Volume Cut
|
||||
31020 Francesca
|
||||
31130 Jolie
|
||||
31530 Zessica
|
||||
31780 ???? ??
|
||||
31820 Grace
|
||||
31860 Laguna Beach
|
||||
31920 CL Hair
|
||||
31950 Vintage Flip
|
||||
33000 Prince Cut
|
||||
34030 Designer Hair
|
||||
|
||||
Missing cosmetic itemids: 15
|
||||
Bohemian Hair
|
||||
Bow Hair
|
||||
Clean-Cut Short Hair
|
||||
Dual Blade Hair
|
||||
Evan Hair (F)
|
||||
Evan Hair (M)
|
||||
Explosion
|
||||
Lilin Hair
|
||||
Low Cut Bob
|
||||
Messy Pigtails
|
||||
Oh So Windy
|
||||
Spiky Shag
|
||||
Top Tied Hair
|
||||
Updo
|
||||
Windy Hair
|
||||
|
||||
3
tools/MapleCashCosmeticsChecker/manifest.mf
Normal file
3
tools/MapleCashCosmeticsChecker/manifest.mf
Normal file
@@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
||||
@@ -0,0 +1,722 @@
|
||||
/*
|
||||
This file is part of the HeavenMS MapleStory Server
|
||||
Copyleft (L) 2016 - 2018 RonanLana
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation version 3 as published by
|
||||
the Free Software Foundation. You may not use, modify or distribute
|
||||
this program under any other version of the GNU Affero General Public
|
||||
License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package maplecashcosmeticschecker;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author RonanLana
|
||||
|
||||
This application parses the cosmetic recipes defined within "lib/care" folder, loads
|
||||
every present cosmetic itemid from the XML data, then checks the scripts for missed
|
||||
cosmetics within the stylist/surgeon. Results from the search are reported in a report
|
||||
file.
|
||||
|
||||
Note: to best make use of this feature, set ignoreCurrentScriptCosmetics = true. This
|
||||
way, every available cosmetic present on the recipes will be listed on the report.
|
||||
|
||||
Estimated parse time: 1 minute
|
||||
|
||||
*/
|
||||
public class MapleCashCosmeticsChecker {
|
||||
static String libPath = "lib";
|
||||
static String handbookPath = "../../handbook";
|
||||
static String wzPath = "../../wz";
|
||||
static String scriptPath = "../../scripts";
|
||||
|
||||
private static PrintWriter printWriter = null;
|
||||
static InputStreamReader fileReader = null;
|
||||
static BufferedReader bufferedReader = null;
|
||||
|
||||
static boolean ignoreCurrentScriptCosmetics = false;
|
||||
|
||||
static int initialStringLength = 50;
|
||||
|
||||
static byte status = 0;
|
||||
|
||||
static Map<Integer, Set<Integer>> scriptCosmetics = new HashMap<>();
|
||||
static Map<Integer, String> scriptEntries = new HashMap<>(500);
|
||||
|
||||
static Set<Integer> allCosmetics = new HashSet<>();
|
||||
|
||||
static Set<Integer> unusedCosmetics = new HashSet<>();
|
||||
static Map<Integer, List<Integer>> usedCosmetics = new HashMap<>();
|
||||
|
||||
static Map<Integer, String> couponNames = new HashMap<>();
|
||||
static Map<Integer, Integer> cosmeticNpcs = new HashMap<>(); // expected only 1 NPC per cosmetic coupon (town care/salon)
|
||||
static Map<List<String>, Integer> cosmeticNpcids = new HashMap<>();
|
||||
|
||||
static Set<String> missingCosmeticNames = new HashSet<>();
|
||||
static Map<String, Integer> cosmeticNameIds = new HashMap<>();
|
||||
static Map<Integer, String> cosmeticIdNames = new HashMap<>();
|
||||
|
||||
static Map<Pair<Integer, String>, Set<Integer>> missingCosmeticsNpcTypes = new HashMap<>();
|
||||
|
||||
private static String getName(String token) {
|
||||
int i, j;
|
||||
char[] dest;
|
||||
String d;
|
||||
|
||||
i = token.lastIndexOf("name");
|
||||
i = token.indexOf("\"", i) + 1; //lower bound of the string
|
||||
j = token.indexOf("\"", i); //upper bound
|
||||
|
||||
dest = new char[initialStringLength];
|
||||
token.getChars(i, j, dest, 0);
|
||||
|
||||
d = new String(dest);
|
||||
return(d.trim());
|
||||
}
|
||||
|
||||
private static String getValue(String token) {
|
||||
int i, j;
|
||||
char[] dest;
|
||||
String d;
|
||||
|
||||
i = token.lastIndexOf("value");
|
||||
i = token.indexOf("\"", i) + 1; //lower bound of the string
|
||||
j = token.indexOf("\"", i); //upper bound
|
||||
|
||||
dest = new char[initialStringLength];
|
||||
token.getChars(i, j, dest, 0);
|
||||
|
||||
d = new String(dest);
|
||||
return(d.trim());
|
||||
}
|
||||
|
||||
private static void forwardCursor(int st) {
|
||||
String line = null;
|
||||
|
||||
try {
|
||||
while(status >= st && (line = bufferedReader.readLine()) != null) {
|
||||
simpleToken(line);
|
||||
}
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private static void simpleToken(String token) {
|
||||
if(token.contains("/imgdir")) {
|
||||
status -= 1;
|
||||
}
|
||||
else if(token.contains("imgdir")) {
|
||||
status += 1;
|
||||
}
|
||||
}
|
||||
|
||||
private static void translateToken(String token) {
|
||||
if(token.contains("/imgdir")) {
|
||||
status -= 1;
|
||||
}
|
||||
else if(token.contains("imgdir")) {
|
||||
status += 1;
|
||||
|
||||
if (status == 3) {
|
||||
String d = getName(token);
|
||||
|
||||
if (!(d.contentEquals("Face") || d.contentEquals("Hair"))) {
|
||||
forwardCursor(status);
|
||||
}
|
||||
} else if (status == 4) {
|
||||
String d = getName(token);
|
||||
int itemid = Integer.valueOf(d);
|
||||
|
||||
int cosmeticid;
|
||||
if (itemid >= 30000) {
|
||||
cosmeticid = (itemid / 10) * 10;
|
||||
} else {
|
||||
cosmeticid = itemid - ((itemid / 100) % 10) * 100;
|
||||
}
|
||||
|
||||
allCosmetics.add(cosmeticid);
|
||||
forwardCursor(status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void readEqpStringData(String eqpStringDirectory) throws IOException {
|
||||
String line;
|
||||
|
||||
fileReader = new InputStreamReader(new FileInputStream(eqpStringDirectory), "UTF-8");
|
||||
bufferedReader = new BufferedReader(fileReader);
|
||||
|
||||
while((line = bufferedReader.readLine()) != null) {
|
||||
translateToken(line);
|
||||
}
|
||||
|
||||
bufferedReader.close();
|
||||
fileReader.close();
|
||||
}
|
||||
|
||||
private static void loadCosmeticWzData() throws IOException {
|
||||
System.out.println("Reading String.wz ...");
|
||||
readEqpStringData(wzPath + "/String.wz/Eqp.img.xml");
|
||||
}
|
||||
|
||||
private static void setCosmeticUsage(List<Integer> usedByNpcids, int cosmeticid) {
|
||||
if (!usedByNpcids.isEmpty()) {
|
||||
usedCosmetics.put(cosmeticid, usedByNpcids);
|
||||
} else {
|
||||
unusedCosmetics.add(cosmeticid);
|
||||
}
|
||||
}
|
||||
|
||||
private static void listFiles(String directoryName, ArrayList<File> files) {
|
||||
File directory = new File(directoryName);
|
||||
|
||||
// get all the files from a directory
|
||||
File[] fList = directory.listFiles();
|
||||
for (File file : fList) {
|
||||
if (file.isFile()) {
|
||||
files.add(file);
|
||||
} else if (file.isDirectory()) {
|
||||
listFiles(file.getAbsolutePath(), files);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int getNpcIdFromFilename(String name) {
|
||||
try {
|
||||
return Integer.valueOf(name.substring(0, name.indexOf('.')));
|
||||
} catch(Exception e) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
private static List<Integer> findCosmeticDataNpcids(int itemid) {
|
||||
List<Integer> npcids = new LinkedList<>();
|
||||
for (Entry<Integer, Set<Integer>> sc : scriptCosmetics.entrySet()) {
|
||||
if (sc.getValue().contains(itemid)) {
|
||||
npcids.add(itemid);
|
||||
}
|
||||
}
|
||||
|
||||
return npcids;
|
||||
}
|
||||
|
||||
private static void loadScripts() throws IOException {
|
||||
ArrayList<File> files = new ArrayList<>();
|
||||
listFiles(scriptPath + "/npc", files);
|
||||
|
||||
for(File f : files) {
|
||||
Integer npcid = getNpcIdFromFilename(f.getName());
|
||||
|
||||
//System.out.println("Parsing " + f.getAbsolutePath());
|
||||
fileReader = new InputStreamReader(new FileInputStream(f), "UTF-8");
|
||||
bufferedReader = new BufferedReader(fileReader);
|
||||
|
||||
String line;
|
||||
|
||||
StringBuilder stringBuffer = new StringBuilder();
|
||||
|
||||
boolean cosmeticNpc = false;
|
||||
Set<Integer> cosmeticids = new HashSet<>();
|
||||
while((line = bufferedReader.readLine())!=null){
|
||||
String[] s = line.split("hair_. = Array\\(", 2);
|
||||
|
||||
if (s.length > 1) {
|
||||
cosmeticNpc = true;
|
||||
s = s[1].split("\\)", 2);
|
||||
s = s[0].split(", ");
|
||||
|
||||
for (String st : s) {
|
||||
if (!st.isEmpty()) {
|
||||
int itemid = Integer.valueOf(st);
|
||||
cosmeticids.add(itemid);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
s = line.split("face_. = Array\\(", 2);
|
||||
|
||||
if (s.length > 1) {
|
||||
cosmeticNpc = true;
|
||||
s = s[1].split("\\)", 2);
|
||||
s = s[0].split(", ");
|
||||
|
||||
for (String st : s) {
|
||||
if (!st.isEmpty()) {
|
||||
int itemid = Integer.valueOf(st);
|
||||
cosmeticids.add(itemid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stringBuffer.append(line).append("\n");
|
||||
}
|
||||
|
||||
scriptEntries.put(npcid, stringBuffer.toString());
|
||||
|
||||
if (cosmeticNpc) {
|
||||
scriptCosmetics.put(npcid, cosmeticids);
|
||||
}
|
||||
|
||||
bufferedReader.close();
|
||||
fileReader.close();
|
||||
}
|
||||
}
|
||||
|
||||
private static void processCosmeticScriptData() throws IOException {
|
||||
System.out.println("Reading script files ...");
|
||||
loadScripts();
|
||||
|
||||
if (ignoreCurrentScriptCosmetics) {
|
||||
for (Set<Integer> npcCosmetics : scriptCosmetics.values()) {
|
||||
npcCosmetics.clear();
|
||||
}
|
||||
}
|
||||
|
||||
for (Integer itemid : allCosmetics) {
|
||||
List<Integer> npcids = findCosmeticDataNpcids(itemid);
|
||||
setCosmeticUsage(npcids, itemid);
|
||||
}
|
||||
}
|
||||
|
||||
private static List<Integer> loadCosmeticCouponids() throws IOException {
|
||||
List<Integer> couponItemids = new LinkedList<>();
|
||||
|
||||
fileReader = new InputStreamReader(new FileInputStream(handbookPath + "/Cash.txt"), "UTF-8");
|
||||
bufferedReader = new BufferedReader(fileReader);
|
||||
|
||||
String line;
|
||||
while((line = bufferedReader.readLine())!=null){
|
||||
if (line.isEmpty()) continue;
|
||||
String[] s = line.split(" - ", 3);
|
||||
|
||||
int itemid = Integer.valueOf(s[0]);
|
||||
if (itemid >= 5150000 && itemid < 5160000) {
|
||||
couponItemids.add(itemid);
|
||||
couponNames.put(itemid, s[1]);
|
||||
}
|
||||
}
|
||||
|
||||
bufferedReader.close();
|
||||
fileReader.close();
|
||||
|
||||
return couponItemids;
|
||||
}
|
||||
|
||||
private static List<Integer> findItemidOnScript(int itemid) {
|
||||
List<Integer> files = new LinkedList<>();
|
||||
String t = String.valueOf(itemid);
|
||||
|
||||
for (Entry<Integer, String> text : scriptEntries.entrySet()) {
|
||||
if (text.getValue().contains(t)) {
|
||||
files.add(text.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
private static void loadCosmeticCouponNpcs() throws IOException {
|
||||
System.out.println("Locating cosmetic NPCs ...");
|
||||
|
||||
for (Integer itemid : loadCosmeticCouponids()) {
|
||||
List<Integer> npcids = findItemidOnScript(itemid);
|
||||
|
||||
if (!npcids.isEmpty()) {
|
||||
cosmeticNpcs.put(itemid, npcids.get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private enum CosmeticType {
|
||||
HAIRSTYLE,
|
||||
HAIRCOLOR,
|
||||
DIRTYHAIR,
|
||||
FACE_SURGERY,
|
||||
EYE_COLOR,
|
||||
SKIN_CARE
|
||||
}
|
||||
|
||||
private static Pair<Integer, CosmeticType> parseCosmeticCoupon(String[] tokens) {
|
||||
for (int i = 0; i < tokens.length; i++) {
|
||||
String s = tokens[i];
|
||||
|
||||
if (s.startsWith("Hair")) {
|
||||
if (s.contentEquals("Hairstyle")) {
|
||||
return new Pair<>(i, CosmeticType.HAIRSTYLE);
|
||||
} else {
|
||||
if (i - 1 >= 0 && tokens[i - 1].contentEquals("Dirty")) {
|
||||
return new Pair<>(i - 1, CosmeticType.DIRTYHAIR);
|
||||
} else if (i + 1 < tokens.length && tokens[i + 1].contentEquals("Color")) {
|
||||
return new Pair<>(i, CosmeticType.HAIRCOLOR);
|
||||
} else {
|
||||
return new Pair<>(i, CosmeticType.HAIRSTYLE);
|
||||
}
|
||||
}
|
||||
} else if (s.startsWith("Face")) {
|
||||
return new Pair<>(i, CosmeticType.FACE_SURGERY);
|
||||
} else if (s.startsWith("Cosmetic")) {
|
||||
return new Pair<>(i, CosmeticType.EYE_COLOR);
|
||||
} else if (s.startsWith("Plastic")) {
|
||||
return new Pair<>(i, CosmeticType.FACE_SURGERY);
|
||||
} else if (s.startsWith("Skin")) {
|
||||
return new Pair<>(i, CosmeticType.SKIN_CARE);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static List<String> getCosmeticCouponData(String town, String type, String subtype) {
|
||||
List<String> ret = new ArrayList<>(3);
|
||||
ret.add(town);
|
||||
ret.add(type);
|
||||
ret.add(subtype);
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static List<String> parseCosmeticCoupon(String couponName) {
|
||||
String town, type, subtype = "EXP";
|
||||
|
||||
String[] s = couponName.split(" Coupon ", 2);
|
||||
|
||||
if (s.length > 1) {
|
||||
subtype = s[1].substring(1, s[1].length() - 1);
|
||||
}
|
||||
|
||||
String[] tokens = s[0].split(" ");
|
||||
Pair<Integer, CosmeticType> cosmeticData = parseCosmeticCoupon(tokens);
|
||||
if (cosmeticData == null) return null;
|
||||
|
||||
town = "";
|
||||
for (int i = 0; i < cosmeticData.left; i++) {
|
||||
town += (tokens[i] + "_");
|
||||
}
|
||||
town = town.substring(0, town.length() - 1).toLowerCase();
|
||||
|
||||
switch (cosmeticData.right) {
|
||||
case HAIRSTYLE:
|
||||
type = "hair";
|
||||
break;
|
||||
|
||||
case FACE_SURGERY:
|
||||
type = "face";
|
||||
break;
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
return getCosmeticCouponData(town, type, subtype);
|
||||
}
|
||||
|
||||
private static void generateCosmeticPlaceNpcs() {
|
||||
for (Entry<Integer, String> e : couponNames.entrySet()) {
|
||||
Integer npcid = cosmeticNpcs.get(e.getKey());
|
||||
if (npcid == null) continue;
|
||||
|
||||
String couponName = e.getValue();
|
||||
List<String> couponData = parseCosmeticCoupon(couponName);
|
||||
|
||||
if (couponData == null) continue;
|
||||
cosmeticNpcids.put(couponData, npcid);
|
||||
}
|
||||
}
|
||||
|
||||
private static Integer getCosmeticNpcid(String townName, String typeCosmetic, String typeCoupon) {
|
||||
return cosmeticNpcids.get(getCosmeticCouponData(townName, typeCosmetic, typeCoupon));
|
||||
}
|
||||
|
||||
private static String getCosmeticName(String name, boolean gender) {
|
||||
String ret = name + " (" + (gender ? "F" : "M") + ")";
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static void loadCosmeticNames(String cosmeticPath) throws IOException {
|
||||
fileReader = new InputStreamReader(new FileInputStream(cosmeticPath), "UTF-8");
|
||||
bufferedReader = new BufferedReader(fileReader);
|
||||
|
||||
String line;
|
||||
while((line = bufferedReader.readLine()) != null) {
|
||||
String[] s = line.split(" - ", 3);
|
||||
int itemid = Integer.valueOf(s[0]);
|
||||
|
||||
String name;
|
||||
if (itemid < 30000) {
|
||||
itemid = itemid - ((itemid / 100) % 10) * 100;
|
||||
|
||||
int idx = s[1].lastIndexOf(" ");
|
||||
if (idx > -1) {
|
||||
name = s[1].substring(0, idx);
|
||||
} else {
|
||||
name = s[1];
|
||||
}
|
||||
} else {
|
||||
itemid = (Integer.valueOf(s[0]) / 10) * 10;
|
||||
|
||||
int idx = s[1].indexOf(" ");
|
||||
if (idx > -1) {
|
||||
name = s[1].substring(idx + 1);
|
||||
} else {
|
||||
name = s[1];
|
||||
}
|
||||
}
|
||||
|
||||
name = name.trim();
|
||||
|
||||
String cname = getCosmeticName(name, (((itemid / 1000) % 10) % 3) != 0);
|
||||
|
||||
/*
|
||||
if (cosmeticNameIds.containsKey(cname) && Math.abs(cosmeticNameIds.get(cname) - itemid) > 50) {
|
||||
System.out.println("Clashing '" + name + "' " + itemid + "/" + cosmeticNameIds.get(cname));
|
||||
}
|
||||
*/
|
||||
|
||||
cosmeticNameIds.put(cname, itemid);
|
||||
cosmeticIdNames.put(itemid, name);
|
||||
}
|
||||
|
||||
bufferedReader.close();
|
||||
fileReader.close();
|
||||
}
|
||||
|
||||
private static void loadCosmeticNames() throws IOException {
|
||||
System.out.println("Reading cosmetics from handbook ...");
|
||||
|
||||
loadCosmeticNames(handbookPath + "/Equip/Face.txt");
|
||||
loadCosmeticNames(handbookPath + "/Equip/Hair.txt");
|
||||
}
|
||||
|
||||
private static List<Integer> fetchExpectedCosmetics(String[] cosmeticList, boolean gender) {
|
||||
List<Integer> list = new LinkedList<>();
|
||||
|
||||
for (String cosmetic : cosmeticList) {
|
||||
String cname = getCosmeticName(cosmetic, gender);
|
||||
Integer itemid = cosmeticNameIds.get(cname);
|
||||
if (itemid != null) {
|
||||
list.add(itemid);
|
||||
} else {
|
||||
missingCosmeticNames.add(cosmetic);
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private static void verifyCosmeticExpectedFile(File f) throws IOException {
|
||||
String townName = f.getParent().substring(f.getParent().lastIndexOf("\\") + 1);
|
||||
String typeCosmetic = f.getName().substring(0, f.getName().indexOf("."));
|
||||
|
||||
fileReader = new InputStreamReader(new FileInputStream(f), "UTF-8");
|
||||
bufferedReader = new BufferedReader(fileReader);
|
||||
|
||||
String line;
|
||||
while((line = bufferedReader.readLine())!=null){
|
||||
String[] s = line.split(": ", 2);
|
||||
String[] t = s[0].split("ale ");
|
||||
|
||||
String typeCoupon = t[1];
|
||||
boolean gender = !t[0].contentEquals("M");
|
||||
|
||||
Integer npcid = getCosmeticNpcid(townName, typeCosmetic, typeCoupon);
|
||||
if (npcid != null) {
|
||||
String[] cosmetics = s[1].split(", ");
|
||||
List<Integer> cosmeticItemids = fetchExpectedCosmetics(cosmetics, gender);
|
||||
|
||||
Set<Integer> npcCosmetics = scriptCosmetics.get(npcid);
|
||||
Set<Integer> missingCosmetics = new HashSet<>();
|
||||
for (Integer itemid : cosmeticItemids) {
|
||||
if (!npcCosmetics.contains(itemid)) {
|
||||
missingCosmetics.add(itemid);
|
||||
}
|
||||
}
|
||||
|
||||
if (!missingCosmetics.isEmpty()) {
|
||||
Pair<Integer, String> key = new Pair<>(npcid, typeCoupon);
|
||||
|
||||
Set<Integer> list = missingCosmeticsNpcTypes.get(key);
|
||||
if (list == null) {
|
||||
missingCosmeticsNpcTypes.put(key, missingCosmetics);
|
||||
} else {
|
||||
list.addAll(missingCosmetics);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bufferedReader.close();
|
||||
fileReader.close();
|
||||
}
|
||||
|
||||
private static void verifyCosmeticExpectedData() throws IOException {
|
||||
System.out.println("Analyzing cosmetic NPC scripts ...");
|
||||
|
||||
ArrayList<File> cosmeticRecipes = new ArrayList<>();
|
||||
listFiles(libPath + "/care", cosmeticRecipes);
|
||||
|
||||
for (File f : cosmeticRecipes) {
|
||||
verifyCosmeticExpectedFile(f);
|
||||
}
|
||||
}
|
||||
|
||||
private static List<Pair<Pair<Integer, String>, List<Integer>>> getSortedMapEntries(Map<Pair<Integer, String>, Set<Integer>> map) {
|
||||
List<Pair<Pair<Integer, String>, List<Integer>>> list = new ArrayList<>(map.size());
|
||||
for(Entry<Pair<Integer, String>, Set<Integer>> e : map.entrySet()) {
|
||||
List<Integer> il = new ArrayList<>(2);
|
||||
for(Integer i : e.getValue()) {
|
||||
il.add(i);
|
||||
}
|
||||
|
||||
Collections.sort(il, new Comparator<Integer>() {
|
||||
@Override
|
||||
public int compare(Integer o1, Integer o2) {
|
||||
return o1 - o2;
|
||||
}
|
||||
});
|
||||
|
||||
list.add(new Pair<>(e.getKey(), il));
|
||||
}
|
||||
|
||||
Collections.sort(list, new Comparator<Pair<Pair<Integer, String>, List<Integer>>>() {
|
||||
@Override
|
||||
public int compare(Pair<Pair<Integer, String>, List<Integer>> o1, Pair<Pair<Integer, String>, List<Integer>> o2) {
|
||||
int cmp = o1.getLeft().getLeft() - o2.getLeft().getLeft();
|
||||
if (cmp == 0) {
|
||||
return o1.getLeft().getRight().compareTo(o2.getLeft().getRight());
|
||||
} else {
|
||||
return cmp;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private static void printReportFileHeader() {
|
||||
printWriter.println(" # Report File autogenerated from the MapleCashCosmeticsChecker feature by Ronan Lana.");
|
||||
printWriter.println(" # Generated data takes into account several data info from the server source files and the server-side WZ.xmls.");
|
||||
printWriter.println();
|
||||
}
|
||||
|
||||
private static Pair<List<Integer>, List<Integer>> getCosmeticReport(List<Integer> itemids) {
|
||||
List<Integer> maleItemids = new LinkedList<>();
|
||||
List<Integer> femaleItemids = new LinkedList<>();
|
||||
|
||||
for (Integer i : itemids) {
|
||||
if ((((i / 1000) % 10) % 3) == 0) {
|
||||
maleItemids.add(i);
|
||||
} else {
|
||||
femaleItemids.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
return new Pair<>(maleItemids, femaleItemids);
|
||||
}
|
||||
|
||||
private static void reportNpcCosmetics(List<Integer> itemids) {
|
||||
if (!itemids.isEmpty()) {
|
||||
String res = " ";
|
||||
for (Integer i : itemids) {
|
||||
res += (i + ", ");
|
||||
unusedCosmetics.remove(i);
|
||||
}
|
||||
|
||||
printWriter.println(res.substring(0, res.length() - 2));
|
||||
}
|
||||
}
|
||||
|
||||
private static void reportCosmeticResults() throws IOException {
|
||||
System.out.println("Reporting results ...");
|
||||
|
||||
printWriter = new PrintWriter("lib/result.txt", "UTF-8");
|
||||
|
||||
printReportFileHeader();
|
||||
|
||||
if (!missingCosmeticsNpcTypes.isEmpty()) {
|
||||
printWriter.println("Found " + missingCosmeticsNpcTypes.size() + " entries with missing cosmetic entries.");
|
||||
|
||||
for (Pair<Pair<Integer, String>, List<Integer>> mcn : getSortedMapEntries(missingCosmeticsNpcTypes)) {
|
||||
printWriter.println(" NPC " + mcn.getLeft());
|
||||
|
||||
Pair<List<Integer>, List<Integer>> genderItemids = getCosmeticReport(mcn.getRight());
|
||||
reportNpcCosmetics(genderItemids.getLeft());
|
||||
reportNpcCosmetics(genderItemids.getRight());
|
||||
printWriter.println();
|
||||
}
|
||||
}
|
||||
|
||||
if (!unusedCosmetics.isEmpty()) {
|
||||
printWriter.println("Unused cosmetics: " + unusedCosmetics.size());
|
||||
|
||||
List<Integer> list = new ArrayList<>(unusedCosmetics);
|
||||
Collections.sort(list);
|
||||
|
||||
for (Integer i : list) {
|
||||
printWriter.println(i + " " + cosmeticIdNames.get(i));
|
||||
}
|
||||
|
||||
printWriter.println();
|
||||
}
|
||||
|
||||
if (!missingCosmeticNames.isEmpty()) {
|
||||
printWriter.println("Missing cosmetic itemids: " + missingCosmeticNames.size());
|
||||
|
||||
List<String> listString = new ArrayList<>(missingCosmeticNames);
|
||||
Collections.sort(listString);
|
||||
|
||||
for (String c : listString) {
|
||||
printWriter.println(c);
|
||||
}
|
||||
|
||||
printWriter.println();
|
||||
}
|
||||
|
||||
printWriter.close();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
loadCosmeticWzData();
|
||||
processCosmeticScriptData();
|
||||
|
||||
loadCosmeticCouponNpcs();
|
||||
generateCosmeticPlaceNpcs();
|
||||
|
||||
loadCosmeticNames();
|
||||
verifyCosmeticExpectedData();
|
||||
|
||||
reportCosmeticResults();
|
||||
System.out.println("Done!");
|
||||
} catch (IOException ioe) {
|
||||
ioe.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
This file is part of the OdinMS Maple Story Server
|
||||
Copyright (C) 2008 ~ 2010 Patrick Huy <patrick.huy@frz.cc>
|
||||
Matthias Butz <matze@odinms.de>
|
||||
Jan Christian Meyer <vimes@odinms.de>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License version 3
|
||||
as published by the Free Software Foundation. You may not use, modify
|
||||
or distribute this program under any other version of the
|
||||
GNU Affero General Public License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package maplecashcosmeticschecker;
|
||||
|
||||
/**
|
||||
* Represents a pair of values.
|
||||
*
|
||||
* @author Frz
|
||||
* @since Revision 333
|
||||
* @version 1.0
|
||||
*
|
||||
* @param <E> The type of the left value.
|
||||
* @param <F> The type of the right value.
|
||||
*/
|
||||
public class Pair<E, F> {
|
||||
|
||||
public E left;
|
||||
public F right;
|
||||
|
||||
/**
|
||||
* Class constructor - pairs two objects together.
|
||||
*
|
||||
* @param left The left object.
|
||||
* @param right The right object.
|
||||
*/
|
||||
public Pair(E left, F right) {
|
||||
this.left = left;
|
||||
this.right = right;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the left value.
|
||||
*
|
||||
* @return The left value.
|
||||
*/
|
||||
public E getLeft() {
|
||||
return left;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the right value.
|
||||
*
|
||||
* @return The right value.
|
||||
*/
|
||||
public F getRight() {
|
||||
return right;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns the pair into a string.
|
||||
*
|
||||
* @return Each value of the pair as a string joined by a colon.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return left.toString() + ":" + right.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the hash code of this pair.
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((left == null) ? 0 : left.hashCode());
|
||||
result = prime * result + ((right == null) ? 0 : right.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if two pairs are equal.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final Pair other = (Pair) obj;
|
||||
if (left == null) {
|
||||
if (other.left != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!left.equals(other.left)) {
|
||||
return false;
|
||||
}
|
||||
if (right == null) {
|
||||
if (other.right != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!right.equals(other.right)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user