diff options
| -rw-r--r-- | sql/updates/world/2011_09_05_00_world_spell_target_position.sql | 6 | ||||
| -rw-r--r-- | sql/updates/world/2011_09_05_01_world_gossip.sql | 28 | ||||
| -rwxr-xr-x | src/server/game/AI/CoreAI/UnitAI.cpp | 24 | ||||
| -rwxr-xr-x | src/server/game/Scripting/MapScripts.cpp | 1 | ||||
| -rwxr-xr-x | src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp | 22 | ||||
| -rwxr-xr-x | src/server/game/Spells/Spell.cpp | 5 |
6 files changed, 57 insertions, 29 deletions
diff --git a/sql/updates/world/2011_09_05_00_world_spell_target_position.sql b/sql/updates/world/2011_09_05_00_world_spell_target_position.sql new file mode 100644 index 00000000000..ae0a69c6e99 --- /dev/null +++ b/sql/updates/world/2011_09_05_00_world_spell_target_position.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_target_position` WHERE `id` IN (17278,49097,55431); +INSERT INTO `spell_target_position` (`id` ,`target_map` ,`target_position_x` ,`target_position_y` ,`target_position_z` ,`target_orientation`) VALUES +(17278, 329, 3534.3, -2966.74, 125.001, 0.279253), -- Cannon Fire cast by a trap GO Cannonball +(49097, 0, -466.4, 1496.36, 17.43, 2.1), -- Out of Body Experience, quest with the same name (Grizzly Hills -> Silverpine) +(55431, 571, 5787.781250, -1582.446045, 234.830414, 2.14); -- Summon Gymer +-- 53821 Teach:Death Gate - couldn't find enough info diff --git a/sql/updates/world/2011_09_05_01_world_gossip.sql b/sql/updates/world/2011_09_05_01_world_gossip.sql new file mode 100644 index 00000000000..0d7a193eb95 --- /dev/null +++ b/sql/updates/world/2011_09_05_01_world_gossip.sql @@ -0,0 +1,28 @@ +-- Fixing Lord Thorval, Lady Alistra and Amal'thazad in map 609 +UPDATE `creature_template` SET `gossip_menu_id`=9691 WHERE `entry`=28471; -- Lady Alistra +UPDATE `creature_template` SET `gossip_menu_id`=9692 WHERE `entry`=28472; -- Lord Thorval +UPDATE `creature_template` SET `gossip_menu_id`=9693 WHERE `entry`=28474; -- Amal'thazad + +DELETE FROM `gossip_menu` WHERE `entry`=9791 AND `text_id`=13475; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (9791,13475); + +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9691,9692,9693,9791,10371); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(9691,0,3,'I seek training, Lady Alistra.',5,16,0,0,0,0,''), +(9691,1,0,'I wish to unlearn my talents.',1,1,9791,0,0,0,''), +(9691,2,0,'Learn about Dual Talent Specialization.',1,1,10371,0,0,0,''), +(9692,0,3,'I seek training, Lord Thorval.',5,16,0,0,0,0,''), +(9692,1,0,'I wish to unlearn my talents.',1,1,9791,0,0,0,''), +(9692,2,0,'Learn about Dual Talent Specialization.',1,1,10371,0,0,0,''), +(9693,0,3,'I seek training, Amal''thazad.',5,16,0,0,0,0,''), +(9693,1,0,'I wish to unlearn my talents.',1,1,9791,0,0,0,''), +(9693,2,0,'Learn about Dual Talent Specialization.',1,1,10371,0,0,0,''), +(9791,0,0,'Yes. I do.',16,16,0,0,0,0,''), +(10371,0,0,'Purchase a Dual Talent Specialization.',18,16,0,0,0,10000000,'Are you sure you wish to purchase a Dual Talent Specialization?'); -- Fixing this entry because Dual Talent Specialization needs confirmation by players. + +-- Darion Mograine DK trainer (Since the quest 'Taking back Acherus' until go to Stormwind/Orgrimmar) +-- The gossip_menu (`entry` and `text_id`) are already in TDB UP41. Only needs this changes: +UPDATE `creature_template` SET `gossip_menu_id`=10027, `trainer_class`=6 WHERE `entry`=31084; +DELETE FROM `gossip_menu_option` WHERE `menu_id`=10027; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(10027,0,3,'I require training, Highlord.',5,16,0,0,0,0,''); diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index b6517e3396b..39bdf219880 100755 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -43,27 +43,17 @@ void UnitAI::DoMeleeAttackIfReady() return; Unit *victim = me->getVictim(); - if (!victim || !victim->IsInWorld()) - return; - //Make sure our attack is ready and we aren't currently casting before checking distance - if (me->isAttackReady()) + if (me->isAttackReady() && me->IsWithinMeleeRange(victim)) { - //If we are within range melee the target - if (me->IsWithinMeleeRange(victim)) - { - me->AttackerStateUpdate(victim); - me->resetAttackTimer(); - } + me->AttackerStateUpdate(victim); + me->resetAttackTimer(); } - if (me->haveOffhandWeapon() && me->isAttackReady(OFF_ATTACK)) + + if (me->haveOffhandWeapon() && me->isAttackReady(OFF_ATTACK) && me->IsWithinMeleeRange(victim)) { - //If we are within range melee the target - if (me->IsWithinMeleeRange(victim)) - { - me->AttackerStateUpdate(victim, OFF_ATTACK); - me->resetAttackTimer(OFF_ATTACK); - } + me->AttackerStateUpdate(victim, OFF_ATTACK); + me->resetAttackTimer(OFF_ATTACK); } } diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index f5e6f3f320e..8efca3a8658 100755 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -306,6 +306,7 @@ void Map::ScriptsProcess() source = player->GetItemByGuid(step.sourceGUID); break; case HIGHGUID_UNIT: + case HIGHGUID_VEHICLE: source = HashMapHolder<Creature>::Find(step.sourceGUID); break; case HIGHGUID_PET: diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index 69024837d61..1d6e9bf5722 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -636,12 +636,11 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte sLog->outDebug(LOG_FILTER_NETWORKIO, "Character creation %s (account %u) has unhandled tail data: [%u]", createInfo->Name.c_str(), GetAccountId(), unk); } - Player* pNewChar = new Player(this); - if (!pNewChar->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PLAYER), createInfo)) + Player newChar(this); + if (!newChar.Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PLAYER), createInfo)) { // Player not create (race/class/etc problem?) - pNewChar->CleanupsBeforeDelete(); - delete pNewChar; + newChar.CleanupsBeforeDelete(); WorldPacket data(SMSG_CHAR_CREATE, 1); data << uint8(CHAR_CREATE_ERROR); @@ -653,12 +652,12 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte } if ((haveSameRace && skipCinematics == 1) || skipCinematics == 2) - pNewChar->setCinematic(1); // not show intro + newChar.setCinematic(1); // not show intro - pNewChar->SetAtLoginFlag(AT_LOGIN_FIRST); // First login + newChar.SetAtLoginFlag(AT_LOGIN_FIRST); // First login // Player created, save it now - pNewChar->SaveToDB(); + newChar.SaveToDB(); createInfo->CharCount += 1; SQLTransaction trans = LoginDatabase.BeginTransaction(); @@ -676,18 +675,17 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte LoginDatabase.CommitTransaction(trans); - pNewChar->CleanupsBeforeDelete(); + newChar.CleanupsBeforeDelete(); WorldPacket data(SMSG_CHAR_CREATE, 1); data << uint8(CHAR_CREATE_SUCCESS); SendPacket(&data); std::string IP_str = GetRemoteAddress(); - sLog->outDetail("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), pNewChar->GetGUIDLow()); - sLog->outChar("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), pNewChar->GetGUIDLow()); - sScriptMgr->OnPlayerCreate(pNewChar); + sLog->outDetail("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow()); + sLog->outChar("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow()); + sScriptMgr->OnPlayerCreate(&newChar); - delete pNewChar; // created only to call SaveToDB() delete createInfo; _charCreateCallback.SetParam(NULL); _charCreateCallback.FreeResult(); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 6d10f40ae58..d456cfdcf47 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4752,6 +4752,11 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_DONT_REPORT; } + // Don't check explicit target for passive spells (workaround) (check should be skipped only for learn case) + // those spells may have incorrect target entries or not filled at all (for example 15332) + // such spells when learned are not targeting anyone using targeting system, they should apply directly to caster instead + // also, such casts shouldn't be sent to client + if (!((m_spellInfo->Attributes & SPELL_ATTR0_PASSIVE) && !m_targets.GetUnitTarget() || m_targets.GetUnitTarget() == m_caster)) { // Check explicit target for m_originalCaster - todo: get rid of such workarounds SpellCastResult castResult = m_spellInfo->CheckExplicitTarget(m_originalCaster ? m_originalCaster : m_caster, m_targets.GetObjectTarget(), m_targets.GetItemTarget()); |
