Core/SmartAI: Drop support for SMART_ACTION_SEND_CASTCREATUREORGO. It is unused in the current newest TDB, it never even worked like it should and the exact same purpose of this function is already fulfilled by SMART_ACTION_CALL_CASTEDCREATUREORGO (the correct way).

This commit is contained in:
Discover-
2013-08-11 02:58:53 +02:00
parent b7d88a3c46
commit 80bd5b363a
3 changed files with 6 additions and 41 deletions

View File

@@ -489,28 +489,6 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
delete targets;
break;
}
case SMART_ACTION_SEND_CASTCREATUREORGO:
{
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.castedCreatureOrGO.creature, GetBaseObject()->GetGUID(), e.action.castedCreatureOrGO.spell);
TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SEND_CASTCREATUREORGO: Player guidLow %u.org Creature: %u, BaseObject GUID: "UI64FMTD", Spell: %u",
(*itr)->GetGUIDLow(), e.action.castedCreatureOrGO.creature, GetBaseObject()->GetGUID(), e.action.castedCreatureOrGO.spell);
}
}
delete targets;
break;
}
case SMART_ACTION_CAST:
{
if (!me)
@@ -800,9 +778,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (IsPlayer((*itr)))
{
(*itr)->ToPlayer()->CastedCreatureOrGO(e.action.castedCreatureOrGO.creature, GetBaseObject()->GetGUID(), e.action.castedCreatureOrGO.spell);
(*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.castedCreatureOrGO.creature, e.action.castedCreatureOrGO.spell);
(*itr)->GetGUIDLow(), e.action.callCastedCreatureOrGO.creature, e.action.callCastedCreatureOrGO.spell);
}
}

View File

@@ -682,13 +682,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
return false;
}
break;
case SMART_ACTION_SEND_CASTCREATUREORGO:
if (!IsQuestValid(e, e.action.castCreatureOrGO.quest))
return false;
if (!IsSpellValid(e, e.action.castCreatureOrGO.spell))
return false;
break;
case SMART_ACTION_SET_EVENT_PHASE:
if (e.action.setEventPhase.phase >= SMART_EVENT_PHASE_MAX)
{
@@ -709,10 +702,10 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
break;
case SMART_ACTION_CALL_CASTEDCREATUREORGO:
if (!IsCreatureValid(e, e.action.castedCreatureOrGO.creature))
if (!IsCreatureValid(e, e.action.callCastedCreatureOrGO.creature))
return false;
if (!IsSpellValid(e, e.action.castedCreatureOrGO.spell))
if (!IsSpellValid(e, e.action.callCastedCreatureOrGO.spell))
return false;
break;
case SMART_ACTION_REMOVEAURASFROMSPELL:

View File

@@ -397,7 +397,7 @@ enum SMART_ACTION
SMART_ACTION_THREAT_SINGLE_PCT = 13, // Threat%
SMART_ACTION_THREAT_ALL_PCT = 14, // Threat%
SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS = 15, // QuestID
SMART_ACTION_SEND_CASTCREATUREORGO = 16, // QuestID, SpellId
SMART_ACTION_UNUSED_16 = 16, // UNUSED
SMART_ACTION_SET_EMOTE_STATE = 17, // emoteID
SMART_ACTION_SET_UNIT_FLAG = 18, // Flags (may be more than one field OR'd together), Target
SMART_ACTION_REMOVE_UNIT_FLAG = 19, // Flags (may be more than one field OR'd together), Target
@@ -572,12 +572,6 @@ struct SmartAction
uint32 threatDEC;
} threatPCT;
struct
{
uint32 quest;
uint32 spell;
} castCreatureOrGO;
struct
{
uint32 flag1;
@@ -623,7 +617,7 @@ struct SmartAction
{
uint32 creature;
uint32 spell;
} castedCreatureOrGO;
} callCastedCreatureOrGO;
struct
{