Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

Conflicts:
	src/server/game/Globals/ObjectMgr.cpp
This commit is contained in:
Vincent-Michael
2013-08-20 17:48:18 +02:00
15 changed files with 276 additions and 277 deletions
@@ -0,0 +1,17 @@
DELETE FROM `creature_text` WHERE `entry` IN (27986, 28047, 28568);
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
(27986, 0, 0, 'Aye, I''ll try it.', 12, 0, 100, 273, 0, 0, 'Hemet Nesingwary'),
(27986, 1, 0, 'That''s exactly what I needed!', 12, 0, 100, 5, 0, 0, 'Hemet Nesingwary'),
(27986, 2, 0, 'It''s got my vote! That''ll put hair on your chest like nothing else will.', 12, 0, 100, 1, 0, 0, 'Hemet Nesingwary'),
(27986, 3, 0, 'What a fight you missed, Dorian! It was one for the ages!', 12, 0, 100, 5, 0, 0, 'Hemet Nesingwary'),
(27986, 4, 0, 'There we were, riding into battle at full speed on the back of Stampy...', 12, 0, 100, 5, 0, 0, 'Hemet Nesingwary'),
(27986, 5, 0, 'Well, lad, you can start by readin'' The Green Hills of Stranglethorn. Then, maybe you can join me on one of my safaris. What do you say?', 12, 0, 100, 0, 0, 0, 'Hemet Nesingwary'),
(28047, 0, 0, 'I''m always up for something of Grimbooze''s.', 12, 0, 100, 273, 0, 0, 'Hadrius Harlowe'),
(28047, 1, 0, 'Well, so far, it tastes like something my wife would drink...', 12, 0, 100, 5, 0, 0, 'Hadrius Harlowe'),
(28047, 2, 0, 'Now, there''s the kick I''ve come to expect from Grimbooze''s drinks! I like it!', 12, 0, 100, 5, 0, 0, 'Hadrius Harlowe'),
(28568, 0, 0, 'Sure!', 12, 0, 100, 273, 0, 0, 'Tamara Wobblesprocket'),
(28568, 1, 0, 'Oh my...', 12, 0, 100, 0, 0, 0, 'Tamara Wobblesprocket'),
(28568, 2, 0, 'Tastes like I''m drinking... engine degreaser!', 12, 0, 100, 1, 0, 0, 'Tamara Wobblesprocket');
@@ -0,0 +1,74 @@
-- To Rule The Skies (23061) & Onyx Scales
SET @OBSIDIA := 23282;
SET @RIVENDARK := 23061;
SET @FURYWING := 23261;
SET @INSIDION := 23281;
SET @APEXIS_SHARD := 32569;
SET @OBSIDIA_EGG := 185932;
SET @FURYWING_EGG := 185937;
SET @INSIDION_EGG := 185938;
SET @RIVENDARK_EGG := 185936;
UPDATE `creature_template` SET `InhabitType`=7, `AIName`= 'SmartAI' WHERE `entry` IN (@OBSIDIA,@RIVENDARK,@FURYWING,@INSIDION);
UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry` IN (@OBSIDIA_EGG,@FURYWING_EGG,@INSIDION_EGG,@RIVENDARK_EGG);
UPDATE `creature_template_addon` SET `bytes1`=33554432 WHERE `entry` IN (@OBSIDIA,@RIVENDARK,@FURYWING,@INSIDION);
DELETE FROM `smart_scripts` WHERE `entryorguid`=@OBSIDIA_EGG AND `source_type`=1;
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
(@OBSIDIA_EGG,1,0,1,62,0,100,0,8685,0,0,0,57,@APEXIS_SHARD,35,0,0,0,0,7,0,0,0,0,0,0,0,'On gossip select -Remove Item - Player'),
(@OBSIDIA_EGG,1,1,2,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'On gossip select - Link - Close gossip'),
(@OBSIDIA_EGG,1,2,0,61,0,100,0,0,0,0,0,12,@OBSIDIA,6,30000,0,0,0,8,0,0,0,2421.336, 6968.062, 391.037,0,'On Script - Summon Obsidia - Location');
DELETE FROM `smart_scripts` WHERE `entryorguid`=@FURYWING_EGG AND `source_type`=1;
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
(@FURYWING_EGG,1,0,1,62,0,100,0,8690,0,0,0,57,@APEXIS_SHARD,35,0,0,0,0,7,0,0,0,0,0,0,0,'On gossip select - Remove Item - Player'),
(@FURYWING_EGG,1,1,2,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'On gossip select - Link - Close gossip'),
(@FURYWING_EGG,1,2,0,61,0,100,0,0,0,0,0,12,@FURYWING,6,30000,0,0,0,8,0,0,0,3845.314, 5220.040, 295.412,0,'On Script - Summon Furywing - Location');
DELETE FROM `smart_scripts` WHERE `entryorguid`=@INSIDION_EGG AND `source_type`=1;
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
(@INSIDION_EGG,1,0,1,62,0,100,0,8691,0,0,0,57,@APEXIS_SHARD,35,0,0,0,0,7,0,0,0,0,0,0,0,'On gossip select - Remove Item - Player'),
(@INSIDION_EGG,1,1,2,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'On gossip select - Link - Close gossip'),
(@INSIDION_EGG,1,2,0,61,0,100,0,0,0,0,0,12,@INSIDION,6,30000,0,0,0,8,0,0,0,4176.496, 5452.214, 291.923,0,'On Script - Summon Insidion - Location');
DELETE FROM `smart_scripts` WHERE `entryorguid`=@RIVENDARK_EGG AND `source_type`=1;
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
(@RIVENDARK_EGG,1,0,1,62,0,100,0,8689,0,0,0,57,@APEXIS_SHARD,35,0,0,0,0,7,0,0,0,0,0,0,0,'On gossip select - Remove Item - Player'),
(@RIVENDARK_EGG,1,1,2,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'On gossip select - Link - Close gossip'),
(@RIVENDARK_EGG,1,2,0,61,0,100,0,0,0,0,0,12,@RIVENDARK,6,30000,0,0,0,8,0,0,0,2060.603, 7418.534, 391.098,0,'On Script - Summon Rivendark - Location');
-- Obsidia SPAWN:2421.336, 6968.062, 391.037 FLY: 2426.8,7001.64,367.572
DELETE FROM `smart_scripts` WHERE `entryorguid`IN (@OBSIDIA,@RIVENDARK,@FURYWING,@INSIDION) AND`source_type`=0;
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
(@OBSIDIA, 0, 0, 0, 0, 0, 100, 0, 3000, 9000, 3000, 9000, 11, 9573, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - In combat - Cast Flame Breath'),
(@OBSIDIA, 0, 1, 0, 0, 0, 100, 0, 2000, 6000, 2000, 6000, 11, 40505, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - In combat - Cast Cleave '),
(@OBSIDIA, 0, 2, 0, 0, 0, 100, 0, 15000, 16000, 15000, 16000, 11, 40717, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - In combat - Cast Hellfire'),
(@OBSIDIA, 0, 3, 0, 0, 0, 100, 0, 13000, 13500, 13000, 13500, 11, 40032, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - In combat - Cast Fiery Breath '),
(@OBSIDIA, 0, 4, 0, 0, 0, 100, 0, 18000, 19000, 18000, 19000, 11, 36922, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Obsidia - In combat - Cast Bellowing Roar'),
(@OBSIDIA, 0, 5, 0, 11, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 2426.8, 7001.64, 367.572, 0, 'Obsidia - On Spawn - Move to Pos');
-- Rivendark 2060.603, 7418.534, 391.098 FLY: 2064.69,7372.69,371.159
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
(@RIVENDARK, 0, 0, 0, 0, 0, 100, 0, 3000, 9000, 3000, 9000, 11, 9573, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Rivendark - In combat - Cast Flame Breath'),
(@RIVENDARK, 0, 1, 0, 0, 0, 100, 0, 2000, 6000, 2000, 6000, 11, 40505, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Rivendark - In combat - Cast Cleave '),
(@RIVENDARK, 0, 2, 0, 0, 0, 100, 0, 7000, 12000, 7000, 12000, 11, 41988, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 'Rivendark - In combat - Cast Corruption'),
(@RIVENDARK, 0, 3, 0, 0, 0, 100, 0, 13000, 13500, 13000, 13500, 11, 40032, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Rivendark - In combat - Cast Fiery Breath '),
(@RIVENDARK, 0, 4, 0, 0, 0, 100, 0, 18000, 19000, 18000, 19000, 11, 36922, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Rivendark - In combat - Cast Bellowing Roar'),
(@RIVENDARK, 0, 5, 0, 0, 0, 100, 0, 5000, 6000, 5000, 6000, 11, 15847, 2, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Rivendark - In combat - Tail Swipe'),
(@RIVENDARK, 0, 6, 0, 11, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 2064.69, 7372.69, 371.159, 0, 'Rivendark- On Spawn - Move to Pos');
-- Furywing 3845.314, 5220.040, 295.412 FLY: 3891.27,5227.05,270.094
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
(@FURYWING, 0, 0, 0, 0, 0, 100, 0, 3000, 9000, 3000, 9000, 11, 9573, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Furywing - In combat - Cast Flame Breath'),
(@FURYWING, 0, 1, 0, 0, 0, 100, 0, 2000, 6000, 2000, 6000, 11, 40505, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Furywing - In combat - Cast Cleave '),
(@FURYWING, 0, 2, 0, 0, 0, 100, 0, 10000, 16000, 10000, 16000, 11, 41572, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 'Furywing - In combat - Cast Wing Buffet'),
(@FURYWING, 0, 3, 0, 0, 0, 100, 0, 13000, 13500, 13000, 13500, 11, 40032, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Furywing - In combat - Cast Fiery Breath '),
(@FURYWING, 0, 4, 0, 0, 0, 100, 0, 18000, 19000, 18000, 19000, 11, 36922, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Furywing - In combat - Cast Bellowing Roar'),
(@FURYWING, 0, 5, 0, 0, 0, 100, 0, 5000, 6000, 5000, 6000, 11, 15847, 2, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Furywing - In combat - Tail Swipe'),
(@FURYWING, 0, 6, 0, 11, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 3891.27, 5227.05, 270.094, 0, 'Furywing - On Spawn - Move to Pos');
-- Insidion 4176.496, 5452.214, 291.923 FLY: 4143.16,5441.75,274.503
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
(@INSIDION, 0, 0, 0, 0, 0, 100, 0, 3000, 9000, 3000, 9000, 11, 9573, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Insidion - In combat - Cast Flame Breath'),
(@INSIDION, 0, 1, 0, 0, 0, 100, 0, 2000, 6000, 2000, 6000, 11, 40505, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Insidion - In combat - Cast Cleave '),
(@INSIDION, 0, 2, 0, 0, 0, 100, 0, 10000, 16000, 10000, 16000, 11, 40719, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 'Insidion - In combat - Cast Flame Buffet'),
(@INSIDION, 0, 3, 0, 0, 0, 100, 0, 13000, 13500, 13000, 13500, 11, 40032, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Insidion - In combat - Cast Fiery Breath '),
(@INSIDION, 0, 4, 0, 0, 0, 100, 0, 18000, 19000, 18000, 19000, 11, 36922, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Insidion - In combat - Cast Bellowing Roar'),
(@INSIDION, 0, 5, 0, 11, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 4143.16, 5441.75, 274.503, 0, 'Insidion - On Spawn - Move to Pos');
@@ -523,12 +523,17 @@ void Creature::Update(uint32 diff)
if (!IsAlive())
break;
// if creature is charmed, switch to charmed AI
// if creature is charmed, switch to charmed AI (and back)
if (NeedChangeAI)
{
UpdateCharmAI();
NeedChangeAI = false;
IsAIEnabled = true;
if (!IsInEvadeMode() && LastCharmerGUID)
if (Unit* charmer = ObjectAccessor::GetUnit(*this, LastCharmerGUID))
i_AI->AttackStart(charmer);
LastCharmerGUID = 0;
}
if (!IsInEvadeMode() && IsAIEnabled)
@@ -1196,13 +1196,6 @@ void GameObject::Use(Unit* user)
// calculate the distance between the player and this slot
float thisDistance = player->GetDistance2d(x_i, y_i);
/* debug code. It will spawn a npc on each slot to visualize them.
Creature* helper = player->SummonCreature(14496, x_i, y_i, GetPositionZ(), GetOrientation(), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 10000);
std::ostringstream output;
output << i << ": thisDist: " << thisDistance;
helper->MonsterSay(output.str().c_str(), LANG_UNIVERSAL, 0);
*/
if (thisDistance <= lowestDist)
{
nearest_slot = itr->first;
@@ -1223,8 +1216,6 @@ void GameObject::Use(Unit* user)
return;
}
}
//else
//player->GetSession()->SendNotification("There's nowhere left for you to sit.");
return;
}
+5 -8
View File
@@ -162,7 +162,7 @@ ProcEventInfo::ProcEventInfo(Unit* actor, Unit* actionTarget, Unit* procTarget,
#endif
Unit::Unit(bool isWorldObject) :
WorldObject(isWorldObject), m_movedPlayer(NULL), m_lastSanctuaryTime(0),
IsAIEnabled(false), NeedChangeAI(false),
IsAIEnabled(false), NeedChangeAI(false), LastCharmerGUID(0),
m_ControlledByPlayer(false), movespline(new Movement::MoveSpline()),
i_AI(NULL), i_disabledAI(NULL), m_AutoRepeatFirstCast(false), m_procDeep(0),
m_removedAurasCount(0), i_motionMaster(this), m_ThreatManager(this),
@@ -14096,16 +14096,13 @@ void Unit::RemoveCharmedBy(Unit* charmer)
if (Creature* creature = ToCreature())
{
// Creature will restore its old AI on next update
if (creature->AI())
creature->AI()->OnCharmed(false);
if (type != CHARM_TYPE_VEHICLE) // Vehicles' AI is never modified
{
creature->AIM_Initialize();
if (creature->AI() && charmer && charmer->IsAlive())
creature->AI()->AttackStart(charmer);
}
// Vehicle should not attack its passenger after he exists the seat
if (type != CHARM_TYPE_VEHICLE)
LastCharmerGUID = charmer->GetGUID();
}
else
ToPlayer()->SetClientControl(this, 1);
+1
View File
@@ -2084,6 +2084,7 @@ class Unit : public WorldObject
friend class VehicleJoinEvent;
bool IsAIEnabled, NeedChangeAI;
uint64 LastCharmerGUID;
bool CreateVehicleKit(uint32 id, uint32 creatureEntry);
void RemoveVehicleKit();
Vehicle* GetVehicleKit()const { return m_vehicleKit; }
+2 -4
View File
@@ -8211,10 +8211,8 @@ void ObjectMgr::LoadGossipMenuItems()
_gossipMenuItemsStore.clear();
QueryResult result = WorldDatabase.Query(
// 0 1 2 3 4 5
"SELECT menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, "
// 6 7 8 9 10
"action_menu_id, action_poi_id, box_coded, box_money, box_text "
// 0 1 2 3 4 5 6 7 8 9 10
"SELECT menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, action_menu_id, action_poi_id, box_coded, box_money, box_text "
"FROM gossip_menu_option ORDER BY menu_id, id");
if (!result)
+1 -2
View File
@@ -218,8 +218,7 @@ void ObjectGridStoper::Visit(CreatureMapType &m)
{
iter->GetSource()->CombatStop();
iter->GetSource()->DeleteThreatList();
if (iter->GetSource()->IsAIEnabled)
iter->GetSource()->AI()->EnterEvadeMode();
iter->GetSource()->AI()->EnterEvadeMode();
}
}
}
@@ -505,93 +505,89 @@ public:
## npc_dark_rider_of_acherus
######*/
enum Spells_DR
enum DarkRiderOfAcherus
{
SAY_DARK_RIDER = 0,
SPELL_DESPAWN_HORSE = 51918
};
enum Says_DR
{
SAY_DARK_RIDER = 0
};
class npc_dark_rider_of_acherus : public CreatureScript
{
public:
npc_dark_rider_of_acherus() : CreatureScript("npc_dark_rider_of_acherus") { }
public:
npc_dark_rider_of_acherus() : CreatureScript("npc_dark_rider_of_acherus") { }
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_dark_rider_of_acherusAI(creature);
}
struct npc_dark_rider_of_acherusAI : public ScriptedAI
{
npc_dark_rider_of_acherusAI(Creature* creature) : ScriptedAI(creature) {}
uint32 PhaseTimer;
uint32 Phase;
bool Intro;
uint64 TargetGUID;
void Reset() OVERRIDE
struct npc_dark_rider_of_acherusAI : public ScriptedAI
{
PhaseTimer = 4000;
Phase = 0;
Intro = false;
TargetGUID = 0;
}
npc_dark_rider_of_acherusAI(Creature* creature) : ScriptedAI(creature) { }
void UpdateAI(uint32 diff) OVERRIDE
{
if (!Intro || !TargetGUID)
return;
if (PhaseTimer <= diff)
void Reset() OVERRIDE
{
switch (Phase)
PhaseTimer = 4000;
Phase = 0;
Intro = false;
TargetGUID = 0;
}
void UpdateAI(uint32 diff) OVERRIDE
{
if (!Intro || !TargetGUID)
return;
if (PhaseTimer <= diff)
{
case 0:
me->MonsterSay(SAY_DARK_RIDER, LANG_UNIVERSAL, 0);
PhaseTimer = 5000;
Phase = 1;
break;
case 1:
if (Unit* target = Unit::GetUnit(*me, TargetGUID))
DoCast(target, SPELL_DESPAWN_HORSE, true);
PhaseTimer = 3000;
Phase = 2;
break;
case 2:
me->SetVisible(false);
PhaseTimer = 2000;
Phase = 3;
break;
case 3:
me->DespawnOrUnsummon();
break;
default:
break;
switch (Phase)
{
case 0:
Talk(SAY_DARK_RIDER);
PhaseTimer = 5000;
Phase = 1;
break;
case 1:
if (Unit* target = ObjectAccessor::GetUnit(*me, TargetGUID))
DoCast(target, SPELL_DESPAWN_HORSE, true);
PhaseTimer = 3000;
Phase = 2;
break;
case 2:
me->SetVisible(false);
PhaseTimer = 2000;
Phase = 3;
break;
case 3:
me->DespawnOrUnsummon();
break;
default:
break;
}
}
} else PhaseTimer -= diff;
else
PhaseTimer -= diff;
}
}
void InitDespawnHorse(Unit* who)
{
if (!who)
return;
void InitDespawnHorse(Unit* who)
TargetGUID = who->GetGUID();
me->SetWalk(true);
me->SetSpeed(MOVE_RUN, 0.4f);
me->GetMotionMaster()->MoveChase(who);
me->SetTarget(TargetGUID);
Intro = true;
}
private:
uint32 PhaseTimer;
uint32 Phase;
bool Intro;
uint64 TargetGUID;
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
if (!who)
return;
TargetGUID = who->GetGUID();
me->SetWalk(true);
me->SetSpeed(MOVE_RUN, 0.4f);
me->GetMotionMaster()->MoveChase(who);
me->SetTarget(TargetGUID);
Intro = true;
return new npc_dark_rider_of_acherusAI(creature);
}
};
};
/*######
@@ -644,7 +640,6 @@ public:
}
void MoveInLineOfSight(Unit* who) OVERRIDE
{
ScriptedAI::MoveInLineOfSight(who);
@@ -428,13 +428,13 @@ class npc_snobold_vassal : public CreatureScript
return;
case EVENT_HEAD_CRACK:
// commented out while SPELL_SNOBOLLED gets fixed
//if (Unit* target = Unit::GetPlayer(*me, m_uiTargetGUID))
//if (Unit* target = ObjectAccessor::GetPlayer(*me, m_uiTargetGUID))
DoCastVictim(SPELL_HEAD_CRACK);
_events.ScheduleEvent(EVENT_HEAD_CRACK, 30*IN_MILLISECONDS);
return;
case EVENT_BATTER:
// commented out while SPELL_SNOBOLLED gets fixed
//if (Unit* target = Unit::GetPlayer(*me, m_uiTargetGUID))
//if (Unit* target = ObjectAccessor::GetPlayer(*me, m_uiTargetGUID))
DoCastVictim(SPELL_BATTER);
_events.ScheduleEvent(EVENT_BATTER, 10*IN_MILLISECONDS);
return;
@@ -196,6 +196,22 @@ class FrostBombExplosion : public BasicEvent
uint64 _sindragosaGUID;
};
class FrostBeaconSelector
{
public:
FrostBeaconSelector(Unit* source) : _source(source) { }
bool operator()(Unit* target) const
{
return target->GetTypeId() == TYPEID_PLAYER &&
target != _source->GetVictim() &&
!target->HasAura(SPELL_ICE_TOMB_UNTARGETABLE);
}
private:
Unit* _source;
};
class boss_sindragosa : public CreatureScript
{
public:
@@ -466,7 +482,7 @@ class boss_sindragosa : public CreatureScript
me->GetMotionMaster()->MovePoint(POINT_AIR_PHASE_FAR, SindragosaAirPosFar);
break;
case EVENT_ICE_TOMB:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_ICE_TOMB_UNTARGETABLE))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, FrostBeaconSelector(me)))
{
Talk(EMOTE_WARN_FROZEN_ORB, target->GetGUID());
DoCast(target, SPELL_ICE_TOMB_DUMMY, true);
@@ -465,23 +465,18 @@ public:
#####*/
#define SAY_OFFER "Care to try Grimbooze Thunderbrew's new jungle punch?"
#define SAY_HEMET_1 "Aye, I'll try it."
#define SAY_HEMET_2 "That's exactly what I needed!"
#define SAY_HEMET_3 "It's got my vote! That'll put hair on your chest like nothing else will."
#define SAY_HADRIUS_1 "I'm always up for something of Grimbooze's."
#define SAY_HADRIUS_2 "Well, so far, it tastes like something my wife would drink..."
#define SAY_HADRIUS_3 "Now, there's the kick I've come to expect from Grimbooze's drinks! I like it!"
#define SAY_TAMARA_1 "Sure!"
#define SAY_TAMARA_2 "Oh my..."
#define SAY_TAMARA_3 "Tastes like I'm drinking... engine degreaser!"
enum utils
enum JunglePunch
{
NPC_HEMET = 27986,
NPC_HADRIUS = 28047,
NPC_TAMARA = 28568,
SPELL_OFFER = 51962,
QUEST_ENTRY = 12645,
QUEST_TASTE_TEST = 12645,
SAY_HEMET_HADRIUS_TAMARA_1 = 0,
SAY_HEMET_HADRIUS_TAMARA_2 = 1,
SAY_HEMET_HADRIUS_TAMARA_3 = 2,
SAY_HEMET_4 = 3, // unused
SAY_HEMET_5 = 4 // unused
};
enum NesingwaryChildrensWeek
@@ -492,12 +487,12 @@ enum NesingwaryChildrensWeek
ORPHAN_WOLVAR = 33532,
TEXT_NESINGWARY_1 = 5,
TEXT_WOLVAR_ORPHAN_6 = 6,
TEXT_WOLVAR_ORPHAN_7 = 7,
TEXT_WOLVAR_ORPHAN_8 = 8,
TEXT_WOLVAR_ORPHAN_9 = 9,
TEXT_NESINGWARY_1 = 1,
TEXT_WOLVAR_ORPHAN_9 = 9
};
class npc_jungle_punch_target : public CreatureScript
@@ -520,7 +515,6 @@ public:
}
void MoveInLineOfSight(Unit* who) OVERRIDE
{
if (!phase && who && who->GetDistance2d(me) < 10.0f)
if (Player* player = who->ToPlayer())
@@ -585,99 +579,55 @@ public:
timer -= diff;
}
void UpdateAI(uint32 uiDiff) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
{
if (phase)
proceedCwEvent(uiDiff);
proceedCwEvent(diff);
if (!sayStep)
return;
if (sayTimer < uiDiff)
if (sayTimer < diff)
{
switch (sayStep)
{
case 0:
{
switch (me->GetEntry())
{
case NPC_HEMET: me->MonsterSay(SAY_HEMET_1, LANG_UNIVERSAL, 0); break;
case NPC_HADRIUS: me->MonsterSay(SAY_HADRIUS_1, LANG_UNIVERSAL, 0); break;
case NPC_TAMARA: me->MonsterSay(SAY_TAMARA_1, LANG_UNIVERSAL, 0); break;
}
sayTimer = 3000;
sayStep++;
break;
}
case 1:
{
switch (me->GetEntry())
{
case NPC_HEMET: me->MonsterSay(SAY_HEMET_2, LANG_UNIVERSAL, 0); break;
case NPC_HADRIUS: me->MonsterSay(SAY_HADRIUS_2, LANG_UNIVERSAL, 0); break;
case NPC_TAMARA: me->MonsterSay(SAY_TAMARA_2, LANG_UNIVERSAL, 0); break;
}
sayTimer = 3000;
sayStep++;
break;
}
case 2:
{
switch (me->GetEntry())
{
case NPC_HEMET: me->MonsterSay(SAY_HEMET_3, LANG_UNIVERSAL, 0); break;
case NPC_HADRIUS: me->MonsterSay(SAY_HADRIUS_3, LANG_UNIVERSAL, 0); break;
case NPC_TAMARA: me->MonsterSay(SAY_TAMARA_3, LANG_UNIVERSAL, 0); break;
}
sayTimer = 3000;
sayStep = 0;
break;
}
}
Talk(SAY_HEMET_HADRIUS_TAMARA_1 + sayStep - 1);
sayTimer = 3000;
sayStep++;
if (sayStep > 3) // end
sayStep = 0;
}
else
sayTimer -= uiDiff;
sayTimer -= diff;
}
void SpellHit(Unit* caster, const SpellInfo* proto) OVERRIDE
void SpellHit(Unit* caster, SpellInfo const* spellInfo) OVERRIDE
{
if (!proto || proto->Id != SPELL_OFFER)
if (spellInfo->Id != SPELL_OFFER)
return;
if (!caster->ToPlayer())
Player* player = caster->ToPlayer();
if (!player)
return;
QuestStatusMap::const_iterator itr = caster->ToPlayer()->getQuestStatusMap().find(QUEST_ENTRY);
Quest const* quest = sObjectMgr->GetQuestTemplate(QUEST_TASTE_TEST);
if (!quest)
return;
QuestStatusMap::const_iterator itr = player->getQuestStatusMap().find(QUEST_TASTE_TEST);
if (itr->second.Status != QUEST_STATUS_INCOMPLETE)
return;
for (uint8 i=0; i<3; i++)
for (uint8 i = 0; i < 3; ++i)
{
switch (i)
{
case 0:
if (NPC_HEMET != me->GetEntry())
continue;
else
break;
case 1:
if (NPC_HADRIUS != me->GetEntry())
continue;
else
break;
case 2:
if (NPC_TAMARA != me->GetEntry())
continue;
else
break;
}
if (quest->RequiredNpcOrGo[i] != me->GetEntry())
continue;
if (itr->second.CreatureOrGOCount[i] != 0)
continue;
caster->ToPlayer()->KilledMonsterCredit(me->GetEntry(), 0);
caster->ToPlayer()->Say(SAY_OFFER, LANG_UNIVERSAL);
sayStep = 0;
player->KilledMonsterCredit(me->GetEntry(), 0);
player->Say(SAY_OFFER, LANG_UNIVERSAL);
sayStep = 1;
break;
}
}
@@ -334,13 +334,19 @@ class npc_wg_quest_giver : public CreatureScript
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
{
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
if (!wintergrasp)
return true;
if (creature->IsVendor())
{
player->ADD_GOSSIP_ITEM_DB(Player::GetDefaultGossipMenuForSource(creature), 0, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_VENDOR);
player->PlayerTalkClass->GetGossipMenu().AddGossipMenuItemData(0, 0, 0);
}
/// @todo: move this to conditions or something else
// Player::PrepareQuestMenu(guid)
if (creature->IsQuestGiver())
{
QuestRelationBounds objectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry());
@@ -368,6 +374,9 @@ class npc_wg_quest_giver : public CreatureScript
if (!quest)
continue;
if (!player->CanTakeQuest(quest, false))
continue;
switch (questId)
{
// Horde attacker
@@ -377,15 +386,8 @@ class npc_wg_quest_giver : public CreatureScript
case QUEST_FUELING_THE_DEMOLISHERS_HORDE_ATT:
case QUEST_HEALING_WITH_ROSES_HORDE_ATT:
case QUEST_DEFEND_THE_SIEGE_HORDE_ATT:
if (wintergrasp->GetAttackerTeam() == TEAM_HORDE)
{
QuestStatus status = player->GetQuestStatus(questId);
if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 4);
else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 2);
}
if (wintergrasp->GetAttackerTeam() != TEAM_HORDE)
continue;
break;
// Horde defender
case QUEST_BONES_AND_ARROWS_HORDE_DEF:
@@ -395,15 +397,8 @@ class npc_wg_quest_giver : public CreatureScript
case QUEST_HEALING_WITH_ROSES_HORDE_DEF:
case QUEST_TOPPLING_THE_TOWERS_HORDE_DEF:
case QUEST_STOP_THE_SIEGE_HORDE_DEF:
if (wintergrasp->GetDefenderTeam() == TEAM_HORDE)
{
QuestStatus status = player->GetQuestStatus(questId);
if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 4);
else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 2);
}
if (wintergrasp->GetDefenderTeam() != TEAM_HORDE)
continue;
break;
// Alliance attacker
case QUEST_BONES_AND_ARROWS_ALLIANCE_ATT:
@@ -411,15 +406,8 @@ class npc_wg_quest_giver : public CreatureScript
case QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_ATT:
case QUEST_DEFEND_THE_SIEGE_ALLIANCE_ATT:
case QUEST_A_RARE_HERB_ALLIANCE_ATT:
if (wintergrasp->GetAttackerTeam() == TEAM_ALLIANCE)
{
QuestStatus status = player->GetQuestStatus(questId);
if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 4);
else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 2);
}
if (wintergrasp->GetAttackerTeam() != TEAM_ALLIANCE)
continue;
break;
// Alliance defender
case QUEST_BONES_AND_ARROWS_ALLIANCE_DEF:
@@ -428,27 +416,20 @@ class npc_wg_quest_giver : public CreatureScript
case QUEST_SHOUTHERN_SABOTAGE_ALLIANCE_DEF:
case QUEST_STOP_THE_SIEGE_ALLIANCE_DEF:
case QUEST_A_RARE_HERB_ALLIANCE_DEF:
if (wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE)
{
QuestStatus status = player->GetQuestStatus(questId);
if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 4);
else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 2);
}
if (wintergrasp->GetDefenderTeam() != TEAM_ALLIANCE)
continue;
break;
default:
QuestStatus status = player->GetQuestStatus(questId);
if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 4);
else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 2);
break;
}
if (quest->IsAutoComplete())
qm.AddMenuItem(questId, 4);
else if (player->GetQuestStatus(questId) == QUEST_STATUS_NONE)
qm.AddMenuItem(questId, 2);
}
}
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
+19 -42
View File
@@ -198,6 +198,9 @@ enum Gurgthock
EMOTE_YGGDRAS_SPAWN = 4,
SAY_STINKBEARD_SPAWN = 5,
SAY_GURGTHOCK_ELEMENTAL_SPAWN = 6,
SAY_GURGTHOCK_7 = 7,
SAY_QUEST_AMPHITHEATER_ANGUISH_YGGDRAS = 8,
SAY_GURGTHOCK_9 = 9,
SAY_CALL_FOR_HELP = 0,
SAY_RECRUIT = 0,
@@ -319,9 +322,9 @@ public:
uiTimer = 2000;
uiPhase = 12;
break;
}
break;
}
}
break;
}
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -341,8 +344,6 @@ public:
if (uiPhase)
{
Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID);
if (uiTimer <= diff)
{
switch (uiPhase)
@@ -371,27 +372,14 @@ public:
uiPhase = 0;
break;
case 6:
{
if (!player)
return;
std::string sText = ("The grand Amphitheater of Anguish awaits, " + std::string(player->GetName()) + ". Remember, once a battle starts you have to stay in the area. WIN OR DIE!");
me->MonsterSay(sText.c_str(), LANG_UNIVERSAL, 0);
uiTimer = 5000;
uiPhase = 9;
}
Talk(SAY_GURGTHOCK_7, _playerGUID);
uiTimer = 5000;
uiPhase = 9;
break;
case 7:
{
if (!player)
return;
std::string sText = ("Prepare to make you stand, " + std::string(player->GetName()) + "! Get in the Amphitheater and stand ready! Remember, you and your opponent must stay in the arena at all times or you will be disqualified!");
me->MonsterSay(sText.c_str(), LANG_UNIVERSAL, 0);
uiTimer = 3000;
uiPhase = 8;
}
Talk(SAY_GURGTHOCK_9, _playerGUID);
uiTimer = 3000;
uiPhase = 8;
break;
case 8:
Talk(SAY_QUEST_ACCEPT_MAGNATAUR);
@@ -399,15 +387,9 @@ public:
uiPhase = 11;
break;
case 9:
{
if (!player)
return;
std::string sText = ("Here we are once again, ladies and gentlemen. The epic struggle between life and death in the Amphitheater of Anguish! For this round we have " + std::string(player->GetName()) + " versus the hulking jormungar, Yg... Yggd? Yggdoze? Who comes up with these names?! " + std::string(player->GetName()) + " versus big worm!");
me->MonsterYell(sText.c_str(), LANG_UNIVERSAL, 0);
uiTimer = 10000;
uiPhase = 10;
}
Talk(SAY_QUEST_AMPHITHEATER_ANGUISH_YGGDRAS, _playerGUID);
uiTimer = 10000;
uiPhase = 10;
break;
case 10:
me->SummonCreature(NPC_YGGDRAS, SpawnPosition[1], TEMPSUMMON_CORPSE_DESPAWN, 1000);
@@ -420,16 +402,10 @@ public:
uiPhase = 0;
break;
case 12:
{
if (!player)
return;
std::string sText = ("Prepare to make you stand, " + std::string(player->GetName()) + "! Get in the Amphitheater and stand ready! Remember, you and your opponent must stay in the arena at all times or you will be disqualified!");
me->MonsterSay(sText.c_str(), LANG_UNIVERSAL, 0);
Talk(SAY_GURGTHOCK_9, _playerGUID);
uiTimer = 5000;
uiPhase = 13;
}
break;
break;
case 13:
Talk(SAY_GURGTHOCK_ELEMENTAL_SPAWN);
uiTimer = 3000;
@@ -443,7 +419,8 @@ public:
break;
}
}
else uiTimer -= diff;
else
uiTimer -= diff;
}
}
@@ -422,7 +422,6 @@ public:
{
damage = 0;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->Yell(SUFF_SAY_RECAP, LANG_UNIVERSAL, 0);
Talk(SUFF_SAY_RECAP);
me->SetReactState(REACT_PASSIVE);
}
@@ -431,14 +430,13 @@ public:
void EnterCombat(Unit* /*who*/) OVERRIDE
{
if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
{
{
Talk(SUFF_SAY_FREED);
DoZoneInCombat();
DoCast(me, AURA_OF_SUFFERING, true); // linked aura need core support
DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE, true);
DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE2, true);
}
else return;
}
}
void KilledUnit(Unit* /*victim*/) OVERRIDE