Florix

[HowTo] Fix Loot

20 posts in this topic

So, today we gonna fix a NPC Loot. For these we will use the tables:

  1.  http://collab.kpsn.org/display/tc/creature_template  - `lootid` Colunm
  2.  http://collab.kpsn.org/display/tc/loot_template - Loot Data


Example: http://www.wowhead.com/npc=67071
I what add all loot of this NPC:

DELETE FROM `creature_loot_template` WHERE `entry`=67071;
INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
(67071, 74833, 34.63, 1, 0, 1, 1),
(67071, 80240, 0.142315, 1, 0, 1, 1),
(67071, 81194, 95.1139, 1, 0, 1, 1),
(67071, 81212, 4.76755, 1, 0, 1, 1),
(67071, 81966, 0.118596, 1, 0, 1, 1),
(67071, 81967, 0.118596, 1, 0, 1, 1),
(67071, 81968, 0.142315, 1, 0, 1, 1),
(67071, 81969, 0.0948767, 1, 0, 1, 1),
(67071, 81970, 0.0948767, 1, 0, 1, 1),
(67071, 81971, 0.0474383, 1, 0, 1, 1),
(67071, 81972, 0.0711575, 1, 0, 1, 1),
(67071, 81973, 0.0474383, 1, 0, 1, 1),
(67071, 81974, 0.0474383, 1, 0, 1, 1),
(67071, 81975, 0.0711575, 1, 0, 1, 1),
(67071, 81976, 0.0474383, 1, 0, 1, 1),
(67071, 81977, 0.118596, 1, 0, 1, 1),
(67071, 81978, 0.0237192, 1, 0, 1, 1),
(67071, 81979, 0.0474383, 1, 0, 1, 1),
(67071, 81982, 0.0474383, 1, 0, 1, 1),
(67071, 81983, 0.0948767, 1, 0, 1, 1),
(67071, 81984, 0.0948767, 1, 0, 1, 1),
(67071, 81985, 0.0711575, 1, 0, 1, 1),
(67071, 81986, 0.0711575, 1, 0, 1, 1),
(67071, 81987, 0.0711575, 1, 0, 1, 1),
(67071, 81988, 0.0948767, 1, 0, 1, 1),
(67071, 81989, 0.0711575, 1, 0, 1, 1),
(67071, 81990, 0.0948767, 1, 0, 1, 1),
(67071, 81991, 0.0711575, 1, 0, 1, 1),
(67071, 81992, 0.0237192, 1, 0, 1, 1),
(67071, 81993, 0.0237192, 1, 0, 1, 1),
(67071, 81994, 0.0948767, 1, 0, 1, 1),
(67071, 81997, 0.0474383, 1, 0, 1, 1),
(67071, 81998, 0.213472, 1, 0, 1, 1),
(67071, 82000, 0.0237192, 1, 0, 1, 1),
(67071, 82001, 0.0711575, 1, 0, 1, 1),
(67071, 82002, 0.0237192, 1, 0, 1, 1),
(67071, 82003, 0.0948767, 1, 0, 1, 1),
(67071, 82005, 0.142315, 1, 0, 1, 1),
(67071, 82006, 0.0474383, 1, 0, 1, 1),
(67071, 82007, 0.0474383, 1, 0, 1, 1),
(67071, 82008, 0.0474383, 1, 0, 1, 1),
(67071, 82009, 0.0237192, 1, 0, 1, 1),
(67071, 82011, 0.0711575, 1, 0, 1, 1),
(67071, 82013, 0.0474383, 1, 0, 1, 1),
(67071, 82014, 0.0474383, 1, 0, 1, 1),
(67071, 82015, 0.0237192, 1, 0, 1, 1),
(67071, 82017, 0.0237192, 1, 0, 1, 1),
(67071, 82019, 0.0474383, 1, 0, 1, 1),
(67071, 82020, 0.0237192, 1, 0, 1, 1),
(67071, 83840, 0.0237192, 1, 0, 1, 1),
(67071, 83844, 0.0237192, 1, 0, 1, 1),
(67071, 83851, 0.0237192, 1, 0, 1, 1),
(67071, 87391, 0.0474383, 1, 0, 1, 1),
(67071, 87506, 0.0237192, 1, 0, 1, 1),
(67071, 87521, 0.0237192, 1, 0, 1, 1),
(67071, 89112, 3.41556, 1, 0, 1, 1);



"But Mr. Horde, the NPC drops a lot of items, I need get one by one from wowhead?
Yes if you don't have a parser, search on Google for more details.
 
But most of loots was parsed and we just correct some wrong data.
Like, I just want to add the http://www.wowhead.com/item=81194 for this NPC."

DELETE FROM `creature_loot_template` WHERE `entry`=67071 AND `item`=81194; -- REMEMBER THE `ITEM` OR YOU WILL DELETE ALL LOOT DATA!
INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES (67071, 81194, 95.1139, 1, 0, 1, 1);



