From 4e130dcdfdd30b84fb5e0b0531c817c7b6c64ff9 Mon Sep 17 00:00:00 2001 From: megamage Date: Mon, 8 Jun 2009 17:25:02 -0500 Subject: [7980] Implement item use target requirements store and check (new table `item_required_target`). Author: NoFantasy Signed-off-by: VladimirMangos * Also implement this table reload * Static Spell::SendCastResult function for call not from spell code. Can be also used in scripts where need send explicitly spell cast error to client. --HG-- branch : trunk --- sql/mangos.sql | 23 +++++++++++++++++++++- ...0_mangos_7980_01_world_item_required_target.sql | 9 +++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 sql/updates/3870_mangos_7980_01_world_item_required_target.sql (limited to 'sql') diff --git a/sql/mangos.sql b/sql/mangos.sql index 346495436d3..5ff29d24fb4 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`; CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, - `required_7945_01_mangos_quest_template` bit(1) default NULL + `required_7980_01_mangos_item_required_target` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -1658,6 +1658,27 @@ LOCK TABLES `item_loot_template` WRITE; /*!40000 ALTER TABLE `item_loot_template` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `item_required_target` +-- + +DROP TABLE IF EXISTS `item_required_target`; +CREATE TABLE `item_required_target` ( + `entry` mediumint(8) unsigned NOT NULL, + `type` tinyint(3) unsigned NOT NULL default '0', + `targetEntry` mediumint(8) unsigned NOT NULL default '0', + UNIQUE KEY `entry_type_target` (`entry`,`type`,`targetEntry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED + +-- +-- Dumping data for table `item_required_target` +-- + +LOCK TABLES `item_required_target` WRITE; +/*!40000 ALTER TABLE `item_required_target` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_required_target` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `item_template` -- diff --git a/sql/updates/3870_mangos_7980_01_world_item_required_target.sql b/sql/updates/3870_mangos_7980_01_world_item_required_target.sql new file mode 100644 index 00000000000..99ff65a5357 --- /dev/null +++ b/sql/updates/3870_mangos_7980_01_world_item_required_target.sql @@ -0,0 +1,9 @@ +-- ALTER TABLE db_version CHANGE COLUMN required_7945_01_mangos_quest_template required_7980_01_mangos_item_required_target bit; + +DROP TABLE IF EXISTS `item_required_target`; +CREATE TABLE `item_required_target` ( + `entry` mediumint(8) unsigned NOT NULL, + `type` tinyint(3) unsigned NOT NULL default '0', + `targetEntry` mediumint(8) unsigned NOT NULL default '0', + UNIQUE KEY `entry_type_target` (`entry`,`type`,`targetEntry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED -- cgit v1.2.3 From 30adb32d53ec268f71819edbc17fa09a7de5884c Mon Sep 17 00:00:00 2001 From: megamage Date: Mon, 8 Jun 2009 18:15:25 -0500 Subject: *Fix a typo in last rev. By Drahy. --HG-- branch : trunk --- sql/updates/3870_mangos_7980_01_world_item_required_target.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/updates/3870_mangos_7980_01_world_item_required_target.sql b/sql/updates/3870_mangos_7980_01_world_item_required_target.sql index 99ff65a5357..7853e496a2d 100644 --- a/sql/updates/3870_mangos_7980_01_world_item_required_target.sql +++ b/sql/updates/3870_mangos_7980_01_world_item_required_target.sql @@ -6,4 +6,4 @@ CREATE TABLE `item_required_target` ( `type` tinyint(3) unsigned NOT NULL default '0', `targetEntry` mediumint(8) unsigned NOT NULL default '0', UNIQUE KEY `entry_type_target` (`entry`,`type`,`targetEntry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED; -- cgit v1.2.3 From 4a662071aa6902c9a6790c8d485b66040ae979a2 Mon Sep 17 00:00:00 2001 From: megamage Date: Mon, 8 Jun 2009 23:44:53 -0500 Subject: *Fix dk quest until 12727. Some scripts are needed for quest 12727. --HG-- branch : trunk --- sql/updates/3873_world_spell_(dk).sql | 25 ++++++++++++++++++++ sql/world_spell_full.sql | 27 ++++++++++++++++++++++ .../eastern_plaguelands/the_scarlet_enclave.cpp | 3 +++ 3 files changed, 55 insertions(+) create mode 100644 sql/updates/3873_world_spell_(dk).sql (limited to 'sql') diff --git a/sql/updates/3873_world_spell_(dk).sql b/sql/updates/3873_world_spell_(dk).sql new file mode 100644 index 00000000000..09d130a4f6b --- /dev/null +++ b/sql/updates/3873_world_spell_(dk).sql @@ -0,0 +1,25 @@ + +replace into creature_questrelation (id,quest) VALUES (28377,12701); +replace into creature_involvedrelation (id,quest) VALUES (28377,12701); +replace into creature_involvedrelation (id,quest) VALUES (28914,12723); +replace into creature_questrelation (id,quest) VALUES (28914,12724); +replace into creature_involvedrelation (id,quest) VALUES (28914,12724); +replace into creature_questrelation (id,quest) VALUES (28913,12725); +replace into creature_involvedrelation (id,quest) VALUES (28912,12725); +replace into creature_questrelation (id,quest) VALUES (28912,12727); +replace into creature_involvedrelation (id,quest) VALUES (28913,12727); + + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (28833,28887); +INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `quest_id`, `quest_status`, `cast_flags`) VALUES +(28833, 52447, 12701, 3, 3), +(28887, 52447, 12701, 3, 3); + +UPDATE creature_template SET spell1=52435,spell2=52576,spell5=52588,VehicleId=68,speed=0 WHERE entry IN (28833,28887); +UPDATE creature_template SET spell1=52211 WHERE entry=28864; + +DELETE FROM `spell_script_target` WHERE entry IN +(52576); +INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES +(52576,1,28834), +(52576,1,28886); diff --git a/sql/world_spell_full.sql b/sql/world_spell_full.sql index 54577ff975e..602be1dd526 100644 --- a/sql/world_spell_full.sql +++ b/sql/world_spell_full.sql @@ -1623,6 +1623,33 @@ INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES (52479,1,28819), (52479,1,28822); + +replace into creature_questrelation (id,quest) VALUES (28377,12701); +replace into creature_involvedrelation (id,quest) VALUES (28377,12701); +replace into creature_involvedrelation (id,quest) VALUES (28914,12723); +replace into creature_questrelation (id,quest) VALUES (28914,12724); +replace into creature_involvedrelation (id,quest) VALUES (28914,12724); +replace into creature_questrelation (id,quest) VALUES (28913,12725); +replace into creature_involvedrelation (id,quest) VALUES (28912,12725); +replace into creature_questrelation (id,quest) VALUES (28912,12727); +replace into creature_involvedrelation (id,quest) VALUES (28913,12727); + +-- ship cannon +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (28833,28887); +INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `quest_id`, `quest_status`, `cast_flags`) VALUES +(28833, 52447, 12701, 3, 3), +(28887, 52447, 12701, 3, 3); + +UPDATE creature_template SET spell1=52435,spell2=52576,spell5=52588,VehicleId=68,speed=0 WHERE entry IN (28833,28887); +UPDATE creature_template SET spell1=52211 WHERE entry=28864; + +DELETE FROM `spell_script_target` WHERE entry IN +(52576); +INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES +(52576,1,28834), +(52576,1,28886); + + -- frostbrood vanquisher update creature_template set maxhealth = 133525, minhealth = 133525, maxmana = 51360, minmana = 51360, spell1 = 53114, spell2 = 53112, spell3=53110, VehicleId = 156 where entry = 28670; diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp index 560d9196d95..4790bf1f97d 100644 --- a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp +++ b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp @@ -598,6 +598,7 @@ CreatureAI* GetAI_npc_ros_dark_rider(Creature *_Creature) return new npc_ros_dark_riderAI(_Creature); } +// correct way: 52312 52314 52555 ... struct TRINITY_DLL_DECL npc_dkc1_gothikAI : public ScriptedAI { npc_dkc1_gothikAI(Creature *c) : ScriptedAI(c) {} @@ -628,6 +629,8 @@ CreatureAI* GetAI_npc_dkc1_gothik(Creature *_Creature) return new npc_dkc1_gothikAI(_Creature); } +// npc 28912 quest 17217 boss 29001 go 191092 + void AddSC_the_scarlet_enclave() { Script *newscript; -- cgit v1.2.3 From c5232138f870a8a4e5a59ecb3e0a3228373f58e2 Mon Sep 17 00:00:00 2001 From: QAston Date: Tue, 9 Jun 2009 21:48:02 +0200 Subject: *Spell_script_target entry for Death pact. --HG-- branch : trunk --- sql/updates/3877_world_spell_script_target.sql | 3 +++ sql/world_spell_full.sql | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 sql/updates/3877_world_spell_script_target.sql (limited to 'sql') diff --git a/sql/updates/3877_world_spell_script_target.sql b/sql/updates/3877_world_spell_script_target.sql new file mode 100644 index 00000000000..9778be52466 --- /dev/null +++ b/sql/updates/3877_world_spell_script_target.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_target` WHERE `entry` IN (48743); +INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES +('48743', '1', '26125'); \ No newline at end of file diff --git a/sql/world_spell_full.sql b/sql/world_spell_full.sql index 602be1dd526..fb2c9a8b04a 100644 --- a/sql/world_spell_full.sql +++ b/sql/world_spell_full.sql @@ -1590,7 +1590,8 @@ INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES (51859, 1, 28525), -- siphon of archerus (51859, 1, 28542), (51859, 1, 28543), -(51859, 1, 28544); +(51859, 1, 28544), +(48743, 1, 26125); -- Death pact update creature_template set minlevel=50,maxlevel=52,minhealth=2215,maxhealth=2317,faction_A=2084,faction_H=2084,mindmg=50,maxdmg=50 where entry=28528; -- ghoul -- cgit v1.2.3