mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-12 21:19:08 +01:00
Merge remote-tracking branch 'origin/master' into 4.3.4
This commit is contained in:
1
sql/updates/world/2013_02_14_00_world_version.sql
Normal file
1
sql/updates/world/2013_02_14_00_world_version.sql
Normal file
@@ -0,0 +1 @@
|
||||
UPDATE `version` SET `db_version`='TDB 335.51', `cache_id`=51 LIMIT 1;
|
||||
20
sql/updates/world/2013_02_15_00_world_waypoint_data.sql
Normal file
20
sql/updates/world/2013_02_15_00_world_waypoint_data.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
SET @NPC_DRAKE := 29709;
|
||||
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@NPC_DRAKE;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@NPC_DRAKE,1,7294.96,-2418.733,823.869,0,0,0,0,100,0),
|
||||
(@NPC_DRAKE,2,7315.984,-2331.46,826.3972,0,0,0,0,100,0),
|
||||
(@NPC_DRAKE,3,7271.826,-2271.479,833.5917,0,0,0,0,100,0),
|
||||
(@NPC_DRAKE,4,7186.253,-2218.475,847.5632,0,0,0,0,100,0),
|
||||
(@NPC_DRAKE,5,7113.195,-2164.288,850.2301,0,0,0,0,100,0),
|
||||
(@NPC_DRAKE,6,7078.018,-2063.106,854.7581,0,0,0,0,100,0),
|
||||
(@NPC_DRAKE,7,7073.221,-1983.382,861.9246,0,0,0,0,100,0),
|
||||
(@NPC_DRAKE,8,7061.455,-1885.899,865.119,0,0,0,0,100,0),
|
||||
(@NPC_DRAKE,9,7033.32,-1826.775,876.2578,0,0,0,0,100,0),
|
||||
(@NPC_DRAKE,10,6999.902,-1784.012,897.4521,0,0,0,0,100,0),
|
||||
(@NPC_DRAKE,11,6954.913,-1747.043,897.4521,0,0,0,0,100,0),
|
||||
(@NPC_DRAKE,12,6933.856,-1720.698,882.2022,0,0,0,0,100,0),
|
||||
(@NPC_DRAKE,13,6932.729,-1687.306,866.1189,0,0,0,0,100,0),
|
||||
(@NPC_DRAKE,14,6952.458,-1663.802,849.8133,0,0,0,0,100,0),
|
||||
(@NPC_DRAKE,15,7002.819,-1651.681,831.397,0,0,0,0,100,0),
|
||||
(@NPC_DRAKE,16,7026.531,-1649.239,828.8406,0,0,0,0,100,0);
|
||||
@@ -356,34 +356,20 @@ public:
|
||||
|
||||
enum FreedProtoDrake
|
||||
{
|
||||
NPC_DRAKE = 29709,
|
||||
|
||||
AREA_VALLEY_OF_ANCIENT_WINTERS = 4437,
|
||||
|
||||
TEXT_EMOTE = 0,
|
||||
|
||||
SPELL_KILL_CREDIT_PRISONER = 55144,
|
||||
SPELL_SUMMON_LIBERATED = 55073,
|
||||
SPELL_KILL_CREDIT_DRAKE = 55143
|
||||
};
|
||||
SPELL_KILL_CREDIT_DRAKE = 55143,
|
||||
|
||||
const Position FreedDrakeWaypoints[16] =
|
||||
{
|
||||
{7294.96f, -2418.733f, 823.869f, 0.0f},
|
||||
{7315.984f, -2331.46f, 826.3972f, 0.0f},
|
||||
{7271.826f, -2271.479f, 833.5917f, 0.0f},
|
||||
{7186.253f, -2218.475f, 847.5632f, 0.0f},
|
||||
{7113.195f, -2164.288f, 850.2301f, 0.0f},
|
||||
{7078.018f, -2063.106f, 854.7581f, 0.0f},
|
||||
{7073.221f, -1983.382f, 861.9246f, 0.0f},
|
||||
{7061.455f, -1885.899f, 865.119f, 0.0f},
|
||||
{7033.32f, -1826.775f, 876.2578f, 0.0f},
|
||||
{6999.902f, -1784.012f, 897.4521f, 0.0f},
|
||||
{6954.913f, -1747.043f, 897.4521f, 0.0f},
|
||||
{6933.856f, -1720.698f, 882.2022f, 0.0f},
|
||||
{6932.729f, -1687.306f, 866.1189f, 0.0f},
|
||||
{6952.458f, -1663.802f, 849.8133f, 0.0f},
|
||||
{7002.819f, -1651.681f, 831.397f, 0.0f},
|
||||
{7026.531f, -1649.239f, 828.8406f, 0.0f}
|
||||
EVENT_CHECK_AREA = 1,
|
||||
EVENT_REACHED_HOME = 2,
|
||||
};
|
||||
|
||||
|
||||
class npc_freed_protodrake : public CreatureScript
|
||||
{
|
||||
public:
|
||||
@@ -393,74 +379,60 @@ public:
|
||||
{
|
||||
npc_freed_protodrakeAI(Creature* creature) : VehicleAI(creature) {}
|
||||
|
||||
bool autoMove;
|
||||
bool wpReached;
|
||||
uint16 CheckTimer;
|
||||
uint16 countWP;
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
autoMove = false;
|
||||
wpReached = false;
|
||||
CheckTimer = 5000;
|
||||
countWP = 0;
|
||||
events.ScheduleEvent(EVENT_CHECK_AREA, 5000);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
if (type != WAYPOINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (id < 15)
|
||||
{
|
||||
++countWP;
|
||||
wpReached = true;
|
||||
}
|
||||
else
|
||||
if (id == 15)
|
||||
// drake reached village
|
||||
{
|
||||
// get player that rides drake (from seat 0)
|
||||
Unit* player = me->GetVehicleKit()->GetPassenger(0);
|
||||
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
// for each prisoner on drake, give credit
|
||||
for (uint8 i = 1; i < 4; ++i)
|
||||
if (Unit* prisoner = me->GetVehicleKit()->GetPassenger(i))
|
||||
{
|
||||
if (prisoner->GetTypeId() != TYPEID_UNIT)
|
||||
return;
|
||||
prisoner->CastSpell(player, SPELL_KILL_CREDIT_PRISONER, true);
|
||||
prisoner->CastSpell(prisoner, SPELL_SUMMON_LIBERATED, true);
|
||||
prisoner->ExitVehicle();
|
||||
}
|
||||
me->CastSpell(me, SPELL_KILL_CREDIT_DRAKE, true);
|
||||
player->ExitVehicle();
|
||||
}
|
||||
}
|
||||
events.ScheduleEvent(EVENT_REACHED_HOME, 2000);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!autoMove)
|
||||
events.Update(diff);
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
if (CheckTimer < diff)
|
||||
{
|
||||
CheckTimer = 5000;
|
||||
case EVENT_CHECK_AREA:
|
||||
if (me->GetAreaId() == AREA_VALLEY_OF_ANCIENT_WINTERS)
|
||||
{
|
||||
Talk(TEXT_EMOTE, me->GetVehicleKit()->GetPassenger(0)->GetGUID());
|
||||
autoMove = true;
|
||||
wpReached = true;
|
||||
if (Vehicle* vehicle = me->GetVehicleKit())
|
||||
if (Unit* passenger = vehicle->GetPassenger(0))
|
||||
{
|
||||
Talk(TEXT_EMOTE, passenger->GetGUID());
|
||||
me->GetMotionMaster()->MovePath(NPC_DRAKE, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
CheckTimer -= diff;
|
||||
}
|
||||
|
||||
if (wpReached && autoMove)
|
||||
{
|
||||
wpReached = false;
|
||||
me->GetMotionMaster()->MovePoint(countWP, FreedDrakeWaypoints[countWP]);
|
||||
else
|
||||
events.ScheduleEvent(EVENT_CHECK_AREA, 5000);
|
||||
break;
|
||||
case EVENT_REACHED_HOME:
|
||||
Unit* player = me->GetVehicleKit()->GetPassenger(0);
|
||||
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
// for each prisoner on drake, give credit
|
||||
for (uint8 i = 1; i < 4; ++i)
|
||||
if (Unit* prisoner = me->GetVehicleKit()->GetPassenger(i))
|
||||
{
|
||||
if (prisoner->GetTypeId() != TYPEID_UNIT)
|
||||
return;
|
||||
prisoner->CastSpell(player, SPELL_KILL_CREDIT_PRISONER, true);
|
||||
prisoner->CastSpell(prisoner, SPELL_SUMMON_LIBERATED, true);
|
||||
prisoner->ExitVehicle();
|
||||
}
|
||||
me->CastSpell(me, SPELL_KILL_CREDIT_DRAKE, true);
|
||||
player->ExitVehicle();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user