Until here we only made changes on creature_loot_template, but we need change too the creature_template of the NPC for say to core:
- Hey, look this NPC, it's have a lootid = XXXXX

UPDATE `creature_template` SET `lootid`=67071 WHERE `entry`=67071;



Most of NPCs have the own loot, so, all time `lootid` will be the NPC `entry`, and on creature_loot_template the entry will be the same of creature_template.
 
There are some other loots types:

  1. fishing_loot_template - Fishing Zone Loots
  2. skinning_loot_template - Skinning NPC Loots
  3. prospering_loot_template - Items
  4. gameobject_loot_template - Loot of chests
  5. spell_loot_template - Some spell drop items

All these `loots_templates` follow the same structure.


Explain the columns:

INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES 
(67071, 74833, 34.63, 1, 0, 1, 1),
  1. `entry` = NPC entry (id)
  2. `item`  = Item entry (id)
  3. `ChanceOrQuestChance` = % of drop
  4. `lootmode` =
A special parameter used for separating conditional loot, such as Hard Mode loot. A lootmode of 0 will effectively disable a loot entry (it's roll will always fail). This column is a bitmask, so you shouldn't duplicate loot across lootmodes. The active lootmode(s) can be changed at any time by the core. This column should only be used if required, in most cases it should be left as 1. Valid lootmodes include: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 16384, 32768.
`groupid` = % Group
Like if one item has 50% and other 50%, and the group id is the same (1) the changes of drop will be 50% for each item, but if Groupid is 0 the loot will be in general change, more info: http://collab.kpsn.org/display/tc/loot_template#loot_template-groupid
`mincountOrRef` 
If > 0 = minimun of drop items, < 0, the entry of reference_loot_template
`maxcount` = Max count of drop item.

 
Original Post: http://community.pandashan.com/index.php?/topic/1921-how-fix-a-npc-loot/#entry17532

4 people like this

Share this post


Link to post
Share on other sites

I recommend adding the following to avoid conflicts

`creature_loot_template` WHERE `entry`= <entrynr>

Share this post


Link to post
Share on other sites

Atm i cannot edit it, but thx

Share this post


Link to post
Share on other sites

I would also add ' ' on the numbers as the core can be picky sometimes and not accept the query.

DELETE FROM `creature_loot_template` WHERE `entry`='84925';
INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES
('84925', '120945', '99', '1', '0', '1', '1'),
('84925', '119382', '40', '1', '0', '1', '1'),
('84925', '112791', '-5', '1', '0', '1', '1'),
('84925', '112891', '-4', '1', '0', '1', '1'),
('84925', '112893', '-3', '1', '0', '1', '1');
UPDATE `creature_template` SET `lootid`='84925' WHERE `entry`='84925';
 

 

2 people like this

Share this post


Link to post
Share on other sites

Keep in mind that for the WoD DB there's an extra `itembonuses` field.

Share this post


Link to post
Share on other sites

How can i do when the loot has to give a random item to the player among a list of items ?
According to the specialisation of the player ( Specified loots for a given spec ) ?

Edited by Abie

Share this post


Link to post
Share on other sites
41 minutes ago, Abie said:

How can i do when the loot has to give a random item to the player among a list of items ?
According to the specialisation of the player ( Specified loots for a given spec ) ?

talking about loot bonusses (warforged seals etc?)

Share this post


Link to post
Share on other sites
2 hours ago, Kilydan said:

talking about loot bonusses (warforged seals etc?)

Nop Burden of eternity

Share this post


Link to post
Share on other sites
8 minutes ago, Abie said:

talking about loot bonusses (warforged seals etc?)

Nop Burden of eternity

I'm on the way to fix it yet :o

Edited by Tweedy

Share this post


Link to post
Share on other sites
23 minutes ago, Abie said:

Nop Burden of eternity

 

9 minutes ago, Tweedy said:

I'm on the way to fix it yet :o

can totally live with both of these :P

Share this post


Link to post
Share on other sites
3 hours ago, Abie said:

How can i do when the loot has to give a random item to the player among a list of items ?
According to the specialisation of the player ( Specified loots for a given spec ) ?

For the moment it isnt possible to fix it with sql in firestorm. Its named "personal loot" if you want to search info about it in trinity or others places.

1 person likes this

Share this post


Link to post
Share on other sites
1 minute ago, Hypnos said:

For the moment it isnt possible to fix it with sql in firestorm. Its named "personal loot" if you want to search info about it in trinity or others places.

So it means we cant get and use Burden of Eternity now for a long time? :/

Share this post


Link to post
Share on other sites
Just now, Tweedy said:

So it means we cant get and use Burden of Eternity now for a long time? :/

they made the token thing kinda work in ToT first boss, i guess that code used for that just needs to be rewritten abit better + applied to all other released bosses out there with the correct currency cost. i remember it was a custom script when i asked for a fix long time ago but not sure about its functionality etc ofc :3

Share this post


Link to post
Share on other sites

Im adding one important thing which wasnt mentionated here, the DELETE. Its really important if you dont want to break the loot.

1- If you are going to add the full loot,so you want to delete the full loot first. Using 1 condition with the field `entry` it will be done. Then you have to add every item in the loot:

DELETE FROM `creature_loot_template` WHERE `entry`='84925';

2- If you want to delete only 1,2 or x items but not all so you have to use 2 conditions so you only will delete the speciffied items:

DELETE FROM `creature_loot_template` WHERE `entry`='84925' AND `item`=120945;

Exist 2 ways to delete x items in a loot but not all:

a) Using a different delete for every item deleted:

