Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB/Item: Sealed Tome (Karazhan) needs functionality added #16049

Open
ghost opened this issue Dec 17, 2015 · 17 comments
Open

DB/Item: Sealed Tome (Karazhan) needs functionality added #16049

ghost opened this issue Dec 17, 2015 · 17 comments

Comments

@ghost
Copy link

ghost commented Dec 17, 2015

Core Rev: 80ed03a
DB: TDB 335.59

Currently, Sealed Tomb just has a loot_template meaning you can loot multiple books from the same tome. On live, you should only be able to get 1 book per tome. (fix has been applied)

Suggested fix.

DELETE FROM `gameobject_loot_template` WHERE `Entry`=18509;
INSERT INTO `gameobject_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES 
(18509,1054,1054,100,0,1,1,1,1,NULL);

DELETE FROM `reference_loot_template` WHERE `Entry`=1054;
INSERT INTO `reference_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES 
(1054,23864,0,0,0,1,1,1,1,NULL), -- Torment of the Worgen
(1054,23857,0,0,0,1,1,1,1,NULL), -- Legacy of the Mountain King
(1054,23862,0,0,0,1,1,1,1,NULL), -- Redemption of the Fallen
(1054,23865,0,0,0,1,1,1,1, NULL); -- Wrath of the Titans

Additionally, there should be a chance to receive a debuff instead of a book.

Looting the object has one of two results:

  1. Places one of four books in your inventory, which, when used, grant certain buffs for 60 minutes. The books disappear when you leave Karazhan (and you of course lose the buff when you die).
  2. Inflicts one of five debuffs.
    Source: WoW Wiki

Debuffs:

http://www.wowhead.com/spell=30762/curse-of-the-tampered-tome
http://www.wowhead.com/spell=30763/curse-of-the-tampered-tome
http://www.wowhead.com/spell=30764/curse-of-the-tampered-tome
http://www.wowhead.com/spell=30765/curse-of-the-tampered-tome
http://www.wowhead.com/spell=30766/curse-of-the-tampered-tome

@offl
Copy link
Contributor

offl commented Dec 17, 2015

DELETE FROM `gameobject_loot_template` WHERE `Entry`=18509;
INSERT INTO `gameobject_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES
(18509,23857,0,0,0,1,1,1,1,'Legacy of the Mountain King'),
(18509,23862,0,0,0,1,1,1,1,'Redemption of the Fallen'),
(18509,23864,0,0,0,1,1,1,1,'Torment of the Worgen'),
(18509,23865,0,0,0,1,1,1,1,'Wrath of the Titans');

This can simplify your code.

@ghost ghost changed the title Sealed Tome (Karazhan) needs functionality added. [3.3.5] Sealed Tome (Karazhan) needs functionality added. Dec 17, 2015
@ghost
Copy link
Author

ghost commented Dec 18, 2015

Every other reference loot comment was left as Null, so I did the same.

Buffs from the tomes also are able to be kept outside of Karazhan. Adding the following to SpellMgr.cpp seems to resolve that issue.

            case 30557:     // Wrath of the Titans (only usable in Karazhan)
            case 30550:     // Redemption of the Fallen (only usable in Karazhan)
            case 30567:     // Torment of the Worgen (only usable in Karazhan)
            case 30562:     // Legacy of the Mountain King (only usable in Karazhan)
                spellInfo->AreaGroupId = 46;

Found on: https://searchcode.com/codesearch/view/64634945/ starting on line 4464.

@Rushor
Copy link
Contributor

Rushor commented Dec 18, 2015

the buffrestriction can be solved with conditions in the database

@Rushor Rushor changed the title [3.3.5] Sealed Tome (Karazhan) needs functionality added. [3.3.5][6.x] DB/Item: Sealed Tome (Karazhan) needs functionality added. Feb 11, 2016
@Rushor Rushor self-assigned this Feb 11, 2016
Rushor added a commit that referenced this issue Feb 11, 2016
* updates #16049
* by #Saben65
@Rushor
Copy link
Contributor

Rushor commented Feb 11, 2016

Every other reference loot comment was left as Null, so I did the same.

Buffs from the tomes also are able to be kept outside of Karazhan. Adding the following to SpellMgr.cpp seems to resolve that issue.

this need to be fixed

Additionally, there should be a chance to receive a debuff instead of a book.

this needs to be fixed

if these things are fixed, we can close this issue

@ghost
Copy link
Author

ghost commented Feb 11, 2016

So with your conditions, the buff can only be applied in kara, but it stays when you leave the zone?

@Rushor
Copy link
Contributor

Rushor commented Feb 11, 2016

yep

@ghost
Copy link
Author

ghost commented Feb 11, 2016

This should fix that.

DELETE FROM `spell_area` WHERE `spell` IN (30562,30557,30550,30567);
INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`, `quest_end_status`) VALUES 
(30562, 3457, 0, 0, 0, 0, 2, 0, 0, 0), -- Legacy of the Mountain King
(30557, 3457, 0, 0, 0, 0, 2, 0, 0, 0), -- Wrath of the Titans
(30550, 3457, 0, 0, 0, 0, 2, 0, 0, 0), -- Redemption of the Fallen
(30567, 3457, 0, 0, 0, 0, 2, 0, 0, 0); -- Torment of the Worgen

