diff options
19 files changed, 181 insertions, 29 deletions
diff --git a/sql/updates/world/2012_04_01_world_creature.sql b/sql/updates/world/2012_04_01_01_world_creature.sql index f6dff34cfa9..f6dff34cfa9 100644 --- a/sql/updates/world/2012_04_01_world_creature.sql +++ b/sql/updates/world/2012_04_01_01_world_creature.sql diff --git a/sql/updates/world/2012_04_01_02_world_spell_group_stack_rules.sql b/sql/updates/world/2012_04_01_02_world_spell_group_stack_rules.sql new file mode 100644 index 00000000000..d42afd1d955 --- /dev/null +++ b/sql/updates/world/2012_04_01_02_world_spell_group_stack_rules.sql @@ -0,0 +1,9 @@ +-- Greater Blessing of Wisdom and Mana Spring Totem should not stack (hotfix) +SET @GROUP := 1117; +DELETE FROM `spell_group` WHERE id=@GROUP; +INSERT INTO `spell_group`(`id`,`spell_id`) VALUES +(@GROUP,25894), -- Greater Blessing of Wisdom +(@GROUP,5677); -- Mana Spring (cast by Mana Spring Totem) +DELETE FROM `spell_group_stack_rules` WHERE `group_id`=@GROUP; +INSERT INTO `spell_group_stack_rules`(`group_id`,`stack_rule`) VALUES +(@GROUP,3); -- Make them SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT diff --git a/sql/updates/world/2012_04_01_03_world_trainers.sql b/sql/updates/world/2012_04_01_03_world_trainers.sql new file mode 100644 index 00000000000..1edc9ae09af --- /dev/null +++ b/sql/updates/world/2012_04_01_03_world_trainers.sql @@ -0,0 +1,83 @@ +-- Template updates +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33608; -- Alchemy +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16/*80*/,`trainer_type`=2 WHERE `entry`=33609; -- Blacksmithing +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33610; -- Enchanting +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33611; -- Engineering +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33612; -- Leatherworking +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16 WHERE `entry`=33613; -- Tailoring +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33614; -- Jewelcrafting +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33616; -- Herbalism +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33618; -- Skinning (guessed) +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33617; -- Mining (guessed) +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16 WHERE `entry`=33619; -- Cooking (guessed) +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16 WHERE `entry`=33621; -- First Aid (guessed) +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33615; -- Inscription (guessed) +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33623; -- Fishing (guessed) + +-- Model data +UPDATE `creature_model_info` SET `bounding_radius`=0.11,`combat_reach`=0,`gender`=2 WHERE `modelid`=28738; -- shared by many +UPDATE `creature_model_info` SET `bounding_radius`=0.14,`combat_reach`=0,`gender`=2 WHERE `modelid`=28758; -- shared by many + +-- Addon data +DELETE FROM `creature_template_addon` WHERE `entry` IN (33608,33609,33610,33611,33612,33613,33614,33616,33618,33617,33619,33621,33615,33623); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(33608,0,0,1,0, NULL), -- Alchemy +(33609,0,0,1,0, NULL), -- Blacksmithing +(33610,0,0,1,0, NULL), -- Enchanting +(33611,0,0,1,0, NULL), -- Engineering +(33612,0,0,1,0, NULL), -- Leatherworking +(33613,0,0,1,0, NULL), -- Tailoring +(33614,0,0,1,0, NULL), -- Jewelcrafting +(33616,0,0,1,0, NULL), -- Herbalism +(33618,0,0,1,0, NULL), -- Skinning (guessed) +(33617,0,0,1,0, NULL), -- Mining (guessed) +(33619,0,0,1,0, NULL), -- Cooking (guessed) +(33621,0,0,1,0, NULL), -- First Aid (guessed) +(33615,0,0,1,0, NULL), -- Inscription (guessed) +(33623,0,0,1,0, NULL); -- Fishing (guessed) + +-- Trainer spells +DELETE FROM `npc_trainer` WHERE `entry` IN (33608,33609,33610,33611,33612,33613,33614,33616,33618,33617,33619,33621,33615,33623); +INSERT INTO `npc_trainer` (`entry`, `spell`, `spellcost`, `reqskill`, `reqskillvalue`, `reqlevel`) VALUES +(33608, -201001, 0, 0, 0, 0), -- Alchemy +(33608, -201002, 0, 0, 0, 0), -- Alchemy +(33608, -201003, 0, 0, 0, 0), -- Alchemy +(33609, -201004, 0, 0, 0, 0), -- Blacksmithing +(33609, -201005, 0, 0, 0, 0), -- Blacksmithing +(33609, -201006, 0, 0, 0, 0), -- Blacksmithing +(33610, -201009, 0, 0, 0, 0), -- Enchanting +(33610, -201010, 0, 0, 0, 0), -- Enchanting +(33610, -201011, 0, 0, 0, 0), -- Enchanting +(33611, -201012, 0, 0, 0, 0), -- Engineering +(33611, -201013, 0, 0, 0, 0), -- Engineering +(33611, -201014, 0, 0, 0, 0), -- Engineering +(33612, -201027, 0, 0, 0, 0), -- Leatherworking +(33612, -201028, 0, 0, 0, 0), -- Leatherworking +(33612, -201029, 0, 0, 0, 0), -- Leatherworking +(33613, -201039, 0, 0, 0, 0), -- Tailoring +(33613, -201040, 0, 0, 0, 0), -- Tailoring +(33613, -201041, 0, 0, 0, 0), -- Tailoring +(33614, -201024, 0, 0, 0, 0), -- Jewelcrafting +(33614, -201025, 0, 0, 0, 0), -- Jewelcrafting +(33614, -201026, 0, 0, 0, 0), -- Jewelcrafting +(33616, -201018, 0, 0, 0, 0), -- Herbalism +(33616, -201019, 0, 0, 0, 0), -- Herbalism +(33616, -201020, 0, 0, 0, 0), -- Herbalism +(33618, -201036, 0, 0, 0, 0), -- Skinning +(33618, -201037, 0, 0, 0, 0), -- Skinning +(33618, -201038, 0, 0, 0, 0), -- Skinning +(33617, -201033, 0, 0, 0, 0), -- Mining +(33617, -201034, 0, 0, 0, 0), -- Mining +(33617, -201035, 0, 0, 0, 0), -- Mining +(33619, -202004, 0, 0, 0, 0), -- Cooking +(33619, -202005, 0, 0, 0, 0), -- Cooking +(33619, -202006, 0, 0, 0, 0), -- Cooking +(33621, -202007, 0, 0, 0, 0), -- First Aid +(33621, -202008, 0, 0, 0, 0), -- First Aid +(33621, -202009, 0, 0, 0, 0), -- First Aid +(33615, -201021, 0, 0, 0, 0), -- Inscription +(33615, -201022, 0, 0, 0, 0), -- Inscription +(33615, -201023, 0, 0, 0, 0), -- Inscription +(33623, -202001, 0, 0, 0, 0), -- Fishing +(33623, -202002, 0, 0, 0, 0), -- Fishing +(33623, -202003, 0, 0, 0, 0); -- Fishing diff --git a/sql/updates/world/2012_04_01_04_world_conditions.sql b/sql/updates/world/2012_04_01_04_world_conditions.sql new file mode 100644 index 00000000000..e84307e0b05 --- /dev/null +++ b/sql/updates/world/2012_04_01_04_world_conditions.sql @@ -0,0 +1,5 @@ +-- Quest: Blending In (11633) +-- Spell from Cape only Appliable in City Area +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=45614; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17,0,45614,11633,23,4125,0,0,0, '', 'Shroud of the Scourge - Temple City of En''kilah'); diff --git a/sql/updates/world/2012_04_01_05_world_creature_template.sql b/sql/updates/world/2012_04_01_05_world_creature_template.sql new file mode 100644 index 00000000000..a4d13f1513a --- /dev/null +++ b/sql/updates/world/2012_04_01_05_world_creature_template.sql @@ -0,0 +1,2 @@ +-- CREATURE_FLAG_EXTRA_NO_XP_AT_KILL +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|64 WHERE `entry`=21267; -- Mana Beast diff --git a/sql/updates/world/2012_04_01_06_world_sai.sql b/sql/updates/world/2012_04_01_06_world_sai.sql new file mode 100644 index 00000000000..9b8857da1e4 --- /dev/null +++ b/sql/updates/world/2012_04_01_06_world_sai.sql @@ -0,0 +1,7 @@ +-- Fix quest 11468 - Falcon versus hawk +SET @entry := 24747; -- Fjord Hawk +UPDATE creature_template SET AIName='SmartAI' WHERE entry=@entry; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@entry AND `source_type`=0; +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 +(@entry,0,0,1,8,0,100,0,44407,0,0,0,11,44408,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Fjord Hawk - On Spellhit - Cast spell on invoker'), +(@entry,0,1,0,61,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fjord Hawk - On Spellhit - Despawn'); diff --git a/sql/updates/world/2012_04_01_07_world_misc.sql b/sql/updates/world/2012_04_01_07_world_misc.sql new file mode 100644 index 00000000000..346627fd88b --- /dev/null +++ b/sql/updates/world/2012_04_01_07_world_misc.sql @@ -0,0 +1,4 @@ +UPDATE `conditions` SET `ElseGroup`=0 WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=45614; -- typo fix for previous commit +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=47431; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17,0,47431,0,23,4195,0,0,64,'','Capture Jormungar Spawn can only be used in Ice Heart Cavern'); diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index b4c86f7ef5f..73e24e5a3c3 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -145,7 +145,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid) uint32 matchMakerRating; if (result) - matchMakerRating = (*result)[0].GetUInt32(); + matchMakerRating = (*result)[0].GetUInt16(); else matchMakerRating = sWorld->getIntConfig(CONFIG_ARENA_START_MATCHMAKER_RATING); diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 9992721a6dd..7a4c17d1c5e 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -401,7 +401,7 @@ ChatCommand* ChatHandler::getCommandTable() { "movegens", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleMovegensCommand>, "", NULL }, { "cometome", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleComeToMeCommand>, "", NULL }, { "damage", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleDamageCommand>, "", NULL }, - { "combatstop", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleCombatStopCommand>, "", NULL }, + { "combatstop", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCombatStopCommand>, "", NULL }, { "flusharenapoints", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleFlushArenaPointsCommand>, "", NULL }, { "repairitems", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleRepairitemsCommand>, "", NULL }, { "waterwalk", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleWaterwalkCommand>, "", NULL }, diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index cc7c9020d38..cc638193b5a 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -713,9 +713,22 @@ bool ChatHandler::HandleLookupEventCommand(const char* args) bool ChatHandler::HandleCombatStopCommand(const char* args) { - Player* target; - if (!extractPlayerTarget((char*)args, &target)) - return false; + Player* target = NULL; + + if (args && strlen(args) > 0) + { + target = sObjectAccessor->FindPlayerByName(args); + if (!target) + { + SendSysMessage(LANG_PLAYER_NOT_FOUND); + SetSentErrorMessage(true); + return false; + } + } + + if (!target) + if (!extractPlayerTarget((char*)args, &target)) + return false; // check online security if (HasLowerSecurity(target, 0)) diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index fe2e8f38e62..bc90e6f4484 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -343,8 +343,8 @@ void Item::SaveToDB(SQLTransaction& trans) } stmt->setString(++index, ssEnchants.str()); - stmt->setInt32 (++index, GetItemRandomPropertyId()); - stmt->setUInt32(++index, GetUInt32Value(ITEM_FIELD_DURABILITY)); + stmt->setInt16 (++index, GetItemRandomPropertyId()); + stmt->setUInt16(++index, GetUInt32Value(ITEM_FIELD_DURABILITY)); stmt->setUInt32(++index, GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME)); stmt->setString(++index, m_text); stmt->setUInt32(++index, guid); @@ -486,7 +486,7 @@ void Item::DeleteFromDB(SQLTransaction& trans) /*static*/ void Item::DeleteFromInventoryDB(SQLTransaction& trans, uint32 itemGuid) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVENTORY_ITEM); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM); stmt->setUInt32(0, itemGuid); trans->Append(stmt); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2afa3c7bc58..0a4363df323 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -18984,7 +18984,7 @@ void Player::_SaveActions(SQLTransaction& trans) void Player::_SaveAuras(SQLTransaction& trans) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_AURA); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA); stmt->setUInt32(0, GetGUIDLow()); trans->Append(stmt); @@ -19147,7 +19147,7 @@ void Player::_SaveInventory(SQLTransaction& trans) trans->Append(stmt); break; case ITEM_REMOVED: - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVENTORY_ITEM); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM); stmt->setUInt32(0, item->GetGUIDLow()); trans->Append(stmt); case ITEM_UNCHANGED: diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 8d02db9d515..d71f8e8dfc3 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4424,9 +4424,7 @@ float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask } // Add the highest of the Same Effect Stack Rule SpellGroups to the multiplier for (std::map<SpellGroup, int32>::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) - { AddPctN(multiplier, itr->second); - } return multiplier; } @@ -4461,27 +4459,39 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 misc_ int32 Unit::GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const { + std::map<SpellGroup, int32> SameEffectSpellGroup; int32 modifier = 0; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { if ((*i)->GetMiscValue() == misc_value) - modifier += (*i)->GetAmount(); + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) + modifier += (*i)->GetAmount(); } + + for (std::map<SpellGroup, int32>::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) + modifier += itr->second; + return modifier; } float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_value) const { + std::map<SpellGroup, int32> SameEffectSpellGroup; float multiplier = 1.0f; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { if ((*i)->GetMiscValue() == misc_value) - AddPctN(multiplier, (*i)->GetAmount()); + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) + AddPctN(multiplier, (*i)->GetAmount()); } + + for (std::map<SpellGroup, int32>::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) + AddPctN(multiplier, itr->second); + return multiplier; } @@ -4515,27 +4525,39 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_ int32 Unit::GetTotalAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const { + std::map<SpellGroup, int32> SameEffectSpellGroup; int32 modifier = 0; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { if ((*i)->IsAffectedOnSpell(affectedSpell)) - modifier += (*i)->GetAmount(); + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) + modifier += (*i)->GetAmount(); } + + for (std::map<SpellGroup, int32>::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) + modifier += itr->second; + return modifier; } float Unit::GetTotalAuraMultiplierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const { + std::map<SpellGroup, int32> SameEffectSpellGroup; float multiplier = 1.0f; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { if ((*i)->IsAffectedOnSpell(affectedSpell)) - AddPctN(multiplier, (*i)->GetAmount()); + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) + AddPctN(multiplier, (*i)->GetAmount()); } + + for (std::map<SpellGroup, int32>::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) + AddPctN(multiplier, itr->second); + return multiplier; } @@ -12754,8 +12776,16 @@ void Unit::setDeathState(DeathState s) // remove aurastates allowing special moves ClearAllReactives(); ClearDiminishings(); - GetMotionMaster()->Clear(false); - GetMotionMaster()->MoveIdle(); + if (IsInWorld()) + { + // Only clear MotionMaster for entities that exists in world + // Avoids crashes in the following conditions : + // * Using 'call pet' on dead pets + // * Using 'call stabled pet' + // * Logging in with dead pets + GetMotionMaster()->Clear(false); + GetMotionMaster()->MoveIdle(); + } StopMoving(); DisableSpline(); // without this when removing IncreaseMaxHealth aura player may stuck with 1 hp diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 8753d2834a1..24435abc4ca 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -7203,7 +7203,7 @@ void ObjectMgr::SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN); stmt->setUInt32(0, loguid); - stmt->setUInt64(1, uint64(t)); + stmt->setUInt32(1, uint32(t)); stmt->setUInt32(2, instance); CharacterDatabase.Execute(stmt); } @@ -7217,7 +7217,7 @@ void ObjectMgr::RemoveCreatureRespawnTime(uint32 loguid, uint32 instance) _creatureRespawnTimesMutex.release(); } - PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN); stmt->setUInt32(0, loguid); stmt->setUInt32(1, instance); CharacterDatabase.Execute(stmt); diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 1e54bbe6995..b0a4da3e42b 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -461,7 +461,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte if (result) { Field* fields = result->Fetch(); - createInfo->CharCount = fields[0].GetUInt8(); + createInfo->CharCount = fields[0].GetUInt64(); if (createInfo->CharCount >= sWorld->getIntConfig(CONFIG_CHARACTERS_PER_REALM)) { diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 7a3964b9469..e3f6e92132e 100755 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -300,9 +300,9 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recv_data) for (uint8 i = 1; i <= signs; ++i) { Field* fields2 = result->Fetch(); - uint64 plguid = fields2[0].GetUInt64(); + uint32 lowGuid = fields2[0].GetUInt32(); - data << uint64(plguid); // Player GUID + data << uint64(MAKE_NEW_GUID(lowGuid, 0, HIGHGUID_PLAYER)); // Player GUID data << uint32(0); // there 0 ... result->NextRow(); @@ -485,7 +485,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) fields = result->Fetch(); uint64 ownerGuid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); - uint8 signs = fields[1].GetUInt8(); + uint64 signs = fields[1].GetUInt64(); uint8 type = fields[2].GetUInt8(); uint32 playerGuid = _player->GetGUIDLow(); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 1a9905edd12..953eafcd3da 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1200,7 +1200,9 @@ void World::LoadConfigSettings(bool reload) m_bool_configs[CONFIG_PDUMP_NO_PATHS] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowPaths", true); m_bool_configs[CONFIG_PDUMP_NO_OVERWRITE] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowOverwrite", true); - sScriptMgr->OnConfigLoad(reload); + // call ScriptMgr if we're reloading the configuration + if (reload) + sScriptMgr->OnConfigLoad(reload); } extern void LoadGameObjectModelList(); @@ -1653,6 +1655,7 @@ void World::SetInitialWorldSettings() sLog->outString("Initializing Scripts..."); sScriptMgr->Initialize(); + sScriptMgr->OnConfigLoad(false); // must be done after the ScriptMgr has been properly initialized sLog->outString("Validating spell scripts..."); sObjectMgr->ValidateSpellScripts(); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 22de70b993b..63be227547a 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -129,7 +129,6 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_ITEM_BOP_TRADE, "DELETE FROM item_soulbound_trade_data WHERE itemGuid = ? LIMIT 1", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_ITEM_BOP_TRADE, "INSERT INTO item_soulbound_trade_data VALUES (?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_REP_INVENTORY_ITEM, "REPLACE INTO character_inventory (guid, bag, slot, item) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_INVENTORY_ITEM, "DELETE FROM character_inventory WHERE item = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_REP_ITEM_INSTANCE, "REPLACE INTO item_instance (itemEntry, owner_guid, creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, guid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_ITEM_INSTANCE, "UPDATE item_instance SET itemEntry = ?, owner_guid = ?, creatorGuid = ?, giftCreatorGuid = ?, count = ?, duration = ?, charges = ?, flags = ?, enchantments = ?, randomPropertyId = ?, durability = ?, playedTime = ?, text = ? WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_ITEM_INSTANCE_ON_LOAD, "UPDATE item_instance SET duration = ?, flags = ?, durability = ? WHERE guid = ?", CONNECTION_ASYNC) @@ -239,7 +238,6 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_EQUIP_SET, "DELETE FROM character_equipmentsets WHERE setguid=?", CONNECTION_ASYNC) // Auras - PREPARE_STATEMENT(CHAR_DEL_AURA, "DELETE FROM character_aura WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_AURA, "INSERT INTO character_aura (guid, caster_guid, item_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) " "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 4d8433c74b2..0b915eba0e3 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -138,7 +138,6 @@ enum CharacterDatabaseStatements CHAR_DEL_ITEM_BOP_TRADE, CHAR_INS_ITEM_BOP_TRADE, CHAR_REP_INVENTORY_ITEM, - CHAR_DEL_INVENTORY_ITEM, CHAR_REP_ITEM_INSTANCE, CHAR_UPD_ITEM_INSTANCE, CHAR_UPD_ITEM_INSTANCE_ON_LOAD, @@ -231,7 +230,6 @@ enum CharacterDatabaseStatements CHAR_INS_EQUIP_SET, CHAR_DEL_EQUIP_SET, - CHAR_DEL_AURA, CHAR_INS_AURA, CHAR_SEL_ACCOUNT_DATA, |