DELETE FROM `creature_loot_template` WHERE `entry`='84925' AND `item`=120945;

DELETE FROM `creature_loot_template` WHERE `entry`='84925' AND `item`=120933;

b) Using a same delete for the x items which you want to delete:

DELETE FROM `creature_loot_template` WHERE `entry`='84925' AND `item` IN (120945,120933);

 

 

Share this post


Link to post
Share on other sites

first, sorry to revive such an old post, but it just belongs here ...

1.When i want to fix the loot of a raid boss, who drops different things in 10m/25m//hc, how do I describe that?  //in this case:http://www.wowhead.com/npc=32867/steelbreaker#drops:mode=n10

2. I coulnd't find the itembonuses field anywhere. What does it do and what do I have to set it?

3. Just wondered about gold drop, do I define that as well in the DB? if yes, how do i change it?

 

Edited by Lordakius

Share this post


Link to post
Share on other sites

1. Maybe you should take a loot at spawnMask in creature table. Or difficulty_entry_x in creature_template table should show in what mode the creature is.

2. do not know that yet. Maybe you can give an example what bonuses you are thinking of to be modified.

3. Take a look at creature_template again - mingold and maxgold may be the fields you are looking for.

Edited by mariebu

Share this post


Link to post
Share on other sites

Alright, I'll take a look into the tables, thanks :)

on 2.: on the WoD expansion, there must be an 'itembonuses' field. I somehow have in mind that this defines the warforged thing, I am not sure on that, tho. Just wondering.

So far it seems that the field has just to be '' in the code. e.g.

DELETE FROM `creature_loot_template` WHERE `entry`='23863';
INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `maxcount`,`itembonuses`) VALUES
('23863', '52078', '0.88', '1', '1', ''),
('23863', '69581', '0.28', '1', '1', ''),
('23863', '69576', '0.21', '1', '1', ''),
('23863', '69582', '0.21', '1', '1', ''),
('23863', '69574', '0.21', '1', '1', ''),
('23863', '69575', '0.18', '1', '1', ''),
('23863', '69579', '0.15', '1', '1', ''),
('23863', '69578', '0.15', '1', '1', ''),
('23863', '69580', '0.15', '1', '1', ''),
('23863', '69583', '0.14', '1', '1', '');
UPDATE `creature_template` SET `lootid`='23863' WHERE `entry`='23863';

 

Share this post


Link to post
Share on other sites
On 22.8.2016 at 8:14 PM, Lordakius said:

Alright, I'll take a look into the tables, thanks :)

on 2.: on the WoD expansion, there must be an 'itembonuses' field. I somehow have in mind that this defines the warforged thing, I am not sure on that, tho. Just wondering.

So far it seems that the field has just to be '' in the code. e.g.


DELETE FROM `creature_loot_template` WHERE `entry`='23863';
INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `maxcount`,`itembonuses`) VALUES
('23863', '52078', '0.88', '1', '1', ''),
('23863', '69581', '0.28', '1', '1', ''),
('23863', '69576', '0.21', '1', '1', ''),
('23863', '69582', '0.21', '1', '1', ''),
('23863', '69574', '0.21', '1', '1', ''),
('23863', '69575', '0.18', '1', '1', ''),
('23863', '69579', '0.15', '1', '1', ''),
('23863', '69578', '0.15', '1', '1', ''),
('23863', '69580', '0.15', '1', '1', ''),
('23863', '69583', '0.14', '1', '1', '');
UPDATE `creature_template` SET `lootid`='23863' WHERE `entry`='23863';

 

Correct.

Share this post


Link to post
Share on other sites

Mikrole, do you know what values that field "itembonuses" may contain?

Share this post


Link to post
Share on other sites

what can I do with the difficulty_entry value? " This field connects the stats from another entry to this template when in 25man normal, 10man heroic or 25man heroic mode instance.  "

Let's say for Steelbreaker http://www.wowhead.com/npc=32867/steelbreaker

DELETE FROM `creature_loot_template` WHERE `entry`='32867';
INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `maxcount`,`difficulty_entry_2`, `itembonuses`) VALUES

What has to be in the field difficulty_entry_2 ? As I read it, there must be the entry ID of the NPC from heroic. Where would I find that one, tho?
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now