@Rushor
Copy link
Contributor

Rushor commented Feb 11, 2016

no we only need the fix for the debuff, can be done by sai for gameobject (gameobject loot state changed/gossip hello - cast spell)

Shauren pushed a commit that referenced this issue Apr 5, 2016
* updates #16049
* by #Saben65

(cherry picked from commit 5059e5f)
@offl
Copy link
Contributor

offl commented Nov 16, 2017

Please test:

UPDATE `gameobject_template` SET `AIName`="SmartGameObjectAI" WHERE `entry` IN (181768,181845,181846,181847,181848);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (181768,181845,181846,181847,181848) AND `source_type`=1;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (18176800,18176801,18176802,18176803,18176804) AND `source_type`=9;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(181768,1,0,0,70,0,100,1,2,0,0,0,87,18176800,18176801,18176802,18176803,18176804,0,1,0,0,0,0,0,0,0,"Sealed Tome - On State Changed - Run Random Script"),
(181845,1,0,0,70,0,100,1,2,0,0,0,87,18176800,18176801,18176802,18176803,18176804,0,1,0,0,0,0,0,0,0,"Sealed Tome - On State Changed - Run Random Script"),
(181846,1,0,0,70,0,100,1,2,0,0,0,87,18176800,18176801,18176802,18176803,18176804,0,1,0,0,0,0,0,0,0,"Sealed Tome - On State Changed - Run Random Script"),
(181847,1,0,0,70,0,100,1,2,0,0,0,87,18176800,18176801,18176802,18176803,18176804,0,1,0,0,0,0,0,0,0,"Sealed Tome - On State Changed - Run Random Script"),
(181848,1,0,0,70,0,100,1,2,0,0,0,87,18176800,18176801,18176802,18176803,18176804,0,1,0,0,0,0,0,0,0,"Sealed Tome - On State Changed - Run Random Script"),
(18176800,9,0,0,0,0,100,1,0,0,0,0,85,30762,0,0,0,0,0,7,0,0,0,0,0,0,0,"Sealed Tome - On Script - Invoker Cast 'Curse of the Tampered Tome'"),
(18176801,9,0,0,0,0,100,1,0,0,0,0,85,30763,0,0,0,0,0,7,0,0,0,0,0,0,0,"Sealed Tome - On Script - Invoker Cast 'Curse of the Tampered Tome'"),
(18176802,9,0,0,0,0,100,1,0,0,0,0,85,30764,0,0,0,0,0,7,0,0,0,0,0,0,0,"Sealed Tome - On Script - Invoker Cast 'Curse of the Tampered Tome'"),
(18176803,9,0,0,0,0,100,1,0,0,0,0,85,30765,0,0,0,0,0,7,0,0,0,0,0,0,0,"Sealed Tome - On Script - Invoker Cast 'Curse of the Tampered Tome'"),
(18176804,9,0,0,0,0,100,1,0,0,0,0,85,30766,0,0,0,0,0,7,0,0,0,0,0,0,0,"Sealed Tome - On Script - Invoker Cast 'Curse of the Tampered Tome'");

@offl offl unassigned Rushor Nov 16, 2017
@Killyana
Copy link
Member

Look at: SELECT * FROM gameobject_template WHERE NAME="Sealed Tome";
There's 2 type of gobs:

  • 181847, 181845, 181846, 181848, 181768: gobs with loot
  • 181833, 181837, 181839, 181841, 181843: gobs with traps
    Linked traps: 181831,181838,181840,181842,181844

So there's some tomes with loots and others with traps, I don't know if there's a pool that must be done or how this is handled on retail, but gobs with loot doesn't cast any spell.

@Killyana
Copy link
Member

Confirmed here: https://wow.gamepedia.com/Sealed_Tome

@offl
Copy link
Contributor

offl commented Nov 16, 2017

According to current spawns seems there's spawned two types of objects: with loot and with linked traps.
So we should add the missing linked traps(181831,181838,181840,181842,181844) and pools for all objects.

But maybe all current objects aren't from sniffs, then my theory breaks.

@Killyana
Copy link
Member

Traps are not spawns they are summoned with the linked gob and despawns with it.
For the pool we mut get a sniff to see if this spawns are random (require a pool) or not

@offl
Copy link
Contributor

offl commented Nov 16, 2017

Traps present in the DB(gameobject_template)?

@offl
Copy link
Contributor

offl commented Nov 16, 2017

It will be hard.
1
And my script above was incorrect, there must be a small chance to receive a debuff, not always.

@ghost
Copy link
Author

ghost commented Nov 16, 2017

@Killyana Here is what I got from the only sniff of kara I got (Legion).

SET @OGUID := XXXXXXX;

DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+42;
INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `PhaseGroup`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES
-- Books with traps
(@OGUID+1, 181833, 532, 3457, 3457, 3, 1, 0, -11236.73, -1685.022, 210.8793, 1.308995, 0, 0, 0.6087608, 0.7933538, 7200, 255, 1, 24461), -- 181833 (Area: 3457 - Difficulty: 3)
(@OGUID+2, 181839, 532, 3457, 3457, 3, 1, 0, -11139.06, -1795.755, 136.0235, 5.166176, 0, 0, -0.5299187, 0.8480484, 7200, 255, 1, 24461), -- 181839 (Area: 3457 - Difficulty: 3)
(@OGUID+3, 181839, 532, 3457, 3457, 3, 1, 0, -11160.39, -1795.184, 135.9977, 1.308995, 0, 0, 0.6087608, 0.7933538, 7200, 255, 1, 24461), -- 181839 (Area: 3457 - Difficulty: 3)
(@OGUID+4, 181839, 532, 3457, 3457, 3, 1, 0, -11284.08, -1719.893, 136.0301, 1.361356, 0, 0, 0.6293201, 0.7771462, 7200, 255, 1, 24461), -- 181839 (Area: 3457 - Difficulty: 3)
(@OGUID+5, 181841, 532, 3457, 3457, 3, 1, 0, -11150.12, -1787.431, 136.007, 3.316144, 0, 0, -0.9961939, 0.08716504, 7200, 255, 1, 24461), -- 181841 (Area: 3457 - Difficulty: 3)
-- Books with buffs
(@OGUID+6, 181847, 532, 3457, 3457, 3, 1, 0, -11198.71, -1866.768, 204.79, 6.143561, 0, 0, -0.06975555, 0.9975641, 7200, 255, 1, 24461), -- 181847 (Area: 3457 - Difficulty: 3)
(@OGUID+7, 181847, 532, 3457, 3457, 3, 1, 0, -11168.31, -1772, 251.1702, 1.291542, 0, 0, 0.6018143, 0.7986361, 7200, 255, 1, 24461), -- 181847 (Area: 3457 - Difficulty: 3)
(@OGUID+8, 181847, 532, 3457, 3457, 3, 1, 0, -11296.71, -1804.073, 179.7341, 4.834563, 0, 0, -0.6626196, 0.7489561, 7200, 255, 1, 24461), -- 181847 (Area: 3457 - Difficulty: 3)
(@OGUID+9, 181845, 532, 3457, 3457, 3, 1, 0, -11201.41, -1870.267, 204.79, 0.802851, 0, 0, 0.3907309, 0.920505, 7200, 255, 1, 24461), -- 181845 (Area: 3457 - Difficulty: 3)
(@OGUID+10, 181846, 532, 3457, 3457, 3, 1, 0, -11172.96, -1846.562, 136.0235, 2.129301, 0, 0, 0.8746195, 0.4848101, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+11, 181846, 532, 3457, 3457, 3, 1, 0, -11170.47, -1847.279, 136.0235, 4.380776, 0, 0, -0.8141155, 0.580703, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+12, 181846, 532, 3457, 3457, 3, 1, 0, -11183.81, -1855.468, 152.0577, 6.19592, 0, 0, -0.04361916, 0.9990482, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+13, 181846, 532, 3457, 3457, 3, 1, 0, -11200.78, -1867.752, 204.79, 2.146753, 0, 0, 0.8788166, 0.4771597, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+14, 181846, 532, 3457, 3457, 3, 1, 0, -11141.29, -1791.542, 136.0235, 5.323256, 0, 0, -0.4617481, 0.8870111, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+16, 181846, 532, 3457, 3457, 3, 1, 0, -11207.11, -1780.463, 136.0235, 3.438303, 0, 0, -0.9890156, 0.1478114, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+17, 181846, 532, 3457, 3457, 3, 1, 0, -11137.63, -1824.48, 238.1669, 6.265733, 0, 0, -0.00872612, 0.9999619, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+18, 181846, 532, 3457, 3457, 3, 1, 0, -11117.17, -1818.964, 238.2509, 0.9250238, 0, 0, 0.4461975, 0.8949345, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+19, 181846, 532, 3457, 3457, 3, 1, 0, -11192.76, -1746.3, 136.0235, 3.490667, 0, 0, -0.984807, 0.1736523, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+20, 181846, 532, 3457, 3457, 3, 1, 0, -11188.71, -1730.857, 136.0235, 2.687807, 0, 0, 0.97437, 0.2249513, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+21, 181846, 532, 3457, 3457, 3, 1, 0, -11219.89, -1735.851, 136.0235, 2.303831, 0, 0, 0.9135447, 0.4067384, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+22, 181846, 532, 3457, 3457, 3, 1, 0, -11221.53, -1727.618, 136.0235, 1.692969, 0, 0, 0.7489557, 0.6626201, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+23, 181846, 532, 3457, 3457, 3, 1, 0, -11282.58, -1725.646, 136.0305, 2.234018, 0, 0, 0.8987932, 0.4383728, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+24, 181846, 532, 3457, 3457, 3, 1, 0, -11342.28, -1914.924, 240.5305, 4.01426, 0, 0, -0.9063072, 0.4226195, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+25, 181846, 532, 3457, 3457, 3, 1, 0, -11359.13, -1768.298, 179.7341, 5.340709, 0, 0, -0.45399, 0.8910068, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+26, 181846, 532, 3457, 3457, 3, 1, 0, -11220.49, -1689.724, 240.9794, 3.159062, 0, 0, -0.9999619, 0.008734641, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+27, 181846, 532, 3457, 3457, 3, 1, 0, -11246.57, -1694.679, 290.348, 0.7155849, 0, 0, 0.3502073, 0.9366722, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+28, 181846, 532, 3457, 3457, 3, 1, 0, -11365.6, -1774.001, 265.1646, 4.991644, 0, 0, -0.6018143, 0.7986361, 7200, 255, 1, 24461), -- 181846 (Area: 3457 - Difficulty: 3)
(@OGUID+29, 181848, 532, 3457, 3457, 3, 1, 0, -11159.47, -1911.102, 232.0086, 2.600535, 0, 0, 0.9636297, 0.267241, 7200, 255, 1, 24461), -- 181848 (Area: 3457 - Difficulty: 3)
(@OGUID+30, 181848, 532, 3457, 3457, 3, 1, 0, -11193.12, -1873.443, 204.8103, 6.161013, 0, 0, -0.06104851, 0.9981348, 7200, 255, 1, 24461), -- 181848 (Area: 3457 - Difficulty: 3)
(@OGUID+31, 181848, 532, 3457, 3457, 3, 1, 0, -11234.86, -1841.9, 136.0235, 6.073746, 0, 0, -0.1045284, 0.9945219, 7200, 255, 1, 24461), -- 181848 (Area: 3457 - Difficulty: 3)
(@OGUID+32, 181848, 532, 3457, 3457, 3, 1, 0, -11270.77, -1847.722, 135.7204, 0.6806767, 0, 0, 0.333806, 0.9426418, 7200, 255, 1, 24461), -- 181848 (Area: 3457 - Difficulty: 3)
(@OGUID+33, 181848, 532, 3457, 3457, 3, 1, 0, -11283.39, -1943.98, 240.4696, 0.6283169, 0, 0, 0.3090162, 0.9510568, 7200, 255, 1, 24461), -- 181848 (Area: 3457 - Difficulty: 3)
(@OGUID+34, 181848, 532, 3457, 3457, 3, 1, 0, -11232.35, -1821.818, 223.9436, 4.956738, 0, 0, -0.6156607, 0.7880114, 7200, 255, 1, 24461), -- 181848 (Area: 3457 - Difficulty: 3)
(@OGUID+35, 181848, 532, 3457, 3457, 3, 1, 0, -11226.26, -1697, 210.8793, 1.937312, 0, 0, 0.8241253, 0.5664076, 7200, 255, 1, 24461), -- 181848 (Area: 3457 - Difficulty: 3)
(@OGUID+36, 181848, 532, 3457, 3457, 3, 1, 0, -11245.07, -1697.589, 290.348, 3.019413, 0, 0, 0.9981346, 0.06105176, 7200, 255, 1, 24461), -- 181848 (Area: 3457 - Difficulty: 3)
(@OGUID+37, 181768, 532, 3457, 3457, 3, 1, 0, -11176.23, -1836.639, 136.0235, 1.588249, 0, 0, 0.7132502, 0.7009096, 7200, 255, 1, 24461), -- 181768 (Area: 3457 - Difficulty: 3)
(@OGUID+38, 181768, 532, 3457, 3457, 3, 1, 0, -11195.8, -1875.327, 204.8016, 2.687807, 0, 0, 0.97437, 0.2249513, 7200, 255, 1, 24461), -- 181768 (Area: 3457 - Difficulty: 3)
(@OGUID+39, 181768, 532, 3457, 3457, 3, 1, 0, -11162.83, -1796.187, 135.9956, 1.221729, 0, 0, 0.573576, 0.8191524, 7200, 255, 1, 24461), -- 181768 (Area: 3457 - Difficulty: 3)
(@OGUID+40, 181768, 532, 3457, 3457, 3, 1, 0, -11200.13, -1784.386, 136.0128, 0.6806767, 0, 0, 0.333806, 0.9426418, 7200, 255, 1, 24461), -- 181768 (Area: 3457 - Difficulty: 3)
(@OGUID+41, 181768, 532, 3457, 3457, 3, 1, 0, -11164.81, -1762.662, 201.2873, 2.705255, 0, 0, 0.9762955, 0.2164421, 7200, 255, 1, 24461), -- 181768 (Area: 3457 - Difficulty: 3)
(@OGUID+42, 181768, 532, 3457, 3457, 3, 1, 0, -11406.01, -1816.614, 260.8701, 5.515242, 0, 0, -0.3746061, 0.927184, 7200, 255, 1, 24461); -- 181768 (Area: 3457 - Difficulty: 3)

@Killyana
Copy link
Member

So there's always 5 gobs with traps and 41- 42 gobs with loot, but positions are random.

@ghost ghost changed the title [3.3.5][6.x] DB/Item: Sealed Tome (Karazhan) needs functionality added. DB/Item: Sealed Tome (Karazhan) needs functionality added Nov 17, 2017
Aokromes pushed a commit to Aokromes/TrinityCore that referenced this issue Jan 1, 2018
funjoker pushed a commit that referenced this issue Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants