mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
Skill Tasks changes
Addressed an issue where the Spinjitzu Initiate achievement would not progress. This also allows mission tasks that specify that the player must get a kill on an enemy with a skill to progress. Tested mission 1935 and 1139 and both missions progressed and completed as intended.
This commit is contained in:
@@ -593,7 +593,7 @@ void DestroyableComponent::Repair(const uint32_t armor)
|
||||
}
|
||||
|
||||
|
||||
void DestroyableComponent::Damage(uint32_t damage, const LWOOBJID source, bool echo)
|
||||
void DestroyableComponent::Damage(uint32_t damage, const LWOOBJID source, uint32_t skillID, bool echo)
|
||||
{
|
||||
if (GetHealth() <= 0)
|
||||
{
|
||||
@@ -677,11 +677,10 @@ void DestroyableComponent::Damage(uint32_t damage, const LWOOBJID source, bool e
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Smash(source);
|
||||
Smash(source, eKillType::VIOLENT, u"", skillID);
|
||||
}
|
||||
|
||||
void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType, const std::u16string& deathType)
|
||||
void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType, const std::u16string& deathType, uint32_t skillID)
|
||||
{
|
||||
if (m_iHealth > 0)
|
||||
{
|
||||
@@ -727,31 +726,20 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType
|
||||
if (memberMissions == nullptr) continue;
|
||||
|
||||
memberMissions->Progress(MissionTaskType::MISSION_TASK_TYPE_SMASH, m_Parent->GetLOT());
|
||||
memberMissions->Progress(MissionTaskType::MISSION_TASK_TYPE_SKILL, m_Parent->GetLOT(), skillID);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
missions->Progress(MissionTaskType::MISSION_TASK_TYPE_SMASH, m_Parent->GetLOT());
|
||||
missions->Progress(MissionTaskType::MISSION_TASK_TYPE_SKILL, m_Parent->GetLOT(), skillID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const auto isPlayer = m_Parent->IsPlayer();
|
||||
|
||||
GameMessages::SendDie(
|
||||
m_Parent,
|
||||
source,
|
||||
source,
|
||||
true,
|
||||
killType,
|
||||
deathType,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
isPlayer,
|
||||
false,
|
||||
1
|
||||
);
|
||||
GameMessages::SendDie(m_Parent, source, source, true, killType, deathType, 0, 0, 0, isPlayer, false, 1);
|
||||
|
||||
//NANI?!
|
||||
if (!isPlayer)
|
||||
|
@@ -377,17 +377,19 @@ public:
|
||||
* Attempt to damage this entity, handles everything from health and armor to absorption, immunity and callbacks.
|
||||
* @param damage the damage to attempt to apply
|
||||
* @param source the attacker that caused this damage
|
||||
* @param skillID the skill that damaged this entity
|
||||
* @param echo whether or not to serialize the damage
|
||||
*/
|
||||
void Damage(uint32_t damage, LWOOBJID source, bool echo = true);
|
||||
void Damage(uint32_t damage, LWOOBJID source, uint32_t skillID = 0, bool echo = true);
|
||||
|
||||
/**
|
||||
* Smashes this entity, notifying all clients
|
||||
* @param source the source that smashed this entity
|
||||
* @param skillID the skill that killed this entity
|
||||
* @param killType the way this entity was killed, determines if a client animation is played
|
||||
* @param deathType the animation to play when killed
|
||||
*/
|
||||
void Smash(LWOOBJID source, eKillType killType = eKillType::VIOLENT, const std::u16string& deathType = u"");
|
||||
void Smash(LWOOBJID source, eKillType killType = eKillType::VIOLENT, const std::u16string& deathType = u"", uint32_t skillID = 0);
|
||||
|
||||
/**
|
||||
* Pushes a layer of immunity to this entity, making it immune for longer
|
||||
|
@@ -25,12 +25,14 @@ ProjectileSyncEntry::ProjectileSyncEntry()
|
||||
{
|
||||
}
|
||||
|
||||
bool SkillComponent::CastPlayerSkill(const uint32_t behaviorId, const uint32_t skillUid, RakNet::BitStream* bitStream, const LWOOBJID target)
|
||||
bool SkillComponent::CastPlayerSkill(const uint32_t behaviorId, const uint32_t skillUid, RakNet::BitStream* bitStream, const LWOOBJID target, uint32_t skillID)
|
||||
{
|
||||
auto* context = new BehaviorContext(this->m_Parent->GetObjectID());
|
||||
|
||||
context->caster = m_Parent->GetObjectID();
|
||||
|
||||
context->skillID = skillID;
|
||||
|
||||
this->m_managedBehaviors.insert_or_assign(skillUid, context);
|
||||
|
||||
auto* behavior = Behavior::CreateBehavior(behaviorId);
|
||||
|
@@ -92,7 +92,7 @@ public:
|
||||
* @param bitStream the bitSteam given by the client to determine the behavior path
|
||||
* @param target the explicit target of the skill
|
||||
*/
|
||||
bool CastPlayerSkill(uint32_t behaviorId, uint32_t skillUid, RakNet::BitStream* bitStream, LWOOBJID target);
|
||||
bool CastPlayerSkill(uint32_t behaviorId, uint32_t skillUid, RakNet::BitStream* bitStream, LWOOBJID target, uint32_t skillID = 0);
|
||||
|
||||
/**
|
||||
* Continues a player skill. Should only be called when the server receives a sync message from the client.
|
||||
|
Reference in New Issue
Block a user