Working with loot templates

User avatar
Gnurg
Posts: 2420
Joined: 28 Jan 2013 19:38
Location: Oslo, Norway

Working with loot templates

#1 » Post by Gnurg » 18 Apr 2016 20:48

I took a look at Trinity Core's pages when I came across some loot issues yesterday and I thought that with some guidance I could try to contribute a bit to server. In short, I would like to know how you update loot tables and some answers to the two sections below (LootMode and GroupId).

Lets take http://www.truewow.org/bugs/view.php?id=3721 as an example.

The problem that I wish to solve is that the boss drops a few items he should not drop on the heroic dificulty. For instance Amani Venom-Axe should not drop from him on heroic.

Deletion:
Looking a bit up on trinity core's page I ended up with this:

Code: Select all

DELETE FROM creature_loot_template WHERE Entry=20521 AND Item=27424 AND LootMode=?;
20521 being the NPC ID and 27424 being the item ID.
The problem is with LootMode, which decides the difficulty. I did find out that its value could be 2^x, where x goes from 0 to 14, but I could not find out which value would corespond to say 5 heroic.

Update:
Also I read up on GroupId and from how I understod it, after deleting the 3 additional item I would need to update the chance for the gear items he drops, so that they together make up 100 % chance. Is that right? If so, he should drop 6 possible gear items and the chance should therefore be set to 100 / 6 --> 16.67?

Lets take this one as an example

Code: Select all

UPDATE creature_loot_template SET chance=16.67 WHERE Entry=20521 AND Item=28216;
OT: Why does the armory say 10 man and 25 man for the boss when it is a dungeon?
HAI
CAN HAZ STDIO?
VISIBLE "HAI WORLD, IZ GNURF!"
KTHXBYE

User avatar
Errorista
Issue Tracker Leader
Posts: 1898
Joined: 02 Sep 2012 14:31

Re: Working with loot templates

#2 » Post by Errorista » 18 Apr 2016 21:15

Gnurg wrote:OT: Why does the armory say 10 man and 25 man for the boss when it is a dungeon?
summoning
Nuko wrote:Nuko
to answer good question

User avatar
gecko32
Posts: 208
Joined: 05 Sep 2010 02:54

Re: Working with loot templates

#3 » Post by gecko32 » 18 Apr 2016 21:48

LootMode most of the time doesn't correspond with difficulty its a value that can be set by script default value will always be 1.
Difficulty is just the creature_template entry 20521 is the hc version of 17862.
GroupId just separates loot into separate rolls.
When it comes to chance if item all have the same chance to drop chance field is just set to a equal value 0 or 1 this way all entries in that groupid have equal chance.

So for this all you would need is
DELETE FROM creature_loot_template WHERE Entry=20521 AND Item=27424 AND LootMode=1;

User avatar
gecko32
Posts: 208
Joined: 05 Sep 2010 02:54

Re: Working with loot templates

#4 » Post by gecko32 » 18 Apr 2016 21:55

For the OT db does not differentiate npcs with different difficulty_entry's between dungeons and raids. Armoury would have to look up spawn location of the npc and then check if map id is dungeon or raid.

User avatar
Gnurg
Posts: 2420
Joined: 28 Jan 2013 19:38
Location: Oslo, Norway

Re: Working with loot templates

#5 » Post by Gnurg » 18 Apr 2016 22:14

gecko32 wrote:LootMode most of the time doesn't correspond with difficulty its a value that can be set by script default value will always be 1.
Difficulty is just the creature_template entry 20521 is the hc version of 17862.
GroupId just separates loot into separate rolls.
When it comes to chance if item all have the same chance to drop chance field is just set to a equal value 0 or 1 this way all entries in that groupid have equal chance.

So for this all you would need is
DELETE FROM creature_loot_template WHERE Entry=20521 AND Item=27424 AND LootMode=1;
Okay, thank you! :-)

For http://www.truewow.org/bugs/view.php?id=3720, I want the boss to drop 2 gear items instead of one. My plan to solve it would be to duplicate everything for the GroupId that had the gear to another GroupId, but I don't know which Groupid is being used. Is there any standard for this?

