Add handling for areatriggers at Area 52 entances.

This commit is contained in:
Malcrom
2012-03-04 16:44:27 -03:30
parent 517f64b518
commit 45ef7dbfcb
2 changed files with 43 additions and 8 deletions

View File

@@ -0,0 +1,7 @@
-- Add Area trigger scripts
DELETE FROM `areatrigger_scripts` WHERE `entry` IN (4422,4466,4471,4472);
INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES
(4422,'at_area_52_entrance'),
(4466,'at_area_52_entrance'),
(4471,'at_area_52_entrance'),
(4472,'at_area_52_entrance');

View File

@@ -427,13 +427,14 @@ class AreaTrigger_at_brewfest : public AreaTriggerScript
enum Area52Entrance
{
NPC_SPOTLIGHT = 19913,
SUMMON_COOLDOWN = 5,
SPELL_A52_NEURALYZER = 34400,
NPC_SPOTLIGHT = 19913,
SUMMON_COOLDOWN = 5,
AT_AREA_52_SOUTH = 4472,
AT_AREA_52_NORTH = 4466,
AT_AREA_52_WEST = 4471,
AT_AREA_52_EAST = 4422,
AT_AREA_52_SOUTH = 4472,
AT_AREA_52_NORTH = 4466,
AT_AREA_52_WEST = 4471,
AT_AREA_52_EAST = 4422,
};
class AreaTrigger_at_area_52_entrance : public AreaTriggerScript
@@ -446,14 +447,41 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger)
{
float x, y, z;
if (!player->isAlive())
return false;
uint32 triggerId = trigger->id;
if (sWorld->GetGameTime() - _triggerTimes[trigger->id] < SUMMON_COOLDOWN)
return false;
player->SummonCreature(NPC_SPOTLIGHT, trigger->x, trigger->y, trigger->z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000);
switch (triggerId)
{
case AT_AREA_52_EAST:
x = 3044.176f;
y = 3610.692f;
z = 143.61f;
break;
case AT_AREA_52_NORTH:
x = 3114.87f;
y = 3687.619f;
z = 143.62f;
break;
case AT_AREA_52_WEST:
x = 3017.79f;
y = 3746.806f;
z = 144.27f;
break;
case AT_AREA_52_SOUTH:
x = 2950.63f;
y = 3719.905f;
z = 143.33f;
break;
}
player->SummonCreature(NPC_SPOTLIGHT, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000);
player->AddAura(SPELL_A52_NEURALYZER, player);
_triggerTimes[trigger->id] = sWorld->GetGameTime();
return false;
}
@@ -474,4 +502,4 @@ void AddSC_areatrigger_scripts()
new AreaTrigger_at_bring_your_orphan_to();
new AreaTrigger_at_brewfest();
new AreaTrigger_at_area_52_entrance();
}
}