--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-05 17:10:59 -05:00
9 changed files with 27 additions and 15 deletions

View File

@@ -0,0 +1,3 @@
delete from command where name in ('reload spell_linked_spell');
insert into command (name, security, help) values
('reload spell_linked_spell','3','Usage: .reload spell_linked_spell\r\nReloads the spell_linked_spell DB table.'),

View File

@@ -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;

View File

@@ -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

View File

@@ -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 },

View File

@@ -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);

View File

@@ -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..." );

View File

@@ -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;
}
}

View File

@@ -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:

View File

@@ -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(); }