diff options
| -rw-r--r-- | sql/updates/world/2013_08_30_06_world_eai_sai.sql | 25 | ||||
| -rw-r--r-- | src/server/game/AI/EventAI/CreatureEventAI.cpp | 14 | ||||
| -rw-r--r-- | src/server/game/AI/EventAI/CreatureEventAI.h | 17 | ||||
| -rw-r--r-- | src/server/game/AI/EventAI/CreatureEventAIMgr.cpp | 14 | ||||
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 22 | ||||
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 7 | ||||
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.h | 8 | ||||
| -rw-r--r-- | src/server/game/Entities/GameObject/GameObject.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 60 | ||||
| -rw-r--r-- | src/server/game/Entities/Player/Player.h | 2 | ||||
| -rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Quests/QuestDef.h | 7 | ||||
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 48 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_quest.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Outland/zone_shadowmoon_valley.cpp | 2 | 
16 files changed, 52 insertions, 186 deletions
diff --git a/sql/updates/world/2013_08_30_06_world_eai_sai.sql b/sql/updates/world/2013_08_30_06_world_eai_sai.sql new file mode 100644 index 00000000000..33814d2cc36 --- /dev/null +++ b/sql/updates/world/2013_08_30_06_world_eai_sai.sql @@ -0,0 +1,25 @@ +DELETE FROM `creature_ai_scripts` WHERE `action1_type`=27; + +-- INSERT INTO `creature_ai_scripts` (`id`, `creature_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_type`, `action1_param1`, `action1_param2`, `action1_param3`, `action2_type`, `action2_param1`, `action2_param2`, `action2_param3`, `action3_type`, `action3_param1`, `action3_param2`, `action3_param3`, `comment`) VALUES +--   ('343001', '3430', '0', '0', '100', '0', '0', '0', '0', '0', '27', '5043', '17013', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Mangletooth - Cast Agamaggan''s Agility on Quest Complete'), +--   ('343002', '3430', '0', '0', '100', '0', '0', '0', '0', '0', '27', '5042', '16612', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Mangletooth - Cast Agamaggan''s Strength on Quest Complete'), +--   ('343003', '3430', '0', '0', '100', '0', '0', '0', '0', '0', '27', '5046', '16610', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Mangletooth - Cast Razorhide on Quest Complete'), +--   ('343004', '3430', '0', '0', '100', '0', '0', '0', '0', '0', '27', '5045', '10767', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Mangletooth - Cast Rising Spirit on Quest Complete'), +--   ('343005', '3430', '0', '0', '100', '0', '0', '0', '0', '0', '27', '889', '16618', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Mangletooth - Cast Spirit of the Wind on Quest Complete'), +--   ('343006', '3430', '0', '0', '100', '0', '0', '0', '0', '0', '27', '5044', '7764', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Mangletooth - Cast Wisdom of Agamaggan on Quest Complete'); + +UPDATE `smart_scripts` SET `action_type`=33, `action_param2`=0 WHERE `source_type`=0 AND `action_type`=27; -- by VM + +-- all quests that used RequiredSpellCastX fields +UPDATE `quest_template` SET `SpecialFlags`=`SpecialFlags`|32 WHERE `entry` IN +(28,29,532,553,849,877,905,974,2118,2932,2994,3825,5096,5163,5165,5441, +6124,6129,6381,6395,6661,8346,8889,9066,9169,9193,9275,9294,9391,9440, +9444,9447,9489,9526,9600,9629,9667,9685,9720,9805,9824,9874,9910,10011, +10078,10087,10129,10144,10146,10182,10208,10233,10240,10305,10306,10307, +10313,10335,10345,10392,10426,10446,10447,10488,10545,10564,10598,10637, +10688,10714,10771,10792,10802,10808,10813,10833,10859,10866,10895,10913, +10923,10935,11055,11150,11205,11232,11245,11247,11258,11259,11285,11330, +11332,11421,11496,11515,11523,11542,11543,11547,11568,11576,11582,11610, +11617,11637,11656,11677,11684,11694,11713,11880,12092,12094,12096,12154, +12172,12173,12180,12213,12232,12267,12417,12449,12502,12588,12591,12598, +12641,12669,12728,12859,13110,13119,13211); diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index c35dbebaad5..c7180836040 100644 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -511,11 +511,6 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32                  if (target->GetTypeId() == TYPEID_PLAYER)                      target->ToPlayer()->AreaExploredOrEventHappens(action.quest_event.questId);              break; -        case ACTION_T_CAST_EVENT: -            if (Unit* target = GetTargetByType(action.cast_event.target, actionInvoker)) -                if (target->GetTypeId() == TYPEID_PLAYER) -                    target->ToPlayer()->CastedCreatureOrGO(action.cast_event.creatureId, me->GetGUID(), action.cast_event.spellId); -            break;          case ACTION_T_SET_UNIT_FIELD:          {              Unit* target = GetTargetByType(action.set_unit_field.target, actionInvoker); @@ -612,15 +607,6 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32                          Temp->ToPlayer()->GroupEventHappens(action.quest_event_all.questId, me);              }              break; -        case ACTION_T_CAST_EVENT_ALL: -        { -            ThreatContainer::StorageType const& threatList = me->getThreatManager().getThreatList(); -            for (ThreatContainer::StorageType::const_iterator i = threatList.begin(); i != threatList.end(); ++i) -                if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid())) -                    if (unit->GetTypeId() == TYPEID_PLAYER) -                        unit->ToPlayer()->CastedCreatureOrGO(action.cast_event_all.creatureId, me->GetGUID(), action.cast_event_all.spellId); -            break; -        }          case ACTION_T_REMOVEAURASFROMSPELL:              if (Unit* target = GetTargetByType(action.remove_aura.target, actionInvoker))                  target->RemoveAurasDueToSpell(action.remove_aura.spellId); diff --git a/src/server/game/AI/EventAI/CreatureEventAI.h b/src/server/game/AI/EventAI/CreatureEventAI.h index d67fef64b95..d98dbfdc234 100644 --- a/src/server/game/AI/EventAI/CreatureEventAI.h +++ b/src/server/game/AI/EventAI/CreatureEventAI.h @@ -81,7 +81,7 @@ enum EventAI_ActionType      ACTION_T_THREAT_SINGLE_PCT          = 13,               // Threat%, Target      ACTION_T_THREAT_ALL_PCT             = 14,               // Threat%      ACTION_T_QUEST_EVENT                = 15,               // QuestID, Target -    ACTION_T_CAST_EVENT                 = 16,               // CreatureId, SpellId, Target - must be removed as hack? +    // none                             = 16,      ACTION_T_SET_UNIT_FIELD             = 17,               // Field_Number, Value, Target      ACTION_T_SET_UNIT_FLAG              = 18,               // Flags (may be more than one field OR'd together), Target      ACTION_T_REMOVE_UNIT_FLAG           = 19,               // Flags (may be more than one field OR'd together), Target @@ -92,7 +92,7 @@ enum EventAI_ActionType      ACTION_T_EVADE                      = 24,               // No Params      ACTION_T_FLEE_FOR_ASSIST            = 25,               // No Params      ACTION_T_QUEST_EVENT_ALL            = 26,               // QuestID -    ACTION_T_CAST_EVENT_ALL             = 27,               // CreatureId, SpellId +    // none                             = 27,      ACTION_T_REMOVEAURASFROMSPELL       = 28,               // Target, Spellid      ACTION_T_RANGED_MOVEMENT            = 29,               // Distance, Angle      ACTION_T_RANDOM_PHASE               = 30,               // PhaseId1, PhaseId2, PhaseId3 @@ -269,13 +269,6 @@ struct CreatureEventAI_Action              uint32 questId;              uint32 target;          } quest_event; -        // ACTION_T_CAST_EVENT                              = 16 -        struct -        { -            uint32 creatureId; -            uint32 spellId; -            uint32 target; -        } cast_event;          // ACTION_T_SET_UNIT_FIELD                          = 17          struct          { @@ -316,12 +309,6 @@ struct CreatureEventAI_Action          {              uint32 questId;          } quest_event_all; -        // ACTION_T_CAST_EVENT_ALL                          = 27 -        struct -        { -            uint32 creatureId; -            uint32 spellId; -        } cast_event_all;          // ACTION_T_REMOVEAURASFROMSPELL                    = 28          struct          { diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp index 4d2aa9b469f..f77499fa7e3 100644 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp @@ -517,14 +517,6 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()                          TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureEventAI:  Event %u Action %u uses incorrect Target type", i, j+1);                      break; -                case ACTION_T_CAST_EVENT: -                    if (!sObjectMgr->GetCreatureTemplate(action.cast_event.creatureId)) -                        TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureEventAI:  Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.cast_event.creatureId); -                    if (!sSpellMgr->GetSpellInfo(action.cast_event.spellId)) -                        TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureEventAI:  Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast_event.spellId); -                    if (action.cast_event.target >= TARGET_T_END) -                        TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureEventAI:  Event %u Action %u uses incorrect Target type", i, j+1); -                    break;                  case ACTION_T_SET_UNIT_FIELD:                      if (action.set_unit_field.field < OBJECT_END || action.set_unit_field.field >= UNIT_END)                          TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureEventAI:  Event %u Action %u param1 (UNIT_FIELD*). Index out of range for intended use.", i, j+1); @@ -555,12 +547,6 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()                      else                          TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureEventAI:  Event %u Action %u uses non-existent Quest entry %u.", i, j+1, action.quest_event_all.questId);                      break; -                case ACTION_T_CAST_EVENT_ALL: -                    if (!sObjectMgr->GetCreatureTemplate(action.cast_event_all.creatureId)) -                        TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureEventAI:  Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.cast_event_all.creatureId); -                    if (!sSpellMgr->GetSpellInfo(action.cast_event_all.spellId)) -                        TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureEventAI:  Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast_event_all.spellId); -                    break;                  case ACTION_T_REMOVEAURASFROMSPELL:                      if (!sSpellMgr->GetSpellInfo(action.remove_aura.spellId))                          TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureEventAI:  Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.remove_aura.spellId); diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 3285ce4dec9..2d6046cbddf 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -766,28 +766,6 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u                          player->GroupEventHappens(e.action.quest.quest, GetBaseObject());              break;          } -        case SMART_ACTION_CALL_CASTEDCREATUREORGO: -        { -            if (!GetBaseObject()) -                break; - -            ObjectList* targets = GetTargets(e, unit); -            if (!targets) -                break; - -            for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) -            { -                if (IsPlayer((*itr))) -                { -                    (*itr)->ToPlayer()->CastedCreatureOrGO(e.action.callCastedCreatureOrGO.creature, GetBaseObject()->GetGUID(), e.action.callCastedCreatureOrGO.spell); -                    TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_CASTEDCREATUREORGO: Player %u, target %u, spell %u", -                        (*itr)->GetGUIDLow(), e.action.callCastedCreatureOrGO.creature, e.action.callCastedCreatureOrGO.spell); -                } -            } - -            delete targets; -            break; -        }          case SMART_ACTION_REMOVEAURASFROMSPELL:          {              ObjectList* targets = GetTargets(e, unit); diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index d12e8ab179c..2e0fd222b6e 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -727,13 +727,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)                  return false;              }              break; -        case SMART_ACTION_CALL_CASTEDCREATUREORGO: -            if (!IsCreatureValid(e, e.action.callCastedCreatureOrGO.creature)) -                return false; - -            if (!IsSpellValid(e, e.action.callCastedCreatureOrGO.spell)) -                return false; -            break;          case SMART_ACTION_REMOVEAURASFROMSPELL:              if (e.action.removeAura.spell != 0 && !IsSpellValid(e, e.action.removeAura.spell))                  return false; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 4c0f5d1b25b..8337f9e15ee 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -417,7 +417,7 @@ enum SMART_ACTION      SMART_ACTION_EVADE                              = 24,     // No Params      SMART_ACTION_FLEE_FOR_ASSIST                    = 25,     // With Emote      SMART_ACTION_CALL_GROUPEVENTHAPPENS             = 26,     // QuestID -    SMART_ACTION_CALL_CASTEDCREATUREORGO            = 27,     // CreatureId, SpellId +    // none                                         = 27,      SMART_ACTION_REMOVEAURASFROMSPELL               = 28,     // Spellid, 0 removes all auras      SMART_ACTION_FOLLOW                             = 29,     // Distance (0 = default), Angle (0 = default), EndCreatureEntry, credit, creditType (0monsterkill, 1event)      SMART_ACTION_RANDOM_PHASE                       = 30,     // PhaseId1, PhaseId2, PhaseId3... @@ -629,12 +629,6 @@ struct SmartAction          struct          { -            uint32 creature; -            uint32 spell; -        } callCastedCreatureOrGO; - -        struct -        {              uint32 spell;          } removeAura; diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index f903e0b2ee5..15e7eb436e1 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -1257,7 +1257,7 @@ void GameObject::Use(Unit* user)                  if (Battleground* bg = player->GetBattleground())                      bg->EventPlayerUsedGO(player, this); -                player->CastedCreatureOrGO(info->entry, GetGUID(), 0); +                player->KillCreditGO(info->entry, GetGUID());              }              if (uint32 trapEntry = info->goober.linkedTrapId) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2c0d22bee29..9b381175280 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5709,15 +5709,10 @@ void Player::HandleBaseModValue(BaseModGroup modGroup, BaseModType modType, floa          return;      } -    switch (modType) -    { -        case FLAT_MOD: -            m_auraBaseMod[modGroup][modType] += apply ? amount : -amount; -            break; -        case PCT_MOD: -            ApplyPercentModFloatVar(m_auraBaseMod[modGroup][modType], amount, apply); -            break; -    } +    if (modType == FLAT_MOD) +        m_auraBaseMod[modGroup][modType] += apply ? amount : -amount; +    else // PCT_MOD +        ApplyPercentModFloatVar(m_auraBaseMod[modGroup][modType], amount, apply);      if (!CanModifyStats())          return; @@ -14935,7 +14930,7 @@ bool Player::CanCompleteQuest(uint32 quest_id)                  }              } -            if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO)) +            if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL | QUEST_TRINITY_FLAGS_CAST | QUEST_TRINITY_FLAGS_SPEAKTO))              {                  for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; i++)                  { @@ -15090,7 +15085,7 @@ void Player::AddQuest(Quest const* quest, Object* questGiver)              questStatusData.ItemCount[i] = 0;      } -    if (quest->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO)) +    if (quest->HasFlag(QUEST_TRINITY_FLAGS_KILL | QUEST_TRINITY_FLAGS_CAST | QUEST_TRINITY_FLAGS_SPEAKTO))      {          for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)              questStatusData.CreatureOrGOCount[i] = 0; @@ -16259,7 +16254,7 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid /*= 0*/)          QuestStatusData& q_status = m_QuestStatus[questid];          if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid(GetMap()->GetDifficulty())))          { -            if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST)) +            if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL) /*&& !qInfo->HasFlag(QUEST_TRINITY_FLAGS_CAST)*/)              {                  for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)                  { @@ -16333,10 +16328,8 @@ void Player::KilledPlayerCredit()      }  } -void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id) +void Player::KillCreditGO(uint32 entry, uint64 guid)  { -    bool isCreature = IS_CRE_OR_VEH_GUID(guid); -      uint16 addCastCount = 1;      for (uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i)      { @@ -16352,41 +16345,16 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id)          if (q_status.Status == QUEST_STATUS_INCOMPLETE)          { -            if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST)) +            if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_CAST) /*&& !qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL)*/)              {                  for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)                  {                      uint32 reqTarget = 0; -                    if (isCreature) -                    { -                        // creature activate objectives -                        if (qInfo->RequiredNpcOrGo[j] > 0) -                        { -                            // checked at quest_template loading -                            reqTarget = qInfo->RequiredNpcOrGo[j]; -                            if (reqTarget != entry) // if entry doesn't match, check for killcredits referenced in template -                            { -                                CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry); -                                if (!cinfo) -                                { -                                    TC_LOG_ERROR(LOG_FILTER_PLAYER, "Player::CastedCreatureOrGO: GetCreatureTemplate failed for entry %u. Skipping.", entry); -                                    continue; -                                } - -                                for (uint8 k = 0; k < MAX_KILL_CREDIT; ++k) -                                    if (cinfo->KillCredit[k] == reqTarget) -                                        entry = cinfo->KillCredit[k]; -                            } -                         } -                    } -                    else -                    { -                        // GO activate objective -                        if (qInfo->RequiredNpcOrGo[j] < 0) -                            // checked at quest_template loading -                            reqTarget = - qInfo->RequiredNpcOrGo[j]; -                    } +                    // GO activate objective +                    if (qInfo->RequiredNpcOrGo[j] < 0) +                        // checked at quest_template loading +                        reqTarget = - qInfo->RequiredNpcOrGo[j];                      // other not this creature/GO related objectives                      if (reqTarget != entry) @@ -16431,7 +16399,7 @@ void Player::TalkedToCreature(uint32 entry, uint64 guid)          if (q_status.Status == QUEST_STATUS_INCOMPLETE)          { -            if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO)) +            if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL | QUEST_TRINITY_FLAGS_CAST | QUEST_TRINITY_FLAGS_SPEAKTO))              {                  for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)                  { diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 9a17033de67..bac794422be 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1416,7 +1416,7 @@ class Player : public Unit, public GridObject<Player>          void KilledMonster(CreatureTemplate const* cInfo, uint64 guid);          void KilledMonsterCredit(uint32 entry, uint64 guid = 0);          void KilledPlayerCredit(); -        void CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id); +        void KillCreditGO(uint32 entry, uint64 guid = 0);          void TalkedToCreature(uint32 entry, uint64 guid);          void MoneyChanged(uint32 value);          void ReputationChanged(FactionEntry const* factionEntry); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index a46720e6d03..804967c760a 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4080,7 +4080,7 @@ void ObjectMgr::LoadQuests()              {                  // In fact SpeakTo and Kill are quite same: either you can speak to mob:SpeakTo or you can't:Kill/Cast -                qinfo->SetFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO); +                qinfo->SetFlag(QUEST_TRINITY_FLAGS_KILL | QUEST_TRINITY_FLAGS_CAST | QUEST_TRINITY_FLAGS_SPEAKTO);                  if (!qinfo->RequiredNpcOrGoCount[j])                  { diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index c202374187f..b2796652a01 100644 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -152,13 +152,14 @@ enum QuestFlags      QUEST_TRINITY_FLAGS_AUTO_ACCEPT          = 0x00400000,  // Set by 4 in SpecialFlags in DB if the quest is to be auto-accepted.      QUEST_TRINITY_FLAGS_DF_QUEST             = 0x00800000,  // Set by 8 in SpecialFlags in DB if the quest is used by Dungeon Finder.      QUEST_TRINITY_FLAGS_MONTHLY              = 0x01000000,  // Set by 16 in SpecialFlags in DB if the quest is reset at the begining of the month - -    QUEST_TRINITY_FLAGS_DB_ALLOWED = 0xFFFFF | QUEST_TRINITY_FLAGS_REPEATABLE | QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT | QUEST_TRINITY_FLAGS_AUTO_ACCEPT | QUEST_TRINITY_FLAGS_DF_QUEST | QUEST_TRINITY_FLAGS_MONTHLY, +    QUEST_TRINITY_FLAGS_CAST                 = 0x02000000,  // Set by 32 in SpecialFlags in DB if the quest requires RequiredOrNpcGo killcredit but NOT kill (a spell cast) +     +    QUEST_TRINITY_FLAGS_DB_ALLOWED = 0xFFFFF | QUEST_TRINITY_FLAGS_REPEATABLE | QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT | QUEST_TRINITY_FLAGS_AUTO_ACCEPT | QUEST_TRINITY_FLAGS_DF_QUEST | QUEST_TRINITY_FLAGS_MONTHLY | QUEST_TRINITY_FLAGS_CAST,      // Trinity flags for internal use only      QUEST_TRINITY_FLAGS_DELIVER              = 0x04000000,   // Internal flag computed only      QUEST_TRINITY_FLAGS_SPEAKTO              = 0x08000000,   // Internal flag computed only -    QUEST_TRINITY_FLAGS_KILL_OR_CAST         = 0x10000000,   // Internal flag computed only +    QUEST_TRINITY_FLAGS_KILL                 = 0x10000000,   // Internal flag computed only      QUEST_TRINITY_FLAGS_TIMED                = 0x20000000,   // Internal flag computed only      QUEST_TRINITY_FLAGS_PLAYER_KILL          = 0x40000000    // Internal flag computed only  }; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index f1c60cb4e90..866cd888c3e 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2569,17 +2569,9 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)      {          //AI functions          if (spellHitTarget->GetTypeId() == TYPEID_UNIT) -        {              if (spellHitTarget->ToCreature()->IsAIEnabled)                  spellHitTarget->ToCreature()->AI()->SpellHit(m_caster, m_spellInfo); -            // cast at creature (or GO) quest objectives update at successful cast finished (+channel finished) -            // ignore pets or autorepeat/melee casts for speed (not exist quest for spells (hm...) -            if (m_originalCaster && m_originalCaster->IsControlledByPlayer() && !spellHitTarget->ToCreature()->IsPet() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive()) -                if (Player* p = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself()) -                    p->CastedCreatureOrGO(spellHitTarget->GetEntry(), spellHitTarget->GetGUID(), m_spellInfo->Id); -        } -          if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsAIEnabled)              m_caster->ToCreature()->AI()->SpellHitTarget(spellHitTarget, m_spellInfo); @@ -2882,12 +2874,6 @@ void Spell::DoAllEffectOnTarget(GOTargetInfo* target)              HandleEffects(NULL, NULL, go, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);      CallScriptOnHitHandlers(); - -    // cast at creature (or GO) quest objectives update at successful cast finished (+channel finished) -    // ignore autorepeat/melee casts for speed (not exist quest for spells (hm...) -    if (m_originalCaster && m_originalCaster->IsControlledByPlayer() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive()) -        if (Player* p = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself()) -            p->CastedCreatureOrGO(go->GetEntry(), go->GetGUID(), m_spellInfo->Id);      CallScriptAfterHitHandlers();  } @@ -3641,40 +3627,6 @@ void Spell::update(uint32 difftime)              if (m_timer == 0)              {                  SendChannelUpdate(0); - -                // channeled spell processed independently for quest targeting -                // cast at creature (or GO) quest objectives update at successful cast channel finished -                // ignore autorepeat/melee casts for speed (not exist quest for spells (hm...) -                if (!IsAutoRepeat() && !IsNextMeleeSwingSpell()) -                { -                    if (Player* p = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself()) -                    { -                        for (std::list<TargetInfo>::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) -                        { -                            TargetInfo* target = &*ihit; -                            if (!IS_CRE_OR_VEH_GUID(target->targetGUID)) -                                continue; - -                            Unit* unit = m_caster->GetGUID() == target->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, target->targetGUID); -                            if (unit == NULL) -                                continue; - -                            p->CastedCreatureOrGO(unit->GetEntry(), unit->GetGUID(), m_spellInfo->Id); -                        } - -                        for (std::list<GOTargetInfo>::iterator ihit = m_UniqueGOTargetInfo.begin(); ihit != m_UniqueGOTargetInfo.end(); ++ihit) -                        { -                            GOTargetInfo* target = &*ihit; - -                            GameObject* go = m_caster->GetMap()->GetGameObject(target->targetGUID); -                            if (!go) -                                continue; - -                            p->CastedCreatureOrGO(go->GetEntry(), go->GetGUID(), m_spellInfo->Id); -                        } -                    } -                } -                  finish();              }              break; diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index 0ffda4ba390..2ecb05db713 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -208,16 +208,12 @@ public:              uint32 creaturecount = quest->RequiredNpcOrGoCount[i];              if (creature > 0) -            {                  if (CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creature))                      for (uint16 z = 0; z < creaturecount; ++z)                          player->KilledMonster(cInfo, 0); -            }              else if (creature < 0) -            {                  for (uint16 z = 0; z < creaturecount; ++z) -                    player->CastedCreatureOrGO(creature, 0, 0); -            } +                    player->KillCreditGO(creature, 0);          }          // If the quest requires reputation to complete diff --git a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp index ab74a76a440..8ee1de1c8d5 100644 --- a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp @@ -172,7 +172,7 @@ public:          if (Creature* stillpine = go->FindNearestCreature(NPC_PRINCESS_STILLPINE, 25, true))          {              stillpine->GetMotionMaster()->MovePoint(1, go->GetPositionX(), go->GetPositionY()-15, go->GetPositionZ()); -            player->CastedCreatureOrGO(NPC_PRINCESS_STILLPINE, 0, SPELL_OPENING_PRINCESS_STILLPINE_CREDIT); +            player->KilledMonsterCredit(NPC_PRINCESS_STILLPINE, stillpine->GetGUID());          }          return true;      } diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp index cb88e5a5a9c..eac3dce43b0 100644 --- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -1899,7 +1899,7 @@ class spell_unlocking_zuluheds_chains : public SpellScriptLoader              {                  if (GetCaster()->GetTypeId() == TYPEID_PLAYER)                      if (Creature* karynaku = GetCaster()->FindNearestCreature(NPC_KARYNAKU, 15.0f)) -                        GetCaster()->ToPlayer()->CastedCreatureOrGO(NPC_KARYNAKU, karynaku->GetGUID(), GetSpellInfo()->Id); +                        GetCaster()->ToPlayer()->KilledMonsterCredit(NPC_KARYNAKU, karynaku->GetGUID());              }              void Register() OVERRIDE  | 
