]> jfr.im git - irc/gameservirc.git/commitdiff
Added all old gameserv data files with some modifications to work better with 2.0...
authorkainazzzo <redacted>
Tue, 15 Sep 2009 21:54:34 +0000 (21:54 +0000)
committerkainazzzo <redacted>
Tue, 15 Sep 2009 21:54:34 +0000 (21:54 +0000)
Consolidated IArmorDAO and IWeaponDAO into IItemDAO... this will handle all items including potions now
Fixed up the inventory to be a vector of foreign item ids with add/remove functionality

git-svn-id: https://svn.code.sf.net/p/gameservirc/code/trunk@521 bc333340-6410-0410-a689-9d09f3c113fa

38 files changed:
gameserv-2.0/data/initialdragon.dat [new file with mode: 0644]
gameserv-2.0/data/items/masteritems.dat [new file with mode: 0644]
gameserv-2.0/data/items/store.dat [new file with mode: 0644]
gameserv-2.0/data/items/tavern.dat [new file with mode: 0644]
gameserv-2.0/data/levels/level1.dat [new file with mode: 0644]
gameserv-2.0/data/levels/level10.dat [new file with mode: 0644]
gameserv-2.0/data/levels/level11.dat [new file with mode: 0644]
gameserv-2.0/data/levels/level12.dat [new file with mode: 0644]
gameserv-2.0/data/levels/level2.dat [new file with mode: 0644]
gameserv-2.0/data/levels/level3.dat [new file with mode: 0644]
gameserv-2.0/data/levels/level4.dat [new file with mode: 0644]
gameserv-2.0/data/levels/level5.dat [new file with mode: 0644]
gameserv-2.0/data/levels/level6.dat [new file with mode: 0644]
gameserv-2.0/data/levels/level7.dat [new file with mode: 0644]
gameserv-2.0/data/levels/level8.dat [new file with mode: 0644]
gameserv-2.0/data/levels/level9.dat [new file with mode: 0644]
gameserv-2.0/data/masters.dat [new file with mode: 0644]
gameserv-2.0/data/monsters/level1.dat [new file with mode: 0644]
gameserv-2.0/data/monsters/level10.dat [new file with mode: 0644]
gameserv-2.0/data/monsters/level11.dat [new file with mode: 0644]
gameserv-2.0/data/monsters/level12.dat [new file with mode: 0644]
gameserv-2.0/data/monsters/level2.dat [new file with mode: 0644]
gameserv-2.0/data/monsters/level3.dat [new file with mode: 0644]
gameserv-2.0/data/monsters/level4.dat [new file with mode: 0644]
gameserv-2.0/data/monsters/level5.dat [new file with mode: 0644]
gameserv-2.0/data/monsters/level6.dat [new file with mode: 0644]
gameserv-2.0/data/monsters/level7.dat [new file with mode: 0644]
gameserv-2.0/data/monsters/level8.dat [new file with mode: 0644]
gameserv-2.0/data/monsters/level9.dat [new file with mode: 0644]
gameserv-2.0/libgameservgldl/include/GameServ/DataLayer/File/FileItemDAO.h [new file with mode: 0644]
gameserv-2.0/libgameservgldl/include/GameServ/DataLayer/IItemDAO.h [new file with mode: 0644]
gameserv-2.0/libgameservgldl/include/GameServ/GameLayer/GameObjects/PlayerGO.h
gameserv-2.0/libgameservgldl/include/GameServ/GameLayer/GameObjects/PotionGO.h [new file with mode: 0644]
gameserv-2.0/libgameservgldl/libgameservgldl.vcproj
gameserv-2.0/libgameservgldl/src/DataLayer/File/FileItemDAO.cpp [new file with mode: 0644]
gameserv-2.0/libgameservgldl/src/DataLayer/IItemDAO.cpp [new file with mode: 0644]
gameserv-2.0/libgameservgldl/src/GameLayer/GameObjects/PlayerGO.cpp
gameserv-2.0/libgameservgldl/src/GameLayer/GameObjects/PotionGO.cpp [new file with mode: 0644]