I assume it's GroupId = 1, so I duplicate it to GroupId 2.

Code: Select all

INSERT INTO creature_loot_template (Entry, Item, Refrence, Chance, QuestRequired, LootMode, GroupId, MinCount, MaxCount)
SELECT Entry, Item, Refrence, Chance, QuestRequired, LootMode, '2', MinCount, MaxCount
FROM creature_loot_template
WHERE Entry=17308 AND GroupId=1 AND LootMode=1;
HAI
CAN HAZ STDIO?
VISIBLE "HAI WORLD, IZ GNURF!"
KTHXBYE

User avatar
gecko32
Posts: 208
Joined: 05 Sep 2010 02:54

Re: Working with loot templates

#6 » Post by gecko32 » 18 Apr 2016 22:40

Items are in GroupId3, If you want to do that you should move the items to a reference_loot_template and set max count on the reference to 2.

User avatar
Gnurg
Posts: 2420
Joined: 28 Jan 2013 19:38
Location: Oslo, Norway

Re: Working with loot templates

#7 » Post by Gnurg » 18 Apr 2016 23:22

gecko32 wrote:Items are in GroupId3, If you want to do that you should move the items to a reference_loot_template and set max count on the reference to 2.
Like this or am I supposed to do something about the reference field?

Code: Select all

INSERT INTO referance_loot_template (Entry, Item, Reference, Chance, QuestRequired, LootMode, GroupId, MinCount, MaxCount)
SELECT Entry, Item, Reference, Chance, QuestRequired, LootMode, GroupId, MinCount, '2'
FROM creature_loot_template
WHERE Entry=17308 AND GroupId=3 AND LootMode=1;

// remove the ones we moved to the reference_loot_template
DELETE FROM creature_loot_template WHERE Entry=17308 AND GroupId=3 AND LootMode=1;
HAI
CAN HAZ STDIO?
VISIBLE "HAI WORLD, IZ GNURF!"
KTHXBYE

User avatar
gecko32
Posts: 208
Joined: 05 Sep 2010 02:54

Re: Working with loot templates

#8 » Post by gecko32 » 18 Apr 2016 23:32

Yes will need to create new reference thats not already taken like 43017 and put it in Item and Reference feilds.

Code: Select all

INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES 
(18433, 43017, 43017, 100, 0, 1, 3, 1, 2, NULL);

User avatar
Gnurg
Posts: 2420
Joined: 28 Jan 2013 19:38
Location: Oslo, Norway

Re: Working with loot templates

#9 » Post by Gnurg » 18 Apr 2016 23:55

gecko32 wrote:Yes will need to create new reference thats not already taken like 43017 and put it in Item and Reference feilds.

Code: Select all

INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES 
(18433, 43017, 43017, 100, 0, 1, 3, 1, 2, NULL);
The reference refers to the entry in the reference_loot_template? Sorry for being slow here and thank you for your patience! :-)
HAI
CAN HAZ STDIO?
VISIBLE "HAI WORLD, IZ GNURF!"
KTHXBYE

User avatar
gecko32
Posts: 208
Joined: 05 Sep 2010 02:54

Re: Working with loot templates

#10 » Post by gecko32 » 19 Apr 2016 00:09

correct.

User avatar
Gnurg
Posts: 2420
Joined: 28 Jan 2013 19:38
Location: Oslo, Norway

Re: Working with loot templates

#11 » Post by Gnurg » 19 Apr 2016 00:24

gecko32 wrote:correct.
Did I do it right now? (It should be 10 more items). There's no way for me to know what references that are free?

Code: Select all


DELETE FROM creature_loot_template WHERE Entry=18433 AND GroupId=3 AND LootMode=1;

INSERT INTO referance_loot_template (Entry, Item, Reference, Chance, QuestRequired, LootMode, GroupId, MinCount, MaxCount) VALUES
(XXXXX, 27462, 0, 100, 0, 1, 3, 1, 2),
(YYYYY, 27463, 0, 100, 0, 1, 3, 1, 2);

