DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • November 24, 2017, 12:11:22 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2 3 ... 22   Go Down
  Print  
Author Topic: Item system  (Read 75263 times)
0 Members and 1 Guest are viewing this topic.
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« on: May 19, 2005, 01:58:16 PM »

Item System, Version 1.0  http://dragonprime.net/index.php?module=Downloads;sa=dlview;id=1033

This thing is containing several files which allow easy integration of an item/inventory system into new or existing modules. It contains a first basic shop, a looting module and the inventory system, which generates the necessary tables and provides the interface for activating the items.

Please note: No premade items are included by now. Before using findloot.php you have to create at least one item with "Loot" (case sensitive!) as category.

The files are:
  • lib/itemhandler.php
  • contains basic functions like "add_item()", "remove_item()", "get_random_item()" or "get_inventory()"
  • functions recognize, if you pass over the item name or the item's ID as reference
  • add_item($item, $qty, $user) -> Adds item to user's inventory. If $user is left empty, item will be added to current user's inventory. If $qty is left empty only one item will be added
  • remove_item($item, $qty, $user) -> Same as above, but removes items
  • check_qty($item, $user) -> Return the quantity of items $user possesses. If user is left empty, current user will be used...
  • get_item($item) -> Returns the item information (array).
  • get_random_item($class) -> Returns a random item (array). Current user must fulfill level and dragonkills requirements for this item. If no item is found, it returns "false".
  • get_inventory($user) -> returns the mysql-result of the users inventory. Rows still need to be fetched from this function's return value
  • shopnav($return, $class, $sell=false, $user=0) -> see basicitemshop for an example on usage... if $user is not left empty it shows the navs depending on $user's inventory... (Useful for trading between players...)
  • modules/inventory.php
  • generates links for users to see other peoples inventory
  • activates items with buffs attached to them
  • generates navs, which can activate items in battle
  • generates links, which can start other modules for scripted effects
  • modules/basicitemshop.php
  • makes use of the "shopnav()" function, which generates navs for a specific item category. E.g. this shop only buys/sells items of the "Loot"-category.
  • modules/findloot.php
  • Simple module, which will pick a valid, random item when the user is victorious on a forest or travel fight and (on a customizable chance) add this item to the victor's inventory.
  • lootitems.sql
  • Contains some basic loot items. No special effects attached though. Just grab them and sell them.
[/list]

Have fun using this... And please tell me, what can be improved, what other ideas should be built in, whatever you like!

Things to do:
  • Make an option, whether players can carry only a specific number of items, only a specific weight or a limitless amount (and display such information via charstats)
  • make items droppable
  • Create a system where players can trade items (only items!)
« Last Edit: April 28, 2007, 08:09:32 AM by Elessa » Logged

Running for more than three years now:
Dannic
Guest
« Reply #1 on: May 19, 2005, 09:16:17 PM »

can you define the max number of items a person can carry?  Or max weight?  Can you define weight of the items or cumbersomeness?  How about dropping items?  Sticking items in a back pack through the backpack hook?

This is a great idea.  Looking forward to its continued support and development.
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #2 on: May 19, 2005, 09:33:48 PM »

Updated to do list for this mod.

which backpack-hook do you think of, Dannic?
Logged

Running for more than three years now:
Dannic
Guest
« Reply #3 on: May 19, 2005, 09:43:36 PM »

The only one I know of is modulehook("backpack").  

Of course I haven't looked at webpixies backpack to see if it has any others that mine doesn't have but that's the same in both of our backpack modules.  Least I think it is.

btw... did you fix the location setting?
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #4 on: May 19, 2005, 09:55:42 PM »

Now, that you mention it... Yes, also fixed some typos concerning translation issues...

Writing modules not translation ready and then cenverting them to translation readiness AND another language is... a source for possible mistakes...  Tongue
Logged

Running for more than three years now:
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #5 on: May 19, 2005, 10:03:54 PM »

Of course I haven't looked at webpixies backpack to see if it has any others that mine doesn't have but that's the same in both of our backpack modules.
As far as I have seen, WebPixies module uses the existing prefs of other modules to display the amount of items you carry...

This here is totally dynamic and does use its own table for inventory... I'm not sure, if this is compatible...
Logged

Running for more than three years now:
Dannic
Guest
« Reply #6 on: May 20, 2005, 07:51:14 AM »

would you mind if I wrote a little something and sent it to you to add?
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #7 on: May 20, 2005, 08:06:53 AM »

No, I definately don't mind...

Any suggestions for loot items are also welcome... Smiley
Logged

Running for more than three years now:
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #8 on: May 21, 2005, 09:47:34 AM »

Updated findloot.php and inventory.php to support weight limits and count limits...

Admins can now configure the maximum amount of items players can carry and the maximum weight they can bear. Both can be turned off by setting these values to 0.

As well as that, users can now drop their items (instead of selling them...) via their inventory. Fur this the itemhandler.php had to be updated, too.
Items can be set up to be "undroppable" to prevent users from throwing away quest items or other important things they might need...

I'm still working on the charstat display. This will come in soon Grin

Any further suggestions (and help) is always welcome!
« Last Edit: May 21, 2005, 09:48:25 AM by XChrisX » Logged

Running for more than three years now:
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #9 on: June 07, 2005, 02:54:18 AM »

how about a sql dump of some items to get our creative engines started.  Smiley
Logged

XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #10 on: June 07, 2005, 02:58:33 AM »

I will post some loot items alongwith an update soon...

SQL dumping of items might be a problem as soon as theres a buff attached to the item... I haven't found a way around this yet... Sad

Give me a little time to translate our items to english! Smiley
Logged

Running for more than three years now:
enderwiggin
Guest
« Reply #11 on: June 07, 2005, 09:26:09 PM »

How about a trading system?

You might get furs from one kill, meat from another, etc.

One city might be buying furs at one price, and another city might be buying them cheaper.

Hopping from one city to another you might make money from trading.
Logged
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #12 on: June 08, 2005, 02:19:58 AM »

How about a trading system?

You might get furs from one kill, meat from another, etc.

One city might be buying furs at one price, and another city might be buying them cheaper.

Hopping from one city to another you might make money from trading.

sounds more like another module.  also, sounds like the alternate currencies/trading modules from Lonny.
Logged

XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #13 on: June 08, 2005, 02:40:14 AM »

I'm planning a module where players can trade items with each other, but that'll have to wait a little for now...
But Shops, that sell and buy items at different prices? Like sixfoot said, sounds a bit like Lonnyl's module...
Logged

Running for more than three years now:
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #14 on: June 09, 2005, 08:45:39 AM »

Okay... Finally I made it... Wink

Updated the file! Please redownload it as some bugfixes had to be made!

Items did not really get lost on a dragonkill and if they did, only one was lost (and never more than one!)

The new file also contains some basic loot items now. Most of them get lost on a dragonkill but three might have a chance to stay.

http://dragonprime.net/users/XChrisX/itemsystem.zip
Logged

Running for more than three years now:
Pages: [1] 2 3 ... 22   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Please take the time to read the FAQ and browse the DragonPedia

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
16 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search