mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 17:54:01 +00:00
Organize dScripts (#814)
* Organize dScripts whitespace Remove parent scope Remove parent scope from initial setter Remove debug Remove helper programs * Fix NtImagimeterVisibility script Co-authored-by: aronwk-aaron <aronwk.aaron@gmail.com>
This commit is contained in:
39
dScripts/ai/PROPERTY/AG/AgPropGuard.cpp
Normal file
39
dScripts/ai/PROPERTY/AG/AgPropGuard.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#include "AgPropGuard.h"
|
||||
#include "Entity.h"
|
||||
#include "Character.h"
|
||||
#include "EntityManager.h"
|
||||
#include "InventoryComponent.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "Item.h"
|
||||
|
||||
void AgPropGuard::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) {
|
||||
auto* character = target->GetCharacter();
|
||||
auto* missionComponent = target->GetComponent<MissionComponent>();
|
||||
auto* inventoryComponent = target->GetComponent<InventoryComponent>();
|
||||
|
||||
const auto state = missionComponent->GetMissionState(320);
|
||||
if (missionID == 768 && missionState == MissionState::MISSION_STATE_AVAILABLE) {
|
||||
if (!character->GetPlayerFlag(71)) {
|
||||
// TODO: Cinematic "MissionCam"
|
||||
}
|
||||
} else if (missionID == 768 && missionState >= MissionState::MISSION_STATE_READY_TO_COMPLETE) {
|
||||
//remove the inventory items
|
||||
for (int item : gearSets) {
|
||||
auto* id = inventoryComponent->FindItemByLot(item);
|
||||
|
||||
if (id) {
|
||||
inventoryComponent->UnEquipItem(id);
|
||||
inventoryComponent->RemoveItem(id->GetLot(), id->GetCount());
|
||||
}
|
||||
}
|
||||
} else if (
|
||||
(missionID == 320 && state == MissionState::MISSION_STATE_AVAILABLE) /*||
|
||||
(state == MissionState::MISSION_STATE_COMPLETE && missionID == 891 && missionState == MissionState::MISSION_STATE_READY_TO_COMPLETE)*/
|
||||
) {
|
||||
//GameMessages::SendNotifyClientObject(EntityManager::Instance()->GetZoneControlEntity()->GetObjectID(), u"GuardChat", target->GetObjectID(), 0, target->GetObjectID(), "", target->GetSystemAddress());
|
||||
|
||||
target->GetCharacter()->SetPlayerFlag(113, true);
|
||||
|
||||
EntityManager::Instance()->GetZoneControlEntity()->AddTimer("GuardFlyAway", 1.0f);
|
||||
}
|
||||
}
|
11
dScripts/ai/PROPERTY/AG/AgPropGuard.h
Normal file
11
dScripts/ai/PROPERTY/AG/AgPropGuard.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class AgPropGuard final : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) override;
|
||||
|
||||
private:
|
||||
std::vector<int> gearSets = { 14359,14321,14353,14315 };
|
||||
};
|
3
dScripts/ai/PROPERTY/AG/CMakeLists.txt
Normal file
3
dScripts/ai/PROPERTY/AG/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
set(DSCRIPTS_SOURCES_AI_PROPERTY_AG
|
||||
"AgPropGuard.cpp"
|
||||
PARENT_SCOPE)
|
Reference in New Issue
Block a user