Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Faq committed Apr 5, 2012
2 parents 036f9d5 + b5dc7bc commit ac1f390
Show file tree
Hide file tree
Showing 33 changed files with 229 additions and 88 deletions.
2 changes: 1 addition & 1 deletion sql/base/auth_database.sql
Expand Up @@ -191,7 +191,7 @@ DROP TABLE IF EXISTS `realmlist`;
CREATE TABLE `realmlist` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL DEFAULT '',
`address` varchar(64) NOT NULL DEFAULT '127.0.0.1',
`address` varchar(255) NOT NULL DEFAULT '127.0.0.1',
`port` smallint(5) unsigned NOT NULL DEFAULT '8085',
`icon` tinyint(3) unsigned NOT NULL DEFAULT '0',
`flag` tinyint(3) unsigned NOT NULL DEFAULT '2',
Expand Down
1 change: 1 addition & 0 deletions sql/updates/auth/2012_04_04_00_auth_realmlist.sql
@@ -0,0 +1 @@
ALTER TABLE `realmlist` CHANGE `address` `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '127.0.0.1';
1 change: 0 additions & 1 deletion sql/updates/world/2012_03_30_00_world_smart_scripts.sql
Expand Up @@ -92,4 +92,3 @@ INSERT INTO `quest_start_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`
(@COOP,38,10,@ENTRY,@LIFE,0, 5227.28,4407.01,-95.3888,4.29414),
(@COOP,39,10,@ENTRY,@LIFE,0, 5251.09,4413.76,-96.086,3.90536),
(@COOP,40,10,@ENTRY,@LIFE,0, 5251.09,4413.76,-96.086,4.36089);

3 changes: 3 additions & 0 deletions sql/updates/world/2012_04_03_00_world_spell_script_names.sql
@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `spell_id` = 36444;
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(36444, 'spell_gen_wg_water');
7 changes: 7 additions & 0 deletions sql/updates/world/2012_04_04_00_world_conditions.sql
@@ -0,0 +1,7 @@
-- Will of Sartharion should only target the drakes and Sartharion
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=61254;
INSERT INTO `conditions`(`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13, 1, 61254, 0, 0, 31, 0, 3, 30449, 0, 0, 0, '', 'Will of Sartharion'),
(13, 1, 61254, 0, 1, 31, 0, 3, 30451, 0, 0, 0, '', 'Will of Sartharion'),
(13, 1, 61254, 0, 2, 31, 0, 3, 30452, 0, 0, 0, '', 'Will of Sartharion'),
(13, 1, 61254, 0, 3, 31, 0, 3, 28860, 0, 0, 0, '', 'Will of Sartharion');
1 change: 1 addition & 0 deletions sql/updates/world/2012_04_04_01_world_spell_dbc.sql
@@ -0,0 +1 @@
UPDATE `spell_dbc` SET `EffectApplyAuraName1`=4 WHERE `Id`=56817;
32 changes: 32 additions & 0 deletions sql/updates/world/2012_04_05_00_world_gameobject_template.sql
@@ -0,0 +1,32 @@
DELETE FROM `gameobject_template` WHERE `entry`=202931;
INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `WDBVerified`) VALUES
(202931, 5, 9463, 'Serpent Offering', '', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.17, 0, 0, 0, 0, 0, 0, 12340); -- -Unknown-

UPDATE `gameobject_template` SET `questItem1`=30527, `questItem2`=30524, `questItem3`=30525, `questItem4`=30526 WHERE `entry`=184815; -- Sealed Coffin
-- UPDATE `gameobject_template` SET `data0`=2061, `WDBVerified`=12340 WHERE `entry`=151951; -- Idol Oven Fire
-- UPDATE `gameobject_template` SET `type`=5, `data3`=0, `data5`=0 WHERE `entry`=188187; -- Snow Pile
UPDATE `gameobject_template` SET `size`=0.45 WHERE `entry`=190169; -- Tiger Lily
UPDATE `gameobject_template` SET `unk1`='' WHERE `entry`=190549; -- The Zephyr
-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=191300; -- Fire
UPDATE `gameobject_template` SET `displayId`=7836 WHERE `entry`=196485; -- Saronite Rock
-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126337; -- 126337
-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126338; -- 126338
-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126339; -- 126339
-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126340; -- 126340
-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126341; -- 126341
-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126345; -- 126345
UPDATE `gameobject_template` SET `data2`=23787, `data7`=3605, `data19`=0 WHERE `entry`=202443; -- Dedication of Honor
UPDATE `gameobject_template` SET `type`=10 WHERE `entry`=166872; -- Supply Crate
UPDATE `gameobject_template` SET `data6`=-1000 WHERE `entry`=178559; -- Larva Spewer

