DB/SAI: Convert quests 10987, 10107, 10108, 9918, 9849 from core scripts to SAI

Closes #1544
Closes #3055
Closes #3056
Closes #3058
Closes #3059
This commit is contained in:
Nay
2011-10-23 11:00:56 +01:00
parent 238e8e5ea1
commit 8e2440133e
2 changed files with 161 additions and 400 deletions

View File

@@ -0,0 +1,159 @@
-- Shattered Rumbler SAI
SET @ENTRY := 17157;
SET @ENTRY_MINION := 18181; -- Minion of Gurok
SET @SPELL_EARTH_RUMBLE := 33840; -- Earth Rumble
SET @SPELL_THROW_GORDAWGS_BULDER := 32001; -- Throw Gordawgs Boulder
UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`=''WHERE `entry`=@ENTRY;
DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,0,0,100,0,1000,1000,8000,9000,11,@SPELL_EARTH_RUMBLE,0,0,0,0,0,2,0,0,0,0,0,0,0,"Shattered Rumbler - In Combat - Cast Earth Rumble"),
(@ENTRY,0,1,0,8,0,100,1,@SPELL_THROW_GORDAWGS_BULDER,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Shattered Rumbler - On Spellhit - Run Script"),
(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,12,@ENTRY_MINION,4,20000,0,0,0,1,0,0,0,0,0,0,0,"Shattered Rumbler - Script - Summon Minion of Gurok"),
(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,12,@ENTRY_MINION,4,20000,0,0,0,1,0,0,0,0,0,0,0,"Shattered Rumbler - Script - Summon Minion of Gurok"),
(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,12,@ENTRY_MINION,4,20000,0,0,0,1,0,0,0,0,0,0,0,"Shattered Rumbler - Script - Summon Minion of Gurok"),
(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Shattered Rumbler - Script - Die");
-- Minion of Gurok SAI
SET @ENTRY := 18181;
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY;
DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,89,10,0,0,0,0,0,1,0,0,0,0,0,0,0,"Minion of Gurok - Out of Combat - Set Random Movement");
-- Spell Throw Gordawgs Boulder can only be cast at Shattered Rumbler
DELETE FROM `conditions` WHERE `SourceEntry`=24501 AND `ConditionValue2`=17157;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(18,0,24501,0,24,1,17157,0,0,'',"Item Gordawgs Boulder can only be used if target is Shattered Rumbler");
-- Lump SAI
SET @ENTRY := 18351;
SET @QUEST := 9918;
SET @GOSSIP := 21289;
SET @SPELL_SLEEPING_SLEEP := 42648; -- Sleeping Sleep
SET @SPELL_SHOULDER_CHARGE := 31994; -- Shoulder Charge
SET @SPELL_SPEAR_THROW := 32248; -- Spear Throw
UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='',`gossip_menu_id`=@GOSSIP+1,`faction_A`=1711,`faction_H`=1711,`unit_flags`=`unit_flags`|528 WHERE `entry`=@ENTRY;
DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY;
DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100);
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,11,@SPELL_SLEEPING_SLEEP,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lump - Out Of Combat - Cast Sleeping Sleep"),
(@ENTRY,0,1,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Lump - On Aggro - Say Line (random)"),
(@ENTRY,0,2,0,62,0,100,0,@GOSSIP+4,0,0,0,33,18354,0,0,0,0,0,7,0,0,0,0,0,0,0,"Lump - On Gossip Select - Give Quest Credit"),
(@ENTRY,0,3,0,2,0,100,1,0,30,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Lump - On 30% HP - Run Script"),
(@ENTRY*100,9,0,0,2,0,100,1,0,0,0,0,2,1080,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lump - On Script - Set Faction Friendly"),
(@ENTRY*100,9,1,0,2,0,100,1,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lump - On Script - Say Line 1"),
(@ENTRY*100,9,2,0,2,0,100,1,1000,1000,0,0,5,447,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lump - On Script - Emote ONESHOT_FLY_SIT_GROUND_DOWN"), -- He wont sit down, no matter which emote I use - probably due evading
(@ENTRY*100,9,3,0,2,0,100,1,0,0,0,0,20,9,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lump - On Script - Stop auto-attack"),
(@ENTRY*100,9,4,0,2,0,100,1,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lump - On Script - Evade"),
(@ENTRY*100,9,5,0,2,0,100,1,0,0,0,0,28,@SPELL_SLEEPING_SLEEP,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lump - On Script - Remove Aura Sleeping Sleep"), -- Prevent gaining it - were leaving combat!
(@ENTRY,0,4,0,9,0,100,0,8,25,1500,2000,11,@SPELL_SHOULDER_CHARGE,1,0,0,0,0,2,0,0,0,0,0,0,0,"Lump - On Player Range - Cast Shoulder Charge"),
(@ENTRY,0,5,0,9,0,100,0,5,40,1500,2000,11,@SPELL_SPEAR_THROW,1,0,0,0,0,2,0,0,0,0,0,0,0,"Lump - On Player Range - Cast Spear Throw");
-- Texts
DELETE FROM `creature_text` WHERE `entry`=@ENTRY;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(@ENTRY,0,0,"In Nagrand, food hunt ogre!",12,0,100,0,0,0,"Lump"),
(@ENTRY,0,1,"You taste good with maybe a little salt and pepper.",12,0,100,0,0,0,"Lump"),
(@ENTRY,1,2,"OK, OK! Lump give up!",12,0,100,0,0,0,"Lump");
-- Actual story menu
DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+1 AND `text_id`=9352;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+1,9352);
DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+2 AND `text_id`=9353;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+2,9353);
DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+3 AND `text_id`=9354;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+3,9354);
DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+4 AND `text_id`=9355;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+4,9355);
DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+5 AND `text_id`=9356;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+5,9356);
-- Insert option menu
DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN @GOSSIP+0 AND @GOSSIP+4;
INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES
(@GOSSIP+1,0,0,"I need answers, ogre!",1,1,@GOSSIP+2),
(@GOSSIP+2,1,0,"Why are the Boulderfist out this far? You know that this is Kurenai territory.",1,1,@GOSSIP+3),
(@GOSSIP+3,2,0,"And you think you can just eat anything you want? You're obviously trying to eat the Broken of Telaar.",1,1,@GOSSIP+4),
(@GOSSIP+4,3,0,"This means war, Lump! War I say!",1,1,@GOSSIP+5);
-- Only show first gossip if player is on quest Not On My Watch!
DELETE FROM `conditions` WHERE `SourceGroup`=@GOSSIP+1 AND `ConditionValue1`=@QUEST AND `SourceTypeOrReferenceId`=15;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,@GOSSIP+1,0,0,9,@QUEST,0,0,0,'',"Only show first gossip if player is on quest Not On My Watch!");
-- Wild Sparrowhawk SAI
SET @ENTRY := 22979;
SET @SPELL_SPARROWHAWK_NET := 39810; -- Sparrowhawk Net
UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='',`InhabitType`=4 WHERE `entry`=@ENTRY; -- Always in air
DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100);
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,8,0,100,1,@SPELL_SPARROWHAWK_NET,0,0,0,80,@ENTRY*100,0,2,0,0,0,1,0,0,0,0,0,0,0,"Wild Sparrowhawk - On Spellhit - Run Script"),
(@ENTRY,0,1,0,6,0,100,0,0,0,0,0,28,@SPELL_SPARROWHAWK_NET,2,0,0,0,0,1,0,0,0,0,0,0,0,"Wild Sparrowhawk - On Death - Remove Aura Sparrowhawk Net"),
(@ENTRY,0,2,0,6,0,100,0,0,0,0,0,41,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Wild Sparrowhawk - Force Despawn 8 Seconds After Death'),
(@ENTRY*100,9,0,0,0,0,100,0,1000,1000,0,0,25,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wild Sparrowhawk - On Script - Flee For Assist"), -- This is how it should work - there is no flee function in event_scripts, so can't do it blizzlike (event_scripts 39812)
(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,28,@SPELL_SPARROWHAWK_NET,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wild Sparrowhawk - On Script - Remove Aura Sparrowhawk Net"), -- Remove it and add it back later
(@ENTRY*100,9,2,0,0,0,100,0,11000,11000,0,0,56,32320,1,0,0,0,0,7,0,0,0,0,0,0,0,"Wild Sparrowhawk - On Script - Add Item Captured Sparrowhawk"),
(@ENTRY*100,9,3,0,0,0,100,0,11000,11000,0,0,37,0,1,0,0,0,0,1,0,0,0,0,0,0,0,"Wild Sparrowhawk - On Script - Die");
-- Spell Sparrowhawk Net can only be cast at Wild Sparrowhawk
DELETE FROM `conditions` WHERE `SourceEntry`=32321 AND `ConditionValue2`=22979 AND `SourceTypeOrReferenceId`=18;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(18,0,32321,0,24,1,22979,0,0,'',"Item Sparrowhawk Net can only be used if target is Wild Sparrowhawk");
-- [Q] Diplomatic Measures
SET @GOSSIP := 21295;
SET @QUEST_HORDE := 10107;
SET @QUEST_ALLIANCE := 10108;
-- Lantresor of the Blade SAI
SET @ENTRY := 18261;
SET @SPELL_BUNING_BLADE_BLADEMASTER := 32281; -- Burning Blade Blademaster
UPDATE `creature_template` SET `gossip_menu_id`=@GOSSIP+0,`AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,1,0,100,1,0,0,0,0,11,@SPELL_BUNING_BLADE_BLADEMASTER,0,0,0,0,0,1,0,0,0,0,0,0,0,"Lantrestor of the Blade - Out of Combat - Cast Burning Blade Blademaster"),
(@ENTRY,0,1,0,62,0,100,0,@GOSSIP+7,0,0,0,26,@QUEST_ALLIANCE,0,0,0,0,0,7,0,0,0,0,0,0,0,"Lantrestor of the Blade - On Gossip Select - Give Quest Credit"),
(@ENTRY,0,2,0,62,0,100,0,@GOSSIP+7,0,0,0,26,@QUEST_HORDE,0,0,0,0,0,7,0,0,0,0,0,0,0,"Lantrestor of the Blade - On Gossip Select - Give Quest Credit");
-- Make the npc_text entries work properly
DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+1 AND `text_id`=9362;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+1,9362);
DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+2 AND `text_id`=9363;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+2,9363);
DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+3 AND `text_id`=9364;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+3,9364);
DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+4 AND `text_id`=9365;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+4,9365);
DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+5 AND `text_id`=9366;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+5,9366);
DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+6 AND `text_id`=9367;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+6,9367);
DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+7 AND `text_id`=9368;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+7,9368);
DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP+8 AND `text_id`=9369;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP+8,9369);
-- Insert menu options
DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN @GOSSIP+0 AND @GOSSIP+7;
INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES
(@GOSSIP+0,0,0,"I have killed many of your ogres, Lantresor. I have no fear.",1,1,@GOSSIP+1),
(@GOSSIP+1,1,0,"Should I know? You look like an orc to me.",1,1,@GOSSIP+2),
(@GOSSIP+2,2,0,"And the other half?",1,1,@GOSSIP+3),
(@GOSSIP+3,3,0,"I have heard of your kind, but I never thought to see the day when I would meet a half-breed.",1,1,@GOSSIP+4),
(@GOSSIP+4,4,0,"My apologies. I did not mean to offend. I am here on behalf of my people.",1,1,@GOSSIP+5),
(@GOSSIP+5,5,0,"My people ask that you pull back your Boulderfist ogres and cease all attacks on our territories. In return, we will also pull back our forces.",1,1,@GOSSIP+6),
(@GOSSIP+6,6,0,"We will fight you until the end,then, Lantresor. We will not stand idly by as you pillage our towns and kill our people.",1,1,@GOSSIP+7),
(@GOSSIP+7,7,0,"What do I need to do?",1,1,@GOSSIP+8);
-- Conditions for gossip menu of quest Diplomatic Measures, they are grouped and thus ONE of them must be met in order for the gossip to become visible
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP+0;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,@GOSSIP+0,0,0,9,@QUEST_ALLIANCE,0,0,0,'',"Only show first gossip if player is on quest Diplomatic Measures (alliance)"),
(15,@GOSSIP+0,0,1,9,@QUEST_HORDE,0,0,0,'',"Only show first gossip if player is on quest Diplomatic Measures (horde)");