diff --git a/gameserv-2.0/data/initialdragon.dat b/gameserv-2.0/data/initialdragon.dat
new file mode 100644 (file)
index 0000000..02fb50a
--- /dev/null
@@ -0,0 +1,2 @@
+The Red Dragon~Breath of Unholy Fire~2500~6667~0~You finally snuff out the deadly murderous dragon's dark flames. You have freed the land of its terror filled reign from above!\r
+^\r
diff --git a/gameserv-2.0/data/items/masteritems.dat b/gameserv-2.0/data/items/masteritems.dat
new file mode 100644 (file)
index 0000000..ccdb401
--- /dev/null
@@ -0,0 +1,47 @@
+# It's important to note that the ID system works off of a long int (32 bit) and can go up to 2 billion +\r
+# The ID numbers below are arbitrarily chosen for organizational purposes\r
+# However, there needs to be some way to distinguish between two items if they have the same name, so I HAD to \r
+# implement IDs\r
+# type~ID~name~price~uses~strengthmod~defensemod~maxhpmod~hpmod~forestfightsmod~playerfightsmod~goldmod~bankbalmod\r
+# Weapons 1-3000\r
+Weapon~1~Stick~200~-1~10~0~0~0\r
+Weapon~2~Dagger~1000~-1~15~0~0~0\r
+Weapon~3~Quarterstaff~3000~-1~25~0~0~0\r
+Weapon~4~Short Sword~10000~-1~35~0~0~0\r
+Weapon~5~Long Sword~30000~-1~45~0~0~0\r
+Weapon~6~Silver Spear~100000~-1~65~0~0~0\r
+Weapon~7~Battle Axe~150000~-1~85~0~0~0\r
+Weapon~8~The Ragnarok~200000~-1~125~0~0~0\r
+Weapon~9~Chain Saw~400000~-1~185~0~0~0\r
+Weapon~10~Poison Sword~1000000~-1~255~0~0~0\r
+Weapon~11~Flame Sword~4000000~-1~355~0~0~0\r
+Weapon~12~Earth Hammer~10000000~-1~505~0~0~0\r
+Weapon~13~Light Saber~40000000~-1~805~0~0~0\r
+Weapon~14~Masamune~100000000~-1~1205~0~0~0\r
+Weapon~15~Excalibur~400000000~-1~1805~0~0~0\r
+# Armor 3001-6000\r
+Armor~3001~Clothes~200~-1~0~3~0~0\r
+Armor~3002~Leather Vest~1000~-1~0~5~0~0\r
+Armor~3003~Chain Mail~3000~-1~0~10~0~0\r
+Armor~3004~Plate Armor~10000~-1~0~15~0~0\r
+Armor~3005~Full Body Armor~30000~-1~0~25~0~0\r
+Armor~3006~Magic Mail~100000~-1~0~35~0~0\r
+Armor~3007~Graphite Suit~150000~-1~0~50~0~0\r
+Armor~3008~Steel Suit~200000~-1~0~75~0~0\r
+Armor~3009~Force Field~400000~-1~0~100~0~0\r
+Armor~3010~Armor of Light~1000000~-1~0~150~0~0\r
+Armor~3011~Mythril Vest~4000000~-1~0~225~0~0\r
+Armor~3012~DemiGod Armor~10000000~-1~0~300~0~0\r
+Armor~3013~Hades' Cloak~40000000~-1~0~400~0~0\r
+Armor~3014~Dragon Scales~100000000~-1~0~600~0~0\r
+Armor~3015~Adamantium~400000000~-1~0~1000~0~0\r
+# Potions 6001-9000\r
+# type~ID~name~price~uses~strengthmax~defensemax~maxhpmod~hpmod~forestfightsmod~playerfightsmod~goldmod~bankbalmod\r
+Potion~6001~Very Weak Healing Potion~600~1~0~0~0~30~0~0~0~0\r
+Potion~6002~Weak Healing Potion~1200~1~0~0~0~60~0~0~0~0\r
+Potion~6003~Healing Potion~5400~1~0~0~0~250~0~0~0~0\r
+Potion~6004~Strong Healing Potion~50000~1~0~0~0~1000~0~0~0~0\r
+Potion~6005~Defense Potion~25000~1~0~2~0~0~0~0~0~0\r
+Potion~6006~Strength Potion~25000~1~2~0~0~0~0~0~0~0\r
+Potion~6007~Max Health Potion~25000~1~0~0~4~0~0~0~0~0\r
+# Miscellaneous 9001-12000
\ No newline at end of file
diff --git a/gameserv-2.0/data/items/store.dat b/gameserv-2.0/data/items/store.dat
new file mode 100644 (file)
index 0000000..10fc6a6
--- /dev/null
@@ -0,0 +1,31 @@
+# These are the item IDs that are available in the store (separate from the tavern)\r
+1\r
+2\r
+3\r
+4\r
+5\r
+6\r
+7\r
+8\r
+9\r
+10\r
+11\r
+12\r
+13\r
+14\r
+15\r
+3001\r
+3002\r
+3003\r
+3004\r
+3005\r
+3006\r
+3007\r
+3008\r
+3009\r
+3010\r
+3011\r
+3012\r
+3013\r
+3014\r
+3015\r
diff --git a/gameserv-2.0/data/items/tavern.dat b/gameserv-2.0/data/items/tavern.dat
new file mode 100644 (file)
index 0000000..f252179
--- /dev/null
@@ -0,0 +1,11 @@
+# This file contains a list of items available at the tavern at what minimum level\r
+# Format: id~level\r
+# If you want a strong health potion to show up only on level 10, put: 6004~10\r
+# All ids must exist in the master item database\r
+6001~1\r
+6002~2\r
+6003~4\r
+6004~10\r
+6005~6\r
+6006~6\r
+6007~6\r
diff --git a/gameserv-2.0/data/levels/level1.dat b/gameserv-2.0/data/levels/level1.dat
new file mode 100644 (file)
index 0000000..28fc841
--- /dev/null
@@ -0,0 +1,4 @@
+2~11\r
+10~250\r
+3~19\r
+3~15
\ No newline at end of file
diff --git a/gameserv-2.0/data/levels/level10.dat b/gameserv-2.0/data/levels/level10.dat
new file mode 100644 (file)
index 0000000..26bef98
--- /dev/null
@@ -0,0 +1,4 @@
+692~850\r
+11642~45300\r
+22900~45500\r
+1978~3400
\ No newline at end of file
diff --git a/gameserv-2.0/data/levels/level11.dat b/gameserv-2.0/data/levels/level11.dat
new file mode 100644 (file)
index 0000000..9d8fdb0
--- /dev/null
@@ -0,0 +1,4 @@
+810~999\r
+12655~71234\r
+65465~67981\r
+2840~3300
\ No newline at end of file
diff --git a/gameserv-2.0/data/levels/level12.dat b/gameserv-2.0/data/levels/level12.dat
new file mode 100644 (file)
index 0000000..02e5105
--- /dev/null
@@ -0,0 +1,4 @@
+900~1360\r
+35000~129543\r
+14000~95000\r
+3500~4125
\ No newline at end of file
diff --git a/gameserv-2.0/data/levels/level2.dat b/gameserv-2.0/data/levels/level2.dat
new file mode 100644 (file)
index 0000000..ed5ed70
--- /dev/null
@@ -0,0 +1,4 @@
+19~35\r
+80~330\r
+6~30\r
+25~50
\ No newline at end of file
diff --git a/gameserv-2.0/data/levels/level3.dat b/gameserv-2.0/data/levels/level3.dat
new file mode 100644 (file)
index 0000000..5ce89f6
--- /dev/null
@@ -0,0 +1,4 @@
+25~60\r
+245~1300\r
+15~45\r
+35~90
\ No newline at end of file
diff --git a/gameserv-2.0/data/levels/level4.dat b/gameserv-2.0/data/levels/level4.dat
new file mode 100644 (file)
index 0000000..d6faa0c
--- /dev/null
@@ -0,0 +1,4 @@
+52~99\r
+597~1747\r
+25~99\r
+80~125
\ No newline at end of file
diff --git a/gameserv-2.0/data/levels/level5.dat b/gameserv-2.0/data/levels/level5.dat
new file mode 100644 (file)
index 0000000..2e38c7e
--- /dev/null
@@ -0,0 +1,4 @@
+130~200\r
+1700~5191\r
+100~254\r
+120~220
\ No newline at end of file
diff --git a/gameserv-2.0/data/levels/level6.dat b/gameserv-2.0/data/levels/level6.dat
new file mode 100644 (file)
index 0000000..412a2b2
--- /dev/null
@@ -0,0 +1,4 @@
+215~300\r
+1000~6220\r
+145~400\r
+200~290
\ No newline at end of file
diff --git a/gameserv-2.0/data/levels/level7.dat b/gameserv-2.0/data/levels/level7.dat
new file mode 100644 (file)
index 0000000..85fc908
--- /dev/null
@@ -0,0 +1,4 @@
+300~350\r
+9041~15158\r
+210~500\r
+410~555
\ No newline at end of file
diff --git a/gameserv-2.0/data/levels/level8.dat b/gameserv-2.0/data/levels/level8.dat
new file mode 100644 (file)
index 0000000..27f457d
--- /dev/null
@@ -0,0 +1,4 @@
+450~510\r
+2140~50102\r
+1000~14000\r
+399~2420
\ No newline at end of file
diff --git a/gameserv-2.0/data/levels/level9.dat b/gameserv-2.0/data/levels/level9.dat
new file mode 100644 (file)
index 0000000..773d651
--- /dev/null
@@ -0,0 +1,4 @@
+535~690\r
+10351~75000\r
+21231~24032\r
+1958~3000
\ No newline at end of file
diff --git a/gameserv-2.0/data/masters.dat b/gameserv-2.0/data/masters.dat
new file mode 100644 (file)
index 0000000..79c1fc0
--- /dev/null
@@ -0,0 +1,13 @@
+# name~weapon~strength~gold~exp~hp~parting words\r
+#\r
+Old Bones~Dull Sword Cane~32~0~0~35~You have done well my student, but the road is long. Use your new strength with humility and honor as you progress in levels!~\r
+Master Chang~Nanchaku~48~0~0~51~You try to make out what Master Chang is saying, but the only thing you catch is something about a grasshopper.~\r
+Chuck Norris~Ranger Kick~88~0~0~100~Be strong, and keep your goals in sight. Drink milk, and don't do drugs. One day you may be fighting next to me as a Texas Ranger YEEHAW!~\r
+Mr. Miagi~Petrified Bonsai~169~0~0~165~Skill comes from repeating the correct but seemingly mundane actions. Wax ON, wax OFF!~\r
+Jackie Chan~Kung Fu Kick~275~0~0~232~I like to let people talk who like to talk... it's easier to find out how full of it they really are!~\r
+Jet Li~Motorcycle~347~0~0~504~Failure is a fuel for excuses. It's the doing the do, that makes the making.~\r
+Muhammad Ali~Quick Jab~515~0~0~1078~It's just a job. Grass grows, birds fly, waves pound the sand. I beat people up.~\r
+Li Mu Bai~Green Destiny~655~0~0~2207~No growth without resistance.  No action without reaction.  No desire without restraint.~\r
+Jimmy Wang Yu~Flying Guillotine~819~0~0~2780~You have beaten the one armed boxer. Proceed with caution!~\r
+Wong Fei Hong~Drunken Boxing~1014~0~0~3046~Hiccup! Monkey drinks master's wine!~\r
+Bruce Lee~Fists of fury~1286~0~0~3988~You must learn to concentrate. It is like a finger pointing away to the moon... DONT concentrate on the finger, or you will miss all the heavenly glory.~
\ No newline at end of file
diff --git a/gameserv-2.0/data/monsters/level1.dat b/gameserv-2.0/data/monsters/level1.dat
new file mode 100644 (file)
index 0000000..3135aa7
--- /dev/null
@@ -0,0 +1,22 @@
+Slime~Acid Goo~The slime oozes into nothing... you clean the acid goo off of your weapon~\r
+Ghost~Cold Breath~You feel a chill as the spirit leaves the realm.~\r
+Ugly Rodent~Sharp Teeth~You stomp on the Ugly Rodent's remains for a finishing blow.~\r
+Whart Hog~Tusks~You cook and eat the hog for good measure!~\r
+Pesky Kid~Slingshot~You take his slingshot and snap the band, sending the kid crying home to mom~\r
+Playground Bully~Painful Noogie~You give him an indian burn, and punt him across the schoolyard!~\r
+Small Imp~Dagger~You can't help but laugh as he stumbles and falls onto his own dagger!~\r
+Little Monkey~Monkey Wrench~You want to cook it, but you just can't think of eating something that looks so human!~\r
+Grub Worm~Minor Nudge~You decide to save the poor little fella for your next fishing trip.~\r
+Drakee~Tail Slap~You hold the little Drakee by its tale and slam it down on a dry stump!~\r
+Fat Slob~Smelly Breath~You kick his stomach for fun, and are thrown back by the spring of it all!~\r
+Lost Warrior~Long Sword~You give him a proper burial in respect for the dead warrior.~\r
+Harry Potter~Nimbus 2000~I don't go looking for trouble. Trouble usually finds me.~\r
+Snake Nidhogg~Crushtail~CURSE YOU!~\r
+Seven of Nine~Nanoprobes~Death is irrelevant, resistance is futile~\r
+Great Smiley~Happiness~Wheeeeeeeee, party!! :D~\r
+Crud Puppy~Bad Office Coffee~My evil powers have grown weak!~\r
+Layla~Sexy Kiss of Insanity~She lookes at you with her misleading eyes, almost making you feel bad you killed her.~\r
+Ignatz Despoiler-of-Maidens~Bludgeon~Blessed with his own stupidity!~\r
+King Kong~Skyscraper~I want my woman!~\r
+Sergeant Gunnary Heartman~Drill Voice~You still need training boy!~\r
+Cartman~Flammable Fart~Respect my authority!
\ No newline at end of file
diff --git a/gameserv-2.0/data/monsters/level10.dat b/gameserv-2.0/data/monsters/level10.dat
new file mode 100644 (file)
index 0000000..7e5577c
--- /dev/null
@@ -0,0 +1,14 @@
+# Name~Weapon~Death Phrase (said when they die)\r
+# Level 10 <damaged at damaged.no-ip.com>\r
+Baby Lag Beast~Lag Knife~It shrinks up into a little ball and slowly fades away.\r
+Horrible Smell~Stink Bombs~You finish it off by hanging up a pine tree deodorizer around its neck.\r
+Small Lag Beast~Glowing Lag Knife~Wow, that was an ugly little thing!\r
+Undead Egyptian Slave~Carpenter's Mallet~That will be the last time he will strike with a hammer again!\r
+Medium Lag Beast~Lag dagger~You wipe off the brain matter left behind. You just had this armor washed too!\r
+Boat Builder~A Large Adz~The adz falls to the ground next to the builder's corpse.\r
+Unwelcomed Guest~A Fruit Cake with Nuts~Easily one of the funnest kills today!\r
+John The Bard~An Oak Staff~He earned \1fhis\1f wings earlier than he had planned.\r
+Mad Summoner~Swarm of Bees~The bees begin devouring the summoner's corpse. You slowly back away...\r
+Ugly Harlot~Rock Filled Purse~Her tattered purse falls as she crumples to the ground.\r
+White Ninja~Large Sai~As he begins to fall, a puff of smoke appears and the corpse is gone...hmmm..\r
+Werewolf~Razor Sharp Fangs~The werewolf yelps like a kicked puppy, then turns into human form before releasing its final breath.
\ No newline at end of file
diff --git a/gameserv-2.0/data/monsters/level11.dat b/gameserv-2.0/data/monsters/level11.dat
new file mode 100644 (file)
index 0000000..a11236e
--- /dev/null
@@ -0,0 +1,14 @@
+# Name~Weapon~Death Phrase (said when they die)\r
+# Level 11 <damaged at damaged.no-ip.com>\r
+Large Lag Beast~Lag Sword~These things keep getting nastier and nastier.\r
+Mean Lag Beast~Glowing Lag Broadsword~It slowly doubles over, as the halves of its body seperate into two peices from your blow...\r
+Lag Beast Lord~Huge Lag Battle Axe~It explodes in a massive array of bright light.\r
+Black Widow~Dripping Fangs~As you deliver the final blow, the spider shrivles up on its back and twitches..\r
+Mephistopheles~Faustian Sword~The corpse erupts into a burst of extremely hot flames before disappearing into the void.\r
+Amen Ra~Large Golden Staff~The heavens shake violently at the death of this one...\r
+Insane Clown~Big Red Shoe~DEAD! No loss here, you hate clowns anyway...\r
+Black Wyrm~Bloodied Claws~It dies with a piercing hiss...\r
+UnHoly Wrath~Sword of Armageddon~Shadows engulf the corpse. A chill passes through the air.\r
+Stone Giant~Huge Boudler~The once fearsome Stone Giant turns into a pile of pebbles.\r
+Evil Unicorn~Large Golden Horn~The Unicorn's beautiful mane is now covered in blood as it falls over, dead.\r
+Troll~Large Spiked Club~The smell is overwhelming, this is a good place for a stick-up.
\ No newline at end of file
diff --git a/gameserv-2.0/data/monsters/level12.dat b/gameserv-2.0/data/monsters/level12.dat
new file mode 100644 (file)
index 0000000..0e53d91
--- /dev/null
@@ -0,0 +1,14 @@
+# Name~Weapon~Death Phrase (said when they die) \r
+# Level 12 <damaged at damaged.no-ip.com>\r
+Insane Lag Beast~Glowing claws~Cackling, it looks at you and giggles before his head separates from his body.\r
+Ghost of the Mean Lag Beast~Fangs covered in feces~With a soft eerie moan, the ghost dissipates.\r
+Imhotep~Shimmering Sword~Thunder deafens all who live, you feel a surge of power pass through you, and you ask yourself, "What have I done?"\r
+Holy Wrath~Hand of God~If it bleeds and dies, then it was no god.\r
+Inu Yasha~The Tetsusaiga~Just before he dies, you notice his eyes turn red! You quickly run away victorious. (You hope)\r
+Sesshoumaru~The Tensaiga~You see The Tensaiga glow just before Sesshoumaru's body seemingly evaporates...\r
+Floating Bastard Sword~Slicing Blade~The sword falls to the ground motionless, then promptly rusts...they just don't make em like they used to...\r
+Floating Eye~Gaze of Death~Liquid oozes from the punctures, ewww...\r
+Ghost of Mephistopheles~Glowing Faustian Sword~You sent him straight back to Hell...again...\r
+Screeching Wraith~Peircing Scream~Ahh, precious silence, you still have ringing in your ears, though...\r
+Ogre Lord~Titan's Hammer~He was tough, but not tough enough.\r
+Mumrah the Everliving~Touch of Decay~Everliving? HAH! Riggghht...
\ No newline at end of file
diff --git a/gameserv-2.0/data/monsters/level2.dat b/gameserv-2.0/data/monsters/level2.dat
new file mode 100644 (file)
index 0000000..861c177
--- /dev/null
@@ -0,0 +1,23 @@
+Lost Warrior's Cousin Larry~Wood Axe~He was pretty pissed you killed his cousin, but he seems to have suffered the same fate!~\r
+Sandman~Sleeping Dust~You put the sandman to his final sleep.~\r
+Skank~Stiletto Heel~Your pimp hand is way strong!~\r
+Goblin Gardener~Garden Spade~You trample on his garden after slaying him... that felt good!~\r
+Evil Elf~Dark Bow~Elves are usually nice you thought... hmm.~\r
+Viking Warrior~Broad Sword~You heard vikings were big, but not THAT big!~\r
+Wicked Witch~Cackling Laugh~Just for kicks, you splash some water on her and watch her melt.~\r
+Vampire Bat~Blood Sucking Fangs~You fry up the bat and eat it... needs gaaahlic.~\r
+Thorn Bush~101 Thorns~You set the bush ablaze and roast some marshmallows.~\r
+Barbarian~Heavy Sword~You listen to him moan as he falls over dead.~\r
+Crypt Rat~Stinging Bite~You squash the little rodent for fear that it might not be dead.~\r
+Small Orc~Sharp Blade~It's an ugly one, and it would've grown up to be a terror...~\r
+Virus Bots~Trojan Horses~You run a quick virus scan before you leave this software in the dust.\r
+Hex Maniac~Satanic Powers~You'll go to hell!~\r
+Eight-legged-freak~Venom~We'll meet again!~\r
+Anger Piercer~Pointy sword~You broke my sword!~\r
+Bookwarp Cadaver~Rotten smell~Don't let me rott!~\r
+Clubthunder Enchanter~Enchantments~My magic has run dry...~\r
+Disinterred Medusa~Snakes~What did you do to my snakes!~\r
+Dissolver Manipulator-hangman~Itching ropes~You broke my rope!~\r
+Gloomy Kraken~Weirdness~Glooooooooooom~\r
+Hookweb Ophidian~Bad breath~Noooooooooooo~\r
+Leech Ant~Leech~You anti-leecher!~
\ No newline at end of file
diff --git a/gameserv-2.0/data/monsters/level3.dat b/gameserv-2.0/data/monsters/level3.dat
new file mode 100644 (file)
index 0000000..595eb01
--- /dev/null
@@ -0,0 +1,19 @@
+Teferi~Puzzle Box~It was a puzzling experience.~\r
+Spineless Thug~Spiked Bat~See you at the crossroads!~\r
+Pyromaniac~Flame Thrower~He chants FIRE FIRE as he falls to the ground... a burning heap of flesh.~\r
+Evil Enchantress~Deadly Spell~She looked just about as good as she fought.~\r
+Killer Leprechaun~Gold Rush~You steal his pot of gold... that's a lot of money!~\r
+Avalanche Rider~Huge Snowball~You take his snowboard and snap it in two!~\r
+Blundering Idiot~Stupidity~Now there's one person you don't feel sorry for killing!~\r
+Militant Anarchist~Molotov Cocktail~Order has been restored for now...~\r
+Scathe Zombies~Death Grip~That was perhaps the scariest experience of your life.~\r
+Demon Llama~Flamed Spit~You wipe the spit off your face and fling it back at the Llama.~\r
+Juggalo~Clown Axe~What is a Juggalo? I don't know!~\r
+The Boogie Man~Striking Fear~He's scared you for the very last time!~\r
+Mace Plant~Mace~You stepped on me!~\r
+Magician Ear~Odd powers~AAAH! Not so loud!~\r
+Pudding Barracuda~Bad taste~You don't like my flavor?~\r
+Rock Scavenger~Nosepick~Don't leave me here!~\r
+Russet Pup~Licking power~Arf?~\r
+Scavenging Lich~Spiked club~Bad, bad man!~ \r
+Scream Controller~Loud Shriek~My voice....~
\ No newline at end of file
diff --git a/gameserv-2.0/data/monsters/level4.dat b/gameserv-2.0/data/monsters/level4.dat
new file mode 100644 (file)
index 0000000..34b17fd
--- /dev/null
@@ -0,0 +1,23 @@
+Living Fire~Scorching Wind~You extinguish the Living Flame once and for all!~\r
+Raging Orc~Orcish Artillary~This orc was a bit tougher than you remembered!~\r
+Huge Tarantula~Tangling Web~You're glad you overcame your arachniphobia so soon!~\r
+Rabid Wolf~Cujo Bite~The mutt falls over dead as white foam drips from its deadly canines...~\r
+Goblin Fighter~Morning Star~He almost got you, but you sliced off his head.~\r
+Grizzly Bear~Razor Claws~It almost got you this time... better be careful~\r
+Skeleton Man~Leg Bone~As a finisher, you wind up with the broad side of your weapon and hit his skull off for a home run!~\r
+Young Werewolf~Gnashed Teeth~You scatter the wolf's body parts in hopes he will stay dead!~\r
+Dark Infantry~Flesh Reaper~Light has prevailed this time... but it's only so long before you meet again.~\r
+Erie Spirit~Deadly Grin~His cousin the ghost was a little bit easier.~\r
+Gollum~Precious Treasure~Gollum screams out "MY PRECIOUS" as his small body falls limp from your blow.~\r
+Rock Fighter~Boulders~You dodge his last rock, and counter with a low blow, cutting off his legs.~\r
+Shadowy Flail Cactus~Spikes~You won?!?!~\r
+Slicktome Wight~Acid~You're pretty slick!~\r
+Songaxe Sprite~Axe~Lalalalalalaaaaa~\r
+Tearblood Roper~Bloodthirst~I have to cry.~\r
+Thunder-Basher~Bash~Fine! Be like that!~\r
+Unicorn Monster~Horn~My horn! You broke it!~\r
+Unknowable Brain Choker~Mental Asphyxiation~But I'm smarter!~\r
+Zombie Tangler~Voodoo powers~Well, I'm dead!~\r
+Bloomgas~Putrid Gas~Whats that smell?~\r
+Brilliant Swarm-Posessor~Sting~Well thats just Brilliant!~\r
+Chromatic Imp~Imp Scale~You suck!~
\ No newline at end of file
diff --git a/gameserv-2.0/data/monsters/level5.dat b/gameserv-2.0/data/monsters/level5.dat
new file mode 100644 (file)
index 0000000..8e00754
--- /dev/null
@@ -0,0 +1,25 @@
+# Name~Weapon~~Death Phrase (said when they die)\r
+#Level 5\r
+Giant Sphinx~Ancient Curse~You look in awe at the great wonder, collapsed at your feet!~\r
+Giant Ogre~Big Log~Your wits outmatched the ogre's brawn... big dumb thing.~\r
+Massive Cockroach~Piercing Hiss~Where's the exterminator when you need one?~\r
+Large Venomous Snake~Poison Fangs~After killing this beast you check for puncture marks... you find none, luckily.~\r
+Lizard Man~Deadly Jaws~His scales made for tough armor, and his jaws for a tougher opponent!~\r
+Face Dancer~Illusion Scyth~His carcus takes the shape of many things before it dies. His true form is so repulsive, you know why he changed faces so much!~\r
+Darklord Longbow Archer~Deadly Bow and Arrows~Your face turns white with horror after you realize you just met the devil's protector!~\r
+Hell's Paladin~Sword of Hellfire~This is starting to get tough you think. Do you really want to go to level 6?~\r
+The Unknown Soldier~Soul Torture~Who was that? Where was he from? And what was that weapon??~\r
+Undead Cult Leader~Lance of Deceit~His words fall on deaf ears... this is one cult you will NOT be part of!~\r
+Water Serpent~Forked Tongue~The serpent squeals as you cut off its head!~\r
+Silverback Gorilla~Deadly Poison Banana Peel~Was that gorilla or guerilla?~\r
+Cosmic Slash Spider~Venom bite~I'm going back to my web!~\r
+Crystal Berserker-behemoth~Beserk!~You're just crazy~\r
+Elder Corpse-miner~Rotten smell~Back to the 'ol mine~ \r
+Gibber Shocker~Electricity~What a shock!~\r
+Hellish Choker~Choking~But I'm evil, I'm supposed to win!~\r
+Hypnotic Bane~Hypnotic powers~I need to order the new "Hypnotism for Dummies"~\r
+Lakevolcano Man~Lava~Perhaps Lava and water make a bad combo..~\r
+Memory Orb~Knowledge~I'm still smarter~\r
+Meteor Bear~Gihugic Claws~Rawwwwrrrrr~\r
+Meteorleaf~Fire~*WHAM*~\r
+Quadra Seeker-breaker~Quad~I never liked people like you~
\ No newline at end of file
diff --git a/gameserv-2.0/data/monsters/level6.dat b/gameserv-2.0/data/monsters/level6.dat
new file mode 100644 (file)
index 0000000..139da58
--- /dev/null
@@ -0,0 +1,20 @@
+# Name~Weapon~Death Phrase (said when they die)\r
+#Level 6\r
+Cheap Bastard~Sack of Pennies~You hear him scream, "MY COINS!!" as you run off with his sack.~\r
+Disgruntled Postal Worker~AK-47~I guess he went postal!~\r
+Unix Administrator~rm -rf you~mv unixadmin /dev/null ; ls unixadmin ... You make sure he's null and void!~\r
+Tremble Troll~Tree Trunk Sized Arms~The creature lies shaking in a pool of blood at your feet.~\r
+Flood Monkey~Swamp Weed Rope~Don't tie me down! Ooh Ooh! Aah Aah!~\r
+Mim Gryan~Needle Fingers~The once razor sharp needles have been grinded to a dull point by your armor.~\r
+Galley Beggar~Shrieking Laugh~What the heck was so funny?~\r
+Freybug~Rocks~Your mother was a rolling stone!~\r
+Psi Morph~Mind Control~It's a good thing this monster couldn't control your spirit!~\r
+Aibyteyu~Spear Fork~Where's the Beef!?!?~\r
+Atax~Tiny Daggers~This THING took on the form of your best friend! Keep your eyes peeled next time!~\r
+Idunkjoo~Trident~You frantically struggle for air as you asphyxiate between the trident's prongs! WHEW!~\r
+Sandmountain Hangman~Sand~Arg, there's sand in my eye!~\r
+Secret Stench Magician~Stinky Magic~Is that smell really me?~\r
+Southern Flare Soaker~Red Flare~I'm going west...~\r
+Steel Zombie~Ghost Steel~But.. how!?~\r
+Stunhowl Phantom~Ghostly powers~I'm stunned!~\r
+Wooden Glove~Splinter~Crap, got a splinter in my glove!~
\ No newline at end of file
diff --git a/gameserv-2.0/data/monsters/level7.dat b/gameserv-2.0/data/monsters/level7.dat
new file mode 100644 (file)
index 0000000..75fe7c9
--- /dev/null
@@ -0,0 +1,14 @@
+# Name~Weapon~Death Phrase (said when they die)\r
+#Level 7\r
+Godzilla~Sparks~<Godzilla> ROAAAAAAR!!!~\r
+Night Crawler~Long Tail~You cannot defend against my teleporting!~\r
+Large Cactus~10,000 Needles~Pins and needles!!~\r
+Fremen Fedaykin~Weirding Way~The death commando calls out for his beloved Muad'Dib before he dies.~\r
+Land Shark~Razor Jaws~After you slay the half breed you tear off its fin and watch the pool of blood gather.~\r
+Wraith Knight~Dark Sword~You could almost taste your impending doom with every swing of his sword!~\r
+Daredevil~Walking Cane~All you can hear him say through his now toothless grin is "I'm not the bad guy!"~\r
+Invisible Boxer~Floating Gloves~You had a hard time with this opponent, his blood soaked flesh is now fully visible.~\r
+Evil Santa~Bag of Coal~This wicked black cloaked rival can do no more harm!~\r
+Referee~Screeching Whistle~Personal foul. Penalty: his life!~\r
+Warlock~Magic Staff~His spells were no match for your heroic display of power!~\r
+Mafia Boss~Gatling Gun~You made him an offer he couldn't refuse!~
\ No newline at end of file
diff --git a/gameserv-2.0/data/monsters/level8.dat b/gameserv-2.0/data/monsters/level8.dat
new file mode 100644 (file)
index 0000000..0661774
--- /dev/null
@@ -0,0 +1,14 @@
+# Name~Weapon~Death Phrase (said when they die)\r
+#Level 8\r
+Cyclops~Laser Eye~That's one hot laser.\r
+Wan's Beast~Crushing Embrace~The hairy thing has finally stopped moving.\r
+Lord Mathese~Fencing Sword~You have wiped the sneer off his face once and for all.\r
+King Arthur's Evil Twin~Excabular~You feel lucky to have lived, things could have gone sour..\r
+Gate Keeper~Large Key~Goodness he was strong! No wonder he's guarding the gate!\r
+Flying Elephant~Trunk~You wonder how such a large beast was able to fly.\r
+Two Headed Lion~Two Headed Pounce~You have slain the mythical beast and, in the process, have cut off both of its heads!\r
+Flying Purple People Eater~Horn on his Head~He was a one eyed one eared flying purple people eater!\r
+Red Neck of the East~Trailer Hitch~If you go to your family reunion to pick up women, you might be a redneck!\r
+Decomposed Corpse~Horrid Stench~Your stomach churns as you flee from this vile creature's twice killed carcus!\r
+Empty Armor~Translucent Sword~The armor falls into a pile as your finishing blow misses completely! Where did it go?\r
+Liquid Gold Man~Sword Arm~He was tough, and you were greedy, but the payoff is wonderful!
\ No newline at end of file
diff --git a/gameserv-2.0/data/monsters/level9.dat b/gameserv-2.0/data/monsters/level9.dat
new file mode 100644 (file)
index 0000000..08cf3f4
--- /dev/null
@@ -0,0 +1,14 @@
+# Name~Weapon~Death Phrase (said when they die) level 9\r
+# Level 9\r
+Iron Maiden~Hell and Fire~666! THE NUMBER OF THE BEAST!\r
+Black Eye~Blank Stare~The eye seems to stare eternally inward from now on!\r
+Bill Gates~Blue Screen of Death~format c: /q ...He's DEAD!\r
+Honored Matre~Tantric Ecstacy~The whore's attempts at sexual government have been halted for now!\r
+Shaitan~Melange Agony~Shai Hulud's warning must be taken with extreme humility, lest you invoke the wrath of Leto! Bi La Kaifa!\r
+Bene Tleilax Master Waff~Poison Tipped Darts~You almost didn't have time to dodge the darts thrown from his sleeves!\r
+Reverend Mother~Gom Jabbar~Her muscle conditioning was exquisite... but yours is better!\r
+Extremely Large Dingo~Sharp Canines~That stupid mutt won't bother you anymore mate!\r
+Walking Ebola Virus~Disease Ridden Body~You better decontaminate yourself, lest you find yourself infected by the vile monster!\r
+Corprus Stalker~Swollen Limbs~He was slow, but extremely powerful! The corprus disease must do something to his body...\r
+Alien Priest~Religious Banter~Green blood oozes from the carcus of this deceased missionary from beyond...\r
+Mad Scientist~Hydrochloric Acid~The strange man cackles as he crawls away. All you catch is something about chemistry... ?
\ No newline at end of file
diff --git a/gameserv-2.0/libgameservgldl/include/GameServ/DataLayer/File/FileItemDAO.h b/gameserv-2.0/libgameservgldl/include/GameServ/DataLayer/File/FileItemDAO.h
new file mode 100644 (file)
index 0000000..cf0e532
--- /dev/null
@@ -0,0 +1,64 @@
+#ifndef __GS__FILEITEMDAO_H__\r
+#define __GS__FILEITEMDAO_H__\r
+\r
+\r
+\r
+#include <GameServ/GameLayer/GameObjects/ItemGO.h>\r
+using GameServ::GameLayer::GameObjects::ItemGO;\r
+#include <GameServ/DataLayer/IItemDAO.h>\r
+using GameServ::DataLayer::DataAccessObjects::IItemDAO;\r
+\r
+#include <boost/shared_ptr.hpp>\r
+using boost::shared_ptr;\r
+\r
+#include <string>\r
+using std::string;\r
+\r
+#include <list>\r
+using std::list;\r
+\r
+#include <map>\r
+using std::map;\r
+\r
+namespace GameServ {  namespace DataLayer { namespace File\r
+{\r
+       //! File implementation of IItemDAO interface\r
+       /*!\r
+               If you're using an File datasource, you will be using this\r
+               DAO to access Items.\r
+       */\r
+       class FileItemDAO : public IItemDAO\r
+       {\r
+       public:\r
+               // Ctors, Dtors ///////////////////////////////////////////////////////\r
+               FileItemDAO(void);\r
+               FileItemDAO(const string &filename);\r
+               virtual ~FileItemDAO();\r
+\r
+               // Methods ////////////////////////////////////////////////////////////\r
+               virtual shared_ptr<ItemGO> GetById(const string &Id) const;\r
+\r
+               virtual bool IdExists(const string &Id) const;\r
+\r
+               void LoadItemCache(void);\r
+\r
+       private:\r
+               //! Data file\r
+               string mFilename;\r
+\r
+               // Helper Methods /////////////////////////////////////////////////////\r
+\r
+               //! Creates the ItemGO found at iterator position\r
+               shared_ptr<ItemGO> CreateItemFromLine(const string &line) const;\r
+\r
+               //! Get the Item database file path\r
+               string GetItemFilePath(void) const;\r
+\r
+               void Initialize(const string &filename);\r
+\r
+\r
+               map<string, shared_ptr<ItemGO> > spItemCache;\r
+       };\r
+} } } // GameServ.DataLayer.DataAccessObjects.File\r
+\r
+#endif // __GS__FILEITEMDAO_H__
\ No newline at end of file
diff --git a/gameserv-2.0/libgameservgldl/include/GameServ/DataLayer/IItemDAO.h b/gameserv-2.0/libgameservgldl/include/GameServ/DataLayer/IItemDAO.h
new file mode 100644 (file)
index 0000000..dae1cf7
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef __GS_IITEMDAO_H__\r
+#define __GS_IITEMDAO_H__\r
+\r
+#include <GameServ/GameLayer/GameObjects/ItemGO.h>\r
+using GameServ::GameLayer::GameObjects::ItemGO;\r
+\r
+#include <boost/shared_ptr.hpp>\r
+using boost::shared_ptr;\r
+\r
+#include <list>\r
+using std::list;\r
+#include <string>\r
+using std::string;\r
+\r
+namespace GameServ { namespace DataLayer { namespace DataAccessObjects\r
+{\r
+       //! Interface for Item Data Access Objects \r
+       /*! \r
+               This is the interface for all Item DAOs.  Each specific datasource\r
+               will need to inherit this common interface.\r
+       */\r
+       class IItemDAO\r
+       {\r
+       public:\r
+               // Ctors, Dtors ///////////////////////////////////////////////////////\r
+               IItemDAO(void);\r
+               virtual ~IItemDAO(void);        // Needs to be virtual \r
+\r
+               //! Get the Item using a unique data/object Id\r
+               /*!\r
+                       \param Id Unique identifier\r
+                       \return A boost shared pointer to a Item game object if found\r
+                       otherwise the list is empty.\r
+               */\r
+               virtual shared_ptr<ItemGO> GetById(const string &Id) const = 0;\r
+\r
+               //! Function to quickly search to see if an Id exists or not\r
+               /*!\r
+               \param Id The Id of the game object to search for\r
+               \return true if the Id is valid and exists in the data, false otherwise\r
+               */\r
+               virtual bool IdExists(const string &Id) const = 0;\r
+\r
+       private:\r
+               \r
+               \r
+       };\r
+} } }\r
+\r
+#endif
\ No newline at end of file
index 6bac5cfd094a4eb3fe7983e3e51676a327024bba..47c83018625345b60a3f8a3c72c55e30f9ac3618 100644 (file)
@@ -28,6 +28,7 @@ namespace GameServ { namespace GameLayer { namespace GameObjects
        class PlayerGO : public GameObject\r
        {\r
        public:\r
+\r
                PlayerGO();\r
                PlayerGO(const string &Id);\r
 \r
@@ -125,6 +126,17 @@ namespace GameServ { namespace GameLayer { namespace GameObjects
                //! Property set - Alive\r
                void Alive(const bool &value);\r
 \r
+               //! Property set - Inventory\r
+               void Inventory(const vector<string> &value);\r
+\r
+               //! Property get - Inventory\r
+               vector<string> Inventory(void) const;\r
+\r
+               //! Add item to inventory\r
+               void AddItemToInventory(const string &fkItemId, const int &Number=1);\r
+               //! Remove item from inventory\r
+               void RemoveItemFromInventory(const string &fkItemId, const int &Number=1);\r
+\r
                bool operator==(const PlayerGO &right) const;\r
                bool operator!=(const PlayerGO &right) const;\r
 \r
@@ -145,11 +157,12 @@ namespace GameServ { namespace GameLayer { namespace GameObjects
                string mPassword;\r
                shared_ptr<WeaponGO> mWeapon;\r
                shared_ptr<ArmorGO> mArmor;\r
-               vector< shared_ptr<ItemGO> > mInventory;\r
                ptime mLastLogin;\r
 \r
                bool mFoughtMaster;\r
                bool mAlive;\r
+\r
+               vector<string> mfkItemIds;\r
        };\r
 }}} // GameServ::GameLayer::GameObjects\r
 #endif
\ No newline at end of file
diff --git a/gameserv-2.0/libgameservgldl/include/GameServ/GameLayer/GameObjects/PotionGO.h b/gameserv-2.0/libgameservgldl/include/GameServ/GameLayer/GameObjects/PotionGO.h
new file mode 100644 (file)
index 0000000..ca52b31
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef __GS__POTION_H__\r
+#define __GS__POTION_H__\r
+\r
+#include <GameServ/GameLayer/GameObjects/GameObject.h>\r
+using GameServ::GameLayer::GameObjects::GameObject;\r
+#include <GameServ/GameLayer/GameObjects/ItemGO.h>\r
+using GameServ::GameLayer::GameObjects::ItemGO;\r
+\r
+\r
+namespace GameServ { namespace GameLayer { namespace GameObjects {\r
+\r
+class PotionGO : public ItemGO\r
+{\r
+public:\r
+       PotionGO();\r
+       PotionGO(const string &name, const int &price, const int &uses, const int &strength, const int &defense, const int &maxhp);\r
+       virtual ~PotionGO();\r
+\r
+private:\r
+};\r
+\r
+}}}\r
+#endif\r
index 0e7c60ae6e8d11a3edebbef522cad090382cb52f..c46cf04f5b749f5005a31574a9ea6522d86aebe9 100644 (file)
                                        RelativePath=".\include\GameServ\GameLayer\GameObjects\PlayerGO.h"\r
                                        >\r
                                </File>\r
+                               <File\r
+                                       RelativePath=".\src\GameLayer\GameObjects\PotionGO.cpp"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath=".\include\GameServ\GameLayer\GameObjects\PotionGO.h"\r
+                                       >\r
+                               </File>\r
                                <File\r
                                        RelativePath=".\src\GameLayer\GameObjects\WeaponGO.cpp"\r
                                        >\r
diff --git a/gameserv-2.0/libgameservgldl/src/DataLayer/File/FileItemDAO.cpp b/gameserv-2.0/libgameservgldl/src/DataLayer/File/FileItemDAO.cpp
new file mode 100644 (file)
index 0000000..a98a450
--- /dev/null
@@ -0,0 +1,216 @@
+#include <GameServ/DataLayer/File/FileItemDAO.h>\r
+using GameServ::DataLayer::File::FileItemDAO;\r
+#include <GameServ/GameLayer/GameObjects/ItemGO.h>\r
+using GameServ::GameLayer::GameObjects::ItemGO;\r
+#include <GameServ/GameLayer/GameObjects/ArmorGO.h>\r
+using GameServ::GameLayer::GameObjects::ArmorGO;\r
+#include <GameServ/GameLayer/GameObjects/WeaponGO.h>\r
+using GameServ::GameLayer::GameObjects::WeaponGO;\r
+#include <GameServ/GameLayer/GameObjects/PotionGO.h>\r
+using GameServ::GameLayer::GameObjects::PotionGO;\r
+\r
+#include <GameServ/DataLayer/DataLayerExceptions.h>\r
+using GameServ::DataLayer::Exceptions::ResourceException;\r
+using GameServ::DataLayer::Exceptions::DataLayerException;\r
+\r
+#include <GameServ/DataLayer/File/FileId.h>\r
+using GameServ::DataLayer::File::FileId;\r
+\r
+#include <GameServ/Types.h>\r
+using GameServ::Types::ItemTypes;\r
+using GameServ::Types::Modifiers;\r
+using GameServ::Types::Exceptions::TypeException;\r
+\r
+#include <boost/shared_ptr.hpp>\r
+#include <boost/format.hpp>\r
+#include <boost/algorithm/string.hpp>\r
+#include <boost/lexical_cast.hpp>\r
+using boost::shared_ptr;\r
+using boost::format;\r
+using boost::str;\r
+using boost::algorithm::to_upper;\r
+using boost::lexical_cast;\r
+#include <boost/tokenizer.hpp>\r
+typedef boost::tokenizer<boost::char_separator<char> > \r
+    tokenizer;\r
+\r
+#include <string>\r
+using std::string;\r
+\r
+#include <fstream>\r
+using std::ifstream;\r
+using std::getline;\r
+using std::ofstream;\r
+using std::endl;\r
+\r
+#include <map>\r
+using std::map;\r
+\r
+// TODO: Switch filename to be loaded from a config file\r
+FileItemDAO::FileItemDAO() : mFilename("data/items/masteritems.dat")\r
+{\r
+       Initialize(GetItemFilePath());\r
+}\r
+\r
+FileItemDAO::FileItemDAO(const string &filename)\r
+{\r
+       Initialize(filename);\r
+}\r
+\r
+FileItemDAO::~FileItemDAO()\r
+{\r
+}\r
+\r
+void FileItemDAO::Initialize(const string &filename)\r
+{\r
+       mFilename = filename;\r
+       LoadItemCache();\r
+}\r
+\r
+string FileItemDAO::GetItemFilePath() const\r
+{\r
+       return mFilename;\r
+}\r
+\r
+shared_ptr<ItemGO> FileItemDAO::GetById(const string &Id) const\r
+{\r
+       string line;\r
+       ifstream infile;\r
+       infile.open(GetItemFilePath().c_str());\r
+\r
+       if (infile.fail())\r
+       {\r
+               throw ResourceException(str(format("Unable to open file %1%") % GetItemFilePath()), __FILE__, __LINE__);\r
+       }\r
+\r
+\r
+       while (getline(infile, line))\r
+       {\r
+               if (line.empty())\r
+               {\r
+                       continue;\r
+               }\r
+               if (line[0] == '#')\r
+               {\r
+                       continue;\r
+               }\r
+               size_t tilde1 = line.find_first_of("~");\r
+               if (tilde1 == string::npos)\r
+               {\r
+                       throw DataLayerException(str(format("Invalid Item in %1%: %2%") % mFilename % line), __FILE__,\r
+                               __LINE__);\r
+               }\r
+               size_t tilde2 = line.find_first_of("~", tilde1 + 1);\r
+               if (tilde2 == string::npos)\r
+               {\r
+                       throw DataLayerException(str(format("Invalid Item in %1%: %2%") % mFilename % line), __FILE__,\r
+                               __LINE__);\r
+               }\r
+               string lineId = FileId::CreateItemId(line.substr(tilde1 + 1, tilde2 - tilde1 - 1));\r
+               \r
+               if (lineId == Id)\r
+               {\r
+                       shared_ptr<ItemGO> spItem = CreateItemFromLine(line);\r
+                       return spItem;\r
+               }\r
+       }\r
+       return shared_ptr<ItemGO>();\r
+}\r
+\r
+shared_ptr<ItemGO> FileItemDAO::CreateItemFromLine(const string &line) const\r
+{\r
+       assert(!line.empty());\r
+       shared_ptr<ItemGO> spItem;\r
+       map<Modifiers::Modifier, int> modifiers;\r
+       boost::char_separator<char> sep("~", 0, boost::keep_empty_tokens);\r
+       tokenizer tokens(line, sep);\r
+       tokenizer::iterator tok_iter = tokens.begin();\r
+\r
+       ItemTypes::ItemType type;\r
+       \r
+       try\r
+       {\r
+               type = ItemTypes::Parse((*tok_iter));\r
+       }\r
+       catch (TypeException)\r
+       {\r
+               return shared_ptr<ItemGO>();\r
+       }\r
+\r
+       switch(type)\r
+       {\r
+       case ItemTypes::Weapon:\r
+               spItem = shared_ptr<WeaponGO>(new WeaponGO());\r
+               break;\r
+       case ItemTypes::Armor:\r
+               spItem = shared_ptr<ArmorGO>(new ArmorGO());\r
+               break;\r
+       case ItemTypes::Potion:\r
+               spItem = shared_ptr<PotionGO>(new PotionGO());\r
+       default:\r
+               throw DataLayerException(str(format("Unknown Item type: %1%") % type), __FILE__, __LINE__);\r
+       }\r
+       tok_iter++;\r
+       spItem->Id(FileId::CreateItemId((*tok_iter)));\r
+\r
+       tok_iter++;\r
+       spItem->Name((*tok_iter));\r
+       tok_iter++;\r
+       spItem->Price(lexical_cast<unsigned long int>((*tok_iter)));\r
+       tok_iter++;\r
+       spItem->Uses(lexical_cast<int>((*tok_iter)));\r
+       tok_iter++;\r
+       modifiers[Modifiers::strength] = lexical_cast<int>((*tok_iter));\r
+       tok_iter++;\r
+       modifiers[Modifiers::defense] = lexical_cast<int>((*tok_iter));\r
+       tok_iter++;\r
+       modifiers[Modifiers::maxhp] = lexical_cast<int>((*tok_iter));\r
+       tok_iter++;\r
+       modifiers[Modifiers::hp] = lexical_cast<int>((*tok_iter));\r
+       tok_iter++;\r
+       modifiers[Modifiers::forestfights] = lexical_cast<int>((*tok_iter));\r
+       tok_iter++;\r
+       modifiers[Modifiers::playerfights] = lexical_cast<int>((*tok_iter));\r
+       tok_iter++;\r
+       modifiers[Modifiers::gold] = lexical_cast<int>((*tok_iter));\r
+       tok_iter++;\r
+       modifiers[Modifiers::bank] = lexical_cast<int>((*tok_iter));\r
+       spItem->Modifiers(modifiers);\r
+\r
+       return spItem;\r
+}\r
+bool FileItemDAO::IdExists(const string &Id) const\r
+{\r
+       map<string, shared_ptr<ItemGO> >::const_iterator iter;\r
+       iter = spItemCache.find(Id);\r
+       return (iter != spItemCache.end());\r
+}\r
+\r
+void FileItemDAO::LoadItemCache(void)\r
+{\r
+       ifstream infile;\r
+       infile.open(mFilename.c_str());\r
+\r
+       if (infile.fail())\r
+       {\r
+               throw DataLayerException(str(format("Unable to open %1% for reading") % mFilename), __FILE__, __LINE__);\r
+       }\r
+       string line;\r
+       while (getline(infile, line))\r
+       {\r
+               if (line.length() == 0)\r
+               {\r
+                       continue;\r
+               }\r
+               if (line[0] == '#')\r
+               {\r
+                       continue;\r
+               }\r
+               shared_ptr<ItemGO> spItem = CreateItemFromLine(line);\r
+               if (spItem != 0)\r
+               {\r
+                       spItemCache[spItem->Id()] = spItem;\r
+               }\r
+       }\r
+       infile.close();\r
+}\r
diff --git a/gameserv-2.0/libgameservgldl/src/DataLayer/IItemDAO.cpp b/gameserv-2.0/libgameservgldl/src/DataLayer/IItemDAO.cpp
new file mode 100644 (file)
index 0000000..53d3b2f
--- /dev/null
@@ -0,0 +1,13 @@
+#include <GameServ/DataLayer/IItemDAO.h>\r
+using GameServ::DataLayer::DataAccessObjects::IItemDAO;\r
+\r
+#include <GameServ/GameLayer/GameObjects/ItemGO.h>\r
+using GameServ::GameLayer::GameObjects::ItemGO;\r
+\r
+IItemDAO::IItemDAO()\r
+{\r
+}\r
+\r
+IItemDAO::~IItemDAO()\r
+{\r
+}
\ No newline at end of file
index efe34fc128a3b0fc87c628f177c5712d8d4ceebf..846f33294c002d15952f7ee59b10bc5bdc7de879 100644 (file)
@@ -14,6 +14,14 @@ using GameServ::Exceptions::GameServException;
 #include <boost/date_time/posix_time/posix_time.hpp>\r
 using boost::posix_time::ptime;\r
 \r
+#include <vector>\r
+using std::vector;\r
+#include <string>\r
+using std::string;\r
+#include <algorithm>\r
+using std::find;\r
+using std::sort;\r
+\r
 PlayerGO::PlayerGO() : GameObject(), mName(""), mLevel(1), mExperience(0), mGold(0), mHealth(0), mMaxHealth(0), mStrength(1),\r
 mDefense(1), mForestFights(0), mPlayerFights(0), mPassword("")\r
 {\r
@@ -216,6 +224,46 @@ ptime PlayerGO::LastLogin(void) const
        return mLastLogin;\r
 }\r
 \r
+\r
+void PlayerGO::Inventory(const vector<string> &value)\r
+{\r
+       mfkItemIds.clear();\r
+       mfkItemIds.insert(mfkItemIds.begin(), value.begin(), value.end());\r
+}\r
+\r
+vector<string> PlayerGO::Inventory(void) const\r
+{\r
+       return mfkItemIds;\r
+}\r
+\r
+\r
+void PlayerGO::AddItemToInventory(const string &fkItemId, const int &Number)\r
+{\r
+       for (int x = 0; x < Number; ++x)\r
+       {\r
+               mfkItemIds.push_back(fkItemId);\r
+       }\r
+       sort(mfkItemIds.begin(), mfkItemIds.end());\r
+}\r
+\r
+void PlayerGO::RemoveItemFromInventory(const string &fkItemId, const int &Number)\r
+{\r
+       vector<string>::iterator iter;\r
+       for (int x = 0; x < Number; ++x)\r
+       {\r
+               iter = find(mfkItemIds.begin(), mfkItemIds.end(), fkItemId);\r
+               if (iter != mfkItemIds.end())\r
+               {\r
+                       mfkItemIds.erase(iter);\r
+               }\r
+               else\r
+               {\r
+                       break;\r
+               }\r
+       }\r
+}\r
+\r
+\r
 bool PlayerGO::operator !=(const PlayerGO &right) const\r
 {\r
        return !(*this == right);\r
@@ -227,9 +275,9 @@ bool PlayerGO::operator ==(const PlayerGO &right) const
                mName == right.mName && right.mArmor == mArmor &&\r
                right.mDefense == mDefense && right.mExperience == mExperience &&\r
                right.mForestFights == mForestFights && right.mGold == mGold &&\r
-               right.mHealth == mHealth && right.mInventory == mInventory &&\r
-               right.mLevel == mLevel && right.mMaxHealth == mMaxHealth &&\r
-               right.mPassword == mPassword && right.mPlayerFights == mPlayerFights &&\r
+               right.mHealth == mHealth && right.mMaxHealth == mMaxHealth &&\r
+               right.mLevel == mLevel && right.mPassword == mPassword && \r
+               right.mPlayerFights == mPlayerFights && \r
                right.mStrength == mStrength && right.mWeapon == mWeapon;\r
 }\r
 \r
diff --git a/gameserv-2.0/libgameservgldl/src/GameLayer/GameObjects/PotionGO.cpp b/gameserv-2.0/libgameservgldl/src/GameLayer/GameObjects/PotionGO.cpp
new file mode 100644 (file)
index 0000000..781d0e6
--- /dev/null
@@ -0,0 +1,46 @@
+#include <GameServ/GameLayer/GameObjects/PotionGO.h>\r
+using GameServ::GameLayer::GameObjects::PotionGO;\r
+\r
+#include <GameServ/Types.h>\r
+using GameServ::Types::Modifiers;\r
+using GameServ::Types::ItemTypes;\r
+\r
+#include <string>\r
+using std::string;\r
+#include <map>\r
+using std::map;\r
+\r
+#include <boost/format.hpp>\r
+#include <boost/algorithm/string.hpp>\r
+using boost::format;\r
+using boost::str;\r
+\r
+\r
+PotionGO::PotionGO() : ItemGO()\r
+{\r
+}\r
+\r
+PotionGO::PotionGO(const string &name, const int &price, const int &uses, const int &strength, const int &defense, const int &maxhp) :\r
+ItemGO()\r
+{\r
+       mName = name;\r
+       mPrice = price;\r
+       mUses = uses;\r
+       mModifiers.clear();\r
+       mModifiers[Modifiers::strength] = strength;\r
+       mModifiers[Modifiers::defense] = defense;\r
+       mModifiers[Modifiers::maxhp] = maxhp;\r
+}\r
+\r
+PotionGO::~PotionGO()\r
+{\r
+}\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r