DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • November 12, 2018, 09:36:22 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: COFD Artifacts  (Read 3219 times)
0 Members and 1 Guest are viewing this topic.
bwatford
Guest
« on: March 23, 2004, 04:34:12 PM »

Ok this is a new idea that's going into the castle that I need some help with how to code them.

There will be 10 Artifacts hidden within the castle that the users that search/do that activity will have a 1 in 100 chance of maybe getting the artifact. Stories and rumors of these artifacts will go into the castle library. Here's the deal.

Only one person can have an artifact at one time with x number of uses and when it is used up then it has the chance to be found again. So...

1.) Where do I add the table so that it will remove the artifact possibility if someone already has it. So it's universal and how would the if statement look.

2.) How do I add the buffs (charges) for this item so it shows in the buff list e.x. 20 uses a day for 5 days etc before in vanishes.

You all probably get the general idea and there will be cursed artifacts as well. I think they would code like a new 'mount' section kinda as far as the code goes but this is one of the things I'm adding that is the roughest to code.

Do you have any other ideas on the subject?

 
Logged
Drenac
Guest
« Reply #1 on: March 23, 2004, 06:01:47 PM »

Bwatford,

I think i would create a seperate table for your artifacts.  This allows you to keep track of which artifacts are currently owned by players, it allows you to keep track of how long the player has had the artifact, and since all the artifacts are data-driven, you can add more artifacts later just by adding them to the artifacts table.  You could in theory store the effects of the artifact in the table as well, in addition to how long that particular artifact lasts....

Basically whenever someone enters a room and searches for an artifact check the artifacts table and see if any artifacts which are located in that area are currently "unowned".  if there is an artifact unowned, then do a random roll and see if the player finds it, otherwise skip the search.....

If the player finds it, you'll want to flag the artifact as owned in the artifact table...you'll probably also want to identify who owns it in that table, and perhaps have a counter in the artifacts table for the number of days the artifact has been owned - which will be reset to 0 whenever someone new finds the artifact.  Finally, you'll want to add a field to the accounts table like "HasArtifact".....which will store the id of the artifact that player currently owns.   This will be necessary so whenever you log in or when a new day occurs you can update the status of the owned artifacts.

As far as adding the buffs, you'll do it very similar to how the mounts work...you'll have a buff category for artifacts and whenever a user logs in the buff will be added...after x turns the buff deactives just like mounts....finally, whenever the owner logs in, check what day it is and see if x days have passed since the owner obtained the item, if so...flag it as unowned, and set the players "HasArtifact" flag to 0.  This should handle most of it.

Let me know if you need any further details...but this should give you a "possible" way to implement it, though not necessarily the "best" way to implement it.

Cheers! ~Drenac  Cool
Logged
bwatford
Guest
« Reply #2 on: March 23, 2004, 06:11:39 PM »

interesting way of doing it.... I'll have to see if my little brain can comprehend all that into code.

Any other suggestions anyone?
Logged
anpera
Guest
« Reply #3 on: March 23, 2004, 07:12:37 PM »

I think Drenac's solution *is* the best.

It would be similar to the "inventory" of my housing script (which should be released here soon). This "Inventory" is a table named "items" where different values of an item can be stored. Like: owner-ID (0 for none), item name, a description, field for buffs is there, gold and gem pricing, 3 user defined values with 1 of them hidden from player. A very important field is "class". In it the origin of the item is stored. I use this table to control the keys for houses, therefore "class" of keys is set to "key". This enables the housing script to identify its own items by only searching "WHERE class='key'".

Enter the 10 artifacts in there and set "class" to "artifact". Rest is exactly like Drenac described.

Buffs are easy to handle. On newday or if player activates the item just read out "buff" field and add the content to bufflist of user. If the item should destroy itself, simply set owner-id to 0 after buff was added to bufflist. Rest is done by buffhandling of LoGD Smiley
For multiple uses store a countdown var in one of the user defined fields of the item, that counts down every day or every use.

I had this idea with spells and magical items while searching for how to handle keys, that's why I've blown up this table a little more than I would have needed for house keys. Smiley

Hell, even Golden Egg could be done with it ^^
Logged
strider
Guest
« Reply #4 on: April 22, 2004, 07:10:50 PM »

I'm actually unifing two little artifact tables I already had going in my game with Anpera's "items" table to make something more universal. It's easy enough to do, once you have a trackable inventory going on in your mod.
« Last Edit: April 22, 2004, 07:11:18 PM by strider » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

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