aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSubv <s.v.h21@hotmail.com>2012-11-16 12:30:48 -0500
committerSubv <s.v.h21@hotmail.com>2012-11-16 12:30:48 -0500
commitd55771267acb0c4788dd51256930d5cad1acb149 (patch)
treed79f5ca8d3e4ce3727480fef8ece0eed41931df7 /src
parentdd80b76cbb6020d84154b0369934c60ba8ef852d (diff)
Core/EventAI: Removed table creature_ai_summons.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAI.cpp42
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAIMgr.cpp54
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAIMgr.h3
-rwxr-xr-xsrc/server/game/World/World.cpp3
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp10
5 files changed, 0 insertions, 112 deletions
diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp
index 78a84eb7ae4..84e44109e58 100755
--- a/src/server/game/AI/EventAI/CreatureEventAI.cpp
+++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp
@@ -497,23 +497,6 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
}
break;
}
- case ACTION_T_SUMMON:
- {
- Unit* target = GetTargetByType(action.summon.target, actionInvoker);
-
- Creature* creature = NULL;
-
- if (action.summon.duration)
- creature = me->SummonCreature(action.summon.creatureId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, action.summon.duration);
- else
- creature = me->SummonCreature(action.summon.creatureId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
-
- if (!creature)
- sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: failed to spawn creature %u. Spawn event %d is on creature %d", action.summon.creatureId, eventId, me->GetEntry());
- else if (action.summon.target != TARGET_T_SELF && target)
- creature->AI()->AttackStart(target);
- break;
- }
case ACTION_T_THREAT_SINGLE_PCT:
if (Unit* target = GetTargetByType(action.threat_single_pct.target, actionInvoker))
me->getThreatManager().modifyThreatPercent(target, action.threat_single_pct.percent);
@@ -663,30 +646,6 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
else
sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 < Param1. Event = %d. CreatureEntry = %d", eventId, me->GetEntry());
break;
- case ACTION_T_SUMMON_ID:
- {
- Unit* target = GetTargetByType(action.summon_id.target, actionInvoker);
-
- CreatureEventAI_Summon_Map::const_iterator i = sEventAIMgr->GetCreatureEventAISummonMap().find(action.summon_id.spawnId);
- if (i == sEventAIMgr->GetCreatureEventAISummonMap().end())
- {
- sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", action.summon_id.creatureId, action.summon_id.spawnId, eventId, me->GetEntry());
- return;
- }
-
- Creature* creature = NULL;
- if ((*i).second.SpawnTimeSecs)
- creature = me->SummonCreature(action.summon_id.creatureId, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, (*i).second.SpawnTimeSecs);
- else
- creature = me->SummonCreature(action.summon_id.creatureId, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
-
- if (!creature)
- sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: failed to spawn creature %u. EventId %d.Creature %d", action.summon_id.creatureId, eventId, me->GetEntry());
- else if (action.summon_id.target != TARGET_T_SELF && target)
- creature->AI()->AttackStart(target);
-
- break;
- }
case ACTION_T_KILLED_MONSTER:
//first attempt player who tapped creature
if (Player* player = me->GetLootRecipient())
@@ -798,7 +757,6 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
}
break;
}
-
case ACTION_T_SET_SHEATH:
{
me->SetSheath(SheathState(action.set_sheath.sheath));
diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp
index 2d973d9eb8f..b8bb99f7b14 100755
--- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp
+++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp
@@ -100,52 +100,6 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u additional CreatureEventAI Texts data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
-void CreatureEventAIMgr::LoadCreatureEventAI_Summons()
-{
- uint32 oldMSTime = getMSTime();
-
- //Drop Existing EventSummon Map
- m_CreatureEventAI_Summon_Map.clear();
-
- // Gather additional data for EventAI
- QueryResult result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, spawntimesecs FROM creature_ai_summons");
-
- if (!result)
- {
- sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 CreatureEventAI Summon definitions. DB table `creature_ai_summons` is empty.");
- return;
- }
-
- uint32 count = 0;
-
- do
- {
- Field* fields = result->Fetch();
-
- CreatureEventAI_Summon temp;
-
- uint32 i = fields[0].GetUInt32();
- temp.position_x = fields[1].GetFloat();
- temp.position_y = fields[2].GetFloat();
- temp.position_z = fields[3].GetFloat();
- temp.orientation = fields[4].GetFloat();
- temp.SpawnTimeSecs = fields[5].GetUInt32();
-
- if (!Trinity::IsValidMapCoord(temp.position_x, temp.position_y, temp.position_z, temp.orientation))
- {
- sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Summon id %u have wrong coordinates (%f, %f, %f, %f), skipping.", i, temp.position_x, temp.position_y, temp.position_z, temp.orientation);
- continue;
- }
-
- //Add to map
- m_CreatureEventAI_Summon_Map[i] = temp;
- ++count;
- }
- while (result->NextRow());
-
- sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u CreatureEventAI summon definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
-}
-
void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
uint32 oldMSTime = getMSTime();
@@ -622,14 +576,6 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
// equal case processed at call
}
break;
- case ACTION_T_SUMMON_ID:
- if (!sObjectMgr->GetCreatureTemplate(action.summon_id.creatureId))
- sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.summon_id.creatureId);
- if (action.summon_id.target >= TARGET_T_END)
- sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
- if (m_CreatureEventAI_Summon_Map.find(action.summon_id.spawnId) == m_CreatureEventAI_Summon_Map.end())
- sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u summons missing CreatureEventAI_Summon %u", i, j+1, action.summon_id.spawnId);
- break;
case ACTION_T_KILLED_MONSTER:
if (!sObjectMgr->GetCreatureTemplate(action.killed_monster.creatureId))
sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.killed_monster.creatureId);
diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.h b/src/server/game/AI/EventAI/CreatureEventAIMgr.h
index 93e953681b6..75e24266fb5 100755
--- a/src/server/game/AI/EventAI/CreatureEventAIMgr.h
+++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.h
@@ -32,16 +32,13 @@ class CreatureEventAIMgr
public:
void LoadCreatureEventAI_Texts();
- void LoadCreatureEventAI_Summons();
void LoadCreatureEventAI_Scripts();
CreatureEventAI_Event_Map const& GetCreatureEventAIMap() const { return m_CreatureEventAI_Event_Map; }
- CreatureEventAI_Summon_Map const& GetCreatureEventAISummonMap() const { return m_CreatureEventAI_Summon_Map; }
CreatureEventAI_TextMap const& GetCreatureEventAITextMap() const { return m_CreatureEventAI_TextMap; }
private:
CreatureEventAI_Event_Map m_CreatureEventAI_Event_Map;
- CreatureEventAI_Summon_Map m_CreatureEventAI_Summon_Map;
CreatureEventAI_TextMap m_CreatureEventAI_TextMap;
};
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 2e5c7b19800..5a776126d33 100755
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1660,9 +1660,6 @@ void World::SetInitialWorldSettings()
sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading CreatureEventAI Texts...");
sEventAIMgr->LoadCreatureEventAI_Texts();
- sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading CreatureEventAI Summons...");
- sEventAIMgr->LoadCreatureEventAI_Summons();
-
sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading CreatureEventAI Scripts...");
sEventAIMgr->LoadCreatureEventAI_Scripts();
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index 25f4c176bfc..10b3fd1b997 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -78,7 +78,6 @@ public:
{ "config", SEC_ADMINISTRATOR, true, &HandleReloadConfigCommand, "", NULL },
{ "creature_text", SEC_ADMINISTRATOR, true, &HandleReloadCreatureText, "", NULL },
{ "creature_ai_scripts", SEC_ADMINISTRATOR, true, &HandleReloadEventAIScriptsCommand, "", NULL },
- { "creature_ai_summons", SEC_ADMINISTRATOR, true, &HandleReloadEventAISummonsCommand, "", NULL },
{ "creature_ai_texts", SEC_ADMINISTRATOR, true, &HandleReloadEventAITextsCommand, "", NULL },
{ "creature_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestInvRelationsCommand, "", NULL },
{ "creature_linked_respawn", SEC_GAMEMASTER, true, &HandleReloadLinkedRespawnCommand, "", NULL },
@@ -276,7 +275,6 @@ public:
static bool HandleReloadAllEventAICommand(ChatHandler* handler, const char* /*args*/)
{
HandleReloadEventAITextsCommand(handler, "a");
- HandleReloadEventAISummonsCommand(handler, "a");
HandleReloadEventAIScriptsCommand(handler, "a");
return true;
}
@@ -1037,14 +1035,6 @@ public:
return true;
}
- static bool HandleReloadEventAISummonsCommand(ChatHandler* handler, const char* /*args*/)
- {
- sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Summons from `creature_ai_summons`...");
- sEventAIMgr->LoadCreatureEventAI_Summons();
- handler->SendGlobalGMSysMessage("DB table `creature_ai_summons` reloaded.");
- return true;
- }
-
static bool HandleReloadEventAIScriptsCommand(ChatHandler* handler, const char* /*args*/)
{
sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `creature_ai_scripts`...");