/*
GameObject (Entry: 126337 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist.
GameObject (Entry: 126338 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist.
GameObject (Entry: 126339 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist.
GameObject (Entry: 126340 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist.
GameObject (Entry: 126341 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist.
GameObject (Entry: 126345 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist.
GameObject (Entry: 151951 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist.
GameObject (Entry: 191300 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist.
Gameobject (Entry: 188192 GoType: 3) have data7=188187 but GO (Entry 188187) have not GAMEOBJECT_TYPE_TRAP (6) type.
*/
6 changes: 6 additions & 0 deletions sql/updates/world/2012_04_05_00_world_spell_script_names.sql
@@ -0,0 +1,6 @@
DELETE FROM `spell_script_names` WHERE `spell_id` in (7384,7887,11584,11585);
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(7384, 'spell_warr_overpower'),
(7887, 'spell_warr_overpower'),
(11584, 'spell_warr_overpower'),
(11585, 'spell_warr_overpower');
2 changes: 2 additions & 0 deletions sql/updates/world/2012_04_05_01_world_spell_proc_event.sql
@@ -0,0 +1,2 @@
UPDATE `spell_proc_event` SET `SpellFamilyMask0`=0x80000000, `SpellFamilyMask1`=0 WHERE `entry`=67363; -- Fixes Libram of Veracity proc

18 changes: 14 additions & 4 deletions src/server/game/AI/SmartScripts/SmartScript.cpp
Expand Up @@ -108,8 +108,11 @@ void SmartScript::OnReset()
ResetBaseObject();
for (SmartAIEventList::iterator i = mEvents.begin(); i != mEvents.end(); ++i)
{
InitTimer((*i));
(*i).runOnce = false;
if (!((*i).event.event_flags & SMART_EVENT_FLAG_DONT_RESET))
{
InitTimer((*i));
(*i).runOnce = false;
}
}
ProcessEventsFor(SMART_EVENT_RESET);
mLastInvoker = 0;
Expand Down Expand Up @@ -1862,19 +1865,26 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (!targets)
break;

ObjectList* storedTargets = GetTargetList(e.action.sendTargetToTarget.id);
if (!storedTargets)
{
delete targets;
return;
}

for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
if (IsCreature(*itr))
{
if (SmartAI* ai = CAST_AI(SmartAI, (*itr)->ToCreature()->AI()))
ai->GetScript()->StoreTargetList(GetTargetList(e.action.sendTargetToTarget.id), e.action.sendTargetToTarget.id);
ai->GetScript()->StoreTargetList(new ObjectList(*storedTargets), e.action.sendTargetToTarget.id); // store a copy of target list
else
sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping");
}
else if (IsGameObject(*itr))
{
if (SmartGameObjectAI* ai = CAST_AI(SmartGameObjectAI, (*itr)->ToGameObject()->AI()))
ai->GetScript()->StoreTargetList(GetTargetList(e.action.sendTargetToTarget.id), e.action.sendTargetToTarget.id);
ai->GetScript()->StoreTargetList(new ObjectList(*storedTargets), e.action.sendTargetToTarget.id); // store a copy of target list
else
sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping");
}
Expand Down
17 changes: 9 additions & 8 deletions src/server/game/AI/SmartScripts/SmartScriptMgr.h
Expand Up @@ -1165,14 +1165,15 @@ const uint32 SmartAIEventMask[SMART_EVENT_END][2] =

