aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2014_05_08_00_world_smart_scripts.sql2
-rw-r--r--sql/updates/world/2014_05_09_01_world_gossip.sql15
-rw-r--r--sql/updates/world/2014_05_09_02_world_creature_template.sql1
-rw-r--r--src/server/scripts/EasternKingdoms/zone_duskwood.cpp56
4 files changed, 47 insertions, 27 deletions
diff --git a/sql/updates/world/2014_05_08_00_world_smart_scripts.sql b/sql/updates/world/2014_05_08_00_world_smart_scripts.sql
new file mode 100644
index 00000000000..ebf971d512d
--- /dev/null
+++ b/sql/updates/world/2014_05_08_00_world_smart_scripts.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `smart_scripts` SET `target_type`=1 WHERE `entryorguid`=28256 AND `source_type`=0;
diff --git a/sql/updates/world/2014_05_09_01_world_gossip.sql b/sql/updates/world/2014_05_09_01_world_gossip.sql
new file mode 100644
index 00000000000..7e2a1b040fc
--- /dev/null
+++ b/sql/updates/world/2014_05_09_01_world_gossip.sql
@@ -0,0 +1,15 @@
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (10026,10025,10024);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(15, 10026, 0, 0, 0, 8, 0, 13419, 0, 0, 0, 0, 0, '', 'Sky-Reaver Klum - Show Gossip if player Has rewarded Quest Preparations for War'),
+(15, 10026, 1, 0, 0, 28, 0, 13419, 0, 0, 0, 0, 0, '', 'Sky-Reaver Klum - Show Gossip if player Has completed Quest Preparations for War'),
+(15, 10025, 0, 0, 0, 8, 0, 13418, 0, 0, 0, 0, 0, '', 'Officer Van Rossem - Show Gossip if player Has rewarded Quest Preparations for War'),
+(15, 10025, 1, 0, 0, 28, 0, 13418, 0, 0, 0, 0, 0, '', 'Officer Van Rossem - Show Gossip if player Has completed Quest Preparations for War'),
+(15, 10024, 0, 0, 0, 8, 0, 12521, 0, 0, 0, 0, 0, '', 'Archmage Pentarus - Show Gossip if player Has rewarded Quest Where in the World is Hemet Nesingwary?'),
+(15, 10024, 1, 0, 0, 28, 0, 12521, 0, 0, 0, 0, 0, '', 'Archmage Pentarus - Show Gossip if player Has completed Quest Where in the World is Hemet Nesingwary?');
+
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (10025,10024) AND `id` IN (0,1);
+INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES
+(10025, 0, 0, 'Take me to the ship.', 31625, 1, 1, 0, 0, 0, 0, '', 0),
+(10025, 1, 0, 'Take me to the ship.', 31625, 1, 1, 0, 0, 0, 0, '', 0),
+(10024, 0, 0, 'I''m ready to fly to Sholazar Basin.', 31594, 1, 1, 0, 0, 0, 0, '', 0),
+(10024, 1, 0, 'I''m ready to fly to Sholazar Basin.', 31594, 1, 1, 0, 0, 0, 0, '', 0);
diff --git a/sql/updates/world/2014_05_09_02_world_creature_template.sql b/sql/updates/world/2014_05_09_02_world_creature_template.sql
new file mode 100644
index 00000000000..5520ca5d6f8
--- /dev/null
+++ b/sql/updates/world/2014_05_09_02_world_creature_template.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `faction`=14 WHERE `entry`=15625;
diff --git a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp
index 236455137dc..4eaf98d0a0e 100644
--- a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp
@@ -29,18 +29,19 @@ EndScriptData */
enum TwilightCorrupter
{
- ITEM_FRAGMENT = 21149,
NPC_TWILIGHT_CORRUPTER = 15625,
- YELL_TWILIGHTCORRUPTOR_RESPAWN = 0,
- YELL_TWILIGHTCORRUPTOR_AGGRO = 1,
- YELL_TWILIGHTCORRUPTOR_KILL = 2,
+ YELL_TWILIGHT_CORRUPTOR_RESPAWN = 0,
+ YELL_TWILIGHT_CORRUPTOR_AGGRO = 1,
+ YELL_TWILIGHT_CORRUPTOR_KILL = 2,
+
SPELL_SOUL_CORRUPTION = 25805,
SPELL_CREATURE_OF_NIGHTMARE = 25806,
SPELL_LEVEL_UP = 24312,
EVENT_SOUL_CORRUPTION = 1,
EVENT_CREATURE_OF_NIGHTMARE = 2,
- FACTION_HOSTILE = 14
+
+ QUEST_NIGHTMARES_CORRUPTION = 8735
};
/*######
@@ -58,12 +59,13 @@ public:
void Reset() override
{
- KillCount = 0;
+ _events.Reset();
+ KillCount = 0;
}
void EnterCombat(Unit* /*who*/) override
{
- Talk(YELL_TWILIGHTCORRUPTOR_AGGRO);
+ Talk(YELL_TWILIGHT_CORRUPTOR_AGGRO);
_events.ScheduleEvent(EVENT_SOUL_CORRUPTION, 15000);
_events.ScheduleEvent(EVENT_CREATURE_OF_NIGHTMARE, 30000);
}
@@ -73,7 +75,7 @@ public:
if (victim->GetTypeId() == TYPEID_PLAYER)
{
++KillCount;
- Talk(YELL_TWILIGHTCORRUPTOR_KILL, victim);
+ Talk(YELL_TWILIGHT_CORRUPTOR_KILL, victim);
if (KillCount == 3)
{
@@ -90,22 +92,27 @@ public:
_events.Update(diff);
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SOUL_CORRUPTION:
- DoCastVictim(SPELL_SOUL_CORRUPTION);
- _events.ScheduleEvent(EVENT_SOUL_CORRUPTION, rand()%4000+15000);
+ DoCastAOE(SPELL_SOUL_CORRUPTION);
+ _events.ScheduleEvent(EVENT_SOUL_CORRUPTION, urand(15000, 19000));
break;
case EVENT_CREATURE_OF_NIGHTMARE:
- DoCastVictim(SPELL_CREATURE_OF_NIGHTMARE);
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
+ DoCast(target, SPELL_CREATURE_OF_NIGHTMARE);
_events.ScheduleEvent(EVENT_CREATURE_OF_NIGHTMARE, 45000);
break;
default:
break;
}
}
+
DoMeleeAttackIfReady();
}
@@ -124,27 +131,22 @@ public:
# at_twilight_grove
######*/
+Position const TwillightCorrupter = { -10328.16f, -489.57f, 49.95f, 0.0f };
+
class at_twilight_grove : public AreaTriggerScript
{
-public:
- at_twilight_grove() : AreaTriggerScript("at_twilight_grove") { }
+ public:
+ at_twilight_grove() : AreaTriggerScript("at_twilight_grove") { }
- bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) override
- {
- if (player->HasQuestForItem(ITEM_FRAGMENT))
+ bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) override
{
- if (Unit* corrupter = player->SummonCreature(NPC_TWILIGHT_CORRUPTER, -10328.16f, -489.57f, 49.95f, 0, TEMPSUMMON_MANUAL_DESPAWN, 60000))
- corrupter->setFaction(FACTION_HOSTILE);
+ if (player->GetQuestStatus(QUEST_NIGHTMARES_CORRUPTION) == QUEST_STATUS_INCOMPLETE)
+ if (!player->FindNearestCreature(NPC_TWILIGHT_CORRUPTER, 500.0f, true))
+ if (Creature* corrupter = player->SummonCreature(NPC_TWILIGHT_CORRUPTER, TwillightCorrupter, TEMPSUMMON_MANUAL_DESPAWN, 60000))
+ corrupter->AI()->Talk(YELL_TWILIGHT_CORRUPTOR_RESPAWN, player);
- if (Creature* CorrupterSpeaker = player->SummonCreature(1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()-1, 0, TEMPSUMMON_TIMED_DESPAWN, 15000))
- {
- CorrupterSpeaker->SetName("Twilight Corrupter");
- CorrupterSpeaker->SetVisible(true);
- CorrupterSpeaker->AI()->Talk(YELL_TWILIGHTCORRUPTOR_RESPAWN, player);
- }
- }
- return false;
- };
+ return false;
+ };
};
void AddSC_duskwood()