INSERT INTO creature_loot_template (Entry, Item, Reference, Chance, QuestRequired, LootMode, GroupId, MinCount, MaxCount) VALUES
(18433, XXXXX, XXXXX, 100, 0, 1, 3, 1, 1),
(18433, YYYYY, YYYYY, 100, 0, 1, 3, 1, 1);
The 'you add between words', are they required?
HAI
CAN HAZ STDIO?
VISIBLE "HAI WORLD, IZ GNURF!"
KTHXBYE

User avatar
gecko32
Posts: 208
Joined: 05 Sep 2010 02:54

Re: Working with loot templates

#12 » Post by gecko32 » 19 Apr 2016 00:48

To find free reference you would need to download tc db.

Code: Select all


DELETE FROM creature_loot_template WHERE Entry=18433 AND GroupId=3 AND LootMode=1;
DELETE FROM reference_loot_template WHERE Entry=XXXXX;

INSERT INTO reference_loot_template (Entry, Item, Reference, Chance, QuestRequired, LootMode, GroupId, MinCount, MaxCount) VALUES
(XXXXX, 27462, 0, 0, 0, 1, 3, 1, 1),
(XXXXX, 27463, 0, 0, 0, 1, 3, 1, 1);

INSERT INTO creature_loot_template (Entry, Item, Reference, Chance, QuestRequired, LootMode, GroupId, MinCount, MaxCount) VALUES
(18433, XXXXX, XXXXX, 100, 0, 1, 3, 1, 2);
You can use max count here since chance for reference is 100% so max count will call the reference twice. if it was less than 100% you would need to call the reference twice.

The `` are not required but the formating looks better to me.

User avatar
Nuko
Former Staff
Posts: 540
Joined: 27 Aug 2010 21:47
Location: United Kingdom

Re: Working with loot templates

#13 » Post by Nuko » 19 Apr 2016 04:18

If it's saying 10 and 25 man on a dungeon it's most likely mistaking the Normal and HC modes for 10 and 25 man due to a lack of data (it defaults to 10N 25N 10HC 25HC)

Cheers.
Nuko - In the event of malfunction, please insert tea.
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

User avatar
Gnurg
Posts: 2420
Joined: 28 Jan 2013 19:38
Location: Oslo, Norway

Re: Working with loot templates

#14 » Post by Gnurg » 19 Apr 2016 08:42

gecko32 wrote:To find free reference you would need to download tc db.

Code: Select all


DELETE FROM creature_loot_template WHERE Entry=18433 AND GroupId=3 AND LootMode=1;
DELETE FROM reference_loot_template WHERE Entry=XXXXX;

INSERT INTO reference_loot_template (Entry, Item, Reference, Chance, QuestRequired, LootMode, GroupId, MinCount, MaxCount) VALUES
(XXXXX, 27462, 0, 0, 0, 1, 3, 1, 1),
(XXXXX, 27463, 0, 0, 0, 1, 3, 1, 1);

INSERT INTO creature_loot_template (Entry, Item, Reference, Chance, QuestRequired, LootMode, GroupId, MinCount, MaxCount) VALUES
(18433, XXXXX, XXXXX, 100, 0, 1, 3, 1, 2);
You can use max count here since chance for reference is 100% so max count will call the reference twice. if it was less than 100% you would need to call the reference twice.

The `` are not required but the formating looks better to me.
Thank you so much! ^_^

One last thing, is the GroupId always 3 for the gear loot, or does it vary for each boss?
HAI
CAN HAZ STDIO?
VISIBLE "HAI WORLD, IZ GNURF!"
KTHXBYE

User avatar
gecko32
Posts: 208
Joined: 05 Sep 2010 02:54

Re: Working with loot templates

#15 » Post by gecko32 » 19 Apr 2016 14:25

varies depending on how the person who wrote it split it up.

Locked

Who is online

Users browsing this forum: No registered users and 3 guests