aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/base/world_database.sql48
-rw-r--r--sql/updates/world/2011_02_20_1_world_smart_scripts.sql24
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp18
3 files changed, 57 insertions, 33 deletions
diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql
index f9689f9a1d8..9aa2cc087b3 100644
--- a/sql/base/world_database.sql
+++ b/sql/base/world_database.sql
@@ -16737,34 +16737,34 @@ DROP TABLE IF EXISTS `smart_scripts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `smart_scripts` (
- `entryorguid` mediumint(11) NOT NULL,
- `source_type` mediumint(5) unsigned NOT NULL DEFAULT '0',
- `id` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `link` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `event_type` mediumint(5) unsigned NOT NULL DEFAULT '0',
- `event_phase_mask` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `event_chance` mediumint(5) unsigned NOT NULL DEFAULT '100',
- `event_flags` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `event_param1` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `event_param2` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `event_param3` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `event_param4` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `action_type` mediumint(5) unsigned NOT NULL DEFAULT '0',
- `action_param1` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `action_param2` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `action_param3` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `action_param4` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `action_param5` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `action_param6` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `target_type` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `target_param1` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `target_param2` mediumint(11) unsigned NOT NULL DEFAULT '0',
- `target_param3` mediumint(11) unsigned NOT NULL DEFAULT '0',
+ `entryorguid` int(11) NOT NULL,
+ `source_type` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `id` smallint(5) unsigned NOT NULL DEFAULT '0',
+ `link` smallint(5) unsigned NOT NULL DEFAULT '0',
+ `event_type` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `event_phase_mask` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `event_chance` tinyint(3) unsigned NOT NULL DEFAULT '100',
+ `event_flags` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `event_param1` int(10) unsigned NOT NULL DEFAULT '0',
+ `event_param2` int(10) unsigned NOT NULL DEFAULT '0',
+ `event_param3` int(10) unsigned NOT NULL DEFAULT '0',
+ `event_param4` int(10) unsigned NOT NULL DEFAULT '0',
+ `action_type` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `action_param1` int(10) unsigned NOT NULL DEFAULT '0',
+ `action_param2` int(10) unsigned NOT NULL DEFAULT '0',
+ `action_param3` int(10) unsigned NOT NULL DEFAULT '0',
+ `action_param4` int(10) unsigned NOT NULL DEFAULT '0',
+ `action_param5` int(10) unsigned NOT NULL DEFAULT '0',
+ `action_param6` int(10) unsigned NOT NULL DEFAULT '0',
+ `target_type` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `target_param1` int(10) unsigned NOT NULL DEFAULT '0',
+ `target_param2` int(10) unsigned NOT NULL DEFAULT '0',
+ `target_param3` int(10) unsigned NOT NULL DEFAULT '0',
`target_x` float NOT NULL DEFAULT '0',
`target_y` float NOT NULL DEFAULT '0',
`target_z` float NOT NULL DEFAULT '0',
`target_o` float NOT NULL DEFAULT '0',
- `comment` varchar(255) NOT NULL DEFAULT '' COMMENT 'Event Comment',
+ `comment` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'Event Comment',
PRIMARY KEY (`entryorguid`,`source_type`,`id`,`link`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED;
/*!40101 SET character_set_client = @saved_cs_client */;
diff --git a/sql/updates/world/2011_02_20_1_world_smart_scripts.sql b/sql/updates/world/2011_02_20_1_world_smart_scripts.sql
new file mode 100644
index 00000000000..236c66cdb1e
--- /dev/null
+++ b/sql/updates/world/2011_02_20_1_world_smart_scripts.sql
@@ -0,0 +1,24 @@
+ALTER TABLE `smart_scripts` CHANGE `entryorguid` `entryorguid` INT(11) NOT NULL;
+ALTER TABLE `smart_scripts` MODIFY `source_type` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `id` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `link` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `event_type` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `event_phase_mask` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `event_chance` TINYINT(3) UNSIGNED NOT NULL DEFAULT 100;
+ALTER TABLE `smart_scripts` MODIFY `event_flags` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `event_param1` INT(10) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `event_param2` INT(10) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `event_param3` INT(10) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `event_param4` INT(10) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `action_type` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `action_param1` INT(10) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `action_param2` INT(10) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `action_param3` INT(10) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `action_param4` INT(10) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `action_param5` INT(10) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `action_param6` INT(10) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `target_type` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `target_param1` INT(10) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `target_param2` INT(10) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `target_param3` INT(10) UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `smart_scripts` MODIFY `comment` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'Event Comment';
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 1f4185ac01a..a25b52aa30b 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -118,7 +118,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
SmartScriptHolder temp;
temp.entryOrGuid = fields[0].GetInt32();
- SmartScriptType source_type = (SmartScriptType)fields[1].GetUInt32();
+ SmartScriptType source_type = (SmartScriptType)fields[1].GetUInt8();
if (source_type >= SMART_SCRIPT_TYPE_MAX)
{
sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: invalid source_type (%u), skipped loading.", uint32(source_type));
@@ -170,19 +170,19 @@ void SmartAIMgr::LoadSmartAIFromDB()
}
}
temp.source_type = source_type;
- temp.event_id = fields[2].GetUInt32();
- temp.link = fields[3].GetUInt32();
- temp.event.type = (SMART_EVENT)fields[4].GetUInt32();
- temp.event.event_phase_mask = fields[5].GetUInt32();
- temp.event.event_chance = fields[6].GetUInt32();
- temp.event.event_flags = fields[7].GetUInt32();
+ temp.event_id = fields[2].GetUInt16();
+ temp.link = fields[3].GetUInt16();
+ temp.event.type = (SMART_EVENT)fields[4].GetUInt8();
+ temp.event.event_phase_mask = fields[5].GetUInt8();
+ temp.event.event_chance = fields[6].GetUInt8();
+ temp.event.event_flags = fields[7].GetUInt8();
temp.event.raw.param1 = fields[8].GetUInt32();
temp.event.raw.param2 = fields[9].GetUInt32();
temp.event.raw.param3 = fields[10].GetUInt32();
temp.event.raw.param4 = fields[11].GetUInt32();
- temp.action.type = (SMART_ACTION)fields[12].GetUInt32();
+ temp.action.type = (SMART_ACTION)fields[12].GetUInt8();
temp.action.raw.param1 = fields[13].GetUInt32();
temp.action.raw.param2 = fields[14].GetUInt32();
@@ -191,7 +191,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
temp.action.raw.param5 = fields[17].GetUInt32();
temp.action.raw.param6 = fields[18].GetUInt32();
- temp.target.type = (SMARTAI_TARGETS)fields[19].GetUInt32();
+ temp.target.type = (SMARTAI_TARGETS)fields[19].GetUInt8();
temp.target.raw.param1 = fields[20].GetUInt32();
temp.target.raw.param2 = fields[21].GetUInt32();
temp.target.raw.param3 = fields[22].GetUInt32();