mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-06-12 18:37:46 +00:00
Handle corals properly and show bloodymemo
This commit is contained in:
parent
6e5d3c5df6
commit
3411770be3
1 changed files with 37 additions and 9 deletions
|
@ -1,5 +1,6 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Territory/InstanceContent.h>
|
||||
#include <Manager/RNGMgr.h>
|
||||
#include <Actor/EventObject.h>
|
||||
|
||||
using namespace Sapphire;
|
||||
|
@ -8,7 +9,14 @@ class Sastasha :
|
|||
public Sapphire::ScriptAPI::InstanceContentScript
|
||||
{
|
||||
private:
|
||||
uint8_t coralCount = 0;
|
||||
enum Corals : int
|
||||
{
|
||||
Blue = 2000213,
|
||||
Red = 2000214,
|
||||
Green = 2000215
|
||||
};
|
||||
|
||||
Corals coral;
|
||||
|
||||
public:
|
||||
Sastasha() :
|
||||
|
@ -17,10 +25,27 @@ public:
|
|||
|
||||
void onInit( InstanceContent& instance ) override
|
||||
{
|
||||
// Random coral
|
||||
auto& RNGMgr = Common::Service< World::Manager::RNGMgr >::ref();
|
||||
coral = static_cast< Corals >( RNGMgr.getRandGenerator< float >( Corals::Blue, Corals::Green ).next() );
|
||||
|
||||
switch( coral )
|
||||
{
|
||||
case Corals::Blue:
|
||||
instance.registerEObj( "Bloodymemo", 2000212, 0, 4, { 320.812988f, 47.862450f, -130.776306f }, 0.600000f, -0.898762f );
|
||||
break;
|
||||
case Corals::Red:
|
||||
instance.registerEObj( "Bloodymemo", 2001548, 0, 4, { 320.812988f, 47.862450f, -130.776306f }, 0.600000f, -0.898762f );
|
||||
break;
|
||||
case Corals::Green:
|
||||
instance.registerEObj( "Bloodymemo", 2001549, 0, 4, { 320.812988f, 47.862450f, -130.776306f }, 0.600000f, -0.898762f );
|
||||
break;
|
||||
}
|
||||
|
||||
instance.registerEObj( "unknown_0", 2000211, 0, 4, { 367.827087f, 47.400051f, -226.694305f }, 4.714991f, 0.000432f );
|
||||
instance.registerEObj( "sgvf_w_lvd_b0250", 2001504, 4323996, 5, { 94.597588f, 26.865030f, -68.584061f }, 1.000000f, 0.000000f );
|
||||
instance.registerEObj( "sgvf_w_lvd_b0250", 2001504, 4323996, 1, { 94.597588f, 26.865030f, -68.584061f }, 1.000000f, 0.000000f );
|
||||
// States -> vf_bextwall_on (id: 3) vf_bextwall_of (id: 4)
|
||||
instance.registerEObj( "sgvf_w_lvd_b0249", 2001505, 4323997, 5, { 95.510597f, 26.620729f, -67.853653f }, 1.000000f, 0.000000f );
|
||||
instance.registerEObj( "sgvf_w_lvd_b0249", 2001505, 4323997, 1, { 95.510597f, 26.620729f, -67.853653f }, 1.000000f, 0.000000f );
|
||||
// States -> vf_line_on (id: 10) vf_line_of (id: 11)
|
||||
instance.registerEObj( "unknown_1", 2001506, 3653862, 4, { -9.239832f, 24.789940f, 35.778252f }, 0.991760f, 0.000048f );
|
||||
instance.registerEObj( "sgvf_w_lvd_b0094", 2001507, 4035750, 4, { -2.841087f, 23.114571f, 38.090420f }, 0.991760f, 0.000048f );
|
||||
|
@ -37,7 +62,7 @@ public:
|
|||
instance.registerEObj( "Bluecoralformation", 2000213, 3668215, 4, { 75.869797f, 35.101421f, -32.537209f }, 0.930753f, 0.000240f );
|
||||
instance.registerEObj( "Redcoralformation", 2000214, 3668214, 4, { 88.769371f, 31.135691f, -40.869640f }, 0.930753f, 0.000240f );
|
||||
instance.registerEObj( "Greencoralformation", 2000215, 3668216, 4, { 64.988159f, 33.672821f, -56.690559f }, 0.991789f, 0.000048f );
|
||||
instance.registerEObj( "Inconspicuousswitch", 2000216, 3653858, 5, { 62.907951f, 33.969521f, -31.172279f }, 1.000000f, -1.396264f );
|
||||
instance.registerEObj( "Inconspicuousswitch", 2000216, 3653858, 3, { 62.907951f, 33.969521f, -31.172279f }, 1.000000f, -1.396264f );
|
||||
instance.registerEObj( "Hiddendoor", 2000217, 3653517, 4, { 59.000000f, 32.000000f, -35.000000f }, 1.000000f, -2.007129f );
|
||||
instance.registerEObj( "Giantclam", 2000222, 4208408, 4, { 181.170303f, 32.104599f, -128.069000f }, 0.991789f, -0.862350f );
|
||||
// States -> vf_kai_off (id: 4) vf_kai_on (id: 5) vf_kai_pop (id: 6) close_open (id: 7) open_close (id: 8)
|
||||
|
@ -51,9 +76,6 @@ public:
|
|||
// States -> vf_kai_off (id: 4) vf_kai_on (id: 5) vf_kai_pop (id: 6) close_open (id: 7) open_close (id: 8)
|
||||
instance.registerEObj( "sgbg_s1d1_p1_shel1_4", 2000264, 4208413, 4, { 97.055313f, 27.081551f, -70.264381f }, 0.991789f, -0.618915f );
|
||||
// States -> vf_kai_off (id: 4) vf_kai_on (id: 5) vf_kai_pop (id: 6) close_open (id: 7) open_close (id: 8)
|
||||
instance.registerEObj( "Bloodymemo", 2000212, 0, 4, { 320.812988f, 47.862450f, -130.776306f }, 0.600000f, -0.898762f );
|
||||
instance.registerEObj( "Bloodymemo_1", 2001548, 0, 4, { 320.812988f, 47.862450f, -130.776306f }, 0.600000f, -0.898762f );
|
||||
instance.registerEObj( "Bloodymemo_2", 2001549, 0, 4, { 320.812988f, 47.862450f, -130.776306f }, 0.600000f, -0.898762f );
|
||||
instance.registerEObj( "Rambadedoor", 2000225, 3653865, 4, { -35.299999f, 24.000000f, 60.799999f }, 1.000000f, -2.007129f );
|
||||
instance.registerEObj( "Captainsquarters", 2000227, 3687697, 4, { -95.044670f, 20.513069f, 172.039597f }, 0.991789f, 0.000048f );
|
||||
instance.registerEObj( "WaveriderGate", 2000231, 3655909, 4, { -130.600006f, 16.000000f, 156.800003f }, 1.000000f, -2.007129f );
|
||||
|
@ -78,23 +100,29 @@ public:
|
|||
|
||||
void onTalk( InstanceContent& instance, Entity::Player& player, Entity::EventObject& eobj, uint32_t eventId ) override
|
||||
{
|
||||
if( eobj.getName() == "Bloodymemo" )
|
||||
{
|
||||
eventMgr().playScene( player, eventId, 1, HIDE_HOTBAR, { 1 } );
|
||||
}
|
||||
|
||||
if( eobj.getName() == "Bluecoralformation" || eobj.getName() == "Redcoralformation" || eobj.getName() == "Greencoralformation" )
|
||||
{
|
||||
eventMgr().eventActionStart( player, getId(), 15,
|
||||
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional )
|
||||
{
|
||||
eobj.setState( 1 );
|
||||
coralCount += 1;
|
||||
|
||||
if( coralCount == 3 )
|
||||
if( eobj.getObjectId() == coral )
|
||||
{
|
||||
// TODO: summon boss, do this after boss is defeated
|
||||
instance.getEObjByName( "Inconspicuousswitch" )->setState( 0 );
|
||||
instance.setVar( 0, 1 );
|
||||
Logger::debug( "correct coral!" );
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: spawn adds
|
||||
Logger::debug( "wrong coral!" );
|
||||
}
|
||||
},
|
||||
nullptr, getId() );
|
||||
|
|
Loading…
Add table
Reference in a new issue