mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
core merge fixes for playerbots
This commit is contained in:
@@ -97,6 +97,32 @@ public:
|
||||
return _eventMap.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Current internal time as uint32 milliseconds
|
||||
*
|
||||
* was removed in core https://github.com/azerothcore/azerothcore-wotlk/pull/23121,
|
||||
* but still required atm for mod-playerbot.
|
||||
*/
|
||||
uint32 GetTimer() const
|
||||
{
|
||||
return static_cast<uint32>(duration_cast<Milliseconds>(_time.time_since_epoch()).count());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Time of found even
|
||||
*
|
||||
* was removed in core https://github.com/azerothcore/azerothcore-wotlk/pull/23121,
|
||||
* but still required atm for mod-playerbot.
|
||||
*/
|
||||
uint32 GetNextEventTime(uint16 eventId) const
|
||||
{
|
||||
auto timeUntil = GetTimeUntilEvent(eventId);
|
||||
if (timeUntil == Milliseconds::max())
|
||||
return 0;
|
||||
|
||||
return GetTimer() + static_cast<uint32>(timeUntil.count());
|
||||
}
|
||||
|
||||
/**
|
||||
* @name SetPhase
|
||||
* @brief Sets the phase of the map (absolute).
|
||||
|
||||
@@ -939,7 +939,7 @@ void MotionMaster::MoveKnockbackFromForPlayer(float srcX, float srcY, float spee
|
||||
init.SetOrientationFixed(true);
|
||||
init.SetVelocity(speedXY);
|
||||
init.Launch();
|
||||
Mutate(new EffectMovementGenerator(0), MOTION_SLOT_CONTROLLED);
|
||||
Mutate(new EffectMovementGenerator(init, 0), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
|
||||
// Similar to MovePoint except setting orientationInversed
|
||||
@@ -951,12 +951,12 @@ void MotionMaster::MovePointBackwards(uint32 id, float x, float y, float z, bool
|
||||
if (_owner->IsPlayer())
|
||||
{
|
||||
LOG_DEBUG("movement.motionmaster", "Player ({}) targeted point (Id: {} X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), id, x, y, z);
|
||||
Mutate(new PointMovementGenerator<Player>(id, x, y, z, 0.0f, orientation, nullptr, generatePath, forceDestination, ObjectGuid::Empty, true), slot);
|
||||
Mutate(new PointMovementGenerator<Player>(id, x, y, z,FORCED_MOVEMENT_NONE,0.0f,orientation,nullptr,generatePath,forceDestination), slot);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("movement.motionmaster", "Creature ({}) targeted point (ID: {} X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), id, x, y, z);
|
||||
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, 0.0f, orientation, nullptr, generatePath, forceDestination, ObjectGuid::Empty, true), slot);
|
||||
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, FORCED_MOVEMENT_NONE, 0.0f, orientation, nullptr, generatePath, forceDestination), slot);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ void PointMovementGenerator<T>::DoInitialize(T* unit)
|
||||
i_recalculateSpeed = false;
|
||||
Movement::MoveSplineInit init(unit);
|
||||
/// Added by mod-playerbots
|
||||
if (_orientationInversed)
|
||||
if (_reverseOrientation)
|
||||
init.SetOrientationInversed();
|
||||
/// End added
|
||||
if (m_precomputedPath.size() > 2) // pussywizard: for charge
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
me->SetInCombatWithZone();
|
||||
events.ScheduleEvent(EVENT_MORTAL_WOUND, 10s);
|
||||
events.ScheduleEvent(EVENT_ENRAGE, 22s);
|
||||
events.ScheduleEvent(EVENT_DECIMATE, RAID_MODE(110000, 90000));
|
||||
events.ScheduleEvent(EVENT_DECIMATE, RAID_MODE(110s, 90s));
|
||||
events.ScheduleEvent(EVENT_BERSERK, 6min);
|
||||
events.ScheduleEvent(EVENT_SUMMON_ZOMBIE, 10s);
|
||||
events.ScheduleEvent(EVENT_CAN_EAT_ZOMBIE, 1s);
|
||||
@@ -182,7 +182,7 @@ public:
|
||||
case EVENT_DECIMATE:
|
||||
Talk(EMOTE_DECIMATE);
|
||||
me->CastSpell(me, RAID_MODE(SPELL_DECIMATE_10, SPELL_DECIMATE_25), false);
|
||||
events.RepeatEvent(RAID_MODE(110000, 90000));
|
||||
events.Repeat(RAID_MODE(110s, 90s));
|
||||
break;
|
||||
case EVENT_SUMMON_ZOMBIE:
|
||||
{
|
||||
@@ -206,7 +206,7 @@ public:
|
||||
break;
|
||||
}
|
||||
case EVENT_CAN_EAT_ZOMBIE:
|
||||
events.RepeatEvent(1000);
|
||||
events.Repeat(1s);
|
||||
if (me->GetVictim()->GetEntry() == NPC_ZOMBIE_CHOW && me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
me->CastCustomSpell(SPELL_CHOW_SEARCHER, SPELLVALUE_RADIUS_MOD, 20000, me, true);
|
||||
|
||||
@@ -428,7 +428,7 @@ public:
|
||||
if (gothikWaves[waveCount][0])
|
||||
{
|
||||
SummonHelpers(gothikWaves[waveCount][0]);
|
||||
events.RepeatEvent(gothikWaves[waveCount][1]);
|
||||
events.Repeat(Milliseconds(gothikWaves[waveCount][1]));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -510,7 +510,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, 3s);
|
||||
break;
|
||||
case NPC_DEAD_RIDER:
|
||||
events.ScheduleEvent(EVENT_DRAIN_LIFE, 2000ms, 3500ms);
|
||||
events.ScheduleEvent(EVENT_DRAIN_LIFE, 2s, 3500ms);
|
||||
events.ScheduleEvent(EVENT_UNHOLY_FRENZY, 5s, 9s);
|
||||
break;
|
||||
case NPC_DEAD_HORSE:
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_POISON_CLOUD, 15s);
|
||||
events.ScheduleEvent(EVENT_MUTATING_INJECTION, 20s);
|
||||
events.ScheduleEvent(EVENT_SLIME_SPRAY, 10s);
|
||||
events.ScheduleEvent(EVENT_BERSERK, RAID_MODE(720000, 540000));
|
||||
events.ScheduleEvent(EVENT_BERSERK, RAID_MODE(720s, 540s));
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
{
|
||||
me->CastSpell(target, SPELL_MUTATING_INJECTION, false);
|
||||
}
|
||||
events.RepeatEvent(6000 + uint32(120 * me->GetHealthPct()));
|
||||
events.Repeat(Milliseconds(6000 + uint32(120 * me->GetHealthPct())));
|
||||
break;
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -279,6 +279,7 @@ class spell_grobbulus_mutating_injection_aura : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -439,7 +439,7 @@ public:
|
||||
cr->AI()->Talk(SAY_ANSWER_REQUEST);
|
||||
|
||||
for (uint8 i = 0 ; i < RAID_MODE(2, 4); ++i)
|
||||
events.ScheduleEvent(EVENT_SUMMON_GUARDIAN_OF_ICECROWN, 10000 + (i * 5000));
|
||||
events.ScheduleEvent(EVENT_SUMMON_GUARDIAN_OF_ICECROWN, Milliseconds(10000 + (i * 5000)));
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -495,7 +495,7 @@ public:
|
||||
{
|
||||
if (!me->IsInCombat())
|
||||
{
|
||||
me->DespawnOrUnsummon(500);
|
||||
me->DespawnOrUnsummon(500ms);
|
||||
}
|
||||
}
|
||||
if (param == ACTION_GUARDIANS_OFF)
|
||||
|
||||
@@ -268,7 +268,7 @@ public:
|
||||
{
|
||||
cr->GetMotionMaster()->MoveRandom(40);
|
||||
}
|
||||
events.RepeatEvent(RAID_MODE(8000, 6500));
|
||||
events.Repeat(RAID_MODE(8000ms, 6500ms));
|
||||
return;
|
||||
}
|
||||
case EVENT_FLIGHT_START:
|
||||
@@ -337,7 +337,7 @@ public:
|
||||
blockList.push_back((*itr)->GetGUID());
|
||||
currentTarget = (*itr)->GetGUID();
|
||||
--iceboltCount;
|
||||
events.ScheduleEvent(EVENT_FLIGHT_ICEBOLT, (me->GetExactDist(*itr) / 13.0f)*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_FLIGHT_ICEBOLT, Seconds(uint32(me->GetExactDist(*itr) / 13.0f)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user