mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-17 05:29:43 -04:00
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Movement/Spline/MoveSplineInit.cpp
This commit is contained in:
35
sql/updates/world/2013_05_31_00_world_misc.sql
Normal file
35
sql/updates/world/2013_05_31_00_world_misc.sql
Normal file
@@ -0,0 +1,35 @@
|
||||
-- DB/Misc: Fix: Prevent chat/spell flood, Prevent summon spells from overwriting.
|
||||
|
||||
-- Prevent chat/spell flood
|
||||
UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid`=2358 AND `source_type`=0 AND `id`=9 AND `link`=10;
|
||||
UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid`=2358 AND `source_type`=0 AND `id`=10 AND `link`=0;
|
||||
UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid`=2358 AND `source_type`=0 AND `id`=11 AND `link`=12;
|
||||
UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid`=2358 AND `source_type`=0 AND `id`=12 AND `link`=0;
|
||||
|
||||
-- Prevent chat flood / ..run away in fear! / Manually checked one by one! (64 NPC's)
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (429,453,548,1166,1867,1920,2369,4063,5839,7075,11319,11324,15281,15401,15417,15938,15945,15970,15971,16204) AND `source_type` = 0 AND `id` = 12 AND `link` = 13;
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (429,453,548,1166,1867,1920,2369,4063,5839,7075,11319,11324,15281,15401,15417,15938,15945,15970,15971,16204) AND `source_type` = 0 AND `id` = 13 AND `link` = 0;
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (1065,1173,1397,1914,1915,2120,2371,2376,6008,8550,9449,16249,16318,16337) AND `source_type` = 0 AND `id` = 13 AND `link` = 14;
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (1065,1124,1173,1397,1914,1915,2120,2245,2371,2376,6008,8550,9449,16249,16318,16337) AND `source_type` = 0 AND `id` = 14 AND `link` = 0;
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (1889,2375,2387,8566,9450,16317,16344,25073) AND `source_type` = 0 AND `id` = 14 AND `link` = 15;
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (1124,1889,2375,2387,8566,9450,16317,16344,25073) AND `source_type` = 0 AND `id` = 15 AND `link` = 0;
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (1123,1162,2245,2554,9451,16403) AND `source_type` = 0 AND `id` = 15 AND `link` = 16;
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (1009,1013,1123,1162,2554,7246,9451,16403) AND `source_type` = 0 AND `id` = 16 AND `link` = 0;
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (2276,2428,4064,4463,10824,12322) AND `source_type` = 0 AND `id` = 16 AND `link` = 17;
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (2276,2428,4064,4463,10824,12322) AND `source_type` = 0 AND `id` = 17 AND `link` = 0;
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (436,4462,17694) AND `source_type` = 0 AND `id` = 17 AND `link` = 18;
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (436,4462,17694) AND `source_type` = 0 AND `id` = 18 AND `link` = 0;
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` = 8564 AND `source_type` = 0 AND `id` = 18 AND `link` = 19; -- Ranger - Allow Combat Movement
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` = 8564 AND `source_type` = 0 AND `id` = 19 AND `link` = 0; -- Ranger - Flee For Assist
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` = 24683 AND `source_type` = 0 AND `id` = 19 AND `link` = 20; -- Sunblade Mage Guard - Allow Combat Movement
|
||||
UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` = 24683 AND `source_type` = 0 AND `id` = 20 AND `link` = 0; -- Sunblade Mage Guard - Flee For Assist
|
||||
|
||||
-- Prevent summon spells from overwriting each other's cast time, earlier script had wrong timers..
|
||||
UPDATE `smart_scripts` SET `link`=15 WHERE `entryorguid`=1124 AND `source_type`=0 AND `id`=14 AND `link`=01;
|
||||
UPDATE `smart_scripts` SET `event_type`=61, `event_flags`=1 WHERE `entryorguid`=1124 AND `source_type`=0 AND `id`=15 AND `link`=0;
|
||||
UPDATE `smart_scripts` SET `event_param1`=9100, `event_param2`=14900 WHERE `entryorguid`=2358 AND `source_type`=0 AND `id`=9 AND `link`=10;
|
||||
UPDATE `smart_scripts` SET `event_param1`=4700, `event_param2`=11100 WHERE `entryorguid`=2358 AND `source_type`=0 AND `id`=11 AND `link`=12;
|
||||
UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid` IN (429,453) AND `source_type`=0 AND `id`=12 AND `link`=13;
|
||||
UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid` IN (1009,1065,1397) AND `source_type`=0 AND `id`=13 AND `link`=14;
|
||||
UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid` IN (1009,1013,1123,2245,2554) AND `source_type`=0 AND `id`=15 AND `link`=16;
|
||||
UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid` = 1009 AND `source_type`=0 AND `id`=14 AND `link`=15;
|
||||
@@ -0,0 +1,2 @@
|
||||
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (24021,3094,23905,27376,27378,27379,27381);
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=26917;
|
||||
@@ -0,0 +1,14 @@
|
||||
DELETE FROM `skill_fishing_base_level` WHERE `entry`=4813;
|
||||
INSERT INTO `skill_fishing_base_level`(`entry`,`skill`) VALUE
|
||||
(4813,450);
|
||||
|
||||
DELETE FROM `fishing_loot_template` WHERE `entry`=4813;
|
||||
INSERT INTO `fishing_loot_template`(`entry`,`item`,`ChanceOrQuestChance`,`groupid`) VALUES
|
||||
(4813,41808,58,1),
|
||||
(4813,43572,20.5,1),
|
||||
(4813,36794,5.4,1),
|
||||
(4813,4875,5,1),
|
||||
(4813,3671,4.5,1),
|
||||
(4813,25447,4.5,1),
|
||||
(4813,44475,1.1,1),
|
||||
(4813,37705,1,1);
|
||||
@@ -169,7 +169,7 @@ class CreatureAI : public UnitAI
|
||||
|
||||
virtual void PassengerBoarded(Unit* /*passenger*/, int8 /*seatId*/, bool /*apply*/) {}
|
||||
|
||||
virtual void OnSpellClick(Unit* /*clicker*/) { }
|
||||
virtual void OnSpellClick(Unit* /*clicker*/, bool& /*result*/) { }
|
||||
|
||||
virtual bool CanSeeAlways(WorldObject const* /*obj*/) { return false; }
|
||||
protected:
|
||||
|
||||
@@ -828,8 +828,11 @@ void SmartAI::sOnGameEvent(bool start, uint16 eventId)
|
||||
GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, NULL, eventId);
|
||||
}
|
||||
|
||||
void SmartAI::OnSpellClick(Unit* clicker)
|
||||
void SmartAI::OnSpellClick(Unit* clicker, bool& result)
|
||||
{
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_ON_SPELLCLICK, clicker);
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ class SmartAI : public CreatureAI
|
||||
|
||||
void RemoveAuras();
|
||||
|
||||
void OnSpellClick(Unit* clicker);
|
||||
void OnSpellClick(Unit* clicker, bool& result);
|
||||
|
||||
private:
|
||||
uint32 mFollowCreditType;
|
||||
|
||||
@@ -117,7 +117,7 @@ class SmartScript
|
||||
smart = false;
|
||||
|
||||
if (!smart)
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript: Action target Creature(entry: %u) is not using SmartAI, action skipped to prevent crash.", c ? c->GetEntry() : (me ? me->GetEntry() : 0));
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript: Action target Creature (GUID: %u Entry: %u) is not using SmartAI, action skipped to prevent crash.", c ? c->GetDBTableGUIDLow() : (me ? me->GetDBTableGUIDLow() : 0), c ? c->GetEntry() : (me ? me->GetEntry() : 0));
|
||||
|
||||
return smart;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ class SmartScript
|
||||
if (!go || go->GetAIName() != "SmartGameObjectAI")
|
||||
smart = false;
|
||||
if (!smart)
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript: Action target GameObject(entry: %u) is not using SmartGameObjectAI, action skipped to prevent crash.", g ? g->GetEntry() : (go ? go->GetEntry() : 0));
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript: Action target GameObject (GUID: %u Entry: %u) is not using SmartGameObjectAI, action skipped to prevent crash.", g ? g->GetDBTableGUIDLow() : (go ? go->GetDBTableGUIDLow() : 0), g ? g->GetEntry() : (go ? go->GetEntry() : 0));
|
||||
|
||||
return smart;
|
||||
}
|
||||
|
||||
@@ -15848,12 +15848,9 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
|
||||
result = true;
|
||||
}
|
||||
|
||||
if (result)
|
||||
{
|
||||
Creature* creature = ToCreature();
|
||||
if (creature && creature->IsAIEnabled)
|
||||
creature->AI()->OnSpellClick(clicker);
|
||||
}
|
||||
Creature* creature = ToCreature();
|
||||
if (creature && creature->IsAIEnabled)
|
||||
creature->AI()->OnSpellClick(clicker, result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -5689,7 +5689,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
|
||||
MapEntry const* map = sMapStore.LookupEntry(MapId);
|
||||
|
||||
// not need to check validity of map object; MapId _MUST_ be valid here
|
||||
if (range.first == range.second && !map->IsBattleArena())
|
||||
if (range.first == range.second && !map->IsBattlegroundOrArena())
|
||||
{
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
|
||||
return GetDefaultGraveYard(team);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "MoveSplineInit.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "Player.h"
|
||||
#include "CreatureGroups.h"
|
||||
|
||||
//----- Point Movement Generator
|
||||
template<class T>
|
||||
@@ -42,6 +43,11 @@ void PointMovementGenerator<T>::DoInitialize(T* unit)
|
||||
if (speed > 0.0f)
|
||||
init.SetVelocity(speed);
|
||||
init.Launch();
|
||||
|
||||
//Call for creature group update
|
||||
if (Creature* creature = unit->ToCreature())
|
||||
if (creature->GetFormation() && creature->GetFormation()->getLeader() == creature)
|
||||
creature->GetFormation()->LeaderMoveTo(i_x, i_y, i_z);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -66,6 +72,11 @@ bool PointMovementGenerator<T>::DoUpdate(T* unit, uint32 /*diff*/)
|
||||
if (speed > 0.0f) // Default value for point motion type is 0.0, if 0.0 spline will use GetSpeed on unit
|
||||
init.SetVelocity(speed);
|
||||
init.Launch();
|
||||
|
||||
//Call for creature group update
|
||||
if (Creature* creature = unit->ToCreature())
|
||||
if (creature->GetFormation() && creature->GetFormation()->getLeader() == creature)
|
||||
creature->GetFormation()->LeaderMoveTo(i_x, i_y, i_z);
|
||||
}
|
||||
|
||||
return !unit->movespline->Finalized();
|
||||
|
||||
@@ -29,11 +29,7 @@ namespace Movement
|
||||
{
|
||||
UnitMoveType SelectSpeedType(uint32 moveFlags)
|
||||
{
|
||||
/*! Not sure about MOVEMENTFLAG_CAN_FLY here - do creatures that can fly
|
||||
but are on ground right now also have it? If yes, this needs a more
|
||||
dynamic check, such as is flying now
|
||||
*/
|
||||
if (moveFlags & (MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_DISABLE_GRAVITY))
|
||||
if (moveFlags & MOVEMENTFLAG_FLYING)
|
||||
{
|
||||
if (moveFlags & MOVEMENTFLAG_BACKWARD /*&& speed_obj.flight >= speed_obj.flight_back*/)
|
||||
return MOVE_FLIGHT_BACK;
|
||||
@@ -55,6 +51,8 @@ namespace Movement
|
||||
else if (moveFlags & MOVEMENTFLAG_BACKWARD /*&& speed_obj.run >= speed_obj.run_back*/)
|
||||
return MOVE_RUN_BACK;
|
||||
|
||||
// Flying creatures use MOVEMENTFLAG_CAN_FLY or MOVEMENTFLAG_DISABLE_GRAVITY
|
||||
// Run speed is their default flight speed.
|
||||
return MOVE_RUN;
|
||||
}
|
||||
|
||||
@@ -88,22 +86,25 @@ namespace Movement
|
||||
move_spline.onTransport = (unit->GetTransGUID() != 0);
|
||||
|
||||
uint32 moveFlags = unit->m_movementInfo.GetMovementFlags();
|
||||
if (args.flags.walkmode)
|
||||
moveFlags |= MOVEMENTFLAG_WALKING;
|
||||
else
|
||||
moveFlags &= ~MOVEMENTFLAG_WALKING;
|
||||
|
||||
moveFlags |= MOVEMENTFLAG_FORWARD;
|
||||
|
||||
if (!args.HasVelocity)
|
||||
args.velocity = unit->GetSpeed(SelectSpeedType(moveFlags));
|
||||
|
||||
if (!args.Validate(unit))
|
||||
return 0;
|
||||
|
||||
if (moveFlags & MOVEMENTFLAG_ROOT)
|
||||
moveFlags &= ~MOVEMENTFLAG_MASK_MOVING;
|
||||
|
||||
if (!args.HasVelocity)
|
||||
{
|
||||
// If spline is initialized with SetWalk method it only means we need to select
|
||||
// walk move speed for it but not add walk flag to unit
|
||||
uint32 moveFlagsForSpeed = moveFlags;
|
||||
if (args.flags.walkmode)
|
||||
moveFlagsForSpeed |= MOVEMENTFLAG_WALKING;
|
||||
|
||||
args.velocity = unit->GetSpeed(SelectSpeedType(moveFlagsForSpeed));
|
||||
}
|
||||
|
||||
if (!args.Validate(unit))
|
||||
return 0;
|
||||
|
||||
unit->m_movementInfo.SetMovementFlags(moveFlags);
|
||||
move_spline.Initialize(args);
|
||||
|
||||
|
||||
@@ -1013,8 +1013,11 @@ class npc_dream_portal : public CreatureScript
|
||||
{
|
||||
}
|
||||
|
||||
void OnSpellClick(Unit* /*clicker*/)
|
||||
void OnSpellClick(Unit* /*clicker*/, bool& result)
|
||||
{
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
_used = true;
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
@@ -709,8 +709,11 @@ class boss_flame_leviathan_overload_device : public CreatureScript
|
||||
{
|
||||
}
|
||||
|
||||
void OnSpellClick(Unit* /*clicker*/)
|
||||
void OnSpellClick(Unit* /*clicker*/, bool& result)
|
||||
{
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
if (me->GetVehicle())
|
||||
{
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
|
||||
|
||||
@@ -1421,8 +1421,10 @@ class npc_descend_into_madness : public CreatureScript
|
||||
{
|
||||
npc_descend_into_madnessAI(Creature* creature) : PassiveAI(creature), _instance(creature->GetInstanceScript()) { }
|
||||
|
||||
void OnSpellClick(Unit* clicker)
|
||||
void OnSpellClick(Unit* clicker, bool& result)
|
||||
{
|
||||
if (!result)
|
||||
return;
|
||||
clicker->RemoveAurasDueToSpell(SPELL_BRAIN_LINK);
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user