From de2f63bcfbabb63abfa3a33399314f5a59fa0e58 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 27 Jul 2010 19:18:44 +0200 Subject: Added possibility to cast spells with triggered flag using SCRIPT_COMMAND_CAST_SPELL, original patch by Az@zel Fixed SCRIPT_COMMAND_CAST_SPELL for casting on creatures with selected entry --HG-- branch : trunk --- src/server/game/Globals/ObjectMgr.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/server/game/Globals/ObjectMgr.cpp') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 139e3accdce..1388ab44748 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4709,13 +4709,13 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename) { if (!sSpellStore.LookupEntry(tmp.datalong)) { - sLog.outErrorDb("Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_REMOVE_AURA or SCRIPT_COMMAND_CAST_SPELL for script id %u", + sLog.outErrorDb("Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u", tablename,tmp.datalong,tmp.id); continue; } if (tmp.datalong2 & ~0x1) // 1 bits (0,1) { - sLog.outErrorDb("Table `%s` using unknown flags in datalong2 (%u)i n SCRIPT_COMMAND_CAST_SPELL for script id %u", + sLog.outErrorDb("Table `%s` using unknown flags in datalong2 (%u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u", tablename,tmp.datalong2,tmp.id); continue; } @@ -4725,16 +4725,22 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename) { if (!sSpellStore.LookupEntry(tmp.datalong)) { - sLog.outErrorDb("Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_REMOVE_AURA or SCRIPT_COMMAND_CAST_SPELL for script id %u", + sLog.outErrorDb("Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_CAST_SPELL for script id %u", tablename,tmp.datalong,tmp.id); continue; } - if (tmp.datalong2 & ~0x3) // 2 bits + if (tmp.datalong2 > 4) // targeting type { - sLog.outErrorDb("Table `%s` using unknown flags in datalong2 (%u)i n SCRIPT_COMMAND_CAST_SPELL for script id %u", + sLog.outErrorDb("Table `%s` using unknown target in datalong2 (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u", tablename,tmp.datalong2,tmp.id); continue; } + if (tmp.dataint & ~0x1) // 1 bit (0,1) + { + sLog.outErrorDb("Table `%s` using unknown flags in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u", + tablename,tmp.dataint,tmp.id); + continue; + } break; } -- cgit v1.2.3