enum SmartEventFlags
{
SMART_EVENT_FLAG_NOT_REPEATABLE = 0x01, //Event can not repeat
SMART_EVENT_FLAG_DIFFICULTY_0 = 0x02, //Event only occurs in instance difficulty 0
SMART_EVENT_FLAG_DIFFICULTY_1 = 0x04, //Event only occurs in instance difficulty 1
SMART_EVENT_FLAG_DIFFICULTY_2 = 0x08, //Event only occurs in instance difficulty 2
SMART_EVENT_FLAG_DIFFICULTY_3 = 0x10, //Event only occurs in instance difficulty 3
SMART_EVENT_FLAG_RESERVED_5 = 0x20,
SMART_EVENT_FLAG_RESERVED_6 = 0x40,
SMART_EVENT_FLAG_DEBUG_ONLY = 0x80, //Event only occurs in debug build
SMART_EVENT_FLAG_NOT_REPEATABLE = 0x001, //Event can not repeat
SMART_EVENT_FLAG_DIFFICULTY_0 = 0x002, //Event only occurs in instance difficulty 0
SMART_EVENT_FLAG_DIFFICULTY_1 = 0x004, //Event only occurs in instance difficulty 1
SMART_EVENT_FLAG_DIFFICULTY_2 = 0x008, //Event only occurs in instance difficulty 2
SMART_EVENT_FLAG_DIFFICULTY_3 = 0x010, //Event only occurs in instance difficulty 3
SMART_EVENT_FLAG_RESERVED_5 = 0x020,
SMART_EVENT_FLAG_RESERVED_6 = 0x040,
SMART_EVENT_FLAG_DEBUG_ONLY = 0x080, //Event only occurs in debug build
SMART_EVENT_FLAG_DONT_RESET = 0x100, //Event will not reset in SmartScript::OnReset()

SMART_EVENT_FLAG_DIFFICULTY_ALL = (SMART_EVENT_FLAG_DIFFICULTY_0|SMART_EVENT_FLAG_DIFFICULTY_1|SMART_EVENT_FLAG_DIFFICULTY_2|SMART_EVENT_FLAG_DIFFICULTY_3)
};
Expand Down
1 change: 0 additions & 1 deletion src/server/game/Entities/Creature/Creature.h
Expand Up @@ -266,7 +266,6 @@ struct CreatureData
// `creature_addon` table
struct CreatureAddon
{
uint32 guidOrEntry;
uint32 path_id;
uint32 mount;
uint32 bytes1;
Expand Down
6 changes: 3 additions & 3 deletions src/server/game/Entities/Item/Item.cpp
Expand Up @@ -1089,9 +1089,9 @@ void Item::SaveRefundDataToDB()

stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_REFUND_INSTANCE);
stmt->setUInt32(0, GetGUIDLow());
stmt->setUInt32(0, GetRefundRecipient());
stmt->setUInt32(0, GetPaidMoney());
stmt->setUInt16(0, uint16(GetPaidExtendedCost()));
stmt->setUInt32(1, GetRefundRecipient());
stmt->setUInt32(2, GetPaidMoney());
stmt->setUInt16(3, uint16(GetPaidExtendedCost()));
trans->Append(stmt);

CharacterDatabase.CommitTransaction(trans);
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Entities/Pet/Pet.cpp
Expand Up @@ -1745,7 +1745,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/)

stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SPELL_LIST);
stmt->setUInt32(0, owner->GetGUIDLow());
stmt->setUInt32(0, except_petnumber);
stmt->setUInt32(1, except_petnumber);
PreparedQueryResult result = CharacterDatabase.Query(stmt);

if (!result)
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Entities/Player/Player.cpp
Expand Up @@ -4885,7 +4885,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
}

Item* pItem = NewItemOrBag(itemProto);
if (!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), fields, item_template))
if (!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), fields2, item_template))
{
pItem->FSetState(ITEM_REMOVED);
pItem->SaveToDB(trans); // it also deletes item object!
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Entities/Unit/Unit.cpp
Expand Up @@ -8827,7 +8827,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
}

// Blade Barrier
if (auraSpellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && auraSpellInfo->SpellIconID == 85)
if (auraSpellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && auraSpellInfo->SpellIconID == 85 && procSpell)
{
Player* player = ToPlayer();
if (!player || player->getClass() != CLASS_DEATH_KNIGHT)
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Groups/Group.cpp
Expand Up @@ -2136,7 +2136,7 @@ void Group::SetGroupMemberFlag(uint64 guid, bool apply, GroupMemberFlags flag)
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_FLAG);

stmt->setUInt8(0, slot->flags);
stmt->setUInt32(0, GUID_LOPART(guid));
stmt->setUInt32(1, GUID_LOPART(guid));

CharacterDatabase.Execute(stmt);

Expand Down
3 changes: 1 addition & 2 deletions src/server/game/Handlers/CharacterHandler.cpp
Expand Up @@ -653,8 +653,6 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte

LoginDatabase.CommitTransaction(trans);

newChar.CleanupsBeforeDelete();

WorldPacket data(SMSG_CHAR_CREATE, 1);
data << uint8(CHAR_CREATE_SUCCESS);
SendPacket(&data);
Expand All @@ -665,6 +663,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
sScriptMgr->OnPlayerCreate(&newChar);
sWorld->AddCharacterNameData(newChar.GetGUIDLow(), std::string(newChar.GetName()), newChar.getGender(), newChar.getRace(), newChar.getClass());

newChar.CleanupsBeforeDelete();
delete createInfo;
_charCreateCallback.Reset();
}
Expand Down
6 changes: 3 additions & 3 deletions src/server/game/Handlers/ItemHandler.cpp
Expand Up @@ -1127,9 +1127,9 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data)

PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GIFT);
stmt->setUInt32(0, GUID_LOPART(item->GetOwnerGUID()));
stmt->setUInt32(0, item->GetGUIDLow());
stmt->setUInt32(0, item->GetEntry());
stmt->setUInt32(0, item->GetUInt32Value(ITEM_FIELD_FLAGS));
stmt->setUInt32(1, item->GetGUIDLow());
stmt->setUInt32(2, item->GetEntry());
stmt->setUInt32(3, item->GetUInt32Value(ITEM_FIELD_FLAGS));
trans->Append(stmt);

item->SetEntry(gift->GetEntry());
Expand Down
4 changes: 1 addition & 3 deletions src/server/game/Handlers/PetitionsHandler.cpp
Expand Up @@ -727,9 +727,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
for (uint8 i = 1; i <= signs; ++i)
{
Field* fields2 = result->Fetch();
plguid = fields2[0].GetUInt64();

data << uint64(plguid); // Player GUID
data << uint64(MAKE_NEW_GUID(fields2[0].GetUInt32(), 0, HIGHGUID_PLAYER)); // Player GUID
data << uint32(0); // there 0 ...

result->NextRow();
Expand Down
10 changes: 2 additions & 8 deletions src/server/game/Handlers/QueryHandler.cpp
Expand Up @@ -38,15 +38,9 @@ void WorldSession::SendNameQueryOpcode(uint64 guid)

WorldPacket data(SMSG_NAME_QUERY_RESPONSE, (8+1+1+1+1+1+10));
data.appendPackGUID(guid);
if (!player)
{
data << uint8(1); // player unknown
SendPacket(&data);
return;
}
if (!nameData)
{
data << uint8(2); // name unknown
data << uint8(1); // name unknown
SendPacket(&data);
return;
}
Expand All @@ -58,7 +52,7 @@ void WorldSession::SendNameQueryOpcode(uint64 guid)
data << uint8(nameData->m_gender);
data << uint8(nameData->m_class);

if (DeclinedName const* names = player->GetDeclinedNames())
if (DeclinedName const* names = (player ? player->GetDeclinedNames() : NULL))
{
data << uint8(1); // Name is declined
for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
Expand Down
6 changes: 3 additions & 3 deletions src/server/game/Instances/InstanceSaveMgr.cpp
Expand Up @@ -581,17 +581,17 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b

PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_MAP_DIFF);
stmt->setUInt16(0, uint16(mapid));
stmt->setUInt8(0, uint8(difficulty));
stmt->setUInt8(1, uint8(difficulty));
trans->Append(stmt);

stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_INSTANCE_BY_MAP_DIFF);
stmt->setUInt16(0, uint16(mapid));
stmt->setUInt8(0, uint8(difficulty));
stmt->setUInt8(1, uint8(difficulty));
trans->Append(stmt);

stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INSTANCE_BY_MAP_DIFF);
stmt->setUInt16(0, uint16(mapid));
stmt->setUInt8(0, uint8(difficulty));
stmt->setUInt8(1, uint8(difficulty));
trans->Append(stmt);

CharacterDatabase.CommitTransaction(trans);
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Miscellaneous/SharedDefines.h
Expand Up @@ -411,7 +411,7 @@ enum SpellAttr3
enum SpellAttr4
{
SPELL_ATTR4_UNK0 = 0x00000001, // 0
SPELL_ATTR4_PROC_ONLY_ON_DUMMY = 0x00000002, // 1 proc only on SPELL_EFFECT_DUMMY?
SPELL_ATTR4_PROC_ONLY_ON_CASTER = 0x00000002, // 1 proc only on effects with TARGET_UNIT_CASTER?
SPELL_ATTR4_UNK2 = 0x00000004, // 2
SPELL_ATTR4_UNK3 = 0x00000008, // 3
SPELL_ATTR4_UNK4 = 0x00000010, // 4 This will no longer cause guards to attack on use??
Expand Down
5 changes: 0 additions & 5 deletions src/server/game/Spells/Auras/SpellAuraEffects.cpp
Expand Up @@ -4768,11 +4768,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (target->GetTypeId() == TYPEID_PLAYER)
target->ToPlayer()->RemoveAmmo(); // not use ammo and not allow use
break;
case 49028:
if (caster)
if (AuraEffect* aurEff = caster->GetAuraEffect(63330, 0)) // glyph of Dancing Rune Weapon
GetBase()->SetDuration(GetBase()->GetDuration() + aurEff->GetAmount());
break;
case 52916: // Honor Among Thieves
if (target->GetTypeId() == TYPEID_PLAYER)
if (Unit* spellTarget = ObjectAccessor::GetUnit(*target, target->ToPlayer()->GetComboTarget()))
Expand Down

0 comments on commit ac1f390

Please sign in to comment.