View File

@@ -19,229 +19,20 @@
/* ScriptData
SDName: Nagrand
SD%Complete: 90
SDComment: Quest support: 9849, 9868, 9918, 9874, 9991, 10107, 10108, 10044, 10172, 10646, 10085, 10987. TextId's unknown for altruis_the_sufferer and greatmother_geyah (npc_text)
SDComment: Quest support: 9868, 9874, 9991, 10044, 10172, 10646, 10085. TextId's unknown for altruis_the_sufferer and greatmother_geyah (npc_text)
SDCategory: Nagrand
EndScriptData */
/* ContentData
mob_shattered_rumbler
mob_lump
npc_altruis_the_sufferer
npc_greatmother_geyah
npc_lantresor_of_the_blade
npc_maghar_captive
npc_creditmarker_visit_with_ancestors
mob_sparrowhawk
EndContentData */
#include "ScriptPCH.h"
#include "ScriptedEscortAI.h"
/*######
## mob_shattered_rumbler - this should be done with ACID
######*/
class mob_shattered_rumbler : public CreatureScript
{
public:
mob_shattered_rumbler() : CreatureScript("mob_shattered_rumbler") { }
CreatureAI* GetAI(Creature* creature) const
{
return new mob_shattered_rumblerAI (creature);
}
struct mob_shattered_rumblerAI : public ScriptedAI
{
bool Spawn;
mob_shattered_rumblerAI(Creature* c) : ScriptedAI(c) {}
void Reset()
{
Spawn = false;
}
void EnterCombat(Unit* /*who*/) {}
void SpellHit(Unit* Hitter, const SpellInfo* Spellkind)
{
if (Spellkind->Id == 32001 && !Spawn)
{
float x = me->GetPositionX();
float y = me->GetPositionY();
float z = me->GetPositionZ();
Hitter->SummonCreature(18181, x+(0.7f * (rand()%30)), y+(rand()%5), z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
Hitter->SummonCreature(18181, x+(rand()%5), y-(rand()%5), z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
Hitter->SummonCreature(18181, x-(rand()%5), y+(0.5f *(rand()%60)), z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
me->setDeathState(CORPSE);
Spawn = true;
}
return;
}
};
};
/*######
## mob_lump
######*/
#define SPELL_VISUAL_SLEEP 16093
#define SPELL_SPEAR_THROW 32248
#define LUMP_SAY0 -1000190
#define LUMP_SAY1 -1000191
#define LUMP_DEFEAT -1000192
#define GOSSIP_HL "I need answers, ogre!"
#define GOSSIP_SL1 "Why are Boulderfist out this far? You know that this is Kurenai territory."
#define GOSSIP_SL2 "And you think you can just eat anything you want? You're obviously trying to eat the Broken of Telaar."
#define GOSSIP_SL3 "This means war, Lump! War I say!"
class mob_lump : public CreatureScript
{
public:
mob_lump() : CreatureScript("mob_lump") { }
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
{
player->PlayerTalkClass->ClearMenus();
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->SEND_GOSSIP_MENU(9353, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+1:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
player->SEND_GOSSIP_MENU(9354, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
player->SEND_GOSSIP_MENU(9355, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
player->SEND_GOSSIP_MENU(9356, creature->GetGUID());
player->TalkedToCreature(18354, creature->GetGUID());
break;
}
return true;
}
bool OnGossipHello(Player* player, Creature* creature)
{
if (player->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(9352, creature->GetGUID());
return true;
}
CreatureAI* GetAI(Creature* creature) const
{
return new mob_lumpAI(creature);
}
struct mob_lumpAI : public ScriptedAI
{
mob_lumpAI(Creature* c) : ScriptedAI(c)
{
bReset = false;
}
uint32 Reset_Timer;
uint32 Spear_Throw_Timer;
bool bReset;
void Reset()
{
Reset_Timer = 60000;
Spear_Throw_Timer = 2000;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
void AttackedBy(Unit* pAttacker)
{
if (me->getVictim())
return;
if (me->IsFriendlyTo(pAttacker))
return;
AttackStart(pAttacker);
}
void DamageTaken(Unit* done_by, uint32 & damage)
{
if (done_by->GetTypeId() == TYPEID_PLAYER && me->HealthBelowPctDamaged(30, damage))
{
if (!bReset && CAST_PLR(done_by)->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE)
{
//Take 0 damage
damage = 0;
CAST_PLR(done_by)->AttackStop();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveAllAuras();
me->DeleteThreatList();
me->CombatStop(true);
me->setFaction(1080); //friendly
me->SetStandState(UNIT_STAND_STATE_SIT);
DoScriptText(LUMP_DEFEAT, me);
bReset = true;
}
}
}
void EnterCombat(Unit* /*who*/)
{
if (me->HasAura(SPELL_VISUAL_SLEEP))
me->RemoveAura(SPELL_VISUAL_SLEEP);
if (!me->IsStandState())
me->SetStandState(UNIT_STAND_STATE_STAND);
DoScriptText(RAND(LUMP_SAY0, LUMP_SAY1), me);
}
void UpdateAI(const uint32 diff)
{
//check if we waiting for a reset
if (bReset)
{
if (Reset_Timer <= diff)
{
EnterEvadeMode();
bReset = false;
me->setFaction(1711); //hostile
return;
}
else Reset_Timer -= diff;
}
//Return since we have no target
if (!UpdateVictim())
return;
//Spear_Throw_Timer
if (Spear_Throw_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SPEAR_THROW);
Spear_Throw_Timer = 20000;
} else Spear_Throw_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
/*######
## npc_altruis_the_sufferer
######*/
@@ -453,83 +244,6 @@ public:
};
/*######
## npc_lantresor_of_the_blade
######*/
#define GOSSIP_HLB "I have killed many of your ogres, Lantresor. I have no fear."
#define GOSSIP_SLB1 "Should I know? You look like an orc to me."
#define GOSSIP_SLB2 "And the other half?"
#define GOSSIP_SLB3 "I have heard of your kind, but I never thought to see the day when I would meet a half-breed."
#define GOSSIP_SLB4 "My apologies. I did not mean to offend. I am here on behalf of my people."
#define GOSSIP_SLB5 "My people ask that you pull back your Boulderfist ogres and cease all attacks on our territories. In return, we will also pull back our forces."
#define GOSSIP_SLB6 "We will fight you until the end, then, Lantresor. We will not stand idly by as you pillage our towns and kill our people."
#define GOSSIP_SLB7 "What do I need to do?"
class npc_lantresor_of_the_blade : public CreatureScript
{
public:
npc_lantresor_of_the_blade() : CreatureScript("npc_lantresor_of_the_blade") { }
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
{
player->PlayerTalkClass->ClearMenus();
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->SEND_GOSSIP_MENU(9362, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+1:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
player->SEND_GOSSIP_MENU(9363, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
player->SEND_GOSSIP_MENU(9364, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
player->SEND_GOSSIP_MENU(9365, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+4:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
player->SEND_GOSSIP_MENU(9366, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+5:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
player->SEND_GOSSIP_MENU(9367, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+6:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SLB7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
player->SEND_GOSSIP_MENU(9368, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+7:
player->SEND_GOSSIP_MENU(9369, creature->GetGUID());
if (player->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE)
player->AreaExploredOrEventHappens(10107);
if (player->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE)
player->AreaExploredOrEventHappens(10108);
break;
}
return true;
}
bool OnGossipHello(Player* player, Creature* creature)
{
if (creature->isQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if (player->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HLB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(9361, creature->GetGUID());
return true;
}
};
/*#####
## npc_maghar_captive
#####*/
@@ -747,113 +461,9 @@ public:
};
/*######
## mob_sparrowhawk
## go_corkis_prison and npc_corki
######*/
#define SPELL_SPARROWHAWK_NET 39810
#define SPELL_ITEM_CAPTIVE_SPARROWHAWK 39812
class mob_sparrowhawk : public CreatureScript
{
public:
mob_sparrowhawk() : CreatureScript("mob_sparrowhawk") { }
CreatureAI* GetAI(Creature* creature) const
{
return new mob_sparrowhawkAI (creature);
}
struct mob_sparrowhawkAI : public ScriptedAI
{
mob_sparrowhawkAI(Creature* c) : ScriptedAI(c) {}
uint32 Check_Timer;
uint64 PlayerGUID;
bool fleeing;
void Reset()
{
me->RemoveAurasDueToSpell(SPELL_SPARROWHAWK_NET);
Check_Timer = 1000;
PlayerGUID = 0;
fleeing = false;
}
void AttackStart(Unit* who)
{
if (PlayerGUID)
return;
ScriptedAI::AttackStart(who);
}
void EnterCombat(Unit* /*who*/) {}
void MoveInLineOfSight(Unit* who)
{
if (!who || PlayerGUID)
return;
if (!PlayerGUID && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 30) && CAST_PLR(who)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE)
{
PlayerGUID = who->GetGUID();
return;
}
ScriptedAI::MoveInLineOfSight(who);
}
void UpdateAI(const uint32 diff)
{
if (Check_Timer <= diff)
{
if (PlayerGUID)
{
if (fleeing && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLEEING_MOTION_TYPE)
fleeing = false;
Player* player = Unit::GetPlayer(*me, PlayerGUID);
if (player && me->IsWithinDistInMap(player, 30))
{
if (!fleeing)
{
me->DeleteThreatList();
me->GetMotionMaster()->MoveFleeing(player);
fleeing = true;
}
}
else if (fleeing)
{
me->GetMotionMaster()->MovementExpired(false);
PlayerGUID = 0;
fleeing = false;
}
}
Check_Timer = 1000;
} else Check_Timer -= diff;
if (PlayerGUID)
return;
ScriptedAI::UpdateAI(diff);
}
void SpellHit(Unit* caster, const SpellInfo* spell)
{
if (caster->GetTypeId() == TYPEID_PLAYER)
{
if (spell->Id == SPELL_SPARROWHAWK_NET && CAST_PLR(caster)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE)
{
DoCast(caster, SPELL_ITEM_CAPTIVE_SPARROWHAWK, true);
me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
}
return;
}
};
};
enum CorkiData
{
// first quest
@@ -916,10 +526,6 @@ public:
}
};
/*######
## npc_corki
######*/
class npc_corki : public CreatureScript
{
public:
@@ -1200,14 +806,10 @@ public:
void AddSC_nagrand()
{
new mob_shattered_rumbler();
new mob_lump();
new npc_altruis_the_sufferer();
new npc_greatmother_geyah();
new npc_lantresor_of_the_blade();
new npc_maghar_captive();
new npc_creditmarker_visit_with_ancestors();
new mob_sparrowhawk();
new npc_corki();
new go_corkis_prison();
new npc_kurenai_captive();