Posted: Sat Dec 06, 2008 7:15 pm
kk, I set up 'roots' and 'budding natural garden' as a test run on your server. The code is checked in now. Let me know if you have any problems.
http://oldforums.eq2classic.com/
Code: Select all
insert ignore into character_skills (char_id, skill_id, max_val) select c.id, s.id, 5 from characters c, skills s where s.name ='Gathering';
insert ignore into character_skills (char_id, skill_id, max_val) select c.id, s.id, 5 from characters c, skills s where s.name ='Foresting';
insert ignore into character_skills (char_id, skill_id, max_val) select c.id, s.id, 5 from characters c, skills s where s.name ='Trapping';
insert ignore into character_skills (char_id, skill_id, max_val) select c.id, s.id, 5 from characters c, skills s where s.name ='Mining';
insert ignore into character_skills (char_id, skill_id, max_val) select c.id, s.id, 5 from characters c, skills s where s.name ='Fishing';Man, we talk a lot. I cannot find shit anymore!John Adams
Database Lead
Posts: 3036
Yup that field is useless, it isn't used in the code at all.John Adams wrote: So I will ask instead... LE, in the `spawn` table, the field 'ground_spawn' is no longer needed, right? I think that was v1.0 and we did away with that almost immediately... but I can't remember. If so, can we drop that field after the DB consolidation?
Nope, those should have been unique, and looking at the table I'm not sure what I was thinking when I created it. It seems that I could have easily just used spawn_id in groundspawn_items and gotten rid of groundspawn_entry_id entirely :/John Adams wrote: And... in spawn_ground, can we add more than one groundspawn_id to a spawn? I am thinking not, but wanted to be sure since there is no UNIQUE index on spawn_id.
What I thought I had to do was set up an Item ID 18 groundspawn_items entry with 1 num_items, min_score of 3 (to make it easier for success in the noob areas), the rare and trigger are on.LethalEncounter wrote: Note the following changes:Examples:1. I am using groundspawn_entry_id as the key between spawn_ground and groundspawn_items. This allows multiple ground spawns to use the same groundspawn_entry_id instead of forcing the admin to duplicate all the entries.
2. The groundspawn_items table is loosely based off of Live, but I think the player will get the same experience doing it this way.
3. Entries in the groundspawn_items table should use the same groundspawn_entry_id for all the items that the groundspawn can give out.
4. To add an entry into the table you give it:
a. the groundspawn_entry_id you are going to use in your spawn_ground table.
b. the item_id, num_items, and min_score required to receive the items (min_score explained below)
5. If the entry is a rare item you would put a 1 in rare_item. This will display the "You have found a rare item" popup.
6. If you want to trigger the bonus check, you would put a 1 in triggers_bonus_check.
6. min_score is the min_score from the random number generator. Ex if the players skill is 2 and the min_score in the table is 4, the player would only receive the items at a random 'roll' of 4-5 (the random range rounds to the next highest increment of 5 to prevent problems at low levels)
7. If you use the same min_score for multiple item_ids for the same groundspawn_entry_id, only 1 item_id will be given to the player if they achieve the min_score value. Which one will be randomly determined.
8. The groundspawn_bonus table is based on precentage NOT on the min_score above. How the bonus works is a separate 'roll' is calculated and going from lowest percentage to highest World tries to find an item an entry in the table for that groundspawn. Once it does it is done. Only 1 bonus entry per trigger is given.1. You want to give the player 3 harvest opportunities for a root node.
1a. In the spawn_ground table you would set number_harvests to 3.
2a. Find a new groundspawn_entry_id that is unused and update the field with this.
2. You also want to give them 1 root if they roll at least a 4 (note that the next highest increment of 5 is used as the max of their roll).
2a. In the groundspawn_items table you use the groundspawn_entry_id from 1a.
2b. You set: the item_id of the root, num_items of 1, min_score 4.
3. You want to give them a chance at getting 3 or 5 roots if they trigger the rare.
3a. You add the entry to the groundspawn_items table and set both rare_item and triggers_bonus_check to 1.
3b. You add two entries into the groundspawn_bonus table, 1 for the 3 roots and 1 for the 5 roots. You specify the percentage that the given entry is triggered. Note that it will only give a max of 1 item (sometimes none based on percentages) per trigger.
LE, I am having some difficulty setting up some ground spawn harvestables. Two things; 1) understanding min_score better, and 2) what-if scenario on multiple rare rewards based on the trigger.LethalEncounter wrote:Examples:OK, That explains the new system. If you have questions please make sure that you thoroughly read the information above as I *think* I have anticipated your questions, however if I didn't please let me know ASAP so that I can start implementing this.Code: Select all
1. You want to give the player 3 harvest opportunities for a root node. 1a. In the spawn_ground table you would set number_harvests to 3. 2a. Find a new groundspawn_entry_id that is unused and update the field with this. 2. You also want to give them 1 root if they roll at least a 4 (note that the next highest increment of 5 is used as the max of their roll). 2a. In the groundspawn_items table you use the groundspawn_entry_id from 1a. 2b. You set: the item_id of the root, num_items of 1, min_score 4. 3. You want to give them a chance at getting 3 or 5 roots if they trigger the rare. 3a. You add the entry to the groundspawn_items table and set both rare_item and triggers_bonus_check to 1. 3b. You add two entries into the groundspawn_bonus table, 1 for the 3 roots and 1 for the 5 roots. You specify the percentage that the given entry is triggered. Note that it will only give a max of 1 item (sometimes none based on percentages) per trigger.
You need to increase the min_score from 1 to 2 unless you always want them to get something from the node.John Adams wrote:I know I asked this a few mos ago, but let me try and be more precise with my question.
LE, I am having some difficulty setting up some ground spawn harvestables. Two things; 1) understanding min_score better, and 2) what-if scenario on multiple rare rewards based on the trigger.LethalEncounter wrote:Examples:OK, That explains the new system. If you have questions please make sure that you thoroughly read the information above as I *think* I have anticipated your questions, however if I didn't please let me know ASAP so that I can start implementing this.Code: Select all
1. You want to give the player 3 harvest opportunities for a root node. 1a. In the spawn_ground table you would set number_harvests to 3. 2a. Find a new groundspawn_entry_id that is unused and update the field with this. 2. You also want to give them 1 root if they roll at least a 4 (note that the next highest increment of 5 is used as the max of their roll). 2a. In the groundspawn_items table you use the groundspawn_entry_id from 1a. 2b. You set: the item_id of the root, num_items of 1, min_score 4. 3. You want to give them a chance at getting 3 or 5 roots if they trigger the rare. 3a. You add the entry to the groundspawn_items table and set both rare_item and triggers_bonus_check to 1. 3b. You add two entries into the groundspawn_bonus table, 1 for the 3 roots and 1 for the 5 roots. You specify the percentage that the given entry is triggered. Note that it will only give a max of 1 item (sometimes none based on percentages) per trigger.
Here's my scenario - first look at my data for a "compound ore" node:
- I have the Ore node assigned the 4 possible T1 rewards; tin, leaded, bronze, and solidified
I have set up reward quantities of 1, 3, 5 and 10 for the two common types... where if the 10 is achieved, the bonus trigger is fired and they not only get the 10 "tin" or "leaded", but also 1 rare "bronze" or "solidified"
I have set up a rare_item on the bronze and solidified, with a min_score of 1 (maybe that's too low)
This is my understanding of now the 1, 3, 5, and 10 harvest results work on Live (correct me if I am wrong)
Hmm yah I see your point, we need to include a max percentage in the mix to prevent people from always getting a particular item if there skill is that that much higher than the threshold. Let me think about this...John Adams wrote: Problem #1:
I am having trouble fully understanding the min_score value. Could you explain it as if you are explaining it to a 5 y/o that has never seen a calculator before?I am assuming, as a level 1 character who's max skill for Mining is 5, that if I put a 5 in min_score, World randoms between 1 and Max_Skill (5) and compares it to min_score (5) and if it's a hit, I get the reward.
However, if I am level 80 and my max skill for Mining is 400, and that node still has a 5 for min_score... what are my results? World randoms 1-400 and if it's greater than 5, I win? That's going to be a rare every time, just about. Right?
The code automatically gets the highest available item that is lower than your score. So if you rolled an 11 it would give the item step up with a min_score of 10, but not the one with a min_score of 5. If there are multiple min_scores that are the same for your particular prize level, it randomly picks one.John Adams wrote: Problem #2:
Taking my example above, I have 2 possible scenarios where a harvest of 10 could trigger a bonus check.
However, how do I tell the groundspawn_items which groundspawn_bonus to reward? I am not getting this "10" to trigger yet, so I cannot tell you what will happen. Hence, the first problem -- understanding min_score
- If it is "10 tin", I should get a bonus "1 bronze"
If it is "10 leaded", I should get a bonus "1 solidified"
Can I get a refresher on this? There are many nodes set up just like this, and until someone tells me this is NOT how it is on Live, this is how I am setting them up.
TIA,
J