diff options
12 files changed, 157 insertions, 15 deletions
diff --git a/sql/updates/world/2012_05_12_00_world_gameobject_template.sql b/sql/updates/world/2012_05_12_00_world_gameobject_template.sql new file mode 100644 index 00000000000..ffa932c8640 --- /dev/null +++ b/sql/updates/world/2012_05_12_00_world_gameobject_template.sql @@ -0,0 +1,2 @@ +-- Lock Halls of Reflection Portcullis +UPDATE `gameobject_template` SET `flags`=18 WHERE `entry`=201848; diff --git a/sql/updates/world/2012_05_12_01_world_item_loot_template.sql b/sql/updates/world/2012_05_12_01_world_item_loot_template.sql new file mode 100644 index 00000000000..052b749c48c --- /dev/null +++ b/sql/updates/world/2012_05_12_01_world_item_loot_template.sql @@ -0,0 +1,92 @@ +DELETE FROM `item_loot_template` WHERE `entry` BETWEEN 51999 AND 52005; +INSERT INTO `item_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Satchel of Helpfull Goods (level 0-25) +(51999,51964,0,1,1,1,1), -- Vigorous Belt +(51999,51968,0,1,1,1,1), -- Enumerated Wrap +(51999,51978,0,1,1,1,1), -- Earthbound Girdle +(51999,51994,25,1,1,1,1), -- Tumultuous Cloak +-- Satchel of Helpfull Goods (level 26-35) +(52000,51965,0,1,1,1,1), -- Vigorous Handguards +(52000,51973,0,1,1,1,1), -- Enumerated Handwraps +(52000,51980,0,1,1,1,1), -- Earthbound Handgrips +(52000,51996,25,1,1,1,1), -- Tumultuous Necklace +-- Satchel of Helpfull Goods (level 36-45) +(52001,51966,0,1,1,1,1), -- Vigorous Spaulders +(52001,51974,0,1,1,1,1), -- Enumerated Shoulderpads +(52001,51976,0,1,1,1,1), -- Earthbound Shoulderguards +(52001,51984,0,1,1,1,1), -- Stalwart Shoulderpads +(52001,51992,25,1,1,1,1), -- Tumultuous Ring +-- Satchel of Helpfull Goods (level 46-55) +(52002,51962,0,1,1,1,1), -- Vigorous Bracers +(52002,51963,0,1,1,1,1), -- Vigorous Stompers +(52002,51967,0,1,1,1,1), -- Enumerated Sandals +(52002,51972,0,1,1,1,1), -- Enumerated Bracers +(52002,51981,0,1,1,1,1), -- Earthbound Wristguards +(52002,51982,0,1,1,1,1), -- Earthbound Boots +(52002,51989,0,1,1,1,1), -- Stalwart Bands +(52002,51990,0,1,1,1,1), -- Stalwart Treads +-- Satchel of Helpfull Goods (level 56-60) +(52003,51959,0,1,1,1,1), -- Vigorous Belt +(52003,51971,0,1,1,1,1), -- Enumerated Belt +(52003,51977,0,1,1,1,1), -- Earthbound Girdle +(52003,51985,0,1,1,1,1), -- Stalwart Belt +(52003,51993,25,1,1,1,1), -- Turbulent Cloak +-- Satchel of Helpfull Goods (level 61-64) +(52004,51960,0,1,1,1,1), -- Vigorous Gloves +(52004,51970,0,1,1,1,1), -- Enumerated Gloves +(52004,51979,0,1,1,1,1), -- Earthbound Grips +(52004,51987,0,1,1,1,1), -- Stalwart Grips +(52004,51995,25,1,1,1,1), -- Turbulent Necklace +-- Satchel of Helpfull Goods (level 65-70) +(52005,51961,0,1,1,1,1), -- Vigorous Shoulderguards +(52005,51969,0,1,1,1,1), -- Enumerated Shoulders +(52005,51975,0,1,1,1,1), -- Earthbound Shoulders +(52005,51983,0,1,1,1,1), -- Stalwart Shoulderguards +(52005,51991,25,1,0,1,1); -- Turbulent Signet +-- ------------------------------------------------------------------- +-- Set some Parameters +-- ------------------------------------------------------------------- +SET @Cloth := 400; -- Class Bitmask: 16 (Priest) +128 (Mage) +256 (Warlock) +SET @Leather1 := 1100; -- Class Bitmask: 4 (Hunter) +8 (Rogue) +64 (Shaman) +1024 (Druid) +SET @Leather2 := 1032; -- Class Bitmask: 8 (Rogue) +1024 (Druid) +SET @Mail1 := 3; -- Class Bitmask: 1 (Warrior) +2 (Paladin) +SET @Mail2 := 68; -- Class Bitmask: 4 (Hunter) +8 (Shaman) +SET @Plate := 35; -- Class Bitmask: 1 (Warrior) +2 (Paladin) +32 (DeathKnight) +-- Add conditions to make sure everyone gets beneficial loot for their class +-- ------------------------------------------------------------------- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=5 AND `SourceGroup` BETWEEN 51999 AND 52005 ; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +-- Cloth Items +(5,51999,51968,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Wrap only for clothusers'), +(5,52000,51973,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Handwraps only for clothusers'), +(5,52001,51974,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Shoulderpads only for clothusers'), +(5,52002,51967,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Sandals only for clothusers'), +(5,52002,51972,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Bracers only for clothusers'), +(5,52003,51971,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Belt only for clothusers'), +(5,52004,51970,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Gloves only for clothusers'), +(5,52005,51969,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Shoulders only for clothusers'), +-- Leather Items +(5,51999,51964,0,0,15,0,@Leather1,0,0,0,0,'','SOHG: Vigorous Belt only for leatherusers'), +(5,52000,51965,0,0,15,0,@Leather1,0,0,0,0,'','SOHG: Vigorous Handguards only for leatherusers'), +(5,52001,51966,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Spaulders only for leatherusers'), +(5,52002,51962,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Bracers only for leatherusers'), +(5,52002,51963,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Stompers only for leatherusers'), +(5,52003,51959,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Belt only for leatherusers'), +(5,52004,51960,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Gloves only for leatherusers'), +(5,52005,51961,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Shoulderguards only for leatherusers'), +-- Mail Items +(5,51999,51978,0,0,15,0,@Mail1,0,0,0,0,'','SOHG: Earthbound Girdle only for mail users'), +(5,52000,51980,0,0,15,0,@Mail1,0,0,0,0,'','SOHG: Earthbound Handgrips only for mail users'), +(5,52001,51976,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Shoulderguards only for mail users'), +(5,52002,51982,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Boots only for mail users'), +(5,52002,51981,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Wristguards only for mail users'), +(5,52003,51977,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Girdle only for mail users'), +(5,52004,51979,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Grips only for mail users'), +(5,52005,51975,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Shoulders only for mail users'), +-- Plate Items +(5,52001,51984,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Shoulderpads only for plate users'), +(5,52002,51989,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Bands only for plate users'), +(5,52002,51990,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Treads only for plate users'), +(5,52003,51985,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Belt only for plate users'), +(5,52004,51987,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Grips only for plate users'), +(5,52005,51983,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Shoulderguards only for plate users'); diff --git a/sql/updates/world/2012_05_12_02_world_gameobject_loot_template.sql b/sql/updates/world/2012_05_12_02_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..b1f445faa59 --- /dev/null +++ b/sql/updates/world/2012_05_12_02_world_gameobject_loot_template.sql @@ -0,0 +1,37 @@ +-- Add Reference Loots +SET @RefNormal := 35091; +SET @RefHeroic := 35092; +DELETE FROM `reference_loot_template` WHERE `entry` IN (@RefNormal,@RefHeroic); +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Normal Loot +(@RefNormal,49839,0,1,1,1,1), -- Mourning Malice +(@RefNormal,49840,0,1,1,1,1), -- Hate-Forged Cleaver +(@RefNormal,49841,0,1,1,1,1), -- Blackened Geist Ribs +(@RefNormal,49842,0,1,1,1,1), -- Tapestry of the Frozen Throne +(@RefNormal,49843,0,1,1,1,1), -- Crystalline Citadel Gauntlets +(@RefNormal,49844,0,1,1,1,1), -- Crypt Fiend Slayer +(@RefNormal,49845,0,1,1,1,1), -- Bone Golem Scapula +(@RefNormal,49846,0,1,1,1,1), -- Chilled Heart of the Glacier +(@RefNormal,49847,0,1,1,1,1), -- Legguards of Untimely Demise +(@RefNormal,49848,0,1,1,1,1), -- Grim Lasher Shoulderguards +(@RefNormal,49849,0,1,1,1,1), -- Tattered Glacial-Woven Hood +(@RefNormal,49851,0,1,1,1,1), -- Greathelm of the Silver Hand +-- Heroic Loot +(@RefHeroic,50303,0,1,1,1,1), -- Black Icicle +(@RefHeroic,50302,0,1,1,1,1), -- Liar's Tongue +(@RefHeroic,50311,0,1,1,1,1), -- Second Helm of the Executioner +(@RefHeroic,50312,0,1,1,1,1), -- Chestguard of Broken Branches +(@RefHeroic,50310,0,1,1,1,1), -- Fossilized Ammonite Choker +(@RefHeroic,50313,0,1,1,1,1), -- Oath of Empress Zoe +(@RefHeroic,50309,0,1,1,1,1), -- Shriveled Heart +(@RefHeroic,50314,0,1,1,1,1), -- Strip of Remorse +(@RefHeroic,50308,0,1,1,1,1), -- Blighted Leather Footpads +(@RefHeroic,50305,0,1,1,1,1), -- Grinning Skull Boots +(@RefHeroic,50306,0,1,1,1,1), -- The Lady's Promise +(@RefHeroic,50304,0,1,1,1,1); -- Hoarfrost Gauntlets +-- Assign to the chest +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (27985,27993); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(27985,1,100,1,0,-@RefNormal,2), -- Two from Normal Reference Loot +(27993,1,100,1,0,-@RefHeroic,2), -- Two from Heroic Reference Loot +(27993,43102,85,1,0,1,1); -- Frozen Orb diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index e604eaf9024..104d2d3d52b 100755 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -535,6 +535,10 @@ void ThreatManager::processThreatEvent(ThreatRefStatusChangeEvent* threatRefStat setCurrentVictim(NULL); setDirty(true); } + if (getOwner() && getOwner()->IsInWorld()) + if (Unit* target = ObjectAccessor::GetUnit(*getOwner(), hostilRef->getUnitGuid())) + if (getOwner()->IsInMap(target)) + getOwner()->SendRemoveFromThreatListOpcode(hostilRef); iThreatContainer.remove(hostilRef); iThreatOfflineContainer.addReference(hostilRef); } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index acdf2b16f2a..d120713636d 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -468,9 +468,9 @@ void Creature::Update(uint32 diff) switch (m_deathState) { - case JUST_ALIVED: - // Must not be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting. - sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_ALIVED (4)", GetGUIDLow(), GetEntry()); + case JUST_RESPAWNED: + // Must not be called, see Creature::setDeathState JUST_RESPAWNED -> ALIVE promoting. + sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_RESPAWNED (4)", GetGUIDLow(), GetEntry()); break; case JUST_DIED: // Must not be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting. @@ -1555,7 +1555,7 @@ void Creature::setDeathState(DeathState s) Unit::setDeathState(CORPSE); } - else if (s == JUST_ALIVED) + else if (s == JUST_RESPAWNED) { //if (isPet()) // setActive(true); @@ -1611,7 +1611,7 @@ void Creature::Respawn(bool force) CreatureTemplate const* cinfo = GetCreatureTemplate(); SelectLevel(cinfo); - setDeathState(JUST_ALIVED); + setDeathState(JUST_RESPAWNED); uint32 displayID = GetNativeDisplayId(); CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5f2f3bc2873..e78c18ea3de 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12835,9 +12835,8 @@ void Unit::setDeathState(DeathState s) { // death state needs to be updated before RemoveAllAurasOnDeath() calls HandleChannelDeathItem(..) so that // it can be used to check creation of death items (such as soul shards). - m_deathState = s; - if (s != ALIVE && s != JUST_ALIVED) + if (s != ALIVE && s != JUST_RESPAWNED) { CombatStop(); DeleteThreatList(); @@ -12880,8 +12879,12 @@ void Unit::setDeathState(DeathState s) if (ZoneScript* zoneScript = GetZoneScript() ? GetZoneScript() : (ZoneScript*)GetInstanceScript()) zoneScript->OnUnitDeath(this); } - else if (s == JUST_ALIVED) + else if (s == JUST_RESPAWNED) + { RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground) + } + + m_deathState = s; } /*######################################## diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index c3cfc415c41..2d6c5b1a86e 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -465,7 +465,7 @@ enum DeathState JUST_DIED = 1, CORPSE = 2, DEAD = 3, - JUST_ALIVED = 4, + JUST_RESPAWNED = 4, }; enum UnitState diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp index 02782a22452..1301acf4c99 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp @@ -27,6 +27,7 @@ DoorData const Doors[] = { {GO_ICE_WALL, DATA_GARFROST, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, {GO_ICE_WALL, DATA_ICK, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, + {GO_HALLS_OF_REFLECTION_PORTCULLIS, DATA_TYRANNUS, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, }; class instance_pit_of_saron : public InstanceMapScript @@ -166,6 +167,7 @@ class instance_pit_of_saron : public InstanceMapScript switch (go->GetEntry()) { case GO_ICE_WALL: + case GO_HALLS_OF_REFLECTION_PORTCULLIS: AddDoor(go, true); break; } @@ -176,6 +178,7 @@ class instance_pit_of_saron : public InstanceMapScript switch (go->GetEntry()) { case GO_ICE_WALL: + case GO_HALLS_OF_REFLECTION_PORTCULLIS: AddDoor(go, false); break; } diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h index 4252f4f59a8..768c3ba40ec 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h @@ -91,6 +91,7 @@ enum GameObjectIds { GO_SARONITE_ROCK = 196485, GO_ICE_WALL = 201885, + GO_HALLS_OF_REFLECTION_PORTCULLIS = 201848, }; #endif diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 5b208768b0c..fab9a5f0740 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1290,7 +1290,7 @@ struct npc_argent_captainAI : public ScriptedAI if (spell->Id == SPELL_REVIVE_CHAMPION && !IsUndead) { IsUndead = true; - me->setDeathState(JUST_ALIVED); + me->setDeathState(JUST_RESPAWNED); uint32 newEntry = 0; switch (me->GetEntry()) { diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index eb2d3187636..045ae5a6f9a 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1095,7 +1095,7 @@ class spell_item_shimmering_vessel : public SpellScriptLoader void HandleDummy(SpellEffIndex /* effIndex */) { if (Creature* target = GetHitCreature()) - target->setDeathState(JUST_ALIVED); + target->setDeathState(JUST_RESPAWNED); } void Register() diff --git a/src/server/shared/Debugging/Errors.h b/src/server/shared/Debugging/Errors.h index 6927fdb483f..48a8bda32ed 100755 --- a/src/server/shared/Debugging/Errors.h +++ b/src/server/shared/Debugging/Errors.h @@ -24,10 +24,10 @@ #include <ace/Stack_Trace.h> #include <ace/OS_NS_unistd.h> -#define WPAssert( assertion ) { if (!(assertion)) { ACE_Stack_Trace st; sLog->outError( "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", __FILE__, __LINE__, __FUNCTION__, #assertion, st.c_str()); assert( #assertion &&0 ); ((void(*)())NULL)();} } -#define WPError( assertion, errmsg ) if ( ! (assertion) ) { sLog->outError( "%\n%s:%i in %s ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); assert( false ); } -#define WPWarning( assertion, errmsg ) if ( ! (assertion) ) { sLog->outError( "\n%s:%i in %s WARNING:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); } -#define WPFatal( assertion, errmsg ) if ( ! (assertion) ) { sLog->outError( "\n%s:%i in %s FATAL ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); ACE_OS::sleep(10); assert( #assertion &&0 ); abort(); } +#define WPAssert(assertion) { if (!(assertion)) { ACE_Stack_Trace st; sLog->outError("\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", __FILE__, __LINE__, __FUNCTION__, #assertion, st.c_str()); *((volatile int*)NULL) = 0; } } +#define WPError(assertion, errmsg) { if (!(assertion)) { sLog->outError("%\n%s:%i in %s ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); *((volatile int*)NULL) = 0; } } +#define WPWarning(assertion, errmsg) { if (!(assertion)) { sLog->outError("\n%s:%i in %s WARNING:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); } } +#define WPFatal(assertion, errmsg) { if (!(assertion)) { sLog->outError("\n%s:%i in %s FATAL ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); ACE_OS::sleep(10); *((volatile int*)NULL) = 0; } } #define ASSERT WPAssert #endif |
