mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 10:44:08 +00:00
Merge branch 'main' into die-roll-anims-ckawell
This commit is contained in:
24
dScripts/BuccaneerValiantShip.cpp
Normal file
24
dScripts/BuccaneerValiantShip.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "BuccaneerValiantShip.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "dLogger.h"
|
||||
|
||||
void BuccaneerValiantShip::OnStartup(Entity* self) {
|
||||
const auto skill = 982;
|
||||
const auto behavior = 20577;
|
||||
const auto skillCastTimer = 1.0F;
|
||||
|
||||
self->AddCallbackTimer(skillCastTimer, [self]() {
|
||||
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||
auto* owner = self->GetOwner();
|
||||
|
||||
if (skillComponent != nullptr && owner != nullptr) {
|
||||
skillComponent->CalculateBehavior(skill, behavior, LWOOBJID_EMPTY, true, false, owner->GetObjectID());
|
||||
|
||||
// Kill self if missed
|
||||
const auto selfSmashTimer = 1.1F;
|
||||
self->AddCallbackTimer(selfSmashTimer, [self]() {
|
||||
self->Kill();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
6
dScripts/BuccaneerValiantShip.h
Normal file
6
dScripts/BuccaneerValiantShip.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class BuccaneerValiantShip : public CppScripts::Script {
|
||||
void OnStartup(Entity *self) override;
|
||||
};
|
@@ -262,6 +262,7 @@
|
||||
#include "PropertyDevice.h"
|
||||
#include "ImaginationBackpackHealServer.h"
|
||||
#include "LegoDieRoll.h"
|
||||
#include "BuccaneerValiantShip.h"
|
||||
|
||||
// Survival scripts
|
||||
#include "AgSurvivalStromling.h"
|
||||
@@ -777,6 +778,8 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
|
||||
script = new ImaginationBackpackHealServer();
|
||||
else if (scriptName == "scripts\\ai\\GENERAL\\L_LEGO_DIE_ROLL.lua")
|
||||
script = new LegoDieRoll();
|
||||
else if (scriptName == "scripts\\EquipmentScripts\\BuccaneerValiantShip.lua")
|
||||
script = new BuccaneerValiantShip();
|
||||
|
||||
//Ignore these scripts:
|
||||
else if (scriptName == "scripts\\02_server\\Enemy\\General\\L_SUSPEND_LUA_AI.lua")
|
||||
@@ -785,7 +788,8 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
|
||||
script = invalidToReturn;
|
||||
else if (script == invalidToReturn) {
|
||||
if (scriptName.length() > 0)
|
||||
Game::logger->Log("CppScripts", "Attempted to load CppScript for '" + scriptName + "', but returned InvalidScript.\n");
|
||||
Game::logger->LogDebug("CppScripts", "Attempted to load CppScript for '" + scriptName + "', but returned InvalidScript.\n");
|
||||
// information not really needed for sys admins but is for developers
|
||||
|
||||
script = invalidToReturn;
|
||||
}
|
||||
|
Reference in New Issue
Block a user