mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-01-09 14:27:10 +00:00
Simplify
tested that things still work as intended
This commit is contained in:
parent
9e4de544a6
commit
5cdff8bcaf
@ -295,19 +295,8 @@
|
|||||||
#include "WblGenericZone.h"
|
#include "WblGenericZone.h"
|
||||||
|
|
||||||
// pickups
|
// pickups
|
||||||
#include "Special1BronzeCoinSpawner.h"
|
#include "SpecialCoinSpawner.h"
|
||||||
#include "Special1SilverCoinSpawner.h"
|
#include "SpecialPowerupSpawner.h"
|
||||||
#include "Special10BronzeCoinSpawner.h"
|
|
||||||
#include "Special25BronzeCoinSpawner.h"
|
|
||||||
#include "Special10SilverCoinSpawner.h"
|
|
||||||
#include "Special25SilverCoinSpawner.h"
|
|
||||||
#include "Special1GoldCoinSpawner.h"
|
|
||||||
#include "Special10GoldCoinSpawner.h"
|
|
||||||
#include "Special25GoldCoinSpawner.h"
|
|
||||||
#include "SpecialImaginePowerupSpawner.h"
|
|
||||||
#include "SpecialImaginePowerupSpawner2pt.h"
|
|
||||||
#include "SpecialLifePowerupSpawner.h"
|
|
||||||
#include "SpecialArmorPowerupSpawner.h"
|
|
||||||
|
|
||||||
//Big bad global bc this is a namespace and not a class:
|
//Big bad global bc this is a namespace and not a class:
|
||||||
InvalidScript* invalidToReturn = new InvalidScript();
|
InvalidScript* invalidToReturn = new InvalidScript();
|
||||||
@ -874,31 +863,31 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
|
|||||||
|
|
||||||
// pickups
|
// pickups
|
||||||
if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_1_BRONZE-COIN-SPAWNER.lua")
|
if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_1_BRONZE-COIN-SPAWNER.lua")
|
||||||
script = new Special1BronzeCoinSpawner();
|
script = new SpecialCoinSpawner(1);
|
||||||
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_1_SILVER-COIN-SPAWNER.lua")
|
|
||||||
script = new Special1SilverCoinSpawner();
|
|
||||||
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_10_BRONZE-COIN-SPAWNER.lua")
|
|
||||||
script = new Special10BronzeCoinSpawner();
|
|
||||||
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_25_BRONZE-COIN-SPAWNER.lua")
|
|
||||||
script = new Special25BronzeCoinSpawner();
|
|
||||||
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_10_SILVER-COIN-SPAWNER.lua")
|
|
||||||
script = new Special10SilverCoinSpawner();
|
|
||||||
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_25_SILVER-COIN-SPAWNER.lua")
|
|
||||||
script = new Special25SilverCoinSpawner();
|
|
||||||
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_1_GOLD-COIN-SPAWNER.lua")
|
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_1_GOLD-COIN-SPAWNER.lua")
|
||||||
script = new Special1GoldCoinSpawner();
|
script = new SpecialCoinSpawner(10000);
|
||||||
|
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_1_SILVER-COIN-SPAWNER.lua")
|
||||||
|
script = new SpecialCoinSpawner(100);
|
||||||
|
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_10_BRONZE-COIN-SPAWNER.lua")
|
||||||
|
script = new SpecialCoinSpawner(10);
|
||||||
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_10_GOLD-COIN-SPAWNER.lua")
|
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_10_GOLD-COIN-SPAWNER.lua")
|
||||||
script = new Special10GoldCoinSpawner();
|
script = new SpecialCoinSpawner(100000);
|
||||||
|
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_10_SILVER-COIN-SPAWNER.lua")
|
||||||
|
script = new SpecialCoinSpawner(1000);
|
||||||
|
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_25_BRONZE-COIN-SPAWNER.lua")
|
||||||
|
script = new SpecialCoinSpawner(25);
|
||||||
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_25_GOLD-COIN-SPAWNER.lua")
|
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_25_GOLD-COIN-SPAWNER.lua")
|
||||||
script = new Special25GoldCoinSpawner();
|
script = new SpecialCoinSpawner(250000);
|
||||||
|
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_25_SILVER-COIN-SPAWNER.lua")
|
||||||
|
script = new SpecialCoinSpawner(2500);
|
||||||
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_IMAGINE-POWERUP-SPAWNER.lua")
|
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_IMAGINE-POWERUP-SPAWNER.lua")
|
||||||
script = new SpecialImaginePowerupSpawner();
|
script = new SpecialPowerupSpawner(13);
|
||||||
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_IMAGINE-POWERUP-SPAWNER-2PT.lua")
|
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_IMAGINE-POWERUP-SPAWNER-2PT.lua")
|
||||||
script = new SpecialImaginePowerupSpawner2pt();
|
script = new SpecialPowerupSpawner(129);
|
||||||
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_LIFE-POWERUP-SPAWNER.lua")
|
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_LIFE-POWERUP-SPAWNER.lua")
|
||||||
script = new SpecialLifePowerupSpawner();
|
script = new SpecialPowerupSpawner(5);
|
||||||
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_ARMOR-POWERUP-SPAWNER.lua")
|
else if (scriptName == "scripts\\ai\\SPEC\\L_SPECIAL_ARMOR-POWERUP-SPAWNER.lua")
|
||||||
script = new SpecialArmorPowerupSpawner();
|
script = new SpecialPowerupSpawner(80);
|
||||||
|
|
||||||
// handle invalid script reporting if the path is greater than zero and it's not an ignored script
|
// handle invalid script reporting if the path is greater than zero and it's not an ignored script
|
||||||
// information not really needed for sys admins but is for developers
|
// information not really needed for sys admins but is for developers
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
#ifndef __SPECIAL10BRONZECOINSPAWNER__H__
|
|
||||||
#define __SPECIAL10BRONZECOINSPAWNER__H__
|
|
||||||
|
|
||||||
#include "SpecialCoinSpawner.h"
|
|
||||||
|
|
||||||
class Special10BronzeCoinSpawner : public SpecialCoinSpawner {
|
|
||||||
public:
|
|
||||||
Special10BronzeCoinSpawner() : SpecialCoinSpawner(m_currencyDenomination) {};
|
|
||||||
private:
|
|
||||||
static const uint32_t m_currencyDenomination = 10;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //!__SPECIAL10BRONZECOINSPAWNER__H__
|
|
@ -1,13 +0,0 @@
|
|||||||
#ifndef __SPECIAL10GOLDCOINSPAWNER__H__
|
|
||||||
#define __SPECIAL10GOLDCOINSPAWNER__H__
|
|
||||||
|
|
||||||
#include "SpecialCoinSpawner.h"
|
|
||||||
|
|
||||||
class Special10GoldCoinSpawner : public SpecialCoinSpawner {
|
|
||||||
public:
|
|
||||||
Special10GoldCoinSpawner() : SpecialCoinSpawner(m_currencyDenomination) {};
|
|
||||||
private:
|
|
||||||
static const uint32_t m_currencyDenomination = 100000;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //!__SPECIAL10GOLDCOINSPAWNER__H__
|
|
@ -1,13 +0,0 @@
|
|||||||
#ifndef __SPECIAL10SILVERCOINSPAWNER__H__
|
|
||||||
#define __SPECIAL10SILVERCOINSPAWNER__H__
|
|
||||||
|
|
||||||
#include "SpecialCoinSpawner.h"
|
|
||||||
|
|
||||||
class Special10SilverCoinSpawner : public SpecialCoinSpawner {
|
|
||||||
public:
|
|
||||||
Special10SilverCoinSpawner() : SpecialCoinSpawner(m_currencyDenomination) {};
|
|
||||||
private:
|
|
||||||
static const uint32_t m_currencyDenomination = 1000;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //!__SPECIAL10SILVERCOINSPAWNER__H__
|
|
@ -1,15 +0,0 @@
|
|||||||
#ifndef __SPECIAL1BRONZECOINSPAWNER__H__
|
|
||||||
#define __SPECIAL1BRONZECOINSPAWNER__H__
|
|
||||||
|
|
||||||
#include "SpecialCoinSpawner.h"
|
|
||||||
|
|
||||||
class Special1BronzeCoinSpawner : public SpecialCoinSpawner {
|
|
||||||
public:
|
|
||||||
Special1BronzeCoinSpawner() : SpecialCoinSpawner(m_currencyDenomination) {};
|
|
||||||
private:
|
|
||||||
static const uint32_t m_currencyDenomination = 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //!__SPECIAL1BRONZECOINSPAWNER__H__
|
|
||||||
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
|||||||
#ifndef __SPECIAL1GOLDCOINSPAWNER__H__
|
|
||||||
#define __SPECIAL1GOLDCOINSPAWNER__H__
|
|
||||||
|
|
||||||
#include "SpecialCoinSpawner.h"
|
|
||||||
|
|
||||||
class Special1GoldCoinSpawner : public SpecialCoinSpawner {
|
|
||||||
public:
|
|
||||||
Special1GoldCoinSpawner() : SpecialCoinSpawner(m_currencyDenomination) {};
|
|
||||||
private:
|
|
||||||
static const uint32_t m_currencyDenomination = 10000;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //!__SPECIAL1GOLDCOINSPAWNER__H__
|
|
@ -1,13 +0,0 @@
|
|||||||
#ifndef __SPECIAL1SILVERCOINSPAWNER__H__
|
|
||||||
#define __SPECIAL1SILVERCOINSPAWNER__H__
|
|
||||||
|
|
||||||
#include "SpecialCoinSpawner.h"
|
|
||||||
|
|
||||||
class Special1SilverCoinSpawner : public SpecialCoinSpawner {
|
|
||||||
public:
|
|
||||||
Special1SilverCoinSpawner() : SpecialCoinSpawner(m_currencyDenomination) {};
|
|
||||||
private:
|
|
||||||
static const uint32_t m_currencyDenomination = 100;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //!__SPECIAL1SILVERCOINSPAWNER__H__
|
|
@ -1,13 +0,0 @@
|
|||||||
#ifndef __SPECIAL25BRONZECOINSPAWNER__H__
|
|
||||||
#define __SPECIAL25BRONZECOINSPAWNER__H__
|
|
||||||
|
|
||||||
#include "SpecialCoinSpawner.h"
|
|
||||||
|
|
||||||
class Special25BronzeCoinSpawner : public SpecialCoinSpawner {
|
|
||||||
public:
|
|
||||||
Special25BronzeCoinSpawner() : SpecialCoinSpawner(m_currencyDenomination) {};
|
|
||||||
private:
|
|
||||||
static const uint32_t m_currencyDenomination = 25;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //!__SPECIAL25BRONZECOINSPAWNER__H__
|
|
@ -1,13 +0,0 @@
|
|||||||
#ifndef __SPECIAL25GOLDCOINSPAWNER__H__
|
|
||||||
#define __SPECIAL25GOLDCOINSPAWNER__H__
|
|
||||||
|
|
||||||
#include "SpecialCoinSpawner.h"
|
|
||||||
|
|
||||||
class Special25GoldCoinSpawner : public SpecialCoinSpawner {
|
|
||||||
public:
|
|
||||||
Special25GoldCoinSpawner() : SpecialCoinSpawner(m_currencyDenomination) {};
|
|
||||||
private:
|
|
||||||
static const uint32_t m_currencyDenomination = 250000;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //!__SPECIAL25GOLDCOINSPAWNER__H__
|
|
@ -1,13 +0,0 @@
|
|||||||
#ifndef __SPECIAL25SILVERCOINSPAWNER__H__
|
|
||||||
#define __SPECIAL25SILVERCOINSPAWNER__H__
|
|
||||||
|
|
||||||
#include "SpecialCoinSpawner.h"
|
|
||||||
|
|
||||||
class Special25SilverCoinSpawner : public SpecialCoinSpawner {
|
|
||||||
public:
|
|
||||||
Special25SilverCoinSpawner() : SpecialCoinSpawner(m_currencyDenomination) {};
|
|
||||||
private:
|
|
||||||
static const uint32_t m_currencyDenomination = 2500;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //!__SPECIAL25SILVERCOINSPAWNER__H__
|
|
@ -1,14 +0,0 @@
|
|||||||
#ifndef __SPECIALARMORPOWERUPSPAWNER__H__
|
|
||||||
#define __SPECIALARMORPOWERUPSPAWNER__H__
|
|
||||||
|
|
||||||
#include "SpecialPowerupSpawner.h"
|
|
||||||
|
|
||||||
class SpecialArmorPowerupSpawner : public SpecialPowerupSpawner {
|
|
||||||
public:
|
|
||||||
SpecialArmorPowerupSpawner() : SpecialPowerupSpawner(m_SkillId) {};
|
|
||||||
private:
|
|
||||||
uint32_t m_SkillId = 80;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif //!__SPECIALARMORPOWERUPSPAWNER__H__
|
|
@ -11,6 +11,6 @@ void SpecialCoinSpawner::OnProximityUpdate(Entity* self, Entity* entering, const
|
|||||||
auto character = entering->GetCharacter();
|
auto character = entering->GetCharacter();
|
||||||
if (!character) return;
|
if (!character) return;
|
||||||
GameMessages::SendPlayFXEffect(self, -1, u"pickup", "", LWOOBJID_EMPTY, 1, 1, true);
|
GameMessages::SendPlayFXEffect(self, -1, u"pickup", "", LWOOBJID_EMPTY, 1, 1, true);
|
||||||
character->SetCoins(character->GetCoins() + this->m_currencyDenomination, eLootSourceType::LOOT_SOURCE_CURRENCY);
|
character->SetCoins(character->GetCoins() + this->m_CurrencyDenomination, eLootSourceType::LOOT_SOURCE_CURRENCY);
|
||||||
self->Smash(entering->GetObjectID(), eKillType::SILENT);
|
self->Smash(entering->GetObjectID(), eKillType::SILENT);
|
||||||
}
|
}
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
class SpecialCoinSpawner : public CppScripts::Script {
|
class SpecialCoinSpawner : public CppScripts::Script {
|
||||||
public:
|
public:
|
||||||
SpecialCoinSpawner(uint32_t CurrencyDenomination) {
|
SpecialCoinSpawner(uint32_t CurrencyDenomination) {
|
||||||
m_currencyDenomination = CurrencyDenomination;
|
m_CurrencyDenomination = CurrencyDenomination;
|
||||||
};
|
};
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void OnProximityUpdate(Entity* self, Entity* entering, const std::string name, const std::string status) override;
|
void OnProximityUpdate(Entity* self, Entity* entering, const std::string name, const std::string status) override;
|
||||||
private:
|
private:
|
||||||
int32_t m_currencyDenomination = 0;
|
int32_t m_CurrencyDenomination = 0;
|
||||||
};
|
};
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
#ifndef __SPECIALIMAGINEPOWERUPSPAWNER__H__
|
|
||||||
#define __SPECIALIMAGINEPOWERUPSPAWNER__H__
|
|
||||||
|
|
||||||
#include "SpecialPowerupSpawner.h"
|
|
||||||
|
|
||||||
class SpecialImaginePowerupSpawner : public SpecialPowerupSpawner {
|
|
||||||
public:
|
|
||||||
SpecialImaginePowerupSpawner() : SpecialPowerupSpawner(m_SkillId) {};
|
|
||||||
private:
|
|
||||||
uint32_t m_SkillId = 13;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //!__SPECIALIMAGINEPOWERUPSPAWNER__H__
|
|
@ -1,13 +0,0 @@
|
|||||||
#ifndef __SPECIALIMAGINEPOWERUPSPAWNER2PT__H__
|
|
||||||
#define __SPECIALIMAGINEPOWERUPSPAWNER2PT__H__
|
|
||||||
|
|
||||||
#include "SpecialPowerupSpawner.h"
|
|
||||||
|
|
||||||
class SpecialImaginePowerupSpawner2pt : public SpecialPowerupSpawner {
|
|
||||||
public:
|
|
||||||
SpecialImaginePowerupSpawner2pt() : SpecialPowerupSpawner(m_SkillId) {};
|
|
||||||
private:
|
|
||||||
uint32_t m_SkillId = 129;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //!__SPECIALIMAGINEPOWERUPSPAWNER2PT__H__
|
|
@ -1,13 +0,0 @@
|
|||||||
#ifndef __SPECIALLIFEPOWERUPSPAWNER__H__
|
|
||||||
#define __SPECIALLIFEPOWERUPSPAWNER__H__
|
|
||||||
|
|
||||||
#include "SpecialPowerupSpawner.h"
|
|
||||||
|
|
||||||
class SpecialLifePowerupSpawner : public SpecialPowerupSpawner {
|
|
||||||
public:
|
|
||||||
SpecialLifePowerupSpawner() : SpecialPowerupSpawner(m_SkillId) {};
|
|
||||||
private:
|
|
||||||
uint32_t m_SkillId = 5;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //!__SPECIALLIFEPOWERUPSPAWNER__H__
|
|
Loading…
Reference in New Issue
Block a user