root/trunk/sql/updates/117_trinityscript.sql @ 109

Revision 109, 4.9 kB (checked in by yumileroy, 17 years ago)

[svn] Update trinityscript to SD2 rev 700. Source: scriptdev2. Patch provided by SLG.

Original author: megamage
Date: 2008-10-25 11:40:10-05:00

Line 
1--
2-- NOTE: If you have temporary stored data in table `eventai_localized_texts` make sure to make backup of this before running this update!
3-- NOTE: If you have any texts in current eventai_texts and they are not using entries valid for *_texts table, you _will_ get error messages on startup.
4-- NOTE: Do not run this update twice, it may create bad data if you choose to do so.
5--
6
7-- drop obsolete table
8DROP TABLE eventai_localized_texts;
9
10-- alter and add fields in table `eventai_texts`
11ALTER TABLE eventai_texts CHANGE COLUMN `id` `entry` mediumint(8) NOT NULL;
12ALTER TABLE eventai_texts CHANGE COLUMN `text` `content_default` text NOT NULL AFTER `entry`;
13ALTER TABLE eventai_texts ADD COLUMN `content_loc1` text AFTER `content_default`;
14ALTER TABLE eventai_texts ADD COLUMN `content_loc2` text AFTER `content_loc1`;
15ALTER TABLE eventai_texts ADD COLUMN `content_loc3` text AFTER `content_loc2`;
16ALTER TABLE eventai_texts ADD COLUMN `content_loc4` text AFTER `content_loc3`;
17ALTER TABLE eventai_texts ADD COLUMN `content_loc5` text AFTER `content_loc4`;
18ALTER TABLE eventai_texts ADD COLUMN `content_loc6` text AFTER `content_loc5`;
19ALTER TABLE eventai_texts ADD COLUMN `content_loc7` text AFTER `content_loc6`;
20ALTER TABLE eventai_texts ADD COLUMN `content_loc8` text AFTER `content_loc7`;
21ALTER TABLE eventai_texts ADD COLUMN `sound` mediumint(8) unsigned NOT NULL default '0' AFTER `content_loc8`;
22ALTER TABLE eventai_texts ADD COLUMN `type` tinyint unsigned NOT NULL default '0' AFTER `sound`;
23ALTER TABLE eventai_texts ADD COLUMN `language` tinyint unsigned NOT NULL default '0' AFTER `type`;
24ALTER TABLE eventai_texts MODIFY COLUMN `comment` text;
25
26-- get our current action type, and update text type = yell
27UPDATE eventai_texts,eventai_scripts SET eventai_texts.type=1 WHERE eventai_scripts.action1_type IN (2,7) AND eventai_scripts.action1_param1=eventai_texts.entry;
28UPDATE eventai_texts,eventai_scripts SET eventai_texts.type=1 WHERE eventai_scripts.action2_type IN (2,7) AND eventai_scripts.action2_param1=eventai_texts.entry;
29UPDATE eventai_texts,eventai_scripts SET eventai_texts.type=1 WHERE eventai_scripts.action3_type IN (2,7) AND eventai_scripts.action3_param1=eventai_texts.entry;
30-- get our current action type, and update text type = textemote
31UPDATE eventai_texts,eventai_scripts SET eventai_texts.type=2 WHERE eventai_scripts.action1_type IN (3,8) AND eventai_scripts.action1_param1=eventai_texts.entry;
32UPDATE eventai_texts,eventai_scripts SET eventai_texts.type=2 WHERE eventai_scripts.action2_type IN (3,8) AND eventai_scripts.action2_param1=eventai_texts.entry;
33UPDATE eventai_texts,eventai_scripts SET eventai_texts.type=2 WHERE eventai_scripts.action3_type IN (3,8) AND eventai_scripts.action3_param1=eventai_texts.entry;
34
35-- update our scripts, for all action type 2, 3, 6, 7 & 8 to become 1
36UPDATE eventai_scripts SET action1_type=1 WHERE action1_type IN (2,3,6,7,8);
37UPDATE eventai_scripts SET action2_type=1 WHERE action2_type IN (2,3,6,7,8);
38UPDATE eventai_scripts SET action3_type=1 WHERE action3_type IN (2,3,6,7,8);
39
40-- was OOC, so at least one could be -1, set this to 0 (dev note: below will be bad, if run twice)
41UPDATE eventai_scripts SET action1_param2=0 WHERE action1_type=1 AND action1_param2=-1;
42UPDATE eventai_scripts SET action1_param3=0 WHERE action1_type=1 AND action1_param3=-1;
43UPDATE eventai_scripts SET action2_param2=0 WHERE action2_type=1 AND action2_param2=-1;
44UPDATE eventai_scripts SET action2_param3=0 WHERE action2_type=1 AND action2_param3=-1;
45UPDATE eventai_scripts SET action3_param2=0 WHERE action3_type=1 AND action3_param2=-1;
46UPDATE eventai_scripts SET action3_param3=0 WHERE action3_type=1 AND action3_param3=-1;
47
48-- expect all to be action type 1 now, continue convert to negative text entry
49UPDATE eventai_scripts SET action1_param1=(`action1_param1`) *-1 WHERE action1_type=1 AND action1_param1>0;
50UPDATE eventai_scripts SET action2_param1=(`action2_param1`) *-1 WHERE action2_type=1 AND action2_param1>0;
51UPDATE eventai_scripts SET action3_param1=(`action3_param1`) *-1 WHERE action3_type=1 AND action3_param1>0;
52
53UPDATE eventai_scripts SET action1_param2=(`action1_param2`) *-1 WHERE action1_type=1 AND action1_param2>0;
54UPDATE eventai_scripts SET action2_param2=(`action2_param2`) *-1 WHERE action2_type=1 AND action2_param2>0;
55UPDATE eventai_scripts SET action3_param2=(`action3_param2`) *-1 WHERE action3_type=1 AND action3_param2>0;
56
57UPDATE eventai_scripts SET action1_param3=(`action1_param3`) *-1 WHERE action1_type=1 AND action1_param3>0;
58UPDATE eventai_scripts SET action2_param3=(`action2_param3`) *-1 WHERE action2_type=1 AND action2_param3>0;
59UPDATE eventai_scripts SET action3_param3=(`action3_param3`) *-1 WHERE action3_type=1 AND action3_param3>0;
60
61-- now we have negative numbers in script, must make sure text entries have same entry as script
62UPDATE eventai_texts SET entry=(`entry`) *-1 WHERE entry>0;
63
64ALTER TABLE script_texts MODIFY COLUMN `sound` mediumint(8) unsigned NOT NULL default '0';
Note: See TracBrowser for help on using the browser.