mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-01 08:27:46 +00:00
remove scripts for battle;
This commit is contained in:
parent
d18ee7871e
commit
03d46ff2b8
7 changed files with 8 additions and 149 deletions
|
@ -46,7 +46,7 @@ foreach(_scriptDir ${children})
|
|||
MODULE
|
||||
${SCRIPT_BUILD_FILES}
|
||||
"${SCRIPT_INCLUDE_FILES}"
|
||||
"${_scriptDir}/ScriptLoader.cpp" "arena/IfritNormal.cpp")
|
||||
"${_scriptDir}/ScriptLoader.cpp" )
|
||||
|
||||
target_link_libraries( "script_${_name}" world )
|
||||
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
#include <ScriptObject.h>
|
||||
#include <Territory/InstanceContent.h>
|
||||
#include <Actor/GameObject.h>
|
||||
#include <Actor/BNpc.h>
|
||||
|
||||
using namespace Sapphire;
|
||||
|
||||
class IfritNormal : public Sapphire::ScriptAPI::InstanceArenaScript
|
||||
{
|
||||
public:
|
||||
IfritNormal() : Sapphire::ScriptAPI::InstanceArenaScript( 20001 )
|
||||
{ }
|
||||
|
||||
void onInit( InstanceContent& instance ) override
|
||||
{
|
||||
auto boss = instance.createBNpcFromLayoutId( 4126276, 13884, Common::BNpcType::Enemy );
|
||||
boss->setFlag( Entity::NoDeaggro );
|
||||
|
||||
//instance.sendForward();
|
||||
}
|
||||
|
||||
void onUpdate( InstanceContent& instance, uint64_t tickCount ) override
|
||||
{
|
||||
auto boss = instance.getActiveBNpcByLayoutId( 4126276 );
|
||||
|
||||
if( boss; boss->hateListGetHighestValue() != 0 )
|
||||
{
|
||||
if( instance.getDirectorVar( 0 ) == 0 )
|
||||
onBattleStart( instance );
|
||||
|
||||
boss->setRot( boss->getRot() + 0.5f );
|
||||
boss->setPos( boss->getPos() );
|
||||
|
||||
boss->sendPositionUpdate();
|
||||
|
||||
playerMgr().sendDebug( *boss->hateListGetHighest()->getAsPlayer(), std::to_string( boss->getRot() ) );
|
||||
|
||||
if( boss->getRot() >= 4.f && instance.getDirectorVar( 0 ) == 1 )
|
||||
{
|
||||
instance.setDirectorVar( 0, 0 );
|
||||
boss->hateListGetHighest()->die();
|
||||
boss->hateListClear();
|
||||
onReset( instance );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void onReset( InstanceContent& instance ) override
|
||||
{
|
||||
auto boss = instance.getActiveBNpcByLayoutId( 4126276 );
|
||||
instance.removeActor( boss );
|
||||
|
||||
onInit( instance );
|
||||
}
|
||||
|
||||
void onBattleStart( InstanceContent& instance ) override
|
||||
{
|
||||
auto boss = instance.getActiveBNpcByLayoutId( 4126276 );
|
||||
|
||||
instance.setDirectorVar( 0, 1 );
|
||||
|
||||
auto pPlayer = boss->hateListGetHighest()->getAsPlayer();
|
||||
|
||||
instance.sendEventLogMessage( *pPlayer, instance, 4847, { 0, 0 } );
|
||||
instance.sendEventLogMessage( *pPlayer, instance, 170, { 0, boss->getId() } );
|
||||
}
|
||||
};
|
||||
|
||||
EXPOSE_SCRIPT( IfritNormal );
|
|
@ -9,24 +9,26 @@ file( GLOB SERVER_SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
|||
Action/*.cpp
|
||||
ContentFinder/*.cpp
|
||||
DebugCommand/*.cpp
|
||||
Encounter/*.cpp
|
||||
Encounter/InstanceContent/*.cpp
|
||||
Event/*.cpp
|
||||
FreeCompany/*.cpp
|
||||
Inventory/*.cpp
|
||||
Linkshell/*.cpp
|
||||
Manager/*.cpp
|
||||
Math/*.cpp
|
||||
Navi/*.cpp
|
||||
Network/*.cpp
|
||||
Network/Util/*.cpp
|
||||
Network/Handlers/*.cpp
|
||||
Network/PacketWrappers/*.cpp
|
||||
Quest/*.cpp
|
||||
Script/*.cpp
|
||||
StatusEffect/*.cpp
|
||||
Task/*.cpp
|
||||
Territory/*.cpp
|
||||
Territory/Housing/*.cpp
|
||||
Util/*.cpp
|
||||
Navi/*.cpp
|
||||
Task/*.cpp
|
||||
Quest/*.cpp )
|
||||
Util/*.cpp )
|
||||
|
||||
add_executable( world ${SERVER_SOURCE_FILES} )
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ TYPE_FORWARD( ItemContainer );
|
|||
TYPE_FORWARD( Land );
|
||||
TYPE_FORWARD( Linkshell );
|
||||
TYPE_FORWARD( FreeCompany );
|
||||
TYPE_FORWARD( EncounterFight );
|
||||
|
||||
namespace World
|
||||
{
|
||||
|
|
|
@ -290,28 +290,5 @@ namespace Sapphire::ScriptAPI
|
|||
uint16_t param1, uint16_t param2 )
|
||||
{
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
InstanceArenaScript::InstanceArenaScript( uint32_t instanceContentId ) : ScriptObject( uint32_t{ 0x8003 } << 16 | instanceContentId, typeid( InstanceArenaScript ).hash_code() )
|
||||
{
|
||||
}
|
||||
|
||||
void InstanceArenaScript::onInit( InstanceContent& instance )
|
||||
{
|
||||
}
|
||||
|
||||
void InstanceArenaScript::onUpdate( InstanceContent& instance, uint64_t tickCount )
|
||||
{
|
||||
}
|
||||
|
||||
void InstanceArenaScript::onReset( InstanceContent& instance )
|
||||
{
|
||||
}
|
||||
|
||||
void InstanceArenaScript::onBattleStart( InstanceContent& instance )
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -405,49 +405,6 @@ namespace Sapphire::ScriptAPI
|
|||
return Common::Service< World::Manager::PlayerMgr >::ref();
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
* @brief The base class for any scripts that implement behaviour related to a generic arena
|
||||
*/
|
||||
class ArenaScript : public ScriptObject
|
||||
{
|
||||
public:
|
||||
explicit ArenaScript( uint32_t battleId );
|
||||
|
||||
virtual void onInit( Sapphire::Territory& instance );
|
||||
|
||||
virtual void onUpdate( Sapphire::Territory& instance, uint64_t tickCount );
|
||||
|
||||
virtual void onReset( Sapphire::Territory& instance );
|
||||
|
||||
World::Manager::PlayerMgr& playerMgr()
|
||||
{
|
||||
return Common::Service< World::Manager::PlayerMgr >::ref();
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
* @brief The base class for any scripts that implement behaviour related to an instance arena
|
||||
*/
|
||||
class InstanceArenaScript : public ScriptObject
|
||||
{
|
||||
public:
|
||||
explicit InstanceArenaScript( uint32_t instanceContentId );
|
||||
|
||||
virtual void onInit( Sapphire::InstanceContent& instance );
|
||||
|
||||
virtual void onUpdate( Sapphire::InstanceContent& instance, uint64_t tickCount );
|
||||
|
||||
virtual void onReset( Sapphire::InstanceContent& instance );
|
||||
|
||||
virtual void onBattleStart( Sapphire::InstanceContent& instance );
|
||||
|
||||
World::Manager::PlayerMgr& playerMgr()
|
||||
{
|
||||
return Common::Service< World::Manager::PlayerMgr >::ref();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -690,10 +690,6 @@ bool Sapphire::Scripting::ScriptMgr::onInstanceInit( InstanceContent& instance )
|
|||
{
|
||||
script->onInit( instance );
|
||||
|
||||
auto arenaScript = m_nativeScriptMgr->getScript< Sapphire::ScriptAPI::InstanceArenaScript >( instance.getDirectorId() );
|
||||
if( arenaScript )
|
||||
arenaScript->onInit( instance );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -708,9 +704,6 @@ bool Sapphire::Scripting::ScriptMgr::onInstanceUpdate( InstanceContent& instance
|
|||
{
|
||||
script->onUpdate( instance, tickCount );
|
||||
|
||||
auto arenaScript = m_nativeScriptMgr->getScript< Sapphire::ScriptAPI::InstanceArenaScript >( instance.getDirectorId() );
|
||||
if( arenaScript )
|
||||
arenaScript->onUpdate( instance, tickCount );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue