diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/interface/ScriptMgr.cpp | 10 | ||||
-rw-r--r-- | src/bindings/interface/ScriptMgr.h | 2 | ||||
-rw-r--r-- | src/game/Chat.cpp | 1 | ||||
-rw-r--r-- | src/game/Chat.h | 1 | ||||
-rw-r--r-- | src/game/Level3.cpp | 9 | ||||
-rw-r--r-- | src/game/Unit.cpp | 1 | ||||
-rw-r--r-- | src/game/World.cpp | 13 | ||||
-rw-r--r-- | src/game/World.h | 2 |
8 files changed, 24 insertions, 15 deletions
diff --git a/src/bindings/interface/ScriptMgr.cpp b/src/bindings/interface/ScriptMgr.cpp index 81e017685d6..3cb45d8170b 100644 --- a/src/bindings/interface/ScriptMgr.cpp +++ b/src/bindings/interface/ScriptMgr.cpp @@ -20,11 +20,11 @@ #include "config.h" #include "ScriptMgr.h" -#include "../../game/GossipDef.h" -#include "../../game/GameObject.h" -#include "../../game/Player.h" -#include "../../game/Map.h" -#include "../../game/ObjectMgr.h" +#include "GossipDef.h" +#include "GameObject.h" +#include "Player.h" +#include "Map.h" +#include "ObjectMgr.h" //uint8 loglevel = 0; int nrscripts; diff --git a/src/bindings/interface/ScriptMgr.h b/src/bindings/interface/ScriptMgr.h index 3954616d382..97b75f07db2 100644 --- a/src/bindings/interface/ScriptMgr.h +++ b/src/bindings/interface/ScriptMgr.h @@ -90,7 +90,7 @@ extern int num_inst_scripts; struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI { - ScriptedAI(Creature* creature) : m_creature(creature) {} + ScriptedAI(Creature* creature):CreatureAI(creature),m_creature(creature){} ~ScriptedAI() {} // Called if IsVisible(Unit *who) is true at each *who move diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 01f1ae1525c..48b6a195a14 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -449,6 +449,7 @@ ChatCommand * ChatHandler::getCommandTable() { "spell_elixir", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellElixirCommand, "", NULL }, { "spell_learn_spell", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellLearnSpellCommand, "", NULL }, { "spell_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesSpellCommand, "", NULL }, + { "spell_linked_spell", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellLinkedSpellCommand, "", NULL }, { "spell_pet_auras", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellPetAurasCommand, "", NULL }, { "spell_proc_event", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellProcEventCommand, "", NULL }, { "spell_bonus_data", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellBonusesCommand, "", NULL }, diff --git a/src/game/Chat.h b/src/game/Chat.h index d05c1cee986..ac24a4c66b7 100644 --- a/src/game/Chat.h +++ b/src/game/Chat.h @@ -356,6 +356,7 @@ class ChatHandler bool HandleReloadSpellAreaCommand(const char* args); bool HandleReloadSpellElixirCommand(const char* args); bool HandleReloadSpellLearnSpellCommand(const char* args); + bool HandleReloadSpellLinkedSpellCommand(const char* args); bool HandleReloadSpellProcEventCommand(const char* args); bool HandleReloadSpellBonusesCommand(const char* args); bool HandleReloadSpellScriptTargetCommand(const char* args); diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index d085e059a99..37f7edf32cd 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -612,6 +612,7 @@ bool ChatHandler::HandleReloadAllSpellCommand(const char*) HandleReloadSpellAreaCommand("a"); HandleReloadSpellElixirCommand("a"); HandleReloadSpellLearnSpellCommand("a"); + HandleReloadSpellLinkedSpellCommand("a"); HandleReloadSpellProcEventCommand("a"); HandleReloadSpellBonusesCommand("a"); HandleReloadSpellScriptTargetCommand("a"); @@ -960,6 +961,14 @@ bool ChatHandler::HandleReloadSpellLearnSpellCommand(const char*) return true; } +bool ChatHandler::HandleReloadSpellLinkedSpellCommand(const char*) +{ + sLog.outString( "Re-Loading Spell Linked Spells..." ); + spellmgr.LoadSpellLinked(); + SendGlobalGMSysMessage("DB table `spell_linked_spell` reloaded."); + return true; +} + bool ChatHandler::HandleReloadSpellProcEventCommand(const char*) { sLog.outString( "Re-Loading Spell Proc Event conditions..." ); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 40f3272a905..7f0e2636d7a 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4130,6 +4130,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) { caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel(); caster->m_currentSpells[CURRENT_CHANNELED_SPELL]=NULL; + } } diff --git a/src/game/World.cpp b/src/game/World.cpp index 4f8797945ff..def0bdf2691 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -1781,7 +1781,7 @@ void World::ForceGameEventUpdate() } /// Put scripts in the execution queue -void World::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, Object* target) +void World::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, Object* target, bool start) { ///- Find the script map ScriptMapMap::const_iterator s = scripts.find(id); @@ -1809,7 +1809,7 @@ void World::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, immedScript = true; } ///- If one of the effects should be immediate, launch the script execution - if (immedScript) + if (start && immedScript) ScriptsProcess(); } @@ -2539,12 +2539,9 @@ void World::ScriptsProcess() break; uint32 script_id = step.script->datalong2; - //delete iter and return it to begin pos(next one) - m_scriptSchedule.erase(iter); - iter = m_scriptSchedule.begin(); - - ScriptsStart(*datamap, script_id, target, NULL); - return; + //insert script into schedule but do not start it + ScriptsStart(*datamap, script_id, target, NULL, false); + break; } case SCRIPT_COMMAND_KILL: diff --git a/src/game/World.h b/src/game/World.h index 1200a868201..2f261467a6c 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -530,7 +530,7 @@ class World BanReturn BanAccount(BanMode mode, std::string nameOrIP, std::string duration, std::string reason, std::string author); bool RemoveBanAccount(BanMode mode, std::string nameOrIP); - void ScriptsStart(std::map<uint32, std::multimap<uint32, ScriptInfo> > const& scripts, uint32 id, Object* source, Object* target); + void ScriptsStart(std::map<uint32, std::multimap<uint32, ScriptInfo> > const& scripts, uint32 id, Object* source, Object* target, bool start = true); void ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* source, Object* target); bool IsScriptScheduled() const { return !m_scriptSchedule.